File: drop.pl

package info (click to toggle)
libprivileges-drop-perl 1.03-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 128 kB
  • sloc: perl: 63; makefile: 7
file content (16 lines) | stat: -rwxr-xr-x 328 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env perl 
use strict;
use warnings;

use Privileges::Drop;

my $user = shift or "die ./drop.pl user";

system("id");
my ($uid, $gid) = drop_privileges($user) or die "Could not drop privileges";
print "Current UID is $uid, GID is $gid\n";
system("id");
if(-f "/proc/$$/status") {
    system("cat /proc/$$/status");
}