|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-12-16 03:20 UTC] jas at eecs dot yorku dot ca
Description:
------------
I think I've discovered an odd bug. When I use "posix_getgrnam" to print details on a group in /etc/group, I get back nothing. If I erase one entry from the group above it, then it works!
example silly /etc/group file:
root:x:0:
labtest:*:31003:a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo,pp,qq,rr,ss,tt,uu,vv,ww,xx,yy,zz,aaa,bbb,ccc,ddd,eee,fff,ggg,hhh,iii,jjj,kkk,lll,mmm,nnn,ooo,ppp,qqq,rrr,sss,ttt,uuu,vvv,www,xxx,yyy,zzz,aaaa,bbbb,cccc,dddd,eeee,ffff,gggg,hhhh,iiii,jjjj,kkkk
tech:*:1000:tdb
Without removing user "kkkk" from "labtest" group, posix_getgrnam can't return the details for group tech!
Test script:
---------------
<?php
print_r(posix_getgrnam("tech"));
?>
Expected result:
----------------
I expect to see the group details for group "tech".
Actual result:
--------------
empty.
Patchestry-again (last revision 2018-08-21 15:07 UTC by cmb@php.net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 10:00:01 2025 UTC |
The empty result is most likely FALSE; verify this by using var_dump() instead of print_r(). Also provide the return value of posix_get_last_error(), i.e. run the following script and post it's output: <?php var_dump(posix_getgrnam("tech")); var_dump(posix_get_last_error()); var_dump(posix_strerror(posix_get_last_error())); ?>