diff options
author | Jeremy Allison <jra@samba.org> | 2007-12-07 17:32:32 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-12-07 17:32:32 -0800 |
commit | 42cfffae80480eae4381902fff3f7c61f858a933 (patch) | |
tree | 2fc1bc486fa988a4f2854310bcf91943db1aa566 /source3/libgpo | |
parent | 25288b0e4472c728fc5a3a70c6c3e1f621ffae5f (diff) | |
download | samba-42cfffae80480eae4381902fff3f7c61f858a933.tar.gz samba-42cfffae80480eae4381902fff3f7c61f858a933.tar.bz2 samba-42cfffae80480eae4381902fff3f7c61f858a933.zip |
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)
Diffstat (limited to 'source3/libgpo')
-rw-r--r-- | source3/libgpo/gpo_fetch.c | 21 |
1 files changed, 5 insertions, 16 deletions
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); |