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

Re: [kernel] r7596 - in people/jurij/ipw3945-daemon: . debian



On Wed, Oct 11, 2006 at 06:22:35AM +0000, Jurij Smakov wrote:
> Log:
> Initial commit (totally untested).

I see it, please see my comments inside. (FYI, I operate such a card.)

> Added: people/jurij/ipw3945-daemon/debian/control
> ==============================================================================
> --- (empty file)
> +++ people/jurij/ipw3945-daemon/debian/control	Wed Oct 11 06:22:30 2006
> @@ -0,0 +1,20 @@
> +Source: ipw3945-daemon
> +Section: admin

Must be non-free/admin.

> +DAEMON_RUN='yes'
> +DAEMON_OWNER='Debian-ipw3945d:Debian-ipw3945d'
> +DAEMON_BINARY='/sbin/ipw3945d'
> +DAEMON_PERM='744'

See the policy, non-executable is only allowed for suid/sgid bins.

> +DAEMON_PID='/var/run/ipw3945d.pid'

It makes never sense to modify the pid file location.

> Added: people/jurij/ipw3945-daemon/debian/init
> ==============================================================================
> --- (empty file)
> +++ people/jurij/ipw3945-daemon/debian/init	Wed Oct 11 06:22:30 2006
> @@ -0,0 +1,55 @@
> +#!/bin/sh
> +
> +DAEMON_RUN='yes'
> +DAEMON_OWNER='Debian-ipw3945d:Debian-ipw3945d'
> +DAEMON_BINARY='/sbin/ipw3945d'
> +DAEMON_PERM='744'
> +DAEMON_PID='/var/run/ipw3945d.pid'
> +
> +if [ -r /etc/default/ipw3945-daemon ]; then
> +  . /etc/default/ipw3945-daemon
> +fi
> +
> +start_daemon() {
> +  cmd="$(echo /sys/bus/pci/drivers/ipw3945/*/cmd)"
> +  if [ -z "${cmd}" ]; then
> +    echo "Not starting regulatory daemon, ipw3945 driver not loaded."
> +  else
> +    echo -n "Starting ipw3945 regulatory daemon: ipw3945d"
> +    # Fix permissions
> +    chown ${DAEMON_OWN} ${cmd}
> +    chmod ${DAEMON_PERM} ${cmd}

Why? It is neither suid nor sgid.

> +    start-stop-daemon --start --quiet --chuid ${DAEMON_OWN}        \
> +                      --exec ${DAEMON_BIN} --pidfile ${DAEMON_PID} \
> +		      -- --pid-path ${DAEMON_PID}

This will not work in default config. The daemon needs to run as root.

The deamon should be started and stopped by modprobe via install/remove
calls like
install ipw3945 /sbin/modprobe --ignore-install ipw3945; $script
or via udev and not via init. It will die if ipw3945 is not loaded
anyway.

Also we don't want it to run as root, which means we can't use the
current sysfs communication. I have a patch for the driver and a preload
lib for the daemon to fix that. Also we can simply put it in a chroot
than.

Bastian

-- 
Dammit Jim, I'm an actor, not a doctor.

Attachment: signature.asc
Description: Digital signature


Reply to: