The branch, master has been updated
via 9edd7268b6d smbd: remove struct privilege_paths
from 89041a6d18a lib ldb: lmdb clear stale readers on write txn start
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -
commit 9edd7268b6da23ade527d02dde5820782f51a237
Author: Ralph Boehme
Date: Mon Mar 30 08:06:10 2020 +0200
smbd: remove struct privilege_paths
The last user of this had been removed by
d485c43cc74c5550d151fe728ddc53b02ab23df8.
Signed-off-by: Ralph Boehme
Reviewed-by: Jeremy Allison
Autobuild-User(master): Jeremy Allison
Autobuild-Date(master): Tue Mar 31 19:32:12 UTC 2020 on sn-devel-184
---
Summary of changes:
source3/include/vfs.h | 7 ---
source3/smbd/process.c | 1 -
source3/smbd/smbd.h| 9 -
source3/smbd/vfs.c | 42 --
4 files changed, 16 insertions(+), 43 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index eae9f97179f..fe315673823 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -543,7 +543,6 @@ typedef struct connection_struct {
} connection_struct;
struct smbd_smb2_request;
-struct privilege_paths;
struct referral;
struct smb_request {
@@ -600,12 +599,6 @@ struct smb_request {
*/
struct smbd_smb2_request *smb2req;
- /*
-* Pathnames used if request done
-* under privilege.
-*/
- struct privilege_paths *priv_paths;
-
/*
* Request list for chained requests, we're part of it.
*/
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 8ffe3555637..955f13938b4 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -632,7 +632,6 @@ static bool init_smb_request(struct smb_request *req,
}
req->chain_fsp = NULL;
req->smb2req = NULL;
- req->priv_paths = NULL;
req->chain = NULL;
req->posix_pathnames = lp_posix_pathnames();
smb_init_perfcount_data(>pcd);
diff --git a/source3/smbd/smbd.h b/source3/smbd/smbd.h
index 4c13239c793..787582850db 100644
--- a/source3/smbd/smbd.h
+++ b/source3/smbd/smbd.h
@@ -26,15 +26,6 @@ struct dptr_struct;
#include "smbd/proto.h"
#include "locking/proto.h"
-/*
- * Pathnames used if request done
- * under privilege.
- */
-struct privilege_paths {
- struct smb_filename parent_name;
- struct smb_filename file_name;
-};
-
struct trans_state {
struct trans_state *next, *prev;
uint64_t vuid; /* SMB2 compat */
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 9e0d14cd57a..f99c12f0451 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -1025,36 +1025,29 @@ NTSTATUS
check_reduced_name_with_privilege(connection_struct *conn,
struct smb_filename *resolved_fname = NULL;
struct smb_filename *saved_dir_fname = NULL;
struct smb_filename *smb_fname_cwd = NULL;
- struct privilege_paths *priv_paths = NULL;
int ret;
+ struct smb_filename parent_name = { 0 };
+ struct smb_filename file_name = { 0 };
DEBUG(3,("check_reduced_name_with_privilege [%s] [%s]\n",
smb_fname->base_name,
conn->connectpath));
- priv_paths = talloc_zero(smbreq, struct privilege_paths);
- if (!priv_paths) {
- status = NT_STATUS_NO_MEMORY;
- goto err;
- }
-
if (!parent_dirname(ctx, smb_fname->base_name,
_name, _component)) {
status = NT_STATUS_NO_MEMORY;
goto err;
}
- priv_paths->parent_name.base_name = talloc_strdup(priv_paths, dir_name);
- priv_paths->file_name.base_name = talloc_strdup(priv_paths,
last_component);
-
- if (priv_paths->parent_name.base_name == NULL ||
- priv_paths->file_name.base_name == NULL) {
+ parent_name.base_name = dir_name;
+ file_name.base_name = talloc_strdup(ctx, last_component);
+ if (file_name.base_name == NULL) {
status = NT_STATUS_NO_MEMORY;
goto err;
}
- if (SMB_VFS_STAT(conn, _paths->parent_name) != 0) {
+ if (SMB_VFS_STAT(conn, _name) != 0) {
status = map_nt_error_from_unix(errno);
goto err;
}
@@ -1065,7 +1058,7 @@ NTSTATUS
check_reduced_name_with_privilege(connection_struct *conn,
goto err;
}
- if (vfs_ChDir(conn, _paths->parent_name) == -1) {
+ if (vfs_ChDir(conn, _name) == -1) {
status = map_nt_error_from_unix(errno);
goto err;
}
@@ -1092,7 +1085,7 @@ NTSTATUS
check_reduced_name_with_privilege(connection_struct *conn,
}