#include "includes.h"
#include "dynconfig.h"
-#include "registry.h"
+#include "lib/registry/registry.h"
#include "lib/cmdline/popt_common.h"
#include "system/time.h"
+#include "librpc/gen_ndr/ndr_security.h"
/*
* ck/cd - change key
* mkkey/mkdir - make key
* ch - change hive
* info - show key info
+ * save - save hive
* help
* exit
*/
static struct registry_key *cmd_info(TALLOC_CTX *mem_ctx, struct registry_context *ctx,struct registry_key *cur, int argc, char **argv)
{
+ struct security_descriptor *sec_desc = NULL;
time_t last_mod;
+ WERROR error;
+
printf("Name: %s\n", cur->name);
printf("Full path: %s\n", cur->path);
printf("Key Class: %s\n", cur->class_name);
last_mod = nt_time_to_unix(cur->last_mod);
printf("Time Last Modified: %s\n", ctime(&last_mod));
- /* FIXME: Security info */
+
+ error = reg_get_sec_desc(mem_ctx, cur, &sec_desc);
+ if (!W_ERROR_IS_OK(error)) {
+ printf("Error getting security descriptor\n");
+ } else {
+ ndr_print_debug((ndr_print_fn_t)ndr_print_security_descriptor, "Security", sec_desc);
+ }
+ talloc_free(sec_desc);
return cur;
}
} else {
struct registry_value *val;
if (reg_string_to_val(mem_ctx, argv[2], argv[3], &val)) {
- WERROR error = reg_val_set(cur, argv[1], val->data_type, val->data_blk, val->data_len);
+ WERROR error = reg_val_set(cur, argv[1], val->data_type, val->data);
if (!W_ERROR_IS_OK(error)) {
fprintf(stderr, "Error setting value: %s\n", win_errstr(error));
return NULL;
struct registry_context *h = NULL;
struct poptOption long_options[] = {
POPT_AUTOHELP
- POPT_COMMON_CREDENTIALS
{"backend", 'b', POPT_ARG_STRING, &backend, 0, "backend to use", NULL},
{"remote", 'R', POPT_ARG_STRING, &remote, 0, "connect to specified remote server", NULL},
+ POPT_COMMON_SAMBA
+ POPT_COMMON_CREDENTIALS
+ POPT_COMMON_VERSION
POPT_TABLEEND
};
regshell_init_subsystems;
- if (!lp_load(dyn_CONFIGFILE,True,False,False)) {
- fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE);
- }
-
-
pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0);
while((opt = poptGetNextOpt(pc)) != -1) {
}
- setup_logging("regtree", DEBUG_STDOUT);
-
if (remote) {
- error = reg_open_remote (&h, cmdline_credentials, remote);
+ error = reg_open_remote (&h, cmdline_credentials, remote, NULL);
} else if (backend) {
error = reg_open_hive(NULL, backend, poptGetArg(pc), NULL, &curkey);
} else {