lkml.org 
[lkml]   [2001]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Should mount --bind not follow symlinks?
Jamie Lokier wrote:
> The automounter could indeed chase those symlinks.
>
> Also, if the automounter creates a symlink in /opt anyway, and the link
> subsequently works (as you said), then it shouldn't be returning "No
> such file or directory" the first time.
>
> In other words the latter behaviour looks like a bug in the automounter,
> and the former is a feature which could be added but isn't needed for
> your application.

Okay! Well, the following I think fixes everything for me, as a
small tweak to autofs-4.0.0pre9.

Thanks

Anthony


*** modules/mount_bind.c.Orig Sun Mar 25 15:43:27 2001
--- modules/mount_bind.c Mon Mar 26 22:57:10 2001
***************
*** 19,24 ****
--- 19,25 ----
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
+ #include <stdlib.h>
#include <syslog.h>
#include <string.h>
#include <sys/param.h>
***************
*** 71,76 ****
--- 72,84 ----
char *fullpath;
int err;
int i;
+
+ char real[PATH_MAX];
+ if (!realpath(what, real)) {
+ syslog(LOG_NOTICE, MODPREFIX "realpath %s failed: %m", what);
+ return 1;
+ }
+ what = real;

fullpath = alloca(strlen(root)+name_len+2);
if ( !fullpath ) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:17    [W:0.055 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site