Hi

I'm the new Debian autofs Maintainer. As such, I had the
privilege to merge 1092 lines of many small patches when
updating to 4.1.3 ...

Here the updated patches that address issues that I couldn't see
fixed otherwise.




Mount is called like this "mount -t fstype -o what fullpath"
because options is allocated but empty.

--- autofs-4.1.3/modules/mount_changer.c.orig   2004-05-10 14:44:30.000000000 +0200
+++ autofs-4.1.3/modules/mount_changer.c        2004-09-03 23:49:18.000000000 +0200
@@ -94,7 +94,7 @@
        }
 
        wait_for_lock();
-       if (options) {
+       if (options && options[0]) {
                debug(MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s",
                    fstype, options, what, fullpath);
 
--- autofs-4.1.3/modules/mount_ext2.c.orig      2004-05-10 14:44:30.000000000 +0200
+++ autofs-4.1.3/modules/mount_ext2.c   2004-09-03 23:49:47.000000000 +0200
@@ -73,7 +73,7 @@
                return 0;
        }
 
-       if (options) {
+       if (options && options[0]) {
                for (p = options; (p1 = strchr(p, ',')); p = p1)
                        if (!strncmp(p, "ro", p1 - p) && ++p1 - p == sizeof("ro"))
                                ro = 1;
--- autofs-4.1.3/modules/mount_generic.c.orig   2004-05-10 14:44:30.000000000 +0200
+++ autofs-4.1.3/modules/mount_generic.c        2004-09-03 23:50:19.000000000 +0200
@@ -72,7 +72,7 @@
        }
 
        wait_for_lock();
-       if (options) {
+       if (options && options[0]) {
                debug(MODPREFIX "calling mount -t %s " SLOPPY "-o %s %s %s",
                      fstype, options, what, fullpath);
 






For program-maps, last character read from STDIN was being
doubled (pretty strange experience).


diff -ruN autofs-4.1.3.orig/modules/lookup_program.c 
autofs-4.1.3/modules/lookup_program.c
--- autofs-4.1.3.orig/modules/lookup_program.c  2004-01-29 17:01:22.000000000 +0100
+++ autofs-4.1.3/modules/lookup_program.c       2004-09-03 23:58:42.000000000 +0200
@@ -159,6 +159,7 @@
                        if (read(pipefd[0], &ch, 1) < 1) {
                                FD_CLR(pipefd[0], &ourfds);
                                files_left--;
+                               state = st_done;
                        }
 
                        if (!quoted && ch == '\\') {







Add crude support for hesiod priorities.

--- autofs-4.1.3/modules/lookup_hesiod.c.orig   2004-09-03 23:18:31.000000000 +0200
+++ autofs-4.1.3/modules/lookup_hesiod.c        2004-09-03 23:18:35.000000000 +0200
@@ -9,6 +9,7 @@
 
 #include <sys/types.h>
 #include <ctype.h>
+#include <limits.h>
 #include <string.h>
 #include <syslog.h>
 #include <unistd.h>
@@ -70,6 +71,8 @@ int lookup_mount(const char *root, const
        char **hes_result;
        struct lookup_context *ctxt = (struct lookup_context *) context;
        int rv;
+       char **record, *best_record = NULL, *p;
+       int priority, lowest_priority = INT_MAX;        
 
        debug(MODPREFIX "looking up root=\"%s\", name=\"%s\"", root, name);
 
@@ -78,14 +81,30 @@ int lookup_mount(const char *root, const
 
        hes_result = hes_resolve(name, "filsys");
 
-       if (!hes_result) {
+       if (!hes_result || !hes_result[0]) {
                warn(MODPREFIX "entry \"%s\" not found in map\n", name);
                return 1;
        }
 
-       debug(MODPREFIX "lookup for \"%s\" gave \"%s\"", name, hes_result[0]);
+       /* autofs doesn't support falling back to alternate records, so just
+          find the record with the lowest priority and hope it works.
+          -- Aaron Ucko <[EMAIL PROTECTED]> 2002-03-11 */
+       for (record = hes_result; *record; ++record) {
+           p = strrchr(*record, ' ');
+           if ( p && isdigit(p[1]) ) {
+               priority = atoi(p+1);
+           } else {
+               priority = INT_MAX - 1;
+           }
+           if (priority < lowest_priority) {
+               lowest_priority = priority;
+               best_record = *record;
+           }
+       }
 
-       rv = ctxt->parser->parse_mount(root, name, name_len, hes_result[0],
+       debug(MODPREFIX "lookup for \"%s\" gave \"%s\"", name, best_record);
+
+       rv = ctxt->parser->parse_mount(root, name, name_len, best_record,
                                       ctxt->parser->context);
        free(hes_result);
        return rv;




The comment says it.

--- bak/modules/mount_afs.c.orig        2004-01-29 17:01:22.000000000 +0100
+++ bak/modules/mount_afs.c     2004-09-03 23:03:04.000000000 +0200
@@ -39,6 +39,10 @@
        strncat(dest, "/", sizeof(dest));
        strncat(dest, name, sizeof(dest));
 
+       /* remove trailing slash (http://bugs.debian.org/141775) */
+       if (dest[strlen(dest)-1] == '/')
+           dest[strlen(dest)-1] = '\0';
+
        debug(MODPREFIX "mounting AFS %s -> %s", dest, what);
 
        return symlink(what, dest);     /* Try it.  If it fails, return the error. */






Rather cosmetic: When there are errors in subdirectories on
build, make will continue. I need this so build-daemons can't
upload incomplete binary packages:

diff -ruN autofs-4.1.3.orig/Makefile autofs-4.1.3/Makefile
--- autofs-4.1.3.orig/Makefile  2003-09-29 10:22:35.000000000 +0200
+++ autofs-4.1.3/Makefile       2004-09-04 20:23:42.000000000 +0200
@@ -13,26 +13,26 @@
 all:   daemon samples
 
 daemon:
-       for i in $(SUBDIRS); do $(MAKE) -C $$i all; done 
+       set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i all; done 
 
 kernel:
-       if [ -d kernel ]; then $(MAKE) -C kernel all; fi
+       set -e; if [ -d kernel ]; then $(MAKE) -C kernel all; fi
 
 samples:
-       if [ -d samples ]; then $(MAKE) -C samples all; fi
+       set -e; if [ -d samples ]; then $(MAKE) -C samples all; fi
 
 clean:
        for i in $(SUBDIRS) samples kernel; do \
                if [ -d $$i ]; then $(MAKE) -C $$i clean; fi; done      
 
 install:
-       for i in $(SUBDIRS); do $(MAKE) -C $$i install; done    
+       set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done    
 
 install_kernel:
-       if [ -d kernel ]; then $(MAKE) -C kernel install; fi
+       set -e; if [ -d kernel ]; then $(MAKE) -C kernel install; fi
 
 install_samples:
-       if [ -d samples ]; then $(MAKE) -C samples install; fi
+       set -e; if [ -d samples ]; then $(MAKE) -C samples install; fi
 
 mrproper distclean: clean
        find . -noleaf \( -name '*~' -o -name '#*' -o -name '*.orig' -o -name '*.rej' 
-o -name '*.old' \) -print0 | xargs -0 rm -f



HTH, 2ri
-- 
Help securing email, spread GPG, clearsign all mail. http://www.gnupg.org
.
                                        /\ .__|_|_    ._ |/ _ ._._  
                                       /--\|  |_| ||_||  |\(_)| | |

Attachment: signature.asc
Description: Digital signature

_______________________________________________
autofs mailing list
[EMAIL PROTECTED]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to