Changeset 988 for vendor/current/source3/include/passdb.h
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/include/passdb.h
r740 r988 24 24 #define _PASSDB_H 25 25 26 #ifndef NT_HASH_LEN 27 #define NT_HASH_LEN 16 28 #endif 29 30 #ifndef LM_HASH_LEN 31 #define LM_HASH_LEN 16 32 #endif 33 26 34 #include "../librpc/gen_ndr/lsa.h" 27 28 #include "mapping.h" 35 #include <tevent.h> 36 struct unixid; 37 struct cli_credentials; 38 39 /* group mapping headers */ 40 41 #define ENUM_ONLY_MAPPED True 42 #define ENUM_ALL_MAPPED False 43 44 typedef struct _GROUP_MAP { 45 struct pdb_methods *methods; 46 gid_t gid; 47 struct dom_sid sid; 48 enum lsa_SidType sid_name_use; 49 char *nt_name; 50 char *comment; 51 } GROUP_MAP; 52 53 struct acct_info { 54 char *acct_name; /* account name */ 55 char *acct_desc; /* account name */ 56 uint32_t rid; /* domain-relative RID */ 57 }; 58 59 /* The following definitions come from groupdb/mapping.c */ 60 61 NTSTATUS add_initial_entry(gid_t gid, const char *sid, enum lsa_SidType sid_name_use, const char *nt_name, const char *comment); 62 bool get_domain_group_from_sid(struct dom_sid sid, GROUP_MAP *map); 63 int smb_create_group(const char *unix_group, gid_t *new_gid); 64 int smb_delete_group(const char *unix_group); 65 int smb_set_primary_group(const char *unix_group, const char* unix_user); 66 int smb_add_user_group(const char *unix_group, const char *unix_user); 67 int smb_delete_user_group(const char *unix_group, const char *unix_user); 68 NTSTATUS pdb_default_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, 69 struct dom_sid sid); 70 NTSTATUS pdb_default_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, 71 gid_t gid); 72 NTSTATUS pdb_default_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, 73 const char *name); 74 NTSTATUS pdb_default_add_group_mapping_entry(struct pdb_methods *methods, 75 GROUP_MAP *map); 76 NTSTATUS pdb_default_update_group_mapping_entry(struct pdb_methods *methods, 77 GROUP_MAP *map); 78 NTSTATUS pdb_default_delete_group_mapping_entry(struct pdb_methods *methods, 79 struct dom_sid sid); 80 NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods, 81 const struct dom_sid *sid, 82 enum lsa_SidType sid_name_use, 83 GROUP_MAP ***pp_rmap, 84 size_t *p_num_entries, 85 bool unix_only); 86 NTSTATUS pdb_default_create_alias(struct pdb_methods *methods, 87 const char *name, uint32_t *rid); 88 NTSTATUS pdb_default_delete_alias(struct pdb_methods *methods, 89 const struct dom_sid *sid); 90 NTSTATUS pdb_default_get_aliasinfo(struct pdb_methods *methods, 91 const struct dom_sid *sid, 92 struct acct_info *info); 93 NTSTATUS pdb_default_set_aliasinfo(struct pdb_methods *methods, 94 const struct dom_sid *sid, 95 struct acct_info *info); 96 NTSTATUS pdb_default_add_aliasmem(struct pdb_methods *methods, 97 const struct dom_sid *alias, const struct dom_sid *member); 98 NTSTATUS pdb_default_del_aliasmem(struct pdb_methods *methods, 99 const struct dom_sid *alias, const struct dom_sid *member); 100 NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods, 101 const struct dom_sid *alias, TALLOC_CTX *mem_ctx, 102 struct dom_sid **pp_members, 103 size_t *p_num_members); 104 NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods, 105 TALLOC_CTX *mem_ctx, 106 const struct dom_sid *domain_sid, 107 const struct dom_sid *members, 108 size_t num_members, 109 uint32_t **pp_alias_rids, 110 size_t *p_num_alias_rids); 111 NTSTATUS pdb_nop_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, 112 struct dom_sid sid); 113 NTSTATUS pdb_nop_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, 114 gid_t gid); 115 NTSTATUS pdb_nop_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, 116 const char *name); 117 NTSTATUS pdb_nop_add_group_mapping_entry(struct pdb_methods *methods, 118 GROUP_MAP *map); 119 NTSTATUS pdb_nop_update_group_mapping_entry(struct pdb_methods *methods, 120 GROUP_MAP *map); 121 NTSTATUS pdb_nop_delete_group_mapping_entry(struct pdb_methods *methods, 122 struct dom_sid sid); 123 NTSTATUS pdb_nop_enum_group_mapping(struct pdb_methods *methods, 124 enum lsa_SidType sid_name_use, 125 GROUP_MAP **rmap, size_t *num_entries, 126 bool unix_only); 127 NTSTATUS pdb_create_builtin_alias(uint32_t rid, gid_t gid); 128 129 130 /* passdb headers */ 29 131 30 132 /********************************************************************** … … 84 186 PDB_BAD_PASSWORD_TIME, 85 187 PDB_CANCHANGETIME, 86 PDB_MUSTCHANGETIME,87 188 PDB_PLAINTEXT_PW, 88 189 PDB_USERNAME, … … 168 269 time_t pass_last_set_time; /* password last set time */ 169 270 time_t pass_can_change_time; /* password can change time */ 170 time_t pass_must_change_time; /* password must change time */171 271 172 272 const char *username; /* UNIX username string */ … … 218 318 }; 219 319 220 struct acct_info {221 fstring acct_name; /* account name */222 fstring acct_desc; /* account name */223 uint32_t rid; /* domain-relative RID */224 };225 226 320 struct samr_displayentry { 227 321 uint32_t idx; … … 268 362 uint32_t trust_type; 269 363 uint32_t trust_attributes; 364 uint32_t *trust_posix_offset; 365 uint32_t *supported_enc_type; 270 366 DATA_BLOB trust_forest_trust_info; 271 367 }; … … 317 413 * Changed to 18, pdb_rid_algorithm -> pdb_capabilities 318 414 * Changed to 19, removed uid_to_rid 415 * Changed to 20, pdb_secret calls 416 * Changed to 21, set/enum_upn_suffixes. AB. 417 * Changed to 22, idmap control functions 418 * Changed to 23, new idmap control functions 419 * Changed to 24, removed uid_to_sid and gid_to_sid, replaced with id_to_sid 420 * Leave at 24, add optional get_trusteddom_creds() 319 421 */ 320 422 321 #define PASSDB_INTERFACE_VERSION 19423 #define PASSDB_INTERFACE_VERSION 24 322 424 323 425 struct pdb_methods … … 373 475 NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, 374 476 const struct dom_sid *sid, enum lsa_SidType sid_name_use, 375 GROUP_MAP ** pp_rmap, size_t *p_num_entries,477 GROUP_MAP ***pp_rmap, size_t *p_num_entries, 376 478 bool unix_only); 377 479 … … 462 564 const struct dom_sid *sid); 463 565 464 bool (*uid_to_sid)(struct pdb_methods *methods, uid_t uid, 465 struct dom_sid *sid); 466 bool (*gid_to_sid)(struct pdb_methods *methods, gid_t gid, 467 struct dom_sid *sid); 566 /* 567 * Instead of passing down a gid or uid, this function sends down a pointer 568 * to a unixid. 569 * 570 * This acts as an in-out variable so that the idmap functions can correctly 571 * receive ID_TYPE_BOTH, filling in cache details correctly rather than forcing 572 * the cache to store ID_TYPE_UID or ID_TYPE_GID. 573 */ 574 bool (*id_to_sid)(struct pdb_methods *methods, struct unixid *id, 575 struct dom_sid *sid); 468 576 bool (*sid_to_id)(struct pdb_methods *methods, const struct dom_sid *sid, 469 union unid_t *id, enum lsa_SidType *type);577 struct unixid *id); 470 578 471 579 uint32_t (*capabilities)(struct pdb_methods *methods); … … 476 584 const char *domain, char** pwd, 477 585 struct dom_sid *sid, time_t *pass_last_set_time); 586 NTSTATUS (*get_trusteddom_creds)(struct pdb_methods *methods, 587 const char *domain, 588 TALLOC_CTX *mem_ctx, 589 struct cli_credentials **creds); 478 590 bool (*set_trusteddom_pw)(struct pdb_methods *methods, 479 591 const char* domain, const char* pwd, … … 484 596 TALLOC_CTX *mem_ctx, uint32_t *num_domains, 485 597 struct trustdom_info ***domains); 486 487 598 488 599 NTSTATUS (*get_trusted_domain)(struct pdb_methods *methods, … … 504 615 struct pdb_trusted_domain ***domains); 505 616 617 NTSTATUS (*get_secret)(struct pdb_methods *methods, 618 TALLOC_CTX *mem_ctx, 619 const char *secret_name, 620 DATA_BLOB *secret_current, 621 NTTIME *secret_current_lastchange, 622 DATA_BLOB *secret_old, 623 NTTIME *secret_old_lastchange, 624 struct security_descriptor **sd); 625 NTSTATUS (*set_secret)(struct pdb_methods *methods, 626 const char *secret_name, 627 DATA_BLOB *secret_current, 628 DATA_BLOB *secret_old, 629 struct security_descriptor *sd); 630 NTSTATUS (*delete_secret)(struct pdb_methods *methods, 631 const char *secret_name); 632 633 NTSTATUS (*enum_upn_suffixes)(struct pdb_methods *methods, 634 TALLOC_CTX *mem_ctx, 635 uint32_t *num_suffixes, 636 char ***suffixes); 637 638 NTSTATUS (*set_upn_suffixes)(struct pdb_methods *methods, 639 uint32_t num_suffixes, 640 const char **suffixes); 641 642 bool (*is_responsible_for_our_sam)(struct pdb_methods *methods); 643 bool (*is_responsible_for_builtin)(struct pdb_methods *methods); 644 bool (*is_responsible_for_wellknown)(struct pdb_methods *methods); 645 bool (*is_responsible_for_unix_users)(struct pdb_methods *methods); 646 bool (*is_responsible_for_unix_groups)(struct pdb_methods *methods); 647 bool (*is_responsible_for_everything_else)(struct pdb_methods *methods); 648 506 649 void *private_data; /* Private data of some kind */ 507 650 … … 520 663 }; 521 664 522 #include "passdb/proto.h" 665 /* The following definitions come from passdb/account_pol.c */ 666 667 void account_policy_names_list(TALLOC_CTX *mem_ctx, const char ***names, int *num_names); 668 const char *decode_account_policy_name(enum pdb_policy_type type); 669 const char *get_account_policy_attr(enum pdb_policy_type type); 670 const char *account_policy_get_desc(enum pdb_policy_type type); 671 enum pdb_policy_type account_policy_name_to_typenum(const char *name); 672 bool account_policy_get_default(enum pdb_policy_type type, uint32_t *val); 673 bool init_account_policy(void); 674 bool account_policy_get(enum pdb_policy_type type, uint32_t *value); 675 bool account_policy_set(enum pdb_policy_type type, uint32_t value); 676 bool cache_account_policy_set(enum pdb_policy_type type, uint32_t value); 677 bool cache_account_policy_get(enum pdb_policy_type type, uint32_t *value); 678 struct db_context *get_account_pol_db( void ); 679 680 /* The following definitions come from passdb/login_cache.c */ 681 682 bool login_cache_init(void); 683 bool login_cache_shutdown(void); 684 bool login_cache_read(struct samu *sampass, struct login_cache *entry); 685 bool login_cache_write(const struct samu *sampass, 686 const struct login_cache *entry); 687 bool login_cache_delentry(const struct samu *sampass); 688 689 /* The following definitions come from passdb/passdb.c */ 690 691 struct samu *samu_new( TALLOC_CTX *ctx ); 692 NTSTATUS samu_set_unix(struct samu *user, const struct passwd *pwd); 693 NTSTATUS samu_alloc_rid_unix(struct pdb_methods *methods, 694 struct samu *user, const struct passwd *pwd); 695 char *pdb_encode_acct_ctrl(uint32_t acct_ctrl, size_t length); 696 uint32_t pdb_decode_acct_ctrl(const char *p); 697 void pdb_sethexpwd(char p[33], const unsigned char *pwd, uint32_t acct_ctrl); 698 bool pdb_gethexpwd(const char *p, unsigned char *pwd); 699 void pdb_sethexhours(char *p, const unsigned char *hours); 700 bool pdb_gethexhours(const char *p, unsigned char *hours); 701 int algorithmic_rid_base(void); 702 uid_t algorithmic_pdb_user_rid_to_uid(uint32_t user_rid); 703 uid_t max_algorithmic_uid(void); 704 uint32_t algorithmic_pdb_uid_to_user_rid(uid_t uid); 705 gid_t pdb_group_rid_to_gid(uint32_t group_rid); 706 gid_t max_algorithmic_gid(void); 707 uint32_t algorithmic_pdb_gid_to_group_rid(gid_t gid); 708 bool algorithmic_pdb_rid_is_user(uint32_t rid); 709 bool lookup_global_sam_name(const char *name, int flags, uint32_t *rid, 710 enum lsa_SidType *type); 711 NTSTATUS local_password_change(const char *user_name, 712 int local_flags, 713 const char *new_passwd, 714 char **pp_err_str, 715 char **pp_msg_str); 716 bool init_samu_from_buffer(struct samu *sampass, uint32_t level, 717 uint8_t *buf, uint32_t buflen); 718 uint32_t init_buffer_from_samu (uint8_t **buf, struct samu *sampass, bool size_only); 719 bool pdb_copy_sam_account(struct samu *dst, struct samu *src ); 720 bool pdb_update_bad_password_count(struct samu *sampass, bool *updated); 721 bool pdb_update_autolock_flag(struct samu *sampass, bool *updated); 722 bool pdb_increment_bad_password_count(struct samu *sampass); 723 bool is_dc_trusted_domain_situation(const char *domain_name); 724 bool get_trust_pw_clear(const char *domain, char **ret_pwd, 725 const char **account_name, 726 enum netr_SchannelType *channel); 727 bool get_trust_pw_hash(const char *domain, uint8_t ret_pwd[16], 728 const char **account_name, 729 enum netr_SchannelType *channel); 730 struct cli_credentials; 731 NTSTATUS pdb_get_trust_credentials(const char *netbios_domain, 732 const char *dns_domain, /* optional */ 733 TALLOC_CTX *mem_ctx, 734 struct cli_credentials **_creds); 735 736 /* The following definitions come from passdb/pdb_compat.c */ 737 738 uint32_t pdb_get_user_rid (const struct samu *sampass); 739 uint32_t pdb_get_group_rid (struct samu *sampass); 740 bool pdb_set_user_sid_from_rid (struct samu *sampass, uint32_t rid, enum pdb_value_state flag); 741 bool pdb_set_group_sid_from_rid (struct samu *sampass, uint32_t grid, enum pdb_value_state flag); 742 743 /* The following definitions come from passdb/pdb_get_set.c */ 744 745 bool pdb_is_password_change_time_max(time_t test_time); 746 uint32_t pdb_get_acct_ctrl(const struct samu *sampass); 747 time_t pdb_get_logon_time(const struct samu *sampass); 748 time_t pdb_get_logoff_time(const struct samu *sampass); 749 time_t pdb_get_kickoff_time(const struct samu *sampass); 750 time_t pdb_get_bad_password_time(const struct samu *sampass); 751 time_t pdb_get_pass_last_set_time(const struct samu *sampass); 752 time_t pdb_get_pass_can_change_time(const struct samu *sampass); 753 time_t pdb_get_pass_can_change_time_noncalc(const struct samu *sampass); 754 time_t pdb_get_pass_must_change_time(const struct samu *sampass); 755 bool pdb_get_pass_can_change(const struct samu *sampass); 756 uint16_t pdb_get_logon_divs(const struct samu *sampass); 757 uint32_t pdb_get_hours_len(const struct samu *sampass); 758 const uint8_t *pdb_get_hours(const struct samu *sampass); 759 const uint8_t *pdb_get_nt_passwd(const struct samu *sampass); 760 const uint8_t *pdb_get_lanman_passwd(const struct samu *sampass); 761 const uint8_t *pdb_get_pw_history(const struct samu *sampass, uint32_t *current_hist_len); 762 const char *pdb_get_plaintext_passwd(const struct samu *sampass); 763 const struct dom_sid *pdb_get_user_sid(const struct samu *sampass); 764 const struct dom_sid *pdb_get_group_sid(struct samu *sampass); 765 enum pdb_value_state pdb_get_init_flags(const struct samu *sampass, enum pdb_elements element); 766 const char *pdb_get_username(const struct samu *sampass); 767 const char *pdb_get_domain(const struct samu *sampass); 768 const char *pdb_get_nt_username(const struct samu *sampass); 769 const char *pdb_get_fullname(const struct samu *sampass); 770 const char *pdb_get_homedir(const struct samu *sampass); 771 const char *pdb_get_dir_drive(const struct samu *sampass); 772 const char *pdb_get_logon_script(const struct samu *sampass); 773 const char *pdb_get_profile_path(const struct samu *sampass); 774 const char *pdb_get_acct_desc(const struct samu *sampass); 775 const char *pdb_get_workstations(const struct samu *sampass); 776 const char *pdb_get_comment(const struct samu *sampass); 777 const char *pdb_get_munged_dial(const struct samu *sampass); 778 uint16_t pdb_get_bad_password_count(const struct samu *sampass); 779 uint16_t pdb_get_logon_count(const struct samu *sampass); 780 uint16_t pdb_get_country_code(const struct samu *sampass); 781 uint16_t pdb_get_code_page(const struct samu *sampass); 782 uint32_t pdb_get_unknown_6(const struct samu *sampass); 783 void *pdb_get_backend_private_data(const struct samu *sampass, const struct pdb_methods *my_methods); 784 bool pdb_set_acct_ctrl(struct samu *sampass, uint32_t acct_ctrl, enum pdb_value_state flag); 785 bool pdb_set_logon_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag); 786 bool pdb_set_logoff_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag); 787 bool pdb_set_kickoff_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag); 788 bool pdb_set_bad_password_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag); 789 bool pdb_set_pass_can_change_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag); 790 bool pdb_set_pass_last_set_time(struct samu *sampass, time_t mytime, enum pdb_value_state flag); 791 bool pdb_set_hours_len(struct samu *sampass, uint32_t len, enum pdb_value_state flag); 792 bool pdb_set_logon_divs(struct samu *sampass, uint16_t hours, enum pdb_value_state flag); 793 bool pdb_set_init_flags(struct samu *sampass, enum pdb_elements element, enum pdb_value_state value_flag); 794 bool pdb_set_user_sid(struct samu *sampass, const struct dom_sid *u_sid, enum pdb_value_state flag); 795 bool pdb_set_user_sid_from_string(struct samu *sampass, const char *u_sid, enum pdb_value_state flag); 796 bool pdb_set_group_sid(struct samu *sampass, const struct dom_sid *g_sid, enum pdb_value_state flag); 797 bool pdb_set_username(struct samu *sampass, const char *username, enum pdb_value_state flag); 798 bool pdb_set_domain(struct samu *sampass, const char *domain, enum pdb_value_state flag); 799 bool pdb_set_nt_username(struct samu *sampass, const char *nt_username, enum pdb_value_state flag); 800 bool pdb_set_fullname(struct samu *sampass, const char *full_name, enum pdb_value_state flag); 801 bool pdb_set_logon_script(struct samu *sampass, const char *logon_script, enum pdb_value_state flag); 802 bool pdb_set_profile_path(struct samu *sampass, const char *profile_path, enum pdb_value_state flag); 803 bool pdb_set_dir_drive(struct samu *sampass, const char *dir_drive, enum pdb_value_state flag); 804 bool pdb_set_homedir(struct samu *sampass, const char *home_dir, enum pdb_value_state flag); 805 bool pdb_set_acct_desc(struct samu *sampass, const char *acct_desc, enum pdb_value_state flag); 806 bool pdb_set_workstations(struct samu *sampass, const char *workstations, enum pdb_value_state flag); 807 bool pdb_set_comment(struct samu *sampass, const char *comment, enum pdb_value_state flag); 808 bool pdb_set_munged_dial(struct samu *sampass, const char *munged_dial, enum pdb_value_state flag); 809 bool pdb_set_nt_passwd(struct samu *sampass, const uint8_t pwd[NT_HASH_LEN], enum pdb_value_state flag); 810 bool pdb_set_lanman_passwd(struct samu *sampass, const uint8_t pwd[LM_HASH_LEN], enum pdb_value_state flag); 811 bool pdb_set_pw_history(struct samu *sampass, const uint8_t *pwd, uint32_t historyLen, enum pdb_value_state flag); 812 bool pdb_set_plaintext_pw_only(struct samu *sampass, const char *password, enum pdb_value_state flag); 813 bool pdb_update_history(struct samu *sampass, const uint8_t new_nt[NT_HASH_LEN]); 814 bool pdb_set_bad_password_count(struct samu *sampass, uint16_t bad_password_count, enum pdb_value_state flag); 815 bool pdb_set_logon_count(struct samu *sampass, uint16_t logon_count, enum pdb_value_state flag); 816 bool pdb_set_country_code(struct samu *sampass, uint16_t country_code, 817 enum pdb_value_state flag); 818 bool pdb_set_code_page(struct samu *sampass, uint16_t code_page, 819 enum pdb_value_state flag); 820 bool pdb_set_unknown_6(struct samu *sampass, uint32_t unkn, enum pdb_value_state flag); 821 bool pdb_set_hours(struct samu *sampass, const uint8_t *hours, int hours_len, 822 enum pdb_value_state flag); 823 bool pdb_set_backend_private_data(struct samu *sampass, void *private_data, 824 void (*free_fn)(void **), 825 const struct pdb_methods *my_methods, 826 enum pdb_value_state flag); 827 bool pdb_set_pass_can_change(struct samu *sampass, bool canchange); 828 bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext); 829 uint32_t pdb_build_fields_present(struct samu *sampass); 830 bool pdb_element_is_changed(const struct samu *sampass, 831 enum pdb_elements element); 832 bool pdb_element_is_set_or_changed(const struct samu *sampass, 833 enum pdb_elements element); 834 835 /* The following definitions come from passdb/pdb_interface.c */ 836 837 NTSTATUS smb_register_passdb(int version, const char *name, pdb_init_function init) ; 838 struct pdb_init_function_entry *pdb_find_backend_entry(const char *name); 839 const struct pdb_init_function_entry *pdb_get_backends(void); 840 struct tevent_context *pdb_get_tevent_context(void); 841 NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected); 842 struct pdb_domain_info *pdb_get_domain_info(TALLOC_CTX *mem_ctx); 843 bool pdb_getsampwnam(struct samu *sam_acct, const char *username) ; 844 bool pdb_getsampwsid(struct samu *sam_acct, const struct dom_sid *sid) ; 845 NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32_t flags, 846 uint32_t *rid); 847 NTSTATUS pdb_delete_user(TALLOC_CTX *mem_ctx, struct samu *sam_acct); 848 NTSTATUS pdb_add_sam_account(struct samu *sam_acct) ; 849 NTSTATUS pdb_update_sam_account(struct samu *sam_acct) ; 850 NTSTATUS pdb_delete_sam_account(struct samu *sam_acct) ; 851 NTSTATUS pdb_rename_sam_account(struct samu *oldname, const char *newname); 852 NTSTATUS pdb_update_login_attempts(struct samu *sam_acct, bool success); 853 bool pdb_getgrsid(GROUP_MAP *map, struct dom_sid sid); 854 bool pdb_getgrgid(GROUP_MAP *map, gid_t gid); 855 bool pdb_getgrnam(GROUP_MAP *map, const char *name); 856 NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name, 857 uint32_t *rid); 858 NTSTATUS pdb_delete_dom_group(TALLOC_CTX *mem_ctx, uint32_t rid); 859 NTSTATUS pdb_add_group_mapping_entry(GROUP_MAP *map); 860 NTSTATUS pdb_update_group_mapping_entry(GROUP_MAP *map); 861 NTSTATUS pdb_delete_group_mapping_entry(struct dom_sid sid); 862 bool pdb_enum_group_mapping(const struct dom_sid *sid, 863 enum lsa_SidType sid_name_use, 864 GROUP_MAP ***pp_rmap, 865 size_t *p_num_entries, 866 bool unix_only); 867 NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx, 868 const struct dom_sid *sid, 869 uint32_t **pp_member_rids, 870 size_t *p_num_members); 871 NTSTATUS pdb_enum_group_memberships(TALLOC_CTX *mem_ctx, struct samu *user, 872 struct dom_sid **pp_sids, gid_t **pp_gids, 873 uint32_t *p_num_groups); 874 NTSTATUS pdb_set_unix_primary_group(TALLOC_CTX *mem_ctx, struct samu *user); 875 NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid, 876 uint32_t member_rid); 877 NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid, 878 uint32_t member_rid); 879 NTSTATUS pdb_create_alias(const char *name, uint32_t *rid); 880 NTSTATUS pdb_delete_alias(const struct dom_sid *sid); 881 NTSTATUS pdb_get_aliasinfo(const struct dom_sid *sid, struct acct_info *info); 882 NTSTATUS pdb_set_aliasinfo(const struct dom_sid *sid, struct acct_info *info); 883 NTSTATUS pdb_add_aliasmem(const struct dom_sid *alias, const struct dom_sid *member); 884 NTSTATUS pdb_del_aliasmem(const struct dom_sid *alias, const struct dom_sid *member); 885 NTSTATUS pdb_enum_aliasmem(const struct dom_sid *alias, TALLOC_CTX *mem_ctx, 886 struct dom_sid **pp_members, size_t *p_num_members); 887 NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx, 888 const struct dom_sid *domain_sid, 889 const struct dom_sid *members, size_t num_members, 890 uint32_t **pp_alias_rids, 891 size_t *p_num_alias_rids); 892 NTSTATUS pdb_lookup_rids(const struct dom_sid *domain_sid, 893 int num_rids, 894 uint32_t *rids, 895 const char **names, 896 enum lsa_SidType *attrs); 897 NTSTATUS pdb_lookup_names(const struct dom_sid *domain_sid, 898 int num_names, 899 const char **names, 900 uint32_t *rids, 901 enum lsa_SidType *attrs); 902 bool pdb_get_account_policy(enum pdb_policy_type type, uint32_t *value); 903 bool pdb_set_account_policy(enum pdb_policy_type type, uint32_t value); 904 bool pdb_get_seq_num(time_t *seq_num); 905 /* 906 * Instead of passing down a gid or uid, this function sends down a pointer 907 * to a unixid. 908 * 909 * This acts as an in-out variable so that the idmap functions can correctly 910 * receive ID_TYPE_BOTH, filling in cache details correctly rather than forcing 911 * the cache to store ID_TYPE_UID or ID_TYPE_GID. 912 */ 913 bool pdb_id_to_sid(struct unixid *id, struct dom_sid *sid); 914 bool pdb_sid_to_id(const struct dom_sid *sid, struct unixid *id); 915 uint32_t pdb_capabilities(void); 916 bool pdb_new_rid(uint32_t *rid); 917 bool initialize_password_db(bool reload, struct tevent_context *tevent_ctx); 918 struct pdb_search *pdb_search_init(TALLOC_CTX *mem_ctx, 919 enum pdb_search_type type); 920 struct pdb_search *pdb_search_users(TALLOC_CTX *mem_ctx, uint32_t acct_flags); 921 struct pdb_search *pdb_search_groups(TALLOC_CTX *mem_ctx); 922 struct pdb_search *pdb_search_aliases(TALLOC_CTX *mem_ctx, const struct dom_sid *sid); 923 uint32_t pdb_search_entries(struct pdb_search *search, 924 uint32_t start_idx, uint32_t max_entries, 925 struct samr_displayentry **result); 926 bool pdb_get_trusteddom_pw(const char *domain, char** pwd, struct dom_sid *sid, 927 time_t *pass_last_set_time); 928 NTSTATUS pdb_get_trusteddom_creds(const char *domain, TALLOC_CTX *mem_ctx, 929 struct cli_credentials **creds); 930 bool pdb_set_trusteddom_pw(const char* domain, const char* pwd, 931 const struct dom_sid *sid); 932 bool pdb_del_trusteddom_pw(const char *domain); 933 NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32_t *num_domains, 934 struct trustdom_info ***domains); 935 NTSTATUS pdb_get_trusted_domain(TALLOC_CTX *mem_ctx, const char *domain, 936 struct pdb_trusted_domain **td); 937 NTSTATUS pdb_get_trusted_domain_by_sid(TALLOC_CTX *mem_ctx, struct dom_sid *sid, 938 struct pdb_trusted_domain **td); 939 NTSTATUS pdb_set_trusted_domain(const char* domain, 940 const struct pdb_trusted_domain *td); 941 NTSTATUS pdb_del_trusted_domain(const char *domain); 942 NTSTATUS pdb_enum_trusted_domains(TALLOC_CTX *mem_ctx, uint32_t *num_domains, 943 struct pdb_trusted_domain ***domains); 944 NTSTATUS make_pdb_method( struct pdb_methods **methods ) ; 945 NTSTATUS pdb_get_secret(TALLOC_CTX *mem_ctx, 946 const char *secret_name, 947 DATA_BLOB *secret_current, 948 NTTIME *secret_current_lastchange, 949 DATA_BLOB *secret_old, 950 NTTIME *secret_old_lastchange, 951 struct security_descriptor **sd); 952 NTSTATUS pdb_set_secret(const char *secret_name, 953 DATA_BLOB *secret_current, 954 DATA_BLOB *secret_old, 955 struct security_descriptor *sd); 956 NTSTATUS pdb_delete_secret(const char *secret_name); 957 bool pdb_sid_to_id_unix_users_and_groups(const struct dom_sid *sid, 958 struct unixid *id); 959 960 NTSTATUS pdb_enum_upn_suffixes(TALLOC_CTX *mem_ctx, 961 uint32_t *num_suffixes, 962 char ***suffixes); 963 964 NTSTATUS pdb_set_upn_suffixes(uint32_t num_suffixes, 965 const char **suffixes); 966 bool pdb_is_responsible_for_our_sam(void); 967 bool pdb_is_responsible_for_builtin(void); 968 bool pdb_is_responsible_for_wellknown(void); 969 bool pdb_is_responsible_for_unix_users(void); 970 bool pdb_is_responsible_for_unix_groups(void); 971 bool pdb_is_responsible_for_everything_else(void); 972 973 /* The following definitions come from passdb/pdb_util.c */ 974 975 NTSTATUS pdb_create_builtin(uint32_t rid); 976 NTSTATUS create_builtin_users(const struct dom_sid *sid); 977 NTSTATUS create_builtin_administrators(const struct dom_sid *sid); 978 523 979 #include "passdb/machine_sid.h" 524 980 #include "passdb/lookup_sid.h" 525 981 982 /* The following definitions come from passdb/pdb_unixid.c */ 983 void unixid_from_uid(struct unixid *id, uint32_t some_uid); 984 void unixid_from_gid(struct unixid *id, uint32_t some_gid); 985 void unixid_from_both(struct unixid *id, uint32_t some_id); 986 987 /* The following definitions come from passdb/pdb_secrets.c 988 * and should be used by PDB modules if they need to store 989 * sid/guid information for the domain in secrets database 990 */ 991 bool PDB_secrets_mark_domain_protected(const char *domain); 992 bool PDB_secrets_clear_domain_protection(const char *domain); 993 bool PDB_secrets_store_domain_sid(const char *domain, const struct dom_sid *sid); 994 bool PDB_secrets_fetch_domain_sid(const char *domain, struct dom_sid *sid); 995 bool PDB_secrets_store_domain_guid(const char *domain, struct GUID *guid); 996 bool PDB_secrets_fetch_domain_guid(const char *domain, struct GUID *guid); 997 526 998 #endif /* _PASSDB_H */
Note:
See TracChangeset
for help on using the changeset viewer.