rpms/autofs/F-7 autofs-5.0.1-allow-ldap-star-wild.patch, NONE, 1.1 autofs-5.0.2-dont-fail-on-empty-master.patch, NONE, 1.1 autofs-5.0.2-ldap-percent-hack.patch, NONE, 1.1 autofs.spec, 1.213, 1.214
Ian Kent (iankent)
fedora-extras-commits at redhat.com
Tue Aug 21 04:07:40 UTC 2007
Author: iankent
Update of /cvs/pkgs/rpms/autofs/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30146
Modified Files:
autofs.spec
Added Files:
autofs-5.0.1-allow-ldap-star-wild.patch
autofs-5.0.2-dont-fail-on-empty-master.patch
autofs-5.0.2-ldap-percent-hack.patch
Log Message:
* Tue Aug 21 2007 Ian Kent <ikent at redhat.com> - 5.0.2-24
- don't fail on empty master map.
- allow for older schemas that allow "*" as a key value.
- add support for the "%" hack for case insensitive attribute schemas.
autofs-5.0.1-allow-ldap-star-wild.patch:
--- NEW FILE autofs-5.0.1-allow-ldap-star-wild.patch ---
diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
index ac3a272..62848d5 100644
--- a/modules/lookup_ldap.c
+++ b/modules/lookup_ldap.c
@@ -1213,16 +1213,57 @@ static int read_one_map(struct autofs_point *ap,
* By definition keys must be unique within
* each map entry
*/
- if (ldap_count_values_len(bvKey) > 1) {
+ k_val = NULL;
+ k_len = 0;
+
+ /*
+ * Keys must be unique so, in general, there shouldn't be
+ * more than one attribute value. We make an exception for
+ * wildcard entries as people may have values for '*' or
+ * '/' for compaibility reasons. We use the '/' as the
+ * wildcard in LDAP but allow '*' as well to allow for
+ * people using older schemas that allow '*' as a key
+ * value.
+ */
+ count = ldap_count_values_len(bvKey);
+ if (count > 2) {
error(ap->logopt,
MODPREFIX
"key %.*s has duplicate entries - ignoring",
bvKey[0]->bv_len, bvKey[0]->bv_val);
goto next;
- }
+ } else if (count == 2) {
+ unsigned int i;
+
+ /* Check for the "/" and "*" and use as "/" if found */
+ for (i = 0; i < count; i++) {
+ /* check for wildcard */
+ if (bvKey[i]->bv_len != 1)
+ continue;
+ if (*bvKey[i]->bv_val != '/' &&
+ *bvKey[i]->bv_val != '*')
+ continue;
+ /* always use '/' internally */
+ *bvKey[i]->bv_val = '/';
+ k_val = bvKey[i]->bv_val;
+ k_len = 1;
+ break;
+ }
- k_val = bvKey[0]->bv_val;
- k_len = bvKey[0]->bv_len;
+ if (!k_val) {
+ error(ap->logopt,
+ MODPREFIX
+ "key %.*s has duplicate entries - ignoring",
+ bvKey[0]->bv_len, bvKey[0]->bv_val);
+ goto next;
+ }
+ } else {
+ /* Check for the "*" and use as "/" if found */
+ if (bvKey[0]->bv_len == 1 && *bvKey[0]->bv_val == '*')
+ *bvKey[0]->bv_val = '/';
+ k_val = bvKey[0]->bv_val;
+ k_len = bvKey[0]->bv_len;
+ }
/*
* Ignore keys beginning with '+' as plus map
@@ -1455,19 +1496,60 @@ static int lookup_one(struct autofs_point *ap,
}
/* By definition keys must be unique within each map entry */
- if (ldap_count_values_len(bvKey) > 1) {
+ k_val = NULL;
+ k_len = 0;
+
+ /*
+ * Keys must be unique so, in general, there shouldn't be
+ * more than one attribute value. We make an exception for
+ * wildcard entries as people may have values for '*' or
+ * '/' for compaibility reasons. We use the '/' as the
+ * wildcard in LDAP but allow '*' as well to allow for
+ * people using older schemas that allow '*' as a key
+ * value.
+ */
+ count = ldap_count_values_len(bvKey);
+ if (count > 2) {
error(ap->logopt,
- MODPREFIX "key %.*s has duplicate entries",
+ MODPREFIX
+ "key %.*s has duplicate entries - ignoring",
bvKey[0]->bv_len, bvKey[0]->bv_val);
- ret = CHE_FAIL;
goto next;
+ } else if (count == 2) {
+ unsigned int i;
+
+ /* Check for the "/" and "*" and use as "/" if found */
+ for (i = 0; i < count; i++) {
+ /* check for wildcard */
+ if (bvKey[i]->bv_len != 1)
+ continue;
+ if (*bvKey[i]->bv_val != '/' &&
+ *bvKey[i]->bv_val != '*')
+ continue;
+ /* always use '/' internally */
+ *bvKey[i]->bv_val = '/';
+ k_val = bvKey[i]->bv_val;
+ k_len = 1;
+ break;
+ }
+
+ if (!k_val) {
+ error(ap->logopt,
+ MODPREFIX "key %.*s has duplicate entries",
+ bvKey[0]->bv_len, bvKey[0]->bv_val);
+ ret = CHE_FAIL;
+ goto next;
+ }
+ } else {
+ /* Check for the "*" and use as "/" if found */
+ if (bvKey[0]->bv_len == 1 && *bvKey[0]->bv_val == '*')
+ *bvKey[0]->bv_val = '/';
+ k_val = bvKey[0]->bv_val;
+ k_len = bvKey[0]->bv_len;
}
debug(ap->logopt, MODPREFIX "examining first entry");
- k_val = bvKey[0]->bv_val;
- k_len = bvKey[0]->bv_len;
-
bvValues = ldap_get_values_len(ldap, e, info);
if (!bvValues || !*bvValues) {
debug(ap->logopt,
autofs-5.0.2-dont-fail-on-empty-master.patch:
--- NEW FILE autofs-5.0.2-dont-fail-on-empty-master.patch ---
diff --git a/lib/master.c b/lib/master.c
index 4d31959..9f24f7e 100644
--- a/lib/master.c
+++ b/lib/master.c
@@ -803,7 +803,7 @@ int master_read_master(struct master *master, time_t age, int readall)
if (list_empty(&master->mounts)) {
master_mutex_unlock();
error(LOGOPT_ANY, "no mounts in table");
- return 0;
+ return 1;
}
master_mutex_unlock();
autofs-5.0.2-ldap-percent-hack.patch:
--- NEW FILE autofs-5.0.2-ldap-percent-hack.patch ---
diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
index de8d515..a412797 100644
--- a/modules/lookup_ldap.c
+++ b/modules/lookup_ldap.c
@@ -1210,50 +1210,68 @@ static int read_one_map(struct autofs_point *ap,
}
/*
- * By definition keys must be unique within
- * each map entry
+ * By definition keys should be unique within each map entry,
+ * but as always there are exceptions.
*/
k_val = NULL;
k_len = 0;
/*
- * Keys must be unique so, in general, there shouldn't be
+ * Keys should be unique so, in general, there shouldn't be
* more than one attribute value. We make an exception for
* wildcard entries as people may have values for '*' or
* '/' for compaibility reasons. We use the '/' as the
* wildcard in LDAP but allow '*' as well to allow for
* people using older schemas that allow '*' as a key
- * value.
+ * value. Another case where there can be multiple key
+ * values is when people have used the "%" hack to specify
+ * case matching ctriteria in a caase insensitive attribute.
*/
count = ldap_count_values_len(bvKey);
- if (count > 2) {
- error(ap->logopt,
- MODPREFIX
- "key %.*s has duplicate entries - ignoring",
- bvKey[0]->bv_len, bvKey[0]->bv_val);
- goto next;
- } else if (count == 2) {
+ if (count > 1) {
unsigned int i;
/* Check for the "/" and "*" and use as "/" if found */
for (i = 0; i < count; i++) {
- /* check for wildcard */
- if (bvKey[i]->bv_len != 1)
+ bvKey[i]->bv_val[bvKey[i]->bv_len] = '\0';
+
+ /*
+ * If multiple entries are present they could
+ * be the result of people using the "%" hack so
+ * ignore them.
+ */
+ if (strchr(bvKey[i]->bv_val, '%'))
continue;
- if (*bvKey[i]->bv_val != '/' &&
- *bvKey[i]->bv_val != '*')
- continue;
- /* always use '/' internally */
- *bvKey[i]->bv_val = '/';
+
+ /* check for wildcard */
+ if (bvKey[i]->bv_len == 1 &&
+ (*bvKey[i]->bv_val == '/' ||
+ *bvKey[i]->bv_val == '*')) {
+ /* always use '/' internally */
+ *bvKey[i]->bv_val = '/';
+ k_val = bvKey[i]->bv_val;
+ k_len = 1;
+ break;
+ }
+
+ /*
+ * We have a result from LDAP so this is a
+ * valid entry. Set the result to the LDAP
+ * key that isn't a wildcard and doesn't have
+ * any "%" hack values present. This should be
+ * the case insensitive match string for the
+ * nis schema, the default value.
+ */
k_val = bvKey[i]->bv_val;
- k_len = 1;
+ k_len = bvKey[i]->bv_len;
+
break;
}
if (!k_val) {
error(ap->logopt,
MODPREFIX
- "key %.*s has duplicate entries - ignoring",
+ "invalid entry %.*s - ignoring",
bvKey[0]->bv_len, bvKey[0]->bv_val);
goto next;
}
@@ -1495,7 +1513,10 @@ static int lookup_one(struct autofs_point *ap,
continue;
}
- /* By definition keys must be unique within each map entry */
+ /*
+ * By definition keys should be unique within each map entry,
+ * but as always there are exceptions.
+ */
k_val = NULL;
k_len = 0;
@@ -1506,37 +1527,53 @@ static int lookup_one(struct autofs_point *ap,
* '/' for compaibility reasons. We use the '/' as the
* wildcard in LDAP but allow '*' as well to allow for
* people using older schemas that allow '*' as a key
- * value.
+ * value. Another case where there can be multiple key
+ * values is when people have used the "%" hack to specify
+ * case matching ctriteria in a caase insensitive attribute.
*/
count = ldap_count_values_len(bvKey);
- if (count > 2) {
- error(ap->logopt,
- MODPREFIX
- "key %.*s has duplicate entries - ignoring",
- bvKey[0]->bv_len, bvKey[0]->bv_val);
- goto next;
- } else if (count == 2) {
+ if (count > 1) {
unsigned int i;
/* Check for the "/" and "*" and use as "/" if found */
for (i = 0; i < count; i++) {
- /* check for wildcard */
- if (bvKey[i]->bv_len != 1)
- continue;
- if (*bvKey[i]->bv_val != '/' &&
- *bvKey[i]->bv_val != '*')
+ bvKey[i]->bv_val[bvKey[i]->bv_len] = '\0';
+
+ /*
+ * If multiple entries are present they could
+ * be the result of people using the "%" hack so
+ * ignore them.
+ */
+ if (strchr(bvKey[i]->bv_val, '%'))
continue;
- /* always use '/' internally */
- *bvKey[i]->bv_val = '/';
- k_val = bvKey[i]->bv_val;
- k_len = 1;
+
+ /* check for wildcard */
+ if (bvKey[i]->bv_len == 1 &&
+ (*bvKey[i]->bv_val == '/' ||
+ *bvKey[i]->bv_val == '*')) {
+ /* always use '/' internally */
+ *bvKey[i]->bv_val = '/';
+ k_val = bvKey[i]->bv_val;
+ k_len = 1;
+ break;
+ }
+
+ /*
+ * The key was matched by LDAP so this is a
+ * valid entry. Set the result key to the
+ * lookup key to provide the mixed case
+ * matching provided by the "%" hack.
+ */
+ k_val = qKey;
+ k_len = strlen(qKey);
+
break;
}
if (!k_val) {
error(ap->logopt,
- MODPREFIX "key %.*s has duplicate entries",
- bvKey[0]->bv_len, bvKey[0]->bv_val);
+ MODPREFIX "no valid key found for %.*s",
+ qKey_len, qKey);
ret = CHE_FAIL;
goto next;
}
Index: autofs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/autofs/F-7/autofs.spec,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -r1.213 -r1.214
--- autofs.spec 30 Jul 2007 09:30:24 -0000 1.213
+++ autofs.spec 21 Aug 2007 04:07:07 -0000 1.214
@@ -4,7 +4,7 @@
Summary: A tool for automatically mounting and unmounting filesystems
Name: autofs
Version: 5.0.1
-Release: 23
+Release: 24
Epoch: 1
License: GPL
Group: System Environment/Daemons
@@ -38,6 +38,9 @@
Patch26: autofs-5.0.2-fix-nfs-version-in-get-supported-ver-and-cost.patch
Patch27: autofs-5.0.1-instance-stale-mark.patch
Patch28: autofs-5.0.1-fix-largefile-dumbness.patch
+Patch29: autofs-5.0.2-dont-fail-on-empty-master.patch
+Patch30: autofs-5.0.1-allow-ldap-star-wild.patch
+Patch31: autofs-5.0.2-ldap-percent-hack.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, libxml2-devel, cyrus-sasl-devel, openssl-devel
Conflicts: kernel < 2.6.17
@@ -107,6 +110,9 @@
%patch26 -p1
%patch27 -p1
%patch28 -p1
+%patch29 -p1
+%patch30 -p1
+%patch31 -p1
%build
#CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@@ -159,6 +165,11 @@
%{_libdir}/autofs/
%changelog
+* Tue Aug 21 2007 Ian Kent <ikent at redhat.com> - 5.0.2-24
+- don't fail on empty master map.
+- allow for older schemas that allow "*" as a key value.
+- add support for the "%" hack for case insensitive attribute schemas.
+
* Mon Jul 30 2007 Ian Kent <ikent at redhat.com> - 5.0.1-23
- mark map instances stale so they aren't "cleaned" during updates.
- fix large file compile time option.
More information about the fedora-extras-commits
mailing list