Little secu: do not run as root

environments/ppa-mbqj77/deployments/1
Xavier Guimard 10 years ago
parent 1b2f5cd48b
commit a708cdaaca
  1. 8
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Cli.pm

@ -144,6 +144,14 @@ sub _setKey {
sub run {
my $self = shift;
if ( $> == 0 ) {
print STDERR
"$0 must not be launched as root since local cache can be corrupted\n"
. "Continue (y/N)? ";
my $res = <STDIN>;
exit 1 unless ( $res =~ /^y/i );
}
# Options simply call corresponding accessor
while ( $_[0] =~ s/^--?// ) {
my $k = shift;

Loading…
Cancel
Save