summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h3
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c6
-rw-r--r--source3/smbd/filename.c16
-rw-r--r--source3/smbd/nttrans.c12
-rw-r--r--source3/smbd/reply.c27
-rw-r--r--source3/smbd/smb2_create.c3
-rw-r--r--source3/smbd/trans2.c15
7 files changed, 26 insertions, 56 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index fe81bd2c97..77283d9cf0 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -6320,8 +6320,7 @@ NTSTATUS filename_convert(TALLOC_CTX *mem_ctx,
connection_struct *conn,
bool dfs_path,
const char *name_in,
- struct smb_filename **pp_smb_fname,
- char **pp_name);
+ struct smb_filename **pp_smb_fname);
/* The following definitions come from smbd/filename_utils.c */
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index c58c08ecdc..b9d1ed6d73 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -2072,8 +2072,7 @@ WERROR _srvsvc_NetGetFileSecurity(pipes_struct *p,
conn,
false,
r->in.file,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(nt_status)) {
werr = ntstatus_to_werror(nt_status);
goto error_exit;
@@ -2201,8 +2200,7 @@ WERROR _srvsvc_NetSetFileSecurity(pipes_struct *p,
conn,
false,
r->in.file,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(nt_status)) {
werr = ntstatus_to_werror(nt_status);
goto error_exit;
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index c05f0e659f..541b0cd3cb 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -1018,8 +1018,7 @@ NTSTATUS filename_convert(TALLOC_CTX *ctx,
connection_struct *conn,
bool dfs_path,
const char *name_in,
- struct smb_filename **pp_smb_fname,
- char **pp_name)
+ struct smb_filename **pp_smb_fname)
{
NTSTATUS status;
char *fname = NULL;
@@ -1046,22 +1045,15 @@ NTSTATUS filename_convert(TALLOC_CTX *ctx,
return status;
}
- status = get_full_smb_filename(ctx, *pp_smb_fname, &fname);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
- status = check_name(conn, fname);
+ status = check_name(conn, (*pp_smb_fname)->base_name);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3,("filename_convert: check_name failed "
"for name %s with %s\n",
- fname,
+ smb_fname_str_dbg(*pp_smb_fname),
nt_errstr(status) ));
+ TALLOC_FREE(*pp_smb_fname);
return status;
}
- if (pp_name != NULL) {
- *pp_name = fname;
- }
return status;
}
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index af79986df4..43212dc800 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -478,8 +478,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
@@ -968,8 +967,7 @@ static void call_nt_transact_create(connection_struct *conn,
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
@@ -1355,8 +1353,7 @@ void reply_ntrename(struct smb_request *req)
status = filename_convert(ctx, conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
oldname,
- &smb_fname_old,
- NULL);
+ &smb_fname_old);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,
NT_STATUS_PATH_NOT_COVERED)) {
@@ -1372,8 +1369,7 @@ void reply_ntrename(struct smb_request *req)
status = filename_convert(ctx, conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
newname,
- &smb_fname_new,
- NULL);
+ &smb_fname_new);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,
NT_STATUS_PATH_NOT_COVERED)) {
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 5924c46cc1..72595aeda7 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -994,8 +994,7 @@ void reply_checkpath(struct smb_request *req)
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
name,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
@@ -1091,8 +1090,7 @@ void reply_getatr(struct smb_request *req)
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
@@ -1193,8 +1191,7 @@ void reply_setatr(struct smb_request *req)
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
@@ -1747,8 +1744,7 @@ void reply_open(struct smb_request *req)
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
reply_botherror(req,
@@ -1918,8 +1914,7 @@ void reply_open_and_X(struct smb_request *req)
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
reply_botherror(req,
@@ -2128,8 +2123,7 @@ void reply_mknew(struct smb_request *req)
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
reply_botherror(req,
@@ -2261,8 +2255,7 @@ void reply_ctemp(struct smb_request *req)
status = filename_convert(ctx, conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
@@ -5267,8 +5260,7 @@ void reply_mkdir(struct smb_request *req)
status = filename_convert(ctx, conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
directory,
- &smb_dname,
- NULL);
+ &smb_dname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
@@ -5575,8 +5567,7 @@ void reply_rmdir(struct smb_request *req)
status = filename_convert(ctx, conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
directory,
- &smb_dname,
- NULL);
+ &smb_dname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
index 7337a345fd..b455f82d80 100644
--- a/source3/smbd/smb2_create.c
+++ b/source3/smbd/smb2_create.c
@@ -325,8 +325,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
smbreq->conn,
smbreq->flags2 & FLAGS2_DFS_PATHNAMES,
in_name,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
tevent_req_nterror(req, status);
TALLOC_FREE(smb_fname);
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 2f1f50b11d..8637d1bda1 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1028,8 +1028,7 @@ static void call_trans2open(connection_struct *conn,
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
reply_botherror(req,
@@ -4889,8 +4888,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
reply_botherror(req,
@@ -5664,8 +5662,7 @@ static NTSTATUS smb_set_file_unix_hlink(connection_struct *conn,
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
oldname,
- &smb_fname_old,
- NULL);
+ &smb_fname_old);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -7465,8 +7462,7 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
status = filename_convert(req, conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
fname,
- &smb_fname,
- NULL);
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
reply_botherror(req,
@@ -7587,8 +7583,7 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req,
conn,
req->flags2 & FLAGS2_DFS_PATHNAMES,
directory,
- &smb_dname,
- NULL);
+ &smb_dname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {