[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#580078: lintian: false positive for "init.d-script-missing-dependency-on-remote_fs /etc/init.d/cryptdisks: required start/stop"



Hi,

Jonas Meurer wrote:
> cryptdisks and cryptdisks-early initscripts both need to be started
> before any (non-root) filesystem is mounted. still, i added a check for
> /usr/bin/id in the initscripts in order to warn normal users that they
> need root privileges when they execute the initscript.

First of all I'm curious as to why you are adding that check. Only a few, 
rare, init scripts do that.

I'm actually surprised that policy doesn't say a word about this. I don't 
think there's any reason to introduce such a technical blockage (that can be 
bypassed until the point where the special privileges are actually needed.)

Russ, what do you think? (with your policy hat on :)

> this causes four
> false positives for the cryptsetup package.
> 
> the relevant code in the initscripts is:
> 
> if [ -x "/usr/bin/id" ] && [ "$(/usr/bin/id -u)"  != "0" ]; then
>         log_warning_msg "$0 needs root privileges"
>         exit 1
> fi
> 

I would personally just drop that piece of code.

The reason behind the check and the fact that it doesn't ignore such 
conditional cases, is exactly that: there might be conditional, but desired, 
cases that are not executed because the file system is not available because 
of a mistake.

Consider a case where the init script does this:

# exit if removed but not purged:
[ -x /usr/sbin/some_daemon ] || exit 0


Now, if the script doesn't have the proper dependency on $remote_fs chances 
are that it will never do anything because it is executed too early.

If you don't agree that it is better to remove the id check then please 
override it (the check's certainty is "possible" for that very reason.)

Cheers,
-- 
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net



Reply to: