Re: [PATCH] regexp support added to command line arguments

Cyrille Lefevre <[email protected]>
Newsgroups gmane.comp.tools.sudo.devel
Organization ACME
Message-ID <[email protected]>
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:[email protected]

____________________________________________________________
sudo-workers mailing list <[email protected]>
For list information, options, or to unsubscribe, visit:
https://www.sudo.ws/mailman/listinfo/sudo-workers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.