Author: trasz
Date: Thu May  4 19:41:19 2017
New Revision: 317804
URL: https://svnweb.freebsd.org/changeset/base/317804

Log:
  Make automount(8) error out when the map name is missing.
  
  MFC after:    2 weeks

Modified:
  head/usr.sbin/autofs/common.c

Modified: head/usr.sbin/autofs/common.c
==============================================================================
--- head/usr.sbin/autofs/common.c       Thu May  4 19:16:36 2017        
(r317803)
+++ head/usr.sbin/autofs/common.c       Thu May  4 19:41:19 2017        
(r317804)
@@ -224,6 +224,7 @@ node_new_map(struct node *parent, char *
                n->n_options = options;
        else
                n->n_options = strdup("");
+       assert(map != NULL);
        n->n_map = map;
        assert(config_file != NULL);
        n->n_config_file = config_file;
@@ -1122,6 +1123,10 @@ parse_master_yyin(struct node *root, con
                ret = yylex();
                if (ret == 0 || ret == NEWLINE) {
                        if (mountpoint != NULL) {
+                               if (map == NULL) {
+                                       log_errx(1, "missing map name "
+                                           "at %s, line %d", master, lineno);
+                               }
                                //log_debugx("adding map for %s", mountpoint);
                                node_new_map(root, mountpoint, options, map,
                                    master, lineno);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to