Hi:

The following very tiny patch adds the `--no-local-symlinks'
option to /usr/sbin/automount. This option causes automount
*not* to symlink NFS mounts which it believes to be local.

If the user doesn't specify this option, then automount's
behaviour is unchanged (ie. it will use symlinks for local
mounts).

I needed this because I was using ssh and rpc_psrv to proxy
NFS connections over a secure tunnel. It took me quite a long
time to work out why `mount localhost:/remote/drive /local'
worked correctly, but automount didn't ...

Rich.

-- 
[EMAIL PROTECTED] | Is your school part of http://www.schoolmaster.net ?
BiblioTech Ltd, Unit 2 Piper Centre, 50 Carnwath Road, London, SW6 3EG.
+44 20 7384 6917 | Click here to play XRacer: http://xracer.annexia.org
Copyright � 2000 Richard Jones | GnuPG/PGP key from www.annexia.org
diff -urN autofs-3.1.3.orig/daemon/automount.c autofs-3.1.3/daemon/automount.c
--- autofs-3.1.3.orig/daemon/automount.c        Tue Nov  3 21:21:14 1998
+++ autofs-3.1.3/daemon/automount.c     Tue Feb  8 12:45:31 2000
@@ -51,6 +51,8 @@
 static int mounted = 0;
 static int submount = 0;
 
+int no_local_symlinks = 0;
+
 struct pending_mount {
   pid_t pid;           /* Which process is mounting for us */
   unsigned long wait_queue_token;      /* Associated kernel wait token */
@@ -604,6 +606,7 @@
     {"timeout",  1, 0, 't'},
     {"version",  0, 0, 'v'},
     {"submount", 0, &submount, 1},
+    {"no-local-symlinks", 0, &no_local_symlinks, 1},
     {0,0,0,0}
   };
   
diff -urN autofs-3.1.3.orig/include/automount.h autofs-3.1.3/include/automount.h
--- autofs-3.1.3.orig/include/automount.h       Tue Nov  3 21:21:14 1998
+++ autofs-3.1.3/include/automount.h    Tue Feb  8 12:44:58 2000
@@ -31,6 +31,12 @@
 #define SLOPPY
 #endif
 
+/* If set, then NFS plug in won't ever assume that an NFS server is
+ * local and create a symlink rather than really linking. This is
+ * set by the `--no-local-symlinks' option on the command line.
+ */
+extern int no_local_symlinks;
+
 /* Standard function used by daemon or modules */
 
 int spawnl(int logpri, const char *prog, ...);
diff -urN autofs-3.1.3.orig/modules/mount_nfs.c autofs-3.1.3/modules/mount_nfs.c
--- autofs-3.1.3.orig/modules/mount_nfs.c       Tue Nov  3 21:21:14 1998
+++ autofs-3.1.3/modules/mount_nfs.c    Tue Feb  8 12:45:02 2000
@@ -152,7 +152,7 @@
     }
   } while (*hostname && !local);
 
-  if ( local ) {
+  if ( local && !no_local_symlinks ) {
     /* Local host -- do a symlink */
     
     syslog(LOG_DEBUG, MODPREFIX "%s is local, symlinking", name);

Reply via email to