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="systemd-logind" name="dbus-1" dev="tmpfs" ino=5548194 scontext=system_u:system_r:systemd_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 systemd-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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-10-14 12:43:06 +02:00
parent 4e93d369b9
commit 7cd0f0f844

View file

@ -541,7 +541,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
@ -552,7 +552,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;
}