projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21b61b1
)
nspawn: drop an unnecessary local variable
author
Lennart Poettering
<lennart@poettering.net>
Wed, 28 Apr 2021 15:24:34 +0000
(17:24 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 7 May 2021 20:44:10 +0000
(22:44 +0200)
src/nspawn/nspawn.c
patch
|
blob
|
history
diff --git
a/src/nspawn/nspawn.c
b/src/nspawn/nspawn.c
index d69b95598eec0fc17cc0b10eaf7e6d00ec24fd36..72886a070b44895eb0929e024e455d693265252a 100644
(file)
--- 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);