Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source4/lib/registry/tools/regdiff.c

    r414 r745  
    131131        poptFreeContext(pc);
    132132
    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);
    135134        if (!W_ERROR_IS_OK(error)) {
    136135                fprintf(stderr, "Problem saving registry diff to '%s': %s\n",
  • trunk/server/source4/lib/registry/tools/regpatch.c

    r414 r745  
    6969        poptFreeContext(pc);
    7070
    71         reg_diff_apply(h, lp_iconv_convenience(cmdline_lp_ctx), patch);
     71        reg_diff_apply(h, patch);
    7272
    7373        return 0;
  • trunk/server/source4/lib/registry/tools/regshell.c

    r414 r745  
    2525#include "lib/events/events.h"
    2626#include "system/time.h"
    27 #include "lib/smbreadline/smbreadline.h"
     27#include "../libcli/smbreadline/smbreadline.h"
    2828#include "librpc/gen_ndr/ndr_security.h"
    2929#include "lib/registry/tools/common.h"
     
    126126                printf("Key Class: %s\n", classname);
    127127        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));
    129129        printf("Number of subkeys: %d\n", num_subkeys);
    130130        printf("Number of values: %d\n", num_values);
     
    141141        error = reg_get_sec_desc(ctx, ctx->current, &sec_desc);
    142142        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;
    145145        }
    146146        ndr_print_debug((ndr_print_fn_t)ndr_print_security_descriptor,
     
    196196        }
    197197
    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)) {
    201199                fprintf(stderr, "Unable to interpret data\n");
    202200                return WERR_INVALID_PARAM;
     
    260258
    261259        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));
    263261
    264262        return WERR_OK;
     
    267265static WERROR cmd_ls(struct regshell_context *ctx, int argc, char **argv)
    268266{
    269         int i;
     267        unsigned int i;
    270268        WERROR error;
    271269        uint32_t valuetype;
     
    283281
    284282        if (!W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS)) {
    285                 fprintf(stderr, "Error occured while browsing thru keys: %s\n",
     283                fprintf(stderr, "Error occurred while browsing through keys: %s\n",
    286284                        win_errstr(error));
    287285                return error;
     
    291289                ctx->current, i, &name, &valuetype, &valuedata)); i++)
    292290                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));
    294292
    295293        return WERR_OK;
     
    326324        }
    327325
    328         error = reg_key_del(ctx->current, argv[1]);
     326        error = reg_key_del(ctx, ctx->current, argv[1]);
    329327        if(!W_ERROR_IS_OK(error)) {
    330328                fprintf(stderr, "Error deleting '%s'\n", argv[1]);
     
    346344        }
    347345
    348         error = reg_del_value(ctx->current, argv[1]);
     346        error = reg_del_value(ctx, ctx->current, argv[1]);
    349347        if(!W_ERROR_IS_OK(error)) {
    350348                fprintf(stderr, "Error deleting value '%s'\n", argv[1]);
     
    389387                       int argc, char **argv)
    390388{
    391         int i;
     389        unsigned int i;
    392390        printf("Available commands:\n");
    393391        for(i = 0; regshell_cmds[i].name; i++) {
     
    430428        /* Complete command */
    431429        char **matches;
    432         int i, len, samelen=0, count=1;
     430        size_t len, samelen=0;
     431        unsigned int i, count=1;
    433432
    434433        matches = malloc_array_p(char *, MAX_COMPLETIONS);
     
    478477        struct registry_key *base;
    479478        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;
    483481        char **matches;
    484482        const char *base_n = "";
     
    594592
    595593        if (ctx->current == NULL) {
    596                 int i;
     594                unsigned int i;
    597595
    598596                for (i = 0; (reg_predefined_keys[i].handle != 0) &&
     
    617615        if (ctx->current == NULL) {
    618616                fprintf(stderr, "Unable to access any of the predefined keys\n");
    619                 return -1;
     617                return 1;
    620618        }
    621619
     
    625623                char *line, *prompt;
    626624
    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                }
    628630
    629631                current_key = ctx->current;             /* No way to pass a void * pointer
  • trunk/server/source4/lib/registry/tools/regtree.c

    r414 r745  
    3434 * @param novals Whether values should not be printed
    3535 */
    36 static void print_tree(int level, struct registry_key *p,
     36static void print_tree(unsigned int level, struct registry_key *p,
    3737                       const char *name,
    3838                       bool fullpath, bool novals)
     
    4444        struct security_descriptor *sec_desc;
    4545        WERROR error;
    46         int i;
     46        unsigned int i;
    4747        TALLOC_CTX *mem_ctx;
    4848
     
    7070
    7171        if(!W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS)) {
    72                 DEBUG(0, ("Error occured while fetching subkeys for '%s': %s\n",
     72                DEBUG(0, ("Error occurred while fetching subkeys for '%s': %s\n",
    7373                                  name, win_errstr(error)));
    7474        }
     
    7979                        mem_ctx, p, i, &valuename, &valuetype, &valuedata));
    8080                        i++) {
    81                         int j;
     81                        unsigned int j;
    8282                        for(j = 0; j < level+1; j++) putchar(' ');
    8383                        printf("%s\n",  reg_val_description(mem_ctx,
    84                                 lp_iconv_convenience(cmdline_lp_ctx), valuename,
    85                                 valuetype, valuedata));
     84                                valuename, valuetype, valuedata));
    8685                }
    8786                talloc_free(mem_ctx);
    8887
    8988                if(!W_ERROR_EQUAL(error, WERR_NO_MORE_ITEMS)) {
    90                         DEBUG(0, ("Error occured while fetching values for '%s': %s\n",
     89                        DEBUG(0, ("Error occurred while fetching values for '%s': %s\n",
    9190                                name, win_errstr(error)));
    9291                }
     
    102101int main(int argc, char **argv)
    103102{
    104         int opt, i;
     103        int opt;
     104        unsigned int i;
    105105        const char *file = NULL;
    106106        const char *remote = NULL;
Note: See TracChangeset for help on using the changeset viewer.