Skip to content

Commit b8215c0

Browse files
committed
Fixed #72974 imap is undefined service on AIX
1 parent 4700745 commit b8215c0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ PHP NEWS
2626
. Fixed bug #69442 (closing of fd incorrect when PTS enabled). (jaytaph)
2727
. Fixed bug #47021 (SoapClient stumbles over WSDL delivered with
2828
"Transfer-Encoding: chunked"). (Rowan Collins)
29+
. Fixed bug #72974 (imap is undefined service on AIX). (matthieu.sarter)
2930

3031
- ZIP:
3132
. Fixed bug #70103 (ZipArchive::addGlob ignores remove_all_path option). (cmb,

ext/standard/basic_functions.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5551,6 +5551,15 @@ PHP_FUNCTION(getservbyname)
55515551

55525552
serv = getservbyname(name, proto);
55535553

5554+
#if defined(_AIX)
5555+
/*
5556+
On AIX, imap is only known as imap2 in /etc/services, while on Linux imap is an alias for imap2.
5557+
If a request for imap gives no result, we try again with imap2.
5558+
*/
5559+
if (serv == NULL && strcmp(name, "imap") == 0) {
5560+
serv = getservbyname("imap2", proto);
5561+
}
5562+
#endif
55545563
if (serv == NULL) {
55555564
RETURN_FALSE;
55565565
}

0 commit comments

Comments
 (0)