Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 242390 - sys-fs/zfs-fuse should be running as "root:root" instead of "daemon:disk"
Summary: sys-fs/zfs-fuse should be running as "root:root" instead of "daemon:disk"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Christian Parpart (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-16 19:18 UTC by John W Eckhart
Modified: 2010-06-23 09:16 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to run daemon as root user, which seems appropriate for a daemon accessing physical discs (zfs-fuse.rc.patch,416 bytes, patch)
2008-10-16 19:21 UTC, John W Eckhart
Details | Diff
working rc-script with root-privileges (zfs-fuse.rc,925 bytes, text/plain)
2010-06-22 19:49 UTC, Stefan G. Weichinger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John W Eckhart 2008-10-16 19:18:35 UTC
The init script for zfs-fuse-0.5.0 (/etc/init.d/zfs) has a very slight bug in it. 

In the current zfs init script, the zfs-fuse daemon is run as the "daemon" user. However, this results in several "Permission denied" type errors when attempting to create, modify, or access a zfs partition on a regular disk.

Since the xfs-fuse daemon generally needs to access physical disks, it seems that it would need to run as root (or ensure that all disks are given the proper group permission and run the daemon under the "disk" group).
Comment 1 John W Eckhart 2008-10-16 19:21:31 UTC
Created attachment 168704 [details, diff]
Patch to run daemon as root user, which seems appropriate for a daemon accessing physical discs
Comment 2 Navid Zamani 2009-03-18 11:22:08 UTC
First of all, zfs-fuse does — as far as I know — not not need physical discs per se. So there should be an option. Like the “chroot” use flag, but maybe “physical”, to enable physical disk access functionality/right at install time. :)

Then: Why is this patch (thank you for the work :) not in the portage tree yet? This is from nearly half a year ago! I see this quite often. Developers doing great work, fixing bugs, and this work then getting thrown away, by not ever putting it inside portage. And quite frankly: If the person who is not doing it, is overworked and/or can’t handle it, he should at least say so. No problem with that. We can help! :)

Who do I contact, or how do I do it myself, to fix this?
Comment 3 Christian Parpart (RETIRED) gentoo-dev 2009-04-27 09:38:14 UTC
Hey guys,

sorry for the late response, i've been overseas, however, I do not actually think, that every daemon has to run in with root privileges, especially where physical disks (by default) have the "disk" group assigned and are group read-/writable.

Please correct me if i'm wrong, but with the above assumtion, it is more save to setuid/setgid into a non-root privileges.

however, IF ppl still feel uncomfortable with root privilege dropping, I feel fine with adding a configuration variable that leave the administrator the option to override default "daemon:disk" service privileges.
Comment 4 Navid Zamani 2009-04-27 10:11:28 UTC
(In reply to comment #3)
> Please correct me if i'm wrong, but with the above assumtion, it is more safe
> to setuid/setgid into a non-root privileges.

No, you are absolutely right. :)

> however, IF ppl still feel uncomfortable with root privilege dropping, I feel
> fine with adding a configuration variable that leave the administrator the
> option to override default "daemon:disk" service privileges.

Well, Gentoo is about choice and freedom. You never know when someone may really need it. Ok, if you can prove that nobody needs it, the better. :)
But if it’s not feeling like a stupid loss of time… why not? :) 
In the end, it‘s your time, so you do, what you like the most. :)
Comment 5 Stefan G. Weichinger 2010-06-22 19:12:49 UTC
The same problem is still there for zfs-fuse 0.6.9.
The init script should start the zfs-fuse binary with root-privileges.
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2010-06-22 19:43:58 UTC
Comment on attachment 168704 [details, diff]
Patch to run daemon as root user, which seems appropriate for a daemon accessing physical discs

This patch seems to be doing the opposite, changing "root" to "daemon".

Reversed patch, perhaps?
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2010-06-22 19:47:58 UTC
How about a log of the failure? Reference to documentation? Anything to "proof" the "doesn't work" claim and I'll do the change in tree... 

(I don't use zfs-fuse myself)
Comment 8 Stefan G. Weichinger 2010-06-22 19:49:57 UTC
Created attachment 236271 [details]
working rc-script with root-privileges

I use this one with zfs-fuse 0.6.9 without the mentioned permission problems.
Comment 9 Stefan G. Weichinger 2010-06-22 19:56:28 UTC
For sure the later rc-script also does it the root-way.

http://bugs.gentoo.org/attachment.cgi?id=234253
Comment 10 Marcin Mirosław 2010-06-22 20:09:49 UTC
(In reply to comment #7)
> How about a log of the failure? Reference to documentation? Anything to "proof"
> the "doesn't work" claim and I'll do the change in tree... 

Please look at these threads:
http://groups.google.com/group/zfs-fuse/browse_thread/thread/fd2b7b8cfa6c055f#
http://groups.google.com/group/zfs-fuse/browse_thread/thread/e662cccc094e1632#
and http://zfs-fuse.net/issues/60
Comment 11 Samuli Suominen (RETIRED) gentoo-dev 2010-06-22 20:13:39 UTC
+*zfs-fuse-0.6.9-r1 (22 Jun 2010)
+
+  22 Jun 2010; Samuli Suominen <ssuominen@gentoo.org>
+  +zfs-fuse-0.6.9-r1.ebuild, +files/zfs-fuse:
+  Run as "root" instead of "daemon" wrt #242390 by Stefan G. Weichinger.
Comment 12 Marcin Mirosław 2010-06-23 07:42:36 UTC
Thanks Samuli.