All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug in restorecond for the first user logged in
@ 2010-08-12 19:51 Chris Adams
  2010-08-13 18:13 ` Daniel J Walsh
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Adams @ 2010-08-12 19:51 UTC (permalink / raw)
  To: SELinux

The first user that logs in will not be caught by restorecond.  The utmp
checking function only returns that there was a change when the previous
list of users was non-NULL.

Here's a patch that works for me (this is against the latest Red Hat
Enterprise Linux 5 policycoreutils release, but I checked the current
source tree and the same problem is present):

diff -urN policycoreutils-1.33.12-dist/restorecond/utmpwatcher.c policycoreutils-1.33.12/restorecond/utmpwatcher.c
--- policycoreutils-1.33.12-dist/restorecond/utmpwatcher.c	2007-01-11 13:01:39.000000000 -0600
+++ policycoreutils-1.33.12/restorecond/utmpwatcher.c	2010-08-12 14:13:24.000000000 -0500
@@ -69,10 +69,9 @@
 
 	utmp_wd =
 	    inotify_add_watch(inotify_fd, utmp_path, IN_MOVED_FROM | IN_MODIFY);
-	if (prev_utmp_ptr) {
-		changed = strings_list_diff(prev_utmp_ptr, utmp_ptr);
+	changed = strings_list_diff(prev_utmp_ptr, utmp_ptr);
+	if (prev_utmp_ptr)
 		strings_list_free(prev_utmp_ptr);
-	}
 	return changed;
 }
 

-- 
Chris Adams <cmadams@hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in restorecond for the first user logged in
  2010-08-12 19:51 Bug in restorecond for the first user logged in Chris Adams
@ 2010-08-13 18:13 ` Daniel J Walsh
  2010-08-13 18:16   ` Chris Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel J Walsh @ 2010-08-13 18:13 UTC (permalink / raw)
  To: Chris Adams; +Cc: SELinux

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/12/2010 03:51 PM, Chris Adams wrote:
> The first user that logs in will not be caught by restorecond.  The utmp
> checking function only returns that there was a change when the previous
> list of users was non-NULL.
> 
> Here's a patch that works for me (this is against the latest Red Hat
> Enterprise Linux 5 policycoreutils release, but I checked the current
> source tree and the same problem is present):
> 
> diff -urN policycoreutils-1.33.12-dist/restorecond/utmpwatcher.c policycoreutils-1.33.12/restorecond/utmpwatcher.c
> --- policycoreutils-1.33.12-dist/restorecond/utmpwatcher.c	2007-01-11 13:01:39.000000000 -0600
> +++ policycoreutils-1.33.12/restorecond/utmpwatcher.c	2010-08-12 14:13:24.000000000 -0500
> @@ -69,10 +69,9 @@
>  
>  	utmp_wd =
>  	    inotify_add_watch(inotify_fd, utmp_path, IN_MOVED_FROM | IN_MODIFY);
> -	if (prev_utmp_ptr) {
> -		changed = strings_list_diff(prev_utmp_ptr, utmp_ptr);
> +	changed = strings_list_diff(prev_utmp_ptr, utmp_ptr);
> +	if (prev_utmp_ptr)
>  		strings_list_free(prev_utmp_ptr);
> -	}
>  	return changed;
>  }
>  
> 
I updated in F14.  If you want to have this fixed in RHEL5 you need to
open a bugzilla.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkxlizYACgkQrlYvE4MpobPLxACglrkZAM8302n+7fDvCMc47nsU
9MsAoKMQytFrhxScF5RrP85NG6yx9AvI
=rL26
-----END PGP SIGNATURE-----

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in restorecond for the first user logged in
  2010-08-13 18:13 ` Daniel J Walsh
@ 2010-08-13 18:16   ` Chris Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Adams @ 2010-08-13 18:16 UTC (permalink / raw)
  To: Daniel J Walsh; +Cc: SELinux

Once upon a time, Daniel J Walsh <dwalsh@redhat.com> said:
> I updated in F14.  If you want to have this fixed in RHEL5 you need to
> open a bugzilla.

Did that first here:

https://bugzilla.redhat.com/show_bug.cgi?id=623708

-- 
Chris Adams <cmadams@hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-13 18:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-12 19:51 Bug in restorecond for the first user logged in Chris Adams
2010-08-13 18:13 ` Daniel J Walsh
2010-08-13 18:16   ` Chris Adams

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.