s3-auth Change type of num_sids to uint32_t
[samba.git] / source3 / include / smb.h
index e2721700e52047bb86849077fdcd25567963ac5a..f8b233ea6bc20e7c78326924e001b9a932020467 100644 (file)
@@ -137,34 +137,11 @@ enum smb_read_errors {
 #define OPENX_FILE_CREATE_IF_NOT_EXIST 0x10
 #define OPENX_FILE_FAIL_IF_NOT_EXIST 0
 
-#include "../libcli/util/doserr.h"
-
 typedef union unid_t {
        uid_t uid;
        gid_t gid;
 } unid_t;
 
-/*
- * SMB UCS2 (16-bit unicode) internal type.
- * smb_ucs2_t is *always* in little endian format.
- */
-
-#ifdef WORDS_BIGENDIAN
-#define UCS2_SHIFT 8
-#else
-#define UCS2_SHIFT 0
-#endif
-
-/* turn a 7 bit character into a ucs2 character */
-#define UCS2_CHAR(c) ((c) << UCS2_SHIFT)
-
-/* return an ascii version of a ucs2 character */
-#define UCS2_TO_CHAR(c) (((c) >> UCS2_SHIFT) & 0xff)
-
-/* Copy into a smb_ucs2_t from a possibly unaligned buffer. Return the copied smb_ucs2_t */
-#define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\
-                               ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest))
-
 /* pipe string names */
 #define PIPE_LANMAN   "\\PIPE\\LANMAN"
 
@@ -197,44 +174,12 @@ typedef union unid_t {
                                        |LOOKUP_NAME_WKN\
                                        |LOOKUP_NAME_DOMAIN)
 
-/**
- * @brief Security Identifier
- *
- * @sa http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/accctrl_38yn.asp
- **/
-typedef struct dom_sid DOM_SID;
-
-enum id_mapping {
-       ID_UNKNOWN = 0,
-       ID_MAPPED,
-       ID_UNMAPPED,
-       ID_EXPIRED
-};
-
-enum id_type {
-       ID_TYPE_NOT_SPECIFIED = 0,
-       ID_TYPE_UID,
-       ID_TYPE_GID
-};
-
-struct unixid {
-       uint32_t id;
-       enum id_type type;
-};
-
-struct id_map {
-       DOM_SID *sid;
-       struct unixid xid;
-       enum id_mapping status;
-};
-
 #include "librpc/gen_ndr/epmapper.h"
