Added --user and --group to override apache:apache for lmConfigEditor

userlogger-in-req
Alex Kelly 4 years ago
parent fe6ad903f1
commit da87299b1d
  1. 14
      lemonldap-ng-manager/scripts/lmConfigEditor

@ -10,13 +10,23 @@ use English qw(-no_match_vars);
use File::Temp;
use POSIX qw(setuid setgid);
use Safe;
use Getopt::Long;
use strict;
my $cli = Lemonldap::NG::Manager::Cli::Lib->new;
our $opt_user = '__APACHEUSER__';
our $opt_group = '__APACHEGROUP__';
GetOptions (
"user=s" => \$opt_user,
"group=s" => \$opt_group
)
or die("Error in command line arguments\n");
eval {
setgid( ( getgrnam('__APACHEGROUP__') )[2] );
setuid( ( getpwnam('__APACHEUSER__') )[2] );
setgid( ( getgrnam($opt_group) )[2] );
setuid( ( getpwnam($opt_user) )[2] );
print STDERR "Running as uid $EUID and gid $EGID\n";
};

Loading…
Cancel
Save