[Samba] CentOS 6.5 + Samba 4.1.6 - Variable Substitution (smb.conf)

Pascal Blétard paddelman at hotmail.com
Tue May 27 07:28:28 MDT 2014


Unfortunately, variable substitution does not work, so i cant pass "%U" as parameter to my script.
In addition, "preexec", "root preexec", ... seems never be called.

Perhaps a configuration problem ? In doubt, i'll try to recompile from 4.1.7

> From: mueller at tropenklinik.de
> To: paddelman at hotmail.com
> Subject: AW: AW: [Samba] CentOS 6.5 + Samba 4.1.6 - Variable Substitution (smb.conf)
> Date: Tue, 27 May 2014 15:18:25 +0200
> 
> So you write a script, ex: userconsole: sambatool ..... $1,mkdir
> /path/to/home/$1, setfacl /path/to/home/$1
> In your [home]
> root preexec= /path/to/your/./userconsole  %U
> 
> working for me with samba 4.1.7
> 
> EDV Daniel Müller
> 
> Leitung EDV
> Tropenklinik Paul-Lechler-Krankenhaus
> Paul-Lechler-Str. 24
> 72076 Tübingen 
> Tel.: 07071/206-463, Fax: 07071/206-499
> eMail: mueller at tropenklinik.de
> Internet: www.tropenklinik.de 
> 
> 
> 
> Von: Pascal Blétard [mailto:paddelman at hotmail.com] 
> Gesendet: Dienstag, 27. Mai 2014 14:38
> An: mueller at tropenklinik.de; samba at lists.samba.org
> Betreff: RE: AW: [Samba] CentOS 6.5 + Samba 4.1.6 - Variable Substitution
> (smb.conf)
> 
> yes, i agree
> 
> For administration from a Windows desktop, i use your second proposal.
> 
> But i would propose the ability to manage from CentOS directly.
> I'll use "prexec", but the problem is that i cant pass the username in
> argument to my script, because the variable's substitute seems doesnt
> working.
> > From: mueller at tropenklinik.de
> > To: paddelman at hotmail.com; samba at lists.samba.org
> > Subject: AW: [Samba] CentOS 6.5 + Samba 4.1.6 - Variable Substitution
> (smb.conf)
> > Date: Tue, 27 May 2014 14:25:57 +0200
> > 
> > Just use prexec=syourscriptname/command
> > In your [home] section.
> > Or login to a admin pc start rsat and choose the user, properties profile
> > there connect to: \\yourdc\home\%username%
> > 
> > 
> > EDV Daniel Müller
> > 
> > Leitung EDV
> > Tropenklinik Paul-Lechler-Krankenhaus
> > Paul-Lechler-Str. 24
> > 72076 Tübingen 
> > Tel.: 07071/206-463, Fax: 07071/206-499
> > eMail: mueller at tropenklinik.de
> > Internet: www.tropenklinik.de
> > 
> > 
> > 
> > 
> > -----Ursprüngliche Nachricht-----
> > Von: samba-bounces at lists.samba.org [mailto:samba-bounces at lists.samba.org]
> Im
> > Auftrag von Pascal Blétard
> > Gesendet: Dienstag, 27. Mai 2014 13:00
> > An: samba at lists.samba.org
> > Betreff: [Samba] CentOS 6.5 + Samba 4.1.6 - Variable Substitution
> (smb.conf)
> > 
> > Hello everyone.
> > 
> > So, I come to you because I have a little problem when setting up my
> domain
> > controller based on CentOS 6.5 and Samba 4.1.6.
> > 
> > Everything works well, except for one small detail, which in my case
> > blocking me.
> > 
> > I
> > would like to automatically generate the home directory of the user during
> > the first connection (from Win or Linux), but the problem is that for some
> > unknown reason, the variable substitution does not work in the smb.conf
> > 
> > I tested various alternatives for the user name, for example, but none
> > works.
> > 
> > Here is my smb.conf
> > 
> > 
> > [global]
> > 
> > workgroup = ADS
> > 
> > realm = ADS.LOCAL
> > 
> > netbios name = BOOS17
> > 
> > server role = active directory domain controller
> > 
> > dns forwarder = 172.16.130.7
> > 
> > server services = rpc, nbt, wrepl, ldap, cldap, kdc, drepl, winbind,
> > ntp_signd, kcc, dnsupdate, dns, smb
> > 
> > dcerpc endpoint servers = epmapper, wkssvc, rpcecho, samr, netlogon,
> > lsarpc, spoolss, drsuapi, dssetup, unixinfo, browser, eventlog6,
> backupkey,
> > dnsserver, winreg, srvsvc
> > 
> > idmap_ldb:use rfc2307 = yes
> > 
> > 
> > 
> > [netlogon]
> > 
> > path = /usr/local/samba/var/locks/sysvol/ads.local/scripts
> > 
> > read only = No
> > 
> > 
> > 
> > [sysvol]
> > 
> > path = /usr/local/samba/var/locks/sysvol
> > 
> > read only = No
> > 
> > 
> > 
> > [home]
> > 
> > comment = %U %USERNAME% %ACCOUNTNAME% %USERACCOUNT% %u Home
> > Directory
> > 
> > path = /home/ADS
> > 
> > read only = No
> > 
> > 
> > 
> > [Global Share]
> > 
> > comment = Global %D %DOMAIN% %DOMAINNAME% Share
> > 
> > path = /home/globalshare
> > valid users = User1
> > 
> > read list = User1
> > 
> > write list = User1
> > 
> > read only = No
> > 
> > guest ok = Yes
> > 
> > 
> > None of the variables used is replaced.
> > 
> > Here is the result of an example smbclient command:
> > 
> > 
> > 
> > # smbclient -L localhost -U Administrator -c 'ls'
> > 
> > Enter Administrator's password:
> > 
> > Domain=[ADS] OS=[Unix] Server=[Samba 4.1.6]
> > 
> > 
> > 
> > Sharename Type Comment
> > 
> > --------- ---- -------
> > 
> > netlogon Disk
> > 
> > sysvol Disk
> > 
> > home Disk %U %USERNAME% %ACCOUNTNAME% %USERACCOUNT%
> > %u Home Directory
> > 
> > Global Share Disk Global %D %DOMAIN% %DOMAINNAME% Share
> > 
> > IPC$ IPC IPC Service
> > 
> > Domain=[ADS] OS=[Unix] Server=[Samba 4.1.6]
> > 
> > 
> > 
> > Server Comment
> > 
> > --------- -------
> > 
> > 
> > 
> > Workgroup Master
> > 
> > --------- -------
> > 
> > 
> > I dont really know where the problem is.
> > 
> > Someone would have an idea?
> > 
> > 
> > 
> > 
> > --
> > To unsubscribe from this list go to the following URL and read the
> > instructions: https://lists.samba.org/mailman/options/samba
> > 
> 
 		 	   		  


More information about the samba mailing list