lkml.org 
[lkml]   [2010]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 06/17] Add an AT_NO_AUTOMOUNT flag to suppress terminal automount
From
Date
On Thu, 2010-09-30 at 19:15 +0100, David Howells wrote:
> Add an AT_NO_AUTOMOUNT flag to suppress terminal automounting of directories
> with follow_link semantics. This can be used by fstatat() users to permit the
> gathering of attributes on an automount point and also prevent
> mass-automounting of a directory of automount points by ls.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
> Acked-by: Ian Kent <raven@themaw.net>
> ---
>
> fs/namei.c | 6 ++++++
> fs/stat.c | 4 +++-
> include/linux/fcntl.h | 1 +
> include/linux/namei.h | 2 ++
> 4 files changed, 12 insertions(+), 1 deletions(-)
>
> diff --git a/fs/namei.c b/fs/namei.c
> index 86421f9..74bce3a 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -625,6 +625,12 @@ static int follow_automount(struct path *path, unsigned flags,
> if (!path->dentry->d_op || !path->dentry->d_op->d_automount)
> return -EREMOTE;
>
> + /* We don't want to mount if someone supplied AT_NO_AUTOMOUNT
> + * and this is the terminal part of the path.
> + */
> + if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_CONTINUE))
> + return -EXDEV; /* we actually want to stop here */

Oops, we missed this -EXDEV when we made the change to -EISDIR.

Ian



\
 
 \ /
  Last update: 2010-10-03 23:51    [from the cache]
©2003-2011 Jasper Spaans