[Samba] session user name

flinchlock fst6x7v02 at sneakemail.com
Wed Mar 3 11:28:07 GMT 2004


Quoting "Pieter Vanmeerbeek"

> Can anyone tell me how to fetch the session username of a request
> in the smb.conf file?

Since I'm a newbie to Samba and I'm using Samba 2.2.8a, the
following information will probably not be of any help to you.

I put this in the Global section of my smb.conf:

exec = /home/samba/netlogon/smbvars "%m" "%M" "%I" "%a" "%D" "%u"
"%H" "%g" "%U" "%G" "%S" "%P" "%p" "%h" "%L" "%N" "%v" "%d" "%R"
"%T" > %H/%S.vars

This is the VERY VERY SIMPLE 'smbvars' script:
---------------------------------------------------------
echo Client variables...
echo %m = "$1" = "Client's NetBIOS name"
echo %M = "$2" = "Client's DNS name"
echo %I = "$3" = "Client's IP address"
echo %a = "$4" = "Client's architecture"
echo
echo User variables...
echo %D = "$5" = "User's Windows NT Domain"
echo %u = "$6" = "User's Unix username"
echo %H = "$7" = "Home directory of %u"
echo %g = "$8" = "Primary group of %u"
echo %U = "$9" = "Requested username"
echo %G = "${10}" = "Primary group of %U"
echo
echo Share variables...
echo %S = "${11}" = "Current share's name"
echo %P = "${12}" = "Current share's root directory"
echo %p = "${13}" = "Current share's root directory (in an NIS
homedir map)"
echo
echo Server variables...
echo %h = "${14}" = "Samba server's DNS name"
echo %L = "${15}" = "Samba server's NetBIOS name"
echo %N = "${16}" = "NIS home directory server (without NIS, same as
%L)"
echo %v = "${17}" = "Samba version"
echo %d = "${18}" = "Current server's process ID"
echo
echo Miscellaneous variables...
echo %R = "${19}" = "SMB protocol level in use"
echo %T = "${20}" = "Current date and time"
---------------------------------------------------------

HTH,
Mike


More information about the samba mailing list