Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 161290
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Christian Heim (RETIRED) <phreak@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Taiyang Chen <taiyang.chen@gmail.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
patch patch against ipw3945d-1.7.22-r4.ebuild (CVS 1.5) patch Jan Kundrát 2007-01-12 14:23 0000 1000 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 161290 depends on: Show dependency tree
Bug 161290 blocks: 158420
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   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.

------- Comment #1 From Jakub Moc (RETIRED) 2007-01-10 08:02:24 0000 -------
*** Bug 161047 has been marked as a duplicate of this bug. ***

------- Comment #2 From Jan Kundrát 2007-01-10 10:58:31 0000 -------
(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?

------- Comment #3 From Jakub Moc (RETIRED) 2007-01-10 14:28:37 0000 -------
(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. 

------- Comment #4 From Taiyang Chen 2007-01-10 19:03:40 0000 -------
(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.

------- Comment #5 From Jan Kundrát 2007-01-10 20:12:58 0000 -------
(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.

------- Comment #6 From Taiyang Chen 2007-01-10 20:53:35 0000 -------
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

------- Comment #7 From Jakub Moc (RETIRED) 2007-01-11 01:18:16 0000 -------
(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

------- Comment #8 From Renat Lumpau 2007-01-11 16:19:33 0000 -------
exactly the same problem here, workaround seems to work.

------- Comment #9 From Pacho Ramos 2007-01-11 21:49:12 0000 -------
Same problem with sandbox violation here. Please, fix it

Thanks

------- Comment #10 From Jan Kundrát 2007-01-12 12:41:08 0000 -------
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.

------- Comment #11 From Jan Kundrát 2007-01-12 14:11:15 0000 -------
(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.

------- Comment #12 From Jan Kundrát 2007-01-12 14:23:20 0000 -------
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.

------- Comment #13 From Christian Heim (RETIRED) 2007-01-12 16:50:01 0000 -------
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.

------- Comment #14 From Taiyang Chen 2007-01-12 19:12:45 0000 -------
Thanks problem solved here.

------- Comment #15 From Jan Kundrát 2007-12-05 16:36:17 0000 -------
*** Bug 194996 has been marked as a duplicate of this bug. ***

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug