summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-07-03 13:04:58 -0400
committerDaniel Mack <github@zonque.org>2015-07-03 13:04:58 -0400
commit42ec2c20eacaab3c6f244d3c7784a5908f64d07a (patch)
tree9f0956256f6fbd7c76b08bb4f7855c988cdc4a58 /src
parented3fd0493160522b5878ef261bcee6f2d7d37ba5 (diff)
parent391567f479f56c2ae7c2beb9eb5305f5c02f5d82 (diff)
Merge pull request #478 from systemd/revert-429-nspawn-userns-uid-shift-autodetection-fix
Revert "nspawn: determine_uid_shift before forking"
Diffstat (limited to 'src')
-rw-r--r--src/nspawn/nspawn.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 7fa098bea8..df341a6e74 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -4313,6 +4313,10 @@ static int outer_child(
if (r < 0)
return r;
+ r = determine_uid_shift(directory);
+ if (r < 0)
+ return r;
+
/* Turn directory into bind mount */
if (mount(directory, directory, NULL, MS_BIND|MS_REC, NULL) < 0)
return log_error_errno(errno, "Failed to make bind mount: %m");
@@ -4491,10 +4495,6 @@ int main(int argc, char *argv[]) {
if (r < 0)
goto finish;
- r = determine_uid_shift(arg_directory);
- if (r < 0)
- return r;
-
if (geteuid() != 0) {
log_error("Need to be root.");
r = -EPERM;