Proper fix for #6898 - Samba duplicates file content on appending. Pointed out by...
[ira/wip.git] / source3 / include / smb.h
index 1347ab228b6e89bb22df1b0d1d961f5cd6301d00..09689840280c791d9fe410fb16f47bc73ecdb2ec 100644 (file)
@@ -253,6 +253,7 @@ struct id_map {
 #include "librpc/gen_ndr/spoolss.h"
 #include "librpc/gen_ndr/dcerpc.h"
 #include "librpc/gen_ndr/ndr_dcerpc.h"
+#include "librpc/gen_ndr/ntlmssp.h"
 
 struct lsa_dom_info {
        bool valid;
@@ -460,6 +461,14 @@ typedef struct files_struct {
 
        struct files_struct *base_fsp; /* placeholder for delete on close */
 
+       /*
+        * Read-only cached brlock record, thrown away when the
+        * brlock.tdb seqnum changes. This avoids fetching data from
+        * the brlock.tdb on every read/write call.
+        */
+       int brlock_seqnum;
+       struct byte_range_lock *brlock_rec;
+
        struct dptr_struct *dptr;
 } files_struct;
 
@@ -557,9 +566,10 @@ typedef struct connection_struct {
        bool ipc;
        bool read_only; /* Attributes for the current user of the share. */
        bool admin_user; /* Attributes for the current user of the share. */
-       bool hires_timestamps_avail; /* Does this filesystem honor
-                                       sub second timestamps on files
-                                       and directories ? */
+       /* Does this filesystem honor
+          sub second timestamps on files
+          and directories when setting time ? */
+       enum timestamp_set_resolution ts_res;
        char *connectpath;
        char *origpath;
 
@@ -725,6 +735,7 @@ struct pending_message_list {
        struct smb_perfcount_data pcd;
        uint32_t seqnum;
        bool encrypted;
+       bool processed;
        DATA_BLOB buf;
        DATA_BLOB private_data;
 };
@@ -1509,6 +1520,15 @@ char *strdup(char *s);
 /* TCONX Flag (smb_vwv2). */
 #define TCONX_FLAG_EXTENDED_RESPONSE   0x8
 
+/* File Status Flags. See:
+
+http://msdn.microsoft.com/en-us/library/cc246334(PROT.13).aspx
+*/
+
+#define NO_EAS                 0x1
+#define NO_SUBSTREAMS          0x2
+#define NO_REPARSETAG          0x4
+
 /* Capabilities.  see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */
 
 #define CAP_RAW_MODE         0x0001
@@ -1877,6 +1897,8 @@ struct ea_list {
 #define SAMBA_XATTR_DOSSTREAM_PREFIX "user.DosStream."
 /* Prefix for DOS timestamps. */
 #define SAMBA_XATTR_DOSTIMESTAMPS "user.DosTimestamps"
+/* Prefix for xattrs storing streams. */
+#define SAMBA_XATTR_MARKER "user.SAMBA_STREAMS"
 
 #define UUID_SIZE 16
 
@@ -1932,6 +1954,7 @@ struct smb_file_time {
 #define UCF_SAVE_LCOMP                 0x00000001
 #define UCF_ALWAYS_ALLOW_WCARD_LCOMP   0x00000002
 #define UCF_COND_ALLOW_WCARD_LCOMP     0x00000004
+#define UCF_POSIX_PATHNAMES            0x00000008
 
 /*
  * smb_filename