[Samba] dfree command

Tilo Lutz TiloLutz at gmx.de
Wed Apr 17 05:11:02 GMT 2002


I'm using SuSE-Linux 7.3, Kernel 2.4.18 with samba 2.2.3a and XFS with
The problem is the quotas won't be displayed in Samba.
So I've tried to write my own dfree command and add it
in smb.conf.

used_space=`/usr/bin/quota -u $1 | tail -1 | awk '{print $2}'`
quota_space=`/usr/bin/quota -u $1 | tail -1 | awk '{print $4}'`
used_files=`/usr/bin/quota -u $1 | tail -1 | awk '{print $5}'`
quota_files=`/usr/bin/quota -u $1 | tail -1 | awk '{print $7}'`
if [ "$used_files" == "$quota_files" ];
    then used_space=$quota_space
free_space=`expr $quota_space - $used_space`
echo "$quota_space $free_space"

First problem:
Why is dfree command run as root and not as user?
I have to use dfree command = /../dfree.sh %U
to get my skript work

Second Problem:
samba should send the path to my script.
But it only sends "." to it. Whats going wrong ?

Third Problem:
Why can't I use %u instead of %U?
I have a some shares with the
force user option, but my script gets
the real username.

Thanks for your help,

Tilo Lutz
Steige 29
75031 Eppingen
TiloLutz at gmx.de

More information about the samba mailing list