From 315f4162111d210d0f65123c8c7fe7084a12121c Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Sun, 3 Sep 2006 02:10:24 +0000 Subject: 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) --- source3/include/libsmb_internal.h | 6 ++++++ source3/include/libsmbclient.h | 14 ++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'source3/include') diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h index ce7a90747f..41f72d5fb3 100644 --- a/source3/include/libsmb_internal.h +++ b/source3/include/libsmb_internal.h @@ -89,6 +89,12 @@ struct smbc_internal_data { */ BOOL _full_time_names; + /* + * The share mode of a file being opened. To match POSIX semantics + * (and maintain backward compatibility), DENY_NONE is the default. + */ + smbc_share_mode _share_mode; + /* * Authentication function which includes the context. This will be * used if set; otherwise context->callbacks.auth_fn() will be used. diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h index 66a567a0d5..45f2a41b08 100644 --- a/source3/include/libsmbclient.h +++ b/source3/include/libsmbclient.h @@ -141,6 +141,20 @@ struct smbc_dirent #define SMBC_DOS_MODE_DIRECTORY 0x10 #define SMBC_DOS_MODE_ARCHIVE 0x20 +/* + * Valid values for the option "open_share_mode", when calling + * smbc_option_set() + */ +typedef enum smbc_share_mode +{ + SMBC_SHAREMODE_DENY_DOS = 0, + SMBC_SHAREMODE_DENY_ALL = 1, + SMBC_SHAREMODE_DENY_WRITE = 2, + SMBC_SHAREMODE_DENY_READ = 3, + SMBC_SHAREMODE_DENY_NONE = 4, + SMBC_SHAREMODE_DENY_FCB = 7 +} smbc_share_mode; + #ifndef ENOATTR # define ENOATTR ENOENT /* No such attribute */ -- cgit