[prev in list] [next in list] [prev in thread] [next in thread] 

List:       proftpd-committers
Subject:    [ProFTPD-committers] CVS: proftpd/contrib mod_ldap.c,1.89,1.90
From:       "John Morrissey" <jwm () users ! sourceforge ! net>
Date:       2010-08-26 21:50:39
Message-ID: E1OokLH-0008GV-JE () sfp-cvsdas-2 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Update of /cvsroot/proftp/proftpd/contrib
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv31752

Modified Files:
	mod_ldap.c 
Log Message:
sync with mod_ldap bzr r104:
  remove LDAPQuotas in favor of using the LDAPUsers configuration
  
  don't see a point in configuring quota lookups separately, since the quota
  attrs should be on the user entry itself. if ldap quota lookups should be
  disabled, "ldap:" can be removed QuotaLimitTable.
  
  this seems to cut down on duplicate configuration and hopefully continues
  the trend of making mod_ldap easier to configure.


Index: mod_ldap.c
===================================================================
RCS file: /cvsroot/proftp/proftpd/contrib/mod_ldap.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -r1.89 -r1.90
--- mod_ldap.c	18 Aug 2010 00:10:50 -0000	1.89
+++ mod_ldap.c	26 Aug 2010 21:50:37 -0000	1.90
@@ -22,7 +22,7 @@
  */
 
 /*
- * mod_ldap v2.9.0-20100804
+ * mod_ldap v2.9.0-20100826
  *
  * Thanks for patches go to (in alphabetical order):
  *
@@ -55,7 +55,7 @@
 #include "conf.h"
 #include "privs.h"
 
-#define MOD_LDAP_VERSION	"mod_ldap/2.9.0-20100804"
+#define MOD_LDAP_VERSION	"mod_ldap/2.9.0-20100826"
 
 #if PROFTPD_VERSION_NUMBER < 0x0001030103
 # error MOD_LDAP_VERSION " requires ProFTPD 1.3.1rc3 or later"
@@ -152,7 +152,6 @@
             *ldap_user_uid_filter,
             *ldap_gid_basedn, *ldap_group_gid_filter,
             *ldap_group_name_filter, *ldap_group_member_filter,
-            *ldap_quota_basedn, *ldap_quota_filter,
             *ldap_defaultauthscheme = "crypt", *ldap_authbind_dn,
             *ldap_genhdir_prefix, *ldap_default_quota,
             *ldap_attr_uid = "uid",
@@ -169,7 +168,7 @@
 #ifdef HAS_LDAP_INITIALIZE
 static char *ldap_server_url;
 #endif /* HAS_LDAP_INITIALIZE */
-static int ldap_do_users = 0, ldap_do_groups = 0, ldap_do_quotas = 0,
+static int ldap_do_users = 0, ldap_do_groups = 0,
            ldap_authbinds = 1, ldap_querytimeout = 0,
            ldap_genhdir = 0, ldap_genhdir_prefix_nouname = 0,
            ldap_forcedefaultuid = 0, ldap_forcedefaultgid = 0,
