diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-04-28 17:24:34 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-05-07 22:44:10 +0200 |
commit | 993da6d4616b56b7ef82c95f1b65494cdcf10c5c (patch) | |
tree | 2d27a306be16b8045aae38f17bce5f7fb31a00b0 /src/nspawn | |
parent | dissect-image: add support for optionally mounting images with idmapping on (diff) | |
download | systemd-993da6d4616b56b7ef82c95f1b65494cdcf10c5c.tar.xz systemd-993da6d4616b56b7ef82c95f1b65494cdcf10c5c.zip |
nspawn: drop an unnecessary local variable
Diffstat (limited to '')
-rw-r--r-- | src/nspawn/nspawn.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index d69b95598e..72886a070b 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -3044,7 +3044,6 @@ static int chase_symlinks_and_update(char **p, unsigned flags) { } static int determine_uid_shift(const char *directory) { - int r; if (arg_userns_mode == USER_NAMESPACE_NO) { arg_uid_shift = 0; @@ -3054,8 +3053,9 @@ static int determine_uid_shift(const char *directory) { if (arg_uid_shift == UID_INVALID) { struct stat st; - r = stat(directory, &st); - if (r < 0) + /* Read the UID shift off the image. Maybe we can reuse this to avoid chowning. */ + + if (stat(directory, &st) < 0) return log_error_errno(errno, "Failed to determine UID base of %s: %m", directory); arg_uid_shift = st.st_uid & UINT32_C(0xffff0000); |