From 4dbd743e467096624961533335afccadc67af0e6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 26 Aug 2010 15:48:50 +0200 Subject: s3-util_sid: use shared dom_sid_compare_auth and dom_sid_equal_X functions. Guenther --- source3/utils/net_rpc.c | 3 ++- source3/utils/net_rpc_samsync.c | 3 ++- source3/utils/profiles.c | 9 +++++---- source3/utils/sharesec.c | 7 ++++--- source3/utils/smbcacls.c | 7 ++++--- 5 files changed, 17 insertions(+), 12 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 671f7e81e9..96b3626391 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -36,6 +36,7 @@ #include "secrets.h" #include "lib/netapi/netapi.h" #include "rpc_client/init_lsa.h" +#include "../libcli/security/dom_sid.h" static int net_mode_share; static bool sync_files(struct copy_clistate *cp_clistate, const char *mask); @@ -4171,7 +4172,7 @@ static bool is_alias_member(struct dom_sid *sid, struct full_alias *alias) int i; for (i=0; inum_members; i++) { - if (sid_compare(sid, &alias->members[i]) == 0) + if (dom_sid_compare(sid, &alias->members[i]) == 0) return true; } diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index 8b5a90838e..c9bb96c18c 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -29,6 +29,7 @@ #include "../librpc/gen_ndr/ndr_drsuapi.h" #include "libnet/libnet_samsync.h" #include "libnet/libnet_dssync.h" +#include "../libcli/security/dom_sid.h" static void parse_samsync_partial_replication_objects(TALLOC_CTX *mem_ctx, int argc, @@ -187,7 +188,7 @@ NTSTATUS rpc_vampire_internals(struct net_context *c, NTSTATUS result; struct samsync_context *ctx = NULL; - if (!sid_equal(domain_sid, get_global_sam_sid())) { + if (!dom_sid_equal(domain_sid, get_global_sam_sid())) { d_printf(_("Cannot import users from %s at this time, " "as the current domain:\n\t%s: %s\nconflicts " "with the remote domain\n\t%s: %s\n" diff --git a/source3/utils/profiles.c b/source3/utils/profiles.c index f6f500a2aa..faec8e2c3b 100644 --- a/source3/utils/profiles.c +++ b/source3/utils/profiles.c @@ -23,6 +23,7 @@ #include "popt_common.h" #include "registry/reg_objects.h" #include "regfio.h" +#include "../libcli/security/dom_sid.h" /* GLOBAL VARIABLES */ @@ -64,7 +65,7 @@ static bool swap_sid_in_acl( struct security_descriptor *sd, struct dom_sid *s1, bool update = False; verbose_output(" Owner SID: %s\n", sid_string_tos(sd->owner_sid)); - if ( sid_equal( sd->owner_sid, s1 ) ) { + if ( dom_sid_equal( sd->owner_sid, s1 ) ) { sid_copy( sd->owner_sid, s2 ); update = True; verbose_output(" New Owner SID: %s\n", @@ -73,7 +74,7 @@ static bool swap_sid_in_acl( struct security_descriptor *sd, struct dom_sid *s1, } verbose_output(" Group SID: %s\n", sid_string_tos(sd->group_sid)); - if ( sid_equal( sd->group_sid, s1 ) ) { + if ( dom_sid_equal( sd->group_sid, s1 ) ) { sid_copy( sd->group_sid, s2 ); update = True; verbose_output(" New Group SID: %s\n", @@ -85,7 +86,7 @@ static bool swap_sid_in_acl( struct security_descriptor *sd, struct dom_sid *s1, for ( i=0; inum_aces; i++ ) { verbose_output(" Trustee SID: %s\n", sid_string_tos(&theacl->aces[i].trustee)); - if ( sid_equal( &theacl->aces[i].trustee, s1 ) ) { + if ( dom_sid_equal( &theacl->aces[i].trustee, s1 ) ) { sid_copy( &theacl->aces[i].trustee, s2 ); update = True; verbose_output(" New Trustee SID: %s\n", @@ -99,7 +100,7 @@ static bool swap_sid_in_acl( struct security_descriptor *sd, struct dom_sid *s1, for ( i=0; inum_aces; i++ ) { verbose_output(" Trustee SID: %s\n", sid_string_tos(&theacl->aces[i].trustee)); - if ( sid_equal( &theacl->aces[i].trustee, s1 ) ) { + if ( dom_sid_equal( &theacl->aces[i].trustee, s1 ) ) { sid_copy( &theacl->aces[i].trustee, s2 ); update = True; verbose_output(" New Trustee SID: %s\n", diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c index 79078b234a..decd063913 100644 --- a/source3/utils/sharesec.c +++ b/source3/utils/sharesec.c @@ -24,6 +24,7 @@ #include "includes.h" #include "popt_common.h" +#include "../libcli/security/dom_sid.h" static TALLOC_CTX *ctx; @@ -370,8 +371,8 @@ static int ace_compare(struct security_ace *ace1, struct security_ace *ace2) if (ace1->type != ace2->type) return ace2->type - ace1->type; - if (sid_compare(&ace1->trustee, &ace2->trustee)) - return sid_compare(&ace1->trustee, &ace2->trustee); + if (dom_sid_compare(&ace1->trustee, &ace2->trustee)) + return dom_sid_compare(&ace1->trustee, &ace2->trustee); if (ace1->flags != ace2->flags) return ace1->flags - ace2->flags; @@ -459,7 +460,7 @@ static int change_share_sec(TALLOC_CTX *mem_ctx, const char *sharename, char *th bool found = False; for (j=0;old->dacl && jdacl->num_aces;j++) { - if (sid_equal(&sd->dacl->aces[i].trustee, + if (dom_sid_equal(&sd->dacl->aces[i].trustee, &old->dacl->aces[j].trustee)) { old->dacl->aces[j] = sd->dacl->aces[i]; found = True; diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index 65fec1041b..fa039f639f 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -25,6 +25,7 @@ #include "popt_common.h" #include "../librpc/gen_ndr/ndr_lsa.h" #include "rpc_client/cli_lsarpc.h" +#include "../libcli/security/dom_sid.h" extern bool AllowDebugChange; @@ -835,8 +836,8 @@ static int ace_compare(struct security_ace *ace1, struct security_ace *ace2) if (ace1->type != ace2->type) return ace2->type - ace1->type; - if (sid_compare(&ace1->trustee, &ace2->trustee)) - return sid_compare(&ace1->trustee, &ace2->trustee); + if (dom_sid_compare(&ace1->trustee, &ace2->trustee)) + return dom_sid_compare(&ace1->trustee, &ace2->trustee); if (ace1->flags != ace2->flags) return ace1->flags - ace2->flags; @@ -929,7 +930,7 @@ static int cacl_set(struct cli_state *cli, const char *filename, bool found = False; for (j=0;old->dacl && jdacl->num_aces;j++) { - if (sid_equal(&sd->dacl->aces[i].trustee, + if (dom_sid_equal(&sd->dacl->aces[i].trustee, &old->dacl->aces[j].trustee)) { old->dacl->aces[j] = sd->dacl->aces[i]; found = True; -- cgit