summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-04-12 11:00:31 +0200
committerJeremy Allison <jra@samba.org>2013-04-17 14:49:58 -0700
commit5774989336570e89b0976842eb9ea2657f8fc3ed (patch)
tree78e8f3679f22b7f52272b694c7e68caf9eb62bb7 /source3/lib
parentc1ad69556c5ba4477a7c369e369c30def0288d55 (diff)
downloadsamba-5774989336570e89b0976842eb9ea2657f8fc3ed.tar.gz
samba-5774989336570e89b0976842eb9ea2657f8fc3ed.tar.bz2
samba-5774989336570e89b0976842eb9ea2657f8fc3ed.zip
lib: Make create_synthetic_smb_fname use synthetic_smb_fname
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.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/source3/lib/filename_util.c b/source3/lib/filename_util.c
index 2503e77764..e4900eb10d 100644
--- a/source3/lib/filename_util.c
+++ b/source3/lib/filename_util.c
@@ -59,20 +59,12 @@ NTSTATUS create_synthetic_smb_fname(TALLOC_CTX *ctx, const char *base_name,
const SMB_STRUCT_STAT *psbuf,
struct smb_filename **smb_fname_out)
{
- struct smb_filename smb_fname_loc;
-
- ZERO_STRUCT(smb_fname_loc);
-
- /* Setup the base_name/stream_name. */
- smb_fname_loc.base_name = discard_const_p(char, base_name);
- smb_fname_loc.stream_name = discard_const_p(char, stream_name);
-
- /* Copy the psbuf if one was given. */
- if (psbuf)
- smb_fname_loc.st = *psbuf;
-
- /* Let copy_smb_filename() do the heavy lifting. */
- return copy_smb_filename(ctx, &smb_fname_loc, smb_fname_out);
+ *smb_fname_out = synthetic_smb_fname(ctx, base_name, stream_name,
+ psbuf);
+ if (*smb_fname_out == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ return NT_STATUS_OK;
}
struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx,
@@ -90,7 +82,7 @@ struct smb_filename *synthetic_smb_fname(TALLOC_CTX *mem_ctx,
if (psbuf)
smb_fname_loc.st = *psbuf;
- /* Let copy_smb_filename() do the heavy lifting. */
+ /* Let cp_smb_filename() do the heavy lifting. */
return cp_smb_filename(mem_ctx, &smb_fname_loc);
}