set the home directory of www-data in lemonldap scripts (#3205)

merge-requests/694/merge
David Coutadeur 6 months ago
parent 7ed71e7147
commit cc9d17adbf
  1. 2
      lemonldap-ng-common/scripts/encryptTotpSecrets
  2. 2
      lemonldap-ng-common/scripts/lemonldap-ng-cli
  3. 2
      lemonldap-ng-common/scripts/lemonldap-ng-sessions
  4. 2
      lemonldap-ng-common/scripts/rotateOidcKeys
  5. 2
      lemonldap-ng-manager/scripts/lmConfigEditor

@ -24,6 +24,8 @@ GetOptions(
eval {
POSIX::setgid( scalar( getgrnam('www-data') ) );
POSIX::setuid( scalar( getpwnam('www-data') ) );
my (undef, undef, undef, undef, undef, undef, undef, $homedir, undef) = getpwnam('www-data');
$ENV{HOME} = $homedir if $homedir;
};
sub verbose {

@ -18,6 +18,8 @@ my $action;
eval {
POSIX::setgid( scalar( getgrnam($opt_group) ) );
POSIX::setuid( scalar( getpwnam($opt_user) ) );
my (undef, undef, undef, undef, undef, undef, undef, $homedir, undef) = getpwnam($opt_user);
$ENV{HOME} = $homedir if $homedir;
};
for ( my $i = 0 ; $i < @ARGV ; $i++ ) {

@ -42,6 +42,8 @@ eval {
no warnings;
POSIX::setgid( scalar( getgrnam($opt_group) ) );
POSIX::setuid( scalar( getpwnam($opt_user) ) );
my (undef, undef, undef, undef, undef, undef, undef, $homedir, undef) = getpwnam($opt_user);
$ENV{HOME} = $homedir if $homedir;
};
my $action = shift @ARGV;

@ -35,6 +35,8 @@ eval {
no warnings;
POSIX::setgid( scalar( getgrnam($opt_group) ) );
POSIX::setuid( scalar( getpwnam($opt_user) ) );
my (undef, undef, undef, undef, undef, undef, undef, $homedir, undef) = getpwnam($opt_user);
$ENV{HOME} = $homedir if $homedir;
};
my $debug = $opts->{debug};

@ -29,6 +29,8 @@ GetOptions(
eval {
setgid( ( getgrnam($opt_group) )[2] );
setuid( ( getpwnam($opt_user) )[2] );
my (undef, undef, undef, undef, undef, undef, undef, $homedir, undef) = getpwnam($opt_user);
$ENV{HOME} = $homedir if $homedir;
print STDERR "Running as uid $EUID and gid $EGID\n";
};

Loading…
Cancel
Save