[PC-BSD Commits] r19320 - pcbsd/current/src-sh/pc-adctl/scripts

svn at pcbsd.org svn at pcbsd.org
Mon Sep 17 15:48:25 PDT 2012


Author: johnh
Date: 2012-09-17 22:48:24 +0000 (Mon, 17 Sep 2012)
New Revision: 19320

Modified:
   pcbsd/current/src-sh/pc-adctl/scripts/pc-samba
Log:
Fix up samba to work with and without unix extensions.



Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-samba
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-samba	2012-09-17 21:08:23 UTC (rev 19319)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-samba	2012-09-17 22:48:24 UTC (rev 19320)
@@ -26,8 +26,7 @@
 	if checkyesno activedirectory_enable 2>/dev/null
 	then
 		local tmp=$(mktemp /tmp/samba.XXXXXX)
-		local backend
-		local range
+		local cmdstr
 
 		AD_init
 
@@ -43,45 +42,47 @@
 			default="yes"
 		fi
 
+		cp "${SMB_CONF}" "${SMB_CONF}.orig"
+		cmdstr="${cmd} \
+			-w -m '+global:security=ADS' \
+			-w -m '+global:realm=$(AD_get domainname | tr a-z A-Z)' \
+			-w -m '+global:workgroup=$(AD_get workgroup)' \
+			-w -m '+global:netbios name=$(AD_get netbiosname)' \
+			-w -m '+global:client use spnego=yes' \
+			-w -m '+global:wins server=$(AD_get dcname)' \
+			-w -m '+global:password server=$(AD_get dcname)' \
+			-w -m '+global:local master=no' \
+			-w -m '+global:domain master=no' \
+			-w -m '+global:preferred master=no' \
+			-w -m '+global:inherit acls=yes' \
+			-w -m '+global:acl compatibility=auto' \
+			-w -m '+global:acl check permissions=true' \
+			-w -m '+global:acl map full control=true' \
+			-w -m '+global:dos filemode=yes' \
+			-w -m '+global:idmap uid=10000-19999' \
+			-w -m '+global:idmap gid=10000-19999' \
+			-w -m '+global:winbind cache time=10' \
+			-w -m '+global:winbind offline logon=yes' \
+			-w -m '+global:winbind enum users=yes' \
+			-w -m '+global:winbind enum groups=yes' \
+			-w -m '+global:winbind nested groups=yes' \
+			-w -m '+global:winbind use default domain=${default}' \
+			-w -m '+global:winbind refresh tickets=yes' \
+			-w -m '+global:allow trusted domains=${trusted}' \
+			-w -m '+global:template shell=/bin/sh' \
+			-w -m '+global: template homedir=/home/%U' \
+		"	
+
 		if ! AD_UNIX_extensions
 		then
-			backend="-w -m '+global:idmap config $(AD_get workgroup): backend=rid'"
-			range="-w -m '+global:idmap config $(AD_get workgroup): range=20000-20000000'"
+			cmdstr="${cmdstr} \
+			-w -m '+global:idmap config $(AD_get workgroup): backend=rid' \
+			-w -m '+global:idmap config $(AD_get workgroup): range=20000-20000000' \
+			"
 		fi
+		cmdstr="${cmdstr} -o "${tmp}""
 
-		cp "${SMB_CONF}" "${SMB_CONF}.orig"
-		${cmd} \
-			-w -m "+global:security=ADS" \
-			-w -m "+global:realm=$(AD_get domainname | tr a-z A-Z)" \
-			-w -m "+global:workgroup=$(AD_get workgroup)" \
-			-w -m "+global:netbios name=$(AD_get netbiosname)" \
-			-w -m "+global:client use spnego=yes" \
-			-w -m "+global:wins server=$(AD_get dcname)" \
-			-w -m "+global:password server=$(AD_get dcname)" \
-			-w -m "+global:local master=no" \
-			-w -m "+global:domain master=no" \
-			-w -m "+global:preferred master=no" \
-			-w -m "+global:inherit acls=yes" \
-			-w -m "+global:acl compatibility=auto" \
-			-w -m "+global:acl check permissions=true" \
-			-w -m "+global:acl map full control=true" \
-			-w -m "+global:dos filemode=yes" \
-			-w -m "+global:idmap uid=10000-19999" \
-			-w -m "+global:idmap gid=10000-19999" \
-			${backend} \
-			${range} \
-			-w -m "+global:winbind cache time=10" \
-			-w -m "+global:winbind offline logon=yes" \
-			-w -m "+global:winbind enum users=yes" \
-			-w -m "+global:winbind enum groups=yes" \
-			-w -m "+global:winbind nested groups=yes" \
-			-w -m "+global:winbind use default domain=${default}" \
-			-w -m "+global:winbind refresh tickets=yes" \
-			-w -m "+global:allow trusted domains=${trusted}" \
-			-w -m "+global:template shell=/bin/sh" \
-			-w -m "+global: template homedir=/home/%U" \
-			-o "${tmp}"
-
+		eval "${cmdstr}"
 		if [ "$?" = "0" -a -s "${tmp}" ]
 		then
 			mv "${tmp}" "${SMB_CONF}"



More information about the Commits mailing list