Bug 161290 - net-wireless/ipw3945d broken permissions handling in init script
|
Bug#:
161290
|
Product: Gentoo Linux
|
Version: unspecified
|
Platform: x86
|
|
OS/Version: Linux
|
Status: RESOLVED
|
Severity: normal
|
Priority: P2
|
|
Resolution: FIXED
|
Assigned To: phreak@gentoo.org
|
Reported By: taiyang.chen@gmail.com
|
|
Component: Ebuilds
|
|
|
URL:
|
|
Summary: net-wireless/ipw3945d broken permissions handling in init script
|
|
Keywords:
|
|
Status Whiteboard:
|
|
Opened: 2007-01-10 07:52 0000
|
hi,
I am using these to get my wireless card working:
gentoo-sources-2.6.18-r6
ieee80211-1.2.15
ipw3945d-1.7.22-r4
ipw3945-1.1.3
wireless-tools-28
After a recent update my ipw3945d init script stopped working (loading on boot)
without using "rmmod ipw3945 && modprobe ipw3945"
After reading the ipw3945d ChangeLog i found out that this was recently
changed:
08 Jan 2007; Christian Heim <phreak@gentoo.org>
-ipw3945d-1.7.22-r3.ebuild, ipw3945d-1.7.22-r4.ebuild:
Removing the old revision, using chmod / chown directly (sue me, fowners /
fperms won't work on files outside of $).
So i found these two chown/chmod lines inside my /etc/init.d/ipw3945d and
deleted them and everything works fine now. It turns out that chown "ipw3945d"
group to the /sys/bus/pci/drivers/ipw3945/00*/cmd did not give permission to
root so ipw3945d could not start the wireless card. I also added "sleep 0.5" to
make it fully working for loading up my net.eth1 (which i believe was the
original initscript).
This is what my /etc/init.d/ipw3945d look like now:
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:
/var/cvsroot/gentoo-x86/net-wireless/ipw3945d/files/ipw3945d-init.d,v 1.4
2006/12/22 10:11:26 phreak Exp $
PIDFILE=/var/run/ipw3945d/ipw3945d.pid
depend() {
before net
}
check() {
# Let's check if the pidfile is still present.
if [ -f "${PIDFILE}" ] ; then
eerror "The pidfile ($PIDFILE) is still present."
eerror "Please check that the daemon isn't running!"
return 1
fi
}
start() {
check
ebegin "Starting ipw3945d"
start-stop-daemon --start --exec /sbin/ipw3945d --pidfile ${PIDFILE} --
\
--pid-file=${PIDFILE} ${ARGS}
sleep 0.5
eend ${?}
}
stop() {
ebegin "Stopping ipw3945d"
start-stop-daemon --stop --exec /sbin/ipw3945d --pidfile ${PIDFILE}
eend ${?}
}
I hope this initscript could be fixed/updated to fix permission problems.
*** Bug 161047 has been marked as a duplicate of this bug. ***
(In reply to comment #0)
> So i found these two chown/chmod lines inside my /etc/init.d/ipw3945d and
> deleted them and everything works fine now. It turns out that chown "ipw3945d"
> group to the /sys/bus/pci/drivers/ipw3945/00*/cmd did not give permission to
> root so ipw3945d could not start the wireless card. I also added "sleep 0.5" to
> make it fully working for loading up my net.eth1 (which i believe was the
> original initscript).
The intention is that ipw3945d doesn't run as root. What are the permissions of
/sbin/ipw3945d on your system?
(In reply to comment #2)
> The intention is that ipw3945d doesn't run as root. What are the permissions of
> /sbin/ipw3945d on your system?
The intention may be fine but this totally kills the (already pretty borked)
thing, rendering it useless.
(In reply to comment #2)
> (In reply to comment #0)
> > So i found these two chown/chmod lines inside my /etc/init.d/ipw3945d and
> > deleted them and everything works fine now. It turns out that chown "ipw3945d"
> > group to the /sys/bus/pci/drivers/ipw3945/00*/cmd did not give permission to
> > root so ipw3945d could not start the wireless card. I also added "sleep 0.5" to
> > make it fully working for loading up my net.eth1 (which i believe was the
> > original initscript).
>
> The intention is that ipw3945d doesn't run as root. What are the permissions of
> /sbin/ipw3945d on your system?
>
here it is:
-r-Sr-x--- 1 root root 69176 Jan 10 02:17 /sbin/ipw3945d
I don't think it's this permission that matters.
ipw3945d cannot read the hardware at /sys/bus/pci/drivers/ipw3945/00*/cmd if it
is owned by the ipw3945d group. A new modprobe changed the ownership back to
root so ipw3945d can find the wireless card again. I am not sure how to make
this intention work. I tried making a new group called ipw3945d but didn't do
anything to it.
(In reply to comment #4)
> here it is:
> -r-Sr-x--- 1 root root 69176 Jan 10 02:17 /sbin/ipw3945d
It should be owned by the ipw3945d user, not by root. Could you please sync
your tree and re-emerge the ipw3945d-1.7.22-r4 ebuild (yup, once again)?
Christian has recently added stuff that should take care of such problems...
> I don't think it's this permission that matters.
> ipw3945d cannot read the hardware at /sys/bus/pci/drivers/ipw3945/00*/cmd if it
> is owned by the ipw3945d group. A new modprobe changed the ownership back to
> root so ipw3945d can find the wireless card again. I am not sure how to make
> this intention work. I tried making a new group called ipw3945d but didn't do
> anything to it.
Everything should work out-of-box. If it doesn't and you aren't using a stale
ebuild, there's a bug we'd like to fix.
Yes i synced and re-emerged ipw3945d-1.7.22-r4 but the problem is still there.
Manually doing "chown ipw3945d /sbin/ipw3945d" did not help either.
Here are some things i found while emerging ipw3945d:
First this shows up:
ACCESS DENIED chmod: /sbin/ipw3945d
chmod: changing permissions of `/sbin/ipw3945d': Permission denied
Then, these seem to be helpful:
* Fixing permissions of /sbin/ipw3945d ... [ ok ]
* Fixing ownership of /var/run/ipw3945d ... [ ok ]
But after this /sbin/ipw3945d is owned by root again! instead of ipw3945d.
Only deleting these 2 lines in /etc/init.d/ipw3945d makes it work:
chown ipw3945d /sys/bus/pci/drivers/ipw3945/00*/cmd
chmod a-w,u+rw /sys/bus/pci/drivers/ipw3945/00*/cmd
(In reply to comment #6)
> ACCESS DENIED chmod: /sbin/ipw3945d
> chmod: changing permissions of `/sbin/ipw3945d': Permission denied
Someone should fix src_install to not try to fiddle w/ perms on live fs, it's
violating sandbox... :P
exactly the same problem here, workaround seems to work.
Same problem with sandbox violation here. Please, fix it
Thanks
Could you please resync your tree and re-emerge the ipw3945d-1.7.22-r4 version
yet again? Christian has added a fix for this issue.
It works for me on my test system in default configuration, ie. the daemon runs
as non-root. If you can't make it work, please reopen.
(In reply to comment #10)
> It works for me on my test system in default configuration
Oops, it doesn't, I was using older init.d/conf.d files.
Created an attachment (id=106682) [details]
patch against ipw3945d-1.7.22-r4.ebuild (CVS 1.5)
Could you please try to apply this patch to the recent -r4 ebuild (ie. CVS
version "1.5" as you can see on the third line of the ebuild)? It works for me.
Thanks to Jan, I fixed all the issues in CVS. Feel free to reopen this bug if
its still not working after your next sync.
Thanks problem solved here.
*** Bug 194996 has been marked as a duplicate of this bug. ***