Hi, sorry, it's really unclear what you are trying to do, because of the shelling out and all that. Also note that you do not check to see that your open call succeeded.
Maybe this will help?
$ perl -MUnix::Passwd::File -MData::Dumper -Mstrict -wE 'say Dumper Un +ix::Passwd::File::get_user(user => "root")'
$VAR1 = [ 200, 'OK', { 'gecos' => 'System Administrator', 'home' => '/var/root', 'uid' => '0', 'pass' => '*', 'gid' => '0', 'user' => 'root', 'shell' => '/bin/sh' } ];
... or maybe:
$ perl -MPath::Tiny -Mstrict -wE 'print for grep {/root/} path("/etc/p +asswd")->lines'
root:*:0:0:System Administrator:/var/root:/bin/sh daemon:*:1:1:System Services:/var/root:/usr/bin/false _cvmsroot:*:212:212:CVMS Root:/var/empty:/usr/bin/false
Hope this helps!
In reply to Re: Leaking a file descriptor into a child to use with /proc/self/fd/3
by 1nickt
in thread Leaking a file descriptor into a child to use with /proc/self/fd/3
by ewheeler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |