lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1567 - nss-pam-ldapd/debian

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

nss-pam-ldapd commit: r1567 - nss-pam-ldapd/debian



Author: arthur
Date: Sat Dec 10 22:09:53 2011
New Revision: 1567
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1567&view=revision

Log:
get the first configuration value instead of the last because tha one is also 
written

Modified:
   nss-pam-ldapd/debian/nslcd.config

Modified: nss-pam-ldapd/debian/nslcd.config
==============================================================================
--- nss-pam-ldapd/debian/nslcd.config   Sat Dec 10 22:03:49 2011        (r1566)
+++ nss-pam-ldapd/debian/nslcd.config   Sat Dec 10 22:09:53 2011        (r1567)
@@ -21,7 +21,7 @@
 #
 
 # read a configuration value from the specified file
-# (it takes care in not overwriting a previously written value)
+# (it takes care in not overwriting a previously written debconf value)
 read_config()
 {
   debconf_param="$1"
@@ -29,7 +29,7 @@
   # overwrite debconf value if different from config file
   db_get "$debconf_param"
   debconf_value="$RET"
-  cfgfile_value=`sed -n 
's/^'"$cfg_param"'[[:space:]]*\([^[:space:]].*[^[:space:]]\)[[:space:]]*$/\1/ip'
 "$cfgfile" | tail -n 1`
+  cfgfile_value=`sed -n 
's/^'"$cfg_param"'[[:space:]]*\([^[:space:]].*[^[:space:]]\)[[:space:]]*$/\1/ip'
 "$cfgfile" | head -n 1`
   [ -n "$cfgfile_value" ] && [ "$debconf_value" != "$cfgfile_value" ] && 
db_set "$debconf_param" "$cfgfile_value"
   # we're done
   return 0
@@ -41,7 +41,7 @@
   domain=`hostname --domain` || true
   [ -z "$domain" ] && domain=`hostname --nis | grep '\.'` || true
   [ -z "$domain" ] && domain=`hostname --fqdn | sed -n 's/^[^.]*\.//p'` || true
-  [ -z "$domain" ] && domain=`sed -n 
's/^[[:space:]]*\(domain\|search\)[[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\2/p'
 /etc/resolv.conf | head -n 1` || true
+  [ -z "$domain" ] && domain=`sed -n 
's/^[[:space:]]*\(domain\|search\)[[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\2/p'
 /etc/resolv.conf | tail -n 1` || true
   echo "$domain"
 }
 
@@ -159,7 +159,7 @@
     if [ -z "$uris" ]
     then
       hosts=`sed -n 's/^host[[:space:]]*//ip' "$cfgfile"`
-      port=`sed -n 's/^port[[:space:]]*//ip' "$cfgfile" | tail -n 1`
+      port=`sed -n 's/^port[[:space:]]*//ip' "$cfgfile" | head -n 1`
       for host in $hosts
       do
         if [ -z "$port" ] || (echo "$host" | grep -q ':' )
@@ -198,7 +198,7 @@
   db_get nslcd/ldap-reqcert
   if [ -z "$RET" ]
   then
-    reqcert=`sed -n 
's/^tls_\(reqcert\|checkpeer\)[[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\2/ip' 
"$cfgfile" | tail -n 1`
+    reqcert=`sed -n 
's/^tls_\(reqcert\|checkpeer\)[[:space:]]*\([^[:space:]]*\)[[:space:]]*$/\2/ip' 
"$cfgfile" | head -n 1`
     # normalise value
     reqcert=`echo "$reqcert" | tr 'A-Z' 'a-z' | sed 
's/^no$/never/;s/^yes$/demand/;s/^hard$/demand/'`
     [ -n "$reqcert" ] && db_set nslcd/ldap-reqcert "$reqcert"
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/