summaryrefslogtreecommitdiff
path: root/src/nspawn
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-11 23:00:57 +0100
committerLennart Poettering <lennart@poettering.net>2017-12-11 23:19:45 +0100
commitfba868fa710a216adade59c2683d8bee20c7da4b (patch)
treee1c3422a86bed7298c97ba2d9f1f4eb67bf2541a /src/nspawn
parent4fe2ba0e2598e70a102fee85d4832ec3d20b5097 (diff)
downloadsystemd-fba868fa710a216adade59c2683d8bee20c7da4b.tar.gz
tree-wide: unify logging of "Must be root" message
Let's unify this in one call, generalizing must_be_root() from bootctl.c.
Diffstat (limited to 'src/nspawn')
-rw-r--r--src/nspawn/nspawn.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index f217def92d..51663e28dc 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -3783,11 +3783,10 @@ int main(int argc, char *argv[]) {
if (r <= 0)
goto finish;
- if (geteuid() != 0) {
- log_error("Need to be root.");
- r = -EPERM;
+ r = must_be_root();
+ if (r < 0)
goto finish;
- }
+
r = determine_names();
if (r < 0)
goto finish;