From f9cfab1e0d1183eb5e948b6dabc6017b9e261704 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 16 Aug 2020 22:20:14 -0400 Subject: Only call setgroups as root setgroups fails when already running as a user. --- service.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/service.c b/service.c index 3178f79..78890b8 100644 --- a/service.c +++ b/service.c @@ -187,8 +187,10 @@ void serviceStart(struct Service *service) { error = setgid(serviceGID); if (error) err(ExitNoExec, "setgid"); - error = setgroups(1, &serviceGID); - if (error) err(ExitNoExec, "setgroups"); + if (!getuid()) { + error = setgroups(1, &serviceGID); + if (error) err(ExitNoExec, "setgroups"); + } error = setuid(serviceUID); if (error) err(ExitNoExec, "setuid"); -- cgit 1.4.1 option value='upstream'>upstream libtls for OpenSSL
summary refs log tree commit diff
path: root/compat/freezero.c (unfollow)
Commit message (Expand)Author
2020-10-22Import LibreSSL 3.2.2June McEnroe
2020-09-29Import LibreSSL 3.2.1June McEnroe
2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe
2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe
2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe