summaryrefslogtreecommitdiff
path: root/source/libgpo/gpo_fetch.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-15 18:27:26 -0800
committerJeremy Allison <jra@samba.org>2007-11-15 18:27:26 -0800
commita1725f4ff7ed375808c78ac661b539557748d0a5 (patch)
tree76addcfb75c9e0df99ce13f9997c7a1f349ff644 /source/libgpo/gpo_fetch.c
parentad9f14b6dcb05e8fa68b51ff26ff40fc445a4631 (diff)
downloadsamba-a1725f4ff7ed375808c78ac661b539557748d0a5.tar.gz
Add MAX_DNS_NAME_LENGTH, remove more pstrings.
Jeremy.
Diffstat (limited to 'source/libgpo/gpo_fetch.c')
-rw-r--r--source/libgpo/gpo_fetch.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/source/libgpo/gpo_fetch.c b/source/libgpo/gpo_fetch.c
index 6be986d5d90..d9995eca21e 100644
--- a/source/libgpo/gpo_fetch.c
+++ b/source/libgpo/gpo_fetch.c
@@ -31,7 +31,7 @@ NTSTATUS gpo_explode_filesyspath(TALLOC_CTX *mem_ctx,
char **unix_path)
{
fstring tok;
- pstring path;
+ char *path = NULL;
*server = NULL;
*service = NULL;
@@ -63,15 +63,22 @@ NTSTATUS gpo_explode_filesyspath(TALLOC_CTX *mem_ctx,
return NT_STATUS_NO_MEMORY;
}
- pstrcpy(path, lock_path(GPO_CACHE_DIR));
- pstrcat(path, "/");
- pstrcat(path, file_sys_path);
- pstring_sub(path, "\\", "/");
+ if ((path = talloc_asprintf(mem_ctx,
+ "%s/%s",
+ lock_path(GPO_CACHE_DIR),
+ file_sys_path)) == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ path = talloc_string_sub(mem_ctx, path, "\\", "/");
+ if (!path) {
+ return NT_STATUS_NO_MEMORY;
+ }
if ((*unix_path = talloc_strdup(mem_ctx, path)) == NULL) {
return NT_STATUS_NO_MEMORY;
}
+ TALLOC_FREE(path);
return NT_STATUS_OK;
}