Merge pull request #48 from avar/master
Make it possible to start daemons as root/root by setting user/group to root/root
This commit is contained in:
commit
5612b30ea4
2 changed files with 6 additions and 2 deletions
4
Changes
4
Changes
|
@ -1,3 +1,7 @@
|
||||||
|
* Due to checking for true values instead of define it was
|
||||||
|
possible to start a daemon as root by setting uid/gid to 0/0,
|
||||||
|
but not user/group to root/root, which would resolve to 0/0 and
|
||||||
|
be considered an invalid user, which it's not.
|
||||||
* Fix an encoding error in the POD resulting from Ævar Arnfjörð
|
* Fix an encoding error in the POD resulting from Ævar Arnfjörð
|
||||||
Bjarmason contributing to the project.
|
Bjarmason contributing to the project.
|
||||||
* Tests that invoke Perl now use $^X instead of the $PATH's perl.
|
* Tests that invoke Perl now use $^X instead of the $PATH's perl.
|
||||||
|
|
|
@ -94,7 +94,7 @@ sub _set_uid_from_name {
|
||||||
my ( $self, $name ) = @_;
|
my ( $self, $name ) = @_;
|
||||||
my $uid = getpwnam( $name );
|
my $uid = getpwnam( $name );
|
||||||
die "Error: Couldn't get uid for non-existent user " . $self->user
|
die "Error: Couldn't get uid for non-existent user " . $self->user
|
||||||
unless $uid;
|
unless defined $uid;
|
||||||
$self->trace( "Set UID => $uid" );
|
$self->trace( "Set UID => $uid" );
|
||||||
$self->uid( $uid );
|
$self->uid( $uid );
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ sub _set_gid_from_name {
|
||||||
my ( $self, $name ) = @_;
|
my ( $self, $name ) = @_;
|
||||||
my $gid = getgrnam( $name );
|
my $gid = getgrnam( $name );
|
||||||
die "Error: Couldn't get gid for non-existent group " . $self->group
|
die "Error: Couldn't get gid for non-existent group " . $self->group
|
||||||
unless $gid;
|
unless defined $gid;
|
||||||
$self->trace( "Set GID => $gid" );
|
$self->trace( "Set GID => $gid" );
|
||||||
$self->gid( $gid );
|
$self->gid( $gid );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue