e2fsprogs icon indicating copy to clipboard operation
e2fsprogs copied to clipboard

Add root_perms extended mke2fs option.

Open chestnykh opened this issue 2 years ago • 3 comments

This options allows user to specify custom root dir permissions at FS creation time. If no perms are specified then the root dir permissions would be set to default.

This is related to https://github.com/tytso/e2fsprogs/issues/168

@tytso could you review this please?

chestnykh avatar Nov 25 '23 11:11 chestnykh

Hey, thanks for the PR! I'm not that good at C, so this isn't a review, but I did give it a test.

With this PR applied on top of e2fsprogs-1.47.0, I'm getting wrong permissions. The permission bits seem to be mangled.

# dd if=/dev/zero of=big bs=8M count=100
...
# mkfs.ext4 -E root_owner=1000:1000,root_perms=1777 big
...
# mount big /tmp/e/
# stat /tmp/e
...
Access: (0361/d-wxrw---x)  Uid: ( 1000/   haarp)   Gid: ( 1000/   haarp)
...

haarp avatar Nov 25 '23 23:11 haarp

Hey, thanks for the PR! I'm not that good at C, so this isn't a review, but I did give it a test.

With this PR applied on top of e2fsprogs-1.47.0, I'm getting wrong permissions. The permission bits seem to be mangled.

# dd if=/dev/zero of=big bs=8M count=100
...
# mkfs.ext4 -E root_owner=1000:1000,root_perms=1777 big
...
# mount big /tmp/e/
# stat /tmp/e
...
Access: (0361/d-wxrw---x)  Uid: ( 1000/   haarp)   Gid: ( 1000/   haarp)
...

I've corrected the patch, could u please test again?

chestnykh avatar Nov 26 '23 02:11 chestnykh

Now it's creating the correct permissions. Thanks!

haarp avatar Nov 26 '23 11:11 haarp