diff options
Diffstat (limited to 'source/include/smb.h')
-rw-r--r-- | source/include/smb.h | 502 |
1 files changed, 266 insertions, 236 deletions
diff --git a/source/include/smb.h b/source/include/smb.h index c39ebed950f..bb780729325 100644 --- a/source/include/smb.h +++ b/source/include/smb.h @@ -1,13 +1,11 @@ /* - Unix SMB/CIFS implementation. - SMB parameters and setup, plus a whole lot more. - + Unix SMB/Netbios implementation. + Version 1.9. + SMB parameters and setup Copyright (C) Andrew Tridgell 1992-2000 - Copyright (C) John H Terpstra 1996-2002 + Copyright (C) John H Terpstra 1996-2000 Copyright (C) Luke Kenneth Casson Leighton 1996-2000 Copyright (C) Paul Ashton 1998-2000 - Copyright (C) Simo Sorce 2001-2002 - Copyright (C) Martin Pool 2002 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,9 +36,7 @@ #define NMB_PORT 137 #define DGRAM_PORT 138 -#define SMB_PORT1 445 -#define SMB_PORT2 139 -#define SMB_PORTS "445 139" +#define SMB_PORT 139 #define False (0) #define True (1) @@ -62,10 +58,11 @@ typedef int BOOL; /* string manipulation flags - see clistr.c and srvstr.c */ #define STR_TERMINATE 1 -#define STR_UPPER 2 -#define STR_ASCII 4 -#define STR_UNICODE 8 -#define STR_NOALIGN 16 +#define STR_CONVERT 2 +#define STR_UPPER 4 +#define STR_ASCII 8 +#define STR_UNICODE 16 +#define STR_NOALIGN 32 /* how long to wait for secondary SMB packets (milli-seconds) */ #define SMB_SECONDARY_WAIT (60*1000) @@ -78,15 +75,22 @@ typedef int BOOL; #define READ_EOF 2 #define READ_ERROR 3 + #define DIR_STRUCT_SIZE 43 +/* these define all the command types recognised by the server - there +are lots of gaps so probably there are some rare commands that are not +implemented */ + +#define pSETDIR '\377' + /* these define the attribute byte as seen by DOS */ -#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 */ +#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 @@ -151,6 +155,18 @@ typedef int BOOL; #include "doserr.h" +#ifndef _PSTRING + +#define PSTRING_LEN 1024 +#define FSTRING_LEN 256 + +typedef char pstring[PSTRING_LEN]; +typedef char fstring[FSTRING_LEN]; + +#define _PSTRING + +#endif + /* * SMB UCS2 (16-bit unicode) internal type. */ @@ -161,16 +177,6 @@ typedef uint16 smb_ucs2_t; typedef smb_ucs2_t wpstring[PSTRING_LEN]; typedef smb_ucs2_t wfstring[FSTRING_LEN]; - -#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) - /* pipe string names */ #define PIPE_LANMAN "\\PIPE\\LANMAN" #define PIPE_SRVSVC "\\PIPE\\srvsvc" @@ -190,8 +196,47 @@ typedef struct nttime_info { uint32 low; uint32 high; + } NTTIME; +#ifndef TIME_T_MIN +#define TIME_T_MIN ((time_t)0 < (time_t) -1 ? (time_t) 0 \ + : ~ (time_t) 0 << (sizeof (time_t) * CHAR_BIT - 1)) +#endif +#ifndef TIME_T_MAX +#define TIME_T_MAX (~ (time_t) 0 - TIME_T_MIN) +#endif + + +/* the following rather strange looking definitions of NTSTATUS and WERROR + and there in order to catch common coding errors where different error types + are mixed up. This is especially important as we slowly convert Samba + from using BOOL for internal functions +*/ +#if defined(HAVE_IMMEDIATE_STRUCTURES) +typedef struct {uint32 v;} NTSTATUS; +#define NT_STATUS(x) ((NTSTATUS) { x }) +#define NT_STATUS_V(x) ((x).v) +#else +typedef uint32 NTSTATUS; +#define NT_STATUS(x) (x) +#define NT_STATUS_V(x) (x) +#endif + +#if defined(HAVE_IMMEDIATE_STRUCTURES) +typedef struct {uint32 v;} WERROR; +#define W_ERROR(x) ((WERROR) { x }) +#define W_ERROR_V(x) ((x).v) +#else +typedef uint32 WERROR; +#define W_ERROR(x) (x) +#define W_ERROR_V(x) (x) +#endif + +#define NT_STATUS_IS_OK(x) (NT_STATUS_V(x) == 0) +#define NT_STATUS_IS_ERR(x) ((NT_STATUS_V(x) & 0xc0000000) == 0xc0000000) +#define NT_STATUS_EQUAL(x,y) (NT_STATUS_V(x) == NT_STATUS_V(y)) +#define W_ERROR_IS_OK(x) (W_ERROR_V(x) == 0) /* Allowable account control bits */ #define ACB_DISABLED 0x0001 /* 1 = User account disabled */ @@ -208,43 +253,52 @@ typedef struct nttime_info #define MAX_HOURS_LEN 32 -#ifndef MAXSUBAUTHS -#define MAXSUBAUTHS 15 /* max sub authorities in a SID */ -#endif -/* SID Types */ -enum SID_NAME_USE +struct sam_disp_info { - SID_NAME_USE_NONE = 0,/* NOTUSED */ - SID_NAME_USER = 1, /* user */ - SID_NAME_DOM_GRP = 2, /* domain group */ - SID_NAME_DOMAIN = 3, /* domain: don't know what this is */ - SID_NAME_ALIAS = 4, /* local group */ - SID_NAME_WKN_GRP = 5, /* well-known group */ - SID_NAME_DELETED = 6, /* deleted account: needed for c2 rating */ - SID_NAME_INVALID = 7, /* invalid account */ - SID_NAME_UNKNOWN = 8 /* oops. */ + uint32 user_rid; /* Primary User ID */ + char *smb_name; /* username string */ + char *full_name; /* user's full name string */ }; -/** - * @brief Security Identifier - * - * @sa http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/accctrl_38yn.asp - **/ +typedef struct +{ + uint32 pid; + uint16 vuid; + +} +vuser_key; + + +struct use_info +{ + BOOL connected; + char *srv_name; + vuser_key key; + char *user_name; + char *domain; +}; + +#ifndef MAXSUBAUTHS +#define MAXSUBAUTHS 15 /* max sub authorities in a SID */ +#endif + +#ifndef _DOM_SID +/* DOM_SID - security id */ typedef struct sid_info { - uint8 sid_rev_num; /**< SID revision number */ - uint8 num_auths; /**< Number of sub-authorities */ - uint8 id_auth[6]; /**< Identifier Authority */ + uint8 sid_rev_num; /* SID revision number */ + uint8 num_auths; /* number of sub-authorities */ + uint8 id_auth[6]; /* Identifier Authority */ /* - * Pointer to sub-authorities. - * - * @note The values in these uint32's are in *native* byteorder, not - * neccessarily little-endian...... JRA. + * Note that the values in these uint32's are in *native* byteorder, + * not neccessarily little-endian...... JRA. */ - uint32 sub_auths[MAXSUBAUTHS]; + uint32 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */ } DOM_SID; +#define _DOM_SID +#endif /* * The complete list of SIDS belonging to this user. @@ -253,16 +307,19 @@ typedef struct sid_info * * token->user_sids[0] = primary user SID. * token->user_sids[1] = primary group SID. - * token->user_sids[2..num_sids] = supplementary group SIDS. + * token->user_sids[2-num_sids] = supplementary group SIDS. */ #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 ***/ @@ -333,21 +390,13 @@ typedef struct write_cache char *data; } write_cache; -typedef struct -{ - smb_ucs2_t *origname; - smb_ucs2_t *filename; - SMB_STRUCT_STAT *statinfo; -} smb_filename; - - typedef struct files_struct { struct files_struct *next, *prev; int fnum; struct connection_struct *conn; int fd; - uint32 print_jobid; + int print_jobid; SMB_DEV_T dev; SMB_INO_T inode; BOOL delete_on_close; @@ -393,9 +442,9 @@ typedef struct time_t status_time; } dir_status_struct; -struct vuid_cache { - unsigned int entries; - uint16 list[VUID_CACHE_SIZE]; +struct uid_cache { + int entries; + uid_t list[UID_CACHE_SIZE]; }; typedef struct @@ -409,23 +458,13 @@ typedef struct #include "smb_acls.h" #include "vfs.h" -typedef struct smb_vfs_handle_struct -{ - void *data; - /* Handle on dlopen() call */ - void *handle; - struct smb_vfs_handle_struct *next, *prev; - -} smb_vfs_handle_struct; - typedef struct connection_struct { struct connection_struct *next, *prev; unsigned cnum; /* an index passed over the wire */ int service; BOOL force_user; - BOOL force_group; - struct vuid_cache vuid_cache; + struct uid_cache uid_cache; void *dirptr; BOOL printer; BOOL ipc; @@ -436,7 +475,9 @@ typedef struct connection_struct char *origpath; struct vfs_ops vfs_ops; /* Filesystem operations */ - struct smb_vfs_handle_struct *vfs_private; + /* 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 */ @@ -550,9 +591,6 @@ typedef struct { #define SHAREMODE_FN(fn) \ void (*fn)(share_mode_entry *, char*) -#define NT_HASH_LEN 16 -#define LM_HASH_LEN 16 - /* * bit flags representing initialized fields in SAM_ACCOUNT */ @@ -561,107 +599,74 @@ typedef struct { #define FLAG_SAM_GID 0x00000002 #define FLAG_SAM_SMBHOME 0x00000004 #define FLAG_SAM_PROFILE 0x00000008 -#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 FLAG_SAM_LOGONSCRIPT 0x00000010 +#define FLAG_SAM_DRIVE 0x00000020 #define IS_SAM_UNIX_USER(x) \ - ((pdb_get_init_flag(x) & FLAG_SAM_UID) \ - && (pdb_get_init_flag(x) & FLAG_SAM_GID)) + (((x)->init_flag & SAM_ACCT_UNIX_UID) \ + && ((x)->init_flag & SAM_ACCT_UNIX_GID)) + +#define IS_SAM_SET(x, flag) ((x)->init_flag & (flag)) -#define IS_SAM_SET(x, flag) ((x)->private.init_flag & (flag)) typedef struct sam_passwd { - TALLOC_CTX *mem_ctx; - - void (*free_fn)(struct sam_passwd **); - - struct pdb_methods *methods; - - struct user_data { - /* initiailization flags */ - uint32 init_flag; - - time_t logon_time; /* logon time */ - time_t logoff_time; /* logoff time */ - time_t kickoff_time; /* kickoff time */ - time_t pass_last_set_time; /* password last set time */ - time_t pass_can_change_time; /* password can change time */ - time_t pass_must_change_time; /* password must change time */ - - char * username; /* UNIX username string */ - 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 */ - char * profile_path; /* profile path string */ - char * acct_desc ; /* user description string */ - char * workstations; /* login from workstations string */ - char * unknown_str ; /* don't know what this is, yet. */ - char * munged_dial ; /* munged path name and dial-back tel number */ - - uid_t uid; /* this is a unix uid_t */ - gid_t gid; /* this is a unix gid_t */ - DOM_SID user_sid; /* Primary User SID */ - DOM_SID group_sid; /* Primary Group SID */ - - DATA_BLOB lm_pw; /* .data is Null if no password */ - DATA_BLOB nt_pw; /* .data is Null if no password */ - char* plaintext_pw; /* is Null if not available */ - - uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ - uint32 unknown_3; /* 0x00ff ffff */ - - uint16 logon_divs; /* 168 - number of hours in a week */ - uint32 hours_len; /* normally 21 bytes */ - uint8 hours[MAX_HOURS_LEN]; - - 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. */ + /* initiailization flags */ + uint32 init_flag; + + time_t logon_time; /* logon time */ + time_t logoff_time; /* logoff time */ + time_t kickoff_time; /* kickoff time */ + time_t pass_last_set_time; /* password last set time */ + time_t pass_can_change_time; /* password can change time */ + time_t pass_must_change_time; /* password must change time */ + + pstring username; /* UNIX username string */ + pstring domain; /* Windows Domain name */ + pstring nt_username; /* Windows username string */ + pstring full_name; /* user's full name string */ + pstring home_dir; /* home directory string */ + pstring dir_drive; /* home directory drive string */ + pstring logon_script; /* logon script string */ + pstring profile_path; /* profile path string */ + pstring acct_desc ; /* user description string */ + pstring workstations; /* login from workstations string */ + pstring unknown_str ; /* don't know what this is, yet. */ + pstring munged_dial ; /* munged path name and dial-back tel number */ + + uid_t uid; /* this is actually the unix uid_t */ + gid_t gid; /* this is actually the unix gid_t */ + uint32 user_rid; /* Primary User ID */ + uint32 group_rid; /* Primary Group ID */ + + unsigned char *lm_pw; /* Null if no password */ + unsigned char *nt_pw; /* Null if no password */ + + uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ + uint32 unknown_3; /* 0x00ff ffff */ + + uint16 logon_divs; /* 168 - number of hours in a week */ + uint32 hours_len; /* normally 21 bytes */ + uint8 hours[MAX_HOURS_LEN]; + + uint32 unknown_5; /* 0x0002 0000 */ + uint32 unknown_6; /* 0x0000 04ec */ } SAM_ACCOUNT; -/* - * Flags for account policy. - */ -#define AP_MIN_PASSWORD_LEN 1 -#define AP_PASSWORD_HISTORY 2 -#define AP_USER_MUST_LOGON_TO_CHG_PASS 3 -#define AP_MAX_PASSWORD_AGE 4 -#define AP_MIN_PASSWORD_AGE 5 -#define AP_LOCK_ACCOUNT_DURATION 6 -#define AP_RESET_COUNT_TIME 7 -#define AP_BAD_ATTEMPT_LOCKOUT 8 -#define AP_TIME_TO_LOGOUT 9 - /* * Flags for local user manipulation. */ -#define LOCAL_ADD_USER 0x1 -#define LOCAL_DELETE_USER 0x2 -#define LOCAL_DISABLE_USER 0x4 -#define LOCAL_ENABLE_USER 0x8 -#define LOCAL_TRUST_ACCOUNT 0x10 -#define LOCAL_SET_NO_PASSWORD 0x20 -#define LOCAL_SET_PASSWORD 0x40 -#define LOCAL_SET_LDAP_ADMIN_PW 0x80 -#define LOCAL_INTERDOM_ACCOUNT 0x100 -#define LOCAL_AM_ROOT 0x200 /* Act as root */ +#define LOCAL_ADD_USER 0x01 +#define LOCAL_DELETE_USER 0x02 +#define LOCAL_DISABLE_USER 0x04 +#define LOCAL_ENABLE_USER 0x08 +#define LOCAL_TRUST_ACCOUNT 0x10 +#define LOCAL_SET_NO_PASSWORD 0x20 +#define LOCAL_SET_LDAP_ADMIN_PW 0x40 +#define LOCAL_GET_DOM_SID 0x80 /* key and data in the connections database - used in smbstatus and smbd */ struct connections_key { @@ -680,7 +685,6 @@ struct connections_data { char addr[24]; char machine[FSTRING_LEN]; time_t start; - uint32 bcast_msg_flags; }; @@ -705,7 +709,7 @@ struct locking_data { /* the following are used by loadparm for option lists */ typedef enum { - P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL,P_LIST, + P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL, P_STRING,P_USTRING,P_GSTRING,P_UGSTRING,P_ENUM,P_SEP } parm_type; @@ -744,7 +748,6 @@ struct parm_struct int ivalue; char *svalue; char cvalue; - char **lvalue; } def; }; @@ -759,7 +762,6 @@ struct bitmap { #define FLAG_GLOBAL 0x0008 /* local options that should be globally settable in SWAT */ #define FLAG_WIZARD 0x0010 /* Parameters that the wizard will operate on */ #define FLAG_ADVANCED 0x0020 /* Parameters that the wizard will operate on */ -#define FLAG_DEVELOPER 0x0040 /* Parameters that the wizard will operate on */ #define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */ #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. */ @@ -779,8 +781,7 @@ struct bitmap { #define smb_err 11 #define smb_flg 13 #define smb_flg2 14 -#define smb_pidhigh 16 -#define smb_ss_field 18 +#define smb_reb 13 #define smb_tid 28 #define smb_pid 30 #define smb_uid 32 @@ -888,7 +889,6 @@ struct bitmap { #define SMBffirst 0x82 /* find first */ #define SMBfunique 0x83 /* find unique */ #define SMBfclose 0x84 /* find close */ -#define SMBkeepalive 0x85 /* keepalive */ #define SMBinvalid 0xFE /* invalid command */ /* Extended 2.0 protocol */ @@ -1209,6 +1209,26 @@ struct bitmap { #define SMB_SUCCESS 0 /* The request was successful. */ +#ifdef HAVE_STDARG_H +int slprintf(char *str, int n, char *format, ...) +#ifdef __GNUC__ + __attribute__ ((format (__printf__, 3, 4))) +#endif +; +#else +int slprintf(); +#endif + +#ifdef HAVE_STDARG_H +int fdprintf(int fd, char *format, ...) +#ifdef __GNUC__ + __attribute__ ((format (__printf__, 2, 3))) +#endif +; +#else +int fdprintf(); +#endif + #ifdef WITH_DFS void dfs_unlogin(void); extern int dcelogin_atmost_once; @@ -1260,7 +1280,7 @@ char *strdup(char *s); * History: * Version 4.0 - never made public * Version 4.10 - New to 1.9.16p2, lost in space 1.9.16p3 to 1.9.16p9 - * - Reappeared in 1.9.16p11 with fixed smbd services + * - Reappeared in 1.9.16p11 with fixed smbd services * Version 4.20 - To indicate that nmbd and browsing now works better * Version 4.50 - Set at release of samba-2.2.0 by JHT * @@ -1268,7 +1288,7 @@ char *strdup(char *s); * Setting this above 4.9 can have undesired side-effects. * This may change again in Samba-3.0 after further testing. JHT */ - + #define DEFAULT_MAJOR_VERSION 0x04 #define DEFAULT_MINOR_VERSION 0x09 @@ -1277,24 +1297,22 @@ char *strdup(char *s); #define BROWSER_CONSTANT 0xaa55 /* Sercurity mode bits. */ -#define NEGOTIATE_SECURITY_USER_LEVEL 0x01 -#define NEGOTIATE_SECURITY_CHALLENGE_RESPONSE 0x02 -#define NEGOTIATE_SECURITY_SIGNATURES_ENABLED 0x04 -#define NEGOTIATE_SECURITY_SIGNATURES_REQUIRED 0x08 +#define NEGOTIATE_SECURITY_USER_LEVEL 0x01 +#define NEGOTIATE_SECURITY_CHALLENGE_RESPONSE 0x02 +#define NEGOTIATE_SECURITY_SIGNATURES_ENABLED 0x04 +#define NEGOTIATE_SECURITY_SIGNATURES_REQUIRED 0x08 /* NT Flags2 bits - cifs6.txt section 3.1.2 */ -#define FLAGS2_LONG_PATH_COMPONENTS 0x0001 -#define FLAGS2_EXTENDED_ATTRIBUTES 0x0002 -#define FLAGS2_SMB_SECURITY_SIGNATURES 0x0004 -#define FLAGS2_IS_LONG_NAME 0x0040 -#define FLAGS2_EXTENDED_SECURITY 0x0800 -#define FLAGS2_DFS_PATHNAMES 0x1000 -#define FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000 -#define FLAGS2_32_BIT_ERROR_CODES 0x4000 -#define FLAGS2_UNICODE_STRINGS 0x8000 - -#define FLAGS2_WIN2K_SIGNATURE 0xC852 /* Hack alert ! For now... JRA. */ +#define FLAGS2_LONG_PATH_COMPONENTS 0x0001 +#define FLAGS2_EXTENDED_ATTRIBUTES 0x0002 +#define FLAGS2_IS_LONG_NAME 0x0040 +#define FLAGS2_DFS_PATHNAMES 0x1000 +#define FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000 +#define FLAGS2_32_BIT_ERROR_CODES 0x4000 +#define FLAGS2_UNICODE_STRINGS 0x8000 + +#define FLAGS2_WIN2K_SIGNATURE 0xC852 /* Hack alert ! For now... JRA. */ /* Capabilities. see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */ @@ -1320,7 +1338,7 @@ char *strdup(char *s); enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANMAN1,PROTOCOL_LANMAN2,PROTOCOL_NT1}; /* security levels */ -enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER,SEC_DOMAIN,SEC_ADS}; +enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER,SEC_DOMAIN}; /* server roles */ enum server_types @@ -1346,15 +1364,17 @@ enum schema_types {SCHEMA_COMPAT, SCHEMA_AD, SCHEMA_SAMBA}; /* LDAP SSL options */ enum ldap_ssl_types {LDAP_SSL_ON, 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}; - /* Remote architectures we know about. */ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_WIN2K, RA_SAMBA}; /* 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) @@ -1363,6 +1383,30 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; #define UID_FIELD_INVALID 0 #define VUID_OFFSET 100 /* Amount to bias returned vuid numbers */ +/* Defines needed for multi-codepage support. */ +#define MSDOS_LATIN_1_CODEPAGE 850 +#define KANJI_CODEPAGE 932 +#define HANGUL_CODEPAGE 949 +#define BIG5_CODEPAGE 950 +#define SIMPLIFIED_CHINESE_CODEPAGE 936 + +#ifdef KANJI +/* + * Default client code page - Japanese + */ +#define DEFAULT_CLIENT_CODE_PAGE KANJI_CODEPAGE +#else /* KANJI */ +/* + * Default client code page - 850 - Western European + */ +#define DEFAULT_CLIENT_CODE_PAGE MSDOS_LATIN_1_CODEPAGE +#endif /* KANJI */ + +/* Global val set if multibyte codepage. */ +extern int global_is_multibyte_codepage; + +#define get_character_len(x) (global_is_multibyte_codepage ? skip_multibyte_char((x)) : 0) + /* * Size of buffer to use when moving files across filesystems. */ @@ -1527,6 +1571,12 @@ struct node_status { unsigned char flags; }; + + +#define AGENT_CMD_CON 0 +#define AGENT_CMD_CON_ANON 2 +#define AGENT_CMD_CON_REUSE 1 + struct pwd_info { BOOL null_pwd; @@ -1540,15 +1590,27 @@ struct pwd_info uchar smb_lm_owf[24]; uchar smb_nt_owf[128]; - size_t nt_owf_len; + uint32 nt_owf_len; uchar lm_cli_chal[8]; uchar nt_cli_chal[128]; - size_t nt_cli_chal_len; + uint32 nt_cli_chal_len; uchar sess_key[16]; }; +/* + * Network Computing Architechture Context Name Named Pipe + * See MSDN docs for more information + */ +struct ncacn_np +{ + fstring pipe_name; + struct cli_state *smb; + uint16 fnum; + BOOL initialised; +}; + #include "rpc_creds.h" #include "rpc_misc.h" #include "rpc_secdes.h" @@ -1562,10 +1624,6 @@ typedef struct user_struct gid_t gid; /* gid of a validated user */ userdom_struct user; - char *homedir; - char *unix_homedir; - char *logon_script; - BOOL guest; /* following groups stuff added by ih */ @@ -1575,15 +1633,9 @@ typedef struct user_struct NT_USER_TOKEN *nt_user_token; - uint8 session_key[16]; - - char *session_keystr; /* used by utmp and pam session code. - TDB key string */ - int homes_snum; - + int session_id; /* used by utmp and pam session code */ } user_struct; - struct unix_error_map { int unix_error; int dos_class; @@ -1596,9 +1648,7 @@ struct unix_error_map { #include "client.h" /* - * Size of new password account encoding string. This is enough space to - * hold 11 ACB characters, plus the surrounding [] and a terminating null. - * Do not change unless you are adding new ACB bits! + * Size of new password account encoding string. DO NOT CHANGE. */ #define NEW_PW_FORMAT_SPACE_PADDED_LEN 14 @@ -1630,26 +1680,6 @@ struct unix_error_map { #define SAFE_NETBIOS_CHARS ". -_" -/* generic iconv conversion structure */ -typedef struct { - size_t (*direct)(void *cd, char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft); - size_t (*pull)(void *cd, char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft); - size_t (*push)(void *cd, char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft); - void *cd_direct, *cd_pull, *cd_push; - char *from_name, *to_name; -} *smb_iconv_t; - -/* The maximum length of a trust account password. - Used when we randomly create it, 15 char passwords - exceed NT4's max password length */ - -#define DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH 14 - -/* Common popt structures */ - -extern struct poptOption popt_common_debug[]; +#include "nsswitch/winbindd_nss.h" #endif /* _SMB_H */ |