File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 11--TEST--
2- Test posix_getpwnam() function : basic functionality
2+ Test posix_getpwnam() function : basic functionality
33--CREDITS--
44Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
55User Group: PHPSP #phptestfestbrasil
66--SKIPIF--
7- <?php
8- if (!extension_loaded ('posix ' )) die ('skip - POSIX extension not loaded ' );
7+ <?php
8+ if (!extension_loaded ('posix ' )) die ('skip - POSIX extension not loaded ' );
99?>
1010--FILE--
11- <?php
11+ <?php
1212 $ uid = posix_geteuid ();
1313 $ user = posix_getpwuid ($ uid );
14- print_r (posix_getpwnam ($ user ['name ' ]));
14+ $ username = $ user ['name ' ];
15+ if (posix_getlogin () == false ) {
16+ $ username = false ;
17+ }
18+ $ info = posix_getpwnam ($ username );
19+ print_r ($ info );
20+ var_dump ($ username == $ info ['name ' ]);
1521?>
1622===DONE====
1723--EXPECTREGEX--
2531 \[dir\] => [^\r\n]+
2632 \[shell\] => [^\r\n]+
2733\)
34+ bool\(true\)
2835===DONE====
You can’t perform that action at this time.
0 commit comments