From: Anthony <anthony@magix.com.sg>
To: Jamie Lokier <lk@tantalophile.demon.co.uk>
Cc: linux-kernel@vger.kernel.org, autofs@linux.kernel.org
Subject: Re: Should mount --bind not follow symlinks?
Date: Mon, 26 Mar 2001 23:04:55 +0900 [thread overview]
Message-ID: <3ABF4C87.F5AA909D@magix.com.sg> (raw)
In-Reply-To: <Pine.GSO.4.21.0103120835390.25792-100000@weyl.math.psu.edu> <3AACED42.39DF0A24@magix.com.sg> <20010314143157.B27572@pcep-jamie.cern.ch>
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 ) {
next prev parent reply other threads:[~2001-03-26 14:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-12 10:44 Should mount --bind not follow symlinks? Anthony Heading
2001-03-12 13:40 ` Alexander Viro
2001-03-12 15:37 ` Anthony
2001-03-14 13:31 ` Jamie Lokier
2001-03-26 14:04 ` Anthony [this message]
2001-04-16 15:37 ` Kai Henningsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3ABF4C87.F5AA909D@magix.com.sg \
--to=anthony@magix.com.sg \
--cc=autofs@linux.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lk@tantalophile.demon.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox