From 91b8a8d1d21b810b6aca44ce647837669efd6dcf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 21 Jun 2001 09:10:42 +0000 Subject: next_token() was supposed to be a reentrant replacement for strtok(), but the code suffered from bitrot and is not now reentrant. That means we can get bizarre behaviour i've fixed this by making next_token() reentrant and creating a next_token_nr() that is a small non-reentrant wrapper for those lumps of code (mostly smbclient) that have come to rely on the non-reentrant behaviour (This used to be commit 674ee2f1d12b0afc164a9e9072758fd1c5e54df7) --- source3/rpcclient/cmd_reg.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source3/rpcclient/cmd_reg.c') diff --git a/source3/rpcclient/cmd_reg.c b/source3/rpcclient/cmd_reg.c index 89b53c823f..9aac99c928 100644 --- a/source3/rpcclient/cmd_reg.c +++ b/source3/rpcclient/cmd_reg.c @@ -91,7 +91,7 @@ void cmd_reg_enum(struct client_info *info) DEBUG(5, ("cmd_reg_enum: smb_cli->fd:%d\n", smb_cli->fd)); - if (!next_token(NULL, full_keyname, NULL, sizeof(full_keyname))) + if (!next_token_nr(NULL, full_keyname, NULL, sizeof(full_keyname))) { fprintf(out_hnd, "regenum \n"); return; @@ -250,7 +250,7 @@ void cmd_reg_query_key(struct client_info *info) DEBUG(5, ("cmd_reg_enum: smb_cli->fd:%d\n", smb_cli->fd)); - if (!next_token(NULL, full_keyname, NULL, sizeof(full_keyname))) + if (!next_token_nr(NULL, full_keyname, NULL, sizeof(full_keyname))) { fprintf(out_hnd, "regquery key_name\n"); return; @@ -349,7 +349,7 @@ void cmd_reg_create_val(struct client_info *info) DEBUG(5, ("cmd_reg_create_val: smb_cli->fd:%d\n", smb_cli->fd)); - if (!next_token(NULL, full_keyname, NULL, sizeof(full_keyname))) + if (!next_token_nr(NULL, full_keyname, NULL, sizeof(full_keyname))) { fprintf(out_hnd, "regcreate \n"); return; @@ -363,7 +363,7 @@ void cmd_reg_create_val(struct client_info *info) return; } - if (!next_token(NULL, tmp, NULL, sizeof(tmp))) + if (!next_token_nr(NULL, tmp, NULL, sizeof(tmp))) { fprintf(out_hnd, "regcreate \n"); return; @@ -377,7 +377,7 @@ void cmd_reg_create_val(struct client_info *info) return; } - if (!next_token(NULL, tmp, NULL, sizeof(tmp))) + if (!next_token_nr(NULL, tmp, NULL, sizeof(tmp))) { fprintf(out_hnd, "regcreate \n"); return; @@ -484,7 +484,7 @@ void cmd_reg_delete_val(struct client_info *info) DEBUG(5, ("cmd_reg_delete_val: smb_cli->fd:%d\n", smb_cli->fd)); - if (!next_token(NULL, full_keyname, NULL, sizeof(full_keyname))) + if (!next_token_nr(NULL, full_keyname, NULL, sizeof(full_keyname))) { fprintf(out_hnd, "regdelete \n"); return; @@ -559,7 +559,7 @@ void cmd_reg_delete_key(struct client_info *info) DEBUG(5, ("cmd_reg_delete_key: smb_cli->fd:%d\n", smb_cli->fd)); - if (!next_token(NULL, full_keyname, NULL, sizeof(full_keyname))) + if (!next_token_nr(NULL, full_keyname, NULL, sizeof(full_keyname))) { fprintf(out_hnd, "regdeletekey \n"); return; @@ -640,7 +640,7 @@ void cmd_reg_create_key(struct client_info *info) DEBUG(5, ("cmd_reg_create_key: smb_cli->fd:%d\n", smb_cli->fd)); - if (!next_token(NULL, full_keyname, NULL, sizeof(full_keyname))) + if (!next_token_nr(NULL, full_keyname, NULL, sizeof(full_keyname))) { fprintf(out_hnd, "regcreate [key_class]\n"); return; @@ -654,7 +654,7 @@ void cmd_reg_create_key(struct client_info *info) return; } - if (!next_token(NULL, key_class, NULL, sizeof(key_class))) + if (!next_token_nr(NULL, key_class, NULL, sizeof(key_class))) { memset(key_class, 0, sizeof(key_class)); } @@ -735,7 +735,7 @@ void cmd_reg_test_key_sec(struct client_info *info) DEBUG(5, ("cmd_reg_get_key_sec: smb_cli->fd:%d\n", smb_cli->fd)); - if (!next_token(NULL, full_keyname, NULL, sizeof(full_keyname))) + if (!next_token_nr(NULL, full_keyname, NULL, sizeof(full_keyname))) { fprintf(out_hnd, "reggetsec \n"); return; @@ -830,7 +830,7 @@ void cmd_reg_get_key_sec(struct client_info *info) DEBUG(5, ("cmd_reg_get_key_sec: smb_cli->fd:%d\n", smb_cli->fd)); - if (!next_token(NULL, full_keyname, NULL, sizeof(full_keyname))) + if (!next_token_nr(NULL, full_keyname, NULL, sizeof(full_keyname))) { fprintf(out_hnd, "reggetsec \n"); return; -- cgit