Changeset 745 for trunk/server/source4/lib/registry/tools
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source4/lib/registry/tools/regdiff.c
r414 r745 131 131 poptFreeContext(pc); 132 132 133 error = reg_dotreg_diff_save(ctx, outputfile, lp_iconv_convenience(cmdline_lp_ctx), &callbacks, 134 &callback_data); 133 error = reg_dotreg_diff_save(ctx, outputfile, &callbacks, &callback_data); 135 134 if (!W_ERROR_IS_OK(error)) { 136 135 fprintf(stderr, "Problem saving registry diff to '%s': %s\n", -
trunk/server/source4/lib/registry/tools/regpatch.c
r414 r745 69 69 poptFreeContext(pc); 70 70 71 reg_diff_apply(h, lp_iconv_convenience(cmdline_lp_ctx),patch);71 reg_diff_apply(h, patch); 72 72 73 73 return 0; -
trunk/server/source4/lib/registry/tools/regshell.c
r414 r745 25 25 #include "lib/events/events.h" 26 26 #include "system/time.h" 27 #include " lib/smbreadline/smbreadline.h"27 #include "../libcli/smbreadline/smbreadline.h" 28 28 #include "librpc/gen_ndr/ndr_security.h" 29 29 #include "lib/registry/tools/common.h" … … 126 126 printf("Key Class: %s\n", classname); 127 127 last_mod = nt_time_to_unix(last_change); 128 printf("Time Last Modified: %s \n", ctime(&last_mod));128 printf("Time Last Modified: %s", ctime(&last_mod)); 129 129 printf("Number of subkeys: %d\n", num_subkeys); 130 130 printf("Number of values: %d\n", num_values); … … 141 141 error = reg_get_sec_desc(ctx, ctx->current, &sec_desc); 142 142 if (!W_ERROR_IS_OK(error)) { 143 printf("Error getting security descriptor \n");144 return error;143 printf("Error getting security descriptor: %s\n", win_errstr(error)); 144 return WERR_OK; 145 145 } 146 146 ndr_print_debug((ndr_print_fn_t)ndr_print_security_descriptor, … … 196 196 } 197 197 198 if (!reg_string_to_val(ctx, lp_iconv_convenience(cmdline_lp_ctx), 199 argv[2], argv[3], &val.data_type, 200 &val.data)) { 198 if (!reg_string_to_val(ctx, argv[2], argv[3], &val.data_type, &val.data)) { 201 199 fprintf(stderr, "Unable to interpret data\n"); 202 200 return WERR_INVALID_PARAM; … … 260 258 261 259 printf("%s\n%s\n", str_regtype(value_type), 262 reg_val_data_string(ctx, lp_iconv_convenience(cmdline_lp_ctx),value_type, value_data));260 reg_val_data_string(ctx, value_type, value_data)); 263 261 264 262 return WERR_OK; … … 267 265 static WERROR cmd_ls(struct regshell_context *ctx, int argc, char **argv) 268 266 { 269 int i;267 unsigned int i; 270 268 WERROR error; 271 269 uint32_t valuetype; … … 283 281 284 282 if (!W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS)) { 285 fprintf(stderr, "Error occur ed while browsing thrukeys: %s\n",283 fprintf(stderr, "Error occurred while browsing through keys: %s\n", 286 284 win_errstr(error)); 287 285 return error; … … 291 289 ctx->current, i, &name, &valuetype, &valuedata)); i++) 292 290 printf("V \"%s\" %s %s\n", name, str_regtype(valuetype), 293 reg_val_data_string(ctx, lp_iconv_convenience(cmdline_lp_ctx),valuetype, valuedata));291 reg_val_data_string(ctx, valuetype, valuedata)); 294 292 295 293 return WERR_OK; … … 326 324 } 327 325 328 error = reg_key_del(ctx ->current, argv[1]);326 error = reg_key_del(ctx, ctx->current, argv[1]); 329 327 if(!W_ERROR_IS_OK(error)) { 330 328 fprintf(stderr, "Error deleting '%s'\n", argv[1]); … … 346 344 } 347 345 348 error = reg_del_value(ctx ->current, argv[1]);346 error = reg_del_value(ctx, ctx->current, argv[1]); 349 347 if(!W_ERROR_IS_OK(error)) { 350 348 fprintf(stderr, "Error deleting value '%s'\n", argv[1]); … … 389 387 int argc, char **argv) 390 388 { 391 int i;389 unsigned int i; 392 390 printf("Available commands:\n"); 393 391 for(i = 0; regshell_cmds[i].name; i++) { … … 430 428 /* Complete command */ 431 429 char **matches; 432 int i, len, samelen=0, count=1; 430 size_t len, samelen=0; 431 unsigned int i, count=1; 433 432 434 433 matches = malloc_array_p(char *, MAX_COMPLETIONS); … … 478 477 struct registry_key *base; 479 478 const char *subkeyname; 480 int i, j = 1; 481 int samelen = 0; 482 int len; 479 unsigned int i, j = 1; 480 size_t len, samelen = 0; 483 481 char **matches; 484 482 const char *base_n = ""; … … 594 592 595 593 if (ctx->current == NULL) { 596 int i;594 unsigned int i; 597 595 598 596 for (i = 0; (reg_predefined_keys[i].handle != 0) && … … 617 615 if (ctx->current == NULL) { 618 616 fprintf(stderr, "Unable to access any of the predefined keys\n"); 619 return -1;617 return 1; 620 618 } 621 619 … … 625 623 char *line, *prompt; 626 624 627 asprintf(&prompt, "%s\\%s> ", ctx->predef?ctx->predef:"", ctx->path); 625 if (asprintf(&prompt, "%s\\%s> ", ctx->predef?ctx->predef:"", 626 ctx->path) < 0) { 627 ret = false; 628 break; 629 } 628 630 629 631 current_key = ctx->current; /* No way to pass a void * pointer -
trunk/server/source4/lib/registry/tools/regtree.c
r414 r745 34 34 * @param novals Whether values should not be printed 35 35 */ 36 static void print_tree( int level, struct registry_key *p,36 static void print_tree(unsigned int level, struct registry_key *p, 37 37 const char *name, 38 38 bool fullpath, bool novals) … … 44 44 struct security_descriptor *sec_desc; 45 45 WERROR error; 46 int i;46 unsigned int i; 47 47 TALLOC_CTX *mem_ctx; 48 48 … … 70 70 71 71 if(!W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS)) { 72 DEBUG(0, ("Error occur ed while fetching subkeys for '%s': %s\n",72 DEBUG(0, ("Error occurred while fetching subkeys for '%s': %s\n", 73 73 name, win_errstr(error))); 74 74 } … … 79 79 mem_ctx, p, i, &valuename, &valuetype, &valuedata)); 80 80 i++) { 81 int j;81 unsigned int j; 82 82 for(j = 0; j < level+1; j++) putchar(' '); 83 83 printf("%s\n", reg_val_description(mem_ctx, 84 lp_iconv_convenience(cmdline_lp_ctx), valuename, 85 valuetype, valuedata)); 84 valuename, valuetype, valuedata)); 86 85 } 87 86 talloc_free(mem_ctx); 88 87 89 88 if(!W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS)) { 90 DEBUG(0, ("Error occur ed while fetching values for '%s': %s\n",89 DEBUG(0, ("Error occurred while fetching values for '%s': %s\n", 91 90 name, win_errstr(error))); 92 91 } … … 102 101 int main(int argc, char **argv) 103 102 { 104 int opt, i; 103 int opt; 104 unsigned int i; 105 105 const char *file = NULL; 106 106 const char *remote = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.