projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
667c1ba
)
nspawn: reset umask early
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 28 May 2018 09:01:30 +0000
(11:01 +0200)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Mon, 28 May 2018 09:01:43 +0000
(11:01 +0200)
Fixes #8911.
src/nspawn/nspawn.c
patch
|
blob
|
history
diff --git
a/src/nspawn/nspawn.c
b/src/nspawn/nspawn.c
index
35bdd89
..
2548c98
100644
(file)
--- a/
src/nspawn/nspawn.c
+++ b/
src/nspawn/nspawn.c
@@
-2618,8
+2618,6
@@
static int inner_child(
return r;
kmsg_socket = safe_close(kmsg_socket);
- umask(0022);
-
if (setsid() < 0)
return log_error_errno(errno, "setsid() failed: %m");
@@
-4238,6
+4236,11
@@
int main(int argc, char *argv[]) {
}
}
+ /* The "default" umask. This is appropriate for most file and directory
+ * operations performed by nspawn, and is the umask that will be used for
+ * the child. Functions like copy_devnodes() change the umask temporarily. */
+ umask(0022);
+
if (arg_directory) {
assert(!arg_image);