All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Mike Frysinger <vapier@gentoo.org>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] mke2fs: do not change root dir ownership
Date: Mon, 13 May 2013 09:37:31 -0400	[thread overview]
Message-ID: <20130513133731.GC4845@thunk.org> (raw)
In-Reply-To: <1367875316-3089-1-git-send-email-vapier@gentoo.org>

On Mon, May 06, 2013 at 05:21:56PM -0400, Mike Frysinger wrote:
> If you use `mke2fs` on a file, the code will automatically chown the root
> dir to the active uid/gid.  It doesn't do this to any other files though.
> 
> I can't see where this would really be desirable: you still need root in
> order to mount, and the lost+found dir is owned by root.  It means if you
> want to generate a rootfs as a non-root user, you first have to run it
> through sudo or manually run `chown 0:0` after you've mounted it.

Yeah, this was something that we've been doing in e2fsprogs since 0.5b
(i.e., dating back to 1997).  I agree that the behavior is a bit silly
and we should probably change it.  It *is* a behavioural change,
though, so I'm going to make it something that changes in 1.43, as
opposed to a 1.42.x maintenance release.

A workarond that I'd recommend (since we will have lots of people
creating file systems for various mobile/embedded systems, and they
will have scripts that need to work on existing versions of e2fsprogs)
is to do something like this:

   mke2fs -t ext4 /tmp/foo.img 16384
   debugfs /tmp/foo.img -R "set_inode_field / uid 0"
   debugfs /tmp/foo.img -R "set_inode_field / gid 0"

   	   		   		      	  - Ted

  reply	other threads:[~2013-05-13 13:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06 21:21 [PATCH] mke2fs: do not change root dir ownership Mike Frysinger
2013-05-13 13:37 ` Theodore Ts'o [this message]
2013-05-13 16:12   ` Mike Frysinger
2013-05-13 21:06     ` Theodore Ts'o
2013-05-13 23:09       ` Darren Hart
2013-05-14 10:36         ` Robert Yang

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=20130513133731.GC4845@thunk.org \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=vapier@gentoo.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.