build: Move pam_wrapper to third_party
authorAndreas Schneider <asn@samba.org>
Fri, 24 Nov 2017 12:34:25 +0000 (13:34 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Sat, 25 Nov 2017 09:14:13 +0000 (10:14 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
12 files changed:
buildtools/wafsamba/samba_third_party.py
python/samba/tests/test_pam_winbind.sh
python/samba/tests/test_pam_winbind_warn_pwd_expire.sh
third_party/pam_wrapper/libpamtest.c [moved from lib/pam_wrapper/libpamtest.c with 100% similarity]
third_party/pam_wrapper/libpamtest.h [moved from lib/pam_wrapper/libpamtest.h with 100% similarity]
third_party/pam_wrapper/pam_wrapper.c [moved from lib/pam_wrapper/pam_wrapper.c with 99% similarity]
third_party/pam_wrapper/pwrap_compat.h [moved from lib/pam_wrapper/pwrap_compat.h with 100% similarity]
third_party/pam_wrapper/python/pypamtest.c [moved from lib/pam_wrapper/python/pypamtest.c with 100% similarity]
third_party/pam_wrapper/wscript [moved from lib/pam_wrapper/wscript with 91% similarity]
third_party/wscript
wscript
wscript_build

index 3253f94..9c894e4 100644 (file)
@@ -59,3 +59,8 @@ Build.BuildContext.CHECK_RESOLV_WRAPPER = CHECK_RESOLV_WRAPPER
 def CHECK_UID_WRAPPER(conf):
     return conf.CHECK_BUNDLED_SYSTEM_PKG('uid_wrapper', minversion='1.2.4')
 Build.BuildContext.CHECK_UID_WRAPPER = CHECK_UID_WRAPPER
+
+@conf
+def CHECK_PAM_WRAPPER(conf):
+    return conf.CHECK_BUNDLED_SYSTEM_PKG('pam_wrapper', minversion='1.0.4')
+Build.BuildContext.CHECK_PAM_WRAPPER = CHECK_PAM_WRAPPER
index c535759..0406b10 100755 (executable)
@@ -12,7 +12,7 @@ PASSWORD="$3"
 export PASSWORD
 shift 3
 
-PAM_WRAPPER_PATH="$BINDIR/default/lib/pam_wrapper"
+PAM_WRAPPER_PATH="$BINDIR/default/third_party/pam_wrapper"
 
 pam_winbind="$BINDIR/shared/pam_winbind.so"
 service_dir="$SELFTEST_TMPDIR/pam_services"
index 305633d..16dede4 100755 (executable)
@@ -12,7 +12,7 @@ PASSWORD="$3"
 export PASSWORD
 shift 3
 
-PAM_WRAPPER_PATH="$BINDIR/default/lib/pam_wrapper"
+PAM_WRAPPER_PATH="$BINDIR/default/third_party/pam_wrapper"
 
 pam_winbind="$BINDIR/shared/pam_winbind.so"
 service_dir="$SELFTEST_TMPDIR/pam_services"
similarity index 99%
rename from lib/pam_wrapper/pam_wrapper.c
rename to third_party/pam_wrapper/pam_wrapper.c
index 03584be..2db9bcc 100644 (file)
@@ -1456,7 +1456,7 @@ int pam_prompt(pam_handle_t *pamh,
                               args);
        va_end(args);
 
-       return rv;  
+       return rv;
 }
 
 #ifdef HAVE_PAM_STRERROR_CONST
similarity index 91%
rename from lib/pam_wrapper/wscript
rename to third_party/pam_wrapper/wscript
index cfd8b4f..75b4eec 100644 (file)
@@ -13,7 +13,7 @@ def find_library(library_names, lookup_paths):
     return ''
 
 def configure(conf):
-    if conf.CHECK_BUNDLED_SYSTEM('pam_wrapper', minversion=VERSION, set_target=False):
+    if conf.CHECK_PAM_WRAPPER():
         conf.DEFINE('USING_SYSTEM_PAM_WRAPPER', 1)
         libpam_wrapper_so_path = 'libpam_wrapper.so'
     else:
@@ -93,7 +93,7 @@ def configure(conf):
 
         # Create full path to pam_wrapper
         blddir = os.path.realpath(conf.blddir)
-        libpam_wrapper_so_path = blddir + '/default/lib/pam_wrapper/libpam-wrapper.so'
+        libpam_wrapper_so_path = blddir + '/default/third_party/pam_wrapper/libpam-wrapper.so'
 
     conf.DEFINE('LIBPAM_WRAPPER_SO_PATH', libpam_wrapper_so_path)
     conf.DEFINE('PAM_WRAPPER', 1)
@@ -110,7 +110,8 @@ def build(bld):
                           realname='libpam-wrapper.so')
 
         # Can be used to write pam tests in python
-        bld.SAMBA_PYTHON('pypamtest',
-                         source='python/pypamtest.c libpamtest.c',
-                         deps='dl pam',
-                         install=False)
+        for env in bld.gen_python_environments():
+            bld.SAMBA_PYTHON('pypamtest',
+                             source='python/pypamtest.c libpamtest.c',
+                             deps='dl pam',
+                             install=False)
index 72f1daa..9a86dfe 100644 (file)
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 
 import samba_git
+import Options
 import Utils
 import os
 import sys
@@ -56,6 +57,8 @@ def configure(conf):
         conf.RECURSE('nss_wrapper')
         conf.RECURSE('resolv_wrapper')
         conf.RECURSE('uid_wrapper')
+        if Options.options.with_pam:
+            conf.RECURSE('pam_wrapper')
 
 
 def build(bld):
@@ -88,3 +91,5 @@ def build(bld):
         bld.RECURSE('resolv_wrapper')
     if bld.CONFIG_GET('UID_WRAPPER'):
         bld.RECURSE('uid_wrapper')
+    if bld.CONFIG_GET('PAM_WRAPPER'):
+        bld.RECURSE('pam_wrapper')
diff --git a/wscript b/wscript
index 7dbaa90..b167102 100644 (file)
--- a/wscript
+++ b/wscript
@@ -176,6 +176,11 @@ def configure(conf):
             else:
                 conf.define('USING_SYSTEM_UID_WRAPPER', 1)
 
+            if not conf.CHECK_PAM_WRAPPER():
+                raise Utils.WafError('pam_wrapper package has not been found.\nIf third_party is installed, check that it is in the proper place.')
+            else:
+                conf.define('USING_SYSTEM_PAM_WRAPPER', 1)
+
     conf.RECURSE('lib/ldb')
 
     if not (Options.options.without_ad_dc):
@@ -204,8 +209,6 @@ def configure(conf):
     conf.RECURSE('lib/crypto')
     conf.RECURSE('pidl')
     if conf.CONFIG_GET('ENABLE_SELFTEST'):
-        if Options.options.with_pam:
-            conf.RECURSE('lib/pam_wrapper')
         if Options.options.with_ntvfs_fileserver != False:
             if not (Options.options.without_ad_dc):
                 conf.DEFINE('WITH_NTVFS_FILESERVER', 1)
index b7ebaae..253f95f 100644 (file)
@@ -67,8 +67,6 @@ bld.RECURSE('source4/lib/messaging')
 bld.RECURSE('source4/lib/events')
 bld.RECURSE('source4/lib/cmdline')
 bld.RECURSE('source4/lib/http')
-if bld.CONFIG_GET('PAM_WRAPPER') and Options.options.with_pam:
-    bld.RECURSE('lib/pam_wrapper')
 if bld.CHECK_FOR_THIRD_PARTY():
     bld.RECURSE('third_party')
 bld.RECURSE('source4/lib/stream')