Bug 10607 - dfree command is not executed as root in samba 4
dfree command is not executed as root in samba 4
Status: NEEDINFO
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other
4.1.6
x86 Linux
: P5 regression
: ---
Assigned To: Jeremy Allison
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-14 23:18 UTC by Peter de Kraker
Modified: 2015-07-31 08:52 UTC (History)
1 user (show)

See Also:


Attachments
the script that runs ok on Samba 3 and fails on Samba 4 (574 bytes, text/plain)
2014-05-14 23:19 UTC, Peter de Kraker
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter de Kraker 2014-05-14 23:18:10 UTC
In Samba 3 (Ubuntu 13.10) I used the dfree command option to query my ZFS on Linux diskspace, because Linux has issues showing the correct total space by itself. 

Part of this script involves calling the zfs binary, which requires root permission. 

On samba 3 this worked without issue. On Samba 4.1.6 (Ubuntu 14.04) the same script fails. 

Error is: 

[2014/04/22 12:48:52.745632, 0] ../source3/smbd/dfree.c:128(sys_disk_free)
  disk_free: file_lines_load() failed for command '/home/peter/scripts/zfs_free.sh .'. Error was : No child processes
Unable to open /dev/zfs: Permission denied.
Unable to open /dev/zfs: Permission denied. 

So zfs command needs access to /dev/zfs and without root fails.

I don't know if this is by design, but I would think this counts as a regression if not. 

It's bothering me because now I can't see the correct disk space and usage on my Windows computer, which I use to connect to this home fileserver.
Comment 1 Peter de Kraker 2014-05-14 23:19:48 UTC
Created attachment 9942 [details]
the script that runs ok on Samba 3 and fails on Samba 4
Comment 2 Jeremy Allison 2014-05-15 05:40:11 UTC
Can you get me a debug level 10 log from Samba 3.6.x, showing the dfree command being called, and a comparative log from Samba 4.x.x showing the dfree command being called.

I don't see a code change in this area that would cause this, so I need to figure out what was causing your dfree command to be run as root on 3.6.x (as far as I can see it shouldn't have been :-).

Thanks,

Jeremy.
Comment 3 Peter de Kraker 2014-05-15 10:43:38 UTC
Ok, will look into this. I am afraid I need to reinstall a Ubuntu 13.10 instance but I will do it.

It does make me wonder if the ZFS command somehow didn't need root on 13.10. But that's highly unlikely I think. Will look into this!