From: Zbigniew Jędrzejewski-Szmek Date: Sat, 14 Oct 2017 10:43:06 +0000 (+0200) Subject: logind: allow two very close error messages to be distinguished X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c265d0ce81b5c19708a4a8a6e3809d658d546a32;p=elogind.git logind: allow two very close error messages to be distinguished In https://bugzilla.redhat.com/show_bug.cgi?id=1486859 error messages appera: Sep 06 19:09:07 ld92.e.math.uh.edu audit[21482]: AVC avc: denied { read } for pid=21482 comm="elogind-logind" name="dbus-1" dev="tmpfs" ino=5548194 scontext=system_u:system_r:elogind_logind_t:s0 tcontext=unconfined_u:object_r:session_dbusd_tmp_t:s0 tclass=dir permissive=0 Sep 06 19:09:07 ld92.e.math.uh.edu elogind-logind[21482]: Failed to remove runtime directory /run/user/8664: Permission denied But it's not clear which of the two rm_rf's is the source. Let's make them different. --- diff --git a/src/login/logind-user.c b/src/login/logind-user.c index 7824a1c8e..00cb8bf3a 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -564,7 +564,7 @@ static int user_remove_runtime_path(User *u) { r = rm_rf(u->runtime_path, 0); if (r < 0) - log_error_errno(r, "Failed to remove runtime directory %s: %m", u->runtime_path); + log_error_errno(r, "Failed to remove runtime directory %s (before unmounting): %m", u->runtime_path); /* Ignore cases where the directory isn't mounted, as that's * quite possible, if we lacked the permissions to mount @@ -575,7 +575,7 @@ static int user_remove_runtime_path(User *u) { r = rm_rf(u->runtime_path, REMOVE_ROOT); if (r < 0) - log_error_errno(r, "Failed to remove runtime directory %s: %m", u->runtime_path); + log_error_errno(r, "Failed to remove runtime directory %s (after unmounting): %m", u->runtime_path); return r; }