lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1423 - nss-pam-ldapd/nslcd

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

nss-pam-ldapd commit: r1423 - nss-pam-ldapd/nslcd



Author: arthur
Date: Sun Apr  3 23:10:09 2011
New Revision: 1423
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1423

Log:
make user and group name validation errors a little more informative

Modified:
   nss-pam-ldapd/nslcd/group.c
   nss-pam-ldapd/nslcd/pam.c
   nss-pam-ldapd/nslcd/passwd.c

Modified: nss-pam-ldapd/nslcd/group.c
==============================================================================
--- nss-pam-ldapd/nslcd/group.c Thu Mar 31 22:50:27 2011        (r1422)
+++ nss-pam-ldapd/nslcd/group.c Sun Apr  3 23:10:09 2011        (r1423)
@@ -161,7 +161,7 @@
   {
     if (!isvalidname(names[i]))
     {
-      log_log(LOG_WARNING,"group entry %s contains invalid group name: \"%s\"",
+      log_log(LOG_WARNING,"group entry %s name denied by validnames option: 
\"%s\"",
                           myldap_get_dn(entry),names[i]);
     }
     else if ((reqname==NULL)||(strcmp(reqname,names[i])==0))
@@ -287,7 +287,7 @@
   READ_STRING(fp,name);
   log_setrequest("group=\"%s\"",name);
   if (!isvalidname(name)) {
-    log_log(LOG_WARNING,"\"%s\": invalid group name",name);
+    log_log(LOG_WARNING,"\"%s\": name denied by validnames option",name);
     return -1;
   },
   NSLCD_ACTION_GROUP_BYNAME,
@@ -314,7 +314,7 @@
   log_setrequest("group/member=\"%s\"",name);
   if (!isvalidname(name))
   {
-    log_log(LOG_WARNING,"\"%s\": invalid user name",name);
+    log_log(LOG_WARNING,"\"%s\": name denied by validnames option",name);
     return -1;
   }
   if ((nslcd_cfg->ldc_nss_initgroups_ignoreusers!=NULL)&&

Modified: nss-pam-ldapd/nslcd/pam.c
==============================================================================
--- nss-pam-ldapd/nslcd/pam.c   Thu Mar 31 22:50:27 2011        (r1422)
+++ nss-pam-ldapd/nslcd/pam.c   Sun Apr  3 23:10:09 2011        (r1423)
@@ -91,7 +91,7 @@
   /* check username for validity */
   if (!isvalidname(username))
   {
-    log_log(LOG_WARNING,"\"%s\": invalid user name",username);
+    log_log(LOG_WARNING,"\"%s\": name denied by validnames option",username);
     return LDAP_NO_SUCH_OBJECT;
   }
   /* look up user DN if not known */
@@ -127,7 +127,8 @@
     /* check the username */
     if ((value==NULL)||!isvalidname(value)||strlen(value)>=usernamesz)
     {
-      log_log(LOG_WARNING,"\"%s\": DN %s has invalid 
username",username,userdn);
+      log_log(LOG_WARNING,"passwd entry %s name denied by validnames option: 
\"%s\"",
+                          userdn,username);
       return LDAP_INVALID_SYNTAX;
     }
     /* check if the username is different and update it if needed */

Modified: nss-pam-ldapd/nslcd/passwd.c
==============================================================================
--- nss-pam-ldapd/nslcd/passwd.c        Thu Mar 31 22:50:27 2011        (r1422)
+++ nss-pam-ldapd/nslcd/passwd.c        Sun Apr  3 23:10:09 2011        (r1423)
@@ -436,7 +436,7 @@
     {
       if (!isvalidname(usernames[i]))
       {
-        log_log(LOG_WARNING,"passwd entry %s contains invalid user name: 
\"%s\"",
+        log_log(LOG_WARNING,"passwd entry %s denied by validnames option: 
\"%s\"",
                             myldap_get_dn(entry),usernames[i]);
       }
       else
@@ -467,7 +467,7 @@
   READ_STRING(fp,name);
   log_setrequest("passwd=\"%s\"",name);
   if (!isvalidname(name)) {
-    log_log(LOG_WARNING,"\"%s\": invalid user name",name);
+    log_log(LOG_WARNING,"\"%s\": name denied by validnames option",name);
     return -1;
   },
   NSLCD_ACTION_PASSWD_BYNAME,
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits