Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LemonLDAP NG
lemonldap-ng
Commits
da87299b
Commit
da87299b
authored
Jul 15, 2021
by
Alex Kelly
Browse files
Added --user and --group to override apache:apache for lmConfigEditor
parent
fe6ad903
Changes
1
Hide whitespace changes
Inline
Side-by-side
lemonldap-ng-manager/scripts/lmConfigEditor
View file @
da87299b
...
...
@@ -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
";
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment