- Fix restorecond watching utmp file for people logging in our out

This commit is contained in:
Dan Walsh 2010-12-22 14:38:46 -05:00
parent b1a3235896
commit 18119ffd24
2 changed files with 18 additions and 5 deletions

View File

@ -1248,10 +1248,10 @@ index f182c22..feddb5a 100644
return changed;
diff --git a/policycoreutils/restorecond/watch.c b/policycoreutils/restorecond/watch.c
new file mode 100644
index 0000000..ab67a02
index 0000000..c0caab2
--- /dev/null
+++ b/policycoreutils/restorecond/watch.c
@@ -0,0 +1,260 @@
@@ -0,0 +1,270 @@
+#define _GNU_SOURCE
+#include <sys/inotify.h>
+#include <errno.h>
@ -1443,8 +1443,18 @@ index 0000000..ab67a02
+ if (event->wd == master_wd)
+ read_config(fd, watch_file);
+ else {
+ if (event->len)
+ watch_list_find(event->wd, event->name);
+ switch (utmpwatcher_handle(fd, event->wd)) {
+ case -1: /* Message was not for utmpwatcher */
+ if (event->len)
+ watch_list_find(event->wd, event->name);
+ break;
+ case 1: /* utmp has changed need to reload */
+ read_config(fd, watch_file);
+ break;
+
+ default: /* No users logged in or out */
+ break;
+ }
+ }
+
+ i += EVENT_SIZE + event->len;

View File

@ -7,7 +7,7 @@
Summary: SELinux policy core utilities
Name: policycoreutils
Version: 2.0.85
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2
Group: System Environment/Base
# Based on git repository with tag 20101221
@ -329,6 +329,9 @@ fi
exit 0
%changelog
* Wed Dec 22 2010 Dan Walsh <dwalsh@redhat.com> 2.0.85-2
- Fix restorecond watching utmp file for people logging in our out
* Tue Dec 21 2010 Dan Walsh <dwalsh@redhat.com> 2.0.85-1
- Update to upstream