summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-18 16:16:57 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-18 16:16:57 +0200
commitf3f9446ec122d633c50a0c3dba9a9bea9f79c2b0 (patch)
tree66a71d3a4809da84d496a54eceee24ff1beb887e
parent63de2d9823f6211668b4b05cb23764ba69a7dc9a (diff)
downloadsamba-f3f9446ec122d633c50a0c3dba9a9bea9f79c2b0.tar.gz
samba-f3f9446ec122d633c50a0c3dba9a9bea9f79c2b0.tar.bz2
samba-f3f9446ec122d633c50a0c3dba9a9bea9f79c2b0.zip
Rename hex_encode to hex_encode_talloc,for consistency with samba 4 and heimdal.
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/lib/dbwrap_ctdb.c4
-rw-r--r--source3/lib/dbwrap_file.c2
-rw-r--r--source3/lib/dbwrap_tdb.c6
-rw-r--r--source3/lib/util_str.c2
-rw-r--r--source3/rpcclient/cmd_spoolss.c2
-rw-r--r--source3/utils/ntlm_auth.c8
7 files changed, 13 insertions, 13 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index ac900233fa..ba84574653 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -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);
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index 2818634b14..38daa61b33 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -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",
diff --git a/source3/lib/dbwrap_file.c b/source3/lib/dbwrap_file.c
index e3779de1e4..69ad8e4b20 100644
--- a/source3/lib/dbwrap_file.c
+++ b/source3/lib/dbwrap_file.c
@@ -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);
diff --git a/source3/lib/dbwrap_tdb.c b/source3/lib/dbwrap_tdb.c
index 7bdadd3770..4860c61ab0 100644
--- a/source3/lib/dbwrap_tdb.c
+++ b/source3/lib/dbwrap_tdb.c
@@ -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));
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 80aaa2b9c0..f6783f10ff 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -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;
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 2a9f2b82bb..378ec891a7 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -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);
diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c
index 4586086d73..0a76761cb2 100644
--- a/source3/utils/ntlm_auth.c
+++ b/source3/utils/ntlm_auth.c
@@ -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);