+2008-01-22 Guillem Jover <guillem@debian.org>
+
+ * utils/start-stop-daemon.c (main): Only call initgroups if changeuser
+ is not NULL.
+
2008-01-22 Guillem Jover <guillem@debian.org>
* utils/start-stop-daemon.c (gid_in_current_groups): Remove function.
[ Guillem Jover ]
* Make start-stop-daemon set the supplementary groups if the real user or
group are different than the ones we should switch to. Closes: #462075
+ * Fix segfault in start-stop-daemon when using --group w/o --chuid (as
+ a side effect, using --group alone works for the first time in years).
+ Closes: #462072
-- Raphael Hertzog <hertzog@debian.org> Tue, 22 Jan 2008 18:15:42 +0100
if (rgid != (gid_t)runas_gid)
if (setgid(runas_gid))
fatal("Unable to set gid to %d", runas_gid);
-
+ }
+ if (changeuser != NULL) {
/* We assume that if our real user and group are the same as
* the ones we should switch to, the supplementary groups
* will be already in place. */
if (initgroups(changeuser, runas_gid))
fatal("Unable to set initgroups() with gid %d",
runas_gid);
- }
- if (changeuser != NULL) {
+
if (ruid != (uid_t)runas_uid)
if (setuid(runas_uid))
fatal("Unable to set uid to %s", changeuser);