Fix: report setegid()/seteuid() failure in runas
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Aug 2018 17:00:53 +0000 (13:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Aug 2018 17:11:04 +0000 (13:11 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/runas.c

index 4a8536c6de0eb1063ed9b4f351d1f40c37355c50..9fe6dcd58efaaa5f4c551efa0ba5e03017837543 100644 (file)
@@ -528,6 +528,8 @@ int handle_one_cmd(struct run_as_worker *worker)
        if (data.gid != getegid()) {
                ret = setegid(data.gid);
                if (ret < 0) {
+                       sendret._error = true;
+                       sendret._errno = errno;
                        PERROR("setegid");
                        goto write_return;
                }
@@ -535,6 +537,8 @@ int handle_one_cmd(struct run_as_worker *worker)
        if (data.uid != prev_euid) {
                ret = seteuid(data.uid);
                if (ret < 0) {
+                       sendret._error = true;
+                       sendret._errno = errno;
                        PERROR("seteuid");
                        goto write_return;
                }
This page took 0.036672 seconds and 4 git commands to generate.