From dc2335669afddc767eea2757f8d7dfc7a8f927fa Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 22 Jan 2018 21:11:04 +0100 Subject: [PATCH] tmpfiles: fix check for figuring out whether to call chmod() No need to call chown() if everything matches already. --- src/tmpfiles/tmpfiles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index c11a649..d733768 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -817,8 +817,8 @@ static int path_set_perms(Item *i, const char *path) { } } - if ((i->uid != st.st_uid || i->gid != st.st_gid) && - (i->uid_set || i->gid_set)) { + if ((i->uid_set && i->uid != st.st_uid) || + (i->gid_set && i->gid != st.st_gid)) { log_debug("Changing \"%s\" to owner "UID_FMT":"GID_FMT, path, i->uid_set ? i->uid : UID_INVALID, -- 2.7.4