summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2018-02-07 11:05:33 +0100
committerJeremy Allison <jra@samba.org>2018-02-13 00:26:43 +0100
commit9487510e9e1269e70d4c4fbc44316f0c8758be03 (patch)
treedfd014e8f43b70fefee3ff2ec9130cc5d963bb00 /source3
parent786e307fd433065c097915a9d98fc71b4afbab14 (diff)
downloadsamba-9487510e9e1269e70d4c4fbc44316f0c8758be03.tar.gz
smbd: Pass in "file_id" into share_mode_str()
This used to directly access share_entry->id, which will go Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/locking/locking.c6
-rw-r--r--source3/locking/proto.h4
-rw-r--r--source3/rpc_server/srvsvc/srv_srvsvc_nt.c5
-rw-r--r--source3/smbd/close.c2
-rw-r--r--source3/smbd/open.c10
5 files changed, 16 insertions, 11 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 8e63bfc4a69..6311cda276a 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -425,7 +425,9 @@ void locking_close_file(struct messaging_context *msg_ctx,
Print out a share mode.
********************************************************************/
-char *share_mode_str(TALLOC_CTX *ctx, int num, const struct share_mode_entry *e)
+char *share_mode_str(TALLOC_CTX *ctx, int num,
+ const struct file_id *id,
+ const struct share_mode_entry *e)
{
struct server_id_buf tmp;
@@ -439,7 +441,7 @@ char *share_mode_str(TALLOC_CTX *ctx, int num, const struct share_mode_entry *e)
e->access_mask, (unsigned long long)e->op_mid,
e->op_type, (unsigned long long)e->share_file_id,
(unsigned int)e->uid, (unsigned int)e->flags,
- file_id_string_tos(&e->id),
+ file_id_string_tos(id),
(unsigned int)e->name_hash);
}
diff --git a/source3/locking/proto.h b/source3/locking/proto.h
index 671b8327e49..afd5373772a 100644
--- a/source3/locking/proto.h
+++ b/source3/locking/proto.h
@@ -140,7 +140,9 @@ void locking_close_file(struct messaging_context *msg_ctx,
bool locking_init(void);
bool locking_init_readonly(void);
bool locking_end(void);
-char *share_mode_str(TALLOC_CTX *ctx, int num, const struct share_mode_entry *e);
+char *share_mode_str(TALLOC_CTX *ctx, int num,
+ const struct file_id *id,
+ const struct share_mode_entry *e);
struct share_mode_lock *get_existing_share_mode_lock(TALLOC_CTX *mem_ctx,
struct file_id id);
struct share_mode_lock *get_share_mode_lock(
diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
index 0d15381e31c..8e830ff9112 100644
--- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
@@ -2722,9 +2722,8 @@ static int enum_file_close_fn(const struct share_mode_entry *e,
}
/* Ok - send the close message. */
- DEBUG(10,("enum_file_close_fn: request to close file %s, %s\n",
- sharepath,
- share_mode_str(talloc_tos(), 0, e) ));
+ DBG_DEBUG("request to close file %s, %s\n", sharepath,
+ share_mode_str(talloc_tos(), 0, &e->id, e));
share_mode_entry_to_message(msg, e);
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 2f6cc4f0aad..0d60a2258e2 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -1288,7 +1288,7 @@ void msg_close_file(struct messaging_context *msg_ctx,
message_to_share_mode_entry(&e, (char *)data->data);
if(DEBUGLVL(10)) {
- char *sm_str = share_mode_str(NULL, 0, &e);
+ char *sm_str = share_mode_str(NULL, 0, &e.id, &e);
if (!sm_str) {
smb_panic("talloc failed");
}
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 5817bdbe9ae..57497bcbcd6 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1566,8 +1566,9 @@ static void validate_my_share_entries(struct smbd_server_connection *sconn,
fsp = file_find_dif(sconn, share_entry->id,
share_entry->share_file_id);
if (!fsp) {
- DEBUG(0,("validate_my_share_entries: PANIC : %s\n",
- share_mode_str(talloc_tos(), num, share_entry) ));
+ DBG_ERR("PANIC : %s\n",
+ share_mode_str(talloc_tos(), num, &share_entry->id,
+ share_entry));
smb_panic("validate_my_share_entries: Cannot match a "
"share entry with an open file\n");
}
@@ -1581,8 +1582,9 @@ static void validate_my_share_entries(struct smbd_server_connection *sconn,
panic:
{
char *str;
- DEBUG(0,("validate_my_share_entries: PANIC : %s\n",
- share_mode_str(talloc_tos(), num, share_entry) ));
+ DBG_ERR("validate_my_share_entries: PANIC : %s\n",
+ share_mode_str(talloc_tos(), num, &share_entry->id,
+ share_entry));
str = talloc_asprintf(talloc_tos(),
"validate_my_share_entries: "
"file %s, oplock_type = 0x%x, op_type = 0x%x\n",