summaryrefslogtreecommitdiff
path: root/debian/patches-applied/setreuid_juggling.patch
blob: d8e36a90959da4f008c18b988f7a994e5e2ad319 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
This particular setreuid() is only needed if we don't have any root
privs at all, so make it conditional like it was pre-1.0.

Authors: Steve Langasek <steve.langasek@canonical.com>

Upstream status: to be submitted

Index: pam.deb/modules/pam_unix/passverify.c
===================================================================
--- pam.deb.orig/modules/pam_unix/passverify.c
+++ pam.deb/modules/pam_unix/passverify.c
@@ -187,8 +187,8 @@
 			if (save_uid == (*pwd)->pw_uid)
 				setreuid(save_uid, save_euid);
 			else {
-				setreuid(-1, 0);
-				setreuid(save_uid, -1);
+				if (setreuid(-1, 0) == -1)
+					setreuid(save_uid, -1);
 				setreuid(-1, save_euid);
 			}