From: Andreas Dilger <adilger@sun.com>
To: Ludwig Nussel <ludwig.nussel@suse.de>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] implement uid mount option for ext2
Date: Fri, 24 Jul 2009 10:52:01 -0600 [thread overview]
Message-ID: <20090724165201.GA4231@webber.adilger.int> (raw)
In-Reply-To: <1248431444-18842-2-git-send-email-ludwig.nussel@suse.de>
On Jul 24, 2009 12:30 +0200, Ludwig Nussel wrote:
> @@ -1353,7 +1356,13 @@ int ext2_write_inode(struct inode *inode, int do_sync)
>
> ext2_get_inode_flags(ei);
> raw_inode->i_mode = cpu_to_le16(inode->i_mode);
> + if (EXT2_SB(sb)->s_uid &&
> + inode->i_uid == EXT2_SB(sb)->s_uid) {
> + raw_inode->i_uid_high = 0;
> + raw_inode->i_uid_low = 0;
> + raw_inode->i_gid_high = 0;
> + raw_inode->i_gid_low = 0;
I would suggest to also clear the SUID flag on this inode. Otherwise,
it opens the risk of creating SUID root files that might be handled
incorrectly.
To be honest, rather than mapping the specified file to uid == 0/gid == 0
it would be more useful (and safe) to allow specifying a mapping from one
UID to another, or have the on-disk UID always be set to/from the specified
UID. Given that your original problem is for the user having UIDX on
system X and UIDY on system Y, you should just specify the X->Y mapping
explicitly, instead of an implicit X->0 mapping. Otherwise, if the user
is unable to access root-owned files on either one of system X or Y your
current patch fails.
I would have the option be something like "uid={local_uid}={disk_uid}"
(which hopefully the option parser can handle), or "uid=X:Y" if not.
That way, the on-disk filesystem will remain correct for at least one
of the two systems. If someone wants to specify disk_uid=0 that is
fine, but it shouldn't be the only option.
PS - please also send a patch for ext4.
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
next prev parent reply other threads:[~2009-07-24 16:52 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-23 11:36 [PATCH 0/2] implement uid mount option for ext2 and ext3 Ludwig Nussel
2009-07-23 11:36 ` [PATCH 1/2] implement uid mount option for ext2 Ludwig Nussel
2009-07-23 11:36 ` [PATCH 2/2] implement uid mount option for ext3 Ludwig Nussel
2009-07-23 14:37 ` [PATCH 0/2] implement uid mount option for ext2 and ext3 Randy Dunlap
2009-07-23 21:23 ` Valdis.Kletnieks
2009-07-24 10:23 ` Ludwig Nussel
2009-07-30 9:07 ` Pavel Machek
2009-07-24 10:30 ` [PATCH 0/2] implement uid mount option for ext2 and ext3, try 2 Ludwig Nussel
2009-07-24 10:30 ` [PATCH 1/2] implement uid mount option for ext2 Ludwig Nussel
2009-07-24 10:30 ` [PATCH 2/2] implement uid mount option for ext3 Ludwig Nussel
2009-07-24 16:52 ` Andreas Dilger [this message]
2009-07-24 18:58 ` [PATCH 1/2] implement uid mount option for ext2 John Stoffel
2009-07-24 23:16 ` Jamie Lokier
2009-07-27 14:56 ` John Stoffel
2009-07-25 15:44 ` Ludwig Nussel
2009-07-27 19:14 ` Andreas Dilger
2009-07-28 7:50 ` Ludwig Nussel
2009-07-28 11:01 ` [PATCH 0/2] implement uid mount option for ext2 and ext3, try 3 Ludwig Nussel
2009-07-28 11:01 ` [PATCH 1/2] implement uid and gid mount options for ext2 Ludwig Nussel
2009-07-28 11:01 ` [PATCH 2/2] implement uid and gid mount options for ext3 Ludwig Nussel
2009-07-28 18:11 ` [PATCH 0/2] implement uid mount option for ext2 and ext3, try 3 Andreas Dilger
-- strict thread matches above, loose matches on Subject: below --
2009-04-08 13:21 [RFC] [PATCH 0/2] implement uid mount option for ext2 and ext3 Ludwig Nussel
2009-04-08 13:21 ` [PATCH 1/2] implement uid mount option for ext2 Ludwig Nussel
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=20090724165201.GA4231@webber.adilger.int \
--to=adilger@sun.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludwig.nussel@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).