From cba7f8b8273e661d3c43652900d93e5a8eab4e5f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 21 May 2010 11:25:01 +1000 Subject: s3:dom_sid Global replace of DOM_SID with struct dom_sid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This matches the structure that new code is being written to, and removes one more of the old-style named structures, and the need to know that is is just an alias for struct dom_sid. Andrew Bartlett Signed-off-by: Günther Deschner --- examples/pdb/test.c | 2 +- libgpo/gpo_ldap.c | 10 +- source3/auth/auth_util.c | 20 +- source3/auth/server_info.c | 10 +- source3/auth/token_util.c | 48 ++-- source3/groupdb/mapping.c | 48 ++-- source3/groupdb/mapping.h | 18 +- source3/groupdb/mapping_tdb.c | 48 ++-- source3/include/ads_protos.h | 14 +- source3/include/auth.h | 2 +- source3/include/mapping.h | 2 +- source3/include/nss_info.h | 4 +- source3/include/ntquotas.h | 2 +- source3/include/passdb.h | 50 ++--- source3/include/proto.h | 296 ++++++++++++------------- source3/include/secrets.h | 2 +- source3/include/smb.h | 61 +++-- source3/include/smbldap.h | 2 +- source3/include/trans2.h | 2 +- source3/lib/afs.c | 2 +- source3/lib/netapi/samr.c | 2 +- source3/lib/netapi/user.c | 2 +- source3/lib/privileges.c | 30 +-- source3/lib/secdesc.c | 22 +- source3/lib/sharesec.c | 2 +- source3/lib/substitute.c | 2 +- source3/lib/util_nttoken.c | 4 +- source3/lib/util_sid.c | 128 +++++------ source3/lib/winbind_util.c | 46 ++-- source3/libads/ldap.c | 44 ++-- source3/libads/ldap_utils.c | 2 +- source3/libgpo/gpo_proto.h | 4 +- source3/libgpo/gpo_reg.c | 14 +- source3/libnet/libnet_samsync_passdb.c | 16 +- source3/libsmb/clidgram.c | 2 +- source3/libsmb/cliquota.c | 4 +- source3/libsmb/libsmb_xattr.c | 24 +- source3/libsmb/samlogon_cache.c | 8 +- source3/libsmb/trustdom_cache.c | 8 +- source3/libsmb/trusts_util.c | 4 +- source3/modules/nfs4_acls.c | 16 +- source3/modules/onefs_acl.c | 18 +- source3/modules/vfs_afsacl.c | 20 +- source3/passdb/lookup_sid.c | 52 ++--- source3/passdb/machine_sid.c | 22 +- source3/passdb/passdb.c | 4 +- source3/passdb/pdb_ads.c | 56 ++--- source3/passdb/pdb_compat.c | 8 +- source3/passdb/pdb_get_set.c | 22 +- source3/passdb/pdb_interface.c | 88 ++++---- source3/passdb/pdb_ldap.c | 102 ++++----- source3/passdb/pdb_smbpasswd.c | 2 +- source3/passdb/pdb_tdb.c | 2 +- source3/passdb/pdb_wbc_sam.c | 40 ++-- source3/passdb/secrets.c | 4 +- source3/passdb/util_builtin.c | 6 +- source3/passdb/util_unixsids.c | 20 +- source3/passdb/util_wellknown.c | 14 +- source3/printing/nt_printing.c | 12 +- source3/rpc_client/cli_lsarpc.c | 20 +- source3/rpc_client/cli_lsarpc.h | 10 +- source3/rpc_server/srv_lsa_nt.c | 34 +-- source3/rpc_server/srv_samr_nt.c | 50 ++--- source3/rpc_server/srv_spoolss_util.c | 4 +- source3/rpcclient/cmd_lsarpc.c | 30 +-- source3/rpcclient/cmd_samr.c | 8 +- source3/rpcclient/rpcclient.c | 2 +- source3/smbd/ntquotas.c | 6 +- source3/smbd/nttrans.c | 6 +- source3/smbd/posix_acls.c | 38 ++-- source3/smbd/service.c | 4 +- source3/smbd/share_access.c | 2 +- source3/utils/net.c | 8 +- source3/utils/net.h | 4 +- source3/utils/net_ads.c | 4 +- source3/utils/net_groupmap.c | 28 +-- source3/utils/net_idmap.c | 2 +- source3/utils/net_lookup.c | 4 +- source3/utils/net_printing.c | 2 +- source3/utils/net_proto.h | 52 ++--- source3/utils/net_rpc.c | 126 +++++------ source3/utils/net_rpc_audit.c | 10 +- source3/utils/net_rpc_join.c | 2 +- source3/utils/net_rpc_printer.c | 22 +- source3/utils/net_rpc_registry.c | 20 +- source3/utils/net_rpc_rights.c | 22 +- source3/utils/net_rpc_samsync.c | 10 +- source3/utils/net_rpc_service.c | 16 +- source3/utils/net_sam.c | 38 ++-- source3/utils/net_usershare.c | 2 +- source3/utils/net_util.c | 4 +- source3/utils/netlookup.c | 6 +- source3/utils/pdbedit.c | 16 +- source3/utils/profiles.c | 4 +- source3/utils/sharesec.c | 4 +- source3/utils/smbcacls.c | 20 +- source3/utils/smbcquotas.c | 6 +- source3/winbindd/idmap_ad.c | 8 +- source3/winbindd/idmap_adex/cell_util.c | 2 +- source3/winbindd/idmap_adex/domain_util.c | 2 +- source3/winbindd/idmap_adex/gc_util.c | 4 +- source3/winbindd/idmap_adex/idmap_adex.c | 4 +- source3/winbindd/idmap_adex/idmap_adex.h | 16 +- source3/winbindd/idmap_adex/likewise_cell.c | 2 +- source3/winbindd/idmap_adex/provider_unified.c | 20 +- source3/winbindd/idmap_hash/idmap_hash.c | 10 +- source3/winbindd/idmap_ldap.c | 4 +- source3/winbindd/idmap_tdb.c | 4 +- source3/winbindd/idmap_util.c | 8 +- source3/winbindd/nss_info.c | 2 +- source3/winbindd/nss_info_template.c | 2 +- source3/winbindd/winbindd.h | 36 +-- source3/winbindd/winbindd_ads.c | 48 ++-- source3/winbindd/winbindd_async.c | 6 +- source3/winbindd/winbindd_cache.c | 64 +++--- source3/winbindd/winbindd_creds.c | 8 +- source3/winbindd/winbindd_pam.c | 10 +- source3/winbindd/winbindd_passdb.c | 28 +-- source3/winbindd/winbindd_proto.h | 48 ++-- source3/winbindd/winbindd_reconnect.c | 18 +- source3/winbindd/winbindd_rpc.c | 30 +-- source3/winbindd/winbindd_util.c | 24 +- source4/torture/unix/whoami.c | 2 +- testsuite/printing/psec.c | 6 +- testsuite/smbd/se_access_check_utils.c | 6 +- 125 files changed, 1290 insertions(+), 1297 deletions(-) diff --git a/examples/pdb/test.c b/examples/pdb/test.c index b5ddefc480..568b448d28 100644 --- a/examples/pdb/test.c +++ b/examples/pdb/test.c @@ -67,7 +67,7 @@ static NTSTATUS testsam_getsampwnam (struct pdb_methods *methods, struct samu *u Search by sid **************************************************************************/ -static NTSTATUS testsam_getsampwsid (struct pdb_methods *methods, struct samu *user, const DOM_SID *sid) +static NTSTATUS testsam_getsampwsid (struct pdb_methods *methods, struct samu *user, const struct dom_sid *sid) { DEBUG(10, ("testsam_getsampwsid called\n")); return NT_STATUS_NOT_IMPLEMENTED; diff --git a/libgpo/gpo_ldap.c b/libgpo/gpo_ldap.c index fe14c5e49a..66e90fb0c9 100644 --- a/libgpo/gpo_ldap.c +++ b/libgpo/gpo_ldap.c @@ -622,11 +622,11 @@ ADS_STATUS ads_get_sid_token(ADS_STRUCT *ads, NT_USER_TOKEN **token) { ADS_STATUS status; - DOM_SID object_sid; - DOM_SID primary_group_sid; - DOM_SID *ad_token_sids; + struct dom_sid object_sid; + struct dom_sid primary_group_sid; + struct dom_sid *ad_token_sids; size_t num_ad_token_sids = 0; - DOM_SID *token_sids; + struct dom_sid *token_sids; size_t num_token_sids = 0; NT_USER_TOKEN *new_token = NULL; int i; @@ -638,7 +638,7 @@ ADS_STATUS ads_get_sid_token(ADS_STRUCT *ads, return status; } - token_sids = TALLOC_ARRAY(mem_ctx, DOM_SID, 1); + token_sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, 1); ADS_ERROR_HAVE_NO_MEMORY(token_sids); status = ADS_ERROR_NT(add_sid_to_array_unique(mem_ctx, diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index 34c8190ee8..ad454b6df1 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -35,7 +35,7 @@ ****************************************************************************/ static void sort_sid_array_for_smbd(struct auth_serversupplied_info *result, - const DOM_SID *pgroup_sid) + const struct dom_sid *pgroup_sid) { unsigned int i; @@ -504,7 +504,7 @@ NTSTATUS create_local_token(struct auth_serversupplied_info *server_info) for (i=1; iptok->num_sids; i++) { gid_t gid; - DOM_SID *sid = &server_info->ptok->user_sids[i]; + struct dom_sid *sid = &server_info->ptok->user_sids[i]; if (!sid_to_gid(sid, &gid)) { DEBUG(10, ("Could not convert SID %s to gid, " @@ -573,7 +573,7 @@ NTSTATUS make_server_info_pw(struct auth_serversupplied_info **server_info, gid_t *gids; char *qualified_name = NULL; TALLOC_CTX *mem_ctx = NULL; - DOM_SID u_sid; + struct dom_sid u_sid; enum lsa_SidType type; struct auth_serversupplied_info *result; @@ -689,7 +689,7 @@ static NTSTATUS make_new_server_info_guest(struct auth_serversupplied_info **ser { NTSTATUS status; struct samu *sampass = NULL; - DOM_SID guest_sid; + struct dom_sid guest_sid; bool ret; static const char zeros[16] = {0, }; fstring tmp; @@ -1052,8 +1052,8 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx, const char *nt_domain; const char *nt_username; struct samu *sam_account = NULL; - DOM_SID user_sid; - DOM_SID group_sid; + struct dom_sid user_sid; + struct dom_sid group_sid; bool username_was_mapped; uid_t uid = (uid_t)-1; @@ -1301,8 +1301,8 @@ NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx, const char *nt_domain; const char *nt_username; struct samu *sam_account = NULL; - DOM_SID user_sid; - DOM_SID group_sid; + struct dom_sid user_sid; + struct dom_sid group_sid; bool username_was_mapped; uint32_t i; @@ -1489,7 +1489,7 @@ NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx, /* Create a 'combined' list of all SIDs we might want in the SD */ result->num_sids = info->num_sids - 2; - result->sids = talloc_array(result, DOM_SID, result->num_sids); + result->sids = talloc_array(result, struct dom_sid, result->num_sids); if (result->sids == NULL) { TALLOC_FREE(result); return NT_STATUS_NO_MEMORY; @@ -1537,7 +1537,7 @@ NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx, bool is_trusted_domain(const char* dom_name) { - DOM_SID trustdom_sid; + struct dom_sid trustdom_sid; bool ret; /* no trusted domains for a standalone server */ diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c index 767ae5e7b6..9d593fa8c8 100644 --- a/source3/auth/server_info.c +++ b/source3/auth/server_info.c @@ -60,9 +60,9 @@ struct auth_serversupplied_info *make_server_info(TALLOC_CTX *mem_ctx) ********************************************************************/ static NTSTATUS nt_token_to_group_list(TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, size_t num_sids, - const DOM_SID *sids, + const struct dom_sid *sids, int *numgroups, struct samr_RidWithAttribute **pgids) { @@ -99,9 +99,9 @@ static NTSTATUS serverinfo_to_SamInfo_base(TALLOC_CTX *mem_ctx, { struct samu *sampw; struct samr_RidWithAttribute *gids = NULL; - const DOM_SID *user_sid = NULL; - const DOM_SID *group_sid = NULL; - DOM_SID domain_sid; + const struct dom_sid *user_sid = NULL; + const struct dom_sid *group_sid = NULL; + struct dom_sid domain_sid; uint32 user_rid, group_rid; NTSTATUS status; diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c index 8e710fdd62..d2a03b4031 100644 --- a/source3/auth/token_util.c +++ b/source3/auth/token_util.c @@ -30,7 +30,7 @@ Check for a SID in an NT_USER_TOKEN ****************************************************************************/ -bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token ) +bool nt_token_check_sid ( const struct dom_sid *sid, const NT_USER_TOKEN *token ) { int i; @@ -47,7 +47,7 @@ bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token ) bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid ) { - DOM_SID domain_sid; + struct dom_sid domain_sid; /* if we are a domain member, the get the domain SID, else for a DC or standalone server, use our own SID */ @@ -78,7 +78,7 @@ bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid ) NT_USER_TOKEN *get_root_nt_token( void ) { struct nt_user_token *token, *for_cache; - DOM_SID u_sid, g_sid; + struct dom_sid u_sid, g_sid; struct passwd *pw; void *cache_data; @@ -124,7 +124,7 @@ NT_USER_TOKEN *get_root_nt_token( void ) * Add alias SIDs from memberships within the partially created token SID list */ -NTSTATUS add_aliases(const DOM_SID *domain_sid, +NTSTATUS add_aliases(const struct dom_sid *domain_sid, struct nt_user_token *token) { uint32 *aliases; @@ -151,7 +151,7 @@ NTSTATUS add_aliases(const DOM_SID *domain_sid, } for (i=0; iuser_sids, @@ -171,9 +171,9 @@ done: *******************************************************************/ static NTSTATUS add_builtin_administrators(struct nt_user_token *token, - const DOM_SID *dom_sid) + const struct dom_sid *dom_sid) { - DOM_SID domadm; + struct dom_sid domadm; NTSTATUS status; /* nothing to do if we aren't in a domain */ @@ -215,7 +215,7 @@ static NTSTATUS add_builtin_administrators(struct nt_user_token *token, static NTSTATUS create_builtin(uint32 rid) { NTSTATUS status = NT_STATUS_OK; - DOM_SID sid; + struct dom_sid sid; gid_t gid; if (!sid_compose(&sid, &global_sid_Builtin, rid)) { @@ -238,8 +238,8 @@ static NTSTATUS create_builtin(uint32 rid) * @param[in] dom_sid sid to add as a member of builtin_sid. * @return Normal NTSTATUS return */ -static NTSTATUS add_sid_to_builtin(const DOM_SID *builtin_sid, - const DOM_SID *dom_sid) +static NTSTATUS add_sid_to_builtin(const struct dom_sid *builtin_sid, + const struct dom_sid *dom_sid) { NTSTATUS status = NT_STATUS_OK; @@ -267,10 +267,10 @@ static NTSTATUS add_sid_to_builtin(const DOM_SID *builtin_sid, /******************************************************************* *******************************************************************/ -NTSTATUS create_builtin_users(const DOM_SID *dom_sid) +NTSTATUS create_builtin_users(const struct dom_sid *dom_sid) { NTSTATUS status; - DOM_SID dom_users; + struct dom_sid dom_users; status = create_builtin(BUILTIN_RID_USERS); if ( !NT_STATUS_IS_OK(status) ) { @@ -292,10 +292,10 @@ NTSTATUS create_builtin_users(const DOM_SID *dom_sid) /******************************************************************* *******************************************************************/ -NTSTATUS create_builtin_administrators(const DOM_SID *dom_sid) +NTSTATUS create_builtin_administrators(const struct dom_sid *dom_sid) { NTSTATUS status; - DOM_SID dom_admins, root_sid; + struct dom_sid dom_admins, root_sid; fstring root_name; enum lsa_SidType type; TALLOC_CTX *ctx; @@ -341,16 +341,16 @@ NTSTATUS create_builtin_administrators(const DOM_SID *dom_sid) *******************************************************************/ struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx, - const DOM_SID *user_sid, + const struct dom_sid *user_sid, bool is_guest, int num_groupsids, - const DOM_SID *groupsids) + const struct dom_sid *groupsids) { struct nt_user_token *result = NULL; int i; NTSTATUS status; gid_t gid; - DOM_SID dom_sid; + struct dom_sid dom_sid; DEBUG(10, ("Create local NT token for %s\n", sid_string_dbg(user_sid))); @@ -585,11 +585,11 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username, { NTSTATUS result = NT_STATUS_NO_SUCH_USER; TALLOC_CTX *tmp_ctx = talloc_stackframe(); - DOM_SID user_sid; + struct dom_sid user_sid; enum lsa_SidType type; gid_t *gids; - DOM_SID *group_sids; - DOM_SID unix_group_sid; + struct dom_sid *group_sids; + struct dom_sid unix_group_sid; size_t num_group_sids; size_t num_gids; size_t i; @@ -715,7 +715,7 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username, } if (num_group_sids) { - group_sids = TALLOC_ARRAY(tmp_ctx, DOM_SID, num_group_sids); + group_sids = TALLOC_ARRAY(tmp_ctx, struct dom_sid, num_group_sids); if (group_sids == NULL) { DEBUG(1, ("TALLOC_ARRAY failed\n")); result = NT_STATUS_NO_MEMORY; @@ -756,7 +756,7 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username, } num_group_sids = 1; - group_sids = TALLOC_ARRAY(tmp_ctx, DOM_SID, num_group_sids); + group_sids = TALLOC_ARRAY(tmp_ctx, struct dom_sid, num_group_sids); if (group_sids == NULL) { DEBUG(1, ("TALLOC_ARRAY failed\n")); result = NT_STATUS_NO_MEMORY; @@ -829,7 +829,7 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username, member of a particular group. ***************************************************************************/ -bool user_in_group_sid(const char *username, const DOM_SID *group_sid) +bool user_in_group_sid(const char *username, const struct dom_sid *group_sid) { NTSTATUS status; uid_t uid; @@ -858,7 +858,7 @@ bool user_in_group_sid(const char *username, const DOM_SID *group_sid) bool user_in_group(const char *username, const char *groupname) { TALLOC_CTX *mem_ctx = talloc_stackframe(); - DOM_SID group_sid; + struct dom_sid group_sid; bool ret; ret = lookup_name(mem_ctx, groupname, LOOKUP_NAME_ALL, diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c index da5a866619..4cfe9957f4 100644 --- a/source3/groupdb/mapping.c +++ b/source3/groupdb/mapping.c @@ -65,8 +65,8 @@ NTSTATUS add_initial_entry(gid_t gid, const char *sid, enum lsa_SidType sid_name return pdb_add_group_mapping_entry(&map); } -static NTSTATUS alias_memberships(const DOM_SID *members, size_t num_members, - DOM_SID **sids, size_t *num) +static NTSTATUS alias_memberships(const struct dom_sid *members, size_t num_members, + struct dom_sid **sids, size_t *num) { size_t i; @@ -82,8 +82,8 @@ static NTSTATUS alias_memberships(const DOM_SID *members, size_t num_members, } struct aliasmem_closure { - const DOM_SID *alias; - DOM_SID **sids; + const struct dom_sid *alias; + struct dom_sid **sids; size_t *num; }; @@ -101,7 +101,7 @@ struct aliasmem_closure { /* get a domain group from it's SID */ -bool get_domain_group_from_sid(DOM_SID sid, GROUP_MAP *map) +bool get_domain_group_from_sid(struct dom_sid sid, GROUP_MAP *map) { struct group *grp; bool ret; @@ -381,7 +381,7 @@ int smb_delete_user_group(const char *unix_group, const char *unix_user) NTSTATUS pdb_default_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, - DOM_SID sid) + struct dom_sid sid) { if (!init_group_mapping()) { DEBUG(0,("failed to initialize group mapping\n")); @@ -436,7 +436,7 @@ NTSTATUS pdb_default_update_group_mapping_entry(struct pdb_methods *methods, } NTSTATUS pdb_default_delete_group_mapping_entry(struct pdb_methods *methods, - DOM_SID sid) + struct dom_sid sid) { if (!init_group_mapping()) { DEBUG(0,("failed to initialize group mapping\n")); @@ -447,7 +447,7 @@ NTSTATUS pdb_default_delete_group_mapping_entry(struct pdb_methods *methods, } NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods, - const DOM_SID *sid, enum lsa_SidType sid_name_use, + const struct dom_sid *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, bool unix_only) { @@ -462,7 +462,7 @@ NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods, NTSTATUS pdb_default_create_alias(struct pdb_methods *methods, const char *name, uint32 *rid) { - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; uint32 new_rid; gid_t gid; @@ -521,13 +521,13 @@ NTSTATUS pdb_default_create_alias(struct pdb_methods *methods, } NTSTATUS pdb_default_delete_alias(struct pdb_methods *methods, - const DOM_SID *sid) + const struct dom_sid *sid) { return pdb_delete_group_mapping_entry(*sid); } NTSTATUS pdb_default_get_aliasinfo(struct pdb_methods *methods, - const DOM_SID *sid, + const struct dom_sid *sid, struct acct_info *info) { GROUP_MAP map; @@ -550,7 +550,7 @@ NTSTATUS pdb_default_get_aliasinfo(struct pdb_methods *methods, } NTSTATUS pdb_default_set_aliasinfo(struct pdb_methods *methods, - const DOM_SID *sid, + const struct dom_sid *sid, struct acct_info *info) { GROUP_MAP map; @@ -565,7 +565,7 @@ NTSTATUS pdb_default_set_aliasinfo(struct pdb_methods *methods, } NTSTATUS pdb_default_add_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, const DOM_SID *member) + const struct dom_sid *alias, const struct dom_sid *member) { if (!init_group_mapping()) { DEBUG(0,("failed to initialize group mapping\n")); @@ -575,7 +575,7 @@ NTSTATUS pdb_default_add_aliasmem(struct pdb_methods *methods, } NTSTATUS pdb_default_del_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, const DOM_SID *member) + const struct dom_sid *alias, const struct dom_sid *member) { if (!init_group_mapping()) { DEBUG(0,("failed to initialize group mapping\n")); @@ -585,8 +585,8 @@ NTSTATUS pdb_default_del_aliasmem(struct pdb_methods *methods, } NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, TALLOC_CTX *mem_ctx, - DOM_SID **pp_members, size_t *p_num_members) + const struct dom_sid *alias, TALLOC_CTX *mem_ctx, + struct dom_sid **pp_members, size_t *p_num_members) { if (!init_group_mapping()) { DEBUG(0,("failed to initialize group mapping\n")); @@ -598,13 +598,13 @@ NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods, NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, - const DOM_SID *members, + const struct dom_sid *domain_sid, + const struct dom_sid *members, size_t num_members, uint32 **pp_alias_rids, size_t *p_num_alias_rids) { - DOM_SID *alias_sids; + struct dom_sid *alias_sids; size_t i, num_alias_sids; NTSTATUS result; @@ -650,7 +650,7 @@ NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods, *********************************************************************/ NTSTATUS pdb_nop_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, - DOM_SID sid) + struct dom_sid sid) { return NT_STATUS_UNSUCCESSFUL; } @@ -680,7 +680,7 @@ NTSTATUS pdb_nop_update_group_mapping_entry(struct pdb_methods *methods, } NTSTATUS pdb_nop_delete_group_mapping_entry(struct pdb_methods *methods, - DOM_SID sid) + struct dom_sid sid) { return NT_STATUS_UNSUCCESSFUL; } @@ -696,7 +696,7 @@ NTSTATUS pdb_nop_enum_group_mapping(struct pdb_methods *methods, /**************************************************************************** These need to be redirected through pdb_interface.c ****************************************************************************/ -bool pdb_get_dom_grp_info(const DOM_SID *sid, struct acct_info *info) +bool pdb_get_dom_grp_info(const struct dom_sid *sid, struct acct_info *info) { GROUP_MAP map; bool res; @@ -714,7 +714,7 @@ bool pdb_get_dom_grp_info(const DOM_SID *sid, struct acct_info *info) return True; } -bool pdb_set_dom_grp_info(const DOM_SID *sid, const struct acct_info *info) +bool pdb_set_dom_grp_info(const struct dom_sid *sid, const struct acct_info *info) { GROUP_MAP map; @@ -733,7 +733,7 @@ bool pdb_set_dom_grp_info(const DOM_SID *sid, const struct acct_info *info) NTSTATUS pdb_create_builtin_alias(uint32 rid) { - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; gid_t gid; GROUP_MAP map; diff --git a/source3/groupdb/mapping.h b/source3/groupdb/mapping.h index 6bb490a7a4..045721d67e 100644 --- a/source3/groupdb/mapping.h +++ b/source3/groupdb/mapping.h @@ -40,17 +40,17 @@ struct mapping_backend { bool (*init_group_mapping)(void); bool (*add_mapping_entry)(GROUP_MAP *map, int flag); - bool (*get_group_map_from_sid)(DOM_SID sid, GROUP_MAP *map); + bool (*get_group_map_from_sid)(struct dom_sid sid, GROUP_MAP *map); bool (*get_group_map_from_gid)(gid_t gid, GROUP_MAP *map); bool (*get_group_map_from_ntname)(const char *name, GROUP_MAP *map); - bool (*group_map_remove)(const DOM_SID *sid); - bool (*enum_group_mapping)(const DOM_SID *domsid, enum lsa_SidType sid_name_use, + bool (*group_map_remove)(const struct dom_sid *sid); + bool (*enum_group_mapping)(const struct dom_sid *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, bool unix_only); - NTSTATUS (*one_alias_membership)(const DOM_SID *member, - DOM_SID **sids, size_t *num); - NTSTATUS (*add_aliasmem)(const DOM_SID *alias, const DOM_SID *member); - NTSTATUS (*del_aliasmem)(const DOM_SID *alias, const DOM_SID *member); - NTSTATUS (*enum_aliasmem)(const DOM_SID *alias, TALLOC_CTX *mem_ctx, - DOM_SID **sids, size_t *num); + NTSTATUS (*one_alias_membership)(const struct dom_sid *member, + struct dom_sid **sids, size_t *num); + NTSTATUS (*add_aliasmem)(const struct dom_sid *alias, const struct dom_sid *member); + NTSTATUS (*del_aliasmem)(const struct dom_sid *alias, const struct dom_sid *member); + NTSTATUS (*enum_aliasmem)(const struct dom_sid *alias, TALLOC_CTX *mem_ctx, + struct dom_sid **sids, size_t *num); }; diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c index 896ad456cd..f608e2e514 100644 --- a/source3/groupdb/mapping_tdb.c +++ b/source3/groupdb/mapping_tdb.c @@ -25,12 +25,12 @@ static struct db_context *db; /* used for driver files */ -static bool enum_group_mapping(const DOM_SID *domsid, +static bool enum_group_mapping(const struct dom_sid *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, bool unix_only); -static bool group_map_remove(const DOM_SID *sid); +static bool group_map_remove(const struct dom_sid *sid); static bool mapping_switch(const char *ldb_path); @@ -109,7 +109,7 @@ static bool init_group_mapping(void) return true; } -static char *group_mapping_key(TALLOC_CTX *mem_ctx, const DOM_SID *sid) +static char *group_mapping_key(TALLOC_CTX *mem_ctx, const struct dom_sid *sid) { char *sidstr, *result; @@ -162,7 +162,7 @@ static bool add_mapping_entry(GROUP_MAP *map, int flag) Return the sid and the type of the unix group. ****************************************************************************/ -static bool get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map) +static bool get_group_map_from_sid(struct dom_sid sid, GROUP_MAP *map) { TDB_DATA dbuf; char *key; @@ -286,7 +286,7 @@ static bool get_group_map_from_ntname(const char *name, GROUP_MAP *map) Remove a group mapping entry. ****************************************************************************/ -static bool group_map_remove(const DOM_SID *sid) +static bool group_map_remove(const struct dom_sid *sid) { char *key; NTSTATUS status; @@ -307,7 +307,7 @@ static bool group_map_remove(const DOM_SID *sid) ****************************************************************************/ struct enum_map_state { - const DOM_SID *domsid; + const struct dom_sid *domsid; enum lsa_SidType sid_name_use; bool unix_only; @@ -358,7 +358,7 @@ static int collect_map(struct db_record *rec, void *private_data) return 0; } -static bool enum_group_mapping(const DOM_SID *domsid, +static bool enum_group_mapping(const struct dom_sid *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, bool unix_only) @@ -384,8 +384,8 @@ static bool enum_group_mapping(const DOM_SID *domsid, /* This operation happens on session setup, so it should better be fast. We * store a list of aliases a SID is member of hanging off MEMBEROF/SID. */ -static NTSTATUS one_alias_membership(const DOM_SID *member, - DOM_SID **sids, size_t *num) +static NTSTATUS one_alias_membership(const struct dom_sid *member, + struct dom_sid **sids, size_t *num) { fstring tmp; fstring key; @@ -407,7 +407,7 @@ static NTSTATUS one_alias_membership(const DOM_SID *member, p = (const char *)dbuf.dptr; while (next_token_talloc(frame, &p, &string_sid, " ")) { - DOM_SID alias; + struct dom_sid alias; if (!string_to_sid(&alias, string_sid)) continue; @@ -423,8 +423,8 @@ done: return status; } -static NTSTATUS alias_memberships(const DOM_SID *members, size_t num_members, - DOM_SID **sids, size_t *num) +static NTSTATUS alias_memberships(const struct dom_sid *members, size_t num_members, + struct dom_sid **sids, size_t *num) { size_t i; @@ -439,9 +439,9 @@ static NTSTATUS alias_memberships(const DOM_SID *members, size_t num_members, return NT_STATUS_OK; } -static bool is_aliasmem(const DOM_SID *alias, const DOM_SID *member) +static bool is_aliasmem(const struct dom_sid *alias, const struct dom_sid *member) { - DOM_SID *sids; + struct dom_sid *sids; size_t i, num; /* This feels the wrong way round, but the on-disk data structure @@ -460,7 +460,7 @@ static bool is_aliasmem(const DOM_SID *alias, const DOM_SID *member) } -static NTSTATUS add_aliasmem(const DOM_SID *alias, const DOM_SID *member) +static NTSTATUS add_aliasmem(const struct dom_sid *alias, const struct dom_sid *member) { GROUP_MAP map; char *key; @@ -543,8 +543,8 @@ static NTSTATUS add_aliasmem(const DOM_SID *alias, const DOM_SID *member) struct aliasmem_state { TALLOC_CTX *mem_ctx; - const DOM_SID *alias; - DOM_SID **sids; + const struct dom_sid *alias; + struct dom_sid **sids; size_t *num; }; @@ -564,7 +564,7 @@ static int collect_aliasmem(struct db_record *rec, void *priv) frame = talloc_stackframe(); while (next_token_talloc(frame, &p, &alias_string, " ")) { - DOM_SID alias, member; + struct dom_sid alias, member; const char *member_string; if (!string_to_sid(&alias, alias_string)) @@ -601,8 +601,8 @@ static int collect_aliasmem(struct db_record *rec, void *priv) return 0; } -static NTSTATUS enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, - DOM_SID **sids, size_t *num) +static NTSTATUS enum_aliasmem(const struct dom_sid *alias, TALLOC_CTX *mem_ctx, + struct dom_sid **sids, size_t *num) { GROUP_MAP map; struct aliasmem_state state; @@ -626,10 +626,10 @@ static NTSTATUS enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } -static NTSTATUS del_aliasmem(const DOM_SID *alias, const DOM_SID *member) +static NTSTATUS del_aliasmem(const struct dom_sid *alias, const struct dom_sid *member) { NTSTATUS status; - DOM_SID *sids; + struct dom_sid *sids; size_t i, num; bool found = False; char *member_string; @@ -760,7 +760,7 @@ static int convert_ldb_record(TDB_CONTEXT *ltdb, TDB_DATA key, char *val; char *q; uint32_t num_mem = 0; - DOM_SID *members = NULL; + struct dom_sid *members = NULL; p = (uint8_t *)data.dptr; if (data.dsize < 8) { @@ -839,7 +839,7 @@ static int convert_ldb_record(TDB_CONTEXT *ltdb, TDB_DATA key, num_vals = pull_uint32(p, 0); if (StrCaseCmp(name, "member") == 0) { num_mem = num_vals; - members = talloc_array(tmp_ctx, DOM_SID, num_mem); + members = talloc_array(tmp_ctx, struct dom_sid, num_mem); if (members == NULL) { errno = ENOMEM; goto failed; diff --git a/source3/include/ads_protos.h b/source3/include/ads_protos.h index dc7922f587..09eaf99cfb 100644 --- a/source3/include/ads_protos.h +++ b/source3/include/ads_protos.h @@ -22,9 +22,9 @@ bool ads_pull_uint32(ADS_STRUCT *ads, LDAPMessage *msg, const char *field, uint32 *v); bool ads_pull_guid(ADS_STRUCT *ads, LDAPMessage *msg, struct GUID *guid); bool ads_pull_sid(ADS_STRUCT *ads, LDAPMessage *msg, const char *field, - DOM_SID *sid); + struct dom_sid *sid); int ads_pull_sids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, - LDAPMessage *msg, const char *field, DOM_SID **sids); + LDAPMessage *msg, const char *field, struct dom_sid **sids); bool ads_pull_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, LDAPMessage *msg, const char *field, struct security_descriptor **sd); char *ads_pull_username(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, @@ -34,7 +34,7 @@ int ads_pull_sids_from_extendeddn(ADS_STRUCT *ads, LDAPMessage *msg, const char *field, enum ads_extended_dn_flags flags, - DOM_SID **sids); + struct dom_sid **sids); ADS_STATUS ads_find_machine_acct(ADS_STRUCT *ads, LDAPMessage **res, const char *machine); @@ -83,7 +83,7 @@ ADS_STATUS ads_search_retry_extended_dn_ranged(ADS_STRUCT *ads, TALLOC_CTX *mem_ char ***strings, size_t *num_strings); ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res, - const DOM_SID *sid, + const struct dom_sid *sid, const char **attrs); @@ -113,9 +113,9 @@ ADS_STATUS ads_do_search_all_sd_flags(ADS_STRUCT *ads, const char *bind_path, ADS_STATUS ads_get_tokensids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char *dn, - DOM_SID *user_sid, - DOM_SID *primary_group_sid, - DOM_SID **sids, + struct dom_sid *user_sid, + struct dom_sid *primary_group_sid, + struct dom_sid **sids, size_t *num_sids); ADS_STATUS ads_get_joinable_ous(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, diff --git a/source3/include/auth.h b/source3/include/auth.h index 09ad631936..9f49fcc478 100644 --- a/source3/include/auth.h +++ b/source3/include/auth.h @@ -43,7 +43,7 @@ struct auth_usersupplied_info { struct auth_serversupplied_info { bool guest; - DOM_SID *sids; /* These SIDs are preliminary between + struct dom_sid *sids; /* These SIDs are preliminary between check_ntlm_password and the token creation. */ size_t num_sids; diff --git a/source3/include/mapping.h b/source3/include/mapping.h index 75459fcebd..bd95859bff 100644 --- a/source3/include/mapping.h +++ b/source3/include/mapping.h @@ -24,7 +24,7 @@ typedef struct _GROUP_MAP { struct pdb_methods *methods; gid_t gid; - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType sid_name_use; fstring nt_name; fstring comment; diff --git a/source3/include/nss_info.h b/source3/include/nss_info.h index 7514289889..9b910ca256 100644 --- a/source3/include/nss_info.h +++ b/source3/include/nss_info.h @@ -62,7 +62,7 @@ struct nss_domain_entry { struct nss_info_methods { NTSTATUS (*init)( struct nss_domain_entry *e ); NTSTATUS (*get_nss_info)( struct nss_domain_entry *e, - const DOM_SID *sid, + const struct dom_sid *sid, TALLOC_CTX *ctx, ADS_STRUCT *ads, LDAPMessage *msg, const char **homedir, const char **shell, @@ -83,7 +83,7 @@ NTSTATUS smb_register_idmap_nss(int version, const char *name, struct nss_info_methods *methods); -NTSTATUS nss_get_info( const char *domain, const DOM_SID *user_sid, +NTSTATUS nss_get_info( const char *domain, const struct dom_sid *user_sid, TALLOC_CTX *ctx, ADS_STRUCT *ads, LDAPMessage *msg, const char **homedir, const char **shell, diff --git a/source3/include/ntquotas.h b/source3/include/ntquotas.h index 9aa8b9139e..cd460260da 100644 --- a/source3/include/ntquotas.h +++ b/source3/include/ntquotas.h @@ -72,7 +72,7 @@ typedef struct _SMB_NTQUOTA_STRUCT { uint64_t softlim; uint64_t hardlim; uint32 qflags; - DOM_SID sid; + struct dom_sid sid; } SMB_NTQUOTA_STRUCT; typedef struct _SMB_NTQUOTA_LIST { diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 860eff9b20..08377010d4 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -145,8 +145,8 @@ struct samu { const char *comment; const char *munged_dial; /* munged path name and dial-back tel number */ - DOM_SID user_sid; - DOM_SID *group_sid; + struct dom_sid user_sid; + struct dom_sid *group_sid; DATA_BLOB lm_pw; /* .data is Null if no password */ DATA_BLOB nt_pw; /* .data is Null if no password */ @@ -267,7 +267,7 @@ struct pdb_methods NTSTATUS (*getsampwnam)(struct pdb_methods *, struct samu *sam_acct, const char *username); - NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const DOM_SID *sid); + NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const struct dom_sid *sid); NTSTATUS (*create_user)(struct pdb_methods *, TALLOC_CTX *tmp_ctx, const char *name, uint32_t acct_flags, @@ -286,7 +286,7 @@ struct pdb_methods NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, struct samu *sam_acct, bool success); - NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SID sid); + NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, struct dom_sid sid); NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, gid_t gid); @@ -306,23 +306,23 @@ struct pdb_methods GROUP_MAP *map); NTSTATUS (*delete_group_mapping_entry)(struct pdb_methods *methods, - DOM_SID sid); + struct dom_sid sid); NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, - const DOM_SID *sid, enum lsa_SidType sid_name_use, + const struct dom_sid *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, bool unix_only); NTSTATUS (*enum_group_members)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - const DOM_SID *group, + const struct dom_sid *group, uint32_t **pp_member_rids, size_t *p_num_members); NTSTATUS (*enum_group_memberships)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, struct samu *user, - DOM_SID **pp_sids, gid_t **pp_gids, + struct dom_sid **pp_sids, gid_t **pp_gids, size_t *p_num_groups); NTSTATUS (*set_unix_primary_group)(struct pdb_methods *methods, @@ -341,40 +341,40 @@ struct pdb_methods const char *name, uint32_t *rid); NTSTATUS (*delete_alias)(struct pdb_methods *methods, - const DOM_SID *sid); + const struct dom_sid *sid); NTSTATUS (*get_aliasinfo)(struct pdb_methods *methods, - const DOM_SID *sid, + const struct dom_sid *sid, struct acct_info *info); NTSTATUS (*set_aliasinfo)(struct pdb_methods *methods, - const DOM_SID *sid, + const struct dom_sid *sid, struct acct_info *info); NTSTATUS (*add_aliasmem)(struct pdb_methods *methods, - const DOM_SID *alias, const DOM_SID *member); + const struct dom_sid *alias, const struct dom_sid *member); NTSTATUS (*del_aliasmem)(struct pdb_methods *methods, - const DOM_SID *alias, const DOM_SID *member); + const struct dom_sid *alias, const struct dom_sid *member); NTSTATUS (*enum_aliasmem)(struct pdb_methods *methods, - const DOM_SID *alias, TALLOC_CTX *mem_ctx, - DOM_SID **members, size_t *p_num_members); + const struct dom_sid *alias, TALLOC_CTX *mem_ctx, + struct dom_sid **members, size_t *p_num_members); NTSTATUS (*enum_alias_memberships)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, - const DOM_SID *members, + const struct dom_sid *domain_sid, + const struct dom_sid *members, size_t num_members, uint32_t **pp_alias_rids, size_t *p_num_alias_rids); NTSTATUS (*lookup_rids)(struct pdb_methods *methods, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, int num_rids, uint32_t *rids, const char **pp_names, enum lsa_SidType *attrs); NTSTATUS (*lookup_names)(struct pdb_methods *methods, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, int num_names, const char **pp_names, uint32_t *rids, @@ -397,13 +397,13 @@ struct pdb_methods struct pdb_search *search); bool (*search_aliases)(struct pdb_methods *methods, struct pdb_search *search, - const DOM_SID *sid); + const struct dom_sid *sid); bool (*uid_to_sid)(struct pdb_methods *methods, uid_t uid, - DOM_SID *sid); + struct dom_sid *sid); bool (*gid_to_sid)(struct pdb_methods *methods, gid_t gid, - DOM_SID *sid); - bool (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid, + struct dom_sid *sid); + bool (*sid_to_id)(struct pdb_methods *methods, const struct dom_sid *sid, union unid_t *id, enum lsa_SidType *type); uint32_t (*capabilities)(struct pdb_methods *methods); @@ -412,10 +412,10 @@ struct pdb_methods bool (*get_trusteddom_pw)(struct pdb_methods *methods, const char *domain, char** pwd, - DOM_SID *sid, time_t *pass_last_set_time); + struct dom_sid *sid, time_t *pass_last_set_time); bool (*set_trusteddom_pw)(struct pdb_methods *methods, const char* domain, const char* pwd, - const DOM_SID *sid); + const struct dom_sid *sid); bool (*del_trusteddom_pw)(struct pdb_methods *methods, const char *domain); NTSTATUS (*enum_trusteddoms)(struct pdb_methods *methods, diff --git a/source3/include/proto.h b/source3/include/proto.h index da5cb0a607..f7d9f39258 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -121,7 +121,7 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username, uid_t *uid, gid_t *gid, char **found_username, struct nt_user_token **token); -bool user_in_group_sid(const char *username, const DOM_SID *group_sid); +bool user_in_group_sid(const char *username, const struct dom_sid *group_sid); bool user_in_group(const char *username, const char *groupname); NTSTATUS make_server_info_pw(struct auth_serversupplied_info **server_info, char *unix_username, @@ -201,18 +201,18 @@ NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *pas /* The following definitions come from auth/token_util.c */ -bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token ); +bool nt_token_check_sid ( const struct dom_sid *sid, const NT_USER_TOKEN *token ); bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid ); NT_USER_TOKEN *get_root_nt_token( void ); -NTSTATUS add_aliases(const DOM_SID *domain_sid, +NTSTATUS add_aliases(const struct dom_sid *domain_sid, struct nt_user_token *token); -NTSTATUS create_builtin_users(const DOM_SID *sid); -NTSTATUS create_builtin_administrators(const DOM_SID *sid); +NTSTATUS create_builtin_users(const struct dom_sid *sid); +NTSTATUS create_builtin_administrators(const struct dom_sid *sid); struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx, - const DOM_SID *user_sid, + const struct dom_sid *user_sid, bool is_guest, int num_groupsids, - const DOM_SID *groupsids); + const struct dom_sid *groupsids); void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token); void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid, int n_groups, gid_t *groups); @@ -220,14 +220,14 @@ void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid, /* The following definitions come from groupdb/mapping.c */ NTSTATUS add_initial_entry(gid_t gid, const char *sid, enum lsa_SidType sid_name_use, const char *nt_name, const char *comment); -bool get_domain_group_from_sid(DOM_SID sid, GROUP_MAP *map); +bool get_domain_group_from_sid(struct dom_sid sid, GROUP_MAP *map); int smb_create_group(const char *unix_group, gid_t *new_gid); int smb_delete_group(const char *unix_group); int smb_set_primary_group(const char *unix_group, const char* unix_user); int smb_add_user_group(const char *unix_group, const char *unix_user); int smb_delete_user_group(const char *unix_group, const char *unix_user); NTSTATUS pdb_default_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, - DOM_SID sid); + struct dom_sid sid); NTSTATUS pdb_default_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, gid_t gid); NTSTATUS pdb_default_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, @@ -237,38 +237,38 @@ NTSTATUS pdb_default_add_group_mapping_entry(struct pdb_methods *methods, NTSTATUS pdb_default_update_group_mapping_entry(struct pdb_methods *methods, GROUP_MAP *map); NTSTATUS pdb_default_delete_group_mapping_entry(struct pdb_methods *methods, - DOM_SID sid); + struct dom_sid sid); NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods, - const DOM_SID *sid, enum lsa_SidType sid_name_use, + const struct dom_sid *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, bool unix_only); NTSTATUS pdb_default_create_alias(struct pdb_methods *methods, const char *name, uint32 *rid); NTSTATUS pdb_default_delete_alias(struct pdb_methods *methods, - const DOM_SID *sid); + const struct dom_sid *sid); NTSTATUS pdb_default_get_aliasinfo(struct pdb_methods *methods, - const DOM_SID *sid, + const struct dom_sid *sid, struct acct_info *info); NTSTATUS pdb_default_set_aliasinfo(struct pdb_methods *methods, - const DOM_SID *sid, + const struct dom_sid *sid, struct acct_info *info); NTSTATUS pdb_default_add_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, const DOM_SID *member); + const struct dom_sid *alias, const struct dom_sid *member); NTSTATUS pdb_default_del_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, const DOM_SID *member); + const struct dom_sid *alias, const struct dom_sid *member); NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, TALLOC_CTX *mem_ctx, - DOM_SID **pp_members, + const struct dom_sid *alias, TALLOC_CTX *mem_ctx, + struct dom_sid **pp_members, size_t *p_num_members); NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, - const DOM_SID *members, + const struct dom_sid *domain_sid, + const struct dom_sid *members, size_t num_members, uint32 **pp_alias_rids, size_t *p_num_alias_rids); NTSTATUS pdb_nop_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, - DOM_SID sid); + struct dom_sid sid); NTSTATUS pdb_nop_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, gid_t gid); NTSTATUS pdb_nop_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, @@ -278,13 +278,13 @@ NTSTATUS pdb_nop_add_group_mapping_entry(struct pdb_methods *methods, NTSTATUS pdb_nop_update_group_mapping_entry(struct pdb_methods *methods, GROUP_MAP *map); NTSTATUS pdb_nop_delete_group_mapping_entry(struct pdb_methods *methods, - DOM_SID sid); + struct dom_sid sid); NTSTATUS pdb_nop_enum_group_mapping(struct pdb_methods *methods, enum lsa_SidType sid_name_use, GROUP_MAP **rmap, size_t *num_entries, bool unix_only); -bool pdb_get_dom_grp_info(const DOM_SID *sid, struct acct_info *info); -bool pdb_set_dom_grp_info(const DOM_SID *sid, const struct acct_info *info); +bool pdb_get_dom_grp_info(const struct dom_sid *sid, struct acct_info *info); +bool pdb_set_dom_grp_info(const struct dom_sid *sid, const struct acct_info *info); NTSTATUS pdb_create_builtin_alias(uint32 rid); /* The following definitions come from groupdb/mapping_ldb.c */ @@ -631,23 +631,23 @@ void popt_common_set_auth_info(struct user_auth_info *auth_info); /* The following definitions come from lib/privileges.c */ -bool get_privileges_for_sids(SE_PRIV *privileges, DOM_SID *slist, int scount); -NTSTATUS privilege_enumerate_accounts(DOM_SID **sids, int *num_sids); +bool get_privileges_for_sids(SE_PRIV *privileges, struct dom_sid *slist, int scount); +NTSTATUS privilege_enumerate_accounts(struct dom_sid **sids, int *num_sids); NTSTATUS privilege_enum_sids(const SE_PRIV *mask, TALLOC_CTX *mem_ctx, - DOM_SID **sids, int *num_sids); -bool grant_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask); -bool grant_privilege_by_name(DOM_SID *sid, const char *name); -bool revoke_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask); -bool revoke_all_privileges( DOM_SID *sid ); -bool revoke_privilege_by_name(DOM_SID *sid, const char *name); -NTSTATUS privilege_create_account(const DOM_SID *sid ); + struct dom_sid **sids, int *num_sids); +bool grant_privilege(const struct dom_sid *sid, const SE_PRIV *priv_mask); +bool grant_privilege_by_name(struct dom_sid *sid, const char *name); +bool revoke_privilege(const struct dom_sid *sid, const SE_PRIV *priv_mask); +bool revoke_all_privileges( struct dom_sid *sid ); +bool revoke_privilege_by_name(struct dom_sid *sid, const char *name); +NTSTATUS privilege_create_account(const struct dom_sid *sid ); NTSTATUS privilege_delete_account(const struct dom_sid *sid); NTSTATUS privilege_set_init(PRIVILEGE_SET *priv_set); NTSTATUS privilege_set_init_by_ctx(TALLOC_CTX *mem_ctx, PRIVILEGE_SET *priv_set); void privilege_set_free(PRIVILEGE_SET *priv_set); NTSTATUS dup_luid_attr(TALLOC_CTX *mem_ctx, LUID_ATTR **new_la, LUID_ATTR *old_la, int count); -bool is_privileged_sid( const DOM_SID *sid ); -bool grant_all_privileges( const DOM_SID *sid ); +bool is_privileged_sid( const struct dom_sid *sid ); +bool grant_all_privileges( const struct dom_sid *sid ); /* The following definitions come from lib/privileges_basic.c */ @@ -698,7 +698,7 @@ struct sec_desc_buf *sec_desc_merge_buf(TALLOC_CTX *ctx, struct sec_desc_buf *ne struct security_descriptor *make_sec_desc(TALLOC_CTX *ctx, enum security_descriptor_revision revision, uint16 type, - const DOM_SID *owner_sid, const DOM_SID *grp_sid, + const struct dom_sid *owner_sid, const struct dom_sid *grp_sid, struct security_acl *sacl, struct security_acl *dacl, size_t *sd_size); struct security_descriptor *dup_sec_desc(TALLOC_CTX *ctx, const struct security_descriptor *src); NTSTATUS marshall_sec_desc(TALLOC_CTX *mem_ctx, @@ -711,20 +711,20 @@ NTSTATUS unmarshall_sec_desc(TALLOC_CTX *mem_ctx, uint8 *data, size_t len, struct security_descriptor **psecdesc); NTSTATUS unmarshall_sec_desc_buf(TALLOC_CTX *mem_ctx, uint8_t *data, size_t len, struct sec_desc_buf **psecdesc_buf); -struct security_descriptor *make_standard_sec_desc(TALLOC_CTX *ctx, const DOM_SID *owner_sid, const DOM_SID *grp_sid, +struct security_descriptor *make_standard_sec_desc(TALLOC_CTX *ctx, const struct dom_sid *owner_sid, const struct dom_sid *grp_sid, struct security_acl *dacl, size_t *sd_size); struct sec_desc_buf *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, struct security_descriptor *sec_desc); struct sec_desc_buf *dup_sec_desc_buf(TALLOC_CTX *ctx, struct sec_desc_buf *src); -NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, DOM_SID *sid, uint32 mask, size_t *sd_size); -NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, DOM_SID *sid, uint32 mask); -NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, DOM_SID *sid, size_t *sd_size); +NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, uint32 mask, size_t *sd_size); +NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, struct dom_sid *sid, uint32 mask); +NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, size_t *sd_size); bool sd_has_inheritable_components(const struct security_descriptor *parent_ctr, bool container); NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx, struct security_descriptor **ppsd, size_t *psize, const struct security_descriptor *parent_ctr, - const DOM_SID *owner_sid, - const DOM_SID *group_sid, + const struct dom_sid *owner_sid, + const struct dom_sid *group_sid, bool container); NTSTATUS se_create_child_secdesc_buf(TALLOC_CTX *ctx, struct sec_desc_buf **ppsdb, @@ -1332,38 +1332,38 @@ bool is_setuid_root(void) ; const char *sid_type_lookup(uint32 sid_type) ; NT_USER_TOKEN *get_system_token(void) ; const char *get_global_sam_name(void) ; -char *sid_to_fstring(fstring sidstr_out, const DOM_SID *sid); -char *sid_string_talloc(TALLOC_CTX *mem_ctx, const DOM_SID *sid); -char *sid_string_dbg(const DOM_SID *sid); -char *sid_string_tos(const DOM_SID *sid); -bool string_to_sid(DOM_SID *sidout, const char *sidstr); -bool sid_append_rid(DOM_SID *sid, uint32 rid); -bool sid_compose(DOM_SID *dst, const DOM_SID *domain_sid, uint32 rid); -bool sid_split_rid(DOM_SID *sid, uint32 *rid); -bool sid_peek_rid(const DOM_SID *sid, uint32 *rid); -bool sid_peek_check_rid(const DOM_SID *exp_dom_sid, const DOM_SID *sid, uint32 *rid); -void sid_copy(DOM_SID *dst, const DOM_SID *src); -bool sid_linearize(char *outbuf, size_t len, const DOM_SID *sid); -bool sid_parse(const char *inbuf, size_t len, DOM_SID *sid); -int sid_compare(const DOM_SID *sid1, const DOM_SID *sid2); -int sid_compare_domain(const DOM_SID *sid1, const DOM_SID *sid2); -bool sid_equal(const DOM_SID *sid1, const DOM_SID *sid2); -bool non_mappable_sid(DOM_SID *sid); -char *sid_binstring(TALLOC_CTX *mem_ctx, const DOM_SID *sid); -char *sid_binstring_hex(const DOM_SID *sid); -DOM_SID *sid_dup_talloc(TALLOC_CTX *ctx, const DOM_SID *src); -NTSTATUS add_sid_to_array(TALLOC_CTX *mem_ctx, const DOM_SID *sid, - DOM_SID **sids, size_t *num); -NTSTATUS add_sid_to_array_unique(TALLOC_CTX *mem_ctx, const DOM_SID *sid, - DOM_SID **sids, size_t *num_sids); -void del_sid_from_array(const DOM_SID *sid, DOM_SID **sids, size_t *num); +char *sid_to_fstring(fstring sidstr_out, const struct dom_sid *sid); +char *sid_string_talloc(TALLOC_CTX *mem_ctx, const struct dom_sid *sid); +char *sid_string_dbg(const struct dom_sid *sid); +char *sid_string_tos(const struct dom_sid *sid); +bool string_to_sid(struct dom_sid *sidout, const char *sidstr); +bool sid_append_rid(struct dom_sid *sid, uint32 rid); +bool sid_compose(struct dom_sid *dst, const struct dom_sid *domain_sid, uint32 rid); +bool sid_split_rid(struct dom_sid *sid, uint32 *rid); +bool sid_peek_rid(const struct dom_sid *sid, uint32 *rid); +bool sid_peek_check_rid(const struct dom_sid *exp_dom_sid, const struct dom_sid *sid, uint32 *rid); +void sid_copy(struct dom_sid *dst, const struct dom_sid *src); +bool sid_linearize(char *outbuf, size_t len, const struct dom_sid *sid); +bool sid_parse(const char *inbuf, size_t len, struct dom_sid *sid); +int sid_compare(const struct dom_sid *sid1, const struct dom_sid *sid2); +int sid_compare_domain(const struct dom_sid *sid1, const struct dom_sid *sid2); +bool sid_equal(const struct dom_sid *sid1, const struct dom_sid *sid2); +bool non_mappable_sid(struct dom_sid *sid); +char *sid_binstring(TALLOC_CTX *mem_ctx, const struct dom_sid *sid); +char *sid_binstring_hex(const struct dom_sid *sid); +struct dom_sid *sid_dup_talloc(TALLOC_CTX *ctx, const struct dom_sid *src); +NTSTATUS add_sid_to_array(TALLOC_CTX *mem_ctx, const struct dom_sid *sid, + struct dom_sid **sids, size_t *num); +NTSTATUS add_sid_to_array_unique(TALLOC_CTX *mem_ctx, const struct dom_sid *sid, + struct dom_sid **sids, size_t *num_sids); +void del_sid_from_array(const struct dom_sid *sid, struct dom_sid **sids, size_t *num); bool add_rid_to_array_unique(TALLOC_CTX *mem_ctx, uint32 rid, uint32 **pp_rids, size_t *p_num); -bool is_null_sid(const DOM_SID *sid); -bool is_sid_in_token(const NT_USER_TOKEN *token, const DOM_SID *sid); +bool is_null_sid(const struct dom_sid *sid); +bool is_sid_in_token(const NT_USER_TOKEN *token, const struct dom_sid *sid); NTSTATUS sid_array_from_info3(TALLOC_CTX *mem_ctx, const struct netr_SamInfo3 *info3, - DOM_SID **user_sids, + struct dom_sid **user_sids, size_t *num_user_sids, bool include_user_group_rid, bool skip_ressource_groups); @@ -1652,21 +1652,21 @@ const char *samba_version_string(void); /* The following definitions come from lib/winbind_util.c */ -bool winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid, +bool winbind_lookup_name(const char *dom_name, const char *name, struct dom_sid *sid, enum lsa_SidType *name_type); -bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, +bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid, const char **domain, const char **name, enum lsa_SidType *name_type); bool winbind_ping(void); -bool winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid); -bool winbind_uid_to_sid(DOM_SID *sid, uid_t uid); -bool winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid); -bool winbind_gid_to_sid(DOM_SID *sid, gid_t gid); +bool winbind_sid_to_uid(uid_t *puid, const struct dom_sid *sid); +bool winbind_uid_to_sid(struct dom_sid *sid, uid_t uid); +bool winbind_sid_to_gid(gid_t *pgid, const struct dom_sid *sid); +bool winbind_gid_to_sid(struct dom_sid *sid, gid_t gid); struct passwd * winbind_getpwnam(const char * sname); -struct passwd * winbind_getpwsid(const DOM_SID *sid); +struct passwd * winbind_getpwsid(const struct dom_sid *sid); wbcErr wb_is_trusted_domain(const char *domain); bool winbind_lookup_rids(TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, int num_rids, uint32 *rids, const char **domain_name, const char ***names, enum lsa_SidType **types); @@ -1677,8 +1677,8 @@ bool winbind_get_groups(TALLOC_CTX *mem_ctx, uint32_t *num_groups, gid_t ** _groups); bool winbind_get_sid_aliases(TALLOC_CTX *mem_ctx, - const DOM_SID *dom_sid, - const DOM_SID *members, + const struct dom_sid *dom_sid, + const struct dom_sid *members, size_t num_members, uint32_t **pp_alias_rids, size_t *p_num_alias_rids); @@ -1884,7 +1884,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res); ADS_STATUS ads_USN(ADS_STRUCT *ads, uint32 *usn); ADS_STATUS ads_current_time(ADS_STRUCT *ads); ADS_STATUS ads_domain_func_level(ADS_STRUCT *ads, uint32 *val); -ADS_STATUS ads_domain_sid(ADS_STRUCT *ads, DOM_SID *sid); +ADS_STATUS ads_domain_sid(ADS_STRUCT *ads, struct dom_sid *sid); ADS_STATUS ads_site_dn(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char **site_name); ADS_STATUS ads_site_dn_for_machine(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char *computer_name, const char **site_dn); ADS_STATUS ads_upn_suffixes(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, char ***suffixes, size_t *num_suffixes); @@ -1895,7 +1895,7 @@ ADS_STATUS ads_get_joinable_ous(ADS_STRUCT *ads, ADS_STATUS ads_get_sid_from_extended_dn(TALLOC_CTX *mem_ctx, const char *extended_dn, enum ads_extended_dn_flags flags, - DOM_SID *sid); + struct dom_sid *sid); char* ads_get_dnshostname( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name ); char* ads_get_upn( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name ); char* ads_get_samaccountname( ADS_STRUCT *ads, TALLOC_CTX *ctx, const char *machine_name ); @@ -2157,7 +2157,7 @@ bool send_getdc_request(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, struct sockaddr_storage *dc_ss, const char *domain_name, - const DOM_SID *sid, + const struct dom_sid *sid, uint32_t nt_version); bool receive_getdc_response(TALLOC_CTX *mem_ctx, struct sockaddr_storage *dc_ss, @@ -2675,8 +2675,8 @@ bool cli_set_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUC bool cli_list_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_LIST **pqt_list); bool cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt); bool cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUCT *pqt); -void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric)); -void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric)); +void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric)); +void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric)); /* The following definitions come from libsmb/clirap.c */ @@ -3167,8 +3167,8 @@ bool netsamlogon_cache_init(void); bool netsamlogon_cache_shutdown(void); void netsamlogon_clear_cached_user(struct netr_SamInfo3 *info3); bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3); -struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid); -bool netsamlogon_cache_have(const DOM_SID *user_sid); +struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct dom_sid *user_sid); +bool netsamlogon_cache_have(const struct dom_sid *user_sid); /* The following definitions come from libsmb/smb_seal.c */ @@ -3230,9 +3230,9 @@ WERROR map_werror_from_unix(int error); bool trustdom_cache_enable(void); bool trustdom_cache_shutdown(void); -bool trustdom_cache_store(char* name, char* alt_name, const DOM_SID *sid, +bool trustdom_cache_store(char* name, char* alt_name, const struct dom_sid *sid, time_t timeout); -bool trustdom_cache_fetch(const char* name, DOM_SID* sid); +bool trustdom_cache_fetch(const char* name, struct dom_sid* sid); uint32 trustdom_cache_fetch_timestamp( void ); bool trustdom_cache_store_timestamp( uint32 t, time_t timeout ); void trustdom_cache_flush(void); @@ -3250,7 +3250,7 @@ NTSTATUS trust_pw_find_change_and_store_it(struct rpc_pipe_client *cli, const char *domain) ; bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain, char ***domain_names, uint32 *num_domains, - DOM_SID **sids ); + struct dom_sid **sids ); /* The following definitions come from libsmb/unexpected.c */ @@ -4322,24 +4322,24 @@ bool login_cache_delentry(const struct samu *sampass); bool lookup_name(TALLOC_CTX *mem_ctx, const char *full_name, int flags, const char **ret_domain, const char **ret_name, - DOM_SID *ret_sid, enum lsa_SidType *ret_type); + struct dom_sid *ret_sid, enum lsa_SidType *ret_type); bool lookup_name_smbconf(TALLOC_CTX *mem_ctx, const char *full_name, int flags, const char **ret_domain, const char **ret_name, - DOM_SID *ret_sid, enum lsa_SidType *ret_type); + struct dom_sid *ret_sid, enum lsa_SidType *ret_type); NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids, - const DOM_SID **sids, int level, + const struct dom_sid **sids, int level, struct lsa_dom_info **ret_domains, struct lsa_name_info **ret_names); -bool lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, +bool lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid, const char **ret_domain, const char **ret_name, enum lsa_SidType *ret_type); -void store_uid_sid_cache(const DOM_SID *psid, uid_t uid); -void store_gid_sid_cache(const DOM_SID *psid, gid_t gid); -void uid_to_sid(DOM_SID *psid, uid_t uid); -void gid_to_sid(DOM_SID *psid, gid_t gid); -bool sid_to_uid(const DOM_SID *psid, uid_t *puid); -bool sid_to_gid(const DOM_SID *psid, gid_t *pgid); +void store_uid_sid_cache(const struct dom_sid *psid, uid_t uid); +void store_gid_sid_cache(const struct dom_sid *psid, gid_t gid); +void uid_to_sid(struct dom_sid *psid, uid_t uid); +void gid_to_sid(struct dom_sid *psid, gid_t gid); +bool sid_to_uid(const struct dom_sid *psid, uid_t *puid); +bool sid_to_gid(const struct dom_sid *psid, gid_t *pgid); /* The following definitions come from passdb/machine_sid.c */ @@ -4416,8 +4416,8 @@ const uint8_t *pdb_get_nt_passwd(const struct samu *sampass); const uint8_t *pdb_get_lanman_passwd(const struct samu *sampass); const uint8_t *pdb_get_pw_history(const struct samu *sampass, uint32_t *current_hist_len); const char *pdb_get_plaintext_passwd(const struct samu *sampass); -const DOM_SID *pdb_get_user_sid(const struct samu *sampass); -const DOM_SID *pdb_get_group_sid(struct samu *sampass); +const struct dom_sid *pdb_get_user_sid(const struct samu *sampass); +const struct dom_sid *pdb_get_group_sid(struct samu *sampass); enum pdb_value_state pdb_get_init_flags(const struct samu *sampass, enum pdb_elements element); const char *pdb_get_username(const struct samu *sampass); const char *pdb_get_domain(const struct samu *sampass); @@ -4446,9 +4446,9 @@ bool pdb_set_pass_last_set_time(struct samu *sampass, time_t mytime, enum pdb_va bool pdb_set_hours_len(struct samu *sampass, uint32_t len, enum pdb_value_state flag); bool pdb_set_logon_divs(struct samu *sampass, uint16_t hours, enum pdb_value_state flag); bool pdb_set_init_flags(struct samu *sampass, enum pdb_elements element, enum pdb_value_state value_flag); -bool pdb_set_user_sid(struct samu *sampass, const DOM_SID *u_sid, enum pdb_value_state flag); +bool pdb_set_user_sid(struct samu *sampass, const struct dom_sid *u_sid, enum pdb_value_state flag); bool pdb_set_user_sid_from_string(struct samu *sampass, fstring u_sid, enum pdb_value_state flag); -bool pdb_set_group_sid(struct samu *sampass, const DOM_SID *g_sid, enum pdb_value_state flag); +bool pdb_set_group_sid(struct samu *sampass, const struct dom_sid *g_sid, enum pdb_value_state flag); bool pdb_set_username(struct samu *sampass, const char *username, enum pdb_value_state flag); bool pdb_set_domain(struct samu *sampass, const char *domain, enum pdb_value_state flag); bool pdb_set_nt_username(struct samu *sampass, const char *nt_username, enum pdb_value_state flag); @@ -4485,7 +4485,7 @@ struct event_context *pdb_get_event_context(void); NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected); struct pdb_domain_info *pdb_get_domain_info(TALLOC_CTX *mem_ctx); bool pdb_getsampwnam(struct samu *sam_acct, const char *username) ; -bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid) ; +bool pdb_getsampwsid(struct samu *sam_acct, const struct dom_sid *sid) ; NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32_t flags, uint32_t *rid); NTSTATUS pdb_delete_user(TALLOC_CTX *mem_ctx, struct samu *sam_acct); @@ -4494,7 +4494,7 @@ NTSTATUS pdb_update_sam_account(struct samu *sam_acct) ; NTSTATUS pdb_delete_sam_account(struct samu *sam_acct) ; NTSTATUS pdb_rename_sam_account(struct samu *oldname, const char *newname); NTSTATUS pdb_update_login_attempts(struct samu *sam_acct, bool success); -bool pdb_getgrsid(GROUP_MAP *map, DOM_SID sid); +bool pdb_getgrsid(GROUP_MAP *map, struct dom_sid sid); bool pdb_getgrgid(GROUP_MAP *map, gid_t gid); bool pdb_getgrnam(GROUP_MAP *map, const char *name); NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name, @@ -4502,15 +4502,15 @@ NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name, NTSTATUS pdb_delete_dom_group(TALLOC_CTX *mem_ctx, uint32_t rid); NTSTATUS pdb_add_group_mapping_entry(GROUP_MAP *map); NTSTATUS pdb_update_group_mapping_entry(GROUP_MAP *map); -NTSTATUS pdb_delete_group_mapping_entry(DOM_SID sid); -bool pdb_enum_group_mapping(const DOM_SID *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, +NTSTATUS pdb_delete_group_mapping_entry(struct dom_sid sid); +bool pdb_enum_group_mapping(const struct dom_sid *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, bool unix_only); NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, uint32_t **pp_member_rids, size_t *p_num_members); NTSTATUS pdb_enum_group_memberships(TALLOC_CTX *mem_ctx, struct samu *user, - DOM_SID **pp_sids, gid_t **pp_gids, + struct dom_sid **pp_sids, gid_t **pp_gids, size_t *p_num_groups); NTSTATUS pdb_set_unix_primary_group(TALLOC_CTX *mem_ctx, struct samu *user); NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid, @@ -4518,24 +4518,24 @@ NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid, NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid, uint32_t member_rid); NTSTATUS pdb_create_alias(const char *name, uint32_t *rid); -NTSTATUS pdb_delete_alias(const DOM_SID *sid); -NTSTATUS pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info); -NTSTATUS pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info); -NTSTATUS pdb_add_aliasmem(const DOM_SID *alias, const DOM_SID *member); -NTSTATUS pdb_del_aliasmem(const DOM_SID *alias, const DOM_SID *member); -NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, - DOM_SID **pp_members, size_t *p_num_members); +NTSTATUS pdb_delete_alias(const struct dom_sid *sid); +NTSTATUS pdb_get_aliasinfo(const struct dom_sid *sid, struct acct_info *info); +NTSTATUS pdb_set_aliasinfo(const struct dom_sid *sid, struct acct_info *info); +NTSTATUS pdb_add_aliasmem(const struct dom_sid *alias, const struct dom_sid *member); +NTSTATUS pdb_del_aliasmem(const struct dom_sid *alias, const struct dom_sid *member); +NTSTATUS pdb_enum_aliasmem(const struct dom_sid *alias, TALLOC_CTX *mem_ctx, + struct dom_sid **pp_members, size_t *p_num_members); NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, - const DOM_SID *members, size_t num_members, + const struct dom_sid *domain_sid, + const struct dom_sid *members, size_t num_members, uint32_t **pp_alias_rids, size_t *p_num_alias_rids); -NTSTATUS pdb_lookup_rids(const DOM_SID *domain_sid, +NTSTATUS pdb_lookup_rids(const struct dom_sid *domain_sid, int num_rids, uint32_t *rids, const char **names, enum lsa_SidType *attrs); -NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid, +NTSTATUS pdb_lookup_names(const struct dom_sid *domain_sid, int num_names, const char **names, uint32_t *rids, @@ -4543,9 +4543,9 @@ NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid, bool pdb_get_account_policy(enum pdb_policy_type type, uint32_t *value); bool pdb_set_account_policy(enum pdb_policy_type type, uint32_t value); bool pdb_get_seq_num(time_t *seq_num); -bool pdb_uid_to_sid(uid_t uid, DOM_SID *sid); -bool pdb_gid_to_sid(gid_t gid, DOM_SID *sid); -bool pdb_sid_to_id(const DOM_SID *sid, union unid_t *id, +bool pdb_uid_to_sid(uid_t uid, struct dom_sid *sid); +bool pdb_gid_to_sid(gid_t gid, struct dom_sid *sid); +bool pdb_sid_to_id(const struct dom_sid *sid, union unid_t *id, enum lsa_SidType *type); uint32_t pdb_capabilities(void); bool pdb_new_rid(uint32_t *rid); @@ -4554,14 +4554,14 @@ struct pdb_search *pdb_search_init(TALLOC_CTX *mem_ctx, enum pdb_search_type type); struct pdb_search *pdb_search_users(TALLOC_CTX *mem_ctx, uint32_t acct_flags); struct pdb_search *pdb_search_groups(TALLOC_CTX *mem_ctx); -struct pdb_search *pdb_search_aliases(TALLOC_CTX *mem_ctx, const DOM_SID *sid); +struct pdb_search *pdb_search_aliases(TALLOC_CTX *mem_ctx, const struct dom_sid *sid); uint32_t pdb_search_entries(struct pdb_search *search, uint32_t start_idx, uint32_t max_entries, struct samr_displayentry **result); -bool pdb_get_trusteddom_pw(const char *domain, char** pwd, DOM_SID *sid, +bool pdb_get_trusteddom_pw(const char *domain, char** pwd, struct dom_sid *sid, time_t *pass_last_set_time); bool pdb_set_trusteddom_pw(const char* domain, const char* pwd, - const DOM_SID *sid); + const struct dom_sid *sid); bool pdb_del_trusteddom_pw(const char *domain); NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32_t *num_domains, struct trustdom_info ***domains); @@ -4656,30 +4656,30 @@ bool secrets_fetch_local_schannel_key(uint8_t schannel_key[16]); bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name); bool lookup_builtin_name(const char *name, uint32 *rid); const char *builtin_domain_name(void); -bool sid_check_is_builtin(const DOM_SID *sid); -bool sid_check_is_in_builtin(const DOM_SID *sid); +bool sid_check_is_builtin(const struct dom_sid *sid); +bool sid_check_is_in_builtin(const struct dom_sid *sid); /* The following definitions come from passdb/util_unixsids.c */ -bool sid_check_is_unix_users(const DOM_SID *sid); -bool sid_check_is_in_unix_users(const DOM_SID *sid); -bool uid_to_unix_users_sid(uid_t uid, DOM_SID *sid); -bool gid_to_unix_groups_sid(gid_t gid, DOM_SID *sid); +bool sid_check_is_unix_users(const struct dom_sid *sid); +bool sid_check_is_in_unix_users(const struct dom_sid *sid); +bool uid_to_unix_users_sid(uid_t uid, struct dom_sid *sid); +bool gid_to_unix_groups_sid(gid_t gid, struct dom_sid *sid); const char *unix_users_domain_name(void); -bool lookup_unix_user_name(const char *name, DOM_SID *sid); -bool sid_check_is_unix_groups(const DOM_SID *sid); -bool sid_check_is_in_unix_groups(const DOM_SID *sid); +bool lookup_unix_user_name(const char *name, struct dom_sid *sid); +bool sid_check_is_unix_groups(const struct dom_sid *sid); +bool sid_check_is_in_unix_groups(const struct dom_sid *sid); const char *unix_groups_domain_name(void); -bool lookup_unix_group_name(const char *name, DOM_SID *sid); +bool lookup_unix_group_name(const char *name, struct dom_sid *sid); /* The following definitions come from passdb/util_wellknown.c */ -bool sid_check_is_wellknown_domain(const DOM_SID *sid, const char **name); -bool sid_check_is_in_wellknown_domain(const DOM_SID *sid); -bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, +bool sid_check_is_wellknown_domain(const struct dom_sid *sid, const char **name); +bool sid_check_is_in_wellknown_domain(const struct dom_sid *sid); +bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid, const char **domain, const char **name); bool lookup_wellknown_name(TALLOC_CTX *mem_ctx, const char *name, - DOM_SID *sid, const char **domain); + struct dom_sid *sid, const char **domain); /* The following definitions come from printing/load.c */ @@ -5836,8 +5836,8 @@ void notify_trigger(struct notify_context *notify, /* The following definitions come from smbd/ntquotas.c */ -int vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid, SMB_NTQUOTA_STRUCT *qt); -int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid, SMB_NTQUOTA_STRUCT *qt); +int vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, struct dom_sid *psid, SMB_NTQUOTA_STRUCT *qt); +int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, struct dom_sid *psid, SMB_NTQUOTA_STRUCT *qt); int vfs_get_user_ntquota_list(files_struct *fsp, SMB_NTQUOTA_LIST **qt_list); void *init_quota_handle(TALLOC_CTX *mem_ctx); @@ -6020,7 +6020,7 @@ void reply_pipe_close(connection_struct *conn, struct smb_request *req); /* The following definitions come from smbd/posix_acls.c */ -void create_file_sids(const SMB_STRUCT_STAT *psbuf, DOM_SID *powner_sid, DOM_SID *pgroup_sid); +void create_file_sids(const SMB_STRUCT_STAT *psbuf, struct dom_sid *powner_sid, struct dom_sid *pgroup_sid); bool nt4_compatible_acls(void); uint32_t map_canon_ace_perms(int snum, enum security_ace_type *pacl_type, @@ -6514,10 +6514,10 @@ NTSTATUS idmap_tdb_init(void); /* The following definitions come from winbindd/idmap_util.c */ -NTSTATUS idmap_uid_to_sid(const char *domname, DOM_SID *sid, uid_t uid); -NTSTATUS idmap_gid_to_sid(const char *domname, DOM_SID *sid, gid_t gid); -NTSTATUS idmap_sid_to_uid(const char *dom_name, DOM_SID *sid, uid_t *uid); -NTSTATUS idmap_sid_to_gid(const char *domname, DOM_SID *sid, gid_t *gid); +NTSTATUS idmap_uid_to_sid(const char *domname, struct dom_sid *sid, uid_t uid); +NTSTATUS idmap_gid_to_sid(const char *domname, struct dom_sid *sid, gid_t gid); +NTSTATUS idmap_sid_to_uid(const char *dom_name, struct dom_sid *sid, uid_t *uid); +NTSTATUS idmap_sid_to_gid(const char *domname, struct dom_sid *sid, gid_t *gid); /* The following definitions come from winbindd/nss_info.c */ diff --git a/source3/include/secrets.h b/source3/include/secrets.h index d0848bdfa4..b51fd22bfa 100644 --- a/source3/include/secrets.h +++ b/source3/include/secrets.h @@ -66,7 +66,7 @@ struct machine_acct_pass { */ struct trustdom_info { char *name; - DOM_SID sid; + struct dom_sid sid; }; /* diff --git a/source3/include/smb.h b/source3/include/smb.h index e2721700e5..93e7323ba8 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -197,13 +197,6 @@ typedef union unid_t { |LOOKUP_NAME_WKN\ |LOOKUP_NAME_DOMAIN) -/** - * @brief Security Identifier - * - * @sa http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/accctrl_38yn.asp - **/ -typedef struct dom_sid DOM_SID; - enum id_mapping { ID_UNKNOWN = 0, ID_MAPPED, @@ -223,7 +216,7 @@ struct unixid { }; struct id_map { - DOM_SID *sid; + struct dom_sid *sid; struct unixid xid; enum id_mapping status; }; @@ -234,7 +227,7 @@ struct id_map { struct lsa_dom_info { bool valid; - DOM_SID sid; + struct dom_sid sid; const char *name; int num_idxs; int *idxs; @@ -248,30 +241,30 @@ struct lsa_name_info { }; /* Some well-known SIDs */ -extern const DOM_SID global_sid_World_Domain; -extern const DOM_SID global_sid_World; -extern const DOM_SID global_sid_Creator_Owner_Domain; -extern const DOM_SID global_sid_NT_Authority; -extern const DOM_SID global_sid_System; -extern const DOM_SID global_sid_NULL; -extern const DOM_SID global_sid_Authenticated_Users; -extern const DOM_SID global_sid_Network; -extern const DOM_SID global_sid_Creator_Owner; -extern const DOM_SID global_sid_Creator_Group; -extern const DOM_SID global_sid_Anonymous; -extern const DOM_SID global_sid_Builtin; -extern const DOM_SID global_sid_Builtin_Administrators; -extern const DOM_SID global_sid_Builtin_Users; -extern const DOM_SID global_sid_Builtin_Guests; -extern const DOM_SID global_sid_Builtin_Power_Users; -extern const DOM_SID global_sid_Builtin_Account_Operators; -extern const DOM_SID global_sid_Builtin_Server_Operators; -extern const DOM_SID global_sid_Builtin_Print_Operators; -extern const DOM_SID global_sid_Builtin_Backup_Operators; -extern const DOM_SID global_sid_Builtin_Replicator; -extern const DOM_SID global_sid_Builtin_PreWin2kAccess; -extern const DOM_SID global_sid_Unix_Users; -extern const DOM_SID global_sid_Unix_Groups; +extern const struct dom_sid global_sid_World_Domain; +extern const struct dom_sid global_sid_World; +extern const struct dom_sid global_sid_Creator_Owner_Domain; +extern const struct dom_sid global_sid_NT_Authority; +extern const struct dom_sid global_sid_System; +extern const struct dom_sid global_sid_NULL; +extern const struct dom_sid global_sid_Authenticated_Users; +extern const struct dom_sid global_sid_Network; +extern const struct dom_sid global_sid_Creator_Owner; +extern const struct dom_sid global_sid_Creator_Group; +extern const struct dom_sid global_sid_Anonymous; +extern const struct dom_sid global_sid_Builtin; +extern const struct dom_sid global_sid_Builtin_Administrators; +extern const struct dom_sid global_sid_Builtin_Users; +extern const struct dom_sid global_sid_Builtin_Guests; +extern const struct dom_sid global_sid_Builtin_Power_Users; +extern const struct dom_sid global_sid_Builtin_Account_Operators; +extern const struct dom_sid global_sid_Builtin_Server_Operators; +extern const struct dom_sid global_sid_Builtin_Print_Operators; +extern const struct dom_sid global_sid_Builtin_Backup_Operators; +extern const struct dom_sid global_sid_Builtin_Replicator; +extern const struct dom_sid global_sid_Builtin_PreWin2kAccess; +extern const struct dom_sid global_sid_Unix_Users; +extern const struct dom_sid global_sid_Unix_Groups; /* * The complete list of SIDS belonging to this user. @@ -288,7 +281,7 @@ extern const DOM_SID global_sid_Unix_Groups; typedef struct nt_user_token { size_t num_sids; - DOM_SID *user_sids; + struct dom_sid *user_sids; SE_PRIV privileges; } NT_USER_TOKEN; diff --git a/source3/include/smbldap.h b/source3/include/smbldap.h index ec0e9f5c18..e3becdb3a1 100644 --- a/source3/include/smbldap.h +++ b/source3/include/smbldap.h @@ -184,7 +184,7 @@ struct ldapsam_privates { int index; const char *domain_name; - DOM_SID domain_sid; + struct dom_sid domain_sid; /* configuration items */ int schema_ver; diff --git a/source3/include/trans2.h b/source3/include/trans2.h index 8152a7be94..076780dec0 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -665,7 +665,7 @@ enum smb_whoami_flags { 4 bytes - pad / reserved (must be zero) 8 bytes unsigned[] - list of GIDs (may be empty) - DOM_SID[] - list of SIDs (may be empty) + struct dom_sid[] - list of SIDs (may be empty) */ /* diff --git a/source3/lib/afs.c b/source3/lib/afs.c index a76b74c616..7b3e610306 100644 --- a/source3/lib/afs.c +++ b/source3/lib/afs.c @@ -219,7 +219,7 @@ bool afs_login(connection_struct *conn) char *cell = NULL; bool result; char *ticket_str = NULL; - const DOM_SID *user_sid; + const struct dom_sid *user_sid; TALLOC_CTX *ctx = talloc_tos(); struct ClearToken ct; diff --git a/source3/lib/netapi/samr.c b/source3/lib/netapi/samr.c index fa190e637c..a33be2ad24 100644 --- a/source3/lib/netapi/samr.c +++ b/source3/lib/netapi/samr.c @@ -208,7 +208,7 @@ WERROR libnetapi_samr_open_builtin_domain(struct libnetapi_ctx *mem_ctx, status = rpccli_samr_OpenDomain(pipe_cli, mem_ctx, connect_handle, builtin_mask, - CONST_DISCARD(DOM_SID *, &global_sid_Builtin), + CONST_DISCARD(struct dom_sid *, &global_sid_Builtin), builtin_handle); if (!NT_STATUS_IS_OK(status)) { werr = ntstatus_to_werror(status); diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c index 249123eef6..e291193fa2 100644 --- a/source3/lib/netapi/user.c +++ b/source3/lib/netapi/user.c @@ -531,7 +531,7 @@ WERROR NetUserDel_r(struct libnetapi_ctx *ctx, status = rpccli_samr_OpenDomain(pipe_cli, ctx, &connect_handle, SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT, - CONST_DISCARD(DOM_SID *, &global_sid_Builtin), + CONST_DISCARD(struct dom_sid *, &global_sid_Builtin), &builtin_handle); if (!NT_STATUS_IS_OK(status)) { werr = ntstatus_to_werror(status); diff --git a/source3/lib/privileges.c b/source3/lib/privileges.c index c8be360dc6..6da8aaa48d 100644 --- a/source3/lib/privileges.c +++ b/source3/lib/privileges.c @@ -27,7 +27,7 @@ typedef struct { size_t count; - DOM_SID *list; + struct dom_sid *list; } SID_LIST; typedef struct { @@ -37,7 +37,7 @@ typedef struct { } PRIV_SID_LIST; -static bool get_privileges( const DOM_SID *sid, SE_PRIV *mask ) +static bool get_privileges( const struct dom_sid *sid, SE_PRIV *mask ) { struct db_context *db = get_account_pol_db(); fstring tmp, keystr; @@ -76,7 +76,7 @@ static bool get_privileges( const DOM_SID *sid, SE_PRIV *mask ) Store the privilege mask (set) for a given SID ****************************************************************************/ -static bool set_privileges( const DOM_SID *sid, SE_PRIV *mask ) +static bool set_privileges( const struct dom_sid *sid, SE_PRIV *mask ) { struct db_context *db = get_account_pol_db(); fstring tmp, keystr; @@ -110,7 +110,7 @@ static bool set_privileges( const DOM_SID *sid, SE_PRIV *mask ) get a list of all privileges for all sids in the list *********************************************************************/ -bool get_privileges_for_sids(SE_PRIV *privileges, DOM_SID *slist, int scount) +bool get_privileges_for_sids(SE_PRIV *privileges, struct dom_sid *slist, int scount) { SE_PRIV mask; int i; @@ -144,7 +144,7 @@ static int priv_traverse_fn(struct db_record *rec, void *state) { PRIV_SID_LIST *priv = (PRIV_SID_LIST *)state; int prefixlen = strlen(PRIVPREFIX); - DOM_SID sid; + struct dom_sid sid; fstring sid_string; /* easy check first */ @@ -199,7 +199,7 @@ static int priv_traverse_fn(struct db_record *rec, void *state) Retreive list of privileged SIDs (for _lsa_enumerate_accounts() *********************************************************************/ -NTSTATUS privilege_enumerate_accounts(DOM_SID **sids, int *num_sids) +NTSTATUS privilege_enumerate_accounts(struct dom_sid **sids, int *num_sids) { struct db_context *db = get_account_pol_db(); PRIV_SID_LIST priv; @@ -227,7 +227,7 @@ NTSTATUS privilege_enumerate_accounts(DOM_SID **sids, int *num_sids) *********************************************************************/ NTSTATUS privilege_enum_sids(const SE_PRIV *mask, TALLOC_CTX *mem_ctx, - DOM_SID **sids, int *num_sids) + struct dom_sid **sids, int *num_sids) { struct db_context *db = get_account_pol_db(); PRIV_SID_LIST priv; @@ -255,7 +255,7 @@ NTSTATUS privilege_enum_sids(const SE_PRIV *mask, TALLOC_CTX *mem_ctx, Add privilege to sid ****************************************************************************/ -bool grant_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask) +bool grant_privilege(const struct dom_sid *sid, const SE_PRIV *priv_mask) { SE_PRIV old_mask, new_mask; @@ -284,7 +284,7 @@ bool grant_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask) Add a privilege based on its name *********************************************************************/ -bool grant_privilege_by_name(DOM_SID *sid, const char *name) +bool grant_privilege_by_name(struct dom_sid *sid, const char *name) { SE_PRIV mask; @@ -301,7 +301,7 @@ bool grant_privilege_by_name(DOM_SID *sid, const char *name) Remove privilege from sid ****************************************************************************/ -bool revoke_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask) +bool revoke_privilege(const struct dom_sid *sid, const SE_PRIV *priv_mask) { SE_PRIV mask; @@ -327,7 +327,7 @@ bool revoke_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask) Revoke all privileges *********************************************************************/ -bool revoke_all_privileges( DOM_SID *sid ) +bool revoke_all_privileges( struct dom_sid *sid ) { return revoke_privilege( sid, &se_priv_all ); } @@ -336,7 +336,7 @@ bool revoke_all_privileges( DOM_SID *sid ) Add a privilege based on its name *********************************************************************/ -bool revoke_privilege_by_name(DOM_SID *sid, const char *name) +bool revoke_privilege_by_name(struct dom_sid *sid, const char *name) { SE_PRIV mask; @@ -354,7 +354,7 @@ bool revoke_privilege_by_name(DOM_SID *sid, const char *name) Retrieve the SIDs assigned to a given privilege ****************************************************************************/ -NTSTATUS privilege_create_account(const DOM_SID *sid ) +NTSTATUS privilege_create_account(const struct dom_sid *sid ) { return ( grant_privilege(sid, &se_priv_none) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL); } @@ -470,7 +470,7 @@ NTSTATUS dup_luid_attr(TALLOC_CTX *mem_ctx, LUID_ATTR **new_la, LUID_ATTR *old_l /******************************************************************* *******************************************************************/ -bool is_privileged_sid( const DOM_SID *sid ) +bool is_privileged_sid( const struct dom_sid *sid ) { SE_PRIV mask; @@ -480,7 +480,7 @@ bool is_privileged_sid( const DOM_SID *sid ) /******************************************************************* *******************************************************************/ -bool grant_all_privileges( const DOM_SID *sid ) +bool grant_all_privileges( const struct dom_sid *sid ) { SE_PRIV mask; diff --git a/source3/lib/secdesc.c b/source3/lib/secdesc.c index 4964fd5f45..a1599a845e 100644 --- a/source3/lib/secdesc.c +++ b/source3/lib/secdesc.c @@ -65,7 +65,7 @@ uint32_t get_sec_info(const struct security_descriptor *sd) struct sec_desc_buf *sec_desc_merge_buf(TALLOC_CTX *ctx, struct sec_desc_buf *new_sdb, struct sec_desc_buf *old_sdb) { - DOM_SID *owner_sid, *group_sid; + struct dom_sid *owner_sid, *group_sid; struct sec_desc_buf *return_sdb; struct security_acl *dacl, *sacl; struct security_descriptor *psd = NULL; @@ -110,7 +110,7 @@ struct sec_desc_buf *sec_desc_merge_buf(TALLOC_CTX *ctx, struct sec_desc_buf *ne struct security_descriptor *sec_desc_merge(TALLOC_CTX *ctx, struct security_descriptor *new_sdb, struct security_descriptor *old_sdb) { - DOM_SID *owner_sid, *group_sid; + struct dom_sid *owner_sid, *group_sid; struct security_acl *dacl, *sacl; struct security_descriptor *psd = NULL; uint16 secdesc_type; @@ -158,7 +158,7 @@ struct security_descriptor *sec_desc_merge(TALLOC_CTX *ctx, struct security_desc struct security_descriptor *make_sec_desc(TALLOC_CTX *ctx, enum security_descriptor_revision revision, uint16 type, - const DOM_SID *owner_sid, const DOM_SID *grp_sid, + const struct dom_sid *owner_sid, const struct dom_sid *grp_sid, struct security_acl *sacl, struct security_acl *dacl, size_t *sd_size) { struct security_descriptor *dst; @@ -366,7 +366,7 @@ NTSTATUS unmarshall_sec_desc_buf(TALLOC_CTX *mem_ctx, uint8_t *data, size_t len, Creates a struct security_descriptor structure with typical defaults. ********************************************************************/ -struct security_descriptor *make_standard_sec_desc(TALLOC_CTX *ctx, const DOM_SID *owner_sid, const DOM_SID *grp_sid, +struct security_descriptor *make_standard_sec_desc(TALLOC_CTX *ctx, const struct dom_sid *owner_sid, const struct dom_sid *grp_sid, struct security_acl *dacl, size_t *sd_size) { return make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1, @@ -411,7 +411,7 @@ struct sec_desc_buf *dup_sec_desc_buf(TALLOC_CTX *ctx, struct sec_desc_buf *src) Add a new SID with its permissions to struct security_descriptor. ********************************************************************/ -NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, DOM_SID *sid, uint32 mask, size_t *sd_size) +NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, uint32 mask, size_t *sd_size) { struct security_descriptor *sd = 0; struct security_acl *dacl = 0; @@ -444,7 +444,7 @@ NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, DOM Modify a SID's permissions in a struct security_descriptor. ********************************************************************/ -NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, DOM_SID *sid, uint32 mask) +NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, struct dom_sid *sid, uint32 mask) { NTSTATUS status; @@ -463,7 +463,7 @@ NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, DOM_SID *sid, uint32 m Delete a SID from a struct security_descriptor. ********************************************************************/ -NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, DOM_SID *sid, size_t *sd_size) +NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, size_t *sd_size) { struct security_descriptor *sd = 0; struct security_acl *dacl = 0; @@ -543,8 +543,8 @@ NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx, struct security_descriptor **ppsd, size_t *psize, const struct security_descriptor *parent_ctr, - const DOM_SID *owner_sid, - const DOM_SID *group_sid, + const struct dom_sid *owner_sid, + const struct dom_sid *group_sid, bool container) { struct security_acl *new_dacl = NULL, *the_acl = NULL; @@ -576,8 +576,8 @@ NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx, for (i = 0; i < the_acl->num_aces; i++) { const struct security_ace *ace = &the_acl->aces[i]; struct security_ace *new_ace = &new_ace_list[new_ace_list_ndx]; - const DOM_SID *ptrustee = &ace->trustee; - const DOM_SID *creator = NULL; + const struct dom_sid *ptrustee = &ace->trustee; + const struct dom_sid *creator = NULL; uint8 new_flags = ace->flags; if (!is_inheritable_ace(ace, container)) { diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c index ee384797e0..67a035749b 100644 --- a/source3/lib/sharesec.c +++ b/source3/lib/sharesec.c @@ -467,7 +467,7 @@ bool parse_usershare_acl(TALLOC_CTX *ctx, const char *acl_str, struct security_d uint32_t sa; uint32 g_access; uint32 s_access; - DOM_SID sid; + struct dom_sid sid; char *sidstr; enum security_ace_type type = SEC_ACE_TYPE_ACCESS_ALLOWED; diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index 64ef95a001..b81f0a1ec8 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -313,7 +313,7 @@ static char * realloc_expand_env_var(char *str, char *p) static char *longvar_domainsid( void ) { - DOM_SID sid; + struct dom_sid sid; fstring tmp; char *sid_string; diff --git a/source3/lib/util_nttoken.c b/source3/lib/util_nttoken.c index edacafd91b..04c7e4f157 100644 --- a/source3/lib/util_nttoken.c +++ b/source3/lib/util_nttoken.c @@ -45,8 +45,8 @@ NT_USER_TOKEN *dup_nt_token(TALLOC_CTX *mem_ctx, const NT_USER_TOKEN *ptoken) } if (ptoken->user_sids && ptoken->num_sids) { - token->user_sids = (DOM_SID *)talloc_memdup( - token, ptoken->user_sids, sizeof(DOM_SID) * ptoken->num_sids ); + token->user_sids = (struct dom_sid *)talloc_memdup( + token, ptoken->user_sids, sizeof(struct dom_sid) * ptoken->num_sids ); if (token->user_sids == NULL) { DEBUG(0, ("talloc_memdup failed\n")); diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index 354b14e14a..4cc7bb401c 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -30,61 +30,61 @@ */ -const DOM_SID global_sid_World_Domain = /* Everyone domain */ +const struct dom_sid global_sid_World_Domain = /* Everyone domain */ { 1, 0, {0,0,0,0,0,1}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_World = /* Everyone */ +const struct dom_sid global_sid_World = /* Everyone */ { 1, 1, {0,0,0,0,0,1}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Creator_Owner_Domain = /* Creator Owner domain */ +const struct dom_sid global_sid_Creator_Owner_Domain = /* Creator Owner domain */ { 1, 0, {0,0,0,0,0,3}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_NT_Authority = /* NT Authority */ +const struct dom_sid global_sid_NT_Authority = /* NT Authority */ { 1, 0, {0,0,0,0,0,5}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_System = /* System */ +const struct dom_sid global_sid_System = /* System */ { 1, 1, {0,0,0,0,0,5}, {18,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_NULL = /* NULL sid */ +const struct dom_sid global_sid_NULL = /* NULL sid */ { 1, 1, {0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Authenticated_Users = /* All authenticated rids */ +const struct dom_sid global_sid_Authenticated_Users = /* All authenticated rids */ { 1, 1, {0,0,0,0,0,5}, {11,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; #if 0 /* for documentation */ -const DOM_SID global_sid_Restriced = /* Restriced Code */ +const struct dom_sid global_sid_Restriced = /* Restriced Code */ { 1, 1, {0,0,0,0,0,5}, {12,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; #endif -const DOM_SID global_sid_Network = /* Network rids */ +const struct dom_sid global_sid_Network = /* Network rids */ { 1, 1, {0,0,0,0,0,5}, {2,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Creator_Owner = /* Creator Owner */ +const struct dom_sid global_sid_Creator_Owner = /* Creator Owner */ { 1, 1, {0,0,0,0,0,3}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Creator_Group = /* Creator Group */ +const struct dom_sid global_sid_Creator_Group = /* Creator Group */ { 1, 1, {0,0,0,0,0,3}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Anonymous = /* Anonymous login */ +const struct dom_sid global_sid_Anonymous = /* Anonymous login */ { 1, 1, {0,0,0,0,0,5}, {7,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Builtin = /* Local well-known domain */ +const struct dom_sid global_sid_Builtin = /* Local well-known domain */ { 1, 1, {0,0,0,0,0,5}, {32,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Builtin_Administrators = /* Builtin administrators */ +const struct dom_sid global_sid_Builtin_Administrators = /* Builtin administrators */ { 1, 2, {0,0,0,0,0,5}, {32,544,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Builtin_Users = /* Builtin users */ +const struct dom_sid global_sid_Builtin_Users = /* Builtin users */ { 1, 2, {0,0,0,0,0,5}, {32,545,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Builtin_Guests = /* Builtin guest users */ +const struct dom_sid global_sid_Builtin_Guests = /* Builtin guest users */ { 1, 2, {0,0,0,0,0,5}, {32,546,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Builtin_Power_Users = /* Builtin power users */ +const struct dom_sid global_sid_Builtin_Power_Users = /* Builtin power users */ { 1, 2, {0,0,0,0,0,5}, {32,547,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Builtin_Account_Operators = /* Builtin account operators */ +const struct dom_sid global_sid_Builtin_Account_Operators = /* Builtin account operators */ { 1, 2, {0,0,0,0,0,5}, {32,548,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Builtin_Server_Operators = /* Builtin server operators */ +const struct dom_sid global_sid_Builtin_Server_Operators = /* Builtin server operators */ { 1, 2, {0,0,0,0,0,5}, {32,549,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Builtin_Print_Operators = /* Builtin print operators */ +const struct dom_sid global_sid_Builtin_Print_Operators = /* Builtin print operators */ { 1, 2, {0,0,0,0,0,5}, {32,550,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Builtin_Backup_Operators = /* Builtin backup operators */ +const struct dom_sid global_sid_Builtin_Backup_Operators = /* Builtin backup operators */ { 1, 2, {0,0,0,0,0,5}, {32,551,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Builtin_Replicator = /* Builtin replicator */ +const struct dom_sid global_sid_Builtin_Replicator = /* Builtin replicator */ { 1, 2, {0,0,0,0,0,5}, {32,552,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Builtin_PreWin2kAccess = /* Builtin pre win2k access */ +const struct dom_sid global_sid_Builtin_PreWin2kAccess = /* Builtin pre win2k access */ { 1, 2, {0,0,0,0,0,5}, {32,554,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Unix_Users = /* Unmapped Unix users */ +const struct dom_sid global_sid_Unix_Users = /* Unmapped Unix users */ { 1, 1, {0,0,0,0,0,22}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; -const DOM_SID global_sid_Unix_Groups = /* Unmapped Unix groups */ +const struct dom_sid global_sid_Unix_Groups = /* Unmapped Unix groups */ { 1, 1, {0,0,0,0,0,22}, {2,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}; /* Unused, left here for documentary purposes */ @@ -100,13 +100,13 @@ const DOM_SID global_sid_Unix_Groups = /* Unmapped Unix groups */ * An NT compatible anonymous token. */ -static DOM_SID anon_sid_array[3] = +static struct dom_sid anon_sid_array[3] = { { 1, 1, {0,0,0,0,0,1}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}, { 1, 1, {0,0,0,0,0,5}, {2,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}, { 1, 1, {0,0,0,0,0,5}, {7,0,0,0,0,0,0,0,0,0,0,0,0,0,0}} }; NT_USER_TOKEN anonymous_token = { 3, anon_sid_array, SE_NONE }; -static DOM_SID system_sid_array[1] = +static struct dom_sid system_sid_array[1] = { { 1, 1, {0,0,0,0,0,5}, {18,0,0,0,0,0,0,0,0,0,0,0,0,0,0}} }; NT_USER_TOKEN system_token = { 1, system_sid_array, SE_ALL_PRIVS }; @@ -172,7 +172,7 @@ const char *get_global_sam_name(void) Convert a SID to an ascii string. *****************************************************************/ -char *sid_to_fstring(fstring sidstr_out, const DOM_SID *sid) +char *sid_to_fstring(fstring sidstr_out, const struct dom_sid *sid) { char *str = sid_string_talloc(talloc_tos(), sid); fstrcpy(sidstr_out, str); @@ -188,7 +188,7 @@ char *sid_to_fstring(fstring sidstr_out, const DOM_SID *sid) be turned around if necessary *****************************************************************/ -char *sid_string_talloc(TALLOC_CTX *mem_ctx, const DOM_SID *sid) +char *sid_string_talloc(TALLOC_CTX *mem_ctx, const struct dom_sid *sid) { char *result = dom_sid_string(mem_ctx, sid); SMB_ASSERT(result != NULL); @@ -199,7 +199,7 @@ char *sid_string_talloc(TALLOC_CTX *mem_ctx, const DOM_SID *sid) Useful function for debug lines. *****************************************************************/ -char *sid_string_dbg(const DOM_SID *sid) +char *sid_string_dbg(const struct dom_sid *sid) { return sid_string_talloc(talloc_tos(), sid); } @@ -208,7 +208,7 @@ char *sid_string_dbg(const DOM_SID *sid) Use with care! *****************************************************************/ -char *sid_string_tos(const DOM_SID *sid) +char *sid_string_tos(const struct dom_sid *sid) { return sid_string_talloc(talloc_tos(), sid); } @@ -217,7 +217,7 @@ char *sid_string_tos(const DOM_SID *sid) Convert a string to a SID. Returns True on success, False on fail. *****************************************************************/ -bool string_to_sid(DOM_SID *sidout, const char *sidstr) +bool string_to_sid(struct dom_sid *sidout, const char *sidstr) { const char *p; char *q; @@ -302,7 +302,7 @@ format_error: Add a rid to the end of a sid *****************************************************************/ -bool sid_append_rid(DOM_SID *sid, uint32 rid) +bool sid_append_rid(struct dom_sid *sid, uint32 rid) { if (sid->num_auths < MAXSUBAUTHS) { sid->sub_auths[sid->num_auths++] = rid; @@ -311,7 +311,7 @@ bool sid_append_rid(DOM_SID *sid, uint32 rid) return False; } -bool sid_compose(DOM_SID *dst, const DOM_SID *domain_sid, uint32 rid) +bool sid_compose(struct dom_sid *dst, const struct dom_sid *domain_sid, uint32 rid) { sid_copy(dst, domain_sid); return sid_append_rid(dst, rid); @@ -321,7 +321,7 @@ bool sid_compose(DOM_SID *dst, const DOM_SID *domain_sid, uint32 rid) Removes the last rid from the end of a sid *****************************************************************/ -bool sid_split_rid(DOM_SID *sid, uint32 *rid) +bool sid_split_rid(struct dom_sid *sid, uint32 *rid) { if (sid->num_auths > 0) { sid->num_auths--; @@ -335,7 +335,7 @@ bool sid_split_rid(DOM_SID *sid, uint32 *rid) Return the last rid from the end of a sid *****************************************************************/ -bool sid_peek_rid(const DOM_SID *sid, uint32 *rid) +bool sid_peek_rid(const struct dom_sid *sid, uint32 *rid) { if (!sid || !rid) return False; @@ -352,7 +352,7 @@ bool sid_peek_rid(const DOM_SID *sid, uint32 *rid) and check the sid against the exp_dom_sid *****************************************************************/ -bool sid_peek_check_rid(const DOM_SID *exp_dom_sid, const DOM_SID *sid, uint32 *rid) +bool sid_peek_check_rid(const struct dom_sid *exp_dom_sid, const struct dom_sid *sid, uint32 *rid) { if (!exp_dom_sid || !sid || !rid) return False; @@ -373,7 +373,7 @@ bool sid_peek_check_rid(const DOM_SID *exp_dom_sid, const DOM_SID *sid, uint32 * Copies a sid *****************************************************************/ -void sid_copy(DOM_SID *dst, const DOM_SID *src) +void sid_copy(struct dom_sid *dst, const struct dom_sid *src) { int i; @@ -392,7 +392,7 @@ void sid_copy(DOM_SID *dst, const DOM_SID *src) Write a sid out into on-the-wire format. *****************************************************************/ -bool sid_linearize(char *outbuf, size_t len, const DOM_SID *sid) +bool sid_linearize(char *outbuf, size_t len, const struct dom_sid *sid) { size_t i; @@ -409,10 +409,10 @@ bool sid_linearize(char *outbuf, size_t len, const DOM_SID *sid) } /***************************************************************** - Parse a on-the-wire SID to a DOM_SID. + Parse a on-the-wire SID to a struct dom_sid. *****************************************************************/ -bool sid_parse(const char *inbuf, size_t len, DOM_SID *sid) +bool sid_parse(const char *inbuf, size_t len, struct dom_sid *sid) { int i; if (len < 8) @@ -434,7 +434,7 @@ bool sid_parse(const char *inbuf, size_t len, DOM_SID *sid) Compare the auth portion of two sids. *****************************************************************/ -static int sid_compare_auth(const DOM_SID *sid1, const DOM_SID *sid2) +static int sid_compare_auth(const struct dom_sid *sid1, const struct dom_sid *sid2) { int i; @@ -459,7 +459,7 @@ static int sid_compare_auth(const DOM_SID *sid1, const DOM_SID *sid2) Compare two sids. *****************************************************************/ -int sid_compare(const DOM_SID *sid1, const DOM_SID *sid2) +int sid_compare(const struct dom_sid *sid1, const struct dom_sid *sid2) { int i; @@ -486,7 +486,7 @@ int sid_compare(const DOM_SID *sid1, const DOM_SID *sid2) this just compares the leading sub-auths *****************************************************************/ -int sid_compare_domain(const DOM_SID *sid1, const DOM_SID *sid2) +int sid_compare_domain(const struct dom_sid *sid1, const struct dom_sid *sid2) { int n, i; @@ -503,7 +503,7 @@ int sid_compare_domain(const DOM_SID *sid1, const DOM_SID *sid2) Compare two sids. *****************************************************************/ -bool sid_equal(const DOM_SID *sid1, const DOM_SID *sid2) +bool sid_equal(const struct dom_sid *sid1, const struct dom_sid *sid2) { return sid_compare(sid1, sid2) == 0; } @@ -512,9 +512,9 @@ bool sid_equal(const DOM_SID *sid1, const DOM_SID *sid2) Returns true if SID is internal (and non-mappable). *****************************************************************/ -bool non_mappable_sid(DOM_SID *sid) +bool non_mappable_sid(struct dom_sid *sid) { - DOM_SID dom; + struct dom_sid dom; uint32 rid; sid_copy(&dom, sid); @@ -530,11 +530,11 @@ bool non_mappable_sid(DOM_SID *sid) } /***************************************************************** - Return the binary string representation of a DOM_SID. + Return the binary string representation of a struct dom_sid. Caller must free. *****************************************************************/ -char *sid_binstring(TALLOC_CTX *mem_ctx, const DOM_SID *sid) +char *sid_binstring(TALLOC_CTX *mem_ctx, const struct dom_sid *sid) { uint8_t *buf; char *s; @@ -550,11 +550,11 @@ char *sid_binstring(TALLOC_CTX *mem_ctx, const DOM_SID *sid) } /***************************************************************** - Return the binary string representation of a DOM_SID. + Return the binary string representation of a struct dom_sid. Caller must free. *****************************************************************/ -char *sid_binstring_hex(const DOM_SID *sid) +char *sid_binstring_hex(const struct dom_sid *sid) { char *buf, *s; int len = ndr_size_dom_sid(sid, 0); @@ -590,10 +590,10 @@ struct dom_sid *sid_dup_talloc(TALLOC_CTX *ctx, const struct dom_sid *src) Add SID to an array SIDs ********************************************************************/ -NTSTATUS add_sid_to_array(TALLOC_CTX *mem_ctx, const DOM_SID *sid, - DOM_SID **sids, size_t *num) +NTSTATUS add_sid_to_array(TALLOC_CTX *mem_ctx, const struct dom_sid *sid, + struct dom_sid **sids, size_t *num) { - *sids = TALLOC_REALLOC_ARRAY(mem_ctx, *sids, DOM_SID, + *sids = TALLOC_REALLOC_ARRAY(mem_ctx, *sids, struct dom_sid, (*num)+1); if (*sids == NULL) { *num = 0; @@ -611,8 +611,8 @@ NTSTATUS add_sid_to_array(TALLOC_CTX *mem_ctx, const DOM_SID *sid, Add SID to an array SIDs ensuring that it is not already there ********************************************************************/ -NTSTATUS add_sid_to_array_unique(TALLOC_CTX *mem_ctx, const DOM_SID *sid, - DOM_SID **sids, size_t *num_sids) +NTSTATUS add_sid_to_array_unique(TALLOC_CTX *mem_ctx, const struct dom_sid *sid, + struct dom_sid **sids, size_t *num_sids) { size_t i; @@ -628,9 +628,9 @@ NTSTATUS add_sid_to_array_unique(TALLOC_CTX *mem_ctx, const DOM_SID *sid, Remove SID from an array ********************************************************************/ -void del_sid_from_array(const DOM_SID *sid, DOM_SID **sids, size_t *num) +void del_sid_from_array(const struct dom_sid *sid, struct dom_sid **sids, size_t *num) { - DOM_SID *sid_list = *sids; + struct dom_sid *sid_list = *sids; size_t i; for ( i=0; i<*num; i++ ) { @@ -675,13 +675,13 @@ bool add_rid_to_array_unique(TALLOC_CTX *mem_ctx, return True; } -bool is_null_sid(const DOM_SID *sid) +bool is_null_sid(const struct dom_sid *sid) { - static const DOM_SID null_sid = {0}; + static const struct dom_sid null_sid = {0}; return sid_equal(sid, &null_sid); } -bool is_sid_in_token(const NT_USER_TOKEN *token, const DOM_SID *sid) +bool is_sid_in_token(const NT_USER_TOKEN *token, const struct dom_sid *sid) { int i; @@ -694,14 +694,14 @@ bool is_sid_in_token(const NT_USER_TOKEN *token, const DOM_SID *sid) NTSTATUS sid_array_from_info3(TALLOC_CTX *mem_ctx, const struct netr_SamInfo3 *info3, - DOM_SID **user_sids, + struct dom_sid **user_sids, size_t *num_user_sids, bool include_user_group_rid, bool skip_ressource_groups) { NTSTATUS status; - DOM_SID sid; - DOM_SID *sid_array = NULL; + struct dom_sid sid; + struct dom_sid *sid_array = NULL; size_t num_sids = 0; int i; diff --git a/source3/lib/winbind_util.c b/source3/lib/winbind_util.c index 0c904ac569..9b95809aee 100644 --- a/source3/lib/winbind_util.c +++ b/source3/lib/winbind_util.c @@ -41,7 +41,7 @@ struct passwd * winbind_getpwnam(const char * name) return pwd; } -struct passwd * winbind_getpwsid(const DOM_SID *sid) +struct passwd * winbind_getpwsid(const struct dom_sid *sid) { wbcErr result; struct passwd * tmp_pwd = NULL; @@ -63,7 +63,7 @@ struct passwd * winbind_getpwsid(const DOM_SID *sid) /* Call winbindd to convert a name to a sid */ -bool winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid, +bool winbind_lookup_name(const char *dom_name, const char *name, struct dom_sid *sid, enum lsa_SidType *name_type) { struct wbcDomainSid dom_sid; @@ -74,7 +74,7 @@ bool winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid, if (result != WBC_ERR_SUCCESS) return false; - memcpy(sid, &dom_sid, sizeof(DOM_SID)); + memcpy(sid, &dom_sid, sizeof(struct dom_sid)); *name_type = (enum lsa_SidType)type; return true; @@ -82,7 +82,7 @@ bool winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid, /* Call winbindd to convert sid to name */ -bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, +bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid, const char **domain, const char **name, enum lsa_SidType *name_type) { @@ -134,7 +134,7 @@ bool winbind_ping(void) /* Call winbindd to convert SID to uid */ -bool winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid) +bool winbind_sid_to_uid(uid_t *puid, const struct dom_sid *sid) { struct wbcDomainSid dom_sid; wbcErr result; @@ -148,14 +148,14 @@ bool winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid) /* Call winbindd to convert uid to sid */ -bool winbind_uid_to_sid(DOM_SID *sid, uid_t uid) +bool winbind_uid_to_sid(struct dom_sid *sid, uid_t uid) { struct wbcDomainSid dom_sid; wbcErr result; result = wbcUidToSid(uid, &dom_sid); if (result == WBC_ERR_SUCCESS) { - memcpy(sid, &dom_sid, sizeof(DOM_SID)); + memcpy(sid, &dom_sid, sizeof(struct dom_sid)); } else { sid_copy(sid, &global_sid_NULL); } @@ -165,7 +165,7 @@ bool winbind_uid_to_sid(DOM_SID *sid, uid_t uid) /* Call winbindd to convert SID to gid */ -bool winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid) +bool winbind_sid_to_gid(gid_t *pgid, const struct dom_sid *sid) { struct wbcDomainSid dom_sid; wbcErr result; @@ -179,14 +179,14 @@ bool winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid) /* Call winbindd to convert gid to sid */ -bool winbind_gid_to_sid(DOM_SID *sid, gid_t gid) +bool winbind_gid_to_sid(struct dom_sid *sid, gid_t gid) { struct wbcDomainSid dom_sid; wbcErr result; result = wbcGidToSid(gid, &dom_sid); if (result == WBC_ERR_SUCCESS) { - memcpy(sid, &dom_sid, sizeof(DOM_SID)); + memcpy(sid, &dom_sid, sizeof(struct dom_sid)); } else { sid_copy(sid, &global_sid_NULL); } @@ -213,7 +213,7 @@ wbcErr wb_is_trusted_domain(const char *domain) /* Lookup a set of rids in a given domain */ bool winbind_lookup_rids(TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, int num_rids, uint32 *rids, const char **domain_name, const char ***names, enum lsa_SidType **types) @@ -295,8 +295,8 @@ bool winbind_get_groups(TALLOC_CTX * mem_ctx, const char *account, uint32_t *num } bool winbind_get_sid_aliases(TALLOC_CTX *mem_ctx, - const DOM_SID *dom_sid, - const DOM_SID *members, + const struct dom_sid *dom_sid, + const struct dom_sid *members, size_t num_members, uint32_t **pp_alias_rids, size_t *p_num_alias_rids) @@ -346,12 +346,12 @@ struct passwd * winbind_getpwnam(const char * name) return NULL; } -struct passwd * winbind_getpwsid(const DOM_SID *sid) +struct passwd * winbind_getpwsid(const struct dom_sid *sid) { return NULL; } -bool winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid, +bool winbind_lookup_name(const char *dom_name, const char *name, struct dom_sid *sid, enum lsa_SidType *name_type) { return false; @@ -359,7 +359,7 @@ bool winbind_lookup_name(const char *dom_name, const char *name, DOM_SID *sid, /* Call winbindd to convert sid to name */ -bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, +bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid, const char **domain, const char **name, enum lsa_SidType *name_type) { @@ -375,28 +375,28 @@ bool winbind_ping(void) /* Call winbindd to convert SID to uid */ -bool winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid) +bool winbind_sid_to_uid(uid_t *puid, const struct dom_sid *sid) { return false; } /* Call winbindd to convert uid to sid */ -bool winbind_uid_to_sid(DOM_SID *sid, uid_t uid) +bool winbind_uid_to_sid(struct dom_sid *sid, uid_t uid) { return false; } /* Call winbindd to convert SID to gid */ -bool winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid) +bool winbind_sid_to_gid(gid_t *pgid, const struct dom_sid *sid) { return false; } /* Call winbindd to convert gid to sid */ -bool winbind_gid_to_sid(DOM_SID *sid, gid_t gid) +bool winbind_gid_to_sid(struct dom_sid *sid, gid_t gid) { return false; } @@ -411,7 +411,7 @@ wbcErr wb_is_trusted_domain(const char *domain) /* Lookup a set of rids in a given domain */ bool winbind_lookup_rids(TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, int num_rids, uint32 *rids, const char **domain_name, const char ***names, enum lsa_SidType **types) @@ -439,8 +439,8 @@ bool winbind_get_groups(TALLOC_CTX *mem_ctx, const char *account, uint32_t *num_ } bool winbind_get_sid_aliases(TALLOC_CTX *mem_ctx, - const DOM_SID *dom_sid, - const DOM_SID *members, + const struct dom_sid *dom_sid, + const struct dom_sid *members, size_t num_members, uint32_t **pp_alias_rids, size_t *p_num_alias_rids) diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index ed5aee1d8a..8d4b86c8b2 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -2139,7 +2139,7 @@ static void dump_sid(ADS_STRUCT *ads, const char *field, struct berval **values) { int i; for (i=0; values[i]; i++) { - DOM_SID sid; + struct dom_sid sid; fstring tmp; sid_parse(values[i]->bv_val, values[i]->bv_len, &sid); printf("%s: %s\n", field, sid_to_fstring(tmp, &sid)); @@ -2622,7 +2622,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res) /** - * pull a single DOM_SID from a ADS result + * pull a single struct dom_sid from a ADS result * @param ads connection to ads server * @param msg Results of search * @param field Attribute to retrieve @@ -2630,13 +2630,13 @@ int ads_count_replies(ADS_STRUCT *ads, void *res) * @return boolean inidicating success */ bool ads_pull_sid(ADS_STRUCT *ads, LDAPMessage *msg, const char *field, - DOM_SID *sid) + struct dom_sid *sid) { return smbldap_pull_sid(ads->ldap.ld, msg, field, sid); } /** - * pull an array of DOM_SIDs from a ADS result + * pull an array of struct dom_sids from a ADS result * @param ads connection to ads server * @param mem_ctx TALLOC_CTX for allocating sid array * @param msg Results of search @@ -2645,7 +2645,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res) * @return the count of SIDs pulled **/ int ads_pull_sids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, - LDAPMessage *msg, const char *field, DOM_SID **sids) + LDAPMessage *msg, const char *field, struct dom_sid **sids) { struct berval **values; bool ret; @@ -2660,7 +2660,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res) /* nop */ ; if (i) { - (*sids) = TALLOC_ARRAY(mem_ctx, DOM_SID, i); + (*sids) = TALLOC_ARRAY(mem_ctx, struct dom_sid, i); if (!(*sids)) { ldap_value_free_len(values); return 0; @@ -2926,7 +2926,7 @@ done: * @param sid Pointer to domain sid * @return status of search **/ -ADS_STATUS ads_domain_sid(ADS_STRUCT *ads, DOM_SID *sid) +ADS_STATUS ads_domain_sid(ADS_STRUCT *ads, struct dom_sid *sid) { const char *attrs[] = {"objectSid", NULL}; LDAPMessage *res; @@ -3165,11 +3165,11 @@ ADS_STATUS ads_get_joinable_ous(ADS_STRUCT *ads, /** - * pull a DOM_SID from an extended dn string + * pull a struct dom_sid from an extended dn string * @param mem_ctx TALLOC_CTX * @param extended_dn string * @param flags string type of extended_dn - * @param sid pointer to a DOM_SID + * @param sid pointer to a struct dom_sid * @return NT_STATUS_OK on success, * NT_INVALID_PARAMETER on error, * NT_STATUS_NOT_FOUND if no SID present @@ -3177,7 +3177,7 @@ ADS_STATUS ads_get_joinable_ous(ADS_STRUCT *ads, ADS_STATUS ads_get_sid_from_extended_dn(TALLOC_CTX *mem_ctx, const char *extended_dn, enum ads_extended_dn_flags flags, - DOM_SID *sid) + struct dom_sid *sid) { char *p, *q, *dn; @@ -3252,7 +3252,7 @@ ADS_STATUS ads_get_sid_from_extended_dn(TALLOC_CTX *mem_ctx, } /** - * pull an array of DOM_SIDs from a ADS result + * pull an array of struct dom_sids from a ADS result * @param ads connection to ads server * @param mem_ctx TALLOC_CTX for allocating sid array * @param msg Results of search @@ -3266,7 +3266,7 @@ ADS_STATUS ads_get_sid_from_extended_dn(TALLOC_CTX *mem_ctx, LDAPMessage *msg, const char *field, enum ads_extended_dn_flags flags, - DOM_SID **sids) + struct dom_sid **sids) { int i; ADS_STATUS rc; @@ -3278,7 +3278,7 @@ ADS_STATUS ads_get_sid_from_extended_dn(TALLOC_CTX *mem_ctx, return 0; } - (*sids) = TALLOC_ZERO_ARRAY(mem_ctx, DOM_SID, dn_count + 1); + (*sids) = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, dn_count + 1); if (!(*sids)) { TALLOC_FREE(dn_strings); return 0; @@ -3583,8 +3583,8 @@ ADS_STATUS ads_leave_realm(ADS_STRUCT *ads, const char *hostname) * @param ads connection to ads server * @param mem_ctx TALLOC_CTX for allocating sid array * @param dn of LDAP object - * @param user_sid pointer to DOM_SID (objectSid) - * @param primary_group_sid pointer to DOM_SID (self composed) + * @param user_sid pointer to struct dom_sid (objectSid) + * @param primary_group_sid pointer to struct dom_sid (self composed) * @param sids pointer to sid array to allocate * @param num_sids counter of SIDs pulled * @return status of token query @@ -3592,18 +3592,18 @@ ADS_STATUS ads_leave_realm(ADS_STRUCT *ads, const char *hostname) ADS_STATUS ads_get_tokensids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char *dn, - DOM_SID *user_sid, - DOM_SID *primary_group_sid, - DOM_SID **sids, + struct dom_sid *user_sid, + struct dom_sid *primary_group_sid, + struct dom_sid **sids, size_t *num_sids) { ADS_STATUS status; LDAPMessage *res = NULL; int count = 0; size_t tmp_num_sids; - DOM_SID *tmp_sids; - DOM_SID tmp_user_sid; - DOM_SID tmp_primary_group_sid; + struct dom_sid *tmp_sids; + struct dom_sid tmp_user_sid; + struct dom_sid tmp_primary_group_sid; uint32 pgid; const char *attrs[] = { "objectSid", @@ -3637,7 +3637,7 @@ ADS_STATUS ads_leave_realm(ADS_STRUCT *ads, const char *hostname) /* hack to compose the primary group sid without knowing the * domsid */ - DOM_SID domsid; + struct dom_sid domsid; uint32 dummy_rid; sid_copy(&domsid, &tmp_user_sid); diff --git a/source3/libads/ldap_utils.c b/source3/libads/ldap_utils.c index 871449a81a..f9106caed1 100644 --- a/source3/libads/ldap_utils.c +++ b/source3/libads/ldap_utils.c @@ -199,7 +199,7 @@ static ADS_STATUS ads_do_search_retry_internal(ADS_STRUCT *ads, const char *bind } ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res, - const DOM_SID *sid, + const struct dom_sid *sid, const char **attrs) { char *dn, *sid_string; diff --git a/source3/libgpo/gpo_proto.h b/source3/libgpo/gpo_proto.h index e093d1eb0c..e77e0351ec 100644 --- a/source3/libgpo/gpo_proto.h +++ b/source3/libgpo/gpo_proto.h @@ -49,12 +49,12 @@ WERROR gp_reg_state_store(TALLOC_CTX *mem_ctx, struct GROUP_POLICY_OBJECT *gpo_list); WERROR gp_reg_state_read(TALLOC_CTX *mem_ctx, uint32_t flags, - const DOM_SID *sid, + const struct dom_sid *sid, struct GROUP_POLICY_OBJECT **gpo_list); WERROR gp_secure_key(TALLOC_CTX *mem_ctx, uint32_t flags, struct registry_key *key, - const DOM_SID *sid); + const struct dom_sid *sid); void dump_reg_val(int lvl, const char *direction, const char *key, const char *subkey, struct registry_value *val); diff --git a/source3/libgpo/gpo_reg.c b/source3/libgpo/gpo_reg.c index b764eaffab..5f6a97cec7 100644 --- a/source3/libgpo/gpo_reg.c +++ b/source3/libgpo/gpo_reg.c @@ -297,7 +297,7 @@ static WERROR gp_store_reg_gpovals(TALLOC_CTX *mem_ctx, ****************************************************************/ static const char *gp_reg_groupmembership_path(TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, uint32_t flags) { if (flags & GPO_LIST_FLAG_MACHINE) { @@ -375,7 +375,7 @@ static WERROR gp_reg_store_groupmembership(TALLOC_CTX *mem_ctx, /* not used yet */ static WERROR gp_reg_read_groupmembership(TALLOC_CTX *mem_ctx, struct gp_registry_context *reg_ctx, - const DOM_SID *object_sid, + const struct dom_sid *object_sid, struct nt_user_token **token, uint32_t flags) { @@ -426,7 +426,7 @@ static WERROR gp_reg_read_groupmembership(TALLOC_CTX *mem_ctx, ****************************************************************/ static const char *gp_req_state_path(TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, uint32_t flags) { if (flags & GPO_LIST_FLAG_MACHINE) { @@ -612,7 +612,7 @@ static WERROR gp_read_reg_gpo(TALLOC_CTX *mem_ctx, WERROR gp_reg_state_read(TALLOC_CTX *mem_ctx, uint32_t flags, - const DOM_SID *sid, + const struct dom_sid *sid, struct GROUP_POLICY_OBJECT **gpo_list) { struct gp_registry_context *reg_ctx = NULL; @@ -687,7 +687,7 @@ WERROR gp_reg_state_read(TALLOC_CTX *mem_ctx, ****************************************************************/ static WERROR gp_reg_generate_sd(TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, struct security_descriptor **sd, size_t *sd_size) { @@ -758,11 +758,11 @@ static WERROR gp_reg_generate_sd(TALLOC_CTX *mem_ctx, WERROR gp_secure_key(TALLOC_CTX *mem_ctx, uint32_t flags, struct registry_key *key, - const DOM_SID *sid) + const struct dom_sid *sid) { struct security_descriptor *sd = NULL; size_t sd_size = 0; - const DOM_SID *sd_sid = NULL; + const struct dom_sid *sd_sid = NULL; WERROR werr; if (!(flags & GPO_LIST_FLAG_MACHINE)) { diff --git a/source3/libnet/libnet_samsync_passdb.c b/source3/libnet/libnet_samsync_passdb.c index 51f96dc398..f90ece5ed9 100644 --- a/source3/libnet/libnet_samsync_passdb.c +++ b/source3/libnet/libnet_samsync_passdb.c @@ -299,8 +299,8 @@ static NTSTATUS fetch_account_info(TALLOC_CTX *mem_ctx, struct samu *sam_account=NULL; GROUP_MAP map; struct group *grp; - DOM_SID user_sid; - DOM_SID group_sid; + struct dom_sid user_sid; + struct dom_sid group_sid; struct passwd *passwd = NULL; fstring sid_string; @@ -385,7 +385,7 @@ static NTSTATUS fetch_group_info(TALLOC_CTX *mem_ctx, fstring name; fstring comment; struct group *grp = NULL; - DOM_SID group_sid; + struct dom_sid group_sid; fstring sid_string; GROUP_MAP map; bool insert = true; @@ -449,7 +449,7 @@ static NTSTATUS fetch_group_mem_info(TALLOC_CTX *mem_ctx, int i; char **nt_members = NULL; char **unix_members; - DOM_SID group_sid; + struct dom_sid group_sid; GROUP_MAP map; struct group *grp; @@ -482,7 +482,7 @@ static NTSTATUS fetch_group_mem_info(TALLOC_CTX *mem_ctx, for (i=0; i < r->num_rids; i++) { struct samu *member = NULL; - DOM_SID member_sid; + struct dom_sid member_sid; if ( !(member = samu_new(mem_ctx)) ) { return NT_STATUS_NO_MEMORY; @@ -569,12 +569,12 @@ static NTSTATUS fetch_group_mem_info(TALLOC_CTX *mem_ctx, static NTSTATUS fetch_alias_info(TALLOC_CTX *mem_ctx, uint32_t rid, struct netr_DELTA_ALIAS *r, - const DOM_SID *dom_sid) + const struct dom_sid *dom_sid) { fstring name; fstring comment; struct group *grp = NULL; - DOM_SID alias_sid; + struct dom_sid alias_sid; fstring sid_string; GROUP_MAP map; bool insert = true; @@ -630,7 +630,7 @@ static NTSTATUS fetch_alias_info(TALLOC_CTX *mem_ctx, static NTSTATUS fetch_alias_mem(TALLOC_CTX *mem_ctx, uint32_t rid, struct netr_DELTA_ALIAS_MEMBER *r, - const DOM_SID *dom_sid) + const struct dom_sid *dom_sid) { return NT_STATUS_OK; } diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c index ca530a8583..1b72e33303 100644 --- a/source3/libsmb/clidgram.c +++ b/source3/libsmb/clidgram.c @@ -131,7 +131,7 @@ bool send_getdc_request(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, struct sockaddr_storage *dc_ss, const char *domain_name, - const DOM_SID *sid, + const struct dom_sid *sid, uint32_t nt_version) { struct in_addr dc_ip; diff --git a/source3/libsmb/cliquota.c b/source3/libsmb/cliquota.c index e15d5df24d..3cd4edf165 100644 --- a/source3/libsmb/cliquota.c +++ b/source3/libsmb/cliquota.c @@ -568,7 +568,7 @@ static const char *quota_str_static(uint64_t val, bool special, bool _numeric) return result; } -void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric)) +void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric)) { TALLOC_CTX *frame = talloc_stackframe(); @@ -621,7 +621,7 @@ void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_ return; } -void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, bool _numeric)) +void dump_ntquota_list(SMB_NTQUOTA_LIST **qtl, bool _verbose, bool _numeric, void (*_sidtostring)(fstring str, struct dom_sid *sid, bool _numeric)) { SMB_NTQUOTA_LIST *cur; diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c index 38a9462077..cc87715d8f 100644 --- a/source3/libsmb/libsmb_xattr.c +++ b/source3/libsmb/libsmb_xattr.c @@ -168,7 +168,7 @@ convert_sid_to_string(struct cli_state *ipc_cli, struct policy_handle *pol, fstring str, bool numeric, - DOM_SID *sid) + struct dom_sid *sid) { char **domains = NULL; char **names = NULL; @@ -212,11 +212,11 @@ static bool convert_string_to_sid(struct cli_state *ipc_cli, struct policy_handle *pol, bool numeric, - DOM_SID *sid, + struct dom_sid *sid, const char *str) { enum lsa_SidType *types = NULL; - DOM_SID *sids = NULL; + struct dom_sid *sids = NULL; bool result = True; TALLOC_CTX *ctx = NULL; struct rpc_pipe_client *pipe_hnd = find_lsa_pipe_hnd(ipc_cli); @@ -264,7 +264,7 @@ parse_ace(struct cli_state *ipc_cli, unsigned int atype; unsigned int aflags; unsigned int amask; - DOM_SID sid; + struct dom_sid sid; uint32_t mask; const struct perm_value *v; struct perm_value { @@ -427,8 +427,8 @@ sec_desc_parse(TALLOC_CTX *ctx, char *tok; struct security_descriptor *ret = NULL; size_t sd_size; - DOM_SID *group_sid=NULL; - DOM_SID *owner_sid=NULL; + struct dom_sid *group_sid=NULL; + struct dom_sid *owner_sid=NULL; struct security_acl *dacl=NULL; int revision=1; @@ -444,7 +444,7 @@ sec_desc_parse(TALLOC_CTX *ctx, DEBUG(5,("OWNER specified more than once!\n")); goto done; } - owner_sid = SMB_CALLOC_ARRAY(DOM_SID, 1); + owner_sid = SMB_CALLOC_ARRAY(struct dom_sid, 1); if (!owner_sid || !convert_string_to_sid(ipc_cli, pol, numeric, @@ -460,7 +460,7 @@ sec_desc_parse(TALLOC_CTX *ctx, DEBUG(5,("OWNER specified more than once!\n")); goto done; } - owner_sid = SMB_CALLOC_ARRAY(DOM_SID, 1); + owner_sid = SMB_CALLOC_ARRAY(struct dom_sid, 1); if (!owner_sid || !convert_string_to_sid(ipc_cli, pol, False, @@ -476,7 +476,7 @@ sec_desc_parse(TALLOC_CTX *ctx, DEBUG(5,("GROUP specified more than once!\n")); goto done; } - group_sid = SMB_CALLOC_ARRAY(DOM_SID, 1); + group_sid = SMB_CALLOC_ARRAY(struct dom_sid, 1); if (!group_sid || !convert_string_to_sid(ipc_cli, pol, numeric, @@ -492,7 +492,7 @@ sec_desc_parse(TALLOC_CTX *ctx, DEBUG(5,("GROUP specified more than once!\n")); goto done; } - group_sid = SMB_CALLOC_ARRAY(DOM_SID, 1); + group_sid = SMB_CALLOC_ARRAY(struct dom_sid, 1); if (!group_sid || !convert_string_to_sid(ipc_cli, pol, False, @@ -1504,8 +1504,8 @@ cacl_set(SMBCCTX *context, int err = 0; struct security_descriptor *sd = NULL, *old; struct security_acl *dacl = NULL; - DOM_SID *owner_sid = NULL; - DOM_SID *group_sid = NULL; + struct dom_sid *owner_sid = NULL; + struct dom_sid *group_sid = NULL; uint32 i, j; size_t sd_size; int ret = 0; diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c index 738e4b3281..7f096ece76 100644 --- a/source3/libsmb/samlogon_cache.c +++ b/source3/libsmb/samlogon_cache.c @@ -100,7 +100,7 @@ bool netsamlogon_cache_shutdown(void) void netsamlogon_clear_cached_user(struct netr_SamInfo3 *info3) { - DOM_SID user_sid; + struct dom_sid user_sid; fstring keystr, tmp; if (!info3) { @@ -133,7 +133,7 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3) TDB_DATA data; fstring keystr, tmp; bool result = false; - DOM_SID user_sid; + struct dom_sid user_sid; time_t t = time(NULL); TALLOC_CTX *mem_ctx; DATA_BLOB blob; @@ -203,7 +203,7 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3) free the user_info struct (malloc()'d memory) ***********************************************************************/ -struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid) +struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct dom_sid *user_sid) { struct netr_SamInfo3 *info3 = NULL; TDB_DATA data; @@ -276,7 +276,7 @@ struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const DOM_SID * #endif } -bool netsamlogon_cache_have(const DOM_SID *user_sid) +bool netsamlogon_cache_have(const struct dom_sid *user_sid) { TALLOC_CTX *mem_ctx = talloc_init("netsamlogon_cache_have"); struct netr_SamInfo3 *info3 = NULL; diff --git a/source3/libsmb/trustdom_cache.c b/source3/libsmb/trustdom_cache.c index eb52b3588d..8c8f05f90e 100644 --- a/source3/libsmb/trustdom_cache.c +++ b/source3/libsmb/trustdom_cache.c @@ -95,7 +95,7 @@ static char* trustdom_cache_key(const char* name) * false if store attempt failed **/ -bool trustdom_cache_store(char* name, char* alt_name, const DOM_SID *sid, +bool trustdom_cache_store(char* name, char* alt_name, const struct dom_sid *sid, time_t timeout) { char *key, *alt_key; @@ -141,7 +141,7 @@ bool trustdom_cache_store(char* name, char* alt_name, const DOM_SID *sid, * false if has expired/doesn't exist **/ -bool trustdom_cache_fetch(const char* name, DOM_SID* sid) +bool trustdom_cache_fetch(const char* name, struct dom_sid* sid) { char *key = NULL, *value = NULL; time_t timeout; @@ -164,7 +164,7 @@ bool trustdom_cache_fetch(const char* name, DOM_SID* sid) DEBUG(5, ("trusted domain %s found (%s)\n", name, value)); } - /* convert sid string representation into DOM_SID structure */ + /* convert sid string representation into struct dom_sid structure */ if(! string_to_sid(sid, value)) { sid = NULL; SAFE_FREE(value); @@ -252,7 +252,7 @@ void trustdom_cache_flush(void) void update_trustdom_cache( void ) { char **domain_names; - DOM_SID *dom_sids; + struct dom_sid *dom_sids; uint32 num_domains; uint32 last_check; int time_diff; diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c index 6e549f4a23..3a2d6d70a1 100644 --- a/source3/libsmb/trusts_util.c +++ b/source3/libsmb/trusts_util.c @@ -137,7 +137,7 @@ NTSTATUS trust_pw_find_change_and_store_it(struct rpc_pipe_client *cli, bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain, char ***domain_names, uint32 *num_domains, - DOM_SID **sids ) + struct dom_sid **sids ) { struct policy_handle pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; @@ -202,7 +202,7 @@ bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain, goto done; } - *sids = TALLOC_ZERO_ARRAY(mem_ctx, DOM_SID, *num_domains); + *sids = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, *num_domains); if (!*sids) { result = NT_STATUS_NO_MEMORY; goto done; diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c index 72e7aeb2fd..875f18c3b3 100644 --- a/source3/modules/nfs4_acls.c +++ b/source3/modules/nfs4_acls.c @@ -197,8 +197,8 @@ static int smbacl4_fGetFileOwner(files_struct *fsp, SMB_STRUCT_STAT *psbuf) } static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx, SMB4ACL_T *theacl, /* in */ - DOM_SID *psid_owner, /* in */ - DOM_SID *psid_group, /* in */ + struct dom_sid *psid_owner, /* in */ + struct dom_sid *psid_group, /* in */ bool is_directory, /* in */ struct security_ace **ppnt_ace_list, /* out */ int *pgood_aces /* out */ @@ -224,7 +224,7 @@ static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx, SMB4ACL_T *theacl, /* in */ for (aceint=aclint->first; aceint!=NULL; aceint=(SMB_ACE4_INT_T *)aceint->next) { uint32_t mask; - DOM_SID sid; + struct dom_sid sid; SMB_ACE4PROP_T *ace = &aceint->prop; uint32_t mapped_ace_flags; @@ -293,7 +293,7 @@ static NTSTATUS smb_get_nt_acl_nfs4_common(const SMB_STRUCT_STAT *sbuf, struct security_descriptor **ppdesc, SMB4ACL_T *theacl) { int good_aces = 0; - DOM_SID sid_owner, sid_group; + struct dom_sid sid_owner, sid_group; size_t sd_size = 0; struct security_ace *nt_ace_list = NULL; struct security_acl *psa = NULL; @@ -481,8 +481,8 @@ static SMB_ACE4PROP_T *smbacl4_find_equal_special( return NULL; } -static bool nfs4_map_sid(smbacl4_vfs_params *params, const DOM_SID *src, - DOM_SID *dst) +static bool nfs4_map_sid(smbacl4_vfs_params *params, const struct dom_sid *src, + struct dom_sid *dst) { static struct db_context *mapping_db = NULL; TDB_DATA data; @@ -573,13 +573,13 @@ static bool smbacl4_fill_ace4( enum lsa_SidType type; uid_t uid; gid_t gid; - DOM_SID sid; + struct dom_sid sid; sid_copy(&sid, &ace_nt->trustee); if (!lookup_sid(mem_ctx, &sid, &dom, &name, &type)) { - DOM_SID mapped; + struct dom_sid mapped; if (!nfs4_map_sid(params, &sid, &mapped)) { DEBUG(1, ("nfs4_acls.c: file [%s]: SID %s " diff --git a/source3/modules/onefs_acl.c b/source3/modules/onefs_acl.c index 440858b578..3337dea255 100644 --- a/source3/modules/onefs_acl.c +++ b/source3/modules/onefs_acl.c @@ -38,7 +38,7 @@ const struct enum_list enum_onefs_acl_wire_format[] = { * Turn SID into UID/GID and setup a struct ifs_identity */ static bool -onefs_sid_to_identity(const DOM_SID *sid, struct ifs_identity *id, +onefs_sid_to_identity(const struct dom_sid *sid, struct ifs_identity *id, bool is_group) { enum ifs_identity_type type = IFS_ID_TYPE_LAST+1; @@ -80,7 +80,7 @@ onefs_sid_to_identity(const DOM_SID *sid, struct ifs_identity *id, * Turn struct ifs_identity into SID */ static bool -onefs_identity_to_sid(struct ifs_identity *id, DOM_SID *sid) +onefs_identity_to_sid(struct ifs_identity *id, struct dom_sid *sid) { if (!id || !sid) return false; @@ -116,10 +116,10 @@ onefs_identity_to_sid(struct ifs_identity *id, DOM_SID *sid) } static bool -onefs_og_to_identity(DOM_SID *sid, struct ifs_identity * ident, +onefs_og_to_identity(struct dom_sid *sid, struct ifs_identity * ident, bool is_group, int snum) { - const DOM_SID *b_admin_sid = &global_sid_Builtin_Administrators; + const struct dom_sid *b_admin_sid = &global_sid_Builtin_Administrators; if (!onefs_sid_to_identity(sid, ident, is_group)) { if (!lp_parm_bool(snum, PARM_ONEFS_TYPE, @@ -140,10 +140,10 @@ onefs_og_to_identity(DOM_SID *sid, struct ifs_identity * ident, } static bool -sid_in_ignore_list(DOM_SID * sid, int snum) +sid_in_ignore_list(struct dom_sid * sid, int snum) { const char ** sid_list = NULL; - DOM_SID match; + struct dom_sid match; sid_list = lp_parm_string_list(snum, PARM_ONEFS_TYPE, PARM_UNMAPPABLE_SIDS_IGNORE_LIST, @@ -323,7 +323,7 @@ onefs_acl_to_samba_acl(struct ifs_security_acl *acl, struct security_acl **samba } for (i = 0; i < num_aces; i++) { - DOM_SID sid; + struct dom_sid sid; if (!onefs_identity_to_sid(&acl->aces[i].trustee, &sid)) goto err_free; @@ -610,8 +610,8 @@ onefs_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32_t sd_size = 0; size_t size = 0; struct ifs_security_descriptor *sd = NULL; - DOM_SID owner_sid, group_sid; - DOM_SID *ownerp, *groupp; + struct dom_sid owner_sid, group_sid; + struct dom_sid *ownerp, *groupp; struct security_acl *dacl, *sacl; struct security_descriptor *pdesc; bool alloced = false; diff --git a/source3/modules/vfs_afsacl.c b/source3/modules/vfs_afsacl.c index 64c8ffc22e..1f495d9448 100644 --- a/source3/modules/vfs_afsacl.c +++ b/source3/modules/vfs_afsacl.c @@ -30,11 +30,11 @@ #define MAXSIZE 2048 -extern const DOM_SID global_sid_World; -extern const DOM_SID global_sid_Builtin_Administrators; -extern const DOM_SID global_sid_Builtin_Backup_Operators; -extern const DOM_SID global_sid_Authenticated_Users; -extern const DOM_SID global_sid_NULL; +extern const struct dom_sid global_sid_World; +extern const struct dom_sid global_sid_Builtin_Administrators; +extern const struct dom_sid global_sid_Builtin_Backup_Operators; +extern const struct dom_sid global_sid_Authenticated_Users; +extern const struct dom_sid global_sid_NULL; static char space_replacement = '%'; @@ -46,7 +46,7 @@ extern int afs_syscall(int, char *, int, char *, int); struct afs_ace { bool positive; char *name; - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; uint32 rights; struct afs_ace *next; @@ -108,7 +108,7 @@ static struct afs_ace *new_afs_ace(TALLOC_CTX *mem_ctx, bool positive, const char *name, uint32 rights) { - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; struct afs_ace *result; @@ -591,7 +591,7 @@ static size_t afs_to_nt_acl_common(struct afs_acl *afs_acl, struct security_descriptor **ppdesc) { struct security_ace *nt_ace_list; - DOM_SID owner_sid, group_sid; + struct dom_sid owner_sid, group_sid; struct security_acl *psa = NULL; int good_aces; size_t sd_size; @@ -695,9 +695,9 @@ static size_t afs_fto_nt_acl(struct afs_acl *afs_acl, return afs_to_nt_acl_common(afs_acl, &sbuf, security_info, ppdesc); } -static bool mappable_sid(const DOM_SID *sid) +static bool mappable_sid(const struct dom_sid *sid) { - DOM_SID domain_sid; + struct dom_sid domain_sid; if (sid_compare(sid, &global_sid_Builtin_Administrators) == 0) return True; diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c index ff8777493a..181b17a838 100644 --- a/source3/passdb/lookup_sid.c +++ b/source3/passdb/lookup_sid.c @@ -32,14 +32,14 @@ bool lookup_name(TALLOC_CTX *mem_ctx, const char *full_name, int flags, const char **ret_domain, const char **ret_name, - DOM_SID *ret_sid, enum lsa_SidType *ret_type) + struct dom_sid *ret_sid, enum lsa_SidType *ret_type) { char *p; const char *tmp; const char *domain = NULL; const char *name = NULL; uint32 rid; - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); @@ -253,7 +253,7 @@ bool lookup_name(TALLOC_CTX *mem_ctx, * that (yet), but give it a chance. */ if (IS_DC && winbind_lookup_name("", name, &sid, &type)) { - DOM_SID dom_sid; + struct dom_sid dom_sid; uint32 tmp_rid; enum lsa_SidType domain_type; @@ -357,7 +357,7 @@ bool lookup_name(TALLOC_CTX *mem_ctx, bool lookup_name_smbconf(TALLOC_CTX *mem_ctx, const char *full_name, int flags, const char **ret_domain, const char **ret_name, - DOM_SID *ret_sid, enum lsa_SidType *ret_type) + struct dom_sid *ret_sid, enum lsa_SidType *ret_type) { char *qualified_name; const char *p; @@ -415,7 +415,7 @@ bool lookup_name_smbconf(TALLOC_CTX *mem_ctx, } static bool wb_lookup_rids(TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, int num_rids, uint32 *rids, const char **domain_name, const char **names, enum lsa_SidType *types) @@ -465,7 +465,7 @@ static bool wb_lookup_rids(TALLOC_CTX *mem_ctx, return true; } -static bool lookup_rids(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, +static bool lookup_rids(TALLOC_CTX *mem_ctx, const struct dom_sid *domain_sid, int num_rids, uint32_t *rids, const char **domain_name, const char ***names, enum lsa_SidType **types) @@ -539,7 +539,7 @@ static bool lookup_rids(TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, if (sid_check_is_wellknown_domain(domain_sid, NULL)) { for (i=0; iprivate_data, struct pdb_ads_state); @@ -688,7 +688,7 @@ static NTSTATUS pdb_ads_getgrfilter(struct pdb_methods *m, GROUP_MAP *map, } static NTSTATUS pdb_ads_getgrsid(struct pdb_methods *m, GROUP_MAP *map, - DOM_SID sid) + struct dom_sid sid) { char *filter; NTSTATUS status; @@ -884,13 +884,13 @@ static NTSTATUS pdb_ads_update_group_mapping_entry(struct pdb_methods *m, } static NTSTATUS pdb_ads_delete_group_mapping_entry(struct pdb_methods *m, - DOM_SID sid) + struct dom_sid sid) { return NT_STATUS_NOT_IMPLEMENTED; } static NTSTATUS pdb_ads_enum_group_mapping(struct pdb_methods *m, - const DOM_SID *sid, + const struct dom_sid *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, @@ -901,7 +901,7 @@ static NTSTATUS pdb_ads_enum_group_mapping(struct pdb_methods *m, static NTSTATUS pdb_ads_enum_group_members(struct pdb_methods *m, TALLOC_CTX *mem_ctx, - const DOM_SID *group, + const struct dom_sid *group, uint32 **pmembers, size_t *pnum_members) { @@ -963,7 +963,7 @@ static NTSTATUS pdb_ads_enum_group_members(struct pdb_methods *m, static NTSTATUS pdb_ads_enum_group_memberships(struct pdb_methods *m, TALLOC_CTX *mem_ctx, struct samu *user, - DOM_SID **pp_sids, + struct dom_sid **pp_sids, gid_t **pp_gids, size_t *p_num_groups) { @@ -1184,7 +1184,7 @@ static NTSTATUS pdb_ads_create_alias(struct pdb_methods *m, } static NTSTATUS pdb_ads_delete_alias(struct pdb_methods *m, - const DOM_SID *sid) + const struct dom_sid *sid) { struct pdb_ads_state *state = talloc_get_type_abort( m->private_data, struct pdb_ads_state); @@ -1239,7 +1239,7 @@ static NTSTATUS pdb_ads_delete_alias(struct pdb_methods *m, } static NTSTATUS pdb_ads_set_aliasinfo(struct pdb_methods *m, - const DOM_SID *sid, + const struct dom_sid *sid, struct acct_info *info) { struct pdb_ads_state *state = talloc_get_type_abort( @@ -1363,8 +1363,8 @@ static NTSTATUS pdb_ads_sid2dn(struct pdb_ads_state *state, } static NTSTATUS pdb_ads_mod_aliasmem(struct pdb_methods *m, - const DOM_SID *alias, - const DOM_SID *member, + const struct dom_sid *alias, + const struct dom_sid *member, int mod_op) { struct pdb_ads_state *state = talloc_get_type_abort( @@ -1422,15 +1422,15 @@ static NTSTATUS pdb_ads_mod_aliasmem(struct pdb_methods *m, } static NTSTATUS pdb_ads_add_aliasmem(struct pdb_methods *m, - const DOM_SID *alias, - const DOM_SID *member) + const struct dom_sid *alias, + const struct dom_sid *member) { return pdb_ads_mod_aliasmem(m, alias, member, TLDAP_MOD_ADD); } static NTSTATUS pdb_ads_del_aliasmem(struct pdb_methods *m, - const DOM_SID *alias, - const DOM_SID *member) + const struct dom_sid *alias, + const struct dom_sid *member) { return pdb_ads_mod_aliasmem(m, alias, member, TLDAP_MOD_DELETE); } @@ -1467,9 +1467,9 @@ static bool pdb_ads_dnblob2sid(struct pdb_ads_state *state, DATA_BLOB *dnblob, } static NTSTATUS pdb_ads_enum_aliasmem(struct pdb_methods *m, - const DOM_SID *alias, + const struct dom_sid *alias, TALLOC_CTX *mem_ctx, - DOM_SID **pmembers, + struct dom_sid **pmembers, size_t *pnum_members) { struct pdb_ads_state *state = talloc_get_type_abort( @@ -1527,8 +1527,8 @@ static NTSTATUS pdb_ads_enum_aliasmem(struct pdb_methods *m, static NTSTATUS pdb_ads_enum_alias_memberships(struct pdb_methods *m, TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, - const DOM_SID *members, + const struct dom_sid *domain_sid, + const struct dom_sid *members, size_t num_members, uint32_t **palias_rids, size_t *pnum_alias_rids) @@ -1622,7 +1622,7 @@ done: } static NTSTATUS pdb_ads_lookup_rids(struct pdb_methods *m, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, int num_rids, uint32 *rids, const char **names, @@ -1698,7 +1698,7 @@ static NTSTATUS pdb_ads_lookup_rids(struct pdb_methods *m, } static NTSTATUS pdb_ads_lookup_names(struct pdb_methods *m, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, int num_names, const char **pp_names, uint32 *rids, @@ -1895,7 +1895,7 @@ static bool pdb_ads_search_groups(struct pdb_methods *m, static bool pdb_ads_search_aliases(struct pdb_methods *m, struct pdb_search *search, - const DOM_SID *sid) + const struct dom_sid *sid) { struct pdb_ads_search_state *sstate; char *filter; @@ -1920,7 +1920,7 @@ static bool pdb_ads_search_aliases(struct pdb_methods *m, } static bool pdb_ads_uid_to_sid(struct pdb_methods *m, uid_t uid, - DOM_SID *sid) + struct dom_sid *sid) { struct pdb_ads_state *state = talloc_get_type_abort( m->private_data, struct pdb_ads_state); @@ -1929,7 +1929,7 @@ static bool pdb_ads_uid_to_sid(struct pdb_methods *m, uid_t uid, } static bool pdb_ads_gid_to_sid(struct pdb_methods *m, gid_t gid, - DOM_SID *sid) + struct dom_sid *sid) { struct pdb_ads_state *state = talloc_get_type_abort( m->private_data, struct pdb_ads_state); @@ -1937,7 +1937,7 @@ static bool pdb_ads_gid_to_sid(struct pdb_methods *m, gid_t gid, return true; } -static bool pdb_ads_sid_to_id(struct pdb_methods *m, const DOM_SID *sid, +static bool pdb_ads_sid_to_id(struct pdb_methods *m, const struct dom_sid *sid, union unid_t *id, enum lsa_SidType *type) { struct pdb_ads_state *state = talloc_get_type_abort( @@ -1996,7 +1996,7 @@ static bool pdb_ads_new_rid(struct pdb_methods *m, uint32 *rid) static bool pdb_ads_get_trusteddom_pw(struct pdb_methods *m, const char *domain, char** pwd, - DOM_SID *sid, + struct dom_sid *sid, time_t *pass_last_set_time) { return false; @@ -2004,7 +2004,7 @@ static bool pdb_ads_get_trusteddom_pw(struct pdb_methods *m, static bool pdb_ads_set_trusteddom_pw(struct pdb_methods *m, const char* domain, const char* pwd, - const DOM_SID *sid) + const struct dom_sid *sid) { return false; } diff --git a/source3/passdb/pdb_compat.c b/source3/passdb/pdb_compat.c index b65be70758..13a7b5f69f 100644 --- a/source3/passdb/pdb_compat.c +++ b/source3/passdb/pdb_compat.c @@ -49,8 +49,8 @@ uint32 pdb_get_group_rid (struct samu *sampass) bool pdb_set_user_sid_from_rid (struct samu *sampass, uint32 rid, enum pdb_value_state flag) { - DOM_SID u_sid; - const DOM_SID *global_sam_sid; + struct dom_sid u_sid; + const struct dom_sid *global_sam_sid; if (!sampass) return False; @@ -75,8 +75,8 @@ bool pdb_set_user_sid_from_rid (struct samu *sampass, uint32 rid, enum pdb_value bool pdb_set_group_sid_from_rid (struct samu *sampass, uint32 grid, enum pdb_value_state flag) { - DOM_SID g_sid; - const DOM_SID *global_sam_sid; + struct dom_sid g_sid; + const struct dom_sid *global_sam_sid; if (!sampass) return False; diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index 554e8127d2..96f6b40b2d 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -175,14 +175,14 @@ const char *pdb_get_plaintext_passwd(const struct samu *sampass) return sampass->plaintext_pw; } -const DOM_SID *pdb_get_user_sid(const struct samu *sampass) +const struct dom_sid *pdb_get_user_sid(const struct samu *sampass) { return &sampass->user_sid; } -const DOM_SID *pdb_get_group_sid(struct samu *sampass) +const struct dom_sid *pdb_get_group_sid(struct samu *sampass) { - DOM_SID *gsid; + struct dom_sid *gsid; struct passwd *pwd; bool need_lookup_sid = false; @@ -193,7 +193,7 @@ const DOM_SID *pdb_get_group_sid(struct samu *sampass) /* generate the group SID from the user's primary Unix group */ - if ( !(gsid = TALLOC_ZERO_P( sampass, DOM_SID )) ) { + if ( !(gsid = TALLOC_ZERO_P( sampass, struct dom_sid )) ) { return NULL; } @@ -215,7 +215,7 @@ const DOM_SID *pdb_get_group_sid(struct samu *sampass) gid_to_sid(gsid, pwd->pw_gid); if (!is_null_sid(gsid)) { - DOM_SID dgsid; + struct dom_sid dgsid; uint32_t rid; sid_copy(&dgsid, gsid); @@ -246,7 +246,7 @@ const DOM_SID *pdb_get_group_sid(struct samu *sampass) enum lsa_SidType type = SID_NAME_UNKNOWN; TALLOC_CTX *mem_ctx; bool lookup_ret; - const DOM_SID *usid = pdb_get_user_sid(sampass); + const struct dom_sid *usid = pdb_get_user_sid(sampass); mem_ctx = talloc_init("pdb_get_group_sid"); if (!mem_ctx) { @@ -525,7 +525,7 @@ bool pdb_set_init_flags(struct samu *sampass, enum pdb_elements element, enum pd return True; } -bool pdb_set_user_sid(struct samu *sampass, const DOM_SID *u_sid, enum pdb_value_state flag) +bool pdb_set_user_sid(struct samu *sampass, const struct dom_sid *u_sid, enum pdb_value_state flag) { if (!u_sid) return False; @@ -540,7 +540,7 @@ bool pdb_set_user_sid(struct samu *sampass, const DOM_SID *u_sid, enum pdb_value bool pdb_set_user_sid_from_string(struct samu *sampass, fstring u_sid, enum pdb_value_state flag) { - DOM_SID new_sid; + struct dom_sid new_sid; if (!u_sid) return False; @@ -569,15 +569,15 @@ bool pdb_set_user_sid_from_string(struct samu *sampass, fstring u_sid, enum pdb_ have to allow the explicitly setting of a group SID here. ********************************************************************/ -bool pdb_set_group_sid(struct samu *sampass, const DOM_SID *g_sid, enum pdb_value_state flag) +bool pdb_set_group_sid(struct samu *sampass, const struct dom_sid *g_sid, enum pdb_value_state flag) { gid_t gid; - DOM_SID dug_sid; + struct dom_sid dug_sid; if (!g_sid) return False; - if ( !(sampass->group_sid = TALLOC_P( sampass, DOM_SID )) ) { + if ( !(sampass->group_sid = TALLOC_P( sampass, struct dom_sid )) ) { return False; } diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index ac53e52d14..4cc8b0815f 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -270,7 +270,7 @@ static bool guest_user_info( struct samu *user ) /********************************************************************** **********************************************************************/ -bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid) +bool pdb_getsampwsid(struct samu *sam_acct, const struct dom_sid *sid) { struct pdb_methods *pdb = pdb_get_methods(); uint32_t rid; @@ -537,7 +537,7 @@ NTSTATUS pdb_update_login_attempts(struct samu *sam_acct, bool success) return pdb->update_login_attempts(pdb, sam_acct, success); } -bool pdb_getgrsid(GROUP_MAP *map, DOM_SID sid) +bool pdb_getgrsid(GROUP_MAP *map, struct dom_sid sid) { struct pdb_methods *pdb = pdb_get_methods(); return NT_STATUS_IS_OK(pdb->getgrsid(pdb, map, sid)); @@ -560,7 +560,7 @@ static NTSTATUS pdb_default_create_dom_group(struct pdb_methods *methods, const char *name, uint32_t *rid) { - DOM_SID group_sid; + struct dom_sid group_sid; struct group *grp; fstring tmp; @@ -605,7 +605,7 @@ static NTSTATUS pdb_default_delete_dom_group(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, uint32_t rid) { - DOM_SID group_sid; + struct dom_sid group_sid; GROUP_MAP map; NTSTATUS status; struct group *grp; @@ -670,13 +670,13 @@ NTSTATUS pdb_update_group_mapping_entry(GROUP_MAP *map) return pdb->update_group_mapping_entry(pdb, map); } -NTSTATUS pdb_delete_group_mapping_entry(DOM_SID sid) +NTSTATUS pdb_delete_group_mapping_entry(struct dom_sid sid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->delete_group_mapping_entry(pdb, sid); } -bool pdb_enum_group_mapping(const DOM_SID *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, +bool pdb_enum_group_mapping(const struct dom_sid *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, bool unix_only) { struct pdb_methods *pdb = pdb_get_methods(); @@ -685,7 +685,7 @@ bool pdb_enum_group_mapping(const DOM_SID *sid, enum lsa_SidType sid_name_use, G } NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, uint32_t **pp_member_rids, size_t *p_num_members) { @@ -714,7 +714,7 @@ NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx, } NTSTATUS pdb_enum_group_memberships(TALLOC_CTX *mem_ctx, struct samu *user, - DOM_SID **pp_sids, gid_t **pp_gids, + struct dom_sid **pp_sids, gid_t **pp_gids, size_t *p_num_groups) { struct pdb_methods *pdb = pdb_get_methods(); @@ -756,9 +756,9 @@ NTSTATUS pdb_set_unix_primary_group(TALLOC_CTX *mem_ctx, struct samu *user) */ static bool pdb_user_in_group(TALLOC_CTX *mem_ctx, struct samu *account, - const DOM_SID *group_sid) + const struct dom_sid *group_sid) { - DOM_SID *sids; + struct dom_sid *sids; gid_t *gids; size_t i, num_groups; @@ -781,7 +781,7 @@ static NTSTATUS pdb_default_add_groupmem(struct pdb_methods *methods, uint32_t group_rid, uint32_t member_rid) { - DOM_SID group_sid, member_sid; + struct dom_sid group_sid, member_sid; struct samu *account = NULL; GROUP_MAP map; struct group *grp; @@ -846,7 +846,7 @@ static NTSTATUS pdb_default_del_groupmem(struct pdb_methods *methods, uint32_t group_rid, uint32_t member_rid) { - DOM_SID group_sid, member_sid; + struct dom_sid group_sid, member_sid; struct samu *account = NULL; GROUP_MAP map; struct group *grp; @@ -909,38 +909,38 @@ NTSTATUS pdb_create_alias(const char *name, uint32_t *rid) return pdb->create_alias(pdb, name, rid); } -NTSTATUS pdb_delete_alias(const DOM_SID *sid) +NTSTATUS pdb_delete_alias(const struct dom_sid *sid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->delete_alias(pdb, sid); } -NTSTATUS pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info) +NTSTATUS pdb_get_aliasinfo(const struct dom_sid *sid, struct acct_info *info) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->get_aliasinfo(pdb, sid, info); } -NTSTATUS pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info) +NTSTATUS pdb_set_aliasinfo(const struct dom_sid *sid, struct acct_info *info) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->set_aliasinfo(pdb, sid, info); } -NTSTATUS pdb_add_aliasmem(const DOM_SID *alias, const DOM_SID *member) +NTSTATUS pdb_add_aliasmem(const struct dom_sid *alias, const struct dom_sid *member) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->add_aliasmem(pdb, alias, member); } -NTSTATUS pdb_del_aliasmem(const DOM_SID *alias, const DOM_SID *member) +NTSTATUS pdb_del_aliasmem(const struct dom_sid *alias, const struct dom_sid *member) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->del_aliasmem(pdb, alias, member); } -NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, - DOM_SID **pp_members, size_t *p_num_members) +NTSTATUS pdb_enum_aliasmem(const struct dom_sid *alias, TALLOC_CTX *mem_ctx, + struct dom_sid **pp_members, size_t *p_num_members) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->enum_aliasmem(pdb, alias, mem_ctx, pp_members, @@ -948,8 +948,8 @@ NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx, } NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, - const DOM_SID *members, size_t num_members, + const struct dom_sid *domain_sid, + const struct dom_sid *members, size_t num_members, uint32_t **pp_alias_rids, size_t *p_num_alias_rids) { @@ -961,7 +961,7 @@ NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx, p_num_alias_rids); } -NTSTATUS pdb_lookup_rids(const DOM_SID *domain_sid, +NTSTATUS pdb_lookup_rids(const struct dom_sid *domain_sid, int num_rids, uint32_t *rids, const char **names, @@ -983,7 +983,7 @@ NTSTATUS pdb_lookup_rids(const DOM_SID *domain_sid, * used in this context some day. */ #if 0 -NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid, +NTSTATUS pdb_lookup_names(const struct dom_sid *domain_sid, int num_names, const char **names, uint32_t *rids, @@ -1024,19 +1024,19 @@ bool pdb_get_seq_num(time_t *seq_num) return NT_STATUS_IS_OK(pdb->get_seq_num(pdb, seq_num)); } -bool pdb_uid_to_sid(uid_t uid, DOM_SID *sid) +bool pdb_uid_to_sid(uid_t uid, struct dom_sid *sid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->uid_to_sid(pdb, uid, sid); } -bool pdb_gid_to_sid(gid_t gid, DOM_SID *sid) +bool pdb_gid_to_sid(gid_t gid, struct dom_sid *sid) { struct pdb_methods *pdb = pdb_get_methods(); return pdb->gid_to_sid(pdb, gid, sid); } -bool pdb_sid_to_id(const DOM_SID *sid, union unid_t *id, +bool pdb_sid_to_id(const struct dom_sid *sid, union unid_t *id, enum lsa_SidType *type) { struct pdb_methods *pdb = pdb_get_methods(); @@ -1136,7 +1136,7 @@ static NTSTATUS pdb_default_getsampwnam (struct pdb_methods *methods, struct sam return NT_STATUS_NO_SUCH_USER; } -static NTSTATUS pdb_default_getsampwsid(struct pdb_methods *my_methods, struct samu * user, const DOM_SID *sid) +static NTSTATUS pdb_default_getsampwsid(struct pdb_methods *my_methods, struct samu * user, const struct dom_sid *sid) { return NT_STATUS_NO_SUCH_USER; } @@ -1185,7 +1185,7 @@ static NTSTATUS pdb_default_get_seq_num(struct pdb_methods *methods, time_t *seq } static bool pdb_default_uid_to_sid(struct pdb_methods *methods, uid_t uid, - DOM_SID *sid) + struct dom_sid *sid) { struct samu *sampw = NULL; struct passwd *unix_pw; @@ -1224,7 +1224,7 @@ static bool pdb_default_uid_to_sid(struct pdb_methods *methods, uid_t uid, } static bool pdb_default_gid_to_sid(struct pdb_methods *methods, gid_t gid, - DOM_SID *sid) + struct dom_sid *sid) { GROUP_MAP map; @@ -1237,7 +1237,7 @@ static bool pdb_default_gid_to_sid(struct pdb_methods *methods, gid_t gid, } static bool pdb_default_sid_to_id(struct pdb_methods *methods, - const DOM_SID *sid, + const struct dom_sid *sid, union unid_t *id, enum lsa_SidType *type) { TALLOC_CTX *mem_ctx; @@ -1367,7 +1367,7 @@ static bool get_memberuids(TALLOC_CTX *mem_ctx, gid_t gid, uid_t **pp_uids, size static NTSTATUS pdb_default_enum_group_members(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - const DOM_SID *group, + const struct dom_sid *group, uint32_t **pp_member_rids, size_t *p_num_members) { @@ -1390,7 +1390,7 @@ static NTSTATUS pdb_default_enum_group_members(struct pdb_methods *methods, *pp_member_rids = TALLOC_ZERO_ARRAY(mem_ctx, uint32_t, num_uids); for (i=0; iset_trusteddom_pw(pdb, domain, pwd, sid); @@ -1940,7 +1940,7 @@ NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32_t *num_domains, static bool pdb_default_get_trusteddom_pw(struct pdb_methods *methods, const char *domain, char** pwd, - DOM_SID *sid, + struct dom_sid *sid, time_t *pass_last_set_time) { return secrets_fetch_trusted_domain_password(domain, pwd, @@ -1951,7 +1951,7 @@ static bool pdb_default_get_trusteddom_pw(struct pdb_methods *methods, static bool pdb_default_set_trusteddom_pw(struct pdb_methods *methods, const char* domain, const char* pwd, - const DOM_SID *sid) + const struct dom_sid *sid) { return secrets_store_trusted_domain_password(domain, pwd, sid); } diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 32eacd1bc8..9e85ca67ed 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -399,7 +399,7 @@ static int ldapsam_search_suffix_by_rid (struct ldapsam_privates *ldap_state, ******************************************************************/ static int ldapsam_search_suffix_by_sid (struct ldapsam_privates *ldap_state, - const DOM_SID *sid, LDAPMessage ** result, + const struct dom_sid *sid, LDAPMessage ** result, const char **attr) { char *filter = NULL; @@ -1032,8 +1032,8 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state, struct passwd unix_pw; bool have_uid = false; bool have_gid = false; - DOM_SID mapped_gsid; - const DOM_SID *primary_gsid; + struct dom_sid mapped_gsid; + const struct dom_sid *primary_gsid; ZERO_STRUCT(unix_pw); @@ -1201,7 +1201,7 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state, /* only update the RID if we actually need to */ if (need_update(sampass, PDB_USERSID)) { fstring sid_string; - const DOM_SID *user_sid = pdb_get_user_sid(sampass); + const struct dom_sid *user_sid = pdb_get_user_sid(sampass); switch ( ldap_state->schema_ver ) { case SCHEMAVER_SAMBAACCOUNT: @@ -1238,7 +1238,7 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state, if (need_update(sampass, PDB_GROUPSID)) { fstring sid_string; - const DOM_SID *group_sid = pdb_get_group_sid(sampass); + const struct dom_sid *group_sid = pdb_get_group_sid(sampass); switch ( ldap_state->schema_ver ) { case SCHEMAVER_SAMBAACCOUNT: @@ -1624,7 +1624,7 @@ static NTSTATUS ldapsam_getsampwnam(struct pdb_methods *my_methods, struct samu } static int ldapsam_get_ldap_user_by_sid(struct ldapsam_privates *ldap_state, - const DOM_SID *sid, LDAPMessage **result) + const struct dom_sid *sid, LDAPMessage **result) { int rc = -1; const char ** attr_list; @@ -1674,7 +1674,7 @@ static int ldapsam_get_ldap_user_by_sid(struct ldapsam_privates *ldap_state, Get struct samu entry from LDAP by SID. *********************************************************************/ -static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, struct samu * user, const DOM_SID *sid) +static NTSTATUS ldapsam_getsampwsid(struct pdb_methods *my_methods, struct samu * user, const struct dom_sid *sid) { struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; LDAPMessage *result = NULL; @@ -2074,7 +2074,7 @@ static NTSTATUS ldapsam_del_groupmem(struct pdb_methods *my_methods, static NTSTATUS ldapsam_enum_group_memberships(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, struct samu *user, - DOM_SID **pp_sids, + struct dom_sid **pp_sids, gid_t **pp_gids, size_t *p_num_groups); @@ -2179,7 +2179,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, struct s const char **attr_list; char *escape_user = NULL; const char *username = pdb_get_username(newpwd); - const DOM_SID *sid = pdb_get_user_sid(newpwd); + const struct dom_sid *sid = pdb_get_user_sid(newpwd); char *filter = NULL; char *dn = NULL; NTSTATUS status = NT_STATUS_UNSUCCESSFUL; @@ -2592,7 +2592,7 @@ static NTSTATUS ldapsam_getgroup(struct pdb_methods *methods, *********************************************************************/ static NTSTATUS ldapsam_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, - DOM_SID sid) + struct dom_sid sid) { char *filter = NULL; NTSTATUS status; @@ -2662,11 +2662,11 @@ static NTSTATUS ldapsam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, static bool ldapsam_extract_rid_from_entry(LDAP *ldap_struct, LDAPMessage *entry, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, uint32_t *rid) { fstring str; - DOM_SID sid; + struct dom_sid sid; if (!smbldap_get_single_attribute(ldap_struct, entry, "sambaSID", str, sizeof(str)-1)) { @@ -2695,7 +2695,7 @@ static bool ldapsam_extract_rid_from_entry(LDAP *ldap_struct, static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - const DOM_SID *group, + const struct dom_sid *group, uint32_t **pp_member_rids, size_t *p_num_members) { @@ -2813,7 +2813,7 @@ static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods, entry = ldap_next_entry(conn->ldap_struct, entry)) { char *sidstr; - DOM_SID sid; + struct dom_sid sid; uint32_t rid; sidstr = smbldap_talloc_single_attribute(conn->ldap_struct, @@ -2896,7 +2896,7 @@ static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods, static NTSTATUS ldapsam_enum_group_memberships(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, struct samu *user, - DOM_SID **pp_sids, + struct dom_sid **pp_sids, gid_t **pp_gids, size_t *p_num_groups) { @@ -3013,7 +3013,7 @@ static NTSTATUS ldapsam_enum_group_memberships(struct pdb_methods *methods, entry = ldap_next_entry(conn->ldap_struct, entry)) { fstring str; - DOM_SID sid; + struct dom_sid sid; gid_t gid; char *end; @@ -3138,7 +3138,7 @@ static NTSTATUS ldapsam_add_group_mapping_entry(struct pdb_methods *methods, TALLOC_CTX *mem_ctx; NTSTATUS result; - DOM_SID sid; + struct dom_sid sid; int rc; @@ -3343,7 +3343,7 @@ static NTSTATUS ldapsam_update_group_mapping_entry(struct pdb_methods *methods, *********************************************************************/ static NTSTATUS ldapsam_delete_group_mapping_entry(struct pdb_methods *methods, - DOM_SID sid) + struct dom_sid sid) { struct ldapsam_privates *priv = (struct ldapsam_privates *)methods->private_data; @@ -3506,7 +3506,7 @@ static NTSTATUS ldapsam_getsamgrent(struct pdb_methods *my_methods, *********************************************************************/ static NTSTATUS ldapsam_enum_group_mapping(struct pdb_methods *methods, - const DOM_SID *domsid, enum lsa_SidType sid_name_use, + const struct dom_sid *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, bool unix_only) @@ -3556,8 +3556,8 @@ static NTSTATUS ldapsam_enum_group_mapping(struct pdb_methods *methods, } static NTSTATUS ldapsam_modify_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, - const DOM_SID *member, + const struct dom_sid *alias, + const struct dom_sid *member, int modop) { struct ldapsam_privates *ldap_state = @@ -3661,24 +3661,24 @@ static NTSTATUS ldapsam_modify_aliasmem(struct pdb_methods *methods, } static NTSTATUS ldapsam_add_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, - const DOM_SID *member) + const struct dom_sid *alias, + const struct dom_sid *member) { return ldapsam_modify_aliasmem(methods, alias, member, LDAP_MOD_ADD); } static NTSTATUS ldapsam_del_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, - const DOM_SID *member) + const struct dom_sid *alias, + const struct dom_sid *member) { return ldapsam_modify_aliasmem(methods, alias, member, LDAP_MOD_DELETE); } static NTSTATUS ldapsam_enum_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, + const struct dom_sid *alias, TALLOC_CTX *mem_ctx, - DOM_SID **pp_members, + struct dom_sid **pp_members, size_t *p_num_members) { struct ldapsam_privates *ldap_state = @@ -3764,7 +3764,7 @@ static NTSTATUS ldapsam_enum_aliasmem(struct pdb_methods *methods, count = ldap_count_values(values); for (i=0; iaccount_name = ""; @@ -4822,7 +4822,7 @@ static bool ldapgroup2displayentry(struct ldap_search_state *state, static bool ldapsam_search_grouptype(struct pdb_methods *methods, struct pdb_search *search, - const DOM_SID *sid, + const struct dom_sid *sid, enum lsa_SidType type) { struct ldapsam_privates *ldap_state = @@ -4874,7 +4874,7 @@ static bool ldapsam_search_groups(struct pdb_methods *methods, static bool ldapsam_search_aliases(struct pdb_methods *methods, struct pdb_search *search, - const DOM_SID *sid) + const struct dom_sid *sid) { return ldapsam_search_grouptype(methods, search, sid, SID_NAME_ALIAS); } @@ -5010,7 +5010,7 @@ static bool ldapsam_new_rid(struct pdb_methods *methods, uint32_t *rid) } static bool ldapsam_sid_to_id(struct pdb_methods *methods, - const DOM_SID *sid, + const struct dom_sid *sid, union unid_t *id, enum lsa_SidType *type) { struct ldapsam_privates *priv = @@ -5107,7 +5107,7 @@ static bool ldapsam_sid_to_id(struct pdb_methods *methods, * This is shortcut is only used if ldapsam:trusted is set to true. */ static bool ldapsam_uid_to_sid(struct pdb_methods *methods, uid_t uid, - DOM_SID *sid) + struct dom_sid *sid) { struct ldapsam_privates *priv = (struct ldapsam_privates *)methods->private_data; @@ -5179,7 +5179,7 @@ static bool ldapsam_uid_to_sid(struct pdb_methods *methods, uid_t uid, * This is shortcut is only used if ldapsam:trusted is set to true. */ static bool ldapsam_gid_to_sid(struct pdb_methods *methods, gid_t gid, - DOM_SID *sid) + struct dom_sid *sid) { struct ldapsam_privates *priv = (struct ldapsam_privates *)methods->private_data; @@ -5189,7 +5189,7 @@ static bool ldapsam_gid_to_sid(struct pdb_methods *methods, gid_t gid, LDAPMessage *entry = NULL; bool ret = false; char *group_sid_string; - DOM_SID group_sid; + struct dom_sid group_sid; int rc; TALLOC_CTX *tmp_ctx = talloc_stackframe(); @@ -5278,8 +5278,8 @@ static NTSTATUS ldapsam_create_user(struct pdb_methods *my_methods, char *uidstr; char *shell; const char *dn = NULL; - DOM_SID group_sid; - DOM_SID user_sid; + struct dom_sid group_sid; + struct dom_sid user_sid; gid_t gid = -1; uid_t uid = -1; NTSTATUS ret; @@ -5598,7 +5598,7 @@ static NTSTATUS ldapsam_create_dom_group(struct pdb_methods *my_methods, char *grouptype; char *gidstr; const char *dn = NULL; - DOM_SID group_sid; + struct dom_sid group_sid; gid_t gid = -1; int rc; @@ -5744,7 +5744,7 @@ static NTSTATUS ldapsam_delete_dom_group(struct pdb_methods *my_methods, TALLOC_ const char *dn; char *gidstr; char *filter; - DOM_SID group_sid; + struct dom_sid group_sid; int rc; /* get the group sid */ @@ -5843,8 +5843,8 @@ static NTSTATUS ldapsam_change_groupmem(struct pdb_methods *my_methods, char *filter; char *uidstr; const char *dn = NULL; - DOM_SID group_sid; - DOM_SID member_sid; + struct dom_sid group_sid; + struct dom_sid member_sid; int rc; switch (modop) { @@ -6178,7 +6178,7 @@ static bool get_trusteddom_pw_int(struct ldapsam_privates *ldap_state, static bool ldapsam_get_trusteddom_pw(struct pdb_methods *methods, const char *domain, char** pwd, - DOM_SID *sid, + struct dom_sid *sid, time_t *pass_last_set_time) { struct ldapsam_privates *ldap_state = @@ -6241,7 +6241,7 @@ static bool ldapsam_get_trusteddom_pw(struct pdb_methods *methods, static bool ldapsam_set_trusteddom_pw(struct pdb_methods *methods, const char* domain, const char* pwd, - const DOM_SID *sid) + const struct dom_sid *sid) { struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)methods->private_data; @@ -6560,8 +6560,8 @@ NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location) char *alg_rid_base_string = NULL; LDAPMessage *result = NULL; LDAPMessage *entry = NULL; - DOM_SID ldap_domain_sid; - DOM_SID secrets_domain_sid; + struct dom_sid ldap_domain_sid; + struct dom_sid secrets_domain_sid; char *domain_sid_string = NULL; char *dn = NULL; char *uri = talloc_strdup( NULL, location ); diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index 78bd0e7561..bfd996436e 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -1317,7 +1317,7 @@ static NTSTATUS smbpasswd_getsampwnam(struct pdb_methods *my_methods, return NT_STATUS_OK; } -static NTSTATUS smbpasswd_getsampwsid(struct pdb_methods *my_methods, struct samu *sam_acct, const DOM_SID *sid) +static NTSTATUS smbpasswd_getsampwsid(struct pdb_methods *my_methods, struct samu *sam_acct, const struct dom_sid *sid) { NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data; diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index c413ec3be7..526633b58d 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -617,7 +617,7 @@ static NTSTATUS tdbsam_getsampwrid (struct pdb_methods *my_methods, } static NTSTATUS tdbsam_getsampwsid(struct pdb_methods *my_methods, - struct samu * user, const DOM_SID *sid) + struct samu * user, const struct dom_sid *sid) { uint32 rid; diff --git a/source3/passdb/pdb_wbc_sam.c b/source3/passdb/pdb_wbc_sam.c index df80411a7a..e90cd109a5 100644 --- a/source3/passdb/pdb_wbc_sam.c +++ b/source3/passdb/pdb_wbc_sam.c @@ -64,26 +64,26 @@ static NTSTATUS pdb_wbc_sam_getsampwnam(struct pdb_methods *methods, struct samu return _pdb_wbc_sam_getsampw(methods, user, winbind_getpwnam(sname)); } -static NTSTATUS pdb_wbc_sam_getsampwsid(struct pdb_methods *methods, struct samu *user, const DOM_SID *sid) +static NTSTATUS pdb_wbc_sam_getsampwsid(struct pdb_methods *methods, struct samu *user, const struct dom_sid *sid) { return _pdb_wbc_sam_getsampw(methods, user, winbind_getpwsid(sid)); } static bool pdb_wbc_sam_uid_to_sid(struct pdb_methods *methods, uid_t uid, - DOM_SID *sid) + struct dom_sid *sid) { return winbind_uid_to_sid(sid, uid); } static bool pdb_wbc_sam_gid_to_sid(struct pdb_methods *methods, gid_t gid, - DOM_SID *sid) + struct dom_sid *sid) { return winbind_gid_to_sid(sid, gid); } static NTSTATUS pdb_wbc_sam_enum_group_members(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - const DOM_SID *group, + const struct dom_sid *group, uint32 **pp_member_rids, size_t *p_num_members) { @@ -93,7 +93,7 @@ static NTSTATUS pdb_wbc_sam_enum_group_members(struct pdb_methods *methods, static NTSTATUS pdb_wbc_sam_enum_group_memberships(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, struct samu *user, - DOM_SID **pp_sids, + struct dom_sid **pp_sids, gid_t **pp_gids, size_t *p_num_groups) { @@ -110,7 +110,7 @@ static NTSTATUS pdb_wbc_sam_enum_group_memberships(struct pdb_methods *methods, smb_panic("primary group missing"); } - *pp_sids = TALLOC_ARRAY(mem_ctx, DOM_SID, *p_num_groups); + *pp_sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, *p_num_groups); if (*pp_sids == NULL) { TALLOC_FREE(*pp_gids); @@ -125,7 +125,7 @@ static NTSTATUS pdb_wbc_sam_enum_group_memberships(struct pdb_methods *methods, } static NTSTATUS pdb_wbc_sam_lookup_rids(struct pdb_methods *methods, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, int num_rids, uint32 *rids, const char **names, @@ -185,7 +185,7 @@ static bool pdb_wbc_sam_search_groups(struct pdb_methods *methods, static bool pdb_wbc_sam_search_aliases(struct pdb_methods *methods, struct pdb_search *search, - const DOM_SID *sid) + const struct dom_sid *sid) { return false; @@ -194,7 +194,7 @@ static bool pdb_wbc_sam_search_aliases(struct pdb_methods *methods, static bool pdb_wbc_sam_get_trusteddom_pw(struct pdb_methods *methods, const char *domain, char **pwd, - DOM_SID *sid, + struct dom_sid *sid, time_t *pass_last_set_time) { return false; @@ -204,7 +204,7 @@ static bool pdb_wbc_sam_get_trusteddom_pw(struct pdb_methods *methods, static bool pdb_wbc_sam_set_trusteddom_pw(struct pdb_methods *methods, const char *domain, const char *pwd, - const DOM_SID *sid) + const struct dom_sid *sid) { return false; } @@ -223,7 +223,7 @@ static NTSTATUS pdb_wbc_sam_enum_trusteddoms(struct pdb_methods *methods, return NT_STATUS_NOT_IMPLEMENTED; } -static bool _make_group_map(struct pdb_methods *methods, const char *domain, const char *name, enum lsa_SidType name_type, gid_t gid, DOM_SID *sid, GROUP_MAP *map) +static bool _make_group_map(struct pdb_methods *methods, const char *domain, const char *name, enum lsa_SidType name_type, gid_t gid, struct dom_sid *sid, GROUP_MAP *map) { snprintf(map->nt_name, sizeof(map->nt_name), "%s%c%s", domain, *lp_winbind_separator(), name); @@ -234,7 +234,7 @@ static bool _make_group_map(struct pdb_methods *methods, const char *domain, con } static NTSTATUS pdb_wbc_sam_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, - DOM_SID sid) + struct dom_sid sid) { NTSTATUS result = NT_STATUS_OK; char *name = NULL; @@ -278,7 +278,7 @@ static NTSTATUS pdb_wbc_sam_getgrgid(struct pdb_methods *methods, GROUP_MAP *map NTSTATUS result = NT_STATUS_OK; char *name = NULL; char *domain = NULL; - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType name_type; if (!winbind_gid_to_sid(&sid, gid)) { @@ -317,7 +317,7 @@ static NTSTATUS pdb_wbc_sam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map { NTSTATUS result = NT_STATUS_OK; const char *domain = ""; - DOM_SID sid; + struct dom_sid sid; gid_t gid; enum lsa_SidType name_type; @@ -350,7 +350,7 @@ done: } static NTSTATUS pdb_wbc_sam_enum_group_mapping(struct pdb_methods *methods, - const DOM_SID *sid, enum lsa_SidType sid_name_use, + const struct dom_sid *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, bool unix_only) { @@ -358,16 +358,16 @@ static NTSTATUS pdb_wbc_sam_enum_group_mapping(struct pdb_methods *methods, } static NTSTATUS pdb_wbc_sam_get_aliasinfo(struct pdb_methods *methods, - const DOM_SID *sid, + const struct dom_sid *sid, struct acct_info *info) { return NT_STATUS_NOT_IMPLEMENTED; } static NTSTATUS pdb_wbc_sam_enum_aliasmem(struct pdb_methods *methods, - const DOM_SID *alias, + const struct dom_sid *alias, TALLOC_CTX *mem_ctx, - DOM_SID **pp_members, + struct dom_sid **pp_members, size_t *p_num_members) { return NT_STATUS_NOT_IMPLEMENTED; @@ -375,8 +375,8 @@ static NTSTATUS pdb_wbc_sam_enum_aliasmem(struct pdb_methods *methods, static NTSTATUS pdb_wbc_sam_alias_memberships(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, - const DOM_SID *members, + const struct dom_sid *domain_sid, + const struct dom_sid *members, size_t num_members, uint32 **pp_alias_rids, size_t *p_num_alias_rids) diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c index a0bc4cea94..b673ad12a4 100644 --- a/source3/passdb/secrets.c +++ b/source3/passdb/secrets.c @@ -214,7 +214,7 @@ static char *trustdom_keystr(const char *domain) ************************************************************************/ bool secrets_fetch_trusted_domain_password(const char *domain, char** pwd, - DOM_SID *sid, time_t *pass_last_set_time) + struct dom_sid *sid, time_t *pass_last_set_time) { struct TRUSTED_DOM_PASS pass; enum ndr_err_code ndr_err; @@ -266,7 +266,7 @@ bool secrets_fetch_trusted_domain_password(const char *domain, char** pwd, **/ bool secrets_store_trusted_domain_password(const char* domain, const char* pwd, - const DOM_SID *sid) + const struct dom_sid *sid) { bool ret; diff --git a/source3/passdb/util_builtin.c b/source3/passdb/util_builtin.c index 2b8bb6e573..05a46371b3 100644 --- a/source3/passdb/util_builtin.c +++ b/source3/passdb/util_builtin.c @@ -102,7 +102,7 @@ const char *builtin_domain_name(void) Check if the SID is the builtin SID (S-1-5-32). *****************************************************************/ -bool sid_check_is_builtin(const DOM_SID *sid) +bool sid_check_is_builtin(const struct dom_sid *sid) { return sid_equal(sid, &global_sid_Builtin); } @@ -111,9 +111,9 @@ bool sid_check_is_builtin(const DOM_SID *sid) Check if the SID is one of the builtin SIDs (S-1-5-32-a). *****************************************************************/ -bool sid_check_is_in_builtin(const DOM_SID *sid) +bool sid_check_is_in_builtin(const struct dom_sid *sid) { - DOM_SID dom_sid; + struct dom_sid dom_sid; uint32 rid; sid_copy(&dom_sid, sid); diff --git a/source3/passdb/util_unixsids.c b/source3/passdb/util_unixsids.c index afda253c70..08c887e9fa 100644 --- a/source3/passdb/util_unixsids.c +++ b/source3/passdb/util_unixsids.c @@ -19,14 +19,14 @@ #include "includes.h" -bool sid_check_is_unix_users(const DOM_SID *sid) +bool sid_check_is_unix_users(const struct dom_sid *sid) { return sid_equal(sid, &global_sid_Unix_Users); } -bool sid_check_is_in_unix_users(const DOM_SID *sid) +bool sid_check_is_in_unix_users(const struct dom_sid *sid) { - DOM_SID dom_sid; + struct dom_sid dom_sid; uint32 rid; sid_copy(&dom_sid, sid); @@ -35,12 +35,12 @@ bool sid_check_is_in_unix_users(const DOM_SID *sid) return sid_check_is_unix_users(&dom_sid); } -bool uid_to_unix_users_sid(uid_t uid, DOM_SID *sid) +bool uid_to_unix_users_sid(uid_t uid, struct dom_sid *sid) { return sid_compose(sid, &global_sid_Unix_Users, uid); } -bool gid_to_unix_groups_sid(gid_t gid, DOM_SID *sid) +bool gid_to_unix_groups_sid(gid_t gid, struct dom_sid *sid) { return sid_compose(sid, &global_sid_Unix_Groups, gid); } @@ -50,7 +50,7 @@ const char *unix_users_domain_name(void) return "Unix User"; } -bool lookup_unix_user_name(const char *name, DOM_SID *sid) +bool lookup_unix_user_name(const char *name, struct dom_sid *sid) { struct passwd *pwd; bool ret; @@ -69,14 +69,14 @@ bool lookup_unix_user_name(const char *name, DOM_SID *sid) return ret; } -bool sid_check_is_unix_groups(const DOM_SID *sid) +bool sid_check_is_unix_groups(const struct dom_sid *sid) { return sid_equal(sid, &global_sid_Unix_Groups); } -bool sid_check_is_in_unix_groups(const DOM_SID *sid) +bool sid_check_is_in_unix_groups(const struct dom_sid *sid) { - DOM_SID dom_sid; + struct dom_sid dom_sid; uint32 rid; sid_copy(&dom_sid, sid); @@ -90,7 +90,7 @@ const char *unix_groups_domain_name(void) return "Unix Group"; } -bool lookup_unix_group_name(const char *name, DOM_SID *sid) +bool lookup_unix_group_name(const char *name, struct dom_sid *sid) { struct group *grp; diff --git a/source3/passdb/util_wellknown.c b/source3/passdb/util_wellknown.c index 0c45faab46..7f670f9225 100644 --- a/source3/passdb/util_wellknown.c +++ b/source3/passdb/util_wellknown.c @@ -29,7 +29,7 @@ struct rid_name_map { struct sid_name_map_info { - const DOM_SID *sid; + const struct dom_sid *sid; const char *name; const struct rid_name_map *known_users; }; @@ -70,7 +70,7 @@ static struct sid_name_map_info special_domains[] = { { &global_sid_NT_Authority, "NT Authority", nt_authority_users }, { NULL, NULL, NULL }}; -bool sid_check_is_wellknown_domain(const DOM_SID *sid, const char **name) +bool sid_check_is_wellknown_domain(const struct dom_sid *sid, const char **name) { int i; @@ -85,9 +85,9 @@ bool sid_check_is_wellknown_domain(const DOM_SID *sid, const char **name) return False; } -bool sid_check_is_in_wellknown_domain(const DOM_SID *sid) +bool sid_check_is_in_wellknown_domain(const struct dom_sid *sid) { - DOM_SID dom_sid; + struct dom_sid dom_sid; uint32 rid; sid_copy(&dom_sid, sid); @@ -100,11 +100,11 @@ bool sid_check_is_in_wellknown_domain(const DOM_SID *sid) Looks up a known username from one of the known domains. ***************************************************************************/ -bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, +bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid, const char **domain, const char **name) { int i; - DOM_SID dom_sid; + struct dom_sid dom_sid; uint32 rid; const struct rid_name_map *users = NULL; @@ -145,7 +145,7 @@ bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, ***************************************************************************/ bool lookup_wellknown_name(TALLOC_CTX *mem_ctx, const char *name, - DOM_SID *sid, const char **domain) + struct dom_sid *sid, const char **domain) { int i, j; diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index f1aa3f492f..5e5d1029cd 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -2632,7 +2632,7 @@ WERROR spoolss_create_default_secdesc(TALLOC_CTX *mem_ctx, uint32_t sa; struct security_acl *psa = NULL; struct security_descriptor *psd = NULL; - DOM_SID adm_sid; + struct dom_sid adm_sid; size_t sd_size; /* Create an ACE where Everyone is allowed to print */ @@ -2644,7 +2644,7 @@ WERROR spoolss_create_default_secdesc(TALLOC_CTX *mem_ctx, /* Add the domain admins group if we are a DC */ if ( IS_DC ) { - DOM_SID domadmins_sid; + struct dom_sid domadmins_sid; sid_compose(&domadmins_sid, get_global_sam_sid(), DOMAIN_RID_ADMINS); @@ -5226,7 +5226,7 @@ WERROR nt_printing_setsec(const char *sharename, struct sec_desc_buf *secdesc_ct descriptor then copy them over from the old one. */ if (!secdesc_ctr->sd->owner_sid || !secdesc_ctr->sd->group_sid) { - DOM_SID *owner_sid, *group_sid; + struct dom_sid *owner_sid, *group_sid; struct security_acl *dacl, *sacl; struct security_descriptor *psd = NULL; size_t size; @@ -5317,7 +5317,7 @@ static struct sec_desc_buf *construct_default_printer_sdb(TALLOC_CTX *ctx) struct security_acl *psa = NULL; struct sec_desc_buf *sdb = NULL; struct security_descriptor *psd = NULL; - DOM_SID adm_sid; + struct dom_sid adm_sid; size_t sd_size; /* Create an ACE where Everyone is allowed to print */ @@ -5329,7 +5329,7 @@ static struct sec_desc_buf *construct_default_printer_sdb(TALLOC_CTX *ctx) /* Add the domain admins group if we are a DC */ if ( IS_DC ) { - DOM_SID domadmins_sid; + struct dom_sid domadmins_sid; sid_compose(&domadmins_sid, get_global_sam_sid(), DOMAIN_RID_ADMINS); @@ -5440,7 +5440,7 @@ bool nt_printing_getsec(TALLOC_CTX *ctx, const char *sharename, struct sec_desc_ down. Take ownership of security descriptor. */ if (sid_equal((*secdesc_ctr)->sd->owner_sid, &global_sid_World)) { - DOM_SID owner_sid; + struct dom_sid owner_sid; /* Change sd owner to workgroup administrator */ diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c index 481b65b80a..649200a967 100644 --- a/source3/rpc_client/cli_lsarpc.c +++ b/source3/rpc_client/cli_lsarpc.c @@ -113,7 +113,7 @@ static NTSTATUS rpccli_lsa_lookup_sids_noalloc(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *pol, int num_sids, - const DOM_SID *sids, + const struct dom_sid *sids, char **domains, char **names, enum lsa_SidType *types, @@ -271,7 +271,7 @@ static NTSTATUS rpccli_lsa_lookup_sids_generic(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *pol, int num_sids, - const DOM_SID *sids, + const struct dom_sid *sids, char ***pdomains, char ***pnames, enum lsa_SidType **ptypes, @@ -280,7 +280,7 @@ static NTSTATUS rpccli_lsa_lookup_sids_generic(struct rpc_pipe_client *cli, NTSTATUS result = NT_STATUS_OK; int sids_left = 0; int sids_processed = 0; - const DOM_SID *hunk_sids = sids; + const struct dom_sid *hunk_sids = sids; char **hunk_domains; char **hunk_names; enum lsa_SidType *hunk_types; @@ -380,7 +380,7 @@ NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *pol, int num_sids, - const DOM_SID *sids, + const struct dom_sid *sids, char ***pdomains, char ***pnames, enum lsa_SidType **ptypes) @@ -393,7 +393,7 @@ NTSTATUS rpccli_lsa_lookup_sids3(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *pol, int num_sids, - const DOM_SID *sids, + const struct dom_sid *sids, char ***pdomains, char ***pnames, enum lsa_SidType **ptypes) @@ -410,7 +410,7 @@ static NTSTATUS rpccli_lsa_lookup_names_generic(struct rpc_pipe_client *cli, const char **names, const char ***dom_names, int level, - DOM_SID **sids, + struct dom_sid **sids, enum lsa_SidType **types, bool use_lookupnames4) { @@ -471,7 +471,7 @@ static NTSTATUS rpccli_lsa_lookup_names_generic(struct rpc_pipe_client *cli, } if (num_names) { - if (!((*sids = TALLOC_ARRAY(mem_ctx, DOM_SID, num_names)))) { + if (!((*sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, num_names)))) { DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n")); result = NT_STATUS_NO_MEMORY; goto done; @@ -501,7 +501,7 @@ static NTSTATUS rpccli_lsa_lookup_names_generic(struct rpc_pipe_client *cli, for (i = 0; i < num_names; i++) { uint32_t dom_idx; - DOM_SID *sid = &(*sids)[i]; + struct dom_sid *sid = &(*sids)[i]; if (use_lookupnames4) { dom_idx = sid_array3.sids[i].sid_index; @@ -548,7 +548,7 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli, const char **names, const char ***dom_names, int level, - DOM_SID **sids, + struct dom_sid **sids, enum lsa_SidType **types) { return rpccli_lsa_lookup_names_generic(cli, mem_ctx, pol, num_names, @@ -562,7 +562,7 @@ NTSTATUS rpccli_lsa_lookup_names4(struct rpc_pipe_client *cli, const char **names, const char ***dom_names, int level, - DOM_SID **sids, + struct dom_sid **sids, enum lsa_SidType **types) { return rpccli_lsa_lookup_names_generic(cli, mem_ctx, pol, num_names, diff --git a/source3/rpc_client/cli_lsarpc.h b/source3/rpc_client/cli_lsarpc.h index 188e5063d3..d971ee9b58 100644 --- a/source3/rpc_client/cli_lsarpc.h +++ b/source3/rpc_client/cli_lsarpc.h @@ -11,7 +11,7 @@ NTSTATUS rpccli_lsa_lookup_sids(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *pol, int num_sids, - const DOM_SID *sids, + const struct dom_sid *sids, char ***pdomains, char ***pnames, enum lsa_SidType **ptypes); @@ -19,7 +19,7 @@ NTSTATUS rpccli_lsa_lookup_sids3(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *pol, int num_sids, - const DOM_SID *sids, + const struct dom_sid *sids, char ***pdomains, char ***pnames, enum lsa_SidType **ptypes); @@ -29,7 +29,7 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli, const char **names, const char ***dom_names, int level, - DOM_SID **sids, + struct dom_sid **sids, enum lsa_SidType **types); NTSTATUS rpccli_lsa_lookup_names4(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -37,8 +37,8 @@ NTSTATUS rpccli_lsa_lookup_names4(struct rpc_pipe_client *cli, const char **names, const char ***dom_names, int level, - DOM_SID **sids, + struct dom_sid **sids, enum lsa_SidType **types); -bool fetch_domain_sid( char *domain, char *remote_machine, DOM_SID *psid); +bool fetch_domain_sid( char *domain, char *remote_machine, struct dom_sid *psid); diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index 8540b59b0b..e3e0dcb4ae 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/rpc_server/srv_lsa_nt.c @@ -41,7 +41,7 @@ extern PRIVS privs[]; enum lsa_handle_type { LSA_HANDLE_POLICY_TYPE = 1, LSA_HANDLE_ACCOUNT_TYPE }; struct lsa_info { - DOM_SID sid; + struct dom_sid sid; const char *name; uint32 access; enum lsa_handle_type type; @@ -83,7 +83,7 @@ const struct generic_mapping lsa_trusted_domain_mapping = { static int init_lsa_ref_domain_list(TALLOC_CTX *mem_ctx, struct lsa_RefDomainList *ref, const char *dom_name, - DOM_SID *dom_sid) + struct dom_sid *dom_sid) { int num = 0; @@ -129,7 +129,7 @@ static int init_lsa_ref_domain_list(TALLOC_CTX *mem_ctx, static void init_dom_query_3(struct lsa_DomainInfo *r, const char *name, - DOM_SID *sid) + struct dom_sid *sid) { init_lsa_StringLarge(&r->name, name); r->sid = sid; @@ -141,7 +141,7 @@ static void init_dom_query_3(struct lsa_DomainInfo *r, static void init_dom_query_5(struct lsa_DomainInfo *r, const char *name, - DOM_SID *sid) + struct dom_sid *sid) { init_lsa_StringLarge(&r->name, name); r->sid = sid; @@ -167,7 +167,7 @@ static NTSTATUS lookup_lsa_rids(TALLOC_CTX *mem_ctx, *pmapped_count = 0; for (i = 0; i < num_entries; i++) { - DOM_SID sid; + struct dom_sid sid; uint32 rid; int dom_idx; const char *full_name; @@ -251,7 +251,7 @@ static NTSTATUS lookup_lsa_sids(TALLOC_CTX *mem_ctx, *pmapped_count = 0; for (i = 0; i < num_entries; i++) { - DOM_SID sid; + struct dom_sid sid; uint32 rid; int dom_idx; const char *full_name; @@ -295,7 +295,7 @@ static NTSTATUS lookup_lsa_sids(TALLOC_CTX *mem_ctx, dom_idx = -1; if (type != SID_NAME_UNKNOWN) { - DOM_SID domain_sid; + struct dom_sid domain_sid; sid_copy(&domain_sid, &sid); sid_split_rid(&domain_sid, &rid); dom_idx = init_lsa_ref_domain_list(mem_ctx, ref, domain, &domain_sid); @@ -314,9 +314,9 @@ static NTSTATUS lookup_lsa_sids(TALLOC_CTX *mem_ctx, static NTSTATUS make_lsa_object_sd(TALLOC_CTX *mem_ctx, struct security_descriptor **sd, size_t *sd_size, const struct generic_mapping *map, - DOM_SID *sid, uint32_t sid_access) + struct dom_sid *sid, uint32_t sid_access) { - DOM_SID adm_sid; + struct dom_sid adm_sid; struct security_ace ace[5]; size_t i = 0; @@ -517,9 +517,9 @@ NTSTATUS _lsa_QueryInfoPolicy(pipes_struct *p, { NTSTATUS status = NT_STATUS_OK; struct lsa_info *handle; - DOM_SID domain_sid; + struct dom_sid domain_sid; const char *name; - DOM_SID *sid = NULL; + struct dom_sid *sid = NULL; union lsa_PolicyInformation *info = NULL; uint32_t acc_required = 0; @@ -786,7 +786,7 @@ static NTSTATUS _lsa_lookup_sids_internal(pipes_struct *p, { NTSTATUS status; int i; - const DOM_SID **sids = NULL; + const struct dom_sid **sids = NULL; struct lsa_RefDomainList *ref = NULL; uint32 mapped_count = 0; struct lsa_dom_info *dom_infos = NULL; @@ -801,7 +801,7 @@ static NTSTATUS _lsa_lookup_sids_internal(pipes_struct *p, return NT_STATUS_OK; } - sids = TALLOC_ARRAY(p->mem_ctx, const DOM_SID *, num_sids); + sids = TALLOC_ARRAY(p->mem_ctx, const struct dom_sid *, num_sids); ref = TALLOC_ZERO_P(p->mem_ctx, struct lsa_RefDomainList); if (sids == NULL || ref == NULL) { @@ -1565,7 +1565,7 @@ NTSTATUS _lsa_EnumAccounts(pipes_struct *p, struct lsa_EnumAccounts *r) { struct lsa_info *handle; - DOM_SID *sid_list; + struct dom_sid *sid_list; int i, j, num_entries; NTSTATUS status; struct lsa_SidPtr *sids = NULL; @@ -2162,7 +2162,7 @@ NTSTATUS _lsa_AddAccountRights(pipes_struct *p, uint32_t acc_granted = 0; struct security_descriptor *psd = NULL; size_t sd_size; - DOM_SID sid; + struct dom_sid sid; NTSTATUS status; /* find the connection policy handle. */ @@ -2231,7 +2231,7 @@ NTSTATUS _lsa_RemoveAccountRights(pipes_struct *p, int i = 0; struct security_descriptor *psd = NULL; size_t sd_size; - DOM_SID sid; + struct dom_sid sid; const char *privname = NULL; uint32_t acc_granted = 0; NTSTATUS status; @@ -2345,7 +2345,7 @@ NTSTATUS _lsa_EnumAccountRights(pipes_struct *p, { NTSTATUS status; struct lsa_info *info = NULL; - DOM_SID sid; + struct dom_sid sid; PRIVILEGE_SET privileges; SE_PRIV mask; diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index b5200af819..09b56ed6de 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -75,7 +75,7 @@ struct samr_alias_info { }; typedef struct disp_info { - DOM_SID sid; /* identify which domain this is. */ + struct dom_sid sid; /* identify which domain this is. */ struct pdb_search *users; /* querydispinfo 1 and 4 */ struct pdb_search *machines; /* querydispinfo 2 */ struct pdb_search *groups; /* querydispinfo 3 and 5, enumgroups */ @@ -124,9 +124,9 @@ static const struct generic_mapping ali_generic_mapping = { static NTSTATUS make_samr_object_sd( TALLOC_CTX *ctx, struct security_descriptor **psd, size_t *sd_size, const struct generic_mapping *map, - DOM_SID *sid, uint32 sid_access ) + struct dom_sid *sid, uint32 sid_access ) { - DOM_SID domadmin_sid; + struct dom_sid domadmin_sid; struct security_ace ace[5]; /* at most 5 entries */ size_t i = 0; @@ -267,7 +267,7 @@ void map_max_allowed_access(const NT_USER_TOKEN *nt_token, /* Full access for DOMAIN\Domain Admins. */ if ( IS_DC ) { - DOM_SID domadmin_sid; + struct dom_sid domadmin_sid; sid_compose(&domadmin_sid, get_global_sam_sid(), DOMAIN_RID_ADMINS); if (is_sid_in_token(nt_token, &domadmin_sid)) { @@ -731,7 +731,7 @@ NTSTATUS _samr_SetSecurity(pipes_struct *p, /******************************************************************* build correct perms based on policies and password times for _samr_query_sec_obj *******************************************************************/ -static bool check_change_pw_access(TALLOC_CTX *mem_ctx, DOM_SID *user_sid) +static bool check_change_pw_access(TALLOC_CTX *mem_ctx, struct dom_sid *user_sid) { struct samu *sampass=NULL; bool ret; @@ -2237,7 +2237,7 @@ NTSTATUS _samr_OpenUser(pipes_struct *p, struct samr_OpenUser *r) { struct samu *sampass=NULL; - DOM_SID sid; + struct dom_sid sid; struct samr_domain_info *dinfo; struct samr_user_info *uinfo; struct security_descriptor *psd = NULL; @@ -2432,9 +2432,9 @@ static struct samr_LogonHours get_logon_hours_from_pdb(TALLOC_CTX *mem_ctx, static NTSTATUS get_user_info_1(TALLOC_CTX *mem_ctx, struct samr_UserInfo1 *r, struct samu *pw, - DOM_SID *domain_sid) + struct dom_sid *domain_sid) { - const DOM_SID *sid_group; + const struct dom_sid *sid_group; uint32_t primary_gid; become_root(); @@ -2481,9 +2481,9 @@ static NTSTATUS get_user_info_2(TALLOC_CTX *mem_ctx, static NTSTATUS get_user_info_3(TALLOC_CTX *mem_ctx, struct samr_UserInfo3 *r, struct samu *pw, - DOM_SID *domain_sid) + struct dom_sid *domain_sid) { - const DOM_SID *sid_user, *sid_group; + const struct dom_sid *sid_user, *sid_group; uint32_t rid, primary_gid; sid_user = pdb_get_user_sid(pw); @@ -2552,9 +2552,9 @@ static NTSTATUS get_user_info_4(TALLOC_CTX *mem_ctx, static NTSTATUS get_user_info_5(TALLOC_CTX *mem_ctx, struct samr_UserInfo5 *r, struct samu *pw, - DOM_SID *domain_sid) + struct dom_sid *domain_sid) { - const DOM_SID *sid_user, *sid_group; + const struct dom_sid *sid_user, *sid_group; uint32_t rid, primary_gid; sid_user = pdb_get_user_sid(pw); @@ -2760,7 +2760,7 @@ static NTSTATUS get_user_info_17(TALLOC_CTX *mem_ctx, static NTSTATUS get_user_info_18(pipes_struct *p, TALLOC_CTX *mem_ctx, struct samr_UserInfo18 *r, - DOM_SID *user_sid) + struct dom_sid *user_sid) { struct samu *smbpass=NULL; bool ret; @@ -2854,11 +2854,11 @@ static NTSTATUS get_user_info_20(TALLOC_CTX *mem_ctx, static NTSTATUS get_user_info_21(TALLOC_CTX *mem_ctx, struct samr_UserInfo21 *r, struct samu *pw, - DOM_SID *domain_sid, + struct dom_sid *domain_sid, uint32_t acc_granted) { NTSTATUS status; - const DOM_SID *sid_user, *sid_group; + const struct dom_sid *sid_user, *sid_group; uint32_t rid, primary_gid; NTTIME force_password_change; time_t must_change_time; @@ -2971,7 +2971,7 @@ NTSTATUS _samr_QueryUserInfo(pipes_struct *p, NTSTATUS status; union samr_UserInfo *user_info = NULL; struct samr_user_info *uinfo; - DOM_SID domain_sid; + struct dom_sid domain_sid; uint32 rid; bool ret = false; struct samu *pwd = NULL; @@ -3188,7 +3188,7 @@ NTSTATUS _samr_GetGroupsForUser(pipes_struct *p, { struct samr_user_info *uinfo; struct samu *sam_pass=NULL; - DOM_SID *sids; + struct dom_sid *sids; struct samr_RidWithAttribute dom_gid; struct samr_RidWithAttribute *gids = NULL; uint32 primary_group_rid; @@ -3774,7 +3774,7 @@ NTSTATUS _samr_CreateUser2(pipes_struct *p, struct samr_CreateUser2 *r) { const char *account = NULL; - DOM_SID sid; + struct dom_sid sid; uint32_t acb_info = r->in.acct_flags; struct samr_domain_info *dinfo; struct samr_user_info *uinfo; @@ -4109,7 +4109,7 @@ NTSTATUS _samr_LookupDomain(pipes_struct *p, NTSTATUS status; struct samr_connect_info *info; const char *domain_name; - DOM_SID *sid = NULL; + struct dom_sid *sid = NULL; /* win9x user manager likes to use SAMR_ACCESS_ENUM_DOMAINS here. Reverted that change so we will work with RAS servers again */ @@ -4202,7 +4202,7 @@ NTSTATUS _samr_EnumDomains(pipes_struct *p, NTSTATUS _samr_OpenAlias(pipes_struct *p, struct samr_OpenAlias *r) { - DOM_SID sid; + struct dom_sid sid; uint32 alias_rid = r->in.rid; struct samr_alias_info *ainfo; struct samr_domain_info *dinfo; @@ -5345,7 +5345,7 @@ NTSTATUS _samr_GetAliasMembership(pipes_struct *p, NTSTATUS status; - DOM_SID *members; + struct dom_sid *members; DEBUG(5,("_samr_GetAliasMembership: %d\n", __LINE__)); @@ -5362,7 +5362,7 @@ NTSTATUS _samr_GetAliasMembership(pipes_struct *p, return NT_STATUS_OBJECT_TYPE_MISMATCH; if (r->in.sids->num_sids) { - members = TALLOC_ARRAY(p->mem_ctx, DOM_SID, r->in.sids->num_sids); + members = TALLOC_ARRAY(p->mem_ctx, struct dom_sid, r->in.sids->num_sids); if (members == NULL) return NT_STATUS_NO_MEMORY; @@ -5412,7 +5412,7 @@ NTSTATUS _samr_GetMembersInAlias(pipes_struct *p, size_t i; size_t num_sids = 0; struct lsa_SidPtr *sids = NULL; - DOM_SID *pdb_sids = NULL; + struct dom_sid *pdb_sids = NULL; ainfo = policy_handle_find(p, r->in.alias_handle, SAMR_ALIAS_ACCESS_GET_MEMBERS, NULL, @@ -5913,7 +5913,7 @@ NTSTATUS _samr_CreateDomainGroup(pipes_struct *p, NTSTATUS _samr_CreateDomAlias(pipes_struct *p, struct samr_CreateDomAlias *r) { - DOM_SID info_sid; + struct dom_sid info_sid; const char *name = NULL; struct samr_domain_info *dinfo; struct samr_alias_info *ainfo; @@ -6269,7 +6269,7 @@ NTSTATUS _samr_OpenGroup(pipes_struct *p, struct samr_OpenGroup *r) { - DOM_SID info_sid; + struct dom_sid info_sid; GROUP_MAP map; struct samr_domain_info *dinfo; struct samr_group_info *ginfo; diff --git a/source3/rpc_server/srv_spoolss_util.c b/source3/rpc_server/srv_spoolss_util.c index b46fc58759..eeae1def3e 100644 --- a/source3/rpc_server/srv_spoolss_util.c +++ b/source3/rpc_server/srv_spoolss_util.c @@ -2293,7 +2293,7 @@ create_default: this security descriptor has been created when winbindd was down. Take ownership of security descriptor. */ if (sid_equal(secdesc->owner_sid, &global_sid_World)) { - DOM_SID owner_sid; + struct dom_sid owner_sid; /* Change sd owner to workgroup administrator */ @@ -2393,7 +2393,7 @@ WERROR winreg_set_printer_secdesc(TALLOC_CTX *mem_ctx, * descriptor then copy them over from the old one. */ if (!secdesc->owner_sid || !secdesc->group_sid) { - DOM_SID *owner_sid, *group_sid; + struct dom_sid *owner_sid, *group_sid; struct security_acl *dacl, *sacl; size_t size; diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c index 6ddcc55b20..da01e6ec94 100644 --- a/source3/rpcclient/cmd_lsarpc.c +++ b/source3/rpcclient/cmd_lsarpc.c @@ -30,12 +30,12 @@ * looking it up automatically */ static NTSTATUS name_to_sid(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - DOM_SID *sid, const char *name) + struct dom_sid *sid, const char *name) { struct policy_handle pol; enum lsa_SidType *sid_types; NTSTATUS result; - DOM_SID *sids; + struct dom_sid *sids; /* maybe its a raw SID */ if (strncmp(name, "S-", 2) == 0 && @@ -212,7 +212,7 @@ static NTSTATUS cmd_lsa_lookup_names(struct rpc_pipe_client *cli, { struct policy_handle pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - DOM_SID *sids; + struct dom_sid *sids; enum lsa_SidType *types; int i; @@ -260,7 +260,7 @@ static NTSTATUS cmd_lsa_lookup_names_level(struct rpc_pipe_client *cli, { struct policy_handle pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - DOM_SID *sids; + struct dom_sid *sids; enum lsa_SidType *types; int i, level; @@ -361,7 +361,7 @@ static NTSTATUS cmd_lsa_lookup_sids(struct rpc_pipe_client *cli, TALLOC_CTX *mem { struct policy_handle pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - DOM_SID *sids; + struct dom_sid *sids; char **domains; char **names; enum lsa_SidType *types; @@ -381,7 +381,7 @@ static NTSTATUS cmd_lsa_lookup_sids(struct rpc_pipe_client *cli, TALLOC_CTX *mem /* Convert arguments to sids */ - sids = TALLOC_ARRAY(mem_ctx, DOM_SID, argc - 1); + sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, argc - 1); if (!sids) { printf("could not allocate memory for %d sids\n", argc - 1); @@ -732,7 +732,7 @@ static NTSTATUS cmd_lsa_create_account(struct rpc_pipe_client *cli, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; uint32 des_access = 0x000f000f; - DOM_SID sid; + struct dom_sid sid; if (argc != 2 ) { printf("Usage: %s SID\n", argv[0]); @@ -778,7 +778,7 @@ static NTSTATUS cmd_lsa_enum_privsaccounts(struct rpc_pipe_client *cli, struct policy_handle user_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; uint32 access_desired = 0x000f000f; - DOM_SID sid; + struct dom_sid sid; struct lsa_PrivilegeSet *privs = NULL; int i; @@ -839,7 +839,7 @@ static NTSTATUS cmd_lsa_enum_acct_rights(struct rpc_pipe_client *cli, { struct policy_handle dom_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - DOM_SID sid; + struct dom_sid sid; struct lsa_RightSet rights; int i; @@ -890,7 +890,7 @@ static NTSTATUS cmd_lsa_add_acct_rights(struct rpc_pipe_client *cli, struct policy_handle dom_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; struct lsa_RightSet rights; - DOM_SID sid; + struct dom_sid sid; int i; if (argc < 3 ) { @@ -943,7 +943,7 @@ static NTSTATUS cmd_lsa_remove_acct_rights(struct rpc_pipe_client *cli, struct policy_handle dom_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; struct lsa_RightSet rights; - DOM_SID sid; + struct dom_sid sid; int i; if (argc < 3 ) { @@ -1120,7 +1120,7 @@ static NTSTATUS cmd_lsa_query_trustdominfobysid(struct rpc_pipe_client *cli, { struct policy_handle pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - DOM_SID dom_sid; + struct dom_sid dom_sid; uint32 access_mask = SEC_FLAG_MAXIMUM_ALLOWED; union lsa_TrustedDomainInfo *info = NULL; enum lsa_TrustDomInfoEnum info_class = 1; @@ -1219,7 +1219,7 @@ static NTSTATUS cmd_lsa_query_trustdominfo(struct rpc_pipe_client *cli, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; uint32 access_mask = SEC_FLAG_MAXIMUM_ALLOWED; union lsa_TrustedDomainInfo *info = NULL; - DOM_SID dom_sid; + struct dom_sid dom_sid; enum lsa_TrustDomInfoEnum info_class = 1; uint8_t nt_hash[16]; @@ -1320,7 +1320,7 @@ static NTSTATUS cmd_lsa_add_priv(struct rpc_pipe_client *cli, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; struct lsa_PrivilegeSet privs; struct lsa_LUIDAttribute *set = NULL; - DOM_SID sid; + struct dom_sid sid; int i; ZERO_STRUCT(privs); @@ -1404,7 +1404,7 @@ static NTSTATUS cmd_lsa_del_priv(struct rpc_pipe_client *cli, NTSTATUS result = NT_STATUS_UNSUCCESSFUL; struct lsa_PrivilegeSet privs; struct lsa_LUIDAttribute *set = NULL; - DOM_SID sid; + struct dom_sid sid; int i; ZERO_STRUCT(privs); diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index 7cd2f9af88..199c8b1dcc 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -29,7 +29,7 @@ #include "rpc_client/cli_samr.h" #include "rpc_client/init_samr.h" -extern DOM_SID domain_sid; +extern struct dom_sid domain_sid; /**************************************************************************** display samr_user_info_7 structure @@ -630,7 +630,7 @@ static NTSTATUS cmd_samr_query_useraliases(struct rpc_pipe_client *cli, { struct policy_handle connect_pol, domain_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - DOM_SID *sids; + struct dom_sid *sids; size_t num_sids; uint32 access_mask = MAXIMUM_ALLOWED_ACCESS; int i; @@ -646,7 +646,7 @@ static NTSTATUS cmd_samr_query_useraliases(struct rpc_pipe_client *cli, num_sids = 0; for (i=2; ist_ex_uid ); gid_to_sid( pgroup_sid, psbuf->st_ex_gid ); @@ -1172,8 +1172,8 @@ NTSTATUS unpack_nt_owners(struct connection_struct *conn, uint32 security_info_sent, const struct security_descriptor *psd) { - DOM_SID owner_sid; - DOM_SID grp_sid; + struct dom_sid owner_sid; + struct dom_sid grp_sid; *puser = (uid_t)-1; *pgrp = (gid_t)-1; @@ -1348,8 +1348,8 @@ static bool uid_entry_in_group(connection_struct *conn, canon_ace *uid_ace, cano static bool ensure_canon_entry_valid(connection_struct *conn, canon_ace **pp_ace, const struct share_params *params, const bool is_directory, - const DOM_SID *pfile_owner_sid, - const DOM_SID *pfile_grp_sid, + const struct dom_sid *pfile_owner_sid, + const struct dom_sid *pfile_grp_sid, const SMB_STRUCT_STAT *pst, bool setting_acl) { @@ -1490,7 +1490,7 @@ static bool ensure_canon_entry_valid(connection_struct *conn, canon_ace **pp_ace file owner or the owning group, and map these to SMB_ACL_USER_OBJ and SMB_ACL_GROUP_OBJ. ****************************************************************************/ -static void check_owning_objs(canon_ace *ace, DOM_SID *pfile_owner_sid, DOM_SID *pfile_grp_sid) +static void check_owning_objs(canon_ace *ace, struct dom_sid *pfile_owner_sid, struct dom_sid *pfile_grp_sid) { bool got_user_obj, got_group_obj; canon_ace *current_ace; @@ -1579,8 +1579,8 @@ static bool dup_owning_ace(canon_ace *dir_ace, canon_ace *ace) static bool create_canon_ace_lists(files_struct *fsp, const SMB_STRUCT_STAT *pst, - DOM_SID *pfile_owner_sid, - DOM_SID *pfile_grp_sid, + struct dom_sid *pfile_owner_sid, + struct dom_sid *pfile_grp_sid, canon_ace **ppfile_ace, canon_ace **ppdir_ace, const struct security_acl *dacl) @@ -2314,8 +2314,8 @@ static mode_t create_default_mode(files_struct *fsp, bool interitable_mode) static bool unpack_canon_ace(files_struct *fsp, const SMB_STRUCT_STAT *pst, - DOM_SID *pfile_owner_sid, - DOM_SID *pfile_grp_sid, + struct dom_sid *pfile_owner_sid, + struct dom_sid *pfile_grp_sid, canon_ace **ppfile_ace, canon_ace **ppdir_ace, uint32 security_info_sent, @@ -2493,7 +2493,7 @@ static void arrange_posix_perms(const char *filename, canon_ace **pp_list_head) static canon_ace *canonicalise_acl(struct connection_struct *conn, const char *fname, SMB_ACL_T posix_acl, const SMB_STRUCT_STAT *psbuf, - const DOM_SID *powner, const DOM_SID *pgroup, struct pai_val *pal, SMB_ACL_TYPE_T the_acl_type) + const struct dom_sid *powner, const struct dom_sid *pgroup, struct pai_val *pal, SMB_ACL_TYPE_T the_acl_type) { mode_t acl_mask = (S_IRUSR|S_IWUSR|S_IXUSR); canon_ace *l_head = NULL; @@ -2506,7 +2506,7 @@ static canon_ace *canonicalise_acl(struct connection_struct *conn, while ( posix_acl && (SMB_VFS_SYS_ACL_GET_ENTRY(conn, posix_acl, entry_id, &entry) == 1)) { SMB_ACL_TAG_T tagtype; SMB_ACL_PERMSET_T permset; - DOM_SID sid; + struct dom_sid sid; posix_id unix_ug; enum ace_owner owner_type; @@ -3137,7 +3137,7 @@ static size_t merge_default_aces( struct security_ace *nt_ace_list, size_t num_a */ static void add_or_replace_ace(struct security_ace *nt_ace_list, size_t *num_aces, - const DOM_SID *sid, enum security_ace_type type, + const struct dom_sid *sid, enum security_ace_type type, uint32_t mask, uint8_t flags) { int i; @@ -3177,8 +3177,8 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn, uint32_t security_info, struct security_descriptor **ppdesc) { - DOM_SID owner_sid; - DOM_SID group_sid; + struct dom_sid owner_sid; + struct dom_sid group_sid; size_t sd_size = 0; struct security_acl *psa = NULL; size_t num_acls = 0; @@ -3188,7 +3188,7 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn, canon_ace *dir_ace = NULL; struct security_ace *nt_ace_list = NULL; size_t num_profile_acls = 0; - DOM_SID orig_owner_sid; + struct dom_sid orig_owner_sid; struct security_descriptor *psd = NULL; int i; @@ -3832,8 +3832,8 @@ NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, const struct s connection_struct *conn = fsp->conn; uid_t user = (uid_t)-1; gid_t grp = (gid_t)-1; - DOM_SID file_owner_sid; - DOM_SID file_grp_sid; + struct dom_sid file_owner_sid; + struct dom_sid file_grp_sid; canon_ace *file_ace_list = NULL; canon_ace *dir_ace_list = NULL; bool acl_perms = False; diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 8ba32652cd..689f0e2f07 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -474,12 +474,12 @@ static NTSTATUS share_sanity_checks(int snum, fstring dev) static NTSTATUS find_forced_group(bool force_user, int snum, const char *username, - DOM_SID *pgroup_sid, + struct dom_sid *pgroup_sid, gid_t *pgid) { NTSTATUS result = NT_STATUS_NO_SUCH_GROUP; TALLOC_CTX *frame = talloc_stackframe(); - DOM_SID group_sid; + struct dom_sid group_sid; enum lsa_SidType type; char *groupname; bool user_must_be_member = False; diff --git a/source3/smbd/share_access.c b/source3/smbd/share_access.c index a300d6f1de..9800e4f01a 100644 --- a/source3/smbd/share_access.c +++ b/source3/smbd/share_access.c @@ -71,7 +71,7 @@ static bool token_contains_name(TALLOC_CTX *mem_ctx, const char *name) { const char *prefix; - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; struct smbd_server_connection *sconn = smbd_server_conn; diff --git a/source3/utils/net.c b/source3/utils/net.c index 85ef1ec407..c677e3a9ba 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -231,7 +231,7 @@ static int net_getauthuser(struct net_context *c, int argc, const char **argv) */ static int net_getlocalsid(struct net_context *c, int argc, const char **argv) { - DOM_SID sid; + struct dom_sid sid; const char *name; fstring sid_str; @@ -271,7 +271,7 @@ static int net_getlocalsid(struct net_context *c, int argc, const char **argv) static int net_setlocalsid(struct net_context *c, int argc, const char **argv) { - DOM_SID sid; + struct dom_sid sid; if ( (argc != 1) || (strncmp(argv[0], "S-1-5-21-", strlen("S-1-5-21-")) != 0) @@ -292,7 +292,7 @@ static int net_setlocalsid(struct net_context *c, int argc, const char **argv) static int net_setdomainsid(struct net_context *c, int argc, const char **argv) { - DOM_SID sid; + struct dom_sid sid; if ( (argc != 1) || (strncmp(argv[0], "S-1-5-21-", strlen("S-1-5-21-")) != 0) @@ -313,7 +313,7 @@ static int net_setdomainsid(struct net_context *c, int argc, const char **argv) static int net_getdomainsid(struct net_context *c, int argc, const char **argv) { - DOM_SID domain_sid; + struct dom_sid domain_sid; fstring sid_str; if (argc > 0) { diff --git a/source3/utils/net.h b/source3/utils/net.h index 91e8c53099..21f393b243 100644 --- a/source3/utils/net.h +++ b/source3/utils/net.h @@ -109,7 +109,7 @@ struct functable { }; typedef NTSTATUS (*rpc_command_fn)(struct net_context *c, - const DOM_SID *, + const struct dom_sid *, const char *, struct cli_state *cli, struct rpc_pipe_client *, @@ -129,7 +129,7 @@ typedef struct copy_clistate { struct rpc_sh_ctx { struct cli_state *cli; - DOM_SID *domain_sid; + struct dom_sid *domain_sid; const char *domain_name; const char *whoami; diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c index 2777772711..fa6cf8309b 100644 --- a/source3/utils/net_ads.c +++ b/source3/utils/net_ads.c @@ -539,7 +539,7 @@ static int ads_user_info(struct net_context *c, int argc, const char **argv) char **grouplist; char *primary_group; char *escaped_user; - DOM_SID primary_group_sid; + struct dom_sid primary_group_sid; uint32_t group_rid; enum SID_NAME_USE type; @@ -2181,7 +2181,7 @@ static int net_ads_sid(struct net_context *c, int argc, const char **argv) const char *sid_string; const char **attrs; LDAPMessage *res = NULL; - DOM_SID sid; + struct dom_sid sid; if (argc < 1 || c->display_usage) { return net_ads_sid_usage(c, argc, argv); diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c index 9b46808b8b..5e3b5bc61a 100644 --- a/source3/utils/net_groupmap.c +++ b/source3/utils/net_groupmap.c @@ -28,7 +28,7 @@ Figure out if the input was an NT group or a SID string. Return the SID. **********************************************************/ -static bool get_sid_from_input(DOM_SID *sid, char *input) +static bool get_sid_from_input(struct dom_sid *sid, char *input) { GROUP_MAP map; @@ -123,7 +123,7 @@ static int net_groupmap_list(struct net_context *c, int argc, const char **argv) /* list a single group is given a name */ if ( ntgroup[0] || sid_string[0] ) { - DOM_SID sid; + struct dom_sid sid; GROUP_MAP map; if ( sid_string[0] ) @@ -165,7 +165,7 @@ static int net_groupmap_list(struct net_context *c, int argc, const char **argv) static int net_groupmap_add(struct net_context *c, int argc, const char **argv) { - DOM_SID sid; + struct dom_sid sid; fstring ntgroup = ""; fstring unixgrp = ""; fstring string_sid = ""; @@ -335,7 +335,7 @@ static int net_groupmap_add(struct net_context *c, int argc, const char **argv) static int net_groupmap_modify(struct net_context *c, int argc, const char **argv) { - DOM_SID sid; + struct dom_sid sid; GROUP_MAP map; fstring ntcomment = ""; fstring type = ""; @@ -483,7 +483,7 @@ static int net_groupmap_modify(struct net_context *c, int argc, const char **arg static int net_groupmap_delete(struct net_context *c, int argc, const char **argv) { - DOM_SID sid; + struct dom_sid sid; fstring ntgroup = ""; fstring sid_string = ""; int i; @@ -580,7 +580,7 @@ static int net_groupmap_set(struct net_context *c, int argc, const char **argv) have_map = pdb_getgrnam(&map, ntgroup); if (!have_map) { - DOM_SID sid; + struct dom_sid sid; have_map = ( (strncmp(ntgroup, "S-", 2) == 0) && string_to_sid(&sid, ntgroup) && pdb_getgrsid(&map, sid) ); @@ -705,7 +705,7 @@ static int net_groupmap_cleanup(struct net_context *c, int argc, const char **ar static int net_groupmap_addmem(struct net_context *c, int argc, const char **argv) { - DOM_SID alias, member; + struct dom_sid alias, member; if ( (argc != 2) || c->display_usage || @@ -728,7 +728,7 @@ static int net_groupmap_addmem(struct net_context *c, int argc, const char **arg static int net_groupmap_delmem(struct net_context *c, int argc, const char **argv) { - DOM_SID alias, member; + struct dom_sid alias, member; if ( (argc != 2) || c->display_usage || @@ -751,8 +751,8 @@ static int net_groupmap_delmem(struct net_context *c, int argc, const char **arg static int net_groupmap_listmem(struct net_context *c, int argc, const char **argv) { - DOM_SID alias; - DOM_SID *members; + struct dom_sid alias; + struct dom_sid *members; size_t i, num; if ( (argc != 1) || @@ -784,8 +784,8 @@ static int net_groupmap_listmem(struct net_context *c, int argc, const char **ar } static bool print_alias_memberships(TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, - const DOM_SID *member) + const struct dom_sid *domain_sid, + const struct dom_sid *member) { uint32 *alias_rids; size_t i, num_alias_rids; @@ -802,7 +802,7 @@ static bool print_alias_memberships(TALLOC_CTX *mem_ctx, } for (i = 0; i < num_alias_rids; i++) { - DOM_SID alias; + struct dom_sid alias; sid_compose(&alias, domain_sid, alias_rids[i]); printf("%s\n", sid_string_tos(&alias)); } @@ -813,7 +813,7 @@ static bool print_alias_memberships(TALLOC_CTX *mem_ctx, static int net_groupmap_memberships(struct net_context *c, int argc, const char **argv) { TALLOC_CTX *mem_ctx; - DOM_SID *domain_sid, member; + struct dom_sid *domain_sid, member; if ( (argc != 1) || c->display_usage || diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c index 32680e0dee..1400e31174 100644 --- a/source3/utils/net_idmap.c +++ b/source3/utils/net_idmap.c @@ -333,7 +333,7 @@ static int net_idmap_aclmapset(struct net_context *c, int argc, const char **arg { TALLOC_CTX *mem_ctx; int result = -1; - DOM_SID src_sid, dst_sid; + struct dom_sid src_sid, dst_sid; char *src, *dst; struct db_context *db; struct db_record *rec; diff --git a/source3/utils/net_lookup.c b/source3/utils/net_lookup.c index 25c781f2c4..585a1185e6 100644 --- a/source3/utils/net_lookup.c +++ b/source3/utils/net_lookup.c @@ -321,7 +321,7 @@ static int net_lookup_kdc(struct net_context *c, int argc, const char **argv) static int net_lookup_name(struct net_context *c, int argc, const char **argv) { const char *dom, *name; - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; if (argc != 1) { @@ -345,7 +345,7 @@ static int net_lookup_name(struct net_context *c, int argc, const char **argv) static int net_lookup_sid(struct net_context *c, int argc, const char **argv) { const char *dom, *name; - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; if (argc != 1) { diff --git a/source3/utils/net_printing.c b/source3/utils/net_printing.c index eaea71e58f..c7a262433e 100644 --- a/source3/utils/net_printing.c +++ b/source3/utils/net_printing.c @@ -596,7 +596,7 @@ static NTSTATUS migrate_secdesc(TALLOC_CTX *mem_ctx, } static NTSTATUS printing_migrate_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, diff --git a/source3/utils/net_proto.h b/source3/utils/net_proto.h index 4cfd148309..9f3fe155a4 100644 --- a/source3/utils/net_proto.h +++ b/source3/utils/net_proto.h @@ -26,16 +26,16 @@ /* The following definitions come from auth/token_util.c */ -bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token ); +bool nt_token_check_sid ( const struct dom_sid *sid, const NT_USER_TOKEN *token ); bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid ); NT_USER_TOKEN *get_root_nt_token( void ); -NTSTATUS add_aliases(const DOM_SID *domain_sid, +NTSTATUS add_aliases(const struct dom_sid *domain_sid, struct nt_user_token *token); struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx, - const DOM_SID *user_sid, + const struct dom_sid *user_sid, bool is_guest, int num_groupsids, - const DOM_SID *groupsids); + const struct dom_sid *groupsids); void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token); void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid, int n_groups, gid_t *groups); @@ -154,7 +154,7 @@ int net_registry(struct net_context *c, int argc, const char **argv); /* The following definitions come from utils/net_rpc.c */ NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx, - DOM_SID **domain_sid, + struct dom_sid **domain_sid, const char **domain_name); int run_rpc_command(struct net_context *c, struct cli_state *cli_arg, @@ -166,7 +166,7 @@ int run_rpc_command(struct net_context *c, int net_rpc_changetrustpw(struct net_context *c, int argc, const char **argv); int net_rpc_join(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_info_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -193,7 +193,7 @@ struct rpc_sh_cmd *net_rpc_share_cmds(struct net_context *c, TALLOC_CTX *mem_ctx struct rpc_sh_ctx *ctx); int net_rpc_file(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_init_shutdown_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -201,7 +201,7 @@ NTSTATUS rpc_init_shutdown_internals(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_reg_shutdown_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -242,7 +242,7 @@ NTSTATUS net_copy_file(struct net_context *c, bool copy_acls, bool copy_attrs, bool copy_timestamps, bool is_file); NTSTATUS rpc_printer_list_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -250,7 +250,7 @@ NTSTATUS rpc_printer_list_internals(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_printer_driver_list_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -258,7 +258,7 @@ NTSTATUS rpc_printer_driver_list_internals(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_printer_publish_publish_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -266,7 +266,7 @@ NTSTATUS rpc_printer_publish_publish_internals(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_printer_publish_unpublish_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -274,7 +274,7 @@ NTSTATUS rpc_printer_publish_unpublish_internals(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_printer_publish_update_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -282,7 +282,7 @@ NTSTATUS rpc_printer_publish_update_internals(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_printer_publish_list_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -290,7 +290,7 @@ NTSTATUS rpc_printer_publish_list_internals(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -298,7 +298,7 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -306,7 +306,7 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -314,7 +314,7 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -322,7 +322,7 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -343,7 +343,7 @@ struct rpc_sh_cmd *net_rpc_rights_cmds(struct net_context *c, TALLOC_CTX *mem_ct /* The following definitions come from utils/net_rpc_samsync.c */ NTSTATUS rpc_samdump_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -352,7 +352,7 @@ NTSTATUS rpc_samdump_internals(struct net_context *c, const char **argv); int rpc_vampire_usage(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_vampire_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -362,7 +362,7 @@ NTSTATUS rpc_vampire_internals(struct net_context *c, int rpc_vampire_passdb(struct net_context *c, int argc, const char **argv); int rpc_vampire_ldif(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_vampire_ldif_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -370,7 +370,7 @@ NTSTATUS rpc_vampire_ldif_internals(struct net_context *c, int argc, const char **argv); NTSTATUS rpc_vampire_keytab_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -440,7 +440,7 @@ int net_serverid(struct net_context *c, int argc, const char **argv); NTSTATUS net_rpc_lookup_name(struct net_context *c, TALLOC_CTX *mem_ctx, struct cli_state *cli, const char *name, const char **ret_domain, - const char **ret_name, DOM_SID *ret_sid, + const char **ret_name, struct dom_sid *ret_sid, enum lsa_SidType *ret_type); NTSTATUS connect_to_service(struct net_context *c, struct cli_state **cli_ctx, @@ -494,11 +494,11 @@ NTSTATUS net_scan_dc(struct net_context *c, NTSTATUS net_lookup_name_from_sid(struct net_context *c, TALLOC_CTX *ctx, - DOM_SID *psid, + struct dom_sid *psid, const char **ppdomain, const char **ppname); NTSTATUS net_lookup_sid_from_name(struct net_context *c, TALLOC_CTX *ctx, - const char *full_name, DOM_SID *pret_sid); + const char *full_name, struct dom_sid *pret_sid); /* The following definitions come from utils/passwd_util.c */ diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 9a88a82219..773663fb47 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -62,7 +62,7 @@ static bool sync_files(struct copy_clistate *cp_clistate, const char *mask); **/ NTSTATUS net_get_remote_domain_sid(struct cli_state *cli, TALLOC_CTX *mem_ctx, - DOM_SID **domain_sid, + struct dom_sid **domain_sid, const char **domain_name) { struct rpc_pipe_client *lsa_pipe = NULL; @@ -131,7 +131,7 @@ int run_rpc_command(struct net_context *c, struct rpc_pipe_client *pipe_hnd = NULL; TALLOC_CTX *mem_ctx; NTSTATUS nt_status; - DOM_SID *domain_sid; + struct dom_sid *domain_sid; const char *domain_name; int ret = -1; @@ -244,7 +244,7 @@ fail: **/ static NTSTATUS rpc_changetrustpw_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -312,7 +312,7 @@ int net_rpc_changetrustpw(struct net_context *c, int argc, const char **argv) **/ static NTSTATUS rpc_oldjoin_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -491,7 +491,7 @@ int net_rpc_join(struct net_context *c, int argc, const char **argv) **/ NTSTATUS rpc_info_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -588,7 +588,7 @@ int net_rpc_info(struct net_context *c, int argc, const char **argv) **/ static NTSTATUS rpc_getsid_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -1106,7 +1106,7 @@ static NTSTATUS rpc_sh_handle_user(struct net_context *c, { struct policy_handle connect_pol, domain_pol, user_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - DOM_SID sid; + struct dom_sid sid; uint32 rid; enum lsa_SidType type; @@ -1495,7 +1495,7 @@ static int rpc_group_usage(struct net_context *c, int argc, const char **argv) **/ static NTSTATUS rpc_group_delete_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -1781,10 +1781,10 @@ static int rpc_group_add(struct net_context *c, int argc, const char **argv) static NTSTATUS get_sid_from_name(struct cli_state *cli, TALLOC_CTX *mem_ctx, const char *name, - DOM_SID *sid, + struct dom_sid *sid, enum lsa_SidType *type) { - DOM_SID *sids = NULL; + struct dom_sid *sids = NULL; enum lsa_SidType *types = NULL; struct rpc_pipe_client *pipe_hnd = NULL; struct policy_handle lsa_pol; @@ -1822,7 +1822,7 @@ static NTSTATUS get_sid_from_name(struct cli_state *cli, /* Try as S-1-5-whatever */ - DOM_SID tmp_sid; + struct dom_sid tmp_sid; if (string_to_sid(&tmp_sid, name)) { sid_copy(sid, &tmp_sid); @@ -1836,7 +1836,7 @@ static NTSTATUS get_sid_from_name(struct cli_state *cli, static NTSTATUS rpc_add_groupmem(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - const DOM_SID *group_sid, + const struct dom_sid *group_sid, const char *member) { struct policy_handle connect_pol, domain_pol; @@ -1847,7 +1847,7 @@ static NTSTATUS rpc_add_groupmem(struct rpc_pipe_client *pipe_hnd, struct samr_Ids rids, rid_types; struct lsa_String lsa_acct_name; - DOM_SID sid; + struct dom_sid sid; sid_copy(&sid, group_sid); @@ -1911,7 +1911,7 @@ static NTSTATUS rpc_add_groupmem(struct rpc_pipe_client *pipe_hnd, static NTSTATUS rpc_add_aliasmem(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - const DOM_SID *alias_sid, + const struct dom_sid *alias_sid, const char *member) { struct policy_handle connect_pol, domain_pol; @@ -1919,10 +1919,10 @@ static NTSTATUS rpc_add_aliasmem(struct rpc_pipe_client *pipe_hnd, uint32 alias_rid; struct policy_handle alias_pol; - DOM_SID member_sid; + struct dom_sid member_sid; enum lsa_SidType member_type; - DOM_SID sid; + struct dom_sid sid; sid_copy(&sid, alias_sid); @@ -1982,7 +1982,7 @@ static NTSTATUS rpc_add_aliasmem(struct rpc_pipe_client *pipe_hnd, } static NTSTATUS rpc_group_addmem_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -1990,7 +1990,7 @@ static NTSTATUS rpc_group_addmem_internals(struct net_context *c, int argc, const char **argv) { - DOM_SID group_sid; + struct dom_sid group_sid; enum lsa_SidType group_type; if (argc != 2 || c->display_usage) { @@ -2048,7 +2048,7 @@ static int rpc_group_addmem(struct net_context *c, int argc, const char **argv) static NTSTATUS rpc_del_groupmem(struct net_context *c, struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - const DOM_SID *group_sid, + const struct dom_sid *group_sid, const char *member) { struct policy_handle connect_pol, domain_pol; @@ -2059,7 +2059,7 @@ static NTSTATUS rpc_del_groupmem(struct net_context *c, struct samr_Ids rids, rid_types; struct lsa_String lsa_acct_name; - DOM_SID sid; + struct dom_sid sid; sid_copy(&sid, group_sid); @@ -2117,7 +2117,7 @@ static NTSTATUS rpc_del_groupmem(struct net_context *c, static NTSTATUS rpc_del_aliasmem(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - const DOM_SID *alias_sid, + const struct dom_sid *alias_sid, const char *member) { struct policy_handle connect_pol, domain_pol; @@ -2125,10 +2125,10 @@ static NTSTATUS rpc_del_aliasmem(struct rpc_pipe_client *pipe_hnd, uint32 alias_rid; struct policy_handle alias_pol; - DOM_SID member_sid; + struct dom_sid member_sid; enum lsa_SidType member_type; - DOM_SID sid; + struct dom_sid sid; sid_copy(&sid, alias_sid); @@ -2185,7 +2185,7 @@ static NTSTATUS rpc_del_aliasmem(struct rpc_pipe_client *pipe_hnd, } static NTSTATUS rpc_group_delmem_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -2193,7 +2193,7 @@ static NTSTATUS rpc_group_delmem_internals(struct net_context *c, int argc, const char **argv) { - DOM_SID group_sid; + struct dom_sid group_sid; enum lsa_SidType group_type; if (argc != 2 || c->display_usage) { @@ -2265,7 +2265,7 @@ static int rpc_group_delmem(struct net_context *c, int argc, const char **argv) **/ static NTSTATUS rpc_group_list_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -2500,7 +2500,7 @@ static NTSTATUS rpc_list_group_members(struct net_context *c, struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, const char *domain_name, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, struct policy_handle *domain_pol, uint32 rid) { @@ -2583,7 +2583,7 @@ static NTSTATUS rpc_list_alias_members(struct net_context *c, struct rpc_pipe_client *lsa_pipe; struct policy_handle alias_pol, lsa_pol; uint32 num_members; - DOM_SID *alias_sids; + struct dom_sid *alias_sids; char **domains; char **names; enum lsa_SidType *types; @@ -2632,7 +2632,7 @@ static NTSTATUS rpc_list_alias_members(struct net_context *c, return result; } - alias_sids = TALLOC_ZERO_ARRAY(mem_ctx, DOM_SID, num_members); + alias_sids = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, num_members); if (!alias_sids) { d_fprintf(stderr, _("Out of memory\n")); TALLOC_FREE(lsa_pipe); @@ -2675,7 +2675,7 @@ static NTSTATUS rpc_list_alias_members(struct net_context *c, } static NTSTATUS rpc_group_members_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -2722,7 +2722,7 @@ static NTSTATUS rpc_group_members_internals(struct net_context *c, /* Ok, did not find it in the global sam, try with builtin */ - DOM_SID sid_Builtin; + struct dom_sid sid_Builtin; rpccli_samr_Close(pipe_hnd, mem_ctx, &domain_pol); @@ -3224,7 +3224,7 @@ static bool check_share_sanity(struct net_context *c, struct cli_state *cli, **/ static NTSTATUS rpc_share_migrate_shares_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -3529,7 +3529,7 @@ bool copy_top_level_perms(struct net_context *c, **/ static NTSTATUS rpc_share_migrate_files_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -3687,7 +3687,7 @@ static int rpc_share_migrate_files(struct net_context *c, int argc, const char * **/ static NTSTATUS rpc_share_migrate_security_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -3897,9 +3897,9 @@ static int rpc_share_migrate(struct net_context *c, int argc, const char **argv) } struct full_alias { - DOM_SID sid; + struct dom_sid sid; uint32 num_members; - DOM_SID *members; + struct dom_sid *members; }; static int num_server_aliases; @@ -3925,7 +3925,7 @@ static void push_alias(TALLOC_CTX *mem_ctx, struct full_alias *alias) static NTSTATUS rpc_fetch_domain_aliases(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, struct policy_handle *connect_pol, - const DOM_SID *domain_sid) + const struct dom_sid *domain_sid) { uint32 start_idx, max_entries, num_entries, i; struct samr_SamArray *groups = NULL; @@ -3982,7 +3982,7 @@ static NTSTATUS rpc_fetch_domain_aliases(struct rpc_pipe_client *pipe_hnd, alias.members = NULL; if (alias.num_members > 0) { - alias.members = SMB_MALLOC_ARRAY(DOM_SID, alias.num_members); + alias.members = SMB_MALLOC_ARRAY(struct dom_sid, alias.num_members); for (j = 0; j < alias.num_members; j++) sid_copy(&alias.members[j], @@ -4009,7 +4009,7 @@ static NTSTATUS rpc_fetch_domain_aliases(struct rpc_pipe_client *pipe_hnd, */ static NTSTATUS rpc_aliaslist_dump(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -4075,7 +4075,7 @@ static NTSTATUS rpc_aliaslist_dump(struct net_context *c, */ static NTSTATUS rpc_aliaslist_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -4108,11 +4108,11 @@ static NTSTATUS rpc_aliaslist_internals(struct net_context *c, return result; } -static void init_user_token(NT_USER_TOKEN *token, DOM_SID *user_sid) +static void init_user_token(NT_USER_TOKEN *token, struct dom_sid *user_sid) { token->num_sids = 4; - if (!(token->user_sids = SMB_MALLOC_ARRAY(DOM_SID, 4))) { + if (!(token->user_sids = SMB_MALLOC_ARRAY(struct dom_sid, 4))) { d_fprintf(stderr, "malloc %s\n",_("failed")); token->num_sids = 0; return; @@ -4129,12 +4129,12 @@ static void free_user_token(NT_USER_TOKEN *token) SAFE_FREE(token->user_sids); } -static void add_sid_to_token(NT_USER_TOKEN *token, DOM_SID *sid) +static void add_sid_to_token(NT_USER_TOKEN *token, struct dom_sid *sid) { if (is_sid_in_token(token, sid)) return; - token->user_sids = SMB_REALLOC_ARRAY(token->user_sids, DOM_SID, token->num_sids+1); + token->user_sids = SMB_REALLOC_ARRAY(token->user_sids, struct dom_sid, token->num_sids+1); if (!token->user_sids) { return; } @@ -4160,7 +4160,7 @@ static void dump_user_token(struct user_token *token) } } -static bool is_alias_member(DOM_SID *sid, struct full_alias *alias) +static bool is_alias_member(struct dom_sid *sid, struct full_alias *alias) { int i; @@ -4172,7 +4172,7 @@ static bool is_alias_member(DOM_SID *sid, struct full_alias *alias) return false; } -static void collect_sid_memberships(NT_USER_TOKEN *token, DOM_SID sid) +static void collect_sid_memberships(NT_USER_TOKEN *token, struct dom_sid sid) { int i; @@ -4206,7 +4206,7 @@ static bool get_user_sids(const char *domain, const char *user, NT_USER_TOKEN *t fstring full_name; struct wbcDomainSid wsid; char *sid_str = NULL; - DOM_SID user_sid; + struct dom_sid user_sid; uint32_t num_groups; gid_t *groups = NULL; uint32_t i; @@ -4256,7 +4256,7 @@ static bool get_user_sids(const char *domain, const char *user, NT_USER_TOKEN *t for (i = 0; i < num_groups; i++) { gid_t gid = groups[i]; - DOM_SID sid; + struct dom_sid sid; wbc_status = wbcGidToSid(gid, &wsid); if (!WBC_ERROR_IS_OK(wbc_status)) { @@ -4375,7 +4375,7 @@ static bool get_user_tokens_from_file(FILE *f, if (line[0] == ' ') { /* We have a SID */ - DOM_SID sid; + struct dom_sid sid; if(!string_to_sid(&sid, &line[1])) { DEBUG(1,("get_user_tokens_from_file: Could " "not convert sid %s \n",&line[1])); @@ -4539,7 +4539,7 @@ static void collect_share(const char *name, uint32 m, **/ static NTSTATUS rpc_share_allowedusers_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -5054,7 +5054,7 @@ int net_rpc_file(struct net_context *c, int argc, const char **argv) **/ static NTSTATUS rpc_shutdown_abort_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -5093,7 +5093,7 @@ static NTSTATUS rpc_shutdown_abort_internals(struct net_context *c, **/ static NTSTATUS rpc_reg_shutdown_abort_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -5169,7 +5169,7 @@ static int rpc_shutdown_abort(struct net_context *c, int argc, **/ NTSTATUS rpc_init_shutdown_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -5223,7 +5223,7 @@ NTSTATUS rpc_init_shutdown_internals(struct net_context *c, **/ NTSTATUS rpc_reg_shutdown_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -5320,7 +5320,7 @@ static int rpc_shutdown(struct net_context *c, int argc, const char **argv) */ static NTSTATUS rpc_trustdom_add_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -5481,7 +5481,7 @@ static int rpc_trustdom_add(struct net_context *c, int argc, const char **argv) */ static NTSTATUS rpc_trustdom_del_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -5492,7 +5492,7 @@ static NTSTATUS rpc_trustdom_del_internals(struct net_context *c, struct policy_handle connect_pol, domain_pol, user_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; char *acct_name; - DOM_SID trust_acct_sid; + struct dom_sid trust_acct_sid; struct samr_Ids user_rids, name_types; struct lsa_String lsa_acct_name; @@ -5687,7 +5687,7 @@ static int rpc_trustdom_establish(struct net_context *c, int argc, struct policy_handle connect_hnd; TALLOC_CTX *mem_ctx; NTSTATUS nt_status; - DOM_SID *domain_sid; + struct dom_sid *domain_sid; char* domain_name; char* acct_name; @@ -5890,7 +5890,7 @@ done: } static NTSTATUS rpc_query_domain_sid(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -5906,7 +5906,7 @@ static NTSTATUS rpc_query_domain_sid(struct net_context *c, return NT_STATUS_OK; } -static void print_trusted_domain(DOM_SID *dom_sid, const char *trusted_dom_name) +static void print_trusted_domain(struct dom_sid *dom_sid, const char *trusted_dom_name) { fstring ascii_sid; @@ -5919,7 +5919,7 @@ static void print_trusted_domain(DOM_SID *dom_sid, const char *trusted_dom_name) static NTSTATUS vampire_trusted_domain(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, struct policy_handle *pol, - DOM_SID dom_sid, + struct dom_sid dom_sid, const char *trusted_dom_name) { NTSTATUS nt_status; @@ -5985,7 +5985,7 @@ static int rpc_trustdom_vampire(struct net_context *c, int argc, struct rpc_pipe_client *pipe_hnd = NULL; NTSTATUS nt_status; const char *domain_name = NULL; - DOM_SID *queried_dom_sid; + struct dom_sid *queried_dom_sid; struct policy_handle connect_hnd; union lsa_PolicyInformation *info = NULL; @@ -6138,7 +6138,7 @@ static int rpc_trustdom_list(struct net_context *c, int argc, const char **argv) struct rpc_pipe_client *pipe_hnd = NULL; NTSTATUS nt_status; const char *domain_name = NULL; - DOM_SID *queried_dom_sid; + struct dom_sid *queried_dom_sid; int ascii_dom_name_len; struct policy_handle connect_hnd; union lsa_PolicyInformation *info = NULL; diff --git a/source3/utils/net_rpc_audit.c b/source3/utils/net_rpc_audit.c index 90d30a6084..68b0d93c6c 100644 --- a/source3/utils/net_rpc_audit.c +++ b/source3/utils/net_rpc_audit.c @@ -56,7 +56,7 @@ static void print_auditing_category(const char *policy, const char *value) ********************************************************************/ static NTSTATUS rpc_audit_get_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -124,7 +124,7 @@ static NTSTATUS rpc_audit_get_internal(struct net_context *c, ********************************************************************/ static NTSTATUS rpc_audit_set_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -265,7 +265,7 @@ static NTSTATUS rpc_audit_enable_internal_ext(struct rpc_pipe_client *pipe_hnd, ********************************************************************/ static NTSTATUS rpc_audit_disable_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -281,7 +281,7 @@ static NTSTATUS rpc_audit_disable_internal(struct net_context *c, ********************************************************************/ static NTSTATUS rpc_audit_enable_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -297,7 +297,7 @@ static NTSTATUS rpc_audit_enable_internal(struct net_context *c, ********************************************************************/ static NTSTATUS rpc_audit_list_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c index 742b71e194..4659fe52ec 100644 --- a/source3/utils/net_rpc_join.c +++ b/source3/utils/net_rpc_join.c @@ -150,7 +150,7 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv) /* rpc variables */ struct policy_handle lsa_pol, sam_pol, domain_pol, user_pol; - DOM_SID *domain_sid; + struct dom_sid *domain_sid; uint32 user_rid; /* Password stuff */ diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index ec6509497a..8c7585a837 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -1126,7 +1126,7 @@ out: **/ NTSTATUS rpc_printer_list_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -1178,7 +1178,7 @@ NTSTATUS rpc_printer_list_internals(struct net_context *c, **/ NTSTATUS rpc_printer_driver_list_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -1336,7 +1336,7 @@ done: } NTSTATUS rpc_printer_publish_publish_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -1348,7 +1348,7 @@ NTSTATUS rpc_printer_publish_publish_internals(struct net_context *c, } NTSTATUS rpc_printer_publish_unpublish_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -1360,7 +1360,7 @@ NTSTATUS rpc_printer_publish_unpublish_internals(struct net_context *c, } NTSTATUS rpc_printer_publish_update_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -1389,7 +1389,7 @@ NTSTATUS rpc_printer_publish_update_internals(struct net_context *c, **/ NTSTATUS rpc_printer_publish_list_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -1481,7 +1481,7 @@ done: **/ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -1629,7 +1629,7 @@ done: **/ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -1792,7 +1792,7 @@ done: **/ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -2003,7 +2003,7 @@ done: **/ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -2160,7 +2160,7 @@ done: **/ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c index 907358163e..f03c346feb 100644 --- a/source3/utils/net_rpc_registry.c +++ b/source3/utils/net_rpc_registry.c @@ -411,7 +411,7 @@ static NTSTATUS registry_setvalue(TALLOC_CTX *mem_ctx, } static NTSTATUS rpc_registry_setvalue_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -483,7 +483,7 @@ static int rpc_registry_setvalue(struct net_context *c, int argc, } static NTSTATUS rpc_registry_deletevalue_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -537,7 +537,7 @@ static int rpc_registry_deletevalue(struct net_context *c, int argc, } static NTSTATUS rpc_registry_getvalue_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -625,7 +625,7 @@ done: } static NTSTATUS rpc_registry_getvalue_full(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -653,7 +653,7 @@ static int rpc_registry_getvalue(struct net_context *c, int argc, } static NTSTATUS rpc_registry_getvalue_raw(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -681,7 +681,7 @@ static int rpc_registry_getvalueraw(struct net_context *c, int argc, } static NTSTATUS rpc_registry_createkey_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -755,7 +755,7 @@ static int rpc_registry_createkey(struct net_context *c, int argc, } static NTSTATUS rpc_registry_deletekey_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -809,7 +809,7 @@ static int rpc_registry_deletekey(struct net_context *c, int argc, const char ** ********************************************************************/ static NTSTATUS rpc_registry_enumerate_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -887,7 +887,7 @@ static int rpc_registry_enumerate(struct net_context *c, int argc, ********************************************************************/ static NTSTATUS rpc_registry_save_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -1189,7 +1189,7 @@ out: ********************************************************************/ static NTSTATUS rpc_registry_getsd_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c index 6b7ca7ec4f..3dc3f85ffb 100644 --- a/source3/utils/net_rpc_rights.c +++ b/source3/utils/net_rpc_rights.c @@ -27,7 +27,7 @@ static NTSTATUS sid_to_name(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - DOM_SID *sid, + struct dom_sid *sid, fstring name) { struct policy_handle pol; @@ -59,12 +59,12 @@ static NTSTATUS sid_to_name(struct rpc_pipe_client *pipe_hnd, static NTSTATUS name_to_sid(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *mem_ctx, - DOM_SID *sid, const char *name) + struct dom_sid *sid, const char *name) { struct policy_handle pol; enum lsa_SidType *sid_types; NTSTATUS result; - DOM_SID *sids; + struct dom_sid *sids; /* maybe its a raw SID */ if ( strncmp(name, "S-", 2) == 0 && string_to_sid(sid, name) ) { @@ -151,7 +151,7 @@ static NTSTATUS enum_privileges(struct rpc_pipe_client *pipe_hnd, static NTSTATUS check_privilege_for_user(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *ctx, struct policy_handle *pol, - DOM_SID *sid, + struct dom_sid *sid, const char *right) { NTSTATUS result; @@ -186,7 +186,7 @@ static NTSTATUS check_privilege_for_user(struct rpc_pipe_client *pipe_hnd, static NTSTATUS enum_privileges_for_user(struct rpc_pipe_client *pipe_hnd, TALLOC_CTX *ctx, struct policy_handle *pol, - DOM_SID *sid ) + struct dom_sid *sid ) { NTSTATUS result; struct lsa_RightSet rights; @@ -311,7 +311,7 @@ static NTSTATUS enum_privileges_for_accounts(struct rpc_pipe_client *pipe_hnd, ********************************************************************/ static NTSTATUS rpc_rights_list_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -321,7 +321,7 @@ static NTSTATUS rpc_rights_list_internal(struct net_context *c, { struct policy_handle pol; NTSTATUS result; - DOM_SID sid; + struct dom_sid sid; fstring privname; struct lsa_String lsa_name; struct lsa_StringLarge *description = NULL; @@ -436,7 +436,7 @@ done: ********************************************************************/ static NTSTATUS rpc_rights_grant_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -449,7 +449,7 @@ static NTSTATUS rpc_rights_grant_internal(struct net_context *c, struct lsa_RightSet rights; int i; - DOM_SID sid; + struct dom_sid sid; if (argc < 2 ) { d_printf("%s\n%s", @@ -508,7 +508,7 @@ static NTSTATUS rpc_rights_grant_internal(struct net_context *c, ********************************************************************/ static NTSTATUS rpc_rights_revoke_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -519,7 +519,7 @@ static NTSTATUS rpc_rights_revoke_internal(struct net_context *c, struct policy_handle dom_pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; struct lsa_RightSet rights; - DOM_SID sid; + struct dom_sid sid; int i; if (argc < 2 ) { diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index 85bdc75cfb..ae1a71b689 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -105,7 +105,7 @@ static void parse_samsync_partial_replication_objects(TALLOC_CTX *mem_ctx, /* dump sam database via samsync rpc calls */ NTSTATUS rpc_samdump_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -174,7 +174,7 @@ int rpc_vampire_usage(struct net_context *c, int argc, const char **argv) /* dump sam database via samsync rpc calls */ NTSTATUS rpc_vampire_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -267,7 +267,7 @@ int rpc_vampire_passdb(struct net_context *c, int argc, const char **argv) } NTSTATUS rpc_vampire_ldif_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -352,7 +352,7 @@ int rpc_vampire_ldif(struct net_context *c, int argc, const char **argv) NTSTATUS rpc_vampire_keytab_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -412,7 +412,7 @@ NTSTATUS rpc_vampire_keytab_internals(struct net_context *c, } static NTSTATUS rpc_vampire_keytab_ds_internals(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, diff --git a/source3/utils/net_rpc_service.c b/source3/utils/net_rpc_service.c index 3010305838..9ab82b5adf 100644 --- a/source3/utils/net_rpc_service.c +++ b/source3/utils/net_rpc_service.c @@ -194,7 +194,7 @@ done: ********************************************************************/ static NTSTATUS rpc_service_list_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -307,7 +307,7 @@ static NTSTATUS rpc_service_list_internal(struct net_context *c, ********************************************************************/ static NTSTATUS rpc_service_status_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -442,7 +442,7 @@ done: ********************************************************************/ static NTSTATUS rpc_service_stop_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -488,7 +488,7 @@ static NTSTATUS rpc_service_stop_internal(struct net_context *c, ********************************************************************/ static NTSTATUS rpc_service_pause_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -534,7 +534,7 @@ static NTSTATUS rpc_service_pause_internal(struct net_context *c, ********************************************************************/ static NTSTATUS rpc_service_resume_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -580,7 +580,7 @@ static NTSTATUS rpc_service_resume_internal(struct net_context *c, ********************************************************************/ static NTSTATUS rpc_service_start_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -661,7 +661,7 @@ done: ********************************************************************/ static NTSTATUS rpc_service_delete_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, @@ -736,7 +736,7 @@ static NTSTATUS rpc_service_delete_internal(struct net_context *c, ********************************************************************/ static NTSTATUS rpc_service_create_internal(struct net_context *c, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, const char *domain_name, struct cli_state *cli, struct rpc_pipe_client *pipe_hnd, diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index 9b842aedd3..311cdd591b 100644 --- a/source3/utils/net_sam.c +++ b/source3/utils/net_sam.c @@ -31,7 +31,7 @@ static int net_sam_userset(struct net_context *c, int argc, const char **argv, enum pdb_value_state)) { struct samu *sam_acct = NULL; - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; const char *dom, *name; NTSTATUS status; @@ -134,7 +134,7 @@ static int net_sam_set_userflag(struct net_context *c, int argc, uint16 flag) { struct samu *sam_acct = NULL; - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; const char *dom, *name; NTSTATUS status; @@ -227,7 +227,7 @@ static int net_sam_set_pwdmustchangenow(struct net_context *c, int argc, const char **argv) { struct samu *sam_acct = NULL; - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; const char *dom, *name; NTSTATUS status; @@ -293,7 +293,7 @@ static int net_sam_set_comment(struct net_context *c, int argc, const char **argv) { GROUP_MAP map; - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; const char *dom, *name; NTSTATUS status; @@ -655,7 +655,7 @@ static int net_sam_rights_list(struct net_context *c, int argc, } if (se_priv_from_name(argv[0], &mask)) { - DOM_SID *sids; + struct dom_sid *sids; int i, num_sids; NTSTATUS status; @@ -688,7 +688,7 @@ static int net_sam_rights_list(struct net_context *c, int argc, static int net_sam_rights_grant(struct net_context *c, int argc, const char **argv) { - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; const char *dom, *name; SE_PRIV mask; @@ -727,7 +727,7 @@ static int net_sam_rights_grant(struct net_context *c, int argc, static int net_sam_rights_revoke(struct net_context *c, int argc, const char **argv) { - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; const char *dom, *name; SE_PRIV mask; @@ -896,7 +896,7 @@ static NTSTATUS unmap_unix_group(const struct group *grp, GROUP_MAP *pmap) { GROUP_MAP map; const char *grpname; - DOM_SID dom_sid; + struct dom_sid dom_sid; map.gid = grp->gr_gid; grpname = grp->gr_name; @@ -986,7 +986,7 @@ static int net_sam_createdomaingroup(struct net_context *c, int argc, static int net_sam_deletedomaingroup(struct net_context *c, int argc, const char **argv) { - DOM_SID sid; + struct dom_sid sid; uint32_t rid; enum lsa_SidType type; const char *dom, *name; @@ -1067,7 +1067,7 @@ static int net_sam_createlocalgroup(struct net_context *c, int argc, const char static int net_sam_deletelocalgroup(struct net_context *c, int argc, const char **argv) { - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; const char *dom, *name; NTSTATUS status; @@ -1114,7 +1114,7 @@ static int net_sam_createbuiltingroup(struct net_context *c, int argc, const cha uint32 rid; enum lsa_SidType type; fstring groupname; - DOM_SID sid; + struct dom_sid sid; if (argc != 1 || c->display_usage) { d_fprintf(stderr, "%s\n%s", @@ -1166,7 +1166,7 @@ static int net_sam_createbuiltingroup(struct net_context *c, int argc, const cha static int net_sam_addmem(struct net_context *c, int argc, const char **argv) { const char *groupdomain, *groupname, *memberdomain, *membername; - DOM_SID group, member; + struct dom_sid group, member; enum lsa_SidType grouptype, membertype; NTSTATUS status; @@ -1255,7 +1255,7 @@ static int net_sam_delmem(struct net_context *c, int argc, const char **argv) const char *groupdomain, *groupname; const char *memberdomain = NULL; const char *membername = NULL; - DOM_SID group, member; + struct dom_sid group, member; enum lsa_SidType grouptype; NTSTATUS status; @@ -1327,8 +1327,8 @@ static int net_sam_delmem(struct net_context *c, int argc, const char **argv) static int net_sam_listmem(struct net_context *c, int argc, const char **argv) { const char *groupdomain, *groupname; - DOM_SID group; - DOM_SID *members = NULL; + struct dom_sid group; + struct dom_sid *members = NULL; size_t i, num_members = 0; enum lsa_SidType grouptype; NTSTATUS status; @@ -1539,7 +1539,7 @@ static int net_sam_list(struct net_context *c, int argc, const char **argv) static int net_sam_show(struct net_context *c, int argc, const char **argv) { - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; const char *dom, *name; @@ -1577,7 +1577,7 @@ static int net_sam_provision(struct net_context *c, int argc, const char **argv) char *p; struct smbldap_state *ls; GROUP_MAP gmap; - DOM_SID gsid; + struct dom_sid gsid; gid_t domusers_gid = -1; gid_t domadmins_gid = -1; struct samu *samuser; @@ -1761,7 +1761,7 @@ doma_done: if (!pdb_getsampwnam(samuser, "Administrator")) { LDAPMod **mods = NULL; - DOM_SID sid; + struct dom_sid sid; char *dn; char *name; char *uidstr; @@ -1843,7 +1843,7 @@ doma_done: if (!pdb_getsampwnam(samuser, lp_guestaccount())) { LDAPMod **mods = NULL; - DOM_SID sid; + struct dom_sid sid; char *dn; char *uidstr; char *gidstr; diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c index c005268d0b..bbaf39a6e4 100644 --- a/source3/utils/net_usershare.c +++ b/source3/utils/net_usershare.c @@ -806,7 +806,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv) num_aces += count_chars(pacl,','); for (i = 0; i < num_aces; i++) { - DOM_SID sid; + struct dom_sid sid; const char *pcolon = strchr_m(pacl, ':'); const char *name; diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c index 191bc52c6b..b6ab03d913 100644 --- a/source3/utils/net_util.c +++ b/source3/utils/net_util.c @@ -28,14 +28,14 @@ NTSTATUS net_rpc_lookup_name(struct net_context *c, TALLOC_CTX *mem_ctx, struct cli_state *cli, const char *name, const char **ret_domain, - const char **ret_name, DOM_SID *ret_sid, + const char **ret_name, struct dom_sid *ret_sid, enum lsa_SidType *ret_type) { struct rpc_pipe_client *lsa_pipe = NULL; struct policy_handle pol; NTSTATUS result = NT_STATUS_OK; const char **dom_names; - DOM_SID *sids; + struct dom_sid *sids; enum lsa_SidType *types; ZERO_STRUCT(pol); diff --git a/source3/utils/netlookup.c b/source3/utils/netlookup.c index a49583d9e5..ef254beb24 100644 --- a/source3/utils/netlookup.c +++ b/source3/utils/netlookup.c @@ -157,7 +157,7 @@ static struct con_struct *create_cs(struct net_context *c, NTSTATUS net_lookup_name_from_sid(struct net_context *c, TALLOC_CTX *ctx, - DOM_SID *psid, + struct dom_sid *psid, const char **ppdomain, const char **ppname) { @@ -199,11 +199,11 @@ NTSTATUS net_lookup_name_from_sid(struct net_context *c, ********************************************************/ NTSTATUS net_lookup_sid_from_name(struct net_context *c, TALLOC_CTX *ctx, - const char *full_name, DOM_SID *pret_sid) + const char *full_name, struct dom_sid *pret_sid) { NTSTATUS nt_status; struct con_struct *csp = NULL; - DOM_SID *sids = NULL; + struct dom_sid *sids = NULL; enum lsa_SidType *types = NULL; csp = create_cs(c, ctx, &nt_status); diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c index 4fc10e2423..c6ccbc86a2 100644 --- a/source3/utils/pdbedit.c +++ b/source3/utils/pdbedit.c @@ -55,7 +55,7 @@ #define MASK_ALWAYS_GOOD 0x0000001F #define MASK_USER_GOOD 0x60405FE0 -static int get_sid_from_cli_string(DOM_SID *sid, const char *str_sid) +static int get_sid_from_cli_string(struct dom_sid *sid, const char *str_sid) { uint32_t rid; @@ -103,7 +103,7 @@ static int export_database (struct pdb_methods *in, while (u_search->next_entry(u_search, &userentry)) { struct samu *user; struct samu *account; - DOM_SID user_sid; + struct dom_sid user_sid; DEBUG(4, ("Processing account %s\n", userentry.account_name)); @@ -376,7 +376,7 @@ static int print_users_list(bool verbosity, bool smbpwdstyle) struct samr_displayentry userentry; struct samu *sam_pwent; TALLOC_CTX *tosctx; - DOM_SID user_sid; + struct dom_sid user_sid; bool bret; int ret; @@ -434,7 +434,7 @@ static int fix_users_list(void) struct samr_displayentry userentry; struct samu *sam_pwent; TALLOC_CTX *tosctx; - DOM_SID user_sid; + struct dom_sid user_sid; NTSTATUS status; bool bret; int ret; @@ -504,7 +504,7 @@ static int set_user_info(const char *username, const char *fullname, uint32_t acb_flags; uint32_t not_settable; uint32_t new_flags; - DOM_SID u_sid; + struct dom_sid u_sid; bool ret; sam_pwent = samu_new(NULL); @@ -618,7 +618,7 @@ static int set_machine_info(const char *machinename, uint32_t acb_flags; uint32_t not_settable; uint32_t new_flags; - DOM_SID m_sid; + struct dom_sid m_sid; char *name; int len; bool ret; @@ -709,7 +709,7 @@ static int new_user(const char *username, const char *fullname, struct samu *sam_pwent = NULL; TALLOC_CTX *tosctx; NTSTATUS status; - DOM_SID u_sid; + struct dom_sid u_sid; int flags; int ret; @@ -806,7 +806,7 @@ static int new_machine(const char *machinename, char *machine_sid) struct samu *sam_pwent = NULL; TALLOC_CTX *tosctx; NTSTATUS status; - DOM_SID m_sid; + struct dom_sid m_sid; char *compatpwd; char *name; int flags; diff --git a/source3/utils/profiles.c b/source3/utils/profiles.c index a987f315d1..e4ed8f50ec 100644 --- a/source3/utils/profiles.c +++ b/source3/utils/profiles.c @@ -25,7 +25,7 @@ /* GLOBAL VARIABLES */ -DOM_SID old_sid, new_sid; +struct dom_sid old_sid, new_sid; int change = 0, new_val = 0; int opt_verbose = False; @@ -56,7 +56,7 @@ static void verbose_output(const char *format, ...) /******************************************************************** ********************************************************************/ -static bool swap_sid_in_acl( struct security_descriptor *sd, DOM_SID *s1, DOM_SID *s2 ) +static bool swap_sid_in_acl( struct security_descriptor *sd, struct dom_sid *s1, struct dom_sid *s2 ) { struct security_acl *theacl; int i; diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c index 07f0e456e3..a29995b87b 100644 --- a/source3/utils/sharesec.c +++ b/source3/utils/sharesec.c @@ -157,7 +157,7 @@ static bool parse_ace(struct security_ace *ace, const char *orig_str) unsigned int atype = 0; unsigned int aflags = 0; unsigned int amask = 0; - DOM_SID sid; + struct dom_sid sid; uint32_t mask; const struct perm_value *v; char *str = SMB_STRDUP(orig_str); @@ -599,7 +599,7 @@ int main(int argc, const char *argv[]) /* check for initializing secrets.tdb first */ if ( initialize_sid ) { - DOM_SID *sid = get_global_sam_sid(); + struct dom_sid *sid = get_global_sam_sid(); if ( !sid ) { fprintf( stderr, "Failed to retrieve Machine SID!\n"); diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index 11ced83bf6..0c7a72263a 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -68,7 +68,7 @@ static const struct perm_value standard_values[] = { /* Open cli connection and policy handle */ static NTSTATUS cli_lsa_lookup_sid(struct cli_state *cli, - const DOM_SID *sid, + const struct dom_sid *sid, TALLOC_CTX *mem_ctx, enum lsa_SidType *type, char **domain, char **name) @@ -121,14 +121,14 @@ static NTSTATUS cli_lsa_lookup_sid(struct cli_state *cli, static NTSTATUS cli_lsa_lookup_name(struct cli_state *cli, const char *name, enum lsa_SidType *type, - DOM_SID *sid) + struct dom_sid *sid) { uint16 orig_cnum = cli->cnum; struct rpc_pipe_client *p; struct policy_handle handle; NTSTATUS status; TALLOC_CTX *frame = talloc_stackframe(); - DOM_SID *sids; + struct dom_sid *sids; enum lsa_SidType *types; status = cli_tcon_andx(cli, "IPC$", "?????", "", 0); @@ -167,7 +167,7 @@ static NTSTATUS cli_lsa_lookup_name(struct cli_state *cli, } /* convert a SID to a string, either numeric or username/group */ -static void SidToString(struct cli_state *cli, fstring str, const DOM_SID *sid) +static void SidToString(struct cli_state *cli, fstring str, const struct dom_sid *sid) { char *domain = NULL; char *name = NULL; @@ -196,7 +196,7 @@ static void SidToString(struct cli_state *cli, fstring str, const DOM_SID *sid) } /* convert a string to a SID, either numeric or username/group */ -static bool StringToSid(struct cli_state *cli, DOM_SID *sid, const char *str) +static bool StringToSid(struct cli_state *cli, struct dom_sid *sid, const char *str) { enum lsa_SidType type; @@ -373,7 +373,7 @@ static bool parse_ace(struct cli_state *cli, struct security_ace *ace, unsigned int atype = 0; unsigned int aflags = 0; unsigned int amask = 0; - DOM_SID sid; + struct dom_sid sid; uint32_t mask; const struct perm_value *v; char *str = SMB_STRDUP(orig_str); @@ -559,7 +559,7 @@ static struct security_descriptor *sec_desc_parse(TALLOC_CTX *ctx, struct cli_st char *tok; struct security_descriptor *ret = NULL; size_t sd_size; - DOM_SID *grp_sid=NULL, *owner_sid=NULL; + struct dom_sid *grp_sid=NULL, *owner_sid=NULL; struct security_acl *dacl=NULL; int revision=1; @@ -574,7 +574,7 @@ static struct security_descriptor *sec_desc_parse(TALLOC_CTX *ctx, struct cli_st printf("Only specify owner once\n"); goto done; } - owner_sid = SMB_CALLOC_ARRAY(DOM_SID, 1); + owner_sid = SMB_CALLOC_ARRAY(struct dom_sid, 1); if (!owner_sid || !StringToSid(cli, owner_sid, tok+6)) { printf("Failed to parse owner sid\n"); @@ -588,7 +588,7 @@ static struct security_descriptor *sec_desc_parse(TALLOC_CTX *ctx, struct cli_st printf("Only specify group once\n"); goto done; } - grp_sid = SMB_CALLOC_ARRAY(DOM_SID, 1); + grp_sid = SMB_CALLOC_ARRAY(struct dom_sid, 1); if (!grp_sid || !StringToSid(cli, grp_sid, tok+6)) { printf("Failed to parse group sid\n"); @@ -782,7 +782,7 @@ because the NT docs say this can't be done :-). JRA. static int owner_set(struct cli_state *cli, enum chown_mode change_mode, const char *filename, const char *new_username) { - DOM_SID sid; + struct dom_sid sid; struct security_descriptor *sd, *old; size_t sd_size; diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c index a494c3f4aa..3f98b12503 100644 --- a/source3/utils/smbcquotas.c +++ b/source3/utils/smbcquotas.c @@ -79,7 +79,7 @@ static bool cli_open_policy_hnd(void) } /* convert a SID to a string, either numeric or username/group */ -static void SidToString(fstring str, DOM_SID *sid, bool _numeric) +static void SidToString(fstring str, struct dom_sid *sid, bool _numeric) { char **domains = NULL; char **names = NULL; @@ -108,10 +108,10 @@ static void SidToString(fstring str, DOM_SID *sid, bool _numeric) } /* convert a string to a SID, either numeric or username/group */ -static bool StringToSid(DOM_SID *sid, const char *str) +static bool StringToSid(struct dom_sid *sid, const char *str) { enum lsa_SidType *types = NULL; - DOM_SID *sids = NULL; + struct dom_sid *sids = NULL; bool result = True; if (strncmp(str, "S-", 2) == 0) { diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c index 4e1ca346c0..1671d90499 100644 --- a/source3/winbindd/idmap_ad.c +++ b/source3/winbindd/idmap_ad.c @@ -267,7 +267,7 @@ static struct id_map *find_map_by_id(struct id_map **maps, enum id_type type, ui Search up to IDMAP_AD_MAX_IDS entries in maps for a match ***********************************************************************/ -static struct id_map *find_map_by_sid(struct id_map **maps, DOM_SID *sid) +static struct id_map *find_map_by_sid(struct id_map **maps, struct dom_sid *sid) { int i; @@ -400,7 +400,7 @@ again: entry = res; for (i = 0; (i < count) && entry; i++) { - DOM_SID sid; + struct dom_sid sid; enum id_type type; struct id_map *map; uint32_t id; @@ -593,7 +593,7 @@ again: entry = res; for (i = 0; (i < count) && entry; i++) { - DOM_SID sid; + struct dom_sid sid; enum id_type type; struct id_map *map; uint32_t id; @@ -818,7 +818,7 @@ static NTSTATUS nss_rfc2307_init( struct nss_domain_entry *e ) ***********************************************************************/ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e, - const DOM_SID *sid, + const struct dom_sid *sid, TALLOC_CTX *mem_ctx, ADS_STRUCT *ads, LDAPMessage *msg, diff --git a/source3/winbindd/idmap_adex/cell_util.c b/source3/winbindd/idmap_adex/cell_util.c index f5c08a0454..4ca3bf516a 100644 --- a/source3/winbindd/idmap_adex/cell_util.c +++ b/source3/winbindd/idmap_adex/cell_util.c @@ -138,7 +138,7 @@ done: ADS_STATUS status; char *domain_dn = ads_build_dn(lp_realm()); NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - DOM_SID sid; + struct dom_sid sid; struct likewise_cell *cell = NULL; /* In the Likewise plugin, I had to support the concept of cells diff --git a/source3/winbindd/idmap_adex/domain_util.c b/source3/winbindd/idmap_adex/domain_util.c index 6851503cc8..dae5415b3b 100644 --- a/source3/winbindd/idmap_adex/domain_util.c +++ b/source3/winbindd/idmap_adex/domain_util.c @@ -208,7 +208,7 @@ static struct dc_info *dc_find_domain(const char *dns_domain) NTSTATUS dc_search_domains(struct likewise_cell **cell, LDAPMessage **msg, const char *dn, - const DOM_SID *sid) + const struct dom_sid *sid) { NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; TALLOC_CTX *frame = talloc_stackframe(); diff --git a/source3/winbindd/idmap_adex/gc_util.c b/source3/winbindd/idmap_adex/gc_util.c index 879c2e0ecf..634fd980e8 100644 --- a/source3/winbindd/idmap_adex/gc_util.c +++ b/source3/winbindd/idmap_adex/gc_util.c @@ -545,7 +545,7 @@ done: NTSTATUS gc_name_to_sid(const char *domain, const char *name, - DOM_SID *sid, + struct dom_sid *sid, enum lsa_SidType *sid_type) { TALLOC_CTX *frame = talloc_stackframe(); @@ -703,7 +703,7 @@ done: /********************************************************************* ********************************************************************/ - NTSTATUS gc_sid_to_name(const DOM_SID *sid, + NTSTATUS gc_sid_to_name(const struct dom_sid *sid, char **name, enum lsa_SidType *sid_type) { diff --git a/source3/winbindd/idmap_adex/idmap_adex.c b/source3/winbindd/idmap_adex/idmap_adex.c index 5ca7df0b4a..e5ddfad946 100644 --- a/source3/winbindd/idmap_adex/idmap_adex.c +++ b/source3/winbindd/idmap_adex/idmap_adex.c @@ -44,7 +44,7 @@ static NTSTATUS _idmap_adex_init(struct idmap_domain *dom, ADS_STRUCT *ads = NULL; ADS_STATUS status; static NTSTATUS init_status = NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND; - DOM_SID domain_sid; + struct dom_sid domain_sid; fstring dcname; struct sockaddr_storage ip; struct likewise_cell *lwcell; @@ -314,7 +314,7 @@ static NTSTATUS _nss_adex_init(struct nss_domain_entry static NTSTATUS _nss_adex_get_info(struct nss_domain_entry *e, - const DOM_SID * sid, + const struct dom_sid * sid, TALLOC_CTX * ctx, ADS_STRUCT * ads, LDAPMessage * msg, diff --git a/source3/winbindd/idmap_adex/idmap_adex.h b/source3/winbindd/idmap_adex/idmap_adex.h index 6d6881e01d..cfb3b807f9 100644 --- a/source3/winbindd/idmap_adex/idmap_adex.h +++ b/source3/winbindd/idmap_adex/idmap_adex.h @@ -91,11 +91,11 @@ */ struct cell_provider_api { - NTSTATUS(*get_sid_from_id) (DOM_SID * sid, + NTSTATUS(*get_sid_from_id) (struct dom_sid * sid, uint32_t id, enum id_type type); NTSTATUS(*get_id_from_sid) (uint32_t * id, - enum id_type * type, const DOM_SID * sid); - NTSTATUS(*get_nss_info) (const DOM_SID * sid, + enum id_type * type, const struct dom_sid * sid); + NTSTATUS(*get_nss_info) (const struct dom_sid * sid, TALLOC_CTX * ctx, const char **homedir, const char **shell, @@ -122,7 +122,7 @@ struct likewise_cell { struct likewise_cell *prev, *next; ADS_STRUCT *conn; struct likewise_cell *gc_search_cell; - DOM_SID domain_sid; + struct dom_sid domain_sid; char *dns_domain; char *forest_name; char *dn; @@ -179,7 +179,7 @@ void cell_set_connection(struct likewise_cell *c, void cell_set_dn(struct likewise_cell *c, const char *dn); void cell_set_domain_sid(struct likewise_cell *c, - DOM_SID *sid); + struct dom_sid *sid); void cell_set_flags(struct likewise_cell *c, uint32_t flags); void cell_clear_flags(struct likewise_cell *c, uint32_t flags); @@ -224,10 +224,10 @@ NTSTATUS gc_search_all_forests_unique(const char *filter, NTSTATUS gc_name_to_sid(const char *domain, const char *name, - DOM_SID *sid, + struct dom_sid *sid, enum lsa_SidType *sid_type); -NTSTATUS gc_sid_to_name(const DOM_SID *sid, +NTSTATUS gc_sid_to_name(const struct dom_sid *sid, char **name, enum lsa_SidType *sid_type); @@ -252,7 +252,7 @@ NTSTATUS domain_init_list(void); NTSTATUS dc_search_domains(struct likewise_cell **cell, LDAPMessage **msg, const char *dn, - const DOM_SID *user_sid); + const struct dom_sid *user_sid); #endif /* _IDMAP_ADEX_H */ diff --git a/source3/winbindd/idmap_adex/likewise_cell.c b/source3/winbindd/idmap_adex/likewise_cell.c index d666d8c01a..f1abb24da2 100644 --- a/source3/winbindd/idmap_adex/likewise_cell.c +++ b/source3/winbindd/idmap_adex/likewise_cell.c @@ -176,7 +176,7 @@ static struct likewise_cell *_lw_cell_list = NULL; /********************************************************************** *********************************************************************/ - void cell_set_domain_sid(struct likewise_cell *c, DOM_SID *sid) + void cell_set_domain_sid(struct likewise_cell *c, struct dom_sid *sid) { sid_copy(&c->domain_sid, sid); } diff --git a/source3/winbindd/idmap_adex/provider_unified.c b/source3/winbindd/idmap_adex/provider_unified.c index af33405747..f66d4dfbf4 100644 --- a/source3/winbindd/idmap_adex/provider_unified.c +++ b/source3/winbindd/idmap_adex/provider_unified.c @@ -35,7 +35,7 @@ struct lwcell_filter enum filterType ftype; bool use2307; union { - DOM_SID sid; + struct dom_sid sid; struct { uint32_t id; enum id_type type; @@ -245,7 +245,7 @@ done: static NTSTATUS search_domain(struct likewise_cell **cell, LDAPMessage **msg, const char *dn, - const DOM_SID *sid) + const struct dom_sid *sid) { NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; TALLOC_CTX* frame = talloc_stackframe(); @@ -341,7 +341,7 @@ static NTSTATUS check_result_unique_scoped(ADS_STRUCT **ads_list, LDAPMessage **msg_list, int num_resp, char **dn, - DOM_SID *user_sid) + struct dom_sid *user_sid) { NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; int i; @@ -465,7 +465,7 @@ static NTSTATUS search_forest(struct likewise_cell *forest_cell, LDAPMessage **msg_list = NULL; int num_resp = 0; LDAPMessage *m; - DOM_SID user_sid; + struct dom_sid user_sid; struct likewise_cell *domain_cell = NULL; if ((gc = gc_search_start()) == NULL) { @@ -611,7 +611,7 @@ done: static NTSTATUS pull_sid(struct likewise_cell *c, LDAPMessage *msg, - DOM_SID *sid) + struct dom_sid *sid) { NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; TALLOC_CTX *frame = talloc_stackframe(); @@ -967,7 +967,7 @@ done: /******************************************************************** *******************************************************************/ -static NTSTATUS _ccp_get_sid_from_id(DOM_SID * sid, +static NTSTATUS _ccp_get_sid_from_id(struct dom_sid * sid, uint32_t id, enum id_type type) { struct likewise_cell *cell = NULL; @@ -996,7 +996,7 @@ done: static NTSTATUS _ccp_get_id_from_sid(uint32_t * id, enum id_type *type, - const DOM_SID * sid) + const struct dom_sid * sid) { struct likewise_cell *cell = NULL; LDAPMessage *msg = NULL; @@ -1026,7 +1026,7 @@ done: /******************************************************************** *******************************************************************/ -static NTSTATUS _ccp_nss_get_info(const DOM_SID * sid, +static NTSTATUS _ccp_nss_get_info(const struct dom_sid * sid, TALLOC_CTX * ctx, const char **homedir, const char **shell, @@ -1071,7 +1071,7 @@ static NTSTATUS _ccp_map_to_alias(TALLOC_CTX *ctx, { TALLOC_CTX *frame = talloc_stackframe(); NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - DOM_SID sid; + struct dom_sid sid; struct likewise_cell *cell = NULL; LDAPMessage *msg = NULL; struct lwcell_filter filter; @@ -1116,7 +1116,7 @@ static NTSTATUS _ccp_map_from_alias(TALLOC_CTX *mem_ctx, { TALLOC_CTX *frame = talloc_stackframe(); NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - DOM_SID sid; + struct dom_sid sid; struct likewise_cell *cell_alias = NULL; LDAPMessage *msg_alias = NULL; struct likewise_cell *cell_sid = NULL; diff --git a/source3/winbindd/idmap_hash/idmap_hash.c b/source3/winbindd/idmap_hash/idmap_hash.c index 1227b2a052..844950e737 100644 --- a/source3/winbindd/idmap_hash/idmap_hash.c +++ b/source3/winbindd/idmap_hash/idmap_hash.c @@ -26,7 +26,7 @@ #define DBGC_CLASS DBGC_IDMAP struct sid_hash_table { - DOM_SID *sid; + struct dom_sid *sid; }; struct sid_hash_table *hashed_domains = NULL; @@ -35,7 +35,7 @@ struct sid_hash_table *hashed_domains = NULL; Hash a domain SID (S-1-5-12-aaa-bbb-ccc) to a 12bit number ********************************************************************/ -static uint32_t hash_domain_sid(const DOM_SID *sid) +static uint32_t hash_domain_sid(const struct dom_sid *sid) { uint32_t hash; @@ -143,7 +143,7 @@ static NTSTATUS be_init(struct idmap_domain *dom, sid_string_dbg(&dom_list[i].sid), hash)); - hashed_domains[hash].sid = talloc(hashed_domains, DOM_SID); + hashed_domains[hash].sid = talloc(hashed_domains, struct dom_sid); sid_copy(hashed_domains[hash].sid, &dom_list[i].sid); } @@ -224,7 +224,7 @@ static NTSTATUS sids_to_unixids(struct idmap_domain *dom, } for (i=0; ids[i]; i++) { - DOM_SID sid; + struct dom_sid sid; uint32_t rid; uint32_t h_domain, h_rid; @@ -271,7 +271,7 @@ static NTSTATUS nss_hash_init(struct nss_domain_entry *e ) *********************************************************************/ static NTSTATUS nss_hash_get_info(struct nss_domain_entry *e, - const DOM_SID *sid, + const struct dom_sid *sid, TALLOC_CTX *ctx, ADS_STRUCT *ads, LDAPMessage *msg, diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c index 22736c6721..fd714a0a7f 100644 --- a/source3/winbindd/idmap_ldap.c +++ b/source3/winbindd/idmap_ldap.c @@ -1145,7 +1145,7 @@ done: /* this function searches up to IDMAP_LDAP_MAX_IDS entries * in maps for a match */ -static struct id_map *find_map_by_sid(struct id_map **maps, DOM_SID *sid) +static struct id_map *find_map_by_sid(struct id_map **maps, struct dom_sid *sid) { int i; @@ -1262,7 +1262,7 @@ again: char *tmp = NULL; enum id_type type; struct id_map *map; - DOM_SID sid; + struct dom_sid sid; uint32_t id; if (i == 0) { /* first entry */ diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c index 45266abe15..27d73d6ab5 100644 --- a/source3/winbindd/idmap_tdb.c +++ b/source3/winbindd/idmap_tdb.c @@ -60,7 +60,7 @@ static int convert_fn(struct db_record *rec, void *private_data) struct winbindd_domain *domain; char *p; NTSTATUS status; - DOM_SID sid; + struct dom_sid sid; uint32 rid; fstring keystr; fstring dom_name; @@ -1146,7 +1146,7 @@ static int idmap_tdb_dump_one_entry(struct db_record *rec, void *pdata) return -1; } *data->maps = maps; - maps[num_maps].sid = talloc(maps, DOM_SID); + maps[num_maps].sid = talloc(maps, struct dom_sid); if ( ! maps[num_maps].sid) { DEBUG(0, ("Out of memory!\n")); data->ret = NT_STATUS_NO_MEMORY; diff --git a/source3/winbindd/idmap_util.c b/source3/winbindd/idmap_util.c index 37b7ecb1f3..a8974a9024 100644 --- a/source3/winbindd/idmap_util.c +++ b/source3/winbindd/idmap_util.c @@ -29,7 +29,7 @@ If mapping is not possible returns an error. *****************************************************************/ -NTSTATUS idmap_uid_to_sid(const char *domname, DOM_SID *sid, uid_t uid) +NTSTATUS idmap_uid_to_sid(const char *domname, struct dom_sid *sid, uid_t uid) { NTSTATUS ret; struct id_map map; @@ -88,7 +88,7 @@ backend: If mapping is not possible returns an error. *****************************************************************/ -NTSTATUS idmap_gid_to_sid(const char *domname, DOM_SID *sid, gid_t gid) +NTSTATUS idmap_gid_to_sid(const char *domname, struct dom_sid *sid, gid_t gid) { NTSTATUS ret; struct id_map map; @@ -147,7 +147,7 @@ backend: If mapping is not possible or SID maps to a GID returns an error. *****************************************************************/ -NTSTATUS idmap_sid_to_uid(const char *dom_name, DOM_SID *sid, uid_t *uid) +NTSTATUS idmap_sid_to_uid(const char *dom_name, struct dom_sid *sid, uid_t *uid) { NTSTATUS ret; struct id_map map; @@ -229,7 +229,7 @@ done: If mapping is not possible or SID maps to a UID returns an error. *****************************************************************/ -NTSTATUS idmap_sid_to_gid(const char *domname, DOM_SID *sid, gid_t *gid) +NTSTATUS idmap_sid_to_gid(const char *domname, struct dom_sid *sid, gid_t *gid) { NTSTATUS ret; struct id_map map; diff --git a/source3/winbindd/nss_info.c b/source3/winbindd/nss_info.c index 663fc9a2a5..82eb6c7db5 100644 --- a/source3/winbindd/nss_info.c +++ b/source3/winbindd/nss_info.c @@ -303,7 +303,7 @@ static struct nss_domain_entry *find_nss_domain( const char *domain ) /******************************************************************** *******************************************************************/ -NTSTATUS nss_get_info( const char *domain, const DOM_SID *user_sid, +NTSTATUS nss_get_info( const char *domain, const struct dom_sid *user_sid, TALLOC_CTX *ctx, ADS_STRUCT *ads, LDAPMessage *msg, const char **homedir, const char **shell, diff --git a/source3/winbindd/nss_info_template.c b/source3/winbindd/nss_info_template.c index 12d9c51896..1b69a8cb2b 100644 --- a/source3/winbindd/nss_info_template.c +++ b/source3/winbindd/nss_info_template.c @@ -33,7 +33,7 @@ static NTSTATUS nss_template_init( struct nss_domain_entry *e ) ***********************************************************************/ static NTSTATUS nss_template_get_info( struct nss_domain_entry *e, - const DOM_SID *sid, + const struct dom_sid *sid, TALLOC_CTX *ctx, ADS_STRUCT *ads, LDAPMessage *msg, diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h index f1815ac870..b8835c0b0b 100644 --- a/source3/winbindd/winbindd.h +++ b/source3/winbindd/winbindd.h @@ -41,7 +41,7 @@ #define WB_REPLACE_CHAR '_' struct sid_ctr { - DOM_SID *sid; + struct dom_sid *sid; bool finished; const char *domain; const char *name; @@ -92,8 +92,8 @@ struct getpwent_user { fstring gecos; /* User information */ fstring homedir; /* User Home Directory */ fstring shell; /* User Login Shell */ - DOM_SID user_sid; /* NT user and primary group SIDs */ - DOM_SID group_sid; + struct dom_sid user_sid; /* NT user and primary group SIDs */ + struct dom_sid group_sid; }; /* Our connection to the DC */ @@ -145,7 +145,7 @@ struct winbindd_domain { fstring name; /* Domain name (NetBIOS) */ fstring alt_name; /* alt Domain name, if any (FQDN for ADS) */ fstring forest_name; /* Name of the AD forest we're in */ - DOM_SID sid; /* SID for this domain */ + struct dom_sid sid; /* SID for this domain */ uint32 domain_flags; /* Domain flags from netlogon.h */ uint32 domain_type; /* Domain type from netlogon.h */ uint32 domain_trust_attribs; /* Trust attribs from netlogon.h */ @@ -246,20 +246,20 @@ struct winbindd_methods { const char *domain_name, const char *name, uint32_t flags, - DOM_SID *sid, + struct dom_sid *sid, enum lsa_SidType *type); /* convert a sid to a user or group name */ NTSTATUS (*sid_to_name)(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, char **domain_name, char **name, enum lsa_SidType *type); NTSTATUS (*rids_to_names)(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, uint32 *rids, size_t num_rids, char **domain_name, @@ -269,7 +269,7 @@ struct winbindd_methods { /* lookup user info for a given SID */ NTSTATUS (*query_user)(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *user_sid, + const struct dom_sid *user_sid, struct wbint_userinfo *user_info); /* lookup all groups that a user is a member of. The backend @@ -277,25 +277,25 @@ struct winbindd_methods { function */ NTSTATUS (*lookup_usergroups)(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *user_sid, - uint32 *num_groups, DOM_SID **user_gids); + const struct dom_sid *user_sid, + uint32 *num_groups, struct dom_sid **user_gids); /* Lookup all aliases that the sids delivered are member of. This is * to implement 'domain local groups' correctly */ NTSTATUS (*lookup_useraliases)(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, uint32 num_sids, - const DOM_SID *sids, + const struct dom_sid *sids, uint32 *num_aliases, uint32 **alias_rids); /* find all members of the group with the specified group_rid */ NTSTATUS (*lookup_groupmem)(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *group_sid, + const struct dom_sid *group_sid, enum lsa_SidType type, uint32 *num_names, - DOM_SID **sid_mem, char ***names, + struct dom_sid **sid_mem, char ***names, uint32 **name_types); /* return the current global sequence number */ @@ -322,11 +322,11 @@ struct winbindd_idmap_methods { /* Called when backend is first loaded */ bool (*init)(void); - bool (*get_sid_from_uid)(uid_t uid, DOM_SID *sid); - bool (*get_sid_from_gid)(gid_t gid, DOM_SID *sid); + bool (*get_sid_from_uid)(uid_t uid, struct dom_sid *sid); + bool (*get_sid_from_gid)(gid_t gid, struct dom_sid *sid); - bool (*get_uid_from_sid)(DOM_SID *sid, uid_t *uid); - bool (*get_gid_from_sid)(DOM_SID *sid, gid_t *gid); + bool (*get_uid_from_sid)(struct dom_sid *sid, uid_t *uid); + bool (*get_gid_from_sid)(struct dom_sid *sid, gid_t *gid); /* Called when backend is unloaded */ bool (*close)(void); @@ -339,7 +339,7 @@ struct winbindd_idmap_methods { struct winbindd_tdc_domain { const char *domain_name; const char *dns_name; - DOM_SID sid; + struct dom_sid sid; uint32 trust_flags; uint32 trust_attribs; uint32 trust_type; diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c index 50abcc30c3..faa4d8ee26 100644 --- a/source3/winbindd/winbindd_ads.c +++ b/source3/winbindd/winbindd_ads.c @@ -206,7 +206,7 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, const char *shell = NULL; uint32 group; uint32 atype; - DOM_SID user_sid; + struct dom_sid user_sid; gid_t primary_gid = (gid_t)-1; if (!ads_pull_uint32(ads, msg, "sAMAccountType", &atype) || @@ -346,7 +346,7 @@ static NTSTATUS enum_dom_groups(struct winbindd_domain *domain, for (msg = ads_first_entry(ads, res); msg; msg = ads_next_entry(ads, msg)) { char *name, *gecos; - DOM_SID sid; + struct dom_sid sid; uint32 rid; name = ads_pull_username(ads, mem_ctx, msg); @@ -407,7 +407,7 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain, const char *domain_name, const char *name, uint32_t flags, - DOM_SID *sid, + struct dom_sid *sid, enum lsa_SidType *type) { return reconnect_methods.name_to_sid(domain, mem_ctx, @@ -418,7 +418,7 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain, /* convert a domain SID to a user or group name - use rpc methods */ static NTSTATUS sid_to_name(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, char **domain_name, char **name, enum lsa_SidType *type) @@ -430,7 +430,7 @@ static NTSTATUS sid_to_name(struct winbindd_domain *domain, /* convert a list of rids to names - use rpc methods */ static NTSTATUS rids_to_names(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, uint32 *rids, size_t num_rids, char **domain_name, @@ -450,7 +450,7 @@ static NTSTATUS rids_to_names(struct winbindd_domain *domain, /* Lookup user information from a rid */ static NTSTATUS query_user(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, struct wbint_userinfo *info) { ADS_STRUCT *ads = NULL; @@ -582,8 +582,8 @@ done: static NTSTATUS lookup_usergroups_member(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, const char *user_dn, - DOM_SID *primary_group, - size_t *p_num_groups, DOM_SID **user_sids) + struct dom_sid *primary_group, + size_t *p_num_groups, struct dom_sid **user_sids) { ADS_STATUS rc; NTSTATUS status = NT_STATUS_UNSUCCESSFUL; @@ -652,7 +652,7 @@ static NTSTATUS lookup_usergroups_member(struct winbindd_domain *domain, if (count > 0) { for (msg = ads_first_entry(ads, res); msg; msg = ads_next_entry(ads, msg)) { - DOM_SID group_sid; + struct dom_sid group_sid; if (!ads_pull_sid(ads, msg, "objectSid", &group_sid)) { DEBUG(1,("No sid for this group ?!?\n")); @@ -689,16 +689,16 @@ done: static NTSTATUS lookup_usergroups_memberof(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, const char *user_dn, - DOM_SID *primary_group, + struct dom_sid *primary_group, size_t *p_num_groups, - DOM_SID **user_sids) + struct dom_sid **user_sids) { ADS_STATUS rc; NTSTATUS status = NT_STATUS_UNSUCCESSFUL; ADS_STRUCT *ads; const char *attrs[] = {"memberOf", NULL}; size_t num_groups = 0; - DOM_SID *group_sids = NULL; + struct dom_sid *group_sids = NULL; int i; char **strings = NULL; size_t num_strings = 0, num_sids = 0; @@ -739,7 +739,7 @@ static NTSTATUS lookup_usergroups_memberof(struct winbindd_domain *domain, goto done; } - group_sids = TALLOC_ZERO_ARRAY(mem_ctx, DOM_SID, num_strings + 1); + group_sids = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, num_strings + 1); if (!group_sids) { status = NT_STATUS_NO_MEMORY; goto done; @@ -801,8 +801,8 @@ done: /* Lookup groups a user is a member of. */ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *sid, - uint32 *p_num_groups, DOM_SID **user_sids) + const struct dom_sid *sid, + uint32 *p_num_groups, struct dom_sid **user_sids) { ADS_STRUCT *ads = NULL; const char *attrs[] = {"tokenGroups", "primaryGroupID", NULL}; @@ -810,9 +810,9 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain, int count; LDAPMessage *msg = NULL; char *user_dn = NULL; - DOM_SID *sids; + struct dom_sid *sids; int i; - DOM_SID primary_group; + struct dom_sid primary_group; uint32 primary_group_rid; NTSTATUS status = NT_STATUS_UNSUCCESSFUL; size_t num_groups = 0; @@ -952,7 +952,7 @@ done: /* Lookup aliases a user is member of - use rpc methods */ static NTSTATUS lookup_useraliases(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - uint32 num_sids, const DOM_SID *sids, + uint32 num_sids, const struct dom_sid *sids, uint32 *num_aliases, uint32 **alias_rids) { return reconnect_methods.lookup_useraliases(domain, mem_ctx, @@ -966,10 +966,10 @@ static NTSTATUS lookup_useraliases(struct winbindd_domain *domain, */ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *group_sid, + const struct dom_sid *group_sid, enum lsa_SidType type, uint32 *num_names, - DOM_SID **sid_mem, char ***names, + struct dom_sid **sid_mem, char ***names, uint32 **name_types) { ADS_STATUS rc; @@ -981,7 +981,7 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain, int i; size_t num_members = 0; ads_control args; - DOM_SID *sid_mem_nocache = NULL; + struct dom_sid *sid_mem_nocache = NULL; char **names_nocache = NULL; enum lsa_SidType *name_types_nocache = NULL; char **domains_nocache = NULL; /* only needed for rpccli_lsa_lookup_sids */ @@ -1055,10 +1055,10 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain, * cache. Only the rest is passed to the lsa_lookup_sids call. */ if (num_members) { - (*sid_mem) = TALLOC_ZERO_ARRAY(mem_ctx, DOM_SID, num_members); + (*sid_mem) = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, num_members); (*names) = TALLOC_ZERO_ARRAY(mem_ctx, char *, num_members); (*name_types) = TALLOC_ZERO_ARRAY(mem_ctx, uint32, num_members); - (sid_mem_nocache) = TALLOC_ZERO_ARRAY(tmp_ctx, DOM_SID, num_members); + (sid_mem_nocache) = TALLOC_ZERO_ARRAY(tmp_ctx, struct dom_sid, num_members); if ((members == NULL) || (*sid_mem == NULL) || (*names == NULL) || (*name_types == NULL) || @@ -1078,7 +1078,7 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain, for (i=0; iofs += 16; } -static void centry_put_sid(struct cache_entry *centry, const DOM_SID *sid) +static void centry_put_sid(struct cache_entry *centry, const struct dom_sid *sid) { fstring sid_string; centry_put_string(centry, sid_to_fstring(sid_string, sid)); @@ -895,7 +895,7 @@ static void centry_end(struct cache_entry *centry, const char *format, ...) static void wcache_save_name_to_sid(struct winbindd_domain *domain, NTSTATUS status, const char *domain_name, - const char *name, const DOM_SID *sid, + const char *name, const struct dom_sid *sid, enum lsa_SidType type) { struct cache_entry *centry; @@ -915,7 +915,7 @@ static void wcache_save_name_to_sid(struct winbindd_domain *domain, } static void wcache_save_sid_to_name(struct winbindd_domain *domain, NTSTATUS status, - const DOM_SID *sid, const char *domain_name, const char *name, enum lsa_SidType type) + const struct dom_sid *sid, const char *domain_name, const char *name, enum lsa_SidType type) { struct cache_entry *centry; fstring sid_string; @@ -1212,7 +1212,7 @@ do_query: return status; } -NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const DOM_SID *sid) +NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct dom_sid *sid) { struct winbind_cache *cache = get_cache(domain); TDB_DATA data; @@ -1247,7 +1247,7 @@ NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const DOM_SID NTSTATUS wcache_get_creds(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, const uint8 **cached_nt_pass, const uint8 **cached_salt) { @@ -1328,7 +1328,7 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain, NTSTATUS wcache_save_creds(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, const uint8 nt_pass[NT_HASH_LEN]) { struct cache_entry *centry; @@ -1766,7 +1766,7 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain, const char *domain_name, const char *name, uint32_t flags, - DOM_SID *sid, + struct dom_sid *sid, enum lsa_SidType *type) { NTSTATUS status; @@ -1875,7 +1875,7 @@ NTSTATUS wcache_sid_to_name(struct winbindd_domain *domain, given */ static NTSTATUS sid_to_name(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, char **domain_name, char **name, enum lsa_SidType *type) @@ -1938,7 +1938,7 @@ static NTSTATUS sid_to_name(struct winbindd_domain *domain, static NTSTATUS rids_to_names(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, + const struct dom_sid *domain_sid, uint32 *rids, size_t num_rids, char **domain_name, @@ -1976,7 +1976,7 @@ static NTSTATUS rids_to_names(struct winbindd_domain *domain, have_mapped = have_unmapped = false; for (i=0; istatus)) { - DOM_SID sid; + struct dom_sid sid; (void)centry_sid(centry, &sid); } @@ -3556,7 +3556,7 @@ static int validate_u(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf, struct tdb_validation_status *state) { struct cache_entry *centry = create_centry_validate(keystr, dbuf, state); - DOM_SID sid; + struct dom_sid sid; if (!centry) { return 1; @@ -3664,7 +3664,7 @@ static int validate_ul(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf, num_entries = (int32)centry_uint32(centry); for (i=0; i< num_entries; i++) { - DOM_SID sid; + struct dom_sid sid; (void)centry_string(centry, mem_ctx); (void)centry_string(centry, mem_ctx); (void)centry_string(centry, mem_ctx); @@ -3722,7 +3722,7 @@ static int validate_ug(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf, num_groups = centry_uint32(centry); for (i=0; i< num_groups; i++) { - DOM_SID sid; + struct dom_sid sid; centry_sid(centry, &sid); } @@ -3773,7 +3773,7 @@ static int validate_gm(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf, num_names = centry_uint32(centry); for (i=0; i< num_names; i++) { - DOM_SID sid; + struct dom_sid sid; centry_sid(centry, &sid); (void)centry_string(centry, mem_ctx); (void)centry_uint32(centry); @@ -4524,7 +4524,7 @@ void wcache_tdc_clear( void ) static void wcache_save_user_pwinfo(struct winbindd_domain *domain, NTSTATUS status, - const DOM_SID *user_sid, + const struct dom_sid *user_sid, const char *homedir, const char *shell, const char *gecos, @@ -4549,7 +4549,7 @@ static void wcache_save_user_pwinfo(struct winbindd_domain *domain, } NTSTATUS nss_get_info_cached( struct winbindd_domain *domain, - const DOM_SID *user_sid, + const struct dom_sid *user_sid, TALLOC_CTX *ctx, ADS_STRUCT *ads, LDAPMessage *msg, const char **homedir, const char **shell, diff --git a/source3/winbindd/winbindd_creds.c b/source3/winbindd/winbindd_creds.c index 46c7a06f7c..00b38e3aae 100644 --- a/source3/winbindd/winbindd_creds.c +++ b/source3/winbindd/winbindd_creds.c @@ -29,7 +29,7 @@ NTSTATUS winbindd_get_creds(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, struct netr_SamInfo3 **info3, const uint8 *cached_nt_pass[NT_HASH_LEN], const uint8 *cred_salt[NT_HASH_LEN]) @@ -58,11 +58,11 @@ NTSTATUS winbindd_store_creds(struct winbindd_domain *domain, const char *user, const char *pass, struct netr_SamInfo3 *info3, - const DOM_SID *user_sid) + const struct dom_sid *user_sid) { NTSTATUS status; uchar nt_pass[NT_HASH_LEN]; - DOM_SID cred_sid; + struct dom_sid cred_sid; if (info3 != NULL) { @@ -144,7 +144,7 @@ NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain, NTSTATUS winbindd_update_creds_by_sid(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, const char *pass) { return winbindd_store_creds(domain, mem_ctx, NULL, pass, NULL, sid); diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c index f2e3829361..cf5ffdf325 100644 --- a/source3/winbindd/winbindd_pam.c +++ b/source3/winbindd/winbindd_pam.c @@ -196,7 +196,7 @@ static NTSTATUS append_afs_token(TALLOC_CTX *mem_ctx, "%U", name_user); { - DOM_SID user_sid; + struct dom_sid user_sid; fstring sidstr; sid_compose(&user_sid, info3->base.domain_sid, @@ -252,11 +252,11 @@ static NTSTATUS check_info3_in_group(struct netr_SamInfo3 *info3, * or other NT_STATUS_IS_ERR(status) for other kinds of failure. */ { - DOM_SID *require_membership_of_sid; + struct dom_sid *require_membership_of_sid; size_t num_require_membership_of_sid; char *req_sid; const char *p; - DOM_SID sid; + struct dom_sid sid; size_t i; struct nt_user_token *token; TALLOC_CTX *frame = talloc_stackframe(); @@ -812,7 +812,7 @@ static NTSTATUS winbindd_dual_pam_auth_cached(struct winbindd_domain *domain, NTSTATUS result = NT_STATUS_LOGON_FAILURE; uint16 max_allowed_bad_attempts; fstring name_domain, name_user; - DOM_SID sid; + struct dom_sid sid; enum lsa_SidType type; uchar new_nt_pass[NT_HASH_LEN]; const uint8 *cached_nt_pass; @@ -1590,7 +1590,7 @@ process_result: if (NT_STATUS_IS_OK(result)) { - DOM_SID user_sid; + struct dom_sid user_sid; /* In all codepaths where result == NT_STATUS_OK info3 must have been initialized. */ diff --git a/source3/winbindd/winbindd_passdb.c b/source3/winbindd/winbindd_passdb.c index 023f68f1b3..6ac9a463fa 100644 --- a/source3/winbindd/winbindd_passdb.c +++ b/source3/winbindd/winbindd_passdb.c @@ -91,7 +91,7 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain, const char *domain_name, const char *name, uint32_t flags, - DOM_SID *sid, + struct dom_sid *sid, enum lsa_SidType *type) { const char *fullname; @@ -127,7 +127,7 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain, */ static NTSTATUS sid_to_name(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, char **domain_name, char **name, enum lsa_SidType *type) @@ -162,7 +162,7 @@ static NTSTATUS sid_to_name(struct winbindd_domain *domain, static NTSTATUS rids_to_names(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *sid, + const struct dom_sid *sid, uint32 *rids, size_t num_rids, char **domain_name, @@ -205,7 +205,7 @@ static NTSTATUS rids_to_names(struct winbindd_domain *domain, have_mapped = have_unmapped = false; for (i=0; iname )); if (num_rids) { - sids = TALLOC_ARRAY(mem_ctx, DOM_SID, num_rids); + sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, num_rids); if (sids == NULL) { return NT_STATUS_NO_MEMORY; } @@ -455,7 +455,7 @@ static NTSTATUS msrpc_rids_to_names(struct winbindd_domain *domain, /* Lookup user information from a rid or username. */ static NTSTATUS query_user(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *user_sid, + const struct dom_sid *user_sid, struct wbint_userinfo *user_info) { NTSTATUS result = NT_STATUS_UNSUCCESSFUL; @@ -546,8 +546,8 @@ static NTSTATUS query_user(struct winbindd_domain *domain, /* Lookup groups a user is a member of. I wish Unix had a call like this! */ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *user_sid, - uint32 *num_groups, DOM_SID **user_grpsids) + const struct dom_sid *user_sid, + uint32 *num_groups, struct dom_sid **user_grpsids) { NTSTATUS result = NT_STATUS_UNSUCCESSFUL; struct policy_handle dom_pol, user_pol; @@ -609,7 +609,7 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain, if (!NT_STATUS_IS_OK(result) || (*num_groups) == 0) return result; - (*user_grpsids) = TALLOC_ARRAY(mem_ctx, DOM_SID, *num_groups); + (*user_grpsids) = TALLOC_ARRAY(mem_ctx, struct dom_sid, *num_groups); if (!(*user_grpsids)) return NT_STATUS_NO_MEMORY; @@ -625,7 +625,7 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain, static NTSTATUS msrpc_lookup_useraliases(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - uint32 num_sids, const DOM_SID *sids, + uint32 num_sids, const struct dom_sid *sids, uint32 *num_aliases, uint32 **alias_rids) { @@ -724,10 +724,10 @@ static NTSTATUS msrpc_lookup_useraliases(struct winbindd_domain *domain, /* Lookup group membership given a rid. */ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *group_sid, + const struct dom_sid *group_sid, enum lsa_SidType type, uint32 *num_names, - DOM_SID **sid_mem, char ***names, + struct dom_sid **sid_mem, char ***names, uint32 **name_types) { NTSTATUS result = NT_STATUS_UNSUCCESSFUL; @@ -807,7 +807,7 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain, *names = TALLOC_ZERO_ARRAY(mem_ctx, char *, *num_names); *name_types = TALLOC_ZERO_ARRAY(mem_ctx, uint32, *num_names); - *sid_mem = TALLOC_ZERO_ARRAY(mem_ctx, DOM_SID, *num_names); + *sid_mem = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, *num_names); for (j=0;j<(*num_names);j++) sid_compose(&(*sid_mem)[j], &domain->sid, rid_mem[j]); @@ -1183,7 +1183,7 @@ typedef NTSTATUS (*lookup_sids_fn_t)(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *pol, int num_sids, - const DOM_SID *sids, + const struct dom_sid *sids, char ***pdomains, char ***pnames, enum lsa_SidType **ptypes); diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index eb471e8d13..c808d2df37 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -71,7 +71,7 @@ static void free_domain_list(void) } } -static bool is_internal_domain(const DOM_SID *sid) +static bool is_internal_domain(const struct dom_sid *sid) { if (sid == NULL) return False; @@ -79,7 +79,7 @@ static bool is_internal_domain(const DOM_SID *sid) return (sid_check_is_domain(sid) || sid_check_is_builtin(sid)); } -static bool is_in_internal_domain(const DOM_SID *sid) +static bool is_in_internal_domain(const struct dom_sid *sid) { if (sid == NULL) return False; @@ -91,7 +91,7 @@ static bool is_in_internal_domain(const DOM_SID *sid) /* Add a trusted domain to our list of domains */ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const char *alt_name, struct winbindd_methods *methods, - const DOM_SID *sid) + const struct dom_sid *sid) { struct winbindd_domain *domain; const char *alternative_name = NULL; @@ -289,7 +289,7 @@ static void trustdom_list_done(struct tevent_req *req) while ((p != NULL) && (*p != '\0')) { char *q, *sidstr, *alt_name; - DOM_SID sid; + struct dom_sid sid; struct winbindd_domain *domain; char *alternate_name = NULL; @@ -618,7 +618,7 @@ bool init_domain_list(void) /* Add ourselves as the first entry. */ if ( role == ROLE_DOMAIN_MEMBER ) { - DOM_SID our_sid; + struct dom_sid our_sid; if (!secrets_fetch_domain_sid(lp_workgroup(), &our_sid)) { DEBUG(0, ("Could not fetch our SID - did we join?\n")); @@ -644,10 +644,10 @@ bool init_domain_list(void) return True; } -void check_domain_trusted( const char *name, const DOM_SID *user_sid ) +void check_domain_trusted( const char *name, const struct dom_sid *user_sid ) { struct winbindd_domain *domain; - DOM_SID dom_sid; + struct dom_sid dom_sid; uint32 rid; /* Check if we even care */ @@ -735,7 +735,7 @@ struct winbindd_domain *find_domain_from_name(const char *domain_name) /* Given a domain sid, return the struct winbindd domain info for it */ -struct winbindd_domain *find_domain_from_sid_noinit(const DOM_SID *sid) +struct winbindd_domain *find_domain_from_sid_noinit(const struct dom_sid *sid) { struct winbindd_domain *domain; @@ -753,7 +753,7 @@ struct winbindd_domain *find_domain_from_sid_noinit(const DOM_SID *sid) /* Given a domain sid, return the struct winbindd domain info for it */ -struct winbindd_domain *find_domain_from_sid(const DOM_SID *sid) +struct winbindd_domain *find_domain_from_sid(const struct dom_sid *sid) { struct winbindd_domain *domain; @@ -808,7 +808,7 @@ struct winbindd_domain *find_builtin_domain(void) /* Find the appropriate domain to lookup a name or SID */ -struct winbindd_domain *find_lookup_domain_from_sid(const DOM_SID *sid) +struct winbindd_domain *find_lookup_domain_from_sid(const struct dom_sid *sid) { /* SIDs in the S-1-22-{1,2} domain should be handled by our passdb */ @@ -1127,8 +1127,8 @@ int winbindd_num_clients(void) NTSTATUS lookup_usergroups_cached(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx, - const DOM_SID *user_sid, - uint32 *p_num_groups, DOM_SID **user_sids) + const struct dom_sid *user_sid, + uint32 *p_num_groups, struct dom_sid **user_sids) { struct netr_SamInfo3 *info3 = NULL; NTSTATUS status = NT_STATUS_NO_MEMORY; diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index c1849962a3..f87f13f248 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -49,7 +49,7 @@ enum smb_whoami_flags { 4 bytes - pad / reserved (must be zero) 8 bytes unsigned[] - list of GIDs (may be empty) - DOM_SID[] - list of SIDs (may be empty) + struct dom_sid[] - list of SIDs (may be empty) */ struct smb_whoami diff --git a/testsuite/printing/psec.c b/testsuite/printing/psec.c index 051837cec9..2438614996 100644 --- a/testsuite/printing/psec.c +++ b/testsuite/printing/psec.c @@ -146,7 +146,7 @@ char *ace_to_str(SEC_ACE *ace) void str_to_ace(SEC_ACE *ace, char *ace_str) { SEC_ACCESS sa; - DOM_SID sid; + struct dom_sid sid; uint32 mask; uint8 type, flags; @@ -256,7 +256,7 @@ int psec_getsec(char *printer) int psec_setsec(char *printer) { - DOM_SID user_sid, group_sid; + struct dom_sid user_sid, group_sid; SEC_ACE *ace_list = NULL; SEC_ACL *dacl = NULL; SEC_DESC *sd; @@ -304,7 +304,7 @@ int psec_setsec(char *printer) int ace_type, ace_flags; uint32 ace_mask; fstring sidstr; - DOM_SID sid; + struct dom_sid sid; SEC_ACCESS sa; if (sscanf(line, "%d %d 0x%x %s", &ace_type, &ace_flags, diff --git a/testsuite/smbd/se_access_check_utils.c b/testsuite/smbd/se_access_check_utils.c index fbd2dab465..cba2ca5012 100644 --- a/testsuite/smbd/se_access_check_utils.c +++ b/testsuite/smbd/se_access_check_utils.c @@ -21,7 +21,7 @@ #include "includes.h" #include "se_access_check_utils.h" -void char_to_sid(DOM_SID *sid, char *sid_str) +void char_to_sid(struct dom_sid *sid, char *sid_str) { /* If it looks like a SID, call string_to_sid() else look it up using wbinfo. */ @@ -65,7 +65,7 @@ SEC_ACL *build_acl(struct ace_entry *ace_list) while(ace_list->sid) { SEC_ACCESS sa; - DOM_SID sid; + struct dom_sid sid; /* Create memory for new ACE */ @@ -99,7 +99,7 @@ SEC_ACL *build_acl(struct ace_entry *ace_list) SEC_DESC *build_sec_desc(struct ace_entry *dacl, struct ace_entry *sacl, char *owner_sid, char *group_sid) { - DOM_SID the_owner_sid, the_group_sid; + struct dom_sid the_owner_sid, the_group_sid; SEC_ACL *the_dacl, *the_sacl; SEC_DESC *result; size_t size; -- cgit