diff options
| author | Pierre Joye <pajoye@php.net> | 2008-03-05 21:09:29 +0000 |
|---|---|---|
| committer | Pierre Joye <pajoye@php.net> | 2008-03-05 21:09:29 +0000 |
| commit | 77fee69a7e0063ceddaf20e99da2e1b6d2ba0758 (patch) | |
| tree | 1aedde13793a32f47edb666cc78e259f9a93863a | |
| parent | 38b94446a41c6d3e9e7cbf0b241cfdae75de1d13 (diff) | |
| download | php-git-77fee69a7e0063ceddaf20e99da2e1b6d2ba0758.tar.gz | |
- #40013, php_uname() does not return nodename on Netware (Guenter Knauf)
| -rw-r--r-- | NEWS | 2 | ||||
| -rw-r--r-- | ext/standard/info.c | 25 |
2 files changed, 27 insertions, 0 deletions
@@ -10,6 +10,8 @@ PHP NEWS (Ilia) - Fixed bug #42505 (new sendmail default breaks on Netware platform) (Guenter Knauf) +- Fixed bug #40013 (php_uname() does not return nodename on Netware + (Guenter Knauf) 27 Feb 2008, PHP 5.2.6RC1 - Fixed security issue detailed in CVE-2008-0599. (Rasmus) diff --git a/ext/standard/info.c b/ext/standard/info.c index cf182d8a1c..0c3118a78b 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -326,6 +326,30 @@ PHPAPI char *php_get_uname(char mode) if (uname((struct utsname *)&buf) == -1) { php_uname = PHP_UNAME; } else { +#ifdef NETWARE + if (mode == 's') { + php_uname = buf.sysname; + } else if (mode == 'r') { + snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d.%d", + buf.netware_major, buf.netware_minor, buf.netware_revision); + php_uname = tmp_uname; + } else if (mode == 'n') { + php_uname = buf.servername; + } else if (mode == 'v') { + snprintf(tmp_uname, sizeof(tmp_uname), "libc-%d.%d.%d #%d", + buf.libmajor, buf.libminor, buf.librevision, buf.libthreshold); + php_uname = tmp_uname; + } else if (mode == 'm') { + php_uname = buf.machine; + } else { /* assume mode == 'a' */ + snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d.%d libc-%d.%d.%d #%d %s", + buf.sysname, buf.servername, + buf.netware_major, buf.netware_minor, buf.netware_revision, + buf.libmajor, buf.libminor, buf.librevision, buf.libthreshold, + buf.machine); + php_uname = tmp_uname; + } +#else if (mode == 's') { php_uname = buf.sysname; } else if (mode == 'r') { @@ -342,6 +366,7 @@ PHPAPI char *php_get_uname(char mode) buf.machine); php_uname = tmp_uname; } +#endif /* NETWARE */ } #else php_uname = PHP_UNAME; |
