[SCM] Samba Shared Repository - branch v4-2-test updated

Karolin Seeger kseeger at samba.org
Fri Dec 18 11:55:06 UTC 2015


The branch, v4-2-test has been updated
       via  2028bac docs: Fix typos in man vfs_gpfs.
       via  fd92549 smbd: make "hide dot files" option work with "store dos attributes = yes"
       via  6d1ee8b lib/async_req: do not install async_connect_send_test.
       via  3f05db5 lib/param: add a fixed unified lpcfg_string_{free,set,set_upper}() infrastructure
       via  417eca7 s4:torture:vfs_fruit: add a test for POSIX rename
       via  8b3e19b vfs_fruit: enable POSIX directory rename semantics
       via  3a1a67e vfs_fruit: add a flag that tracks whether use of AAPL was negotiated
       via  b5a081b s3:smbd: file_struct: seperate POSIX directory rename cap from POSIX open
       via  c91214f s3:smbd: convert file_struct.posix_open to a bitmap with flags
      from  b73894c VERSION: Bump version up to 4.2.8...

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-2-test


- Log -----------------------------------------------------------------
commit 2028bacb041ec16f513642ece271f1995a85e8ac
Author: Karolin Seeger <kseeger at samba.org>
Date:   Fri Dec 11 10:23:28 2015 +0100

    docs: Fix typos in man vfs_gpfs.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11641
    Duplicate "acl map full control" entry in man vfs_gpfs
    
    Signed-off-by: Karolin Seeger <kseeger at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 79df4caed3b819cc1cd67c4033f3ac700086ab99)
    
    Autobuild-User(v4-2-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-2-test): Fri Dec 18 12:54:37 CET 2015 on sn-devel-104

commit fd925497bc206f67cf30e40bfd0da0e7842bc8eb
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Dec 16 13:13:55 2015 +0100

    smbd: make "hide dot files" option work with "store dos attributes = yes"
    
    When using "store dos attributes = yes", the function that reads the
    attributes from the xattr get_ea_dos_attribute() will overwrite the
    attribute previously set for "hide dot files".
    
    According to smb.conf, "store dos attributes = yes" should only
    overwrite the "map XXX" options, but not "hide dot files".
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11645
    
    Signed-off-by: Ralph Boehme <slow at samba.org>

commit 6d1ee8b21a17331f391ce095c7dd129a667fe54d
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 1 14:39:37 2015 +0100

    lib/async_req: do not install async_connect_send_test.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11639
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 632114584d3be0d4660e97a6c9e69e577a7bc1e2)

commit 3f05db55c077ed03400691ce8e827c362021f4ef
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Dec 7 16:32:57 2015 -0800

    lib/param: add a fixed unified lpcfg_string_{free,set,set_upper}() infrastructure
    
    This reduces the memory footprint of empty string options.
    
    smbd -d1 -i with 1400 shares in smb.conf under x64 valgrind massif before this
    patch has 7,703,392 bytes peak memory consumption and after this patch
    3,321,200 bytes.
    
    This fixes a regression introduced by commit
    2dd7c890792cf12049ec13b88aa4e9de23035f9d.
    
    BUG:
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11625
    
    Back-port of commit a84eed532549c1dbad43f963838bc5f13c4fe68d
    from master.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 417eca79d45fca70cfc1e2d346cf6d170fb6e9d3
Author: Ralph Boehme <slow at samba.org>
Date:   Sat Nov 28 19:26:47 2015 +0100

    s4:torture:vfs_fruit: add a test for POSIX rename
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11065
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 0f0693d0fa5fa991bb573525f332eba5ceb6ece6)

commit 8b3e19b62c11b273da43a283eaa25f5d75ffa864
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Jan 22 10:07:56 2015 +0100

    vfs_fruit: enable POSIX directory rename semantics
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11065
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 1d7bef5a75403f5baec13aa6264dfe763a4b278a)

