summaryrefslogtreecommitdiff
path: root/net-mail/relay-ctrl/files/authenticated.c-relayfixup.diff
blob: 72bb5a27aa4706f7778062d3469ec45ccb2a14d4 (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
diff -ur relay-ctrl-3.1.1/authenticated.c relay-ctrl-3.1.1-r2/authenticated.c
--- relay-ctrl-3.1.1/authenticated.c	2002-04-26 09:07:38.000000000 -0700
+++ relay-ctrl-3.1.1-r2/authenticated.c	2004-05-24 02:31:47.000000000 -0700
@@ -1,14 +1,20 @@
 #include <stdlib.h>
+#include <string.h>
 #include "relay-ctrl.h"
 
 int is_authenticated(void)
 {
   if (getenv("AUTHUSER") && getenv("AUTHARGV0")) {
     /* Courier IMAP or POP3 */
-    if (getenv("AUTHENTICATED"))
-      return 1;
-  }
-  else
+	char *authenticated = getenv("AUTHENTICATED");
+	if (authenticated && strlen(authenticated)) {
+		return 1;
+	} else {
+		return 0;
+	}
+  } else {
     return 1;
+  }
+  // unreachable code
   return 0;
 }