]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: allow two very close error messages to be distinguished
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 14 Oct 2017 10:43:06 +0000 (12:43 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 19 Oct 2017 06:49:01 +0000 (08:49 +0200)
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.

src/login/logind-user.c

index dcf367e22d1e4d21219617f536115b8d8aec37e5..d651a6f7463606fc7383312c04571d91313c5d57 100644 (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;
 }