summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-04-11 15:26:34 +0200
committerJeremy Allison <jra@samba.org>2013-04-17 14:49:54 -0700
commit8de3c04de346c120ca5ac396008d71eae708071f (patch)
treeaec7437c2aaef1f4fbe1175c5a1fc79e3ba76a16 /source3/lib
parente1f4942a07ef20f3540a47dd08a7a64dbd469398 (diff)
downloadsamba-8de3c04de346c120ca5ac396008d71eae708071f.tar.gz
samba-8de3c04de346c120ca5ac396008d71eae708071f.tar.bz2
samba-8de3c04de346c120ca5ac396008d71eae708071f.zip
lib: Convert copy_smb_filename to use cp_smb_filename
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/filename_util.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/source3/lib/filename_util.c b/source3/lib/filename_util.c
index 67fa1a98f2..90bb2b8627 100644
--- a/source3/lib/filename_util.c
+++ b/source3/lib/filename_util.c
@@ -204,43 +204,11 @@ NTSTATUS copy_smb_filename(TALLOC_CTX *ctx,
const struct smb_filename *smb_fname_in,
struct smb_filename **smb_fname_out)
{
- /* stream_name must always be NULL if there is no stream. */
- if (smb_fname_in->stream_name) {
- SMB_ASSERT(smb_fname_in->stream_name[0] != '\0');
- }
-
- *smb_fname_out = talloc_zero(ctx, struct smb_filename);
+ *smb_fname_out = cp_smb_filename(ctx, smb_fname_in);
if (*smb_fname_out == NULL) {
return NT_STATUS_NO_MEMORY;
}
-
- if (smb_fname_in->base_name) {
- (*smb_fname_out)->base_name =
- talloc_strdup(*smb_fname_out, smb_fname_in->base_name);
- if (!(*smb_fname_out)->base_name)
- goto no_mem_err;
- }
-
- if (smb_fname_in->stream_name) {
- (*smb_fname_out)->stream_name =
- talloc_strdup(*smb_fname_out, smb_fname_in->stream_name);
- if (!(*smb_fname_out)->stream_name)
- goto no_mem_err;
- }
-
- if (smb_fname_in->original_lcomp) {
- (*smb_fname_out)->original_lcomp =
- talloc_strdup(*smb_fname_out, smb_fname_in->original_lcomp);
- if (!(*smb_fname_out)->original_lcomp)
- goto no_mem_err;
- }
-
- (*smb_fname_out)->st = smb_fname_in->st;
return NT_STATUS_OK;
-
- no_mem_err:
- TALLOC_FREE(*smb_fname_out);
- return NT_STATUS_NO_MEMORY;
}
/****************************************************************************