From 4d105d2a64758d01d646f182cd1bfc5e65e35142 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Sat, 3 Sep 2016 15:54:15 +0000 Subject: in lka specifically, use initgroups() so that users may share files between smtpd and another daemon by adding supplementary groups ok eric@ --- usr.sbin/smtpd/lka.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.sbin/smtpd/lka.c') diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c index 703a97a8795..7ca46e90184 100644 --- a/usr.sbin/smtpd/lka.c +++ b/usr.sbin/smtpd/lka.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka.c,v 1.194 2016/09/01 10:54:25 eric Exp $ */ +/* $OpenBSD: lka.c,v 1.195 2016/09/03 15:54:14 gilles Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard @@ -419,7 +419,7 @@ lka(void) config_process(PROC_LKA); - if (setgroups(1, &pw->pw_gid) || + if (initgroups(pw->pw_name, pw->pw_gid) || setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) || setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) fatal("lka: cannot drop privileges"); -- cgit v1.2.3