From 99c04b5e75066a902e777e1a92fef9f84bef6d33 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Mon, 20 Jul 2026 15:07:29 -0300 Subject: [PATCH 1/7] EPERM string on AIX is "Not owner" --- ext/standard/tests/file/open_basedir_cwd_resolve.phpt | 2 +- ext/standard/tests/streams/glob-wrapper.phpt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/tests/file/open_basedir_cwd_resolve.phpt b/ext/standard/tests/file/open_basedir_cwd_resolve.phpt index 074a015e1c14..37e783c46abb 100644 --- a/ext/standard/tests/file/open_basedir_cwd_resolve.phpt +++ b/ext/standard/tests/file/open_basedir_cwd_resolve.phpt @@ -11,5 +11,5 @@ var_dump(file_get_contents('/some/path/outside/open/basedir')); --EXPECTF-- Warning: file_get_contents(): open_basedir restriction in effect. File(/some/path/outside/open/basedir) is not within the allowed path(s): (%s) in %s on line %d -Warning: file_get_contents(): Failed to open stream: %r(Operation not permitted|Insufficient privileges)%r in %s on line %d +Warning: file_get_contents(): Failed to open stream: %r(Operation not permitted|Insufficient privileges|Not owner)%r in %s on line %d bool(false) diff --git a/ext/standard/tests/streams/glob-wrapper.phpt b/ext/standard/tests/streams/glob-wrapper.phpt index 6f5519c60be7..c9da9cc5ef25 100644 --- a/ext/standard/tests/streams/glob-wrapper.phpt +++ b/ext/standard/tests/streams/glob-wrapper.phpt @@ -27,7 +27,7 @@ foreach ( [ __DIR__, "glob://".__DIR__ ] as $spec) { Warning: opendir(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (/does_not_exist) in %s%eglob-wrapper.php on line 5 -Warning: opendir(): Failed to open directory: %r(Operation not permitted|Insufficient privileges)%r in %s%eglob-wrapper.php on line 5 +Warning: opendir(): Failed to open directory: %r(Operation not permitted|Insufficient privileges|Not owner)%r in %s%eglob-wrapper.php on line 5 Failed to open %s ** Opening glob://%s No files in glob://%s From aca7a5b03910a114ef5216d5eadd2bf7544739eb Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Mon, 20 Jul 2026 15:09:45 -0300 Subject: [PATCH 2/7] Hack to workaround silly locale -a issue on IBM i locale -a returns some bogus locales that segfault if you load them. Skip them in this test. --- ext/standard/tests/strings/setlocale_variation2.phpt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt index c6d44c4a54c2..5e1ea0f26108 100644 --- a/ext/standard/tests/strings/setlocale_variation2.phpt +++ b/ext/standard/tests/strings/setlocale_variation2.phpt @@ -55,6 +55,12 @@ echo "-- Test setlocale() with all available locale in the system --\n"; // gather all locales installed in the system(stored $all_system_locales), // try n set each locale using setlocale() and keep track failures, if any foreach($all_system_locales as $value){ + if (PHP_OS == 'OS400' && str_ends_with($value, ".o")) { + // HACK: At least PASE returns locales in "locale -a" that segfault if + // loaded; skip them. Bump success count since it's expected at end. + $success_count++; + continue; + } //set locale to $value, if success, count increments if(setlocale(LC_ALL,$value )){ $success_count++; From a57ff887f2326447f73c31cabe948e75004cf925 Mon Sep 17 00:00:00 2001 From: Calvin Buckley Date: Mon, 20 Jul 2026 15:27:04 -0300 Subject: [PATCH 3/7] Can't remove cwd on IBM i either I don't have an AIX system to test this with, but I suspect this is also true for AIX, since Solaris has the same limitation and System V heritage as well. --- ext/standard/tests/file/realpath_bug77484.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/tests/file/realpath_bug77484.phpt b/ext/standard/tests/file/realpath_bug77484.phpt index 0b78a2aad26f..cbc298d27885 100644 --- a/ext/standard/tests/file/realpath_bug77484.phpt +++ b/ext/standard/tests/file/realpath_bug77484.phpt @@ -2,8 +2,8 @@ Bug #77484 Zend engine crashes when calling realpath in invalid working dir --SKIPIF-- Date: Mon, 20 Jul 2026 16:10:06 -0300 Subject: [PATCH 4/7] AIX also has different niceness levels While it can use BSD-style niceness, it defaults to System V style niceness, like how Solaris is. Documented in https://www.ibm.com/docs/en/aix/7.2.0?topic=g-getpriority-setpriority-nice-subroutine --- ext/standard/tests/general_functions/proc_nice_basic.phpt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/standard/tests/general_functions/proc_nice_basic.phpt b/ext/standard/tests/general_functions/proc_nice_basic.phpt index 107f6d186514..c1568071e5f0 100644 --- a/ext/standard/tests/general_functions/proc_nice_basic.phpt +++ b/ext/standard/tests/general_functions/proc_nice_basic.phpt @@ -9,7 +9,9 @@ Simone Gentili (sensorario@gmail.com) Date: Mon, 20 Jul 2026 16:11:36 -0300 Subject: [PATCH 5/7] IBM i requires special authorities to set niceness at all For the other proc_nice test, we skip on AIX family stuff, so it wouldn't matter there. --- .../tests/general_functions/proc_nice_variation2.phpt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/standard/tests/general_functions/proc_nice_variation2.phpt b/ext/standard/tests/general_functions/proc_nice_variation2.phpt index f1f93be221ef..c173b1751339 100644 --- a/ext/standard/tests/general_functions/proc_nice_variation2.phpt +++ b/ext/standard/tests/general_functions/proc_nice_variation2.phpt @@ -8,6 +8,10 @@ Simone Gentili (sensorario@gmail.com) --SKIPIF-- --FILE-- Date: Mon, 20 Jul 2026 16:13:39 -0300 Subject: [PATCH 6/7] Also skip on AIX without /etc/services IBM i doesn't have it here. I suspect this test could probably be rewritten to not use it, but let's keep the logic the same for now. --- ext/standard/tests/general_functions/getservbyport_basic.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/tests/general_functions/getservbyport_basic.phpt b/ext/standard/tests/general_functions/getservbyport_basic.phpt index 817d4fd3ca2c..df5e37cb9f2d 100644 --- a/ext/standard/tests/general_functions/getservbyport_basic.phpt +++ b/ext/standard/tests/general_functions/getservbyport_basic.phpt @@ -7,7 +7,7 @@ Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) --SKIPIF-- Date: Mon, 20 Jul 2026 16:17:16 -0300 Subject: [PATCH 7/7] IBM i lacks "imap" in its services DB Which doesn't seem to be in /etc/services, but another, funnier location. We could also just skip imap here. I have not skipped on AIX family, since I'm unsure if AIX is also missing imap from this list as well. It seems plausible if Solaris is also missing it. --- ext/standard/tests/general_functions/getservbyname_basic.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/tests/general_functions/getservbyname_basic.phpt b/ext/standard/tests/general_functions/getservbyname_basic.phpt index db08f8e0c3da..75c17246669c 100644 --- a/ext/standard/tests/general_functions/getservbyname_basic.phpt +++ b/ext/standard/tests/general_functions/getservbyname_basic.phpt @@ -10,8 +10,8 @@ Simone Gentili (sensorario@gmail.com) if(in_array(PHP_OS_FAMILY, ['BSD', 'Darwin', 'Solaris', 'Linux'])){ if (!file_exists("/etc/services")) die("skip reason: missing /etc/services"); } -if (PHP_OS_FAMILY === 'Solaris') { - die("skip Solaris has incomplete /etc/services"); +if (PHP_OS_FAMILY === 'Solaris' || PHP_OS == 'OS400') { + die("skip Solaris and IBM i have incomplete /etc/services"); } if (getenv('SKIP_MSAN')) die('skip msan missing interceptor for getservbyname()'); ?>