summaryrefslogtreecommitdiff
path: root/security/openssh/patches/patch-ao
blob: b2f1b37282164e714eb87eb2615757faf54ebcf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$NetBSD: patch-ao,v 1.5 2004/08/04 06:43:53 minskim Exp $

--- uidswap.c.orig	Mon Feb 23 20:17:30 2004
+++ uidswap.c
@@ -83,6 +83,7 @@ temporarily_use_uid(struct passwd *pw)
 			xfree(saved_egroups);
 	}
 
+#ifndef __INTERIX
 	/* set and save the user's groups */
 	if (user_groupslen == -1) {
 		if (initgroups(pw->pw_name, pw->pw_gid) < 0)
@@ -105,6 +106,7 @@ temporarily_use_uid(struct passwd *pw)
 	/* Set the effective uid to the given (unprivileged) uid. */
 	if (setgroups(user_groupslen, user_groups) < 0)
 		fatal("setgroups: %.100s", strerror(errno));
+#endif /* __INTERIX */
 #ifndef SAVED_IDS_WORK_WITH_SETEUID
 	/* Propagate the privileged gid to all of our gids. */
 	if (setgid(getegid()) < 0)
@@ -152,8 +154,10 @@ restore_uid(void)
 	setgid(getgid());
 #endif /* SAVED_IDS_WORK_WITH_SETEUID */
 
+#ifndef __INTERIX
 	if (setgroups(saved_egroupslen, saved_egroups) < 0)
 		fatal("setgroups: %.100s", strerror(errno));
+#endif /* __INTERIX */
 	temporarily_use_uid_effective = 0;
 }