|
|
6bbd11 |
autofs-5.1.0-beta1 - allow empty value in macro selectors
|
|
|
6bbd11 |
|
|
|
6bbd11 |
From: Ian Kent <raven@themaw.net>
|
|
|
6bbd11 |
|
|
|
6bbd11 |
Some map selectors (this case is olny considering macro selectors) may
|
|
|
6bbd11 |
be given the comparison value left blank, possibly with the intent the
|
|
|
6bbd11 |
selector will not match so a mount will not be attempted, such as when
|
|
|
6bbd11 |
the delay option is also given.
|
|
|
6bbd11 |
|
|
|
6bbd11 |
autofs doesn't implement the delay option but it shouldn't fail to parse
|
|
|
6bbd11 |
these locations so that a valid locations in the list can be tried.
|
|
|
6bbd11 |
---
|
|
|
6bbd11 |
CHANGELOG | 1 +
|
|
|
6bbd11 |
modules/amd_parse.y | 14 ++++++++++++++
|
|
|
6bbd11 |
modules/parse_amd.c | 9 +++++++--
|
|
|
6bbd11 |
3 files changed, 22 insertions(+), 2 deletions(-)
|
|
|
6bbd11 |
|
|
|
6bbd11 |
--- autofs-5.0.7.orig/CHANGELOG
|
|
|
6bbd11 |
+++ autofs-5.0.7/CHANGELOG
|
|
|
6bbd11 |
@@ -125,6 +125,7 @@
|
|
|
6bbd11 |
- fix multi entry ldap option handling.
|
|
|
6bbd11 |
- cleanup options in amd_parse.c
|
|
|
6bbd11 |
- allow empty value for some map options.
|
|
|
6bbd11 |
+- allow empty value in macro selectors.
|
|
|
6bbd11 |
|
|
|
6bbd11 |
25/07/2012 autofs-5.0.7
|
|
|
6bbd11 |
=======================
|
|
|
6bbd11 |
--- autofs-5.0.7.orig/modules/amd_parse.y
|
|
|
6bbd11 |
+++ autofs-5.0.7/modules/amd_parse.y
|
|
|
6bbd11 |
@@ -200,12 +200,26 @@ selection: SELECTOR IS_EQUAL SELECTOR_VA
|
|
|
6bbd11 |
YYABORT;
|
|
|
6bbd11 |
}
|
|
|
6bbd11 |
}
|
|
|
6bbd11 |
+ | SELECTOR IS_EQUAL
|
|
|
6bbd11 |
+ {
|
|
|
6bbd11 |
+ if (!make_selector($1, "", NULL, SEL_COMP_EQUAL)) {
|
|
|
6bbd11 |
+ amd_notify($1);
|
|
|
6bbd11 |
+ YYABORT;
|
|
|
6bbd11 |
+ }
|
|
|
6bbd11 |
+ }
|
|
|
6bbd11 |
| SELECTOR NOT_EQUAL SELECTOR_VALUE
|
|
|
6bbd11 |
{
|
|
|
6bbd11 |
if (!make_selector($1, $3, NULL, SEL_COMP_NOTEQUAL)) {
|
|
|
6bbd11 |
amd_notify($1);
|
|
|
6bbd11 |
YYABORT;
|
|
|
6bbd11 |
}
|
|
|
6bbd11 |
+ }
|
|
|
6bbd11 |
+ | SELECTOR NOT_EQUAL
|
|
|
6bbd11 |
+ {
|
|
|
6bbd11 |
+ if (!make_selector($1, "", NULL, SEL_COMP_EQUAL)) {
|
|
|
6bbd11 |
+ amd_notify($1);
|
|
|
6bbd11 |
+ YYABORT;
|
|
|
6bbd11 |
+ }
|
|
|
6bbd11 |
}
|
|
|
6bbd11 |
| SELECTOR LBRACKET SEL_ARG_VALUE RBRACKET
|
|
|
6bbd11 |
{
|
|
|
6bbd11 |
--- autofs-5.0.7.orig/modules/parse_amd.c
|
|
|
6bbd11 |
+++ autofs-5.0.7/modules/parse_amd.c
|
|
|
6bbd11 |
@@ -350,8 +350,13 @@ static int eval_selector(unsigned int lo
|
|
|
6bbd11 |
break;
|
|
|
6bbd11 |
|
|
|
6bbd11 |
case SEL_FLAG_NUM:
|
|
|
6bbd11 |
- res = atoi(v->val);
|
|
|
6bbd11 |
- val = atoi(s->comp.value);
|
|
|
6bbd11 |
+ if (!*s->comp.value) {
|
|
|
6bbd11 |
+ res = 1;
|
|
|
6bbd11 |
+ val = 0;
|
|
|
6bbd11 |
+ } else {
|
|
|
6bbd11 |
+ res = atoi(v->val);
|
|
|
6bbd11 |
+ val = atoi(s->comp.value);
|
|
|
6bbd11 |
+ }
|
|
|
6bbd11 |
if (s->compare & SEL_COMP_EQUAL && res == val) {
|
|
|
6bbd11 |
debug(logopt, MODPREFIX
|
|
|
6bbd11 |
"matched selector %s(%s) equal to %s",
|