com php-src: Fixed #72974 imap is undefined service on AIX: NEWS ext/standard/basic_functions.c

From: Date: Mon, 09 Jan 2017 05:15:21 +0000
Subject: com php-src: Fixed #72974 imap is undefined service on AIX: NEWS ext/standard/basic_functions.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-96635@lists.php.net to get a copy of this message
Commit: b8215c08171412fec3dc560161a1d18498418379 Author: Joe Watkins <krakjoe@php.net> Mon, 9 Jan 2017 05:13:46 +0000 Parents: 47007455dc777aee13c5de9c6751c85c957a5172 Branches: PHP-7.0 PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b8215c08171412fec3dc560161a1d18498418379 Log: Fixed #72974 imap is undefined service on AIX Bugs: https://bugs.php.net/72974 Changed paths: M NEWS M ext/standard/basic_functions.c Diff: diff --git a/NEWS b/NEWS index 005ad09..224ed83 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ PHP NEWS . Fixed bug #69442 (closing of fd incorrect when PTS enabled). (jaytaph) . Fixed bug #47021 (SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chunked"). (Rowan Collins) + . Fixed bug #72974 (imap is undefined service on AIX). (matthieu.sarter) - ZIP: . Fixed bug #70103 (ZipArchive::addGlob ignores remove_all_path option). (cmb, diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 132d340..eeb3031 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5551,6 +5551,15 @@ PHP_FUNCTION(getservbyname) serv = getservbyname(name, proto); +#if defined(_AIX) + /* + On AIX, imap is only known as imap2 in /etc/services, while on Linux imap is an alias for imap2. + If a request for imap gives no result, we try again with imap2. + */ + if (serv == NULL && strcmp(name, "imap") == 0) { + serv = getservbyname("imap2", proto); + } +#endif if (serv == NULL) { RETURN_FALSE; }

« previous php.cvs (#96635) next »