Bug#458742: lintian: Please test for valid filenames for run-parts
tags 458742 +patch kthxbye Patch attached. Regards, -- Chris Lamb, UK [EMAIL PROTECTED] GPG: 0x634F9A20 Index: checks/files === --- checks/files(revision 1117) +++ checks/files(working copy) @@ -135,6 +135,10 @@ if ($file =~ m,^etc/nntpserver, ) { tag package-uses-obsolete-file, $file; } + # /etc/cron.daily, etc. + elsif ($file =~ m,^etc/cron\.(daily|hourly|monthly|weekly)/.*\., ) { + tag run-parts-cron-script-filename-contains-full-stop, $file; + } # /etc/cron.d elsif ($file =~ m,^etc/cron\.d/\S, and $operm != 0644) { tag bad-permissions-for-etc-cron.d-script, sprintf($file %04o != 0644,$operm); Index: checks/files.desc === --- checks/files.desc (revision 1117) +++ checks/files.desc (working copy) @@ -328,6 +328,11 @@ violation of policy. Ref: policy 10.5 +Tag: run-parts-cron-script-filename-contains-full-stop +Type: warning +Info: The script in /etc/cron.time-interval will not be executed by + run-parts(8) because the filename contains a . (full-stop). + Tag: bad-permissions-for-etc-cron.d-script Type: error Info: Files in tt/etc/cron.d/tt are configuration files for cron and not signature.asc Description: PGP signature
Bug#458742: lintian: Please test for valid filenames for run-parts
Chris Lamb [EMAIL PROTECTED] writes: Patch attached. Hi Chris, Thank you very much for the patches! What you're doing is very helpful, and I don't want you to stop! But if you have a bit of time in addition, it would save me time if you could also add a new test case for any patch that introduces a new tag. Every tag should have a test case (and if there's something inobvious about when the tag shouldn't trigger, that should also be tested). For this tag, I think we also want to exclude files named .placeholder (maybe any files starting with .) so that we don't get false positives from the cron packages themselves. -- Russ Allbery ([EMAIL PROTECTED]) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#458742: lintian: Please test for valid filenames for run-parts
Chris Lamb [EMAIL PROTECTED] writes: Russ Allbery wrote: it would save me time if you could also add a new test case for any patch that introduces a new tag. Revised patch with testcases attached. For this tag, I think we also want to exclude files named .placeholder (maybe any files starting with .) so that we don't get false positives from the cron packages themselves. Agreed; the latter suggestion is reflected in the new patch. Thanks! This looks great; I'll apply this for the next release. -- Russ Allbery ([EMAIL PROTECTED]) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#458742: lintian: Please test for valid filenames for run-parts
Russ Allbery wrote: it would save me time if you could also add a new test case for any patch that introduces a new tag. Revised patch with testcases attached. For this tag, I think we also want to exclude files named .placeholder (maybe any files starting with .) so that we don't get false positives from the cron packages themselves. Agreed; the latter suggestion is reflected in the new patch. Regards, -- Chris Lamb, UK [EMAIL PROTECTED] GPG: 0x634F9A20 Index: checks/files === --- checks/files(revision 1117) +++ checks/files(working copy) @@ -135,6 +135,10 @@ if ($file =~ m,^etc/nntpserver, ) { tag package-uses-obsolete-file, $file; } + # /etc/cron.daily, etc. + elsif ($file =~ m,^etc/cron\.(daily|hourly|monthly|weekly)/[^\.].*\., ) { + tag run-parts-cron-script-filename-contains-full-stop, $file; + } # /etc/cron.d elsif ($file =~ m,^etc/cron\.d/\S, and $operm != 0644) { tag bad-permissions-for-etc-cron.d-script, sprintf($file %04o != 0644,$operm); Index: checks/files.desc === --- checks/files.desc (revision 1117) +++ checks/files.desc (working copy) @@ -328,6 +328,11 @@ violation of policy. Ref: policy 10.5 +Tag: run-parts-cron-script-filename-contains-full-stop +Type: warning +Info: The script in /etc/cron.time-interval will not be executed by + run-parts(8) because the filename contains a . (full-stop). + Tag: bad-permissions-for-etc-cron.d-script Type: error Info: Files in tt/etc/cron.d/tt are configuration files for cron and not Index: testset/etcfiles/debian/conffiles === --- testset/etcfiles/debian/conffiles (revision 1117) +++ testset/etcfiles/debian/conffiles (working copy) @@ -1,2 +1,5 @@ /etc/proper /var/lib/foo +/etc/cron.daily/cronfile-normal +/etc/cron.daily/.cronfile-begins-with-fullstop +/etc/cron.daily/cronfile-contains.fullstop Index: testset/etcfiles/debian/rules === --- testset/etcfiles/debian/rules (revision 1117) +++ testset/etcfiles/debian/rules (working copy) @@ -11,6 +11,10 @@ install -d $(tmp)/etc install -m 644 proper $(tmp)/etc install -m 644 improper $(tmp)/etc + mkdir $(tmp)/etc/cron.daily + touch $(tmp)/etc/cron.daily/cronfile-normal + touch $(tmp)/etc/cron.daily/.cronfile-begins-with-fullstop + touch $(tmp)/etc/cron.daily/cronfile-contains.fullstop ln $(tmp)/etc/improper $(tmp)/etc/improper-link install -d $(tmp)/usr/share/doc/etcfiles install -d $(tmp)/var/lib @@ -21,6 +25,12 @@ install -d $(tmp)/DEBIAN install -m 644 debian/conffiles $(tmp)/DEBIAN + echo '68b329da9893e34099c7d8ad5cb9c940 ./etc/cron.daily/cronfile-normal' \ +debian/tmp/DEBIAN/md5sums + echo '68b329da9893e34099c7d8ad5cb9c940 ./etc/cron.daily/.cronfile-begins-with-fullstop' \ +debian/tmp/DEBIAN/md5sums + echo '68b329da9893e34099c7d8ad5cb9c940 ./etc/cron.daily/cronfile-contains.fullstop' \ +debian/tmp/DEBIAN/md5sums echo 'ab371382468880299e5ebd05921764ce ./etc/proper' \ debian/tmp/DEBIAN/md5sums echo 'ab371382468880299e5ebd05921764ce etc/improper' \ Index: testset/tags.etcfiles === --- testset/tags.etcfiles (revision 1117) +++ testset/tags.etcfiles (working copy) @@ -12,3 +12,4 @@ W: etcfiles: file-missing-in-md5sums usr/share/doc/etcfiles/changelog W: etcfiles: non-etc-file-marked-as-conffile /var/lib/foo W: etcfiles: package-contains-hardlink etc/improper - etc/improper-link +W: etcfiles: run-parts-cron-script-filename-contains-full-stop etc/cron.daily/cronfile-contains.fullstop signature.asc Description: PGP signature
Bug#458742: lintian: Please test for valid filenames for run-parts
Package: lintian Version: 1.23.41 Severity: wishlist In tomcat5.5 we have the problem that a script in /etc/cron.daily is not executed because the script name contained a .. Then run-parts ignores that file. It would be nice if lintian could check this dir (and others) for sich files and give a warning/error. Cheers, Michael -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.22-3-vserver-amd64 (SMP w/4 CPU cores) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages lintian depends on: ii binutils2.18.1~cvs20071027-2 The GNU assembler, linker and bina ii diffstat1.45-2 produces graph of changes introduc ii dpkg-dev1.14.14 package building tools for Debian ii file4.21-4 Determines file type using magic ii gettext 0.17-2 GNU Internationalization utilities ii intltool-debian 0.35.0+20060710.1Help i18n of RFC822 compliant conf ii libparse-debianchan 1.1.1-1 parse Debian changelogs and output ii liburi-perl 1.35.dfsg.1-1Manipulates and accesses URI strin ii man-db 2.5.0-4 on-line manual pager ii perl [libdigest-md5 5.8.8-12 Larry Wall's Practical Extraction lintian recommends no packages. -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]