[PATCH] [RFC] Always run hald as non-root

Sjoerd Simons sjoerd at luon.net
Tue Feb 8 14:13:36 PST 2005


On Tue, Feb 08, 2005 at 04:59:40PM -0500, David Zeuthen wrote:
> On Tue, 2005-02-08 at 00:07 +0100, Sjoerd Simons wrote:
> > Hi,
> > 
> >   Since i seem to be in an extreme mood anyway, attached it is a patch that
> >   will make hal always drop permissions to non-root. Also it removes keeping
> >   the net admin capability as it's not being used anymore. 
> 
> Not exactly true - it is (was, see below) used for network link
> detection. 
> 
> But, anyway, after some thorough discussion with Dan Williams
> (NetworkManager maintainer), I've decided to remove this since network
> link detection is a whole ordeal in itself (ethtool, mii, traffic
> sniffing, different sysfs carrier file behavior dependent on
> driver/network card/chip set, crashers caused by broken drivers etc.).
> So NM and other tools are on their own now. 

Yeah, and even if they wouldn't do according to the new hal plan getting the
info directly would have been done in a callout anyway or via the new sysfs
file :)

> It'll stay in the 0.4.x branch though, as we cannot break API.

Yeah, it was obviously meant for HEAD>.
> 
> >   I think it's the right way to do things. There should be no reason to run
> >   hald as root ever and forcing it from the start of the development cycle is
> >   a good way of ensuring that :)
> 
> Sure, we've already agreed on this so, yeah, no probs. Your patch wasn't
> perfect though; it didn't change hald/hald.c:usage() and it didn't
> remove the libcap stuff from configure.in.

Bah, forgot that.. stupid..
> 
> Also, for development, you want to run hald as root as otherwise you
> need to setuid root all your probers, callouts and addons all the time.
> So, I added the option --retain-privileges and added that to the
> run-hald.sh script.
> 
> >   It would also be nice to have the addons that need to start out as root
> >   (like the ups one) drop permission as soon as possible (one can never be
> >   too sure)... Probably a utility function would be nice for that, but i
> >   don't know where to place it (as the addons and probers live in different
> >   dirs)
> 
> Sure, I don't really now either. I suppose this would be nice to add
> sometime along the 0.5.x cycle. Patches welcome.

Made move addons and probing things to a common subdir (external), so it's easy
to put common functionality there for them ? A patch for this is probably just
a copy from the drop_priveledges functiond in hald.c..

  Sjoerd
-- 
Ma Bell is a mean mother!
_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list