]> diplodocus.org Git - nmh/commitdiff
Reset done in inc_done() to prevent endless loop when setegid()
authorMarcin Cieslak <saper@saper.info>
Sat, 14 Feb 2015 03:01:09 +0000 (21:01 -0600)
committerDavid Levine <levinedl@acm.org>
Sat, 14 Feb 2015 03:01:09 +0000 (21:01 -0600)
fails (in which case adios() is called, which calls done()).

uip/inc.c

index b4572824a7eb7c3e094a84e126bdea5b5a7264af..7d128420ae6e2e7a3c7f2f7fd78187ae8bbce16b 100644 (file)
--- a/uip/inc.c
+++ b/uip/inc.c
@@ -137,7 +137,7 @@ static gid_t return_gid;
 #define TRYDROPGROUPPRIVS() DROPGROUPPRIVS()
 #define DROPGROUPPRIVS() \
     if (setegid(getgid()) != 0) { \
-        adios ("setegid", "unable to set group to %ld", (long) getgid()); \
+        adios ("setegid", "unable to restore group to %ld", (long) getgid()); \
     }
 #define GETGROUPPRIVS() \
     if (setegid(return_gid) != 0) { \
@@ -959,6 +959,7 @@ skip:
 static void
 inc_done (int status)
 {
+    done = exit;
     if (packfile && pd != NOTOK)
        mbx_close (packfile, pd);
     if (locked)