1 |
--- src/setuid.c~ 2008-05-27 17:11:42.000000000 -0600 |
2 |
+++ src/setuid.c 2008-05-27 17:11:42.000000000 -0600 |
3 |
@@ -76,11 +76,11 @@ set_ids_by_number (uid_t uid, |
4 |
errno = 0; |
5 |
if (setgroups (1, &gid) < 0) |
6 |
sgs_errno = errno ? errno : -1; |
7 |
- |
8 |
+#if 0 |
9 |
errno = 0; |
10 |
if (setgid (gid) != 0) |
11 |
gid_errno = errno ? errno : -1; |
12 |
- |
13 |
+#endif |
14 |
errno = 0; |
15 |
if (setuid (uid) != 0) |
16 |
uid_errno = errno ? errno : -1; |
17 |
@@ -194,7 +194,7 @@ hack_uid (char **nolock_reason, |
18 |
*orig_uid = uid_gid_string (euid, egid); |
19 |
} |
20 |
|
21 |
- if (uid != euid || gid != egid) { |
22 |
+ if (euid == (uid_t) 0 && (uid != euid || gid != egid)) { |
23 |
if (! set_ids_by_number (uid, gid, uid_message)) { |
24 |
reason = g_strdup ("unable to discard privileges."); |
25 |
|