core: introduce unit_verify_contexts

Refuse WorkingDirectory=~ both in that and exec_invoke()
when dynamic user is used.
This commit is contained in:
Mike Yuan
2024-05-26 13:41:43 +08:00
parent 4dd884af1b
commit 52d8ba71b6
3 changed files with 25 additions and 2 deletions
+3
View File
@@ -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;