diff options
Diffstat (limited to 'saxrobot')
-rwxr-xr-x | saxrobot | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -2,6 +2,7 @@ use strict; use warnings; +use POSIX qw(setuid setgid); use POE; use POE::Kernel; use POE::Component::IRC; @@ -33,8 +34,15 @@ POE::Session->create( heap => { irc => $irc }, ); +drop_priv(); + $poe_kernel->run(); +sub drop_priv { + setgid($config{gid}) or die "Failed to setgid: $!\n"; + setuid($config{uid}) or die "Failed to setuid: $!\n"; +} + sub _start { my $heap = $_[HEAP]; my $irc = $heap->{irc}; |