added extra fields to struct smb_passwd
[kai/samba.git] / source / include / smb.h
index 88d9a9de0959ca385a261bb4dbcf3196064e98cc..11e7409a9a80565b4da3516b18d76d5a18c4dd18 100644 (file)
@@ -251,13 +251,6 @@ typedef fstring string;
 #define PIPE_LSASS    "\\PIPE\\lsass"
 #define PIPE_LSARPC   "\\PIPE\\lsarpc"
 
-/* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */
-typedef struct time_info
-{
-  uint32 time;
-
-} UTIME;
-
 /* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */
 typedef struct nttime_info
 {
@@ -279,40 +272,102 @@ typedef struct nttime_info
 #define ACB_PWNOEXP    0x0200  /* 1 = User password does not expire */
 #define ACB_AUTOLOCK   0x0400  /* 1 = Account auto locked */
  
+#define MAX_HOURS_LEN 32
+
 struct smb_passwd
 {
-       int smb_userid;
-       char *smb_name;
+       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 *smb_name;     /* username unicode string */
+       char *full_name;    /* user's full name unicode string */
+       char *home_dir;     /* home directory unicode string */
+       char *dir_drive;    /* home directory drive unicode string */
+       char *logon_script; /* logon script unicode string */
+       char *profile_path; /* profile path unicode string */
+       char *acct_desc  ;  /* user description unicode string */
+       char *workstations; /* login from workstations unicode string */
+       char *unknown_str ; /* don't know what this is, yet. */
+       char *munged_dial ; /* munged path name and dial-back tel number */
+
+       int smb_userid;       /* this is actually the unix uid_t */
+       uint32 user_rid;      /* Primary User ID */
+       uint32 group_rid;     /* Primary Group ID */
+
        unsigned char *smb_passwd; /* Null if no password */
        unsigned char *smb_nt_passwd; /* Null if no password */
-       /* Other fields / flags may be added later */
-        uint16 acct_ctrl;
+
+       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 */
 };
 
+
+/* DOM_CHAL - challenge info */
+typedef struct chal_info
+{
+  uchar data[8]; /* credentials */
+} DOM_CHAL;
+
+/* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */
+typedef struct time_info
+{
+  uint32 time;
+
+} UTIME;
+
+/* DOM_CREDs - timestamped client or server credentials */
+typedef struct cred_info
+{  
+  DOM_CHAL challenge; /* credentials */
+  UTIME timestamp;    /* credential time-stamp */
+
+} DOM_CRED;
+
 struct cli_state {
-       int fd;
-       int cnum;
-       int pid;
-       int mid;
-       int uid;
-       int protocol;
-       int sec_mode;
-       int error;
-       int privilages;
-       fstring eff_name;
-       fstring desthost;
-       char cryptkey[8];
-       uint32 sesskey;
-       int serverzone;
-       uint32 servertime;
-       int readbraw_supported;
-       int writebraw_supported;
-       int timeout;
-       int max_xmit;
-       char *outbuf;
-       char *inbuf;
-       int bufsize;
-       int initialised;
+  int fd;
+  int cnum;
+  int pid;
+  int mid;
+  int uid;
+  int protocol;
+  int sec_mode;
+  int rap_error;
+  int privilages;
+  fstring eff_name;
+  fstring desthost;
+  char cryptkey[8];
+  uint32 sesskey;
+  int serverzone;
+  uint32 servertime;
+  int readbraw_supported;
+  int writebraw_supported;
+  int timeout;
+  int max_xmit;
+  char *outbuf;
+  char *inbuf;
+  int bufsize;
+  int initialised;
+  /*
+   * Only used in NT domain calls.
+   */
+  uint32 nt_error;                   /* NT RPC error code. */
+  uint16 nt_pipe_fnum;               /* Pipe handle. */
+  unsigned char sess_key[16];        /* Current session key. */
+  DOM_CRED clnt_cred;                /* Client credential. */
+  fstring mach_acct;                 /* MYNAME$. */
+  fstring srv_name_slash;            /* \\remote server. */
+  fstring clnt_name_slash;            /* \\local client. */
 };
 
 
@@ -443,20 +498,6 @@ typedef struct
 
 } connection_struct;
 
