Variable Substitution for NT Domain

cjsmith at cjsmith at
Thu Nov 23 10:29:48 GMT 2000


Your suggestion doesn't quite work - the %D (or %W) 
variable is always replaced with the domain of the 
Samba *server*, not that of the *user*.

e.g.: My server is in domain EUROPE. The EUROPE and 
FRANCE domains have a trust relationship in the PDC.

If I connect as "EUROPE\csmith", and have a 
share "domain" mapped as "/data/%D", it 
opens /data/EUROPE.

If I connect as "FRANCE\csmith", it also 
opens /data/EUROPE (it should have 
been /data/FRANCE). I have verified that the server is 
authenticating me as FRANCE\csmith, not 

I also tried tweaking the code to use lp_workgroup() 
rather than my_workgroup, but this didn't make any 
difference. I'm trying to hack in a change to set up a 
sesssetup_domain global, but so far to no avail. I can't 
follow the code well enough to work out when I can 
safely assign it to a value - the check_domain_validate 
section maybe?

My recommendation would be to keep %W as the 
SERVER's workgroup, but set %D to the USER's domain 
(for use with %U). This should then make sense in a 
Win95/98 environment, where the user's domain should 
be set the same as the server's workgroup.

Any further help much appreciated,


<<original message>>
> I would like to use "/data/%D/%U" as a share 
> where %D is the NT Domain of the connecting user (I
> run samba in security=domain mode). Unfortunately,
> there doesn't seem to be a variable for NT
> Domain/Workgroup in the existing substitutions.

This is a good idea. Try the following patch for 2.0.7 to 
add the
substitutions %D and %W to mean the same thing, the 
workgroup/domain the Samba server is in.

Let me know if this works for you,


	Jeremy Allison,
	Samba Team.

More information about the samba-technical mailing list