From d2da9dee686881106678d50a96713f0632dcdf10 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Jun 2009 15:07:14 -0700 Subject: Add some const to the stat struct in the dosmode calls. Fix a couple more unix_convert uses to filename_convert. Fix bug in acl_group_override() where an uninitialized struct could be used. Move unix_convert with wildcard use in SMBsearch reply to boilerplate code. Jeremy. --- source3/smbd/nttrans.c | 40 ++++++---------------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) (limited to 'source3/smbd/nttrans.c') diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 73c062e69f..222caae516 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1205,12 +1205,10 @@ void reply_ntcancel(struct smb_request *req) static NTSTATUS copy_internals(TALLOC_CTX *ctx, connection_struct *conn, struct smb_request *req, - const char *oldname_in, - const char *newname_in, + struct smb_filename *smb_fname_src, + struct smb_filename *smb_fname_dst, uint32 attrs) { - struct smb_filename *smb_fname_src = NULL; - struct smb_filename *smb_fname_dst = NULL; char *oldname = NULL; char *newname = NULL; files_struct *fsp1,*fsp2; @@ -1225,16 +1223,6 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx, goto out; } - status = unix_convert(ctx, conn, oldname_in, &smb_fname_src, 0); - if (!NT_STATUS_IS_OK(status)) { - goto out; - } - - status = check_name(conn, smb_fname_src->base_name); - if (!NT_STATUS_IS_OK(status)) { - goto out; - } - /* Source must already exist. */ if (!VALID_STAT(smb_fname_src->st)) { status = NT_STATUS_OBJECT_NAME_NOT_FOUND; @@ -1253,16 +1241,6 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx, goto out; } - status = unix_convert(ctx, conn, newname_in, &smb_fname_dst, 0); - if (!NT_STATUS_IS_OK(status)) { - goto out; - } - - status = check_name(conn, smb_fname_dst->base_name); - if (!NT_STATUS_IS_OK(status)) { - goto out; - } - /* Disallow if dst file already exists. */ if (VALID_STAT(smb_fname_dst->st)) { status = NT_STATUS_OBJECT_NAME_COLLISION; @@ -1275,12 +1253,6 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx, goto out; } - /* Ensure this is within the share. */ - status = check_reduced_name(conn, smb_fname_src->base_name); - if (!NT_STATUS_IS_OK(status)) { - goto out; - } - DEBUG(10,("copy_internals: doing file copy %s to %s\n", smb_fname_str_dbg(smb_fname_src), smb_fname_str_dbg(smb_fname_dst))); @@ -1374,8 +1346,6 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx, smb_fname_str_dbg(smb_fname_dst))); } - TALLOC_FREE(smb_fname_src); - TALLOC_FREE(smb_fname_dst); TALLOC_FREE(oldname); TALLOC_FREE(newname); @@ -1501,8 +1471,10 @@ void reply_ntrename(struct smb_request *req) /* No wildcards. */ status = NT_STATUS_OBJECT_PATH_SYNTAX_BAD; } else { - status = copy_internals(ctx, conn, req, oldname, - newname, attrs); + status = copy_internals(ctx, conn, req, + smb_fname_old, + smb_fname_new, + attrs); } break; case RENAME_FLAG_MOVE_CLUSTER_INFORMATION: -- cgit