summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1993-01-08 20:32:36 +0000
committerRoland McGrath <roland@redhat.com>1993-01-08 20:32:36 +0000
commitd07b95da6f09623f2cf2ae5cb055bc25ecf0b516 (patch)
tree7de08a092f8abaaccd4cb9d7cac7917408e91f62 /misc.c
parent2f22bfeaaa0d2d393a58740a05366d7d425c2f84 (diff)
downloadgunmake-d07b95da6f09623f2cf2ae5cb055bc25ecf0b516.tar.gz
Formerly misc.c.~20~
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index 761fca0..a954d15 100644
--- a/misc.c
+++ b/misc.c
@@ -605,10 +605,21 @@ child_access ()
/* Set both the real and effective UID and GID to the user's.
They cannot be changed back to make's. */
+#ifndef HAVE_SETREUID
if (setuid (user_uid) < 0)
pfatal_with_name ("child_access: setuid");
+#else
+ if (setreuid (user_uid, user_uid) < 0)
+ pfatal_with_name ("child_access: setreuid");
+#endif
+
+#ifndef HAVE_SETREGID
if (setgid (user_gid) < 0)
pfatal_with_name ("child_access: setgid");
+#else
+ if (setregid (user_gid, user_gid) < 0)
+ pfatal_with_name ("child_access: setregid");
+#endif
}
#ifdef NEED_GET_PATH_MAX