This is apparently a legal format for a multi-mount map:

g3b     segfault.boston.redhat.com:/export/automount/export5/testing/test \
        /s1     segfault.boston.redhat.com:/export/automount/export2 \
        /s2     segfault.boston.redhat.com:/export/automount/export3

The first entry is an implied root level entry, or '/'.  Solaris handles
this case just fine, and the automounter test sweet uses this as one of its
tests.  The attached patch causes this map format to be recognized.  I
think the patch could probably re-use the memory allocatd for "path" by the
dequote function.  That's up to you, Ian, if you want to change that to be
a little prettier.

-Jeff

--- autofs-4.1.4/modules/parse_sun.c.orig       2005-04-29 15:39:39.604564968 
-0400
+++ autofs-4.1.4/modules/parse_sun.c    2005-04-29 15:47:00.661514120 -0400
@@ -886,7 +886,18 @@ int parse_mount(const char *root, const 
                                return 1;
                        }
 
-                       p += l;
+                       if (*path != '/') {
+                               free(path);
+                               path = strdup("/");
+                               if (!path) {
+                                       error(MODPREFIX "out of memory");
+                                       free(myoptions);
+                                       free(options);
+                                       multi_free_list(head);
+                                       return 1;
+                               }
+                       } else
+                               p += l;
                        p = skipspace(p);
 
                        /* Local options are appended to per-map options */

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to