-/* DOM_CHAL - challenge info */
-typedef struct chal_info
-{
-  uchar data[8]; /* credentials */
-} DOM_CHAL;
-
-/* DOM_CREDs - timestamped client or server credentials */
-typedef struct cred_info
-{  
-  DOM_CHAL challenge; /* credentials */
-  UTIME timestamp;    /* credential time-stamp */
-
-} DOM_CRED;
-
 /* Domain controller authentication protocol info */
 struct dcinfo
 {
@@ -474,7 +515,8 @@ typedef struct
   int uid; /* uid of a validated user */
   int gid; /* gid of a validated user */
 
-  fstring name; /* name of a validated user */
+  fstring requested_name; /* user name from the client */
+  fstring name; /* unix user name of a validated user */
   fstring real_name;   /* to store real name from password file - simeon */
   BOOL guest;
 
@@ -632,7 +674,7 @@ struct parm_struct
        parm_type type;
        parm_class class;
        void *ptr;
-       BOOL (*special)();
+       BOOL (*special)(char *, char **);
        struct enum_list *enum_list;
        unsigned flags;
        union {
@@ -883,11 +925,36 @@ struct parm_struct
 #define smb_droff smb_vwv7
 #define smb_drdisp smb_vwv8
 
+/* these are for the NT trans primary request. */
+#define smb_nt_MaxSetupCount smb_vwv0
+#define smb_nt_Flags (smb_vwv0 + 1)
+#define smb_nt_TotalParameterCount (smb_vwv0 + 3)
+#define smb_nt_TotalDataCount (smb_vwv0 + 7)
+#define smb_nt_MaxParameterCount (smb_vwv0 + 11)
+#define smb_nt_MaxDataCount (smb_vwv0 + 15)
+#define smb_nt_ParameterCount (smb_vwv0 + 19)
+#define smb_nt_ParameterOffset (smb_vwv0 + 23)
+#define smb_nt_DataCount (smb_vwv0 + 27)
+#define smb_nt_DataOffset (smb_vwv0 + 31)
+#define smb_nt_SetupCount (smb_vwv0 + 35)
+#define smb_nt_Function (smb_vwv0 + 36)
+#define smb_nt_SetupStart (smb_vwv0 + 39)
+
+/* these are for the NT trans secondary request. */
+#define smb_nts_TotalParameterCount (smb_vwv0 + 3)
+#define smb_nts_TotalDataCount (smb_vwv0 + 7)
+#define smb_nts_ParameterCount (smb_vwv0 + 11)
+#define smb_nts_ParameterOffset (smb_vwv0 + 15)
+#define smb_nts_ParameterDisplacement (smb_vwv0 + 19)
+#define smb_nts_DataCount (smb_vwv0 + 23)
+#define smb_nts_DataOffset (smb_vwv0 + 27)
+#define smb_nts_DataDisplacement (smb_vwv0 + 31)
+
 /* where to find the base of the SMB packet proper */
 #define smb_base(buf) (((char *)(buf))+4)
 
 
-#define SUCCESS 0  /* The request was successful. */
+#define SMB_SUCCESS 0  /* The request was successful. */
 #define ERRDOS 0x01 /*  Error is from the core DOS operating system set. */
 #define ERRSRV 0x02  /* Error is generated by the server network file manager.*/
 #define ERRHRD 0x03  /* Error is an hardware error. */
@@ -1060,7 +1127,7 @@ char *Strstr(char *s, char *p);
 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};
+enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER,SEC_DOMAIN};
 
 /* printing types */
 enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX,
@@ -1115,6 +1182,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 #define KANJI_CODEPAGE 932
 #define HANGUL_CODEPAGE 949
 #define BIG5_CODEPAGE 950
+#define SIMPLIFIED_CHINESE_CODEPAGE 936
 
 #ifdef KANJI
 /*