diff options
author | Tim Prouty <tprouty@samba.org> | 2009-07-01 16:14:40 -0700 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-07-06 15:38:40 -0700 |
commit | de3246eae2b1234cc7fcb7d4dd6c6863ab9d31b3 (patch) | |
tree | da5fbf42b00b1419e96eab80c6f82c37c5699f2d /source3/smbd | |
parent | 258952aa85f2a68e2d2362522f6114c6a439f1e3 (diff) | |
download | samba-de3246eae2b1234cc7fcb7d4dd6c6863ab9d31b3.tar.gz samba-de3246eae2b1234cc7fcb7d4dd6c6863ab9d31b3.tar.bz2 samba-de3246eae2b1234cc7fcb7d4dd6c6863ab9d31b3.zip |
s3: Add ability to pass NULL to filename_convert for the char *fname
The goal is to eventually remove the need for the char **fname argument
once all callers have standardized on smb_filename.
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/filename.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index bf12e86d53..29ebc37d1a 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -1217,14 +1217,14 @@ NTSTATUS filename_convert(TALLOC_CTX *ctx, char **pp_name) { NTSTATUS status; + char *fname = NULL; *pp_smb_fname = NULL; - *pp_name = NULL; status = resolve_dfspath(ctx, conn, dfs_path, name_in, - pp_name); + &fname); if (!NT_STATUS_IS_OK(status)) { DEBUG(10,("filename_convert: resolve_dfspath failed " "for name %s with %s\n", @@ -1232,27 +1232,31 @@ NTSTATUS filename_convert(TALLOC_CTX *ctx, nt_errstr(status) )); return status; } - status = unix_convert(ctx, conn, *pp_name, pp_smb_fname, 0); + status = unix_convert(ctx, conn, fname, pp_smb_fname, 0); if (!NT_STATUS_IS_OK(status)) { DEBUG(10,("filename_convert: unix_convert failed " "for name %s with %s\n", - *pp_name, + fname, nt_errstr(status) )); return status; } - status = get_full_smb_filename(ctx, *pp_smb_fname, pp_name); + status = get_full_smb_filename(ctx, *pp_smb_fname, &fname); if (!NT_STATUS_IS_OK(status)) { return status; } - status = check_name(conn, *pp_name); + status = check_name(conn, fname); if (!NT_STATUS_IS_OK(status)) { DEBUG(3,("filename_convert: check_name failed " "for name %s with %s\n", - *pp_name, + fname, nt_errstr(status) )); return status; } + + if (pp_name != NULL) { + *pp_name = fname; + } return status; } |