in reply to Leaking a file descriptor into a child to use with /proc/self/fd/3
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Leaking a file descriptor into a child to use with /proc/self/fd/3
by ewheeler (Novice) on Feb 26, 2020 at 23:47 UTC |