1From 54a5279cb33abd23ef7c094d51f16078ece2da0c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 6 Nov 2016 23:40:54 -0800
4Subject: [PATCH] Lifted from gentoo and ported to 4.4.5
5
6http://data.gpo.zugaina.org/musl/net-fs/samba/files/samba-4.2.7-pam.patch
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9
10---
11 source3/wscript | 13 ++++++++++++-
12 1 file changed, 12 insertions(+), 1 deletion(-)
13
14diff --git a/source3/wscript b/source3/wscript
15index 5436db2..864f614 100644
16--- a/source3/wscript
17+++ b/source3/wscript
18@@ -879,7 +879,7 @@ msg.msg_accrightslen = sizeof(fd);
19         if conf.env.with_iconv:
20             conf.DEFINE('HAVE_ICONV', 1)
21
22-    if Options.options.with_pam:
23+    if Options.options.with_pam != False:
24         use_pam=True
25         conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h')
26         if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'):
27@@ -956,6 +956,17 @@ int i; i = PAM_RADIO_TYPE;
28                        "or headers not found. Use --without-pam to disable "
29                        "PAM support.");
30
31+    else:
32+        Logs.warn("PAM disabled")
33+        use_pam=False
34+        conf.undefine('WITH_PAM')
35+        conf.undefine('WITH_PAM_MODULES')
36+        conf.undefine('HAVE_SECURITY_PAM_APPL_H')
37+        conf.undefine('PAM_RHOST')
38+        conf.undefine('PAM_TTY')
39+        conf.undefine('HAVE_PAM_PAM_APPL_H')
40+
41+
42     seteuid = False
43
44 #
45