core: introduce unit_verify_contexts
Refuse WorkingDirectory=~ both in that and exec_invoke() when dynamic user is used.
This commit is contained in:
@@ -3600,6 +3600,9 @@ static int acquire_home(const ExecContext *c, const char **home, char **ret_buf)
|
||||
if (!c->working_directory_home)
|
||||
return 0;
|
||||
|
||||
if (c->dynamic_user)
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
r = get_home_dir(ret_buf);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user