From: Joe Orton Date: Mon, 20 Apr 2020 09:31:25 +0000 (+0000) Subject: * support/suexec.c (main): Report error string after failure from X-Git-Tag: 2.5.0-alpha2-ci-test-only~1504 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8acbc07a956387f8987b962b1d61d2aa63f40d98;p=thirdparty%2Fapache%2Fhttpd.git * support/suexec.c (main): Report error string after failure from setgid/initgroups or setuid. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876745 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/support/suexec.c b/support/suexec.c index 8b81eebd373..33e95343ea6 100644 --- a/support/suexec.c +++ b/support/suexec.c @@ -543,7 +543,8 @@ int main(int argc, char *argv[]) * and setgid() to the target group. If unsuccessful, error out. */ if (((setgid(gid)) != 0) || (initgroups(actual_uname, gid) != 0)) { - log_err("failed to setgid (%lu: %s)\n", (unsigned long)gid, cmd); + log_err("failed to setgid/initgroups (%lu: %s): %s\n", + (unsigned long)gid, cmd, strerror(errno)); exit(109); } @@ -551,7 +552,8 @@ int main(int argc, char *argv[]) * setuid() to the target user. Error out on fail. */ if ((setuid(uid)) != 0) { - log_err("failed to setuid (%lu: %s)\n", (unsigned long)uid, cmd); + log_err("failed to setuid (%lu: %s): %s\n", + (unsigned long)uid, cmd, strerror(errno)); exit(110); }