php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72986 File handling inconsistency between AIX and Linux
Submitted: 2016-08-31 07:55 UTC Modified: 2017-01-22 04:22 UTC
From: matthieu dot sarter dot external at atos dot net Assigned:
Status: No Feedback Package: *Directory/Filesystem functions
PHP Version: 7.0.10 OS: AIX
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-08-31 07:55 UTC] matthieu dot sarter dot external at atos dot net
Description:
------------
AIX and Linux behaves differently when using file functions with regular filenames containing an excedentary trailing slash.

Linux raises an error in this case, as expected in the Open Group specifications, while AIX ignores the trailing slash.

To ensure consistent behaviour on the two OS, I suggest to add a check for excendentary trailing slash when accessing a regular file on AIX, and to raise the same error as on Linux. This is implemented in the attached patch (tested with PHP 7.0.3, 7.0.7, 7.0.9 and 7.0.10 on AIX 6.1).

If consistency is not a priority, some tests under ext/standard/tests/file will need to be skipped on AIX (or better, the trailing slash tests should be grouped in a single phpt file, skipped on AIX, so that the other file related tests won't be skipped) : filegroup_variation3.phpt, fileinode_variation3.phpt, fileowner_variation3.phpt, fileperms_variation3.phpt and ext/standard/tests/file/rename_variation.phpt


Patches

php-7.0.3-aix-trailing-slash.patch (last revision 2016-08-31 07:55 UTC by matthieu dot sarter dot external at atos dot net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-09 05:28 UTC] krakjoe@php.net
-Status: Open +Status: Feedback
 [2017-01-09 05:28 UTC] krakjoe@php.net
I think it will be better to skip the appropriate tests, since I have no AIX testing environment, please could you provide the patches to tests.
 [2017-01-22 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Sep 16 19:03:38 2021 UTC