summaryrefslogtreecommitdiff
path: root/source/libgpo
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-12-07 17:32:32 -0800
committerJeremy Allison <jra@samba.org>2007-12-07 17:32:32 -0800
commitec003f39369910dee852b7cafb883ddaa321c2de (patch)
treea960a6c8955b6485d4b2ae8772bed7f9ef7f627c /source/libgpo
parentbca371bff8e1dd5099eda1774e5bb0fdbd6a1a77 (diff)
downloadsamba-ec003f39369910dee852b7cafb883ddaa321c2de.tar.gz
Remove next_token - all uses must now be next_token_talloc.
No more temptations to use static length strings. Jeremy.
Diffstat (limited to 'source/libgpo')
-rw-r--r--source/libgpo/gpo_fetch.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/source/libgpo/gpo_fetch.c b/source/libgpo/gpo_fetch.c
index d9995eca21e..916db2b3d35 100644
--- a/source/libgpo/gpo_fetch.c
+++ b/source/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);