[Samba] $HOME in magic script

Alexey Lobanov aal at evidence-cpr.com
Mon Nov 3 15:45:57 GMT 2003


Hello all.

I can see that "magic scripts" are run in some mixed (between root and real user) shell 
environment. 

Share definition is got from "SambaMagicTray" utility:

[autoscript]
   comment = special directory for SAMBA-Magic Script
   path = /var/magic
   read only = no
   locking = yes
   public = yes
   writeable = yes
   magic script = magic
   magic output = out.txt
   create mode = 0777

"printenv" in script shows:

PWD=/var/magic
HZ=100
USER=root
MAIL=/var/mail/aal
LANG=C
LOGNAME=aal
SHLVL=6
HUSHLOGIN=FALSE
_=/usr/bin/printenv
SHELL=/bin/bash
TERM=vt100
HOME=/root
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin

Respectively, attempts to access my own files as "~/myfile" fail. It tries to go to 
"/root".

Can anyone give me an idea: how to set proper $HOME in magic script? 
Obviously, "export HOME=/home/%LOGNAME" is not a valid solution.

Alexey




More information about the samba mailing list