From: Russell Coker <russell@coker.com.au>
To: SE Linux <selinux@tycho.nsa.gov>
Cc: fedora-selinux-list@redhat.com
Subject: genhomedircon
Date: Mon, 19 Jul 2004 23:02:42 +1000 [thread overview]
Message-ID: <200407192302.42130.russell@coker.com.au> (raw)
[-- Attachment #1: Type: text/plain, Size: 700 bytes --]
The attached patch fixes a bug in genhomedircon.
Without this if you create system users with "useradd -r" and give them home
directories in unusual locations (such as /usr/DIR or /var/run/DIR) then a
file_contexts file will be generated that will mess up your system.
This match makes it check /etc/login.defs for the value of UID_MIN.
Also perhaps we should make STARTING_UID default to 500. 500 is the default
value for this in Fedora.
--
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/ Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/ My home page
[-- Attachment #2: diff --]
[-- Type: text/x-diff, Size: 593 bytes --]
--- genhomedircon 2004-07-19 22:29:23.851864480 +1000
+++ /usr/sbin/genhomedircon 2004-07-19 22:47:01.984003944 +1000
@@ -25,7 +25,6 @@
import commands, sys, os, pwd, string
EXCLUDE_LOGINS=["/sbin/nologin", "/bin/false"]
-STARTING_UID=100
def getPrefixes():
ulist = pwd.getpwall()
@@ -92,6 +91,12 @@
print len(sys.argv)
usage("Incorrect parameters")
+ rc=commands.getstatusoutput("grep -h '^UID_MIN' /etc/login.defs | sed -e 's/^UID_MIN[^0-9]*//'")
+ if rc[0] == 0:
+ STARTING_UID=rc[1]
+ else:
+ STARTING_UID=100
+
FILECONTEXTDIR=sys.argv[1]
prefixes = getPrefixes()
next reply other threads:[~2004-07-19 13:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-19 13:02 Russell Coker [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-05-19 10:28 genhomedircon Russell Coker
2006-05-19 14:09 ` genhomedircon Christopher J. PeBenito
2004-08-20 11:52 genhomedircon Russell Coker
2004-06-16 6:08 genhomedircon Russell Coker
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=200407192302.42130.russell@coker.com.au \
--to=russell@coker.com.au \
--cc=fedora-selinux-list@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.