btrfs-progs icon indicating copy to clipboard operation
btrfs-progs copied to clipboard

Some user-permission changes to btrfs-progs

Open sweettea opened this issue 11 months ago • 4 comments

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).

sweettea avatar Mar 21 '24 20:03 sweettea

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?

adam900710 avatar Mar 21 '24 20:03 adam900710

Snapshotting shouldn't require root?

But uuid search, good point, I was running on a kernel with uuid search allowed for non-root.

sweettea avatar Mar 26 '24 17:03 sweettea

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.

kdave avatar Apr 18 '24 17:04 kdave

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.

kdave avatar Jun 12 '24 18:06 kdave