-#include "librpc/gen_ndr/krb5pac.h"
 #include "librpc/gen_ndr/dcerpc.h"
 
 struct lsa_dom_info {
        bool valid;
-       DOM_SID sid;
+       struct dom_sid sid;
        const char *name;
        int num_idxs;
        int *idxs;
@@ -248,30 +193,30 @@ struct lsa_name_info {
 };
 
 /* Some well-known SIDs */
-extern const DOM_SID global_sid_World_Domain;
-extern const DOM_SID global_sid_World;
-extern const DOM_SID global_sid_Creator_Owner_Domain;
-extern const DOM_SID global_sid_NT_Authority;
-extern const DOM_SID global_sid_System;
-extern const DOM_SID global_sid_NULL;
-extern const DOM_SID global_sid_Authenticated_Users;
-extern const DOM_SID global_sid_Network;
-extern const DOM_SID global_sid_Creator_Owner;
-extern const DOM_SID global_sid_Creator_Group;
-extern const DOM_SID global_sid_Anonymous;
-extern const DOM_SID global_sid_Builtin;
-extern const DOM_SID global_sid_Builtin_Administrators;
-extern const DOM_SID global_sid_Builtin_Users;
-extern const DOM_SID global_sid_Builtin_Guests;
-extern const DOM_SID global_sid_Builtin_Power_Users;
-extern const DOM_SID global_sid_Builtin_Account_Operators;
-extern const DOM_SID global_sid_Builtin_Server_Operators;
-extern const DOM_SID global_sid_Builtin_Print_Operators;
-extern const DOM_SID global_sid_Builtin_Backup_Operators;
-extern const DOM_SID global_sid_Builtin_Replicator;
-extern const DOM_SID global_sid_Builtin_PreWin2kAccess;
-extern const DOM_SID global_sid_Unix_Users;
-extern const DOM_SID global_sid_Unix_Groups;
+extern const struct dom_sid global_sid_World_Domain;
+extern const struct dom_sid global_sid_World;
+extern const struct dom_sid global_sid_Creator_Owner_Domain;
+extern const struct dom_sid global_sid_NT_Authority;
+extern const struct dom_sid global_sid_System;
+extern const struct dom_sid global_sid_NULL;
+extern const struct dom_sid global_sid_Authenticated_Users;
+extern const struct dom_sid global_sid_Network;
+extern const struct dom_sid global_sid_Creator_Owner;
+extern const struct dom_sid global_sid_Creator_Group;
+extern const struct dom_sid global_sid_Anonymous;
+extern const struct dom_sid global_sid_Builtin;
+extern const struct dom_sid global_sid_Builtin_Administrators;
+extern const struct dom_sid global_sid_Builtin_Users;
+extern const struct dom_sid global_sid_Builtin_Guests;
+extern const struct dom_sid global_sid_Builtin_Power_Users;
+extern const struct dom_sid global_sid_Builtin_Account_Operators;
+extern const struct dom_sid global_sid_Builtin_Server_Operators;
+extern const struct dom_sid global_sid_Builtin_Print_Operators;
+extern const struct dom_sid global_sid_Builtin_Backup_Operators;
+extern const struct dom_sid global_sid_Builtin_Replicator;
+extern const struct dom_sid global_sid_Builtin_PreWin2kAccess;
+extern const struct dom_sid global_sid_Unix_Users;
+extern const struct dom_sid global_sid_Unix_Groups;
 
 /*
  * The complete list of SIDS belonging to this user.
@@ -287,9 +232,9 @@ extern const DOM_SID global_sid_Unix_Groups;
 #define PRIMARY_GROUP_SID_INDEX 1
 
 typedef struct nt_user_token {
-       size_t num_sids;
-       DOM_SID *user_sids;
-       SE_PRIV privileges;
+       uint32_t num_sids;
+       struct dom_sid *sids;
+       uint64_t privilege_mask;
 } NT_USER_TOKEN;
 
 typedef struct unix_user_token {
@@ -299,11 +244,6 @@ typedef struct unix_user_token {
        gid_t *groups;
 } UNIX_USER_TOKEN;
 
-/* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */
-typedef struct time_info {
-       uint32 time;
-} UTIME;
-
 typedef struct write_cache {
        SMB_OFF_T file_size;
        SMB_OFF_T offset;
@@ -312,8 +252,6 @@ typedef struct write_cache {
        char *data;
 } write_cache;
 
-#include "fake_file.h"
-
 struct fd_handle {
        size_t ref_count;
        int fd;
@@ -388,6 +326,11 @@ struct notify_change_buf {
 };
 
 struct print_file_data {
+       char *svcname;
+       char *docname;
+       char *filename;
+       struct policy_handle handle;
+       uint32_t jobid;
        uint16 rap_jobid;
 };
 
@@ -459,6 +402,11 @@ typedef struct files_struct {
 #include "ntquotas.h"
 #include "sysquotas.h"
 
+struct client_address {
+       char addr[INET6_ADDRSTRLEN];
+       const char *name;
+};
+
 struct vuid_cache_entry {
        struct auth_serversupplied_info *server_info;
        uint16_t vuid;
@@ -569,8 +517,6 @@ typedef struct connection_struct {
         */
        gid_t force_group_gid;
 
-       char client_address[INET6_ADDRSTRLEN]; /* String version of client IP address. */
-
        uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */
 
        time_t lastused;
@@ -599,6 +545,9 @@ typedef struct connection_struct {
        struct dfree_cached_info *dfree_info;
        struct trans_state *pending_trans;
        struct notify_context *notify_ctx;
+
+       struct rpc_pipe_client *spoolss_pipe;
+
 } connection_struct;
 
 struct current_user {
@@ -638,6 +587,7 @@ struct smb_request {
        size_t unread_bytes;
        bool encrypted;
        connection_struct *conn;
+       struct smbd_server_connection *sconn;
        struct smb_perfcount_data pcd;
 
        /*
@@ -676,8 +626,23 @@ typedef struct {
 
 /* Extra fields above "LPQ_PRINTING" are used to map extra NT status codes. */
 
-enum {LPQ_QUEUED=0,LPQ_PAUSED,LPQ_SPOOLING,LPQ_PRINTING,LPQ_ERROR,LPQ_DELETING,
-      LPQ_OFFLINE,LPQ_PAPEROUT,LPQ_PRINTED,LPQ_DELETED,LPQ_BLOCKED,LPQ_USER_INTERVENTION};
+enum {
+       LPQ_QUEUED = 0,
+       LPQ_PAUSED,
+       LPQ_SPOOLING,
+       LPQ_PRINTING,
+       LPQ_ERROR,
+       LPQ_DELETING,
+       LPQ_OFFLINE,
+       LPQ_PAPEROUT,
+       LPQ_PRINTED,
+       LPQ_DELETED,
+       LPQ_BLOCKED,
+       LPQ_USER_INTERVENTION,
+
+       /* smbd is dooing the file spooling before passing control to spoolss */
+       PJOB_SMBD_SPOOLING
+};
 
 typedef struct _print_queue_struct {
        int job;                /* normally the UNIX jobid -- see note in 
@@ -887,7 +852,12 @@ struct connections_data {
        char addr[24];
        char machine[FSTRING_LEN];
        time_t start;
-       uint32 bcast_msg_flags;
+
+       /*
+        * This field used to hold the msg_flags. For compatibility reasons,
+        * keep the data structure in the tdb file the same.
+        */
+       uint32 unused_compatitibility_field;
 };
 
 
@@ -935,6 +905,7 @@ struct parm_struct {
 #define FLAG_HIDE      0x2000 /* options that should be hidden in SWAT */
 #define FLAG_DOS_STRING 0x4000 /* convert from UNIX to DOS codepage when reading this string. */
 #define FLAG_META      0x8000 /* A meta directive - not a real parameter */
+#define FLAG_CMDLINE   0x10000 /* option has been overridden */
 
 struct bitmap {
        uint32 *b;
@@ -1261,7 +1232,7 @@ struct bitmap {
                           SYNCHRONIZE_ACCESS)
 
 /* This maps to 0x120116 */
-#define FILE_GENERIC_WRITE (STD_RIGHT_READ_CONTROL_ACCESS|\
+#define FILE_GENERIC_WRITE (SEC_STD_READ_CONTROL|\
                            FILE_WRITE_DATA|\
                            FILE_WRITE_ATTRIBUTES|\
                            FILE_WRITE_EA|\
@@ -1597,6 +1568,18 @@ enum ldap_ssl_types {LDAP_SSL_OFF, LDAP_SSL_START_TLS};
 /* LDAP PASSWD SYNC methods */
 enum ldap_passwd_sync_types {LDAP_PASSWD_SYNC_ON, LDAP_PASSWD_SYNC_OFF, LDAP_PASSWD_SYNC_ONLY};
 
+/*
+ * This should be under the HAVE_KRB5 flag but since they're used
+ * in lp_kerberos_method(), they ned to be always available
+ * If you add any entries to KERBEROS_VERIFY defines, please modify USE.*KEYTAB macros
+ * so they remain accurate.
+ */
+
+#define KERBEROS_VERIFY_SECRETS 0
+#define KERBEROS_VERIFY_SYSTEM_KEYTAB 1
+#define KERBEROS_VERIFY_DEDICATED_KEYTAB 2
+#define KERBEROS_VERIFY_SECRETS_AND_KEYTAB 3
+
 /* 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_VISTA,
@@ -1869,8 +1852,6 @@ struct unix_error_map {
 
 #define DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH 14
 
-#include "popt_common.h"
-
 #define PORT_NONE      0
 #ifndef LDAP_PORT
 #define LDAP_PORT      389
@@ -1983,4 +1964,13 @@ struct child_pid {
 /* Used to keep track of deferred opens. */
 struct deferred_open_record;
 
+/* Client-side offline caching policy types */
+#define CSC_POLICY_MANUAL 0
+#define CSC_POLICY_DOCUMENTS 1
+#define CSC_POLICY_PROGRAMS 2
+#define CSC_POLICY_DISABLE 3
+
+/* Used inside aio code. */
+struct aio_extra;
+
 #endif /* _SMB_H */