summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2018-11-24 10:54:06 +0100
committerRalph Boehme <slow@samba.org>2018-11-27 07:13:13 +0100
commit9c462e1b324ebad60c51bd6e8e659b39a31ec02e (patch)
treeb9f220daf3840901627af3b9dad92461984adf16 /source3
parent14b6e6842b76d7c3e53249ba026a3ff51615ebd7 (diff)
downloadsamba-9c462e1b324ebad60c51bd6e8e659b39a31ec02e.tar.gz
s3:smbd: pass down twrp from SMB2_CREATE to filename_convert()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/smb2_create.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
index ac9235c6611..fdd04ac0331 100644
--- a/source3/smbd/smb2_create.c
+++ b/source3/smbd/smb2_create.c
@@ -476,6 +476,8 @@ struct smbd_smb2_create_state {
ssize_t lease_len;
bool need_replay_cache;
struct smbXsrv_open *op;
+ time_t twrp_time;
+ time_t *twrp_timep;
struct smb2_create_blob *dhnc;
struct smb2_create_blob *dh2c;
@@ -891,7 +893,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
smb1req->conn,
state->fname,
ucf_flags,
- NULL,
+ state->twrp_timep,
NULL, /* ppath_contains_wcards */
&smb_fname);
if (!NT_STATUS_IS_OK(status)) {
@@ -1179,9 +1181,6 @@ static void smbd_smb2_create_before_exec(struct tevent_req *req)
if (state->twrp != NULL) {
NTTIME nttime;
- time_t t;
- struct tm *tm;
- char *tmpname = state->fname;
if (state->twrp->data.length != 8) {
tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
@@ -1189,27 +1188,9 @@ static void smbd_smb2_create_before_exec(struct tevent_req *req)
}
nttime = BVAL(state->twrp->data.data, 0);
- t = nt_time_to_unix(nttime);
- tm = gmtime(&t);
+ state->twrp_time = nt_time_to_unix(nttime);
+ state->twrp_timep = &state->twrp_time;
- state->fname = talloc_asprintf(
- state,
- "%s\\@GMT-%04u.%02u.%02u-%02u.%02u.%02u",
- state->fname,
- tm->tm_year + 1900,
- tm->tm_mon + 1,
- tm->tm_mday,
- tm->tm_hour,
- tm->tm_min,
- tm->tm_sec);
- if (tevent_req_nomem(state->fname, req)) {
- return;
- }
- TALLOC_FREE(tmpname);
- /*
- * Tell filename_create_ucf_flags() this
- * is an @GMT path.
- */
smb1req->flags2 |= FLAGS2_REPARSE_PATH;
}