*/
#include "includes.h"
+#include "system/filesys.h"
#include "popt_common.h"
#include "registry/reg_objects.h"
#include "registry/regfio.h"
-#include "../libcli/security/dom_sid.h"
+#include "../libcli/security/security.h"
/* GLOBAL VARIABLES */
struct security_acl *theacl;
int i;
bool update = False;
+ struct dom_sid_buf buf;
- verbose_output(" Owner SID: %s\n", sid_string_tos(sd->owner_sid));
+ verbose_output(" Owner SID: %s\n",
+ dom_sid_str_buf(sd->owner_sid, &buf));
if ( dom_sid_equal( sd->owner_sid, s1 ) ) {
sid_copy( sd->owner_sid, s2 );
update = True;
verbose_output(" New Owner SID: %s\n",
- sid_string_tos(sd->owner_sid));
+ dom_sid_str_buf(sd->owner_sid, &buf));
}
- verbose_output(" Group SID: %s\n", sid_string_tos(sd->group_sid));
+ verbose_output(" Group SID: %s\n",
+ dom_sid_str_buf(sd->group_sid, &buf));
if ( dom_sid_equal( sd->group_sid, s1 ) ) {
sid_copy( sd->group_sid, s2 );
update = True;
verbose_output(" New Group SID: %s\n",
- sid_string_tos(sd->group_sid));
+ dom_sid_str_buf(sd->group_sid, &buf));
}
theacl = sd->dacl;
verbose_output(" DACL: %d entries:\n", theacl->num_aces);
for ( i=0; i<theacl->num_aces; i++ ) {
verbose_output(" Trustee SID: %s\n",
- sid_string_tos(&theacl->aces[i].trustee));
+ dom_sid_str_buf(&theacl->aces[i].trustee,
+ &buf));
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",
- sid_string_tos(&theacl->aces[i].trustee));
+ verbose_output(
+ " New Trustee SID: %s\n",
+ dom_sid_str_buf(&theacl->aces[i].trustee,
+ &buf));
}
}
verbose_output(" SACL: %d entries: \n", theacl->num_aces);
for ( i=0; i<theacl->num_aces; i++ ) {
verbose_output(" Trustee SID: %s\n",
- sid_string_tos(&theacl->aces[i].trustee));
+ dom_sid_str_buf(&theacl->aces[i].trustee,
+ &buf));
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",
- sid_string_tos(&theacl->aces[i].trustee));
+ verbose_output(
+ " New Trustee SID: %s\n",
+ dom_sid_str_buf(&theacl->aces[i].trustee,
+ &buf));
}
}
#endif
/* 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;
}
}
}
- /* values is a talloc()'d child of subkeys here so just throw it all away */
-
- TALLOC_FREE( subkeys );
verbose_output("[%s]\n", path);
+ /* values is a talloc()'d child of subkeys here so just throw it all away */
+ TALLOC_FREE(subkeys);
+
return True;
}
/*********************************************************************
*********************************************************************/
-int main( int argc, char *argv[] )
+int main( int argc, const char *argv[] )
{
TALLOC_CTX *frame = talloc_stackframe();
int opt;
};
poptContext pc;
- load_case_tables();
+ smb_init_locale();
/* setup logging options */
- setup_logging( "profiles", True );
- dbf = x_stderr;
- x_setbuf( x_stderr, NULL );
+ 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>");