Opened 13 years ago
Closed 9 years ago
#8254 closed bug (fixed)
bfs_fuse needs root privs since hrev41258
Reported by: | luroh | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | File Systems/BFS | Version: | R1/Development |
Keywords: | Cc: | idefix | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
Before hrev41258, it was possible to mount a Haiku partition in Linux without root privileges.
Attachments (3)
Change History (16)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
I tried to mount an partition in Linux (Ubuntu 11.10) as a normal user, but it wouldn't let me:
With hrev41257:
jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ mkdir bfs_fuse_mount jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ ./bfs_fuse_hrev41257 /dev/sda7 bfs_fuse_mount/ bfs: Mount:329: Bad file descriptor bfs: bfs_mount:172: Bad file descriptor Error: Mounting FS failed: Bad file descriptor jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ sudo ./bfs_fuse_hrev41257 /dev/sda7 bfs_fuse_mount/ [sudo] password for jeroen: bfs: mounted "Build" (root node at 524288, device = /dev/sda7) jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ umount bfs_fuse_mount umount: /home/jeroen/Builds/Haiku/befs_fuse_bug/bfs_fuse_mount is not in the fstab (and you are not root) jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ sudo umount bfs_fuse_mount jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$
With hrev43876:
jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ mkdir bfs_fuse_mount jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ ./bfs_fuse_hrev43876 /dev/sda7 bfs_fuse_mount bfs: Mount:340: Bad file descriptor bfs: bfs_mount:172: Bad file descriptor Error: Mounting FS failed: Bad file descriptor jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ sudo ./bfs_fuse_hrev43876 /dev/sda7 bfs_fuse_mount [sudo] password for jeroen: bfs: mounted "Build" (root node at 524288, device = /dev/sda7) jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ umount bfs_fuse_mount umount: /home/jeroen/Builds/Haiku/befs_fuse_bug/bfs_fuse_mount is not in the fstab (and you are not root) jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ sudo umount bfs_fuse_mount jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$
When mounting an image, it would let me do it as non-user though.
With hrev41257:
jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ mkdir bfs_fuse_mount jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ ./bfs_fuse_hrev41257 haiku-nightly.image bfs_fuse_mount bfs: mounted "Haiku" (root node at 131072, device = haiku-nightly.image) jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ umount bfs_fuse_mount umount: /home/jeroen/Builds/Haiku/befs_fuse_bug/bfs_fuse_mount is not in the fstab (and you are not root) jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ sudo umount bfs_fuse_mount [sudo] password for jeroen: jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$
But not with hrev43876:
jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ mkdir bfs_fuse_mount jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$ ./bfs_fuse_hrev43876 haiku-nightly.image bfs_fuse_mount bfs: mounted "Haiku" (root node at 131072, device = haiku-nightly.image) fusermount: failed to open /etc/fuse.conf: Permission denied fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf jeroen@Gromit:~/Builds/Haiku/befs_fuse_bug$
This is caused by the fuse option allow_other
, which is - by default - not allowed when mounting as non-root user.
I created a patch that will only set this option when the user is root.
by , 13 years ago
Attachment: | 0001-Allow-non-root-to-mount-BFS-partition-with-bfs_fuse.patch added |
---|
Only set allow_other
fuse option when user is root
comment:3 by , 13 years ago
patch: | 0 → 1 |
---|
comment:4 by , 13 years ago
With patch 0001, I confirm that it is now possible to mount an image without being root.
It still doesn't let me mount my /dev/sda1 Haiku partition as non-root though:
fusermount: failed to open /etc/fuse.conf: Permission denied fusermount: option blkdev is privileged
That said, due to a broken display, I'm currently unable to test on the exact same hardware and Ubuntu installation I was using when I created this ticket, so I'll have to do some more testing next week once I get that display sorted.
comment:6 by , 13 years ago
No, but the first row "fusermount: failed to open..." is no longer displayed.
I remembered I do have another computer where I am able to mount without being root, and I can confirm that I am not added to the 'fuse' group on that computer.
Mostly for my own reference, I'm attaching an old bfs_fuse binary from that other machine that lets me mount without being root.
by , 13 years ago
Attachment: | bfs_fuse_non-root added |
---|
comment:7 by , 13 years ago
by , 13 years ago
Attachment: | 0002-Allow-non-root-to-mount-BFS-partition-with-bfs_fuse.patch added |
---|
Only add FUSE options when user is root (updated commit message)
comment:10 by , 12 years ago
Can anyone comment if attachment:0002-Allow-non-root-to-mount-BFS-partition-with-bfs_fuse.patch is OK to commit?
comment:11 by , 11 years ago
Fwiw, the patch still applies cleanly and works fine here on 64-bit Linux (hrev47303, gcc2).
comment:12 by , 10 years ago
Milestone: | R1 → Unscheduled |
---|
comment:13 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Applied in hrev50364. Thanks (and apologies for the very long delay!)
As far as I can remember, I always had to use
sudo
to mount a Haiku partition in Ubuntu.Will look into it...