2008-01-24 19:36:32

by Miklos Szeredi

[permalink] [raw]
Subject: [patch 06/26] mount options: fix autofs4

From: Miklos Szeredi <[email protected]>

Add uid= and gid= options to /proc/mounts for autofs4 filesystems.

Signed-off-by: Miklos Szeredi <[email protected]>
---

Index: linux/fs/autofs4/inode.c
===================================================================
--- linux.orig/fs/autofs4/inode.c 2008-01-22 15:52:42.000000000 +0100
+++ linux/fs/autofs4/inode.c 2008-01-22 23:36:02.000000000 +0100
@@ -188,11 +188,16 @@ out_kill_sb:
static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
{
struct autofs_sb_info *sbi = autofs4_sbi(mnt->mnt_sb);
+ struct inode *root_inode = mnt->mnt_sb->s_root->d_inode;

if (!sbi)
return 0;

seq_printf(m, ",fd=%d", sbi->pipefd);
+ if (root_inode->i_uid != 0)
+ seq_printf(m, ",uid=%u", root_inode->i_uid);
+ if (root_inode->i_gid != 0)
+ seq_printf(m, ",gid=%u", root_inode->i_gid);
seq_printf(m, ",pgrp=%d", sbi->oz_pgrp);
seq_printf(m, ",timeout=%lu", sbi->exp_timeout/HZ);
seq_printf(m, ",minproto=%d", sbi->min_proto);

--


2008-01-25 05:16:19

by Ian Kent

[permalink] [raw]
Subject: Re: [patch 06/26] mount options: fix autofs4


On Thu, 2008-01-24 at 20:33 +0100, Miklos Szeredi wrote:
> plain text document attachment (autofs4_opts.patch)
> From: Miklos Szeredi <[email protected]>
>
> Add uid= and gid= options to /proc/mounts for autofs4 filesystems.

Apologies, I did say I would do this but have been quite busy.

>
> Signed-off-by: Miklos Szeredi <[email protected]>
Acked-by Ian Kent <[email protected]>

I haven't tested this yet but it is fairly straight forward.
I will check it out as soon as I get back to some work that I'm doing on
autofs4 (next few days).

> ---
>
> Index: linux/fs/autofs4/inode.c
> ===================================================================
> --- linux.orig/fs/autofs4/inode.c 2008-01-22 15:52:42.000000000 +0100
> +++ linux/fs/autofs4/inode.c 2008-01-22 23:36:02.000000000 +0100
> @@ -188,11 +188,16 @@ out_kill_sb:
> static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)
> {
> struct autofs_sb_info *sbi = autofs4_sbi(mnt->mnt_sb);
> + struct inode *root_inode = mnt->mnt_sb->s_root->d_inode;
>
> if (!sbi)
> return 0;
>
> seq_printf(m, ",fd=%d", sbi->pipefd);
> + if (root_inode->i_uid != 0)
> + seq_printf(m, ",uid=%u", root_inode->i_uid);
> + if (root_inode->i_gid != 0)
> + seq_printf(m, ",gid=%u", root_inode->i_gid);
> seq_printf(m, ",pgrp=%d", sbi->oz_pgrp);
> seq_printf(m, ",timeout=%lu", sbi->exp_timeout/HZ);
> seq_printf(m, ",minproto=%d", sbi->min_proto);
>
> --