php.net |  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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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. 

Situation:
$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)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-02 05:48 UTC] sander@php.net
Works fine for moe. Can you try a snapshot from http://snaps.php.net ?
 [2002-07-07 19:51 UTC] sniper@php.net
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 http://www.php.net/downloads.php

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: Sat Dec 21 13:01:31 2024 UTC