Blame SOURCES/nss-pam-ldapd-0.8.12-validname.patch

09a3f6
Defaults changed to allow opening and closing parentheses everywhere.  Defaults
09a3f6
changed again to make characters after the first optional, and again to go back
09a3f6
to disallowing names which end with "\".
09a3f6
--- man/nslcd.conf.5.xml
09a3f6
+++ man/nslcd.conf.5.xml
09a3f6
@@ -712,7 +712,7 @@
09a3f6
        characters and the 'i' flag may be appended at the end to indicate
09a3f6
        that the match should be case-insensetive.
09a3f6
        The default value is
09a3f6
-       <literal>/^[a-z0-9._@$][a-z0-9._@$ \\~-]*[a-z0-9._@$~-]$/i</literal>
09a3f6
+       <literal>/^[a-z0-9._@$()]([a-z0-9._@$() \\~-]*[a-z0-9._@$()~-])?$/i</literal>
09a3f6
       </para>
09a3f6
      </listitem>
09a3f6
     </varlistentry>
09a3f6
--- nslcd/cfg.c
09a3f6
+++ nslcd/cfg.c
09a3f6
@@ -134,7 +134,7 @@ static void cfg_defaults(struct ldap_con
09a3f6
     cfg->ldc_pam_authz_search[i]=NULL;
09a3f6
   cfg->ldc_nss_min_uid=0;
09a3f6
   parse_validnames_statement(__FILE__,__LINE__,"",
09a3f6
-                "/^[a-z0-9._@$][a-z0-9._@$ \\~-]*[a-z0-9._@$~-]$/i",cfg);
09a3f6
+                "/^[a-z0-9._@$()]([a-z0-9._@$() \\~-]*[a-z0-9._@$()~-])?$/i",cfg);
09a3f6
   cfg->pam_password_prohibit_message=NULL;
09a3f6
 }
09a3f6
 
09a3f6
--- tests/test_common.c
09a3f6
+++ tests/test_common.c
09a3f6
@@ -39,6 +39,8 @@ static void test_isvalidname(void)
09a3f6
   assert(!isvalidname("\\foo\\bar"));
09a3f6
   assert(!isvalidname("foo\\bar\\"));
09a3f6
   assert(isvalidname("me")); /* try short name */
09a3f6
+  assert(isvalidname("f"));
09a3f6
+  assert(isvalidname("(foo bar)"));
09a3f6
 }
09a3f6
 
09a3f6
 /* the main program... */