From: Mike Kershaw <dragorn@kismetwireless.net>
To: Alexey Toptygin <alexeyt@freeshell.org>
Cc: Johannes Berg <johannes@sipsolutions.net>, netdev@vger.kernel.org
Subject: Re: sysfs vs. d80211 configuration
Date: Mon, 14 Aug 2006 20:07:06 -0400 [thread overview]
Message-ID: <20060815000706.GE5672@drd1812a> (raw)
In-Reply-To: <Pine.NEB.4.64.0608142302560.21364@otaku.freeshell.org>
[-- Attachment #1: Type: text/plain, Size: 1456 bytes --]
On Mon, Aug 14, 2006 at 11:05:15PM +0000, Alexey Toptygin wrote:
> On Mon, 14 Aug 2006, Johannes Berg wrote:
>
> >In my seemingly never-ending quest to actually use the d80211 stack for
> >something useful I just wanted to write a small setuid tool that:
> >* creates and opens a new monitor interface
> >* drops priviledges
> >* ... does things with received frames ... (not interesting for this
> >discussion)
> >* removes new monitor interface
> >
> >So I figured I'd just keep an fd open to
> >/sys/class/net/mymonitorinterface/remove_iface to which I could write the
> >interfaces name after I was done with it. However, when writing to that fd
> >I got -EACCESS because it checks for CAP_NET_ADMIN.
>
> Why not have the tool create a monitor interface, open it, and fork; the
> child drops privileges and does the reading, and the parent wait(2)s for
> the child and removes the interface once it has collected the child?
Kismet achieves this nearly the same way -- It keeps a root process for
channel control, and talks over IPC to a nonpriv process. When it's
done, it sends the shutdown command to the root process and restores the
interface settings (or removes monitor interfaces, etc).
If you set up all your interfaces before the fork you can keep the IPC
very simple.
-m
--
Mike Kershaw/Dragorn <dragorn@kismetwireless.net>
GPG Fingerprint: 3546 89DF 3C9D ED80 3381 A661 D7B2 8822 738B BDB1
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-08-15 0:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-14 13:10 sysfs vs. d80211 configuration Johannes Berg
2006-08-14 23:05 ` Alexey Toptygin
2006-08-15 0:07 ` Mike Kershaw [this message]
2006-08-15 7:41 ` Johannes Berg
2006-08-15 10:02 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060815000706.GE5672@drd1812a \
--to=dragorn@kismetwireless.net \
--cc=alexeyt@freeshell.org \
--cc=johannes@sipsolutions.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).