diff options
author | Garming Sam <garming@catalyst.net.nz> | 2014-01-17 10:16:12 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-02-20 10:11:00 +1300 |
commit | bce62e600085270f26053882c5a4e35f5fe4fb5e (patch) | |
tree | 36be15d3c9867498693ae247c119c18b933e835f /source4/ntvfs/posix | |
parent | 497f0327a08fbfa444308c90a418ccb6b45b96d6 (diff) | |
download | samba-bce62e600085270f26053882c5a4e35f5fe4fb5e.tar.gz samba-bce62e600085270f26053882c5a4e35f5fe4fb5e.tar.xz samba-bce62e600085270f26053882c5a4e35f5fe4fb5e.zip |
s4: pass down a memory context when performing share_string_option, to allow substitutions
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: I24b36db3ac11834c3268b2da929e214c10268b16
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
Diffstat (limited to 'source4/ntvfs/posix')
-rw-r--r-- | source4/ntvfs/posix/vfs_posix.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 2ca024b6187..519ca98f39d 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -38,7 +38,8 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) { struct share_config *scfg = pvfs->ntvfs->ctx->config; - const char *eadb; + char *eadb; + char *xattr_backend; bool def_perm_override = false; if (share_bool_option(scfg, SHARE_MAP_HIDDEN, SHARE_MAP_HIDDEN_DEFAULT)) @@ -117,11 +118,12 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) FS_ATTR_SPARSE_FILES; /* allow xattrs to be stored in a external tdb */ - eadb = share_string_option(scfg, PVFS_EADB, NULL); + eadb = share_string_option(pvfs, scfg, PVFS_EADB, NULL); if (eadb != NULL) { pvfs->ea_db = tdb_wrap_open(pvfs, eadb, 50000, TDB_DEFAULT, O_RDWR|O_CREAT, 0600, pvfs->ntvfs->ctx->lp_ctx); + TALLOC_FREE(eadb); if (pvfs->ea_db != NULL) { pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; } else { @@ -147,7 +149,9 @@ static void pvfs_setup_options(struct pvfs_state *pvfs) } /* enable an ACL backend */ - pvfs->acl_ops = pvfs_acl_backend_byname(share_string_option(scfg, PVFS_ACL, "xattr")); + xattr_backend = share_string_option(pvfs, scfg, PVFS_ACL, "xattr"); + pvfs->acl_ops = pvfs_acl_backend_byname(xattr_backend); + TALLOC_FREE(xattr_backend); } static int pvfs_state_destructor(struct pvfs_state *pvfs) @@ -220,7 +224,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, NT_STATUS_HAVE_NO_MEMORY(pvfs); /* for simplicity of path construction, remove any trailing slash now */ - base_directory = talloc_strdup(pvfs, share_string_option(ntvfs->ctx->config, SHARE_PATH, "")); + base_directory = share_string_option(pvfs, ntvfs->ctx->config, SHARE_PATH, ""); NT_STATUS_HAVE_NO_MEMORY(base_directory); if (strcmp(base_directory, "/") != 0) { trim_string(base_directory, NULL, "/"); |