summaryrefslogtreecommitdiffstats
path: root/usr.sbin/autofs/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/autofs/common.c')
-rw-r--r--usr.sbin/autofs/common.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/usr.sbin/autofs/common.c b/usr.sbin/autofs/common.c
index e6db682..6fd8a05 100644
--- a/usr.sbin/autofs/common.c
+++ b/usr.sbin/autofs/common.c
@@ -498,6 +498,19 @@ node_is_direct_map(const struct node *n)
return (true);
}
+bool
+node_has_wildcards(const struct node *n)
+{
+ const struct node *child;
+
+ TAILQ_FOREACH(child, &n->n_children, n_next) {
+ if (strcmp(child->n_key, "*") == 0)
+ return (true);
+ }
+
+ return (false);
+}
+
static void
node_expand_maps(struct node *n, bool indirect)
{
@@ -526,7 +539,7 @@ node_expand_maps(struct node *n, bool indirect)
log_debugx("map \"%s\" is a direct map, parsing",
child->n_map);
}
- parse_map(child, child->n_map, NULL);
+ parse_map(child, child->n_map, NULL, NULL);
}
}
@@ -996,7 +1009,8 @@ parse_included_map(struct node *parent, const char *map)
}
void
-parse_map(struct node *parent, const char *map, const char *key)
+parse_map(struct node *parent, const char *map, const char *key,
+ bool *wildcards)
{
char *path = NULL;
int error, ret;
@@ -1007,8 +1021,14 @@ parse_map(struct node *parent, const char *map, const char *key)
log_debugx("parsing map \"%s\"", map);
- if (map[0] == '-')
+ if (wildcards != NULL)
+ *wildcards = false;
+
+ if (map[0] == '-') {
+ if (wildcards != NULL)
+ *wildcards = true;
return (parse_special_map(parent, map, key));
+ }
if (map[0] == '/') {
path = checked_strdup(map);
@@ -1035,6 +1055,9 @@ parse_map(struct node *parent, const char *map, const char *key)
if (executable) {
log_debugx("map \"%s\" is executable", map);
+ if (wildcards != NULL)
+ *wildcards = true;
+
if (key != NULL) {
yyin = auto_popen(path, key, NULL);
} else {
OpenPOWER on IntegriCloud