On Mon, Sep 11, 2023 at 04:36:17PM +0100, Rowland Penny via samba
wrote:>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!
Oh, Rowland is right of course :-).