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>
/* swap out the SIDs in the security descriptor */
/* 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");