Bug#797395: [maintainer-script-should-not-use-adduser-system-without-home] false positivies
Hi,
Axel Beckert wrote:
> > >'adduser --home /var/lib/saned --quiet --system --no-create-home --group saned
> > >|| true'
> >
> > Lintian uses this regexp (see
> > data/scripts/maintainer-script-bad-command):
> >
> > (adduser(?:\s.*)?\s--system(?=\s)(?!.*\s--home\s+(?:["']?/(?!home/)|"?\$[\(\[\{]?)).*)
> >
> > The regexp made my head hurt,
>
> Huh?
Uses neat features, namely negative look-ahead patterns, even nested!
Cool! :-)
> Will work on a fix for that.
I've just pushed the fix. The regexp is now surely uglier and less
readable than before. So I wonder what we could do to improve the
situation inside data/scripts/maintainer-script-bad-command:
What would help is some if-line-matches-this-then-check-that kind of
check which is at least difficult to do within a single regexp. I see
currently multiple ways to fix that:
* Add another column to data/scripts/maintainer-script-bad-command
being a pre-match regexp, so that the ultimate regexp is only tested
if the line or command matches the pre-regexp.
* Change the parsing of data/scripts/maintainer-script-bad-command so
that not the tag but the regexp is the key column which would allow
to add more than one line with the same tag to the file. (Currently
the last column with some tag is used and all previous ones are
discarded.
Any preferences/comments/other options?
Regards, Axel
--
,''`. | Axel Beckert <abe@debian.org>, http://people.debian.org/~abe/
: :' : | Debian Developer, ftp.ch.debian.org Admin
`. `' | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5
`- | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE
Reply to: