|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
33 + 32 = ?
Subscribe to this entry?

 [2016-08-31 07:55 UTC] matthieu dot sarter dot external at atos dot net
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


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


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-09 05:28 UTC]
-Status: Open +Status: Feedback
 [2017-01-09 05:28 UTC]
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: Tue Oct 26 01:03:34 2021 UTC