btrfs-progs
btrfs-progs copied to clipboard
Some user-permission changes to btrfs-progs
This makes it possible to use btrfs receive as a regular user, and gets part of the way to using btrfs subvolume list as a regular user (the main change there is pretty big so it's going in a different pull request).
For data writes it's totally fine to fallback to non-privileged writes.
But wouldn't things like snapshotting and UUID tree updates still requires root privilege?
Snapshotting shouldn't require root?
But uuid search, good point, I was running on a kernel with uuid search allowed for non-root.
There are the unprivileged subvolume ioctls, I'm not sure if there are also helpers for that but this should be possible to implement by manual iteration.
I'm taking another look, the idea of using unprivileged ioctls makes sense but we can go further and use the library functions (receive code is old so the interface was not there). I'd apply the patches but the change in lookup_ino_path() to strcpy(ri->name, args.name);
looks like it's ignoring the following code that checks args.name[0]
and build the path.