mirror of
https://github.com/systemd/systemd.git
synced 2024-11-27 12:13:33 +08:00
execute: use empty_to_root() a bit more
This commit is contained in:
parent
74e1252072
commit
14eb3285ab
@ -9,3 +9,8 @@ expression s;
|
||||
@@
|
||||
- (empty_or_root(s) ? "/" : s)
|
||||
+ empty_to_root(s)
|
||||
@@
|
||||
expression s;
|
||||
@@
|
||||
- (s ? s : "/")
|
||||
+ empty_to_root(s)
|
||||
|
@ -3245,10 +3245,8 @@ static int apply_working_directory(
|
||||
|
||||
wd = home;
|
||||
|
||||
} else if (context->working_directory)
|
||||
wd = context->working_directory;
|
||||
else
|
||||
wd = "/";
|
||||
} else
|
||||
wd = empty_to_root(context->working_directory);
|
||||
|
||||
if (params->flags & EXEC_APPLY_CHROOT)
|
||||
d = wd;
|
||||
@ -5171,8 +5169,8 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) {
|
||||
"%sProtectProc: %s\n"
|
||||
"%sProcSubset: %s\n",
|
||||
prefix, c->umask,
|
||||
prefix, c->working_directory ? c->working_directory : "/",
|
||||
prefix, c->root_directory ? c->root_directory : "/",
|
||||
prefix, empty_to_root(c->working_directory),
|
||||
prefix, empty_to_root(c->root_directory),
|
||||
prefix, yes_no(c->non_blocking),
|
||||
prefix, yes_no(c->private_tmp),
|
||||
prefix, yes_no(c->private_devices),
|
||||
|
Loading…
Reference in New Issue
Block a user