All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: SE Linux <selinux@tycho.nsa.gov>
Subject: libsemanage patch
Date: Wed, 15 Jul 2009 10:36:27 -0400	[thread overview]
Message-ID: <4A5DE96B.7080400@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 296 bytes --]

If you have a homedir that ends in '/', genhomedircon gets confused.

# useradd -h /home2/dwalsh/ dwalsh
# genhomedircon

Check out the labeling.  genhomedircon thinks dwalsh is a toplevel home root.  

We should just get rid of this command...  :^)

Patch removes all trailing '/' from homedir.

[-- Attachment #2: libsemanage-rhat.patch --]
[-- Type: text/plain, Size: 597 bytes --]

diff --exclude-from=exclude -N -u -r nsalibsemanage/src/genhomedircon.c libsemanage-2.0.33/src/genhomedircon.c
--- nsalibsemanage/src/genhomedircon.c	2008-08-28 09:34:24.000000000 -0400
+++ libsemanage-2.0.33/src/genhomedircon.c	2009-07-15 10:32:20.000000000 -0400
@@ -304,6 +304,10 @@
 			continue;
 		if (!semanage_list_find(shells, pwbuf->pw_shell))
 			continue;
+		int len = strlen(pwbuf->pw_dir) -1;
+		for(; len > 0 && pwbuf->pw_dir[len]=='/'; len--) {
+			pwbuf->pw_dir[len]=0;
+		}
 		if (strcmp(pwbuf->pw_dir, "/") == 0)
 			continue;
 		if (semanage_str_count(pwbuf->pw_dir, '/') <= 1)

             reply	other threads:[~2009-07-15 14:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-15 14:36 Daniel J Walsh [this message]
2009-08-11 21:22 ` libsemanage patch Chad Sellers
2009-09-04 13:56 ` Joshua Brindle
2009-09-07 10:44   ` Daniel J Walsh
2009-09-08 16:04     ` Chad Sellers
2009-09-16 15:22       ` Joshua Brindle
2009-09-16 15:55         ` Joshua Brindle
2009-09-16 17:27         ` Daniel J Walsh
2009-09-16 21:12           ` Joshua Brindle
  -- strict thread matches above, loose matches on Subject: below --
2007-12-03 19:31 Daniel J Walsh
2007-12-03 19:51 ` Todd Miller
2007-12-03 19:53   ` Stephen Smalley
2007-12-03 20:03     ` Todd Miller
2007-12-03 20:08       ` Daniel J Walsh
2007-12-03 20:49     ` Daniel J Walsh
2007-12-05 17:48       ` Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A5DE96B.7080400@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.