Subject: Re: #define name for non-root pkg_install tools
To: None <tech-pkg@NetBSD.org>
From: Jonathan Perkin <jonathan@perkin.org.uk>
List: tech-pkg
Date: 03/30/2004 13:04:13
* On 2004-03-29 at 18:22 BST, Todd Vierling wrote:

> The diff follows.  Of course, I'd like to choose a different name
> for the symbol and put it into pkgtools/pkg_install/Makefile,
> rather than potting an OS-specific symbol there.  Is there a
> preferred naming convention here?  I was thinking
> "PKG_INSTALL_AS_NONROOT", but that sounds clunky.

Well, personally I use:

   	}
  +#ifdef I_CARE_ABOUT_NONROOT_WARNINGS
   #ifndef __INTERIX
   	if (!Fake && getuid() != 0) {
   		warnx("not running as root - trying to delete anyways");
   ...

so it's not that clunky by me :)  I'd love to see the warnx's
removed when built with "./bootstrap --ignore-user-check ...",
or even removed completely given the shift of target user base
recently and the proliferation of local unprivileged installs.

Cheers,

-- 
Jonathan Perkin                         <jonathan@perkin.org.uk>
BBC Internet Services         http://www.perkin.org.uk/jonathan/