From fd999d9fc69c2991fffdb88f60a8b7d891498ee9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 6 Mar 2013 11:14:27 +0100 Subject: [PATCH] profiles --- source3/utils/profiles.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/source3/utils/profiles.c b/source3/utils/profiles.c index d128d6d1d674..1ef4b43203d8 100644 --- a/source3/utils/profiles.c +++ b/source3/utils/profiles.c @@ -238,6 +238,9 @@ int main( int argc, const char *argv[] ) poptSetOtherOptionHelp(pc, ""); + ZERO_STRUCT(old_sid); + ZERO_STRUCT(new_sid); + /* Now, process the arguments */ while ((opt = poptGetNextOpt(pc)) != -1) { @@ -270,7 +273,7 @@ int main( int argc, const char *argv[] ) exit(1); } - if ((!change && new_val) || (change && !new_val)) { + if (!change || !new_val) { fprintf(stderr, "You must specify both -c and -n if one or the other is set!\n"); poptPrintUsage(pc, stderr, 0); exit(252); @@ -295,12 +298,18 @@ int main( int argc, const char *argv[] ) } ndr_err = ndr_push_struct_blob(&old_blob, frame, &old_sid, - (ndr_push_flags_fn_t) ndr_push_security_descriptor); + (ndr_push_flags_fn_t) ndr_push_dom_sid); + SMB_ASSERT(NDR_ERR_CODE_IS_SUCCESS(ndr_err)); + ndr_err = ndr_push_struct_blob(&new_blob, frame, &new_sid, - (ndr_push_flags_fn_t) ndr_push_security_descriptor); + (ndr_push_flags_fn_t) ndr_push_dom_sid); + SMB_ASSERT(NDR_ERR_CODE_IS_SUCCESS(ndr_err)); if (new_blob.length > old_blob.length) { - + fprintf(stderr, "New SID[%s][%u] is longer than old SID[%s][%u]]\n", + sid_string_dbg(&new_sid), (unsigned)new_blob.length, + sid_string_dbg(&old_sid), (unsigned)old_blob.length); + exit (1); } if (new_blob.length < old_blob.length) { -- 2.34.1