Maytham Alsudany pushed to branch master at lintian / lintian


Commits:
69a6c7b0 by Maytham Alsudany at 2025-03-20T00:22:34+00:00
Allow for "=" in --home option when checking 
maintainer-script-lacks-home-in-adduser

Previously, lintian wrongfully emitted the tag for the following:

adduser --system --home=/var/lib/myuser myuser

This fixes the issue by making a minor adjustment to the regex allowing
for "=" in the --home option, and adds a corresponding test.

Closes: #1055591

- - - - -


3 changed files:

- data/scripts/maintainer-script-bad-command
- t/recipes/checks/scripts/scripts-maintainer-general/build-spec/debian/postinst
- t/recipes/checks/scripts/scripts-maintainer-general/eval/hints


Changes:

=====================================
data/scripts/maintainer-script-bad-command
=====================================
@@ -32,7 +32,7 @@ maintainer-script-hides-init-failure                          
  ~~ 0 ~~ 0 ~~
 maintainer-script-changes-ld-so-conf                            ~~ 0 ~~ 0 
~~^libc               ~~          
~~(?:\A\s*(?:cp|mv)\s+.*\s+|>\s*)/etc/ld\.so\.conf\s*(?:\s|\Z)
 maintainer-script-changes-netbase                               ~~ 0 ~~ 0 ~~   
                 ~~          
~~(?:\A\s*(?:cp|mv)\s+.*\s+|>\s*)(/etc/(?:services|protocols|rpc))\s*(?:\s|\Z)
 maintainer-script-should-not-parse-etc-passwd-or-group          ~~ 0 ~~ 0 ~~   
                 ~~          ~~\b([ef]?grep\b.*/etc/(?:passwd|group))\b
-maintainer-script-lacks-home-in-adduser                         ~~ 1 ~~ 0 ~~   
                 ~~          
~~(adduser\s(?:(?!.*(?<=\s)--home\s.*\s--system).*(?<=\s)--system(?=\s)(?!.*\s--home\s+(?:["]?/(?!home/)|["]?\$[\(\[\{]?))|--home\s+["]?/home/.*\s--system(?:\s|$)).*)
+maintainer-script-lacks-home-in-adduser                         ~~ 1 ~~ 0 ~~   
                 ~~          
~~(adduser\s(?:(?!.*(?<=\s)--home[\=\s].*\s--system).*(?<=\s)--system(?=\s)(?!.*\s--home[\=\s]\s*(?:["]?/(?!home/)|["]?\$[\(\[\{]?))|--home[\=\s]\s*["]?/home/.*\s--system(?:\s|$)).*)
 maintainer-script-calls-chown-improperly                        ~~ 0 ~~ 0 ~~   
                 ~~          
~~(chown(?:\s+--?[A-Za-z-]+)*\s+[-_A-Za-z0-9]+\.[-_A-Za-z0-9]+)\s+
 maintainer-script-should-not-use-dpkg-maintscript-helper        ~~ 1 ~~ 1 ~~   
                 ~~          ~~dpkg-maintscript-helper
 maintainer-script-updates-fontconfig-cache-improperly           ~~ 0 ~~ 0 
~~^(fontconfig)$      ~~          
~~${LEADING_PATTERN}(?:/usr/bin/)?fc-cache(?:\s|\Z)


=====================================
t/recipes/checks/scripts/scripts-maintainer-general/build-spec/debian/postinst
=====================================
@@ -147,9 +147,9 @@ rm /dev/.hiddenfile
 # adduser system
 adduser --system foo
 adduser --system foo2 --home /home/foo2
-adduser --system bar --home /var/lib/bar
+adduser --system bar --home=/var/lib/bar
 adduser --home /var/lib/fnord --system fnord
-adduser --home /home/fnord2 --system fnord2
+adduser --home=/home/fnord2 --system fnord2
 
 # other test case for gconftool
 /usr/bin/gconftool-2 --makefile-install-rule foo.schema


=====================================
t/recipes/checks/scripts/scripts-maintainer-general/eval/hints
=====================================
@@ -55,7 +55,7 @@ scripts-maintainer-general (binary): 
maintainer-script-lacks-home-in-adduser "ad
 scripts-maintainer-general (binary): maintainer-script-lacks-home-in-adduser 
"adduser --system foo2 --home /home/foo2" [postinst:149]
 scripts-maintainer-general (binary): maintainer-script-lacks-home-in-adduser 
"adduser --system foo" [postinst:148]
 scripts-maintainer-general (binary): maintainer-script-lacks-home-in-adduser 
"adduser --system --quiet --ingroup ntp --no-create-home ntp" [postinst:199]
-scripts-maintainer-general (binary): maintainer-script-lacks-home-in-adduser 
"adduser --home /home/fnord2 --system fnord2" [postinst:152]
+scripts-maintainer-general (binary): maintainer-script-lacks-home-in-adduser 
"adduser --home=/home/fnord2 --system fnord2" [postinst:152]
 scripts-maintainer-general (binary): maintainer-script-interpreter /bin/sh 
[prerm]
 scripts-maintainer-general (binary): maintainer-script-interpreter /bin/sh 
[preinst]
 scripts-maintainer-general (binary): maintainer-script-interpreter /bin/sh 
[postrm]



View it on GitLab: 
https://salsa.debian.org/lintian/lintian/-/commit/69a6c7b0d1f0de9b14d38105974a4e155e7ddcb9

-- 
View it on GitLab: 
https://salsa.debian.org/lintian/lintian/-/commit/69a6c7b0d1f0de9b14d38105974a4e155e7ddcb9
You're receiving this email because of your account on salsa.debian.org.


Reply via email to