Subject: Re: bin/18936: syslogd should call initgroups()
To: Christian Biere <christianbiere@gmx.de>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 11/05/2002 12:23:52
[ On Tuesday, November 5, 2002 at 03:32:29 (+0100), Christian Biere wrote: ]
> Subject: bin/18936: syslogd should call initgroups()
>
> 
> /usr/sbin/syslogd should call initgroups() before set{e,}{g,u}gid() like
> almost(?) any other daemon to get rid of unnecessary rights.

No, not initgroups(), just setgroups(), and perhaps only if started by
root (in theory syslogd can be started as non-root):

	if (uid == 0) {
		gid_t gid = getgid();

		setgroups(1, &gid);
	}

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>