lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1863 - in nss-pam-ldapd: . pynslcd

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1863 - in nss-pam-ldapd: . pynslcd



Author: arthur
Date: Sat Dec 15 12:13:35 2012
New Revision: 1863
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1863&view=revision

Log:
merge config.py into constants.py and generate it from configure

Added:
   nss-pam-ldapd/pynslcd/constants.py.in
      - copied, changed from r1862, nss-pam-ldapd/pynslcd/config.py.in
Deleted:
   nss-pam-ldapd/pynslcd/config.py.in
Modified:
   nss-pam-ldapd/.gitignore
   nss-pam-ldapd/configure.ac
   nss-pam-ldapd/pynslcd/   (props changed)
   nss-pam-ldapd/pynslcd/Makefile.am
   nss-pam-ldapd/pynslcd/pynslcd.py
   nss-pam-ldapd/pynslcd/tio.py

Modified: nss-pam-ldapd/.gitignore
==============================================================================
--- nss-pam-ldapd/.gitignore    Fri Dec 14 21:03:05 2012        (r1862)
+++ nss-pam-ldapd/.gitignore    Sat Dec 15 12:13:35 2012        (r1863)
@@ -50,7 +50,6 @@
 /nslcd/nslcd
 
 # /pynslcd/
-/pynslcd/config.py
 /pynslcd/constants.py
 
 # /tests/

Modified: nss-pam-ldapd/configure.ac
==============================================================================
--- nss-pam-ldapd/configure.ac  Fri Dec 14 21:03:05 2012        (r1862)
+++ nss-pam-ldapd/configure.ac  Sat Dec 15 12:13:35 2012        (r1863)
@@ -767,6 +767,14 @@
 
 # generate files
 AC_CONFIG_FILES([Makefile compat/Makefile common/Makefile nss/Makefile
-                 pam/Makefile nslcd/Makefile pynslcd/Makefile pynslcd/config.py
+                 pam/Makefile nslcd/Makefile pynslcd/Makefile
                  man/Makefile tests/Makefile])
+AC_CONFIG_FILES([pynslcd/constants.py], [[
+(
+  echo ''
+  echo '# The following is automatically generated from nslcd.h.'
+  echo '# See that file for details.'
+  echo ''
+  sed -n 's| */\*.*\*/ *||;s/^.define  *\(NSLCD_[A-Z_]*\)  */\1 = /p' 
"$srcdir"/nslcd.h
+) >> pynslcd/constants.py]])
 AC_OUTPUT

Modified: nss-pam-ldapd/pynslcd/Makefile.am
==============================================================================
--- nss-pam-ldapd/pynslcd/Makefile.am   Fri Dec 14 21:03:05 2012        (r1862)
+++ nss-pam-ldapd/pynslcd/Makefile.am   Sat Dec 15 12:13:35 2012        (r1863)
@@ -23,7 +23,7 @@
                  mypidfile.py tio.py \
                  alias.py ether.py group.py host.py netgroup.py network.py \
                  pam.py passwd.py protocol.py rpc.py service.py shadow.py
-nodist_pynslcd_PYTHON = constants.py config.py
+nodist_pynslcd_PYTHON = constants.py
 CLEANFILES = $(nodist_pynslcd_PYTHON)
 
 all-local: $(nodist_pynslcd_PYTHON)
@@ -37,11 +37,3 @@
        chmod a+rx $(DESTDIR)$(pynslcddir)/pynslcd.py
        $(MKDIR_P) $(DESTDIR)$(sbindir)
        [ -L $(DESTDIR)$(sbindir)/pynslcd ] || $(LN_S) $(pynslcddir)/pynslcd.py 
$(DESTDIR)$(sbindir)/pynslcd
-
-# generate constants module
-constants.py: $(top_srcdir)/nslcd.h Makefile
-       ( echo "# This file is automatically generated from nslcd.h." ; \
-         echo "# See that file for details." ; \
-         echo "" ; \
-         sed -n 's| */\*.*\*/ *||;s/^.define  *\(NSLCD_[A-Z_]*\)  */\1 = /p' \
-             $(top_srcdir)/nslcd.h ) > $@

Copied and modified: nss-pam-ldapd/pynslcd/constants.py.in (from r1862, 
nss-pam-ldapd/pynslcd/config.py.in)
==============================================================================
--- nss-pam-ldapd/pynslcd/config.py.in  Fri Dec 14 21:03:05 2012        (r1862, 
copy source)
+++ nss-pam-ldapd/pynslcd/constants.py.in       Sat Dec 15 12:13:35 2012        
(r1863)
@@ -1,6 +1,8 @@
 
-# config.py.in - configured information, this file is processed by the
-#                configure script to produce config.py
+# constants.py - configured information and constants, this file is processed
+#                and extended by the configure script
+#
+# Copyright (C) 2012 Arthur de Jong
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public

Modified: nss-pam-ldapd/pynslcd/pynslcd.py
==============================================================================
--- nss-pam-ldapd/pynslcd/pynslcd.py    Fri Dec 14 21:03:05 2012        (r1862)
+++ nss-pam-ldapd/pynslcd/pynslcd.py    Sat Dec 15 12:13:35 2012        (r1863)
@@ -31,10 +31,9 @@
 import ldap
 
 from tio import TIOStream
