problems with PATTERN/LINE in ainsl(1)
Michael Tautschnig
mt at debian.org
Thu Oct 15 22:12:15 CEST 2009
> On 30.09.2009 09:02, Juergen Kahnert wrote:
> > Hi,
> >
> > On Wed, Sep 30, 2009 at 03:06:41AM +0200, Darshaka Pathirana wrote:
> >>>> ainsl -a $target/etc/sudoers "%adm ALL = NOPASSWD: /bin/su -[mp]"
> >> Any help greatly appreciated. Thanks!
> >
> > try this as a quick workaround:
> >
> > ainsl -a $target/etc/sudoers '%adm ALL = NOPASSWD: /bin/su -[mp]' '^%adm ALL = NOPASSWD: /bin/su -.mp.$'
>
> Thx very much. Figured that out a bit later (but was to lazy to post
> it here).
>
> Nevertheless the question is: is it a mistake on my side?
>
I don't think so, I think it's a weakness in ainsl. And the \[ \] probably
doesn't work either because the shell will strip off the \, you'll need
something like \\[ or even \\\[.
Thomas, shouldn't ainsl not escape anything while matching and instead use \Q
and \E in the match operation to disable regexp specials? Of course, it should
take care of ^ and $ and change that to ^\Q$line\E$.
Best,
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
Url : http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20091015/a1230b4f/attachment-0001.bin
More information about the linux-fai
mailing list