mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-31 01:47:15 +03:00
namespace: temporaily reset umask when creating private /tmp
This commit is contained in:
parent
fc8af9ff3f
commit
21d279cf54
@ -253,11 +253,19 @@ int setup_namespace(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (need_private) {
|
if (need_private) {
|
||||||
|
mode_t u;
|
||||||
|
|
||||||
memcpy(private_dir, tmp_dir, sizeof(tmp_dir)-1);
|
memcpy(private_dir, tmp_dir, sizeof(tmp_dir)-1);
|
||||||
|
|
||||||
|
u = umask(0000);
|
||||||
if (mkdir(private_dir, 0777 + S_ISVTX) < 0) {
|
if (mkdir(private_dir, 0777 + S_ISVTX) < 0) {
|
||||||
|
umask(u);
|
||||||
|
|
||||||
r = -errno;
|
r = -errno;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
umask(u);
|
||||||
remove_private = true;
|
remove_private = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user