diff --git a/source3/include/proto.h b/source3/include/proto.h index cf508e33981..372ed16fd51 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -3072,6 +3072,7 @@ bool rename_share_filename(struct messaging_context *msg_ctx, uint32_t new_name_hash, const struct smb_filename *smb_fname); void get_file_infos(struct file_id id, + uint32_t name_hash, bool *delete_on_close, struct timespec *write_time); bool is_valid_share_mode_entry(const struct share_mode_entry *e); diff --git a/source3/locking/locking.c b/source3/locking/locking.c index a65fcbdba88..0d7d4eecf60 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -1051,6 +1051,7 @@ bool rename_share_filename(struct messaging_context *msg_ctx, } void get_file_infos(struct file_id id, + uint32_t name_hash, bool *delete_on_close, struct timespec *write_time) { diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index b49b89396c0..7c9d6e262e0 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -981,7 +981,7 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, fileid = vfs_file_id_from_sbuf(conn, &smb_fname.st); - get_file_infos(fileid, NULL, &write_time_ts); + get_file_infos(fileid, 0, NULL, &write_time_ts); if (!null_timespec(write_time_ts)) { update_stat_ex_mtime(&smb_fname.st, write_time_ts); diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index bd783232f68..1194660565a 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -859,6 +859,7 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx, bool delete_pending; get_file_infos(vfs_file_id_from_sbuf(conn, &smb_fname->st), + 0, &delete_pending, NULL); if (delete_pending) { status = NT_STATUS_DELETE_PENDING; diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 9d6a892ad6b..b63f37f0fd3 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -654,7 +654,7 @@ void reply_ntcreate_and_X(struct smb_request *req) /* Deal with other possible opens having a modified write time. JRA. */ ZERO_STRUCT(write_time_ts); - get_file_infos(fsp->file_id, NULL, &write_time_ts); + get_file_infos(fsp->file_id, 0, NULL, &write_time_ts); if (!null_timespec(write_time_ts)) { update_stat_ex_mtime(&smb_fname->st, write_time_ts); } @@ -1232,7 +1232,7 @@ static void call_nt_transact_create(connection_struct *conn, /* Deal with other possible opens having a modified write time. JRA. */ ZERO_STRUCT(write_time_ts); - get_file_infos(fsp->file_id, NULL, &write_time_ts); + get_file_infos(fsp->file_id, 0, NULL, &write_time_ts); if (!null_timespec(write_time_ts)) { update_stat_ex_mtime(&smb_fname->st, write_time_ts); } diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 92be257029d..4d3be85a85f 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1141,7 +1141,7 @@ void reply_getatr(struct smb_request *req) ZERO_STRUCT(write_time_ts); fileid = vfs_file_id_from_sbuf(conn, &smb_fname->st); - get_file_infos(fileid, NULL, &write_time_ts); + get_file_infos(fileid, 0, NULL, &write_time_ts); if (!null_timespec(write_time_ts)) { update_stat_ex_mtime(&smb_fname->st, write_time_ts); } @@ -1803,7 +1803,7 @@ void reply_open(struct smb_request *req) struct timespec write_time_ts; ZERO_STRUCT(write_time_ts); - get_file_infos(fsp->file_id, NULL, &write_time_ts); + get_file_infos(fsp->file_id, 0, NULL, &write_time_ts); if (!null_timespec(write_time_ts)) { update_stat_ex_mtime(&smb_fname->st, write_time_ts); } diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 71e97a4040c..b191b74fccc 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -797,7 +797,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, /* Deal with other possible opens having a modified write time. JRA. */ ZERO_STRUCT(write_time_ts); - get_file_infos(result->file_id, NULL, &write_time_ts); + get_file_infos(result->file_id, 0, NULL, &write_time_ts); if (!null_timespec(write_time_ts)) { update_stat_ex_mtime(&result->fsp_name->st, write_time_ts); } diff --git a/source3/smbd/smb2_getinfo.c b/source3/smbd/smb2_getinfo.c index 09234cd1295..0ff659346ed 100644 --- a/source3/smbd/smb2_getinfo.c +++ b/source3/smbd/smb2_getinfo.c @@ -320,7 +320,7 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx, fileid = vfs_file_id_from_sbuf(conn, &fsp->fsp_name->st); - get_file_infos(fileid, &delete_pending, &write_time_ts); + get_file_infos(fileid, 0, &delete_pending, &write_time_ts); } else { /* * Original code - this is an open file. @@ -336,7 +336,7 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx, } fileid = vfs_file_id_from_sbuf(conn, &fsp->fsp_name->st); - get_file_infos(fileid, &delete_pending, &write_time_ts); + get_file_infos(fileid, 0, &delete_pending, &write_time_ts); } status = smbd_do_qfilepathinfo(conn, state, diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 90a878d17e9..60664fd2295 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -5103,7 +5103,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn, } fileid = vfs_file_id_from_sbuf(conn, &smb_fname->st); - get_file_infos(fileid, &delete_pending, &write_time_ts); + get_file_infos(fileid, 0, &delete_pending, &write_time_ts); } else { /* * Original code - this is an open file. @@ -5120,7 +5120,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn, return; } fileid = vfs_file_id_from_sbuf(conn, &smb_fname->st); - get_file_infos(fileid, &delete_pending, &write_time_ts); + get_file_infos(fileid, 0, &delete_pending, &write_time_ts); } } else { @@ -5213,7 +5213,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn, fileid = vfs_file_id_from_sbuf(conn, &smb_fname_base->st); TALLOC_FREE(smb_fname_base); - get_file_infos(fileid, &delete_pending, NULL); + get_file_infos(fileid, 0, &delete_pending, NULL); if (delete_pending) { reply_nterror(req, NT_STATUS_DELETE_PENDING); return; @@ -5245,7 +5245,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn, } fileid = vfs_file_id_from_sbuf(conn, &smb_fname->st); - get_file_infos(fileid, &delete_pending, &write_time_ts); + get_file_infos(fileid, 0, &delete_pending, &write_time_ts); if (delete_pending) { reply_nterror(req, NT_STATUS_DELETE_PENDING); return;