All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: Anatol Pomozov <anatol.pomozov@gmail.com>
Cc: util-linux@vger.kernel.org
Subject: Re: Why "--fake" and "--no-canonicalize" started requiring root in 2.22?
Date: Sun, 3 Feb 2013 16:28:09 +0100	[thread overview]
Message-ID: <20130203152809.GA17182@x2.net.home> (raw)
In-Reply-To: <CAOMFOmWOvh2TAp5a61esH=2Kzgt_YkQ5dHvQOz=_k53zzx20Xg@mail.gmail.com>

On Sun, Feb 03, 2013 at 01:39:50AM -0800, Anatol Pomozov wrote:
> I am trying to compile and use libfuse. Libfuse utilises 'mount' and
> 'umount' tools. One of few things it uses are "--fake" and
> "--no-canonicalize" command options run as regular user. It worked
> fine with previous versions of util-linux (2.20 from Ubuntu Precise).
> But in the latest version (2.22 from Arch) it fails to run as a
> regular user:

The original (now deprecated) mount code:

# git blame --date=short -L 2572,+11 mount-deprecated/mount.c 

3d1b35b6 mount/mount.c (Karel Zak 2009-09-30 2572) 		if (restricted &&
3d1b35b6 mount/mount.c (Karel Zak 2009-09-30 2573) 		    (types || options || readwrite || nomtab || mount_all ||
be9adec4 mount/mount.c (Karel Zak 2009-12-17 2574) 		     nocanonicalize || fake || mounttype ||
be9adec4 mount/mount.c (Karel Zak 2009-12-17 2575) 		     (argc + specseen) != 1)) {
3d1b35b6 mount/mount.c (Karel Zak 2009-09-30 2576) 
3d1b35b6 mount/mount.c (Karel Zak 2009-09-30 2577) 			if (ruid == 0 && euid != 0)
3d1b35b6 mount/mount.c (Karel Zak 2009-09-30 2578) 				/* user is root, but setuid to non-root */
3d1b35b6 mount/mount.c (Karel Zak 2009-09-30 2579) 				die (EX_USAGE, _("mount: only root can do that "
b7481d6f mount/mount.c (Karel Zak 2010-06-14 2580) 					"(effective UID is %u)"), euid);
3d1b35b6 mount/mount.c (Karel Zak 2009-09-30 2581) 
3d1b35b6 mount/mount.c (Karel Zak 2009-09-30 2582) 			die (EX_USAGE, _("mount: only root can do that"));

for example:

commit be9adec40ffc81b28cbb051d0aa1f46f596f7b81
Author: Karel Zak <kzak@redhat.com>
Date:   Thu Dec 17 12:27:16 2009 +0100

    mount: disable --no-canonicalize for non-root users
        
    Signed-off-by: Karel Zak <kzak@redhat.com>


> $  mount --version
> mount from util-linux 2.22.2 (libmount 2.22.0: debug)
> $  mount --fake
> mount: only root can use "--fake" option

fake was always disable for non root users

> $  mount --no-canonicalize
> mount: only root can use "--no-canonicalize" option
> 
> Should it be removed from the list of "restricted" options like it
> happened with other options recently? This would restore the same
> behavior that "mount" had before.

I don't see a change...

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2013-02-03 15:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-03  9:39 Why "--fake" and "--no-canonicalize" started requiring root in 2.22? Anatol Pomozov
2013-02-03 15:28 ` Karel Zak [this message]
2013-02-03 17:06   ` Anatol Pomozov
2013-02-03 19:51     ` Anatol Pomozov

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=20130203152809.GA17182@x2.net.home \
    --to=kzak@redhat.com \
    --cc=anatol.pomozov@gmail.com \
    --cc=util-linux@vger.kernel.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.