* support/suexec.c (main): Report error string after failure from
setgid/initgroups or setuid.
@@ -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);
}
