diff -ruN autofs-4.0.0pre5/NEWS autofs-4.0.0pre6/NEWS --- autofs-4.0.0pre5/NEWS Sun Feb 13 11:06:31 2000 +++ autofs-4.0.0pre6/NEWS Sun Feb 13 11:04:27 2000 @@ -1,3 +1,13 @@ +autofs-4.0.0-pre6: Since autofs-4.0.0-pre5: +------------------------------------------- +* Fix to auto.net to deal with mount options in the showmount output +* Don't delete symlinks after just creating them + +autofs-4.0.0-pre5: Since autofs-4.0.0-pre4: +------------------------------------------- +* Updated header files to match kernel. The updates fix some + protocol version confusion. + autofs-4.0.0-pre4: Since autofs-4.0.0-pre3: ------------------------------------------- * Fixed spec file so you can actually build from it diff -ruN autofs-4.0.0pre5/autofs.spec autofs-4.0.0pre6/autofs.spec --- autofs-4.0.0pre5/autofs.spec Sun Feb 13 11:06:31 2000 +++ autofs-4.0.0pre6/autofs.spec Sun Feb 13 11:04:27 2000 @@ -1,7 +1,7 @@ -# $Id: //depot/autofs-4.0/autofs.spec#6 $ +# $Id: //depot/autofs-4.0/autofs.spec#7 $ Summary: autofs daemon Name: autofs -%define version 4.0.0pre5 +%define version 4.0.0pre6 Version: %{version} Release: 1 Copyright: GPL diff -ruN autofs-4.0.0pre5/daemon/automount.c autofs-4.0.0pre6/daemon/automount.c --- autofs-4.0.0pre5/daemon/automount.c Sun Feb 13 11:06:31 2000 +++ autofs-4.0.0pre6/daemon/automount.c Sun Feb 13 11:04:27 2000 @@ -1,4 +1,4 @@ -#ident "$Id: //depot/autofs-4.0/daemon/automount.c#7 $" +#ident "$Id: //depot/autofs-4.0/daemon/automount.c#8 $" /* ----------------------------------------------------------------------- * * * automount.c - Linux automounter daemon @@ -241,6 +241,8 @@ static int rm_unwanted_fn(const char *file, const struct stat *st, int when, void *arg) { + int rmsymlink = *(int *)arg; + if (when == 0) { if (st->st_dev != ap.dev) return 0; @@ -248,16 +250,16 @@ DB(syslog(LOG_INFO, "rm_unwanted: %s\n", file)); if (S_ISDIR(st->st_mode)) rmdir(file); - else + else if (!S_ISLNK(st->st_mode) || rmsymlink) unlink(file); } return 1; } -static void rm_unwanted(const char *path, int incl) +static void rm_unwanted(const char *path, int incl, int rmsymlink) { - walk_tree(path, rm_unwanted_fn, incl, 0); + walk_tree(path, rm_unwanted_fn, incl, &rmsymlink); } /* umount all filesystems mounted under path. If incl is true, then @@ -317,7 +319,7 @@ /* Delete detritus like unwanted mountpoints and symlinks */ if (left == 0) - rm_unwanted(path, incl); + rm_unwanted(path, incl, 1); return left; } @@ -375,7 +377,7 @@ if (i != 0) syslog(LOG_INFO, "umount %s succeeded\n", ap.path); if (submount) - rm_unwanted(ap.path, 1); + rm_unwanted(ap.path, 1, 1); } free(ap.path); @@ -993,7 +995,7 @@ /* Clean up after any failed mounts */ sprintf(buf, "%s/%.*s", ap.path, pkt->len, pkt->name); - rm_unwanted(buf, 1); + rm_unwanted(buf, 1, 0); _exit(i ? 1 : 0); } else { diff -ruN autofs-4.0.0pre5/patches/autofs4-2.3.41-20000130.diff autofs-4.0.0pre6/patches/autofs4-2.3.41-20000130.diff --- autofs-4.0.0pre5/patches/autofs4-2.3.41-20000130.diff Sun Feb 13 11:06:31 2000 +++ autofs-4.0.0pre6/patches/autofs4-2.3.41-20000130.diff Wed Dec 31 16:00:00 1969 @@ -1,82 +0,0 @@ ---- 2.3/Documentation/Configure.help Sat Jan 29 14:47:15 2000 -+++ linux/Documentation/Configure.help Sun Jan 30 11:34:15 2000 -@@ -8735,6 +8735,30 @@ - If you are not a part of a fairly large, distributed network, you - probably do not need an automounter, and can say N here. - -+ If you want to use the newer version of autofs with more features, -+ say N here and select automounter v4. -+ -+Kernel automounter v4 support -+CONFIG_AUTOFS4_FS -+ The automounter is a tool to automatically mount remote filesystems -+ on demand. This implementation is partially kernel-based to reduce -+ overhead in the already-mounted case; this is unlike the BSD -+ automounter (amd), which is a pure user space daemon. -+ -+ To use the automounter you need the user-space tools from -+ ftp://ftp.kernel.org/pub/linux/daemons/autofs/testing-v4 ; you also -+ want to answer Y to "NFS filesystem support", below. -+ -+ If you want to compile this as a module ( = code which can be -+ inserted in and removed from the running kernel whenever you want), -+ say M here and read Documentation/modules.txt. The module will be -+ called autofs4.o. You will need to add "alias autofs autofs4" to -+ your modules configuration file. -+ -+ If you are not a part of a fairly large, distributed network or don't -+ have a laptop which needs to dynamically reconfigure to the local -+ network, you probably do not need an automounter, and can say N here. -+ - EFS filesystem support (read only) (EXPERIMENTAL) - CONFIG_EFS_FS - EFS is an older filesystem used for non-ISO9660 CDROMs and hard disk ---- 2.3/include/linux/auto_fs.h Sat Jan 29 14:47:43 2000 -+++ linux/include/linux/auto_fs.h Sun Jan 30 22:24:56 2000 -@@ -20,8 +20,14 @@ - #include - #include - -+/* This header file describes a range of autofs interface versions; -+ the new implementation ("autofs4") supports them all, but the old -+ implementation only supports v3. */ - #define AUTOFS_MIN_PROTO_VERSION 3 /* Min version we support */ --#define AUTOFS_PROTO_VERSION 4 /* Current version */ -+#define AUTOFS_MAX_PROTO_VERSION 4 /* Max (current) version */ -+ -+/* Backwards compat for autofs v3; it just implements a version */ -+#define AUTOFS_PROTO_VERSION 3 /* v3 version */ - - /* - * Architectures where both 32- and 64-bit binaries can be executed -diff -X ../diffexcl -Nur 2.3/fs/autofs4/inode.c abulafia-2.3/fs/autofs4/inode.c ---- 2.3/fs/autofs4/inode.c Sat Jan 29 14:47:39 2000 -+++ linux/fs/autofs4/inode.c Sun Jan 30 22:08:01 2000 -@@ -140,7 +140,7 @@ - *gid = current->gid; - *pgrp = current->pgrp; - -- *minproto = *maxproto = AUTOFS_PROTO_VERSION; -+ *minproto = *maxproto = AUTOFS_MAX_PROTO_VERSION; - - *pipefd = -1; - -@@ -278,15 +278,15 @@ - - /* Couldn't this be tested earlier? */ - if (maxproto < AUTOFS_MIN_PROTO_VERSION || -- minproto > AUTOFS_PROTO_VERSION) { -+ minproto > AUTOFS_MAX_PROTO_VERSION) { - printk("autofs: kernel does not match daemon version " - "daemon (%d, %d) kernel (%d, %d)\n", - minproto, maxproto, -- AUTOFS_MIN_PROTO_VERSION, AUTOFS_PROTO_VERSION); -+ AUTOFS_MIN_PROTO_VERSION, AUTOFS_MAX_PROTO_VERSION); - goto fail_dput; - } - -- sbi->version = maxproto > AUTOFS_PROTO_VERSION ? AUTOFS_PROTO_VERSION : maxproto; -+ sbi->version = maxproto > AUTOFS_MAX_PROTO_VERSION ? AUTOFS_MAX_PROTO_VERSION : maxproto; - - DPRINTK(("autofs: pipe fd = %d, pgrp = %u\n", pipefd, sbi->oz_pgrp)); - pipe = fget(pipefd); diff -ruN autofs-4.0.0pre5/samples/auto.net autofs-4.0.0pre6/samples/auto.net --- autofs-4.0.0pre5/samples/auto.net Sun Feb 13 11:06:31 2000 +++ autofs-4.0.0pre6/samples/auto.net Sun Feb 13 11:04:27 2000 @@ -1,6 +1,6 @@ #!/bin/sh -# $Id: //depot/autofs-4.0/samples/auto.net#2 $ +# $Id: //depot/autofs-4.0/samples/auto.net#3 $ # Look at what a host is exporting to determine what we can mount. # This is very simple, but it appears to work surprisingly well @@ -18,4 +18,4 @@ # Newer distributions get this right SHOWMOUNT="showmount --no-headers -e $key" -$SHOWMOUNT | sort | sed -e "s|^\([^ ]*\).*|$key\1 $opts $key:\1|" +$SHOWMOUNT | sort +0 | sed -e "s|^\([^ ]*\).*|$key\1 $opts $key:\1|"