python/hypothesis: update to 6.122.3
[oi-userland.git] / components / desktop / lightdm / patches / 05-privileges.patch
blobc040e53cfa7f34aceb2423184101bf355aedf75a
1 http://patches.osdyson.org/patch/series/view/lightdm/1.10.3-3+dyson2/dyson-privileges.patch
3 Description: cannot reclaim root
4 "Thus, a set-user-ID-root program wishing to temporarily drop root
5 privileges, assume the identity of an unprivileged user, and then regain
6 root privileges afterward cannot use setuid(). You can accomplish this
7 with seteuid(2)."
8 (http://linux.die.net/man/2/setuid)
10 "For portability, it is recommended that new non-privileged applications
11 use the seteuid() and setegid() functions instead."
12 (http://pubs.opengroup.org/onlinepubs/009695399/functions/setuid.html)
13 Index: lightdm-1.10.3/common/privileges.c
14 ===================================================================
15 --- lightdm-1.10.3.orig/common/privileges.c
16 +++ lightdm-1.10.3/common/privileges.c
17 @@ -23,13 +23,11 @@ privileges_drop (uid_t uid, gid_t gid)
18 #ifdef HAVE_SETRESGID
19 g_assert (setresgid (gid, gid, -1) == 0);
20 #else
21 - g_assert (setgid (gid) == 0);
22 g_assert (setegid (gid) == 0);
23 #endif
24 #ifdef HAVE_SETRESUID
25 g_assert (setresuid (uid, uid, -1) == 0);
26 #else
27 - g_assert (setuid (uid) == 0);
28 g_assert (seteuid (uid) == 0);
29 #endif
31 @@ -40,13 +38,11 @@ privileges_reclaim (void)
32 #ifdef HAVE_SETRESUID
33 g_assert (setresuid (0, 0, -1) == 0);
34 #else
35 - g_assert (setuid (0) == 0);
36 g_assert (seteuid (0) == 0);
37 #endif
38 #ifdef HAVE_SETRESGID
39 g_assert (setresgid (0, 0, -1) == 0);
40 #else
41 - g_assert (setgid (0) == 0);
42 g_assert (setegid (0) == 0);
43 #endif