Hi Ian,

Here is another trivial patch.  The connectathon test sweet does some
negative testing.  Here is a malformed entry that we will attempt to mount:

b1c                             /server.example.com

It turns out that we think this is a multimount entry, and the what string
is actually NULL!  The attached patch catches this before handing off to
the mount module.  This was the least intrusive fix I could think of, but
this could warrant further debate as to where in the parse code this should
be handled.

-Jeff

--- autofs-4.1.4/modules/parse_sun.c.orig       2005-04-29 16:34:40.133808256 
-0400
+++ autofs-4.1.4/modules/parse_sun.c    2005-04-29 16:36:27.975413840 -0400
@@ -678,6 +678,10 @@ static int sun_mount(const char *root, c
            "mounting root %s, mountpoint %s, what %s, fstype %s, options %s\n",
            root, mountpoint, what, fstype, options);
 
+       /* A malformed entry of the form key /xyz will trigger this case */
+       if (!what || *what == '\0')
+               return 1;
+
        if (!strcmp(fstype, "nfs")) {
                rv = mount_nfs->mount_mount(root, mountpoint, 
strlen(mountpoint),
                                            what, fstype, options, 
mount_nfs->context);

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

Reply via email to