All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Sam Bull <sam.hacking@sent.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: btrfs send non-root
Date: Fri, 24 Mar 2017 13:14:31 +0100	[thread overview]
Message-ID: <20170324121431.GO14605@twin.jikos.cz> (raw)
In-Reply-To: <1489244085.6022.8.camel@sent.com>

On Sat, Mar 11, 2017 at 02:54:45PM +0000, Sam Bull wrote:
> I'm getting an error when trying to send a subvolume. I only seem to be
> able to do this as root. The subvolume was created by the user account,
> and not root. Could anybody shed some light on why this is failing? Is
> there a way to get it working?
> 
> $ btrfs send /var/spool/backups/hacking/2017-03-10 > something
> ERROR: cannot open '/': Operation not permitted

The send operation for non-root would need a full evaluation whether it
does not cross the permissions/security boundaries.

> Also appears I cannot even use btrfs subvolume show:
> 
> $ btrfs subvolume show /var/spool/backups/hacking/2017-03-10
> ERROR: can't perform the search - Operation not permitted
> ERROR: can't find 'var/spool/backups/hacking/2017-03-10'

The reason here is that the TREE_SEACH ioctl is used, that gives full
access to the internal structures and therefore is root-only. Many
'btrfs' subcommands utilize the flexibility of the ioctl as we don't
have tons of specialized ioctls, but this comes at some cost.

      reply	other threads:[~2017-03-24 12:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-11 14:54 btrfs send non-root Sam Bull
2017-03-24 12:14 ` David Sterba [this message]

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=20170324121431.GO14605@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sam.hacking@sent.com \
    /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.