From: Steve Grubb <sgrubb@redhat.com>
To: SE Linux <selinux@tycho.nsa.gov>
Subject: rpmlint
Date: Fri, 3 Nov 2006 08:16:22 -0500 [thread overview]
Message-ID: <200611030816.22148.sgrubb@redhat.com> (raw)
Hi,
Below is a patch that I am thinking about submitting to rpmlint. The main idea
of this patch is to catch places where people might be coding policy knowledge
into scripts. Chcon would require knowing some types in order to work. If the
types ever got changed, the script would break. Can anyone think of other
things we do not want to see in rpm scriplets?
-Steve
diff -ur rpmlint-0.78.orig/PostCheck.py rpmlint-0.78/PostCheck.py
--- rpmlint-0.78.orig/PostCheck.py 2006-11-01 11:13:04.000000000 -0500
+++ rpmlint-0.78/PostCheck.py 2006-11-01 12:26:49.000000000 -0500
@@ -38,6 +38,7 @@
bracket_regex=re.compile('^[^#]*if.*[^ :\]]\]', re.MULTILINE)
home_regex=re.compile('[^a-zA-Z]+~/|\${?HOME(\W|$)', re.MULTILINE)
dangerous_command_regex=re.compile("(^|[;\|`]|&&|$\()\s*(?:\S*/s?bin/)?(cp|mv|ln|tar|rpm|chmod|chown|rm|cpio|install|perl|userdel|groupdel)\s", re.MULTILINE)
+selinux_regex=re.compile("(^|[;\|`]|&&|$\()\s*(?:\S*/s?bin/)?(chcon|runcon)\s", re.MULTILINE)
single_command_regex=re.compile("^[ \n]*([^ \n]+)[ \n]*$")
update_menu_regex=re.compile('update-menus', re.MULTILINE)
tmp_regex=re.compile('\s(/var)?/tmp', re.MULTILINE)
@@ -139,6 +140,10 @@
res=dangerous_command_regex.search(script)
if res:
printWarning(pkg, 'dangerous-command-in-' + tag[2], res.group(2))
+ res=selinux_regex.search(script)
+ if res:
+ printError(pkg, 'selinux-forbidden-command-in-' + tag[2], res.group(2))
+
if update_menu_regex.search(script):
menu_error=1
for f in files:
--
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.
next reply other threads:[~2006-11-03 14:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-03 13:16 Steve Grubb [this message]
2006-11-05 22:32 ` rpmlint Joshua Brindle
2006-11-06 16:03 ` rpmlint Karl MacMillan
2006-11-06 16:25 ` rpmlint Joshua Brindle
2006-11-06 16:37 ` rpmlint Karl MacMillan
2006-11-06 18:13 ` rpmlint Joshua Brindle
2006-11-06 18:28 ` rpmlint Karl MacMillan
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=200611030816.22148.sgrubb@redhat.com \
--to=sgrubb@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.