linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: jdike@karaya.com, pasky@ucw.cz
Cc: linux-fsdevel@vger.kernel.org
Subject: ROOT_DEV usage in hostfs
Date: Tue, 25 Jan 2005 10:10:39 +0100	[thread overview]
Message-ID: <20050125091039.GA32409@lst.de> (raw)

Could someone explain why hosts does thnings like:

	if((ino->i_sb->s_dev == ROOT_DEV) && (ino->i_uid == getuid()))
		ino->i_uid = 0;

(in fs/hostfs/hostfs_kern.c:read_name())

and

	if(attr->ia_valid & ATTR_UID){
		if((dentry->d_inode->i_sb->s_dev == ROOT_DEV) &&
		   (attr->ia_uid == 0))
			attr->ia_uid = getuid();
		attrs.ia_valid |= HOSTFS_ATTR_UID;
		attrs.ia_uid = attr->ia_uid;
	}
	if(attr->ia_valid & ATTR_GID){
		if((dentry->d_inode->i_sb->s_dev == ROOT_DEV) &&
		   (attr->ia_gid == 0))
			attr->ia_gid = getuid();
		attrs.ia_valid |= HOSTFS_ATTR_GID;
		attrs.ia_gid = attr->ia_gid;
	}

(hostfs_getattr)

A filesystems shouldn't have special casing for the rootfs, and
chowning files from root to the current user sounds like an extremly
bad idea to me aswell.

It's also the last thing preventing us from exporting ROOT_DEV

             reply	other threads:[~2005-01-25  9:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-25  9:10 Christoph Hellwig [this message]
2005-01-25  9:55 ` ROOT_DEV usage in hostfs Christoph Hellwig
2005-01-25 10:11 ` Petr Baudis
2005-01-25 18:30 ` Jeff Dike

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=20050125091039.GA32409@lst.de \
    --to=hch@lst.de \
    --cc=jdike@karaya.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=pasky@ucw.cz \
    /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).