[sudo-workers] [PATCH] regexp support added to command line arguments

Cyrille Lefevre cyrille.lefevre-lists at laposte.net
Wed Mar 23 19:28:39 MDT 2016


Hi,

Le 23/03/2016 21:15, Todd C. Miller a écrit :
> I'm going to have to think about this a bit.  The main thing holding
> up regex support was the lack of a good way to specify separate
> regexes for the command and the args.  Only supporting them in the
> arguments is more straightforward to implement but could be a little
> confusing.

well, I already did that in some program, but w/ a mixed pattern/regexp 
syntax...

something like :

input re	output re
.		\.
?		[^/]
*		[^/]*
\?		?
\*		*
\.		.

from my memory, every else character as himself.

this may apply only for the command spec ans not the args spec.

> Rather than support extended regular expressions now and add
> perl-compatible regular expressions later I think it would be better
> for sudo to just include a copy of pcre to use if the system doesn't
> have it already.  This is similar to how zlib support is done.
> Also, using pcre makes it easier to specify modifiers inside the
> regex itself for things like case-insensitive matching.

well too, pcre2 is a little big, but why not if you prefer.

other than that, what do you think about te implementation and the 
proposed syntax ?

ie. : ERE:[subset of global modifiers] prefix to command arg...
by subset, I mean not PCRE2_MULTILINE for example or the sudo syntax has 
to be modifier for multiline input w/o \ in string, am I wrong ?

PS : I like the pcre2posix interface :) no need to modify the current 
implementation, just link as is w/ eventual global modifiers...
http://pcre.org/current/doc/html/pcre2posix.html
however, I suppose the pcre2 interface is more powerfull ?!

Regards,

Cyrille Lefevre
-- 
mailto:Cyrille.Lefevre-lists at laposte.net



More information about the sudo-workers mailing list