Rename hex_encode to hex_encode_talloc,for consistency with samba 4 and heimdal.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 18 Oct 2008 14:16:57 +0000 (16:16 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 18 Oct 2008 14:16:57 +0000 (16:16 +0200)
source3/include/proto.h
source3/lib/dbwrap_ctdb.c
source3/lib/dbwrap_file.c
source3/lib/dbwrap_tdb.c
source3/lib/util_str.c
source3/rpcclient/cmd_spoolss.c
source3/utils/ntlm_auth.c

index ac900233fa2bca6458dbf1c6a5df72229a75971b..ba84574653447ef62bc7a0ca4363104a0e389e69 100644 (file)
@@ -1614,7 +1614,7 @@ char *alpha_strcpy_fn(const char *fn,
 char *StrnCpy_fn(const char *fn, int line,char *dest,const char *src,size_t n);
 size_t strhex_to_str(char *buf, size_t buf_len, const char *strhex, size_t strhex_len);
 DATA_BLOB strhex_to_data_blob(TALLOC_CTX *mem_ctx, const char *strhex);
-char *hex_encode(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len);
+char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len);
 bool in_list(const char *s, const char *list, bool casesensitive);
 void string_free(char **s);
 bool string_set(char **dest,const char *src);
index 2818634b14386224a1fe7d2dfeac6f7426661581..38daa61b330cb93be495349357d8b2dd74898b78 100644 (file)
@@ -821,7 +821,7 @@ static int db_ctdb_record_destr(struct db_record* data)
                   ? "Unlocking db %u key %s\n"
                   : "Unlocking db %u key %.20s\n",
                   (int)crec->ctdb_ctx->db_id,
-                  hex_encode(data, (unsigned char *)data->key.dptr,
+                  hex_encode_talloc(data, (unsigned char *)data->key.dptr,
                              data->key.dsize)));
 
        if (tdb_chainunlock(crec->ctdb_ctx->wtdb->tdb, data->key) != 0) {
@@ -871,7 +871,7 @@ static struct db_record *fetch_locked_internal(struct db_ctdb_ctx *ctx,
 again:
 
        if (DEBUGLEVEL >= 10) {
-               char *keystr = hex_encode(result, key.dptr, key.dsize);
+               char *keystr = hex_encode_talloc(result, key.dptr, key.dsize);
                DEBUG(10, (DEBUGLEVEL > 10
                           ? "Locking db %u key %s\n"
                           : "Locking db %u key %.20s\n",
index e3779de1e47effda998f93ba7b996cc0243a5f44..69ad8e4b20c7c16031d7a3013c729e159d5c4a13 100644 (file)
@@ -105,7 +105,7 @@ static struct db_record *db_file_fetch_locked(struct db_context *db,
 
        /* Cut to 8 bits */
        file->hash = fsh(key.dptr, key.dsize);
-       file->name = hex_encode(file, (unsigned char *)key.dptr, key.dsize);
+       file->name = hex_encode_talloc(file, (unsigned char *)key.dptr, key.dsize);
        if (file->name == NULL) {
                DEBUG(0, ("hex_encode failed\n"));
                TALLOC_FREE(result);
index 7bdadd37709526d1b18b0ab96a70a7218b436c89..4860c61ab04fe3fd19ba8d4b87966d98e8ee1f9d 100644 (file)
@@ -31,14 +31,14 @@ static int db_tdb_record_destr(struct db_record* data)
        struct db_tdb_ctx *ctx =
                talloc_get_type_abort(data->private_data, struct db_tdb_ctx);
 
-       /* This hex_encode() call allocates memory on data context. By way how current 
+       /* This hex_encode_talloc() call allocates memory on data context. By way how current 
           __talloc_free() code works, it is OK to allocate in the destructor as 
           the children of data will be freed after call to the destructor and this 
           new 'child' will be caught and freed correctly.
         */
        DEBUG(10, (DEBUGLEVEL > 10
                   ? "Unlocking key %s\n" : "Unlocking key %.20s\n",
-                  hex_encode(data, (unsigned char *)data->key.dptr,
+                  hex_encode_talloc(data, (unsigned char *)data->key.dptr,
                              data->key.dsize)));
 
        if (tdb_chainunlock(ctx->wtdb->tdb, data->key) != 0) {
@@ -94,7 +94,7 @@ static struct db_record *db_tdb_fetch_locked(struct db_context *db,
 
        /* Do not accidently allocate/deallocate w/o need when debug level is lower than needed */
        if(DEBUGLEVEL >= 10) {
-               char *keystr = hex_encode(NULL, (unsigned char*)key.dptr, key.dsize);
+               char *keystr = hex_encode_talloc(NULL, (unsigned char*)key.dptr, key.dsize);
                DEBUG(10, (DEBUGLEVEL > 10
                           ? "Locking key %s\n" : "Locking key %.20s\n",
                           keystr));
index 80aaa2b9c02a3ee54cb64e89d95b95204fd046d0..f6783f10ffd8537c40cc39a543d21833bc2194cd 100644 (file)
@@ -939,7 +939,7 @@ DATA_BLOB strhex_to_data_blob(TALLOC_CTX *mem_ctx, const char *strhex)
  * Routine to print a buffer as HEX digits, into an allocated string.
  */
 
-char *hex_encode(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len)
+char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, size_t len)
 {
        int i;
        char *hex_buffer;
index 2a9f2b82bb2c0bf1ba8c7dd2bfa86296736f66c3..378ec891a7ed8193db2c6cda61362e53e60edb17 100644 (file)
@@ -691,7 +691,7 @@ static void display_reg_value(REGISTRY_VALUE value)
                printf("%s: REG_SZ: %s\n", value.valuename, text ? text : "");
                break;
        case REG_BINARY: {
-               char *hex = hex_encode(NULL, value.data_p, value.size);
+               char *hex = hex_encode_talloc(NULL, value.data_p, value.size);
                size_t i, len;
                printf("%s: REG_BINARY:", value.valuename);
                len = strlen(hex);
index 4586086d73fcf1a418119cda55952f3a6c0a77a5..0a76761cb27e270664f3a0722928ebf6c071d159 100644 (file)
@@ -1813,7 +1813,7 @@ static void manage_ntlm_server_1_request(struct ntlm_auth_state *state,
                                if (ntlm_server_1_lm_session_key 
                                    && (memcmp(zeros, lm_key, 
                                               sizeof(lm_key)) != 0)) {
-                                       hex_lm_key = hex_encode(NULL,
+                                       hex_lm_key = hex_encode_talloc(NULL,
                                                                (const unsigned char *)lm_key,
                                                                sizeof(lm_key));
                                        x_fprintf(x_stdout, "LANMAN-Session-Key: %s\n", hex_lm_key);
@@ -1823,7 +1823,7 @@ static void manage_ntlm_server_1_request(struct ntlm_auth_state *state,
                                if (ntlm_server_1_user_session_key 
                                    && (memcmp(zeros, user_session_key, 
                                               sizeof(user_session_key)) != 0)) {
-                                       hex_user_session_key = hex_encode(NULL,
+                                       hex_user_session_key = hex_encode_talloc(NULL,
                                                                          (const unsigned char *)user_session_key, 
                                                                          sizeof(user_session_key));
                                        x_fprintf(x_stdout, "User-Session-Key: %s\n", hex_user_session_key);
@@ -2262,7 +2262,7 @@ static bool check_auth_crap(void)
        if (request_lm_key 
            && (memcmp(zeros, lm_key, 
                       sizeof(lm_key)) != 0)) {
-               hex_lm_key = hex_encode(NULL, (const unsigned char *)lm_key,
+               hex_lm_key = hex_encode_talloc(NULL, (const unsigned char *)lm_key,
                                        sizeof(lm_key));
                x_fprintf(x_stdout, "LM_KEY: %s\n", hex_lm_key);
                TALLOC_FREE(hex_lm_key);
@@ -2270,7 +2270,7 @@ static bool check_auth_crap(void)
        if (request_user_session_key 
            && (memcmp(zeros, user_session_key, 
                       sizeof(user_session_key)) != 0)) {
-               hex_user_session_key = hex_encode(NULL, (const unsigned char *)user_session_key, 
+               hex_user_session_key = hex_encode_talloc(NULL, (const unsigned char *)user_session_key, 
                                                  sizeof(user_session_key));
                x_fprintf(x_stdout, "NT_KEY: %s\n", hex_user_session_key);
                TALLOC_FREE(hex_user_session_key);