[Samba] dfree command

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


Hi

I'm using SuSE-Linux 7.3, Kernel 2.4.18 with samba 2.2.3a and XFS with
quotas
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.

dfree.sh:
#!/bin/sh
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
    fi
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