diff options
author | trasz <trasz@FreeBSD.org> | 2014-08-31 21:53:42 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2014-08-31 21:53:42 +0000 |
commit | ea9facf035a27630270c4502346a663f0dbc2e45 (patch) | |
tree | beea0d97451d60b487b7209c8d0dced37a436842 | |
parent | d1036ec04d97c478ac585f50d8d98eb1dfc87c35 (diff) | |
download | FreeBSD-src-ea9facf035a27630270c4502346a663f0dbc2e45.zip FreeBSD-src-ea9facf035a27630270c4502346a663f0dbc2e45.tar.gz |
MFC r270405:
Don't fail on executable maps that return no entries. This turns useless
error message into useful one.
Sponsored by: The FreeBSD Foundation
-rw-r--r-- | usr.sbin/autofs/common.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/autofs/common.c b/usr.sbin/autofs/common.c index 7dffd95..205d152 100644 --- a/usr.sbin/autofs/common.c +++ b/usr.sbin/autofs/common.c @@ -716,7 +716,13 @@ parse_map_yyin(struct node *parent, const char *map, const char *executable_key) for (;;) { ret = yylex(); if (ret == 0 || ret == NEWLINE) { - if (key != NULL || options != NULL) { + /* + * In case of executable map, the key is always + * non-NULL, even if the map is empty. So, make sure + * we don't fail empty maps here. + */ + if ((key != NULL && executable_key == NULL) || + options != NULL) { log_errx(1, "truncated entry at %s, line %d", map, lineno); } |