[Samba] Samba dfree command not working

Rowland Penny rpenny at samba.org
Mon Sep 11 15:36:17 UTC 2023


On Mon, 11 Sep 2023 16:45:51 +0200
Keram Yasin via samba <samba at lists.samba.org> wrote:

> Dear Samba Team Member,
> 
> I installed Samba on my server and It worked perfect so far. Now I
> wanted to use some advanced feature of samba like dfree option. I
> created a shell script named dfree according to the "dfree command
> (S)" section in the following url:
> https://www.samba.org/samba/docs/current/manhtml/smb.conf.5.html
> 
> The content of the dfree command is as followings:
> 
> STR=$(/usr/sbin/btrfs qgroup show -rF --raw "$1" | /usr/bin/tail -1)
> SIZE=$(/usr/bin/expr `/bin/echo $STR | /usr/bin/cut -d \  -f 4` /
> 1024) USED=$(/usr/bin/expr `/bin/echo $STR | /usr/bin/cut -d \  -f
> 2` / 1024) AVAIL=$(/usr/bin/expr $SIZE - $USED)
> /bin/echo $SIZE $AVAIL
> 
> I set the shell script to be owned by nobody user and nobody group.
> The script also has chmod 777 enabled. The script is located at the
> following directory: /var/lib/samba/bin/dfree;

If you read the manpage under 'dfree command (S)' it says:

Note: Your script should NOT be setuid or setgid and should be owned by
(and writeable only by) root!

Rowland




More information about the samba mailing list