|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16879 posix_getpwuid() fails incorrectly
Submitted: 2002-04-27 14:54 UTC Modified: 2002-07-07 19:51 UTC
From: solo at n-w-t dot net Assigned:
Status: Not a bug Package: POSIX related
PHP Version: 4.0CVS-2002-04-27 OS: RedHat Linux 2.2.5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: solo at n-w-t dot net
New email:
PHP Version: OS:


 [2002-04-27 14:54 UTC] solo at n-w-t dot net
I am not sure that this is a bug, but for some reason, when attempting to get the file owner of a file getpwuid() fails (used in this context):

$uid = fileowner($path);
$owner = posix_getpwuid($uid);

Fileowner() returns either 0 or 1028, and getpwuid fails. The 0 of course false would mean the file doesnt exist, but using the same variable ($path) in other functions such as fileperms() etc do not fail and return the proper data. 

$path = "/home/";
$uid = fileowner($path);
$owner = posix_getpwuid($uid);
$owner_name = $owner['name'];

I have tried the same situation with valid filenames (instead of directories).

all extensions are enabled and configure line is:
'./configure' '--target=i386-redhat-linux' '--prefix=/usr' '--with-config-file-path=/etc' '--disable-debug' '--enable-pic' '--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs' '--disable-static' '--with-exec-dir=/usr/bin' '--with-regex=system' '--with-gettext' '--with-gd' '--with-jpeg-dir=/usr' '--with-png' '--with-zlib' '--with-db2' '--with-db3' '--with-gdbm' '--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-yp' '--enable-ftp' '--without-mysql' '--with-xml'

(as phpinfo() says it is)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-02 05:48 UTC]
Works fine for moe. Can you try a snapshot from ?
 [2002-07-07 19:51 UTC]
Thank you for taking the time to report a problem with PHP.
Unfortunately your are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 08:01:30 2024 UTC