summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2006-09-03 02:10:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:39:48 -0500
commit315f4162111d210d0f65123c8c7fe7084a12121c (patch)
treee73633c908b99856adb9e423fbe2f5bb243e734e /source3/libsmb
parent44c1504c032ffa0f0b9cc2333fa0e3a05a03bf48 (diff)
downloadsamba-315f4162111d210d0f65123c8c7fe7084a12121c.tar.gz
samba-315f4162111d210d0f65123c8c7fe7084a12121c.tar.bz2
samba-315f4162111d210d0f65123c8c7fe7084a12121c.zip
r18013: Fix for "bug" (enhancement) 3684.
Provide a new option to specify the share mode to be used when opening a file. (This used to be commit 9b6fee5f6f60638ed80fdedcce4b3d29b091f7aa)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/libsmbclient.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index 95a9da8487..f89c03274a 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -1120,7 +1120,8 @@ smbc_open_ctx(SMBCCTX *context,
cli_dfs_make_full_path( targetpath, targetcli->desthost, targetcli->share, temppath);
}
- if ((fd = cli_open(targetcli, targetpath, flags, DENY_NONE)) < 0) {
+ if ((fd = cli_open(targetcli, targetpath, flags,
+ context->internal->_share_mode)) < 0) {
/* Handle the error ... */
@@ -6166,6 +6167,8 @@ smbc_new_context(void)
context->options.browse_max_lmb_count = 3; /* # LMBs to query */
context->options.urlencode_readdir_entries = False;/* backward compat */
context->options.one_share_per_server = False;/* backward compat */
+ context->internal->_share_mode = SMBC_SHAREMODE_DENY_NONE;
+ /* backward compat */
context->open = smbc_open_ctx;
context->creat = smbc_creat_ctx;
@@ -6301,6 +6304,7 @@ smbc_option_set(SMBCCTX *context,
{
va_list ap;
union {
+ int i;
BOOL b;
smbc_get_auth_data_with_context_fn auth_fn;
void *v;
@@ -6327,6 +6331,15 @@ smbc_option_set(SMBCCTX *context,
option_value.b = (BOOL) va_arg(ap, int);
context->internal->_full_time_names = option_value.b;
+ } else if (strcmp(option_name, "open_share_mode") == 0) {
+ /*
+ * The share mode to use for files opened with
+ * smbc_open_ctx(). The default is SMBC_SHAREMODE_DENY_NONE.
+ */
+ option_value.i = va_arg(ap, int);
+ context->internal->_share_mode =
+ (smbc_share_mode) option_value.i;
+
} else if (strcmp(option_name, "auth_function") == 0) {
/*
* Use the new-style authentication function which includes