commit 3a1a67eef4202d64af8be9f0d297f0aeb3f3e6bf
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Nov 25 09:12:55 2015 +0100

    vfs_fruit: add a flag that tracks whether use of AAPL was negotiated
    
    Add a flag that tracks whether use of AAPL was negotiated, ensuring we
    don't enable AAPL features for clients that didn't negotiate it.
    
    Torture test that need AAPL must call the new function enable_aapl().
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11065
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 89a7394d679b383920d73fef0d178b8f84bc393f)

commit b5a081bb5ef414c94fc67e03cf74e27146605eae
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Jan 22 10:00:15 2015 +0100

    s3:smbd: file_struct: seperate POSIX directory rename cap from POSIX open
    
    We need more fine grained control over which POSIX semantics we'd like
    to enable per file handle. Currently POSIX_FLAGS_OPEN is a kitchensink
    for all kinds of stuff like:
    
    - POSIX unlink
    - POSIX byte-range locks
    - POSIX rename
    - delayed writetime update
    - more...
    
    For CIFS UNIX extensions we use POSIX_FLAGS_ALL so semantics are
    preserved. OS X clients will enable POSIX rename via AAPL.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11065
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit bf1957584e341473edcd5025b7f77766440d408b)

commit c91214fa6e74a3e547165631aac0bdce159ad01a
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Nov 27 18:29:55 2015 +0100

    s3:smbd: convert file_struct.posix_open to a bitmap with flags
    
    This is in preperation of a more fine grained control of POSIX behaviour
    in the SMB and VFS layers.
    
    Inititally we use an uint8_t for the flags bitmap and add a define
    posix_flags as posix_open in order to avoid breaking the VFS ABI.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11065
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit d698cec1c7e700e57cab46d33df0dde13303b318)

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/manpages/vfs_gpfs.8.xml |   6 +-
 lib/async_req/wscript_build      |   3 +-
 lib/param/loadparm.c             |  56 +++++++----
 source3/include/vfs.h            |  12 ++-
 source3/locking/locking.c        |   3 +-
 source3/modules/vfs_acl_common.c |   4 +-
 source3/modules/vfs_fruit.c      |  33 ++++--
 source3/param/loadparm.c         | 212 ++++++++++++++++++---------------------
 source3/smbd/close.c             |   6 +-
 source3/smbd/dosmode.c           |   2 +-
 source3/smbd/fileio.c            |   8 +-
 source3/smbd/open.c              |  10 +-
 source3/smbd/reply.c             |   2 +-
 source3/smbd/smb2_close.c        |   2 +-
 source3/smbd/vfs.c               |   4 +-
 source4/torture/vfs/fruit.c      | 201 +++++++++++++++++++++++++++++++++++++
 16 files changed, 396 insertions(+), 168 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_gpfs.8.xml b/docs-xml/manpages/vfs_gpfs.8.xml
index 21865c4..9bd06e1 100644
--- a/docs-xml/manpages/vfs_gpfs.8.xml
+++ b/docs-xml/manpages/vfs_gpfs.8.xml
@@ -42,14 +42,14 @@
 	</itemizedlist>
 	</para>
 
-	<para><command>NOTE:</command>This module follows the posix-acl behaviour
+	<para><command>NOTE:</command> This module follows the posix-acl behaviour
 	and hence allows permission stealing via chown. Samba might allow at a later
 	point in time, to restrict the chown via this module as such restrictions
 	are the responsibility of the underlying filesystem than of Samba.
 	</para>
 
 	<para>This module makes use of the smb.conf parameter
-	<smbconfoption name="acl map full control">acl map full control</smbconfoption>
+	<smbconfoption name="acl map full control"></smbconfoption>.
 	When set to yes (the default), this parameter will add in the FILE_DELETE_CHILD
 	bit on a returned ACE entry for a file (not a directory) that already
 	contains all file permissions except for FILE_DELETE and FILE_DELETE_CHILD.
@@ -469,7 +469,7 @@
 	</para>
 	<para>
 	At build time, only the header file <command>gpfs_gpl.h</command>
-	is required , which is a symlink to <command>gpfs.h</command> in
+	is required, which is a symlink to <command>gpfs.h</command> in
 	gpfs versions newer than 3.2.1 PTF8.
 	</para>
 </refsect1>
