all_string_sub() is broken as it doesn't handle mb chars correctly (and
[Samba.git] / source / include / authdata.h
blob9d80745fb0669d3198e70ae1b90505240ca3a7cb
1 /*
2 Unix SMB/CIFS implementation.
3 Kerberos authorization data
4 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef _AUTHDATA_H
23 #define _AUTHDATA_H
25 #include "rpc_misc.h"
27 #define PAC_TYPE_LOGON_INFO 1
28 #define PAC_TYPE_SERVER_CHECKSUM 6
29 #define PAC_TYPE_PRIVSVR_CHECKSUM 7
30 #define PAC_TYPE_UNKNOWN_10 10
32 typedef struct unknown_type_10 {
33 NTTIME unknown_time;
34 uint16 len;
35 uint16 *username; /* might not be null terminated, so not UNISTR */
36 } UNKNOWN_TYPE_10;
38 typedef struct pac_signature_data {
39 uint32 type;
40 uint8 *signature;
41 } PAC_SIGNATURE_DATA;
43 typedef struct group_membership {
44 uint32 rid;
45 uint32 attrs;
46 } GROUP_MEMBERSHIP;
48 typedef struct group_membership_array {
49 uint32 count;
50 GROUP_MEMBERSHIP *group_membership;
51 } GROUP_MEMBERSHIP_ARRAY;
53 typedef struct krb_sid_and_attrs {
54 uint32 sid_ptr;
55 uint32 attrs;
56 DOM_SID2 *sid;
57 } KRB_SID_AND_ATTRS;
59 typedef struct krb_sid_and_attr_array {
60 uint32 count;
61 KRB_SID_AND_ATTRS *krb_sid_and_attrs;
62 } KRB_SID_AND_ATTR_ARRAY;
65 /* This is awfully similar to a samr_user_info_23, but not identical.
66 Many of the field names have been swiped from there, because it is
67 so similar that they are likely the same, but many have been verified.
68 Some are in a different order, though... */
69 typedef struct pac_logon_info {
70 NTTIME logon_time; /* logon time */
71 NTTIME logoff_time; /* logoff time */
72 NTTIME kickoff_time; /* kickoff time */
73 NTTIME pass_last_set_time; /* password last set time */
74 NTTIME pass_can_change_time; /* password can change time */
75 NTTIME pass_must_change_time; /* password must change time */
77 UNIHDR hdr_user_name; /* user name unicode string header */
78 UNIHDR hdr_full_name; /* user's full name unicode string header */
79 UNIHDR hdr_logon_script; /* these last 4 appear to be in a different */
80 UNIHDR hdr_profile_path; /* order than in the info23 */
81 UNIHDR hdr_home_dir;
82 UNIHDR hdr_dir_drive;
84 uint16 logon_count; /* number of times user has logged onto domain */
85 uint16 reserved12;
87 uint32 user_rid;
88 uint32 group_rid;
89 uint32 group_count;
90 uint32 group_membership_ptr;
91 uint32 user_flags;
93 uint32 reserved13[4];
94 UNIHDR hdr_dom_controller;
95 UNIHDR hdr_dom_name;
97 uint32 ptr_dom_sid;
99 uint32 reserved16[2];
100 uint32 reserved17; /* looks like it may be acb_info */
101 uint32 reserved18[7];
103 uint32 sid_count;
104 uint32 ptr_extra_sids;
106 uint32 ptr_res_group_dom_sid;
107 uint32 res_group_count;
108 uint32 ptr_res_groups;
110 UNISTR2 uni_user_name; /* user name unicode string header */
111 UNISTR2 uni_full_name; /* user's full name unicode string header */
112 UNISTR2 uni_logon_script; /* these last 4 appear to be in a different*/
113 UNISTR2 uni_profile_path; /* order than in the info23 */
114 UNISTR2 uni_home_dir;
115 UNISTR2 uni_dir_drive;
116 UNISTR2 uni_dom_controller;
117 UNISTR2 uni_dom_name;
118 DOM_SID2 dom_sid;
119 GROUP_MEMBERSHIP_ARRAY groups;
120 KRB_SID_AND_ATTR_ARRAY extra_sids;
121 DOM_SID2 res_group_dom_sid;
122 GROUP_MEMBERSHIP_ARRAY res_groups;
124 } PAC_LOGON_INFO;
126 typedef struct pac_info_ctr
128 union
130 PAC_LOGON_INFO *logon_info;
131 PAC_SIGNATURE_DATA *srv_cksum;
132 PAC_SIGNATURE_DATA *privsrv_cksum;
133 UNKNOWN_TYPE_10 *type_10;
134 } pac;
135 } PAC_INFO_CTR;
137 typedef struct pac_info_hdr {
138 uint32 type;
139 uint32 size;
140 uint32 offset;
141 uint32 offsethi;
142 PAC_INFO_CTR *ctr;
143 } PAC_INFO_HDR;
145 typedef struct pac_data {
146 uint32 num_buffers;
147 uint32 version;
148 PAC_INFO_HDR *pac_info_hdr_ptr;
149 } PAC_DATA;
152 #endif