From 42cfffae80480eae4381902fff3f7c61f858a933 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 7 Dec 2007 17:32:32 -0800 Subject: Remove next_token - all uses must now be next_token_talloc. No more temptations to use static length strings. Jeremy. (This used to be commit ec003f39369910dee852b7cafb883ddaa321c2de) --- source3/libgpo/gpo_fetch.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'source3/libgpo/gpo_fetch.c') diff --git a/source3/libgpo/gpo_fetch.c b/source3/libgpo/gpo_fetch.c index d9995eca21..916db2b3d3 100644 --- a/source3/libgpo/gpo_fetch.c +++ b/source3/libgpo/gpo_fetch.c @@ -30,7 +30,6 @@ NTSTATUS gpo_explode_filesyspath(TALLOC_CTX *mem_ctx, char **nt_path, char **unix_path) { - fstring tok; char *path = NULL; *server = NULL; @@ -42,22 +41,14 @@ NTSTATUS gpo_explode_filesyspath(TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } - if (!next_token(&file_sys_path, tok, "\\", sizeof(tok))) { + if (!next_token_talloc(mem_ctx, &file_sys_path, server, "\\")) { return NT_STATUS_INVALID_PARAMETER; } - if ((*server = talloc_strdup(mem_ctx, tok)) == NULL) { - return NT_STATUS_NO_MEMORY; - } - - if (!next_token(&file_sys_path, tok, "\\", sizeof(tok))) { + if (!next_token_talloc(mem_ctx, &file_sys_path, service, "\\")) { return NT_STATUS_INVALID_PARAMETER; } - if ((*service = talloc_strdup(mem_ctx, tok)) == NULL) { - return NT_STATUS_NO_MEMORY; - } - if ((*nt_path = talloc_asprintf(mem_ctx, "\\%s", file_sys_path)) == NULL) { return NT_STATUS_NO_MEMORY; @@ -91,7 +82,7 @@ static NTSTATUS gpo_prepare_local_store(TALLOC_CTX *mem_ctx, { const char *top_dir = lock_path(GPO_CACHE_DIR); char *current_dir; - fstring tok; + char *tok; current_dir = talloc_strdup(mem_ctx, top_dir); NT_STATUS_HAVE_NO_MEMORY(current_dir); @@ -100,15 +91,13 @@ static NTSTATUS gpo_prepare_local_store(TALLOC_CTX *mem_ctx, return NT_STATUS_ACCESS_DENIED; } - while (next_token(&unix_path, tok, "/", sizeof(tok))) { - + while (next_token_talloc(mem_ctx, &unix_path, &tok, "/")) { if (strequal(tok, GPO_CACHE_DIR)) { break; } } - while (next_token(&unix_path, tok, "/", sizeof(tok))) { - + while (next_token_talloc(mem_ctx, &unix_path, &tok, "/")) { current_dir = talloc_asprintf_append_buffer(current_dir, "/%s", tok); NT_STATUS_HAVE_NO_MEMORY(current_dir); -- cgit