@@ -987,8 +986,8 @@
   if (cached_quota == NULL ||
       strcasecmp(((char **)cached_quota->elts)[0], cmd->argv[0]) != 0)
   {
-    if (pr_ldap_quota_lookup(cmd->tmp_pool, ldap_quota_filter,
-                             cmd->argv[0], ldap_quota_basedn) == FALSE)
+    if (pr_ldap_quota_lookup(cmd->tmp_pool, ldap_user_name_filter,
+                             cmd->argv[0], ldap_user_basedn) == FALSE)
     {
       return PR_DECLINED(cmd);
     }
@@ -1024,7 +1023,7 @@
 MODRET
 handle_ldap_setpwent(cmd_rec *cmd)
 {
-  if (!ldap_do_users && !ldap_do_groups && !ldap_do_quotas) {
+  if (!ldap_do_users && !ldap_do_groups) {
     return PR_DECLINED(cmd);
   }
 
@@ -1037,7 +1036,7 @@
 MODRET
 handle_ldap_endpwent(cmd_rec *cmd)
 {
-  if (!ldap_do_users && !ldap_do_groups && !ldap_do_quotas) {
+  if (!ldap_do_users && !ldap_do_groups) {
     return PR_DECLINED(cmd);
   }
 
@@ -1498,10 +1497,10 @@
 #endif /* HAS_LDAP_INITIALIZE */
 
       if (url->lud_dn && strcmp(url->lud_dn, "") != 0) {
-        CONF_ERROR(cmd, "A base DN may not be specified by an LDAPServer URL, only \
by LDAPUsers, LDAPGroups, or LDAPQuotas."); +        CONF_ERROR(cmd, "A base DN may \
not be specified by an LDAPServer URL, only by LDAPUsers or LDAPGroups.");  }
       if (url->lud_filter && strcmp(url->lud_filter, "") != 0) {
-        CONF_ERROR(cmd, "A search filter may not be specified by an LDAPServer URL, \
only by LDAPUsers, LDAPGroups, or LDAPQuotas."); +        CONF_ERROR(cmd, "A search \
filter may not be specified by an LDAPServer URL, only by LDAPUsers or LDAPGroups."); \
}  
       ldap_free_urldesc(url);
@@ -1861,21 +1860,12 @@
 }
 
 MODRET
-set_ldap_quotalookups(cmd_rec *cmd)
+set_ldap_defaultquota(cmd_rec *cmd)
 {
-  config_rec *c;
-
+  CHECK_ARGS(cmd, 1);
   CHECK_CONF(cmd, CONF_ROOT | CONF_VIRTUAL | CONF_GLOBAL);
 
-  c = add_config_param(cmd->argv[0], cmd->argc - 1, NULL);
-  c->argv[0] = pstrdup(c->pool, cmd->argv[1]);
-  if (cmd->argc > 2) {
-    c->argv[1] = pstrdup(c->pool, cmd->argv[2]);
-  }
-  if (cmd->argc > 3) {
-    c->argv[2] = pstrdup(c->pool, cmd->argv[3]);
-  }
-
+  add_config_param_str(cmd->argv[0], 1, cmd->argv[1]);
   return PR_HANDLED(cmd);
 }
 
@@ -2026,6 +2016,9 @@
 
   ldap_genhdir_prefix = (char *)get_param_ptr(main_server->conf, \
"LDAPGenerateHomedirPrefix", FALSE);  
+  ldap_default_quota = (char *)get_param_ptr(main_server->conf,
+    "LDAPDefaultQuota", FALSE);
+
   ptr = get_param_ptr(main_server->conf, "LDAPGenerateHomedirPrefixNoUsername", \
FALSE);  if (ptr) {
     ldap_genhdir_prefix_nouname = *((int *) ptr);
@@ -2058,23 +2051,6 @@
     }
   }
 
-  c = find_config(main_server->conf, CONF_PARAM, "LDAPQuotas", FALSE);
-  if (c != NULL) {
-    ldap_do_quotas = 1;
-    ldap_quota_basedn = pstrdup(session.pool, c->argv[0]);
-
-    if (c->argc > 1) {
-      ldap_quota_filter = pstrdup(session.pool, c->argv[1]);
-    } else {
-      ldap_quota_filter = pstrcat(session.pool,
-        "(&(", ldap_attr_uid, "=%v)(objectclass=posixAccount))", NULL);
-    }
-
-    if (c->argc > 2) {
-      ldap_default_quota = pstrdup(session.pool, c->argv[2]);
-    }
-  }
-
   return 0;
 }
 
@@ -2106,9 +2082,9 @@
   { "LDAPGenerateHomedirPrefix", set_ldap_genhdirprefix, NULL },
   { "LDAPGenerateHomedirPrefixNoUsername", set_ldap_genhdirprefixnouname, NULL },
   { "LDAPForceGeneratedHomedir", set_ldap_forcegenhdir, NULL },
+  { "LDAPDefaultQuota", set_ldap_defaultquota, NULL },
   { "LDAPGroups", set_ldap_grouplookups, NULL },
-  { "LDAPQuotas", set_ldap_quotalookups, NULL },
-  { NULL, NULL, NULL }
+  { NULL, NULL, NULL },
 };
 
 static cmdtable ldap_cmdtab[] = {


------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
ProFTPD Committers Mailing List
proftpd-committers@proftpd.org
https://lists.sourceforge.net/lists/listinfo/proftp-committers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic