#define WRITE_ERROR 4 /* This error code can go into the client smb_rw_error. */
#define READ_BAD_SIG 5
#define DO_NOT_DO_TDIS 6 /* cli_close_connection() check for this when smbfs wants to keep tree connected */
+#define READ_BAD_DECRYPT 7
#define DIR_STRUCT_SIZE 43
#define PIPE_NETDFS "\\PIPE\\netdfs"
#define PIPE_ECHO "\\PIPE\\rpcecho"
#define PIPE_SHUTDOWN "\\PIPE\\initshutdown"
-#define PIPE_EPM "\\PIPE\\epmapper"
+#define PIPE_EPMAPPER "\\PIPE\\epmapper"
#define PIPE_SVCCTL "\\PIPE\\svcctl"
#define PIPE_EVENTLOG "\\PIPE\\eventlog"
#define PIPE_UNIXINFO "\\PIPE\\unixinfo"
#define PI_EVENTLOG 12
#define PI_UNIXINFO 13
#define PI_NTSVCS 14
-#define PI_MAX_PIPES 15
+#define PI_EPMAPPER 15
+#define PI_MAX_PIPES 16
/* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */
typedef uint64_t NTTIME;
#define dom_sid2 dom_sid
#define dom_sid28 dom_sid
+enum id_mapping {
+ ID_UNKNOWN,
+ ID_MAPPED,
+ ID_UNMAPPED
+};
+
enum id_type {
ID_TYPE_UID,
ID_TYPE_GID
struct id_map {
DOM_SID *sid;
struct unixid xid;
- BOOL mapped;
+ enum id_mapping status;
};
#include "librpc/ndr/misc.h"
unsigned long file_id;
};
+struct messaging_context;
+struct event_context;
+struct fd_event;
struct timed_event;
struct idle_event;
struct share_mode_entry;
struct notify_change {
uint32_t action;
- char *name;
-};
-
-struct notify_change_request {
- struct notify_change_request *prev, *next;
- struct files_struct *fsp; /* backpointer for cancel by mid */
- char request_buf[smb_size];
- uint32 filter;
- uint32 max_param_count;
- struct notify_mid_map *mid_map;
+ const char *name;
};
-/*
- * For NTCancel, we need to find the notify_change_request indexed by
- * mid. Separate list here.
- */
-
-struct notify_mid_map {
- struct notify_mid_map *prev, *next;
- struct notify_change_request *req;
- uint16 mid;
+struct notify_mid_map;
+struct notify_entry;
+struct notify_event;
+struct notify_change_request;
+struct sys_notify_backend;
+struct sys_notify_context {
+ struct event_context *ev;
+ struct connection_struct *conn;
+ void *private_data; /* For use by the system backend */
};
struct notify_change_buf {
* If no requests are pending, changes are queued here. Simple array,
* we only append.
*/
- unsigned num_changes;
+
+ /*
+ * num_changes == -1 means that we have got a catch-all change, when
+ * asked we just return NT_STATUS_OK without specific changes.
+ */
+ int num_changes;
struct notify_change *changes;
/*
uint32 access_mask; /* NTCreateX access bits (FILE_READ_DATA etc.) */
uint32 share_access; /* NTCreateX share constants (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE). */
BOOL pending_modtime_owner;
- time_t pending_modtime;
- time_t last_write_time;
+ struct timespec pending_modtime;
+ struct timespec last_write_time;
int oplock_type;
int sent_oplock_break;
struct timed_event *oplock_timeout;
struct lock_struct last_lock_failure;
+ int current_lock_count; /* Count the number of outstanding locks and pending locks. */
struct share_mode_entry *pending_break_messages;
int num_pending_break_messages;
BOOL modified;
BOOL is_directory;
BOOL is_stat;
- BOOL aio_write_behind;
BOOL lockdb_clean;
+ BOOL initial_delete_on_close; /* Only set at NTCreateX if file was created. */
+ BOOL posix_open;
char *fsp_name;
struct vfs_fsp_data *vfs_extension;
name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */
name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */
name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */
- name_compare_entry *aio_write_behind_list; /* Per-share list of files to use aio write behind on. */
struct dfree_cached_info *dfree_info;
struct trans_state *pending_trans;
+ struct notify_context *notify_ctx;
} connection_struct;
struct current_user {
DATA_BLOB private_data;
};
+#define SHARE_MODE_FLAG_POSIX_OPEN 0x1
+
/* struct returned by get_share_modes */
struct share_mode_entry {
struct process_id pid;
SMB_INO_T inode;
unsigned long share_file_id;
uint32 uid; /* uid of file opener. */
+ uint16 flags; /* POSIX_OPEN only defined so far... */
};
/* oplock break message definition - linearization of share_mode_entry.
36 SMB_INO_T inode 8 bytes
44 unsigned long file_id 4 bytes
48 uint32 uid 4 bytes
-52
+52 uint16 flags 2 bytes
+54
*/
-#define MSG_SMB_SHARE_MODE_ENTRY_SIZE 52
+#define MSG_SMB_SHARE_MODE_ENTRY_SIZE 54
struct share_mode_lock {
const char *servicepath; /* canonicalized. */
struct share_mode_entry *share_modes;
UNIX_USER_TOKEN *delete_token;
BOOL delete_on_close;
- BOOL initial_delete_on_close;
BOOL fresh;
BOOL modified;
};
struct {
int num_share_mode_entries;
BOOL delete_on_close;
- BOOL initial_delete_on_close; /* Only set at NTCreateX if file was created. */
uint32 delete_token_size; /* Only valid if either of
the two previous fields
are True. */
#define SMBunlock 0x0D /* unlock byte range */
#define SMBctemp 0x0E /* create temporary file */
#define SMBmknew 0x0F /* make new file */
-#define SMBchkpth 0x10 /* check directory path */
+#define SMBcheckpath 0x10 /* check directory path */
#define SMBexit 0x11 /* process exit */
#define SMBlseek 0x12 /* seek */
#define SMBtcon 0x70 /* tree connect */
/* Mapping of generic access rights for files to specific rights. */
+/* This maps to 0x1F01FF */
#define FILE_GENERIC_ALL (STANDARD_RIGHTS_REQUIRED_ACCESS| SYNCHRONIZE_ACCESS|FILE_ALL_ACCESS)
+/* This maps to 0x120089 */
#define FILE_GENERIC_READ (STANDARD_RIGHTS_READ_ACCESS|FILE_READ_DATA|FILE_READ_ATTRIBUTES|\
FILE_READ_EA|SYNCHRONIZE_ACCESS)
+/* This maps to 0x120116 */
#define FILE_GENERIC_WRITE (STD_RIGHT_READ_CONTROL_ACCESS|FILE_WRITE_DATA|FILE_WRITE_ATTRIBUTES|\
FILE_WRITE_EA|FILE_APPEND_DATA|SYNCHRONIZE_ACCESS)
#define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE_ACCESS|\
FILE_EXECUTE|SYNCHRONIZE_ACCESS)
+/* Share specific rights. */
+#define SHARE_ALL_ACCESS FILE_GENERIC_ALL
+#define SHARE_READ_ONLY (FILE_GENERIC_READ|FILE_EXECUTE)
+
/* Mapping of access rights to UNIX perms. */
#define UNIX_ACCESS_RWX FILE_GENERIC_ALL
#define UNIX_ACCESS_R FILE_GENERIC_READ
#define FILE_READ_ONLY_VOLUME 0x00080000
/* ChangeNotify flags. */
-#define FILE_NOTIFY_CHANGE_FILE 0x001
+#define FILE_NOTIFY_CHANGE_FILE_NAME 0x001
#define FILE_NOTIFY_CHANGE_DIR_NAME 0x002
#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x004
#define FILE_NOTIFY_CHANGE_SIZE 0x008
#define FILE_NOTIFY_CHANGE_CREATION 0x040
#define FILE_NOTIFY_CHANGE_EA 0x080
#define FILE_NOTIFY_CHANGE_SECURITY 0x100
-#define FILE_NOTIFY_CHANGE_FILE_NAME 0x200
+#define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
+#define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
+#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
#define FILE_NOTIFY_CHANGE_NAME \
(FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_DIR_NAME)
#define FLAGS2_LONG_PATH_COMPONENTS 0x0001
#define FLAGS2_EXTENDED_ATTRIBUTES 0x0002
#define FLAGS2_SMB_SECURITY_SIGNATURES 0x0004
+#define FLAGS2_UNKNOWN_BIT4 0x0010
#define FLAGS2_IS_LONG_NAME 0x0040
#define FLAGS2_EXTENDED_SECURITY 0x0800
#define FLAGS2_DFS_PATHNAMES 0x1000
#define FLAGS2_WIN2K_SIGNATURE 0xC852 /* Hack alert ! For now... JRA. */
+/* TCONX Flag (smb_vwv2). */
+#define TCONX_FLAG_EXTENDED_RESPONSE 0x8
+
/* Capabilities. see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */
#define CAP_RAW_MODE 0x0001
/* Remote architectures we know about. */
enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT,
- RA_WIN2K, RA_WINXP, RA_WIN2K3, RA_SAMBA, RA_CIFSFS};
+ RA_WIN2K, RA_WINXP, RA_WIN2K3, RA_VISTA,
+ RA_SAMBA, RA_CIFSFS};
/* case handling */
enum case_handling {CASE_LOWER,CASE_UPPER};
* Note these must fit into 16-bits.
*/
-#define NO_OPLOCK 0
-#define EXCLUSIVE_OPLOCK 1
-#define BATCH_OPLOCK 2
-#define LEVEL_II_OPLOCK 4
+#define NO_OPLOCK 0x0
+#define EXCLUSIVE_OPLOCK 0x1
+#define BATCH_OPLOCK 0x2
+#define LEVEL_II_OPLOCK 0x4
/* The following are Samba-private. */
-#define INTERNAL_OPEN_ONLY 8
-#define FAKE_LEVEL_II_OPLOCK 16 /* Client requested no_oplock, but we have to
+#define INTERNAL_OPEN_ONLY 0x8
+#define FAKE_LEVEL_II_OPLOCK 0x10 /* Client requested no_oplock, but we have to
* inform potential level2 holders on
* write. */
-#define DEFERRED_OPEN_ENTRY 32
-#define UNUSED_SHARE_MODE_ENTRY 64
-#define FORCE_OPLOCK_BREAK_TO_NONE 128
+#define DEFERRED_OPEN_ENTRY 0x20
+#define UNUSED_SHARE_MODE_ENTRY 0x40
+#define FORCE_OPLOCK_BREAK_TO_NONE 0x80
/* None of the following should ever appear in fsp->oplock_request. */
#define SAMBA_PRIVATE_OPLOCK_MASK (INTERNAL_OPEN_ONLY|DEFERRED_OPEN_ENTRY|UNUSED_SHARE_MODE_ENTRY|FORCE_OPLOCK_BREAK_TO_NONE)
int notification_fd;
};
-
-/* this structure defines the functions for doing change notify in
- various implementations */
-struct cnotify_fns {
- void * (*register_notify)(connection_struct *conn, char *path, uint32 flags);
- BOOL (*check_notify)(connection_struct *conn, uint16 vuid, char *path, uint32 flags, void *data, time_t t);
- void (*remove_notify)(void *data);
- int select_time;
- int notification_fd;
-};
-
#include "smb_macros.h"
#define MAX_NETBIOSNAME_LEN 16
fstring password;
};
+/* For split krb5 SPNEGO blobs. */
+struct pending_auth_data {
+ struct pending_auth_data *prev, *next;
+ uint16 vuid; /* Tag for this entry. */
+ uint16 smbpid; /* Alternate tag for this entry. */
+ size_t needed_len;
+ DATA_BLOB partial_data;
+};
+
typedef struct user_struct {
struct user_struct *next, *prev;
uint16 vuid; /* Tag for this entry. */
gid_t gid; /* gid of a validated user */
userdom_struct user;
- char *homedir;
- char *unix_homedir;
- char *logon_script;
+ const char *homedir;
+ const char *unix_homedir;
+ const char *logon_script;
BOOL guest;
struct auth_serversupplied_info *server_info;
struct auth_ntlmssp_state *auth_ntlmssp_state;
-
} user_struct;
struct unix_error_map {
/* Different reasons for closing a file. */
enum file_close_type {NORMAL_CLOSE=0,SHUTDOWN_CLOSE,ERROR_CLOSE};
+#include "librpc/gen_ndr/epmapper.h"
+
#endif /* _SMB_H */