php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16051 posix bug
Submitted: 2002-03-13 17:06 UTC Modified: 2002-03-13 21:48 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: mvergoz at sysdoor dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.1.2 OS: FreeBSD
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mvergoz at sysdoor dot com
New email:
PHP Version: OS:

 

 [2002-03-13 17:06 UTC] mvergoz at sysdoor dot com
there is a problem in the file ext/posix/posix.c in function posix_uname, if i read the documentation about this function i can get some informations of the utsname struct. Well under linux you can use a machine domain name, (not yet implemented in FreeBSD). well the 'domainname' are not implemented on php but it's writed on the docs :

/* {{{ proto array posix_uname(void)
   Get system name (POSIX.1, 4.4.1) */
PHP_FUNCTION(posix_uname)
{
        struct utsname u;

        uname(&u);

        if (array_init(return_value) == FAILURE) {
                RETURN_FALSE;
        }
        add_assoc_string(return_value, "sysname",  u.sysname,  1);
        add_assoc_string(return_value, "nodename", u.nodename, 1);
        add_assoc_string(return_value, "release",  u.release, 1);
        add_assoc_string(return_value, "version",  u.version, 1);
        add_assoc_string(return_value, "machine",  u.machine, 1);
}
/* }}} */

i'v fix it :

/* {{{ proto array posix_uname(void)
   Get system name (POSIX.1, 4.4.1) */
PHP_FUNCTION(posix_uname)
{
        struct utsname u;

        uname(&u);

        if (array_init(return_value) == FAILURE) {
                RETURN_FALSE;
        }
        add_assoc_string(return_value, "sysname",  u.sysname,  1);
        add_assoc_string(return_value, "nodename", u.nodename, 1);
        add_assoc_string(return_value, "release",  u.release, 1);
        add_assoc_string(return_value, "version",  u.version, 1);
        add_assoc_string(return_value, "machine",  u.machine, 1);
#ifdef __USE_GNU
        add_assoc_string(return_value, "domainname", u.domainname, 1);
#endif
}
/* }}} */

if you don't want to correct it, please delete the wrong information in the documentations.

Regards,
Vergoz Michael
SYSDOOR

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-13 21:48 UTC] mfischer@php.net
Has been fixes in CVS already and will be in 4.2.0
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Sep 12 00:01:27 2024 UTC