A few things in this commit:
[kai/samba.git] / source3 / include / smb.h
index 6f05868a3f9ed41fdbce90a98efe586851d53ecb..ca146ff50a0dda3aabad4faa4283311e3c835833 100644 (file)
 #ifndef _SMB_H
 #define _SMB_H
 
+#if defined(LARGE_SMB_OFF_T)
+#define BUFFER_SIZE (128*1024)
+#else /* no large readwrite possible */
 #define BUFFER_SIZE (0xFFFF)
+#endif
+
 #define SAFETY_MARGIN 1024
 #define LARGE_WRITEX_HDR_SIZE 65
 
@@ -74,12 +79,12 @@ typedef int BOOL;
 #define DIR_STRUCT_SIZE 43
 
 /* these define the attribute byte as seen by DOS */
-#define aRONLY (1L<<0)
-#define aHIDDEN (1L<<1)
-#define aSYSTEM (1L<<2)
-#define aVOLID (1L<<3)
-#define aDIR (1L<<4)
-#define aARCH (1L<<5)
+#define aRONLY (1L<<0)         /* 0x01 */
+#define aHIDDEN (1L<<1)                /* 0x02 */
+#define aSYSTEM (1L<<2)                /* 0x04 */
+#define aVOLID (1L<<3)         /* 0x08 */
+#define aDIR (1L<<4)           /* 0x10 */
+#define aARCH (1L<<5)          /* 0x20 */
 
 /* deny modes */
 #define DENY_DOS 0
@@ -118,11 +123,6 @@ typedef int BOOL;
 #define GET_DELETE_ON_CLOSE_FLAG(x) (((x) & DELETE_ON_CLOSE_FLAG) ? True : False)
 #define SET_DELETE_ON_CLOSE_FLAG(x) ((x) ? DELETE_ON_CLOSE_FLAG : 0)
 
-/* was delete access requested in NT open ? */
-#define DELETE_ACCESS_REQUESTED (1<<17)
-#define GET_DELETE_ACCESS_REQUESTED(x) (((x) & DELETE_ACCESS_REQUESTED) ? True : False)
-#define SET_DELETE_ACCESS_REQUESTED(x) ((x) ? DELETE_ACCESS_REQUESTED : 0)
-
 /* open disposition values */
 #define FILE_EXISTS_FAIL 0
 #define FILE_EXISTS_OPEN 1
@@ -149,8 +149,6 @@ typedef int BOOL;
 
 #include "doserr.h"
 
-#include "pstring.h"
-
 /*
  * SMB UCS2 (16-bit unicode) internal type.
  */
@@ -250,7 +248,6 @@ typedef uint32 WERROR;
 #define MAXSUBAUTHS 15 /* max sub authorities in a SID */
 #endif
 
-#ifndef _DOM_SID
 /**
  * @brief Security Identifier
  *
@@ -270,8 +267,6 @@ typedef struct sid_info
   uint32 sub_auths[MAXSUBAUTHS];  
 
 } DOM_SID;
-#define _DOM_SID
-#endif
 
 /*
  * The complete list of SIDS belonging to this user.
@@ -286,13 +281,10 @@ typedef struct sid_info
 #define PRIMARY_USER_SID_INDEX 0
 #define PRIMARY_GROUP_SID_INDEX 1
 
-#ifndef _NT_USER_TOKEN
 typedef struct _nt_user_token {
        size_t num_sids;
        DOM_SID *user_sids;
 } NT_USER_TOKEN;
-#define _NT_USER_TOKEN
-#endif
 
 /*** query a local group, get a list of these: shows who is in that group ***/
 
@@ -389,6 +381,7 @@ typedef struct files_struct
        write_cache *wcp;
        struct timeval open_time;
        int share_mode;
+       uint32 desired_access;
        time_t pending_modtime;
        int oplock_type;
        int sent_oplock_break;
@@ -400,7 +393,6 @@ typedef struct files_struct
        BOOL modified;
        BOOL is_directory;
        BOOL directory_delete_on_close;
-       BOOL stat_open;
        char *fsp_name;
 } files_struct;
 
@@ -435,6 +427,7 @@ typedef struct
 
 /* Include VFS stuff */
 
+#include "smb_acls.h"
 #include "vfs.h"
 
 typedef struct connection_struct
@@ -456,6 +449,7 @@ typedef struct connection_struct
        struct vfs_ops vfs_ops;                   /* Filesystem operations */
        /* Handle on dlopen() call */
        void *dl_handle;
+       void *vfs_private;
 
        char *user; /* name of user who *opened* this connection */
        uid_t uid; /* uid of user who *opened* this connection */
@@ -512,11 +506,12 @@ typedef struct _print_queue_struct
 {
   int job;
   int size;
+  int page_count;
   int status;
   int priority;
   time_t time;
-  fstring user;
-  fstring file;
+  fstring fs_user;
+  fstring fs_file;
 } print_queue_struct;
 
 enum {LPSTAT_OK, LPSTAT_STOPPED, LPSTAT_ERROR};
