Changeset 740 for vendor/current/source3/include/passdb.h
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified vendor/current/source3/include/passdb.h ¶
r414 r740 24 24 #define _PASSDB_H 25 25 26 #include "../librpc/gen_ndr/lsa.h" 27 28 #include "mapping.h" 29 26 30 /********************************************************************** 27 31 * Masks for mappings between unix uid and gid types and … … 29 33 **********************************************************************/ 30 34 31 #define BASE_RID (0x000003E8L)32 33 35 /* Take the bottom bit. */ 34 36 #define RID_TYPE_MASK 1 … … 38 40 #define USER_RID_TYPE 0 39 41 #define GROUP_RID_TYPE 1 42 43 /* 44 * Flags for local user manipulation. 45 */ 46 47 #define LOCAL_ADD_USER 0x1 48 #define LOCAL_DELETE_USER 0x2 49 #define LOCAL_DISABLE_USER 0x4 50 #define LOCAL_ENABLE_USER 0x8 51 #define LOCAL_TRUST_ACCOUNT 0x10 52 #define LOCAL_SET_NO_PASSWORD 0x20 53 #define LOCAL_SET_PASSWORD 0x40 54 #define LOCAL_SET_LDAP_ADMIN_PW 0x80 55 #define LOCAL_INTERDOM_ACCOUNT 0x100 56 #define LOCAL_AM_ROOT 0x200 /* Act as root */ 57 58 /* 59 * Size of new password account encoding string. This is enough space to 60 * hold 11 ACB characters, plus the surrounding [] and a terminating null. 61 * Do not change unless you are adding new ACB bits! 62 */ 63 64 #define NEW_PW_FORMAT_SPACE_PADDED_LEN 14 65 66 /* Password history contants. */ 67 #define PW_HISTORY_SALT_LEN 16 68 #define SALTED_MD5_HASH_LEN 16 69 #define PW_HISTORY_ENTRY_LEN (PW_HISTORY_SALT_LEN+SALTED_MD5_HASH_LEN) 70 #define MAX_PW_HISTORY_LEN 24 40 71 41 72 /* … … 73 104 PDB_BAD_PASSWORD_COUNT, 74 105 PDB_LOGON_COUNT, 106 PDB_COUNTRY_CODE, 107 PDB_CODE_PAGE, 75 108 PDB_UNKNOWN6, 76 109 PDB_LMPASSWD, … … 105 138 106 139 /* cache for bad password lockout data, to be used on replicated SAMs */ 107 typedef struct logon_cache_struct{140 struct login_cache { 108 141 time_t entry_timestamp; 109 uint32 acct_ctrl;110 uint16 bad_password_count;142 uint32_t acct_ctrl; 143 uint16_t bad_password_count; 111 144 time_t bad_password_time; 112 } LOGIN_CACHE;145 }; 113 146 114 147 #define SAMU_BUFFER_V0 0 … … 119 152 #define SAMU_BUFFER_V4 4 120 153 #define SAMU_BUFFER_LATEST SAMU_BUFFER_V4 154 155 #define MAX_HOURS_LEN 32 121 156 122 157 struct samu { … … 148 183 const char *munged_dial; /* munged path name and dial-back tel number */ 149 184 150 DOM_SID user_sid;151 DOM_SID*group_sid;185 struct dom_sid user_sid; 186 struct dom_sid *group_sid; 152 187 153 188 DATA_BLOB lm_pw; /* .data is Null if no password */ … … 156 191 char* plaintext_pw; /* is Null if not available */ 157 192 158 uint32 acct_ctrl; /* account info (ACB_xxxx bit-mask) */159 uint32 fields_present; /* 0x00ff ffff */160 161 uint16 logon_divs; /* 168 - number of hours in a week */162 uint32 hours_len; /* normally 21 bytes */163 uint8 hours[MAX_HOURS_LEN];193 uint32_t acct_ctrl; /* account info (ACB_xxxx bit-mask) */ 194 uint32_t fields_present; /* 0x00ff ffff */ 195 196 uint16_t logon_divs; /* 168 - number of hours in a week */ 197 uint32_t hours_len; /* normally 21 bytes */ 198 uint8_t hours[MAX_HOURS_LEN]; 164 199 165 200 /* Was unknown_5. */ 166 uint16 bad_password_count; 167 uint16 logon_count; 168 169 uint32 unknown_6; /* 0x0000 04ec */ 201 uint16_t bad_password_count; 202 uint16_t logon_count; 203 204 uint16_t country_code; 205 uint16_t code_page; 206 207 uint32_t unknown_6; /* 0x0000 04ec */ 170 208 171 209 /* a tag for who added the private methods */ … … 183 221 fstring acct_name; /* account name */ 184 222 fstring acct_desc; /* account name */ 185 uint32 rid; /* domain-relative RID */223 uint32_t rid; /* domain-relative RID */ 186 224 }; 187 225 188 226 struct samr_displayentry { 189 uint32 idx;190 uint32 rid;191 uint32 acct_flags;227 uint32_t idx; 228 uint32_t rid; 229 uint32_t acct_flags; 192 230 const char *account_name; 193 231 const char *fullname; … … 204 242 enum pdb_search_type type; 205 243 struct samr_displayentry *cache; 206 uint32 num_entries;244 uint32_t num_entries; 207 245 ssize_t cache_size; 208 246 bool search_ended; … … 219 257 struct dom_sid sid; 220 258 struct GUID guid; 259 }; 260 261 struct pdb_trusted_domain { 262 char *domain_name; 263 char *netbios_name; 264 struct dom_sid security_identifier; 265 DATA_BLOB trust_auth_incoming; 266 DATA_BLOB trust_auth_outgoing; 267 uint32_t trust_direction; 268 uint32_t trust_type; 269 uint32_t trust_attributes; 270 DATA_BLOB trust_forest_trust_info; 271 }; 272 273 /* 274 * trusted domain entry/entries returned by secrets_get_trusted_domains 275 * (used in _lsa_enum_trust_dom call) 276 */ 277 struct trustdom_info { 278 char *name; 279 struct dom_sid sid; 221 280 }; 222 281 … … 237 296 }; 238 297 239 #define PDB_CAP_STORE_RIDS 0x0001 240 #define PDB_CAP_ADS 0x0002 298 #define PDB_CAP_STORE_RIDS 0x0001 299 #define PDB_CAP_ADS 0x0002 300 #define PDB_CAP_TRUSTED_DOMAINS_EX 0x0004 241 301 242 302 /***************************************************************** … … 252 312 * the pdb module. Remove the latter, this might happen more often. VL. 253 313 * changed to version 14 to move lookup_rids and lookup_names to return 254 * enum lsa_SidType rather than uint32 .314 * enum lsa_SidType rather than uint32_t. 255 315 * Changed to 16 for access to the trusted domain passwords (obnox). 256 316 * Changed to 17, the sampwent interface is gone. … … 270 330 NTSTATUS (*getsampwnam)(struct pdb_methods *, struct samu *sam_acct, const char *username); 271 331 272 NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const DOM_SID*sid);332 NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const struct dom_sid *sid); 273 333 274 334 NTSTATUS (*create_user)(struct pdb_methods *, TALLOC_CTX *tmp_ctx, 275 const char *name, uint32 acct_flags,276 uint32 *rid);335 const char *name, uint32_t acct_flags, 336 uint32_t *rid); 277 337 278 338 NTSTATUS (*delete_user)(struct pdb_methods *, TALLOC_CTX *tmp_ctx, … … 289 349 NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, struct samu *sam_acct, bool success); 290 350 291 NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SIDsid);351 NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, struct dom_sid sid); 292 352 293 353 NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, gid_t gid); … … 297 357 NTSTATUS (*create_dom_group)(struct pdb_methods *methods, 298 358 TALLOC_CTX *mem_ctx, const char *name, 299 uint32 *rid);359 uint32_t *rid); 300 360 301 361 NTSTATUS (*delete_dom_group)(struct pdb_methods *methods, 302 TALLOC_CTX *mem_ctx, uint32 rid);362 TALLOC_CTX *mem_ctx, uint32_t rid); 303 363 304 364 NTSTATUS (*add_group_mapping_entry)(struct pdb_methods *methods, … … 309 369 310 370 NTSTATUS (*delete_group_mapping_entry)(struct pdb_methods *methods, 311 DOM_SIDsid);371 struct dom_sid sid); 312 372 313 373 NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, 314 const DOM_SID*sid, enum lsa_SidType sid_name_use,374 const struct dom_sid *sid, enum lsa_SidType sid_name_use, 315 375 GROUP_MAP **pp_rmap, size_t *p_num_entries, 316 376 bool unix_only); … … 318 378 NTSTATUS (*enum_group_members)(struct pdb_methods *methods, 319 379 TALLOC_CTX *mem_ctx, 320 const DOM_SID*group,321 uint32 **pp_member_rids,380 const struct dom_sid *group, 381 uint32_t **pp_member_rids, 322 382 size_t *p_num_members); 323 383 … … 325 385 TALLOC_CTX *mem_ctx, 326 386 struct samu *user, 327 DOM_SID**pp_sids, gid_t **pp_gids,328 size_t *p_num_groups);387 struct dom_sid **pp_sids, gid_t **pp_gids, 388 uint32_t *p_num_groups); 329 389 330 390 NTSTATUS (*set_unix_primary_group)(struct pdb_methods *methods, … … 334 394 NTSTATUS (*add_groupmem)(struct pdb_methods *methods, 335 395 TALLOC_CTX *mem_ctx, 336 uint32 group_rid, uint32member_rid);396 uint32_t group_rid, uint32_t member_rid); 337 397 338 398 NTSTATUS (*del_groupmem)(struct pdb_methods *methods, 339 399 TALLOC_CTX *mem_ctx, 340 uint32 group_rid, uint32member_rid);400 uint32_t group_rid, uint32_t member_rid); 341 401 342 402 NTSTATUS (*create_alias)(struct pdb_methods *methods, 343 const char *name, uint32 *rid);403 const char *name, uint32_t *rid); 344 404 345 405 NTSTATUS (*delete_alias)(struct pdb_methods *methods, 346 const DOM_SID*sid);406 const struct dom_sid *sid); 347 407 348 408 NTSTATUS (*get_aliasinfo)(struct pdb_methods *methods, 349 const DOM_SID*sid,409 const struct dom_sid *sid, 350 410 struct acct_info *info); 351 411 352 412 NTSTATUS (*set_aliasinfo)(struct pdb_methods *methods, 353 const DOM_SID*sid,413 const struct dom_sid *sid, 354 414 struct acct_info *info); 355 415 356 416 NTSTATUS (*add_aliasmem)(struct pdb_methods *methods, 357 const DOM_SID *alias, const DOM_SID*member);417 const struct dom_sid *alias, const struct dom_sid *member); 358 418 NTSTATUS (*del_aliasmem)(struct pdb_methods *methods, 359 const DOM_SID *alias, const DOM_SID*member);419 const struct dom_sid *alias, const struct dom_sid *member); 360 420 NTSTATUS (*enum_aliasmem)(struct pdb_methods *methods, 361 const DOM_SID*alias, TALLOC_CTX *mem_ctx,362 DOM_SID**members, size_t *p_num_members);421 const struct dom_sid *alias, TALLOC_CTX *mem_ctx, 422 struct dom_sid **members, size_t *p_num_members); 363 423 NTSTATUS (*enum_alias_memberships)(struct pdb_methods *methods, 364 424 TALLOC_CTX *mem_ctx, 365 const DOM_SID*domain_sid,366 const DOM_SID*members,425 const struct dom_sid *domain_sid, 426 const struct dom_sid *members, 367 427 size_t num_members, 368 uint32 **pp_alias_rids,428 uint32_t **pp_alias_rids, 369 429 size_t *p_num_alias_rids); 370 430 371 431 NTSTATUS (*lookup_rids)(struct pdb_methods *methods, 372 const DOM_SID*domain_sid,432 const struct dom_sid *domain_sid, 373 433 int num_rids, 374 uint32 *rids,434 uint32_t *rids, 375 435 const char **pp_names, 376 436 enum lsa_SidType *attrs); 377 437 378 438 NTSTATUS (*lookup_names)(struct pdb_methods *methods, 379 const DOM_SID*domain_sid,439 const struct dom_sid *domain_sid, 380 440 int num_names, 381 441 const char **pp_names, 382 uint32 *rids,442 uint32_t *rids, 383 443 enum lsa_SidType *attrs); 384 444 … … 395 455 bool (*search_users)(struct pdb_methods *methods, 396 456 struct pdb_search *search, 397 uint32 acct_flags);457 uint32_t acct_flags); 398 458 bool (*search_groups)(struct pdb_methods *methods, 399 459 struct pdb_search *search); 400 460 bool (*search_aliases)(struct pdb_methods *methods, 401 461 struct pdb_search *search, 402 const DOM_SID*sid);462 const struct dom_sid *sid); 403 463 404 464 bool (*uid_to_sid)(struct pdb_methods *methods, uid_t uid, 405 DOM_SID*sid);465 struct dom_sid *sid); 406 466 bool (*gid_to_sid)(struct pdb_methods *methods, gid_t gid, 407 DOM_SID*sid);408 bool (*sid_to_id)(struct pdb_methods *methods, const DOM_SID*sid,467 struct dom_sid *sid); 468 bool (*sid_to_id)(struct pdb_methods *methods, const struct dom_sid *sid, 409 469 union unid_t *id, enum lsa_SidType *type); 410 470 411 471 uint32_t (*capabilities)(struct pdb_methods *methods); 412 bool (*new_rid)(struct pdb_methods *methods, uint32 *rid);472 bool (*new_rid)(struct pdb_methods *methods, uint32_t *rid); 413 473 414 474 415 475 bool (*get_trusteddom_pw)(struct pdb_methods *methods, 416 476 const char *domain, char** pwd, 417 DOM_SID*sid, time_t *pass_last_set_time);477 struct dom_sid *sid, time_t *pass_last_set_time); 418 478 bool (*set_trusteddom_pw)(struct pdb_methods *methods, 419 479 const char* domain, const char* pwd, 420 const DOM_SID*sid);480 const struct dom_sid *sid); 421 481 bool (*del_trusteddom_pw)(struct pdb_methods *methods, 422 482 const char *domain); 423 483 NTSTATUS (*enum_trusteddoms)(struct pdb_methods *methods, 424 TALLOC_CTX *mem_ctx, uint32 *num_domains,484 TALLOC_CTX *mem_ctx, uint32_t *num_domains, 425 485 struct trustdom_info ***domains); 486 487 488 NTSTATUS (*get_trusted_domain)(struct pdb_methods *methods, 489 TALLOC_CTX *mem_ctx, 490 const char *domain, 491 struct pdb_trusted_domain **td); 492 NTSTATUS (*get_trusted_domain_by_sid)(struct pdb_methods *methods, 493 TALLOC_CTX *mem_ctx, 494 struct dom_sid *sid, 495 struct pdb_trusted_domain **td); 496 NTSTATUS (*set_trusted_domain)(struct pdb_methods *methods, 497 const char* domain, 498 const struct pdb_trusted_domain *td); 499 NTSTATUS (*del_trusted_domain)(struct pdb_methods *methods, 500 const char *domain); 501 NTSTATUS (*enum_trusted_domains)(struct pdb_methods *methods, 502 TALLOC_CTX *mem_ctx, 503 uint32_t *num_domains, 504 struct pdb_trusted_domain ***domains); 426 505 427 506 void *private_data; /* Private data of some kind */ … … 441 520 }; 442 521 522 #include "passdb/proto.h" 523 #include "passdb/machine_sid.h" 524 #include "passdb/lookup_sid.h" 525 443 526 #endif /* _PASSDB_H */
Note:
See TracChangeset
for help on using the changeset viewer.