-import cfg        # from nslcd.conf
+import cfg
 import common
-import config     # from configure
-import constants  # from nslcd.h
+import constants
 import mypidfile
 
 
@@ -95,7 +94,7 @@
              'Copyright (C) 2010-2012 Arthur de Jong\n'
              'This is free software; see the source for copying conditions.  
There is NO\n'
              'warranty; not even for MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE.\n'
-             % {'PACKAGE_STRING': config.PACKAGE_STRING, })
+             % {'PACKAGE_STRING': constants.PACKAGE_STRING, })
 
 
 def display_usage(fp):
@@ -108,7 +107,7 @@
              "\n"
              "Report bugs to <%(PACKAGE_BUGREPORT)s>.\n"
              % {'program_name': program_name,
-                'PACKAGE_BUGREPORT': config.PACKAGE_BUGREPORT, })
+                'PACKAGE_BUGREPORT': constants.PACKAGE_BUGREPORT, })
 
 
 def parse_cmdline():
@@ -149,15 +148,15 @@
     sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
     # remove existing named socket
     try:
-        os.unlink(config.NSLCD_SOCKET)
+        os.unlink(constants.NSLCD_SOCKET)
     except OSError:
         pass  # ignore any problems
     # bind to named socket
-    sock.bind(config.NSLCD_SOCKET)
+    sock.bind(constants.NSLCD_SOCKET)
     # close the file descriptor on exit
     fcntl.fcntl(sock, fcntl.F_SETFD, fcntl.FD_CLOEXEC)
     # set permissions of socket so anybody can do requests
-    os.chmod(config.NSLCD_SOCKET, 0666)
+    os.chmod(constants.NSLCD_SOCKET, 0666)
     # start listening for connections
     sock.listen(socket.SOMAXCONN)
     return sock
@@ -230,7 +229,7 @@
 def disable_nss_ldap():
     """Disable the nss_ldap module to avoid lookup loops."""
     import ctypes
-    lib = ctypes.CDLL(config.NSS_LDAP_SONAME)
+    lib = ctypes.CDLL(constants.NSS_LDAP_SONAME)
     ctypes.c_int.in_dll(lib, '_nss_ldap_enablelookups').value = 0
 
 
@@ -284,7 +283,7 @@
     #if myldap_set_debuglevel(cfg.debug) != LDAP_SUCCESS:
     #    sys.exit(1)
     # read configuration file
-    cfg.read(config.NSLCD_CONF_PATH)
+    cfg.read(constants.NSLCD_CONF_PATH)
     # set process title
     try:
         import setproctitle
@@ -294,19 +293,19 @@
     # set a default umask for the pidfile and socket
     os.umask(0022)
     # see if someone already locked the pidfile
-    pidfile = mypidfile.MyPIDLockFile(config.NSLCD_PIDFILE)
+    pidfile = mypidfile.MyPIDLockFile(constants.NSLCD_PIDFILE)
     # see if --check option was given
     if checkonly:
         if pidfile.is_locked():
-            logging.debug('pidfile (%s) is locked', config.NSLCD_PIDFILE)
+            logging.debug('pidfile (%s) is locked', constants.NSLCD_PIDFILE)
             sys.exit(0)
         else:
-            logging.debug('pidfile (%s) is not locked', config.NSLCD_PIDFILE)
+            logging.debug('pidfile (%s) is not locked', 
constants.NSLCD_PIDFILE)
             sys.exit(1)
     # normal check for pidfile locked
     if pidfile.is_locked():
         logging.error('daemon may already be active, cannot acquire lock (%s)',
-                      config.NSLCD_PIDFILE)
+                      constants.NSLCD_PIDFILE)
         sys.exit(1)
     # daemonize
     if debugging:
@@ -324,7 +323,7 @@
         # start normal logging to syslog
         if not debugging:
             logging.getLogger().addHandler(sysloghandler)
-        logging.info('version %s starting', config.VERSION)
+        logging.info('version %s starting', constants.VERSION)
         try:
             # create socket
             nslcd_serversocket = create_socket()

Modified: nss-pam-ldapd/pynslcd/tio.py
==============================================================================
--- nss-pam-ldapd/pynslcd/tio.py        Fri Dec 14 21:03:05 2012        (r1862)
+++ nss-pam-ldapd/pynslcd/tio.py        Sat Dec 15 12:13:35 2012        (r1863)
@@ -26,13 +26,13 @@
 # definition for reading and writing INT32 values
 _int32 = struct.Struct('i')
 
-# FIXME: use something from config.py to determine the correct size
+# FIXME: use something from constants.py to determine the correct size
 _uid_t = struct.Struct('i')
 
-# FIXME: use something from config.py to determine the correct size
+# FIXME: use something from constants.py to determine the correct size
 _gid_t = struct.Struct('i')
 
-# FIXME: use something from config.py to determine the correct size
+# FIXME: use something from constants.py to determine the correct size
 _struct_timeval = struct.Struct('ll')
 
 
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/