The branch, v4-3-test has been updated via a7fa3a6 smbd: make "hide dot files" option work with "store dos attributes = yes" via 76edbf5 lib/async_req: do not install async_connect_send_test. via 795c543 lib/param: add a fixed unified lpcfg_string_{free,set,set_upper}() infrastructure via b8ecf97 samba-tool: fsmo.py throws an uncaught exception if no via 95ed8b7 s4:torture:vfs_fruit: add a test for POSIX rename via 685ad2d vfs_fruit: enable POSIX directory rename semantics via dfbf293 vfs_fruit: add a flag that tracks whether use of AAPL was negotiated via 02968ec s3:smbd: file_struct: seperate POSIX directory rename cap from POSIX open via db3d0c6 s3:smbd: convert file_struct.posix_open to a bitmap with flags from 420f38f VERSION: Bump version up to 4.3.4...
https://git.samba.org/?p=samba.git;a=shortlog;h=v4-3-test - Log ----------------------------------------------------------------- commit a7fa3a6db563e0e160843090f72bfd6a40f27303 Author: Ralph Boehme <s...@samba.org> Date: Tue Dec 15 13:13:02 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 <s...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Wed Dec 16 07:21:10 CET 2015 on sn-devel-104 (cherry picked from commit 2058ce246ea5008202e737f64fbdd9b586b2d7d4) Autobuild-User(v4-3-test): Karolin Seeger <ksee...@samba.org> Autobuild-Date(v4-3-test): Thu Dec 17 14:08:21 CET 2015 on sn-devel-104 commit 76edbf52b1e7a56014e546abfa588f3ee40e2574 Author: Günther Deschner <g...@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 <g...@samba.org> Reviewed-by: Ralph Boehme <s...@samba.org> (cherry picked from commit 632114584d3be0d4660e97a6c9e69e577a7bc1e2) commit 795c543d858b2452f062a02846c2f908fe4cffe4 Author: Jeremy Allison <j...@samba.org> Date: Mon Dec 7 16:01:17 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 <me...@samba.org> Reviewed-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit b8ecf97b1f3d67fd6124ef51202d792734024c8b Author: Rowland Penny <repenny241...@gmail.com> Date: Mon Nov 23 18:40:19 2015 +0000 samba-tool: fsmo.py throws an uncaught exception if no fSMORoleOwner attribute This will fix bug 11613 where a user got the uncaught exception when trying to seize an FSMO role that didn't have the required attribute. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11613 Signed-off-by: Rowland Penny <repenny241...@gmail.com> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Uri Simchoni <u...@samba.org> Autobuild-User(master): Uri Simchoni <u...@samba.org> Autobuild-Date(master): Sun Dec 6 00:33:10 CET 2015 on sn-devel-104 (cherry picked from commit 4735e5f5e35bdff88bf59d56ecf1980cdabc3c83) commit 95ed8b75eda7ad120d64e6e9554ef2a69d8b8491 Author: Ralph Boehme <s...@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 <s...@samba.org> (cherry picked from commit 0f0693d0fa5fa991bb573525f332eba5ceb6ece6) commit 685ad2d373d679c054ab4dd976c80fbc4d377638 Author: Ralph Boehme <s...@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 <s...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit 1d7bef5a75403f5baec13aa6264dfe763a4b278a) commit dfbf293cd736bd437537bd39fe5f4d4abeafeb26 Author: Ralph Boehme <s...@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 <s...@samba.org> (cherry picked from commit 89a7394d679b383920d73fef0d178b8f84bc393f) commit 02968ec3cd90a62ffc2164bf337d049b86d8be49 Author: Ralph Boehme <s...@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 <s...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit bf1957584e341473edcd5025b7f77766440d408b) commit db3d0c68fa2cb4739063c9d03ff5d029d0358f7a Author: Ralph Boehme <s...@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 <s...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> (cherry picked from commit d698cec1c7e700e57cab46d33df0dde13303b318) ----------------------------------------------------------------------- Summary of changes: lib/async_req/wscript_build | 3 +- lib/param/loadparm.c | 56 ++++++---- python/samba/netcmd/fsmo.py | 3 +- 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 | 235 +++++++++++++++++++-------------------- 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, 414 insertions(+), 170 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/async_req/wscript_build b/lib/async_req/wscript_build index 9c25223..bf79fdd 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 c26442a..7b75f13 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -508,16 +508,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) { @@ -534,10 +554,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) { @@ -811,9 +833,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; @@ -825,16 +846,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; @@ -2404,13 +2419,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/python/samba/netcmd/fsmo.py b/python/samba/netcmd/fsmo.py index 0b4488f..3904bcb 100644 --- a/python/samba/netcmd/fsmo.py +++ b/python/samba/netcmd/fsmo.py @@ -38,7 +38,8 @@ def get_fsmo_roleowner(samdb, roledn): """ res = samdb.search(roledn, scope=ldb.SCOPE_BASE, attrs=["fSMORoleOwner"]) - assert len(res) == 1 + if len(res) == 0: + raise CommandError('"%s" does not have a FSMO roleowner' % roledn) master_owner = res[0]["fSMORoleOwner"][0] return master_owner diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 9945375..d839be4 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -218,6 +218,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; @@ -255,7 +258,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. */ @@ -297,6 +300,13 @@ typedef struct files_struct { struct tevent_req *deferred_close; } 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 7b8bc84..5a97460 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -847,7 +847,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_t)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 ecce85d..610a690 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -124,7 +124,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; @@ -1894,6 +1895,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; } @@ -3338,16 +3342,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 2f53a74..6258bcc 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -266,44 +266,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 @@ -367,7 +329,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)); } @@ -524,10 +486,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(); @@ -550,13 +509,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); @@ -565,61 +527,75 @@ 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); - - 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_chat, + DEFAULT_PASSWD_CHAT); + + lpcfg_string_set(Globals.ctx, &Globals.workgroup, DEFAULT_WORKGROUP); + + 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. - */ + */ Globals.nmbd_bind_explicit_broadcast = true; s = talloc_asprintf(talloc_tos(), "Samba %s", samba_version_string()); 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 = str_list_make_v3_const(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; @@ -660,7 +636,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; @@ -676,9 +652,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; @@ -723,14 +700,14 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals) Globals.change_notify = true, Globals.kernel_change_notify = true, - 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, ""); -- Samba Shared Repository