From: antoine <antoine@nagafix.co.uk>
To: Eric Paris <eparis@parisplace.org>
Cc: SELinux <selinux@tycho.nsa.gov>
Subject: Re: error building file_contexts
Date: Tue, 13 Sep 2005 22:44:58 +0100 [thread overview]
Message-ID: <1126647898.3769.19.camel@localhost> (raw)
In-Reply-To: <1126623363.6074.7.camel@localhost.localdomain>
> The way I found the bug in the rpc_pipefs context when I wrote that
> regex ugliness in genhomedircon was by just adding a
>
> sys.stderr.write("%s\n" % regex)
> sys.stderr.flush()
>
> Right after the
>
> for regex in prefix_regex:
> (around line 190 of genhomedircon for me)
I tried that (also dumped the 'potential' string) and got some output,
but I can't see anything wrong with it:
(...)
-/home/rsyslog
-/emul/lib(64)?/*$
-/home/rsyslog
-/emul/lib(64)?/.*\.so(\.[^/]*)*/*$
-/home/rsyslog
-/emul/lib(64)?/ld-[^/]*\.so(\.[^/]*)*/*$
-/home/rsyslog
-/usr/sbin/amavisd(.*)?/*$
-/home/rsyslog
Traceback (most recent call last):
File "/usr/sbin/genhomedircon", line 475, in ?
oldgenhomedircon(cmds[0], cmds[1])
File "/usr/sbin/genhomedircon", line 190, in oldgenhomedircon
if re.search(regex, potential, 0):
File "/usr/lib/python2.3/sre.py", line 137, in search
return _compile(pattern, flags).search(string)
File "/usr/lib/python2.3/sre.py", line 230, in _compile
raise error, v # invalid expression
sre_constants.error: nothing to repeat
make: *** [file_contexts/file_contexts] Error 1
Any ideas?
Thanks
Antoine
For reference, here is the updated code snippet:
(...)
for potential in potential_prefixes.keys():
addme = 1
for regex in prefix_regex:
#match a trailing (/*)? which is actually a bug
in rpc_pipefs
regex = re.sub("\(/\*\)\?$", "", regex)
#match a trailing .+
regex = re.sub("\.+$", "", regex)
#match a trailing .*
regex = re.sub("\.\*$", "", regex)
#strip a (/.*)? which matches anything trailing
to a /*$ which matches trailing /'s
regex = re.sub("\(\/\.\*\)\?", "", regex)
regex = regex + "/*$"
sys.stderr.write("-%s\n" % regex)
sys.stderr.write("-%s\n" % potential)
sys.stderr.flush()
if re.search(regex, potential, 0):
addme = 0
if addme == 1:
if not prefixes.has_key(potential):
prefixes[potential] = ""
(...)
--
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 prev parent reply other threads:[~2005-09-13 21:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-12 22:18 error building file_contexts antoine
2005-09-13 13:17 ` Stephen Smalley
2005-09-13 13:28 ` Antoine Martin
2005-09-13 14:00 ` Stephen Smalley
2005-09-13 14:07 ` Antoine Martin
2005-09-13 14:18 ` Stephen Smalley
[not found] ` <1126623363.6074.7.camel@localhost.localdomain>
2005-09-13 21:44 ` antoine [this message]
2005-09-13 22:07 ` Eric Paris
2005-09-14 12:30 ` Daniel J Walsh
2005-09-16 20:32 ` Antoine Martin
2005-09-13 13:48 ` Christopher J. PeBenito
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=1126647898.3769.19.camel@localhost \
--to=antoine@nagafix.co.uk \
--cc=eparis@parisplace.org \
--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.