summaryrefslogtreecommitdiffstats
path: root/source3/utils
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2014-05-26 15:41:41 +0200
committerJeremy Allison <jra@samba.org>2014-05-28 17:52:13 +0200
commitaef195d0b3a4111206e9b13b27c135367976974a (patch)
treeaa187283859d577d9b1cdbcb5d25f1033182c303 /source3/utils
parent21b03f4e6223f9823cc667b352ba325d721e30d7 (diff)
downloadsamba-aef195d0b3a4111206e9b13b27c135367976974a.tar.gz
samba-aef195d0b3a4111206e9b13b27c135367976974a.tar.xz
samba-aef195d0b3a4111206e9b13b27c135367976974a.zip
s3/profiles: replace dup_sec_desc() usage
Use security_descriptor_copy() instead, which is also provided by libcli. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/profiles.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/utils/profiles.c b/source3/utils/profiles.c
index 442a7de018..a193582387 100644
--- a/source3/utils/profiles.c
+++ b/source3/utils/profiles.c
@@ -129,8 +129,14 @@ static bool copy_registry_tree( REGF_FILE *infile, REGF_NK_REC *nk,
/* swap out the SIDs in the security descriptor */
- if ( !(new_sd = dup_sec_desc( outfile->mem_ctx, nk->sec_desc->sec_desc )) ) {
- fprintf( stderr, "Failed to copy security descriptor!\n" );
+ if (nk->sec_desc->sec_desc == NULL) {
+ new_sd = NULL;
+ } else {
+ new_sd = security_descriptor_copy(outfile->mem_ctx,
+ nk->sec_desc->sec_desc);
+ }
+ if (new_sd == NULL) {
+ fprintf(stderr, "Failed to copy security descriptor!\n");
return False;
}