lists.arthurdejong.org
RSS feed

nss-pam-ldapd branch master updated. 0.9.8-1-g8f76d24

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

nss-pam-ldapd branch master updated. 0.9.8-1-g8f76d24



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "nss-pam-ldapd".

The branch, master has been updated
       via  8f76d24b5e08c1d3670f3ab7399d71a1f8b330ef (commit)
      from  47fd03bc80d470de881c025ff934325bd7def0b5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://arthurdejong.org/git/nss-pam-ldapd/commit/?id=8f76d24b5e08c1d3670f3ab7399d71a1f8b330ef

commit 8f76d24b5e08c1d3670f3ab7399d71a1f8b330ef
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Fri Oct 13 14:43:07 2017 +0200

    Support spaces in attribute mapping expressions

diff --git a/nslcd/cfg.c b/nslcd/cfg.c
index 530ab28..a6cfeb3 100644
--- a/nslcd/cfg.c
+++ b/nslcd/cfg.c
@@ -802,7 +802,7 @@ static void handle_map(const char *filename, int lnr,
 {
   enum ldap_map_selector map;
   const char **var;
-  char oldatt[32], newatt[1024];
+  char oldatt[32], *newatt;
   /* get the map */
   if ((map = get_map(&line)) == LM_NONE)
   {
@@ -811,10 +811,8 @@ static void handle_map(const char *filename, int lnr,
   }
   /* read the other tokens */
   check_argumentcount(filename, lnr, keyword,
-                      (get_token(&line, oldatt, sizeof(oldatt)) != NULL) &&
-                      (get_token(&line, newatt, sizeof(newatt)) != NULL));
-  /* check that there are no more tokens left on the line */
-  get_eol(filename, lnr, keyword, &line);
+                      (get_token(&line, oldatt, sizeof(oldatt)) != NULL));
+  newatt = get_linedup(filename, lnr, keyword, &line);
   /* change attribute mapping */
   var = attmap_get_var(map, oldatt);
   if (var == NULL)
@@ -829,6 +827,7 @@ static void handle_map(const char *filename, int lnr,
             filename, lnr, oldatt);
     exit(EXIT_FAILURE);
   }
+  free(newatt);
 }
 
 #ifdef LDAP_OPT_X_TLS
diff --git a/tests/test_cfg.c b/tests/test_cfg.c
index 6f36460..2ae24bc 100644
--- a/tests/test_cfg.c
+++ b/tests/test_cfg.c
@@ -203,7 +203,8 @@ static void test_read(void)
           "base dc=test, dc=tld\n"
           "base passwd ou=Some People,dc=test,dc=tld\n"
           "map\tpasswd uid\t\tsAMAccountName\n"
-          "map passwd homeDirectory \"${homeDirectory:-/home/$uid}\"\n"
+          "map passwd homeDirectory \"${homeDirectory:-/home/$uid}\"  \n"
+          "map    passwd gecos            \"${givenName}. ${sn}\"\n"
           "filter group (&(objeclClass=posixGroup)(gid=1*))\n"
           "\n"
           "scope passwd one\n"
@@ -223,6 +224,8 @@ static void test_read(void)
   assertstreq(cfg.bases[0], "dc=test, dc=tld");
   assertstreq(passwd_bases[0], "ou=Some People,dc=test,dc=tld");
   assertstreq(attmap_passwd_uid, "sAMAccountName");
+  assertstreq(attmap_passwd_homeDirectory, "\"${homeDirectory:-/home/$uid}\"");
+  assertstreq(attmap_passwd_gecos, "\"${givenName}. ${sn}\"");
   assertstreq(group_filter, "(&(objeclClass=posixGroup)(gid=1*))");
   assert(passwd_scope == LDAP_SCOPE_ONELEVEL);
   assert(cfg.cache_dn2uid_positive == 10 * 60);

-----------------------------------------------------------------------

Summary of changes:
 nslcd/cfg.c      | 9 ++++-----
 tests/test_cfg.c | 5 ++++-
 2 files changed, 8 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
nss-pam-ldapd
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
https://lists.arthurdejong.org/nss-pam-ldapd-commits/