cezarmathe / btrfsutil-rs

Safe wrappers for libbtrfsutil.
https://crates.io/crates/btrfsutil
MIT License
6 stars 5 forks source link

some functions which should haven't needed privileges require privileges due to path() #1

Closed sprhawk closed 4 years ago

sprhawk commented 4 years ago

Some functions in libbtrfsutil, like btrfs_subvolume_create_snapshot, do not require privilege (CAP_SYS_ADMIN), But inside Subvolume::snapshot, it calls Subvolume::path, which requires privilege, that cause these functions require privilege too.

cezarmathe commented 4 years ago

Hi! I was thinking about storing the path of the subvolume inside the Subvolume struct, too. I think that would solve this issue.

sprhawk commented 4 years ago

Hi! I was thinking about storing the path of the subvolume inside the Subvolume struct, too. I think that would solve this issue.

Yeah, sure, it will do. And I think it needs to transform relative path into absolute path too if you save that path.

cezarmathe commented 4 years ago

Waiting to see what happens to this: https://github.com/kdave/btrfs-progs/issues/252

cezarmathe commented 4 years ago

Fixed by #14

sprhawk commented 4 years ago

Cool