summaryrefslogtreecommitdiff
path: root/debian/patches-applied/pam_mail-fix-quiet
blob: b85637ca3b2121c25b1497b7f2ad47c214fc437b (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
32
33
34
35
36
37
Make quiet option of pam_mail work. Fixes http://bugs.debian.org/439268

Author: Andreas Henriksson <andreas@fatal.se>
Upstream status: applied in upstream CVS September 2008

Index: sid/modules/pam_mail/pam_mail.c
===================================================================
--- sid.orig/modules/pam_mail/pam_mail.c	2009-07-21 04:31:54.000000000 -0400
+++ sid/modules/pam_mail/pam_mail.c	2009-07-24 12:16:47.000000000 -0400
@@ -303,8 +303,13 @@
 {
     int retval;
 
-    if (!(ctrl & PAM_MAIL_SILENT) ||
-	((ctrl & PAM_QUIET_MAIL) && type == HAVE_NEW_MAIL))
+    if ((ctrl & PAM_MAIL_SILENT) ||
+	((ctrl & PAM_QUIET_MAIL) && type != HAVE_NEW_MAIL))
+      {
+	D(("keeping quiet"));
+	retval = PAM_SUCCESS;
+      }
+    else
       {
 	if (ctrl & PAM_STANDARD_MAIL)
 	  switch (type)
@@ -345,11 +350,6 @@
 	      break;
 	    }
       }
-    else
-      {
-	D(("keeping quiet"));
-	retval = PAM_SUCCESS;
-      }
 
     D(("returning %s", pam_strerror(pamh, retval)));
     return retval;