diff --git a/lib/async_req/wscript_build b/lib/async_req/wscript_build
index 2a338b0..4104f79 100644
--- a/lib/async_req/wscript_build
+++ b/lib/async_req/wscript_build
@@ -9,5 +9,6 @@ bld.SAMBA_SUBSYSTEM('LIBASYNC_REQ',
 
 bld.SAMBA_BINARY('async_connect_send_test',
                  source='async_connect_send_test.c',
-                 deps='LIBASYNC_REQ'
+                 deps='LIBASYNC_REQ',
+                 install=False
 )
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index ae60cbf..2cc145d 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -519,16 +519,36 @@ bool lpcfg_parm_bool(struct loadparm_context *lp_ctx,
 }
 
 
+/* this is used to prevent lots of mallocs of size 1 */
+static const char lpcfg_string_emtpy[] = "";
+
+/**
+ Free a string value.
+**/
+void lpcfg_string_free(char **s)
+{
+	if (s == NULL) {
+		return;
+	}
+	if (*s == lpcfg_string_emtpy) {
+		*s = NULL;
+		return;
+	}
+	TALLOC_FREE(*s);
+}
+
 /**
  * Set a string value, deallocating any existing space, and allocing the space
  * for the string
  */
 bool lpcfg_string_set(TALLOC_CTX *mem_ctx, char **dest, const char *src)
 {
-	talloc_free(*dest);
+	lpcfg_string_free(dest);
 
-	if (src == NULL)
-		src = "";
+	if ((src == NULL) || (*src == '\0')) {
+		*dest = discard_const_p(char, lpcfg_string_emtpy);
+		return true;
+	}
 
 	*dest = talloc_strdup(mem_ctx, src);
 	if ((*dest) == NULL) {
@@ -545,10 +565,12 @@ bool lpcfg_string_set(TALLOC_CTX *mem_ctx, char **dest, const char *src)
  */
 bool lpcfg_string_set_upper(TALLOC_CTX *mem_ctx, char **dest, const char *src)
 {
-	talloc_free(*dest);
+	lpcfg_string_free(dest);
 
-	if (src == NULL)
-		src = "";
+	if ((src == NULL) || (*src == '\0')) {
+		*dest = discard_const_p(char, lpcfg_string_emtpy);
+		return true;
+	}
 
 	*dest = strupper_talloc(mem_ctx, src);
 	if ((*dest) == NULL) {
@@ -822,9 +844,8 @@ void set_param_opt(TALLOC_CTX *mem_ctx,
 				   overridden */
 				return;
 			}
-			TALLOC_FREE(opt->value);
 			TALLOC_FREE(opt->list);
-			opt->value = talloc_strdup(opt, opt_value);
+			lpcfg_string_set(opt, &opt->value, opt_value);
 			opt->priority = priority;
 			not_added = false;
 			break;
@@ -836,16 +857,10 @@ void set_param_opt(TALLOC_CTX *mem_ctx,
 		if (new_opt == NULL) {
 			smb_panic("OOM");
 		}
-
-		new_opt->key = talloc_strdup(new_opt, opt_name);
-		if (new_opt->key == NULL) {
-			smb_panic("talloc_strdup failed");
-		}
-
-		new_opt->value = talloc_strdup(new_opt, opt_value);
-		if (new_opt->value == NULL) {
-			smb_panic("talloc_strdup failed");
-		}
+		new_opt->key = NULL;
+		lpcfg_string_set(new_opt, &new_opt->key, opt_name);
+		new_opt->value = NULL;
+		lpcfg_string_set(new_opt, &new_opt->value, opt_value);
 
 		new_opt->list = NULL;
 		new_opt->priority = priority;
@@ -2384,13 +2399,16 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 		if ((parm_table[i].type == P_STRING ||
 		     parm_table[i].type == P_USTRING) &&
 		    !(lp_ctx->flags[i] & FLAG_CMDLINE)) {
+			TALLOC_CTX *parent_mem;
 			char **r;
 			if (parm_table[i].p_class == P_LOCAL) {
+				parent_mem = lp_ctx->sDefault;
 				r = (char **)(((char *)lp_ctx->sDefault) + parm_table[i].offset);
 			} else {
+				parent_mem = lp_ctx->globals;
 				r = (char **)(((char *)lp_ctx->globals) + parm_table[i].offset);
 			}
-			*r = talloc_strdup(lp_ctx, "");
+			lpcfg_string_set(parent_mem, r, "");
 		}
 	}
 
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 9d60d82..d475d99 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -212,6 +212,9 @@ struct fsp_lease {
 	struct smb2_lease lease;
 };
 
+/* VFS ABI stability hack */
+#define posix_flags posix_open
+
 typedef struct files_struct {
 	struct files_struct *next, *prev;
 	uint64_t fnum;
@@ -249,7 +252,7 @@ typedef struct files_struct {
 	bool aio_write_behind;
 	bool initial_delete_on_close; /* Only set at NTCreateX if file was created. */
 	bool delete_on_close;
-	bool posix_open;
+	uint8_t posix_flags;
 	bool is_sparse;
 	bool backup_intent; /* Handle was successfully opened with backup intent
 				and opener has privilege to do so. */
@@ -291,6 +294,13 @@ typedef struct files_struct {
 	bool aapl_copyfile_supported;
 } files_struct;
 
+#define FSP_POSIX_FLAGS_OPEN		0x01
+#define FSP_POSIX_FLAGS_RENAME		0x02
+
+#define FSP_POSIX_FLAGS_ALL			\
+	(FSP_POSIX_FLAGS_OPEN |			\
+	 FSP_POSIX_FLAGS_RENAME)
+
 struct vuid_cache_entry {
 	struct auth_session_info *session_info;
 	uint64_t vuid; /* SMB2 compat */
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index ce595e1..dd90c82 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -842,7 +842,8 @@ bool set_share_mode(struct share_mode_lock *lck, struct files_struct *fsp,
 	e->id = fsp->file_id;
 	e->share_file_id = fsp->fh->gen_id;
 	e->uid = (uint32)uid;
-	e->flags = fsp->posix_open ? SHARE_MODE_FLAG_POSIX_OPEN : 0;
+	e->flags = (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) ?
+		SHARE_MODE_FLAG_POSIX_OPEN : 0;
 	e->name_hash = fsp->name_hash;
 
 	return true;
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index 625e7cb..f73e80c 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -1089,7 +1089,7 @@ static int chmod_acl_module_common(struct vfs_handle_struct *handle,
 static int fchmod_acl_module_common(struct vfs_handle_struct *handle,
 			struct files_struct *fsp, mode_t mode)
 {
-	if (fsp->posix_open) {
+	if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
 		/* Only allow this on POSIX opens. */
 		return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
 	}
@@ -1109,7 +1109,7 @@ static int chmod_acl_acl_module_common(struct vfs_handle_struct *handle,
 static int fchmod_acl_acl_module_common(struct vfs_handle_struct *handle,
 			struct files_struct *fsp, mode_t mode)
 {
-	if (fsp->posix_open) {
+	if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
 		/* Only allow this on POSIX opens. */
 		return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
 	}
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 461311c..17da629 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -123,7 +123,8 @@ struct fruit_config_data {
 	enum fruit_meta meta;
 	enum fruit_locking locking;
 	enum fruit_encoding encoding;
-	bool use_aapl;
+	bool use_aapl;		/* config from smb.conf */
+	bool nego_aapl;		/* client negotiated AAPL */
 	bool use_copyfile;
 	bool readdir_attr_enabled;
 	bool unix_info_enabled;
@@ -1901,6 +1902,9 @@ static NTSTATUS check_aapl(vfs_handle_struct *handle,
 				      out_context_blobs,
 				      SMB2_CREATE_TAG_AAPL,
 				      blob);
+	if (NT_STATUS_IS_OK(status)) {
+		config->nego_aapl = true;
+	}
 
 	return status;
 }
@@ -3345,16 +3349,27 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
 	if (!NT_STATUS_IS_OK(status)) {
 		return status;
 	}
+
 	fsp = *result;
 
-	if (config->copyfile_enabled) {
-		/*
-		 * Set a flag in the fsp. Gets used in copychunk to
-		 * check whether the special Apple copyfile semantics
-		 * for copychunk should be allowed in a copychunk
-		 * request with a count of 0.
-		 */
-		fsp->aapl_copyfile_supported = true;
+	if (config->nego_aapl) {
+		if (config->copyfile_enabled) {
+			/*
+			 * Set a flag in the fsp. Gets used in
+			 * copychunk to check whether the special
+			 * Apple copyfile semantics for copychunk
+			 * should be allowed in a copychunk request
+			 * with a count of 0.
+			 */
+			fsp->aapl_copyfile_supported = true;
+		}
+
+		if (fsp->is_directory) {
+			/*
+			 * Enable POSIX directory rename behaviour
+			 */
+			fsp->posix_flags |= FSP_POSIX_FLAGS_RENAME;
+		}
 	}
 
 	/*
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 7c125fa..94de252 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -265,44 +265,6 @@ static void set_allowed_client_auth(void);
 static bool lp_set_cmdline_helper(const char *pszParmName, const char *pszParmValue);
 static void free_param_opts(struct parmlist_entry **popts);
 
-/* this is used to prevent lots of mallocs of size 1 */
-static const char null_string[] = "";
-
-/**
- Free a string value.
-**/
-
-static void string_free(char **s)
-{
-	if (!s || !(*s))
-		return;
-	if (*s == null_string)
-		*s = NULL;
-	TALLOC_FREE(*s);
-}
-
-/**
- Set a string value, deallocating any existing space, and allocing the space
- for the string
-**/
-
-static bool string_set(TALLOC_CTX *mem_ctx, char **dest,const char *src)
-{
-	string_free(dest);
-
-	if (!src) {
-		src = "";
-	}
-
-	(*dest) = talloc_strdup(mem_ctx, src);
-	if ((*dest) == NULL) {
-		DEBUG(0,("Out of memory in string_init\n"));
-		return false;
-	}
-
-	return true;
-}
-
 /**
  *  Function to return the default value for the maximum number of open
  *  file descriptors permitted.  This function tries to consult the
@@ -366,7 +328,7 @@ static void free_one_parameter_common(void *parm_ptr,
 	if ((parm.type == P_STRING) ||
 	    (parm.type == P_USTRING))
 	{
-		string_free((char**)parm_ptr);
+		lpcfg_string_free((char**)parm_ptr);
 	} else if (parm.type == P_LIST || parm.type == P_CMDLIST) {
 		TALLOC_FREE(*((char***)parm_ptr));
 	}
@@ -523,10 +485,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 
 	if (!done_init) {
 		/* The logfile can be set before this is invoked. Free it if so. */
-		if (Globals.logfile != NULL) {
-			string_free(&Globals.logfile);
-			Globals.logfile = NULL;
-		}
+		lpcfg_string_free(&Globals.logfile);
 		done_init = true;
 	} else {
 		free_global_parameters();
@@ -549,13 +508,16 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 		if ((parm_table[i].type == P_STRING ||
 		     parm_table[i].type == P_USTRING))
 		{
-			string_set(Globals.ctx, (char **)lp_parm_ptr(NULL, &parm_table[i]), "");
+			lpcfg_string_set(
+				Globals.ctx,
+				(char **)lp_parm_ptr(NULL, &parm_table[i]),
+				"");
 		}
 	}
 
 
-	string_set(Globals.ctx, &sDefault.fstype, FSTYPE_STRING);
-	string_set(Globals.ctx, &sDefault.printjob_username, "%U");
+	lpcfg_string_set(Globals.ctx, &sDefault.fstype, FSTYPE_STRING);
+	lpcfg_string_set(Globals.ctx, &sDefault.printjob_username, "%U");
 
 	init_printer_values(lp_ctx, Globals.ctx, &sDefault);
 
@@ -564,36 +526,38 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 	DEBUG(3, ("Initialising global parameters\n"));
 
 	/* Must manually force to upper case here, as this does not go via the handler */
-	string_set(Globals.ctx, &Globals.netbios_name, myhostname_upper());
+	lpcfg_string_set(Globals.ctx, &Globals.netbios_name, myhostname_upper());
 
-	string_set(Globals.ctx, &Globals.smb_passwd_file, get_dyn_SMB_PASSWD_FILE());
-	string_set(Globals.ctx, &Globals.private_dir, get_dyn_PRIVATE_DIR());
+	lpcfg_string_set(Globals.ctx, &Globals.smb_passwd_file,
+		get_dyn_SMB_PASSWD_FILE());
+	lpcfg_string_set(Globals.ctx, &Globals.private_dir,
+		get_dyn_PRIVATE_DIR());
 
 	/* use the new 'hash2' method by default, with a prefix of 1 */
-	string_set(Globals.ctx, &Globals.mangling_method, "hash2");
+	lpcfg_string_set(Globals.ctx, &Globals.mangling_method, "hash2");
 	Globals.mangle_prefix = 1;
 
-	string_set(Globals.ctx, &Globals.guest_account, GUEST_ACCOUNT);
+	lpcfg_string_set(Globals.ctx, &Globals.guest_account, GUEST_ACCOUNT);
 
 	/* using UTF8 by default allows us to support all chars */
-	string_set(Globals.ctx, &Globals.unix_charset, DEFAULT_UNIX_CHARSET);
+	lpcfg_string_set(Globals.ctx, &Globals.unix_charset, DEFAULT_UNIX_CHARSET);
 
 	/* Use codepage 850 as a default for the dos character set */
-	string_set(Globals.ctx, &Globals.dos_charset, DEFAULT_DOS_CHARSET);
+	lpcfg_string_set(Globals.ctx, &Globals.dos_charset, DEFAULT_DOS_CHARSET);
 
 	/*
 	 * Allow the default PASSWD_CHAT to be overridden in local.h.
 	 */
-	string_set(Globals.ctx, &Globals.passwd_chat, DEFAULT_PASSWD_CHAT);
+	lpcfg_string_set(Globals.ctx, &Globals.passwd_chat, DEFAULT_PASSWD_CHAT);
 
-	string_set(Globals.ctx, &Globals.workgroup, DEFAULT_WORKGROUP);
+	lpcfg_string_set(Globals.ctx, &Globals.workgroup, DEFAULT_WORKGROUP);
 
-	string_set(Globals.ctx, &Globals.passwd_program, "");
-	string_set(Globals.ctx, &Globals.lock_directory, get_dyn_LOCKDIR());
-	string_set(Globals.ctx, &Globals.state_directory, get_dyn_STATEDIR());
-	string_set(Globals.ctx, &Globals.cache_directory, get_dyn_CACHEDIR());
-	string_set(Globals.ctx, &Globals.pid_directory, get_dyn_PIDDIR());
-	string_set(Globals.ctx, &Globals.nbt_client_socket_address, "0.0.0.0");
+	lpcfg_string_set(Globals.ctx, &Globals.passwd_program, "");
+	lpcfg_string_set(Globals.ctx, &Globals.lock_directory, get_dyn_LOCKDIR());
+	lpcfg_string_set(Globals.ctx, &Globals.state_directory, get_dyn_STATEDIR());
+	lpcfg_string_set(Globals.ctx, &Globals.cache_directory, get_dyn_CACHEDIR());
+	lpcfg_string_set(Globals.ctx, &Globals.pid_directory, get_dyn_PIDDIR());
+	lpcfg_string_set(Globals.ctx, &Globals.nbt_client_socket_address, "0.0.0.0");
 	/*
 	 * By default support explicit binding to broadcast
  	 * addresses.
@@ -604,21 +568,21 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 	if (s == NULL) {
 		smb_panic("init_globals: ENOMEM");
 	}
-	string_set(Globals.ctx, &Globals.server_string, s);
+	lpcfg_string_set(Globals.ctx, &Globals.server_string, s);
 	TALLOC_FREE(s);
 #ifdef DEVELOPER
-	string_set(Globals.ctx, &Globals.panic_action, "/bin/sleep 999999999");
+	lpcfg_string_set(Globals.ctx, &Globals.panic_action, "/bin/sleep 999999999");
 #endif
 
-	string_set(Globals.ctx, &Globals.socket_options, DEFAULT_SOCKET_OPTIONS);
+	lpcfg_string_set(Globals.ctx, &Globals.socket_options, DEFAULT_SOCKET_OPTIONS);
 
-	string_set(Globals.ctx, &Globals.logon_drive, "");
+	lpcfg_string_set(Globals.ctx, &Globals.logon_drive, "");
 	/* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */
-	string_set(Globals.ctx, &Globals.logon_home, "\\\\%N\\%U");
-	string_set(Globals.ctx, &Globals.logon_path, "\\\\%N\\%U\\profile");
+	lpcfg_string_set(Globals.ctx, &Globals.logon_home, "\\\\%N\\%U");
+	lpcfg_string_set(Globals.ctx, &Globals.logon_path, "\\\\%N\\%U\\profile");
 
 	Globals.name_resolve_order = (const char **)str_list_make_v3(NULL, "lmhosts wins host bcast", NULL);
-	string_set(Globals.ctx, &Globals.password_server, "*");
+	lpcfg_string_set(Globals.ctx, &Globals.password_server, "*");
 
 	Globals.algorithmic_rid_base = BASE_RID;
 
@@ -659,7 +623,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 	Globals.syslog = 1;
 	Globals.syslog_only = false;
 	Globals.timestamp_logs = true;
-	string_set(Globals.ctx, &Globals.log_level, "0");
+	lpcfg_string_set(Globals.ctx, &Globals.log_level, "0");
 	Globals.debug_prefix_timestamp = false;
 	Globals.debug_hires_timestamp = true;
 	Globals.debug_pid = false;
@@ -675,9 +639,10 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 #if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT))
 	Globals.nis_homedir = false;
 #ifdef WITH_NISPLUS_HOME
-	string_set(Globals.ctx, &Globals.homedir_map, "auto_home.org_dir");
+	lpcfg_string_set(Globals.ctx, &Globals.homedir_map,
+			 "auto_home.org_dir");
 #else
-	string_set(Globals.ctx, &Globals.homedir_map, "auto.home");
+	lpcfg_string_set(Globals.ctx, &Globals.homedir_map, "auto.home");
 #endif
 #endif
 	Globals.time_server = false;
@@ -718,14 +683,14 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
 	   a large number of sites (tridge) */
 	Globals.hostname_lookups = false;
 
-	string_set(Globals.ctx, &Globals.passdb_backend, "tdbsam");
-	string_set(Globals.ctx, &Globals.ldap_suffix, "");
-	string_set(Globals.ctx, &Globals.szLdapMachineSuffix, "");
-	string_set(Globals.ctx, &Globals.szLdapUserSuffix, "");
-	string_set(Globals.ctx, &Globals.szLdapGroupSuffix, "");
-	string_set(Globals.ctx, &Globals.szLdapIdmapSuffix, "");
+	lpcfg_string_set(Globals.ctx, &Globals.passdb_backend, "tdbsam");
+	lpcfg_string_set(Globals.ctx, &Globals.ldap_suffix, "");
+	lpcfg_string_set(Globals.ctx, &Globals.szLdapMachineSuffix, "");
+	lpcfg_string_set(Globals.ctx, &Globals.szLdapUserSuffix, "");
+	lpcfg_string_set(Globals.ctx, &Globals.szLdapGroupSuffix, "");
+	lpcfg_string_set(Globals.ctx, &Globals.szLdapIdmapSuffix, "");
 
-	string_set(Globals.ctx, &Globals.ldap_admin_dn, "");
+	lpcfg_string_set(Globals.ctx, &Globals.ldap_admin_dn, "");
 	Globals.ldap_ssl = LDAP_SSL_START_TLS;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list