*/
#include "includes.h"
+#include "system/filesys.h"
#include "popt_common.h"
#include "registry/reg_objects.h"
#include "registry/regfio.h"
/* 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) {
+ fprintf(stderr, "Invalid (NULL) security descriptor!\n");
+ return false;
+ }
+
+ 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;
}
/*********************************************************************
*********************************************************************/
-int main( int argc, char *argv[] )
+int main( int argc, const char *argv[] )
{
TALLOC_CTX *frame = talloc_stackframe();
int opt;
setup_logging( "profiles", DEBUG_STDERR);
- pc = poptGetContext("profiles", argc, (const char **)argv, long_options,
+ pc = poptGetContext("profiles", argc, argv, long_options,
POPT_CONTEXT_KEEP_FIRST);
poptSetOtherOptionHelp(pc, "<profilefile>");