@@ -554,6 +549,7 @@ typedef struct {
        uint16 op_port;
        uint16 op_type;
        int share_mode;
+       uint32 desired_access;
        struct timeval time;
        SMB_DEV_T dev;
        SMB_INO_T inode;
@@ -578,8 +574,14 @@ typedef struct {
 #define FLAG_SAM_GID           0x00000002
 #define FLAG_SAM_SMBHOME       0x00000004
 #define FLAG_SAM_PROFILE       0x00000008
-#define FLAG_SAM_LOGONSCRIPT   0x00000010
-#define FLAG_SAM_DRIVE         0x00000020
+#define FLAG_SAM_DRIVE          0x00000010
+#define FLAG_SAM_LOGONSCRIPT   0x00000020
+#define FLAG_SAM_LOGONTIME     0x00000040
+#define FLAG_SAM_LOGOFFTIME    0x00000080
+#define FLAG_SAM_KICKOFFTIME   0x00000100
+#define FLAG_SAM_CANCHANGETIME 0x00000200
+#define FLAG_SAM_MUSTCHANGETIME        0x00000400
+#define FLAG_SAM_PLAINTEXT_PW   0x00000800
 
 #define IS_SAM_UNIX_USER(x) \
        ((pdb_get_init_flag(x) & FLAG_SAM_UID) \
@@ -593,6 +595,8 @@ typedef struct sam_passwd
        
        void (*free_fn)(struct sam_passwd **);
 
+       struct pdb_methods *methods;
+
        struct user_data {
                /* initiailization flags */
                uint32 init_flag;
@@ -608,6 +612,7 @@ typedef struct sam_passwd
                char * domain;       /* Windows Domain name */
                char * nt_username;  /* Windows username string */
                char * full_name;    /* user's full name string */
+               char * unix_home_dir;     /* UNIX home directory string */
                char * home_dir;     /* home directory string */
                char * dir_drive;    /* home directory drive string */
                char * logon_script; /* logon script string */
@@ -624,6 +629,7 @@ typedef struct sam_passwd
                
                DATA_BLOB lm_pw; /* .data is Null if no password */
                DATA_BLOB nt_pw; /* .data is Null if no password */
+               DATA_BLOB plaintext_pw; /* .data is Null if not available */
                
                uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */
                uint32 unknown_3; /* 0x00ff ffff */
@@ -635,6 +641,7 @@ typedef struct sam_passwd
                uint32 unknown_5; /* 0x0002 0000 */
                uint32 unknown_6; /* 0x0000 04ec */
        } private;
+
        /* Lets see if the remaining code can get the hint that you
           are meant to use the pdb_...() functions. */
        
@@ -1054,11 +1061,11 @@ struct bitmap {
 #define SYNCHRONIZE_ACCESS   (1L<<20) /* 0x00100000 */
 
 /* Combinations of standard masks. */
-#define STANDARD_RIGHTS_ALL_ACCESS (DELETE_ACCESS|READ_CONTROL_ACCESS|WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS|SYNCHRONIZE_ACCESS)
-#define STANDARD_RIGHTS_EXECUTE_ACCESS (READ_CONTROL_ACCESS)
-#define STANDARD_RIGHTS_READ_ACCESS (READ_CONTROL_ACCESS)
-#define STANDARD_RIGHTS_REQUIRED_ACCESS (DELETE_ACCESS|READ_CONTROL_ACCESS|WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS)
-#define STANDARD_RIGHTS_WRITE_ACCESS (READ_CONTROL_ACCESS)
+#define STANDARD_RIGHTS_ALL_ACCESS (DELETE_ACCESS|READ_CONTROL_ACCESS|WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS|SYNCHRONIZE_ACCESS) /* 0x001f0000 */
+#define STANDARD_RIGHTS_EXECUTE_ACCESS (READ_CONTROL_ACCESS) /* 0x00020000 */
+#define STANDARD_RIGHTS_READ_ACCESS (READ_CONTROL_ACCESS) /* 0x00200000 */
+#define STANDARD_RIGHTS_REQUIRED_ACCESS (DELETE_ACCESS|READ_CONTROL_ACCESS|WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS) /* 0x000f0000 */
+#define STANDARD_RIGHTS_WRITE_ACCESS (READ_CONTROL_ACCESS) /* 0x00020000 */
 
 #define SYSTEM_SECURITY_ACCESS (1L<<24)                  /* 0x01000000 */
 #define MAXIMUM_ALLOWED_ACCESS (1L<<25)                  /* 0x02000000 */
@@ -1277,6 +1284,7 @@ char *strdup(char *s);
    
 #define FLAGS2_LONG_PATH_COMPONENTS   0x0001
 #define FLAGS2_EXTENDED_ATTRIBUTES    0x0002
+#define FLAGS2_IS_LONG_NAME           0x0040
 #define FLAGS2_EXTENDED_SECURITY      0x0800 
 #define FLAGS2_DFS_PATHNAMES          0x1000
 #define FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000
@@ -1341,11 +1349,6 @@ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_WIN2
 /* case handling */
 enum case_handling {CASE_LOWER,CASE_UPPER};
 
-#ifdef WITH_SSL
-/* SSL version options */
-enum ssl_version_enum {SMB_SSL_V2,SMB_SSL_V3,SMB_SSL_V23,SMB_SSL_TLS1};
-#endif /* WITH_SSL */
-
 /*
  * Global value meaing that the smb_uid field should be
  * ingored (in share level security and protocol level == CORE)
@@ -1384,7 +1387,7 @@ extern int global_is_multibyte_codepage;
 #define COPYBUF_SIZE (8*1024)
 
 /* 
- * Integers used to override error codes. 
+ * Values used to override error codes. 
  */
 extern int unix_ERR_class;
 extern int unix_ERR_code;
@@ -1578,6 +1581,8 @@ typedef struct user_struct
 
        userdom_struct user;
        char *homedir;
+       char *unix_homedir;
+       char *logon_script;
        
        BOOL guest;
 
@@ -1641,7 +1646,6 @@ struct unix_error_map {
 #define SAFE_NETBIOS_CHARS ". -_"
 
 #include "nsswitch/winbindd_nss.h"
-#include "smb_acls.h"
 
 /* generic iconv conversion structure */
 typedef struct {