diff options
author | Christof Schmitt <christof.schmitt@us.ibm.com> | 2013-08-29 19:36:00 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2013-09-10 22:38:50 +0200 |
commit | c8c0632c871e838fc4465b2a69b4e059e9a126c0 (patch) | |
tree | 05f294c36a8c2c07268b5ab25cf9bb28bc683c3b /source3/smbd | |
parent | 6bd5fef77dc89e925c65af8788528b226edf4fb7 (diff) | |
download | samba-c8c0632c871e838fc4465b2a69b4e059e9a126c0.tar.gz samba-c8c0632c871e838fc4465b2a69b4e059e9a126c0.tar.bz2 samba-c8c0632c871e838fc4465b2a69b4e059e9a126c0.zip |
s3:smb2_find: Return that timestamps do not exist as directories
When a Windows client receives a large directory listing while
querying snapshots, it sends a find request asking for the
timestamp as a directory. A Windows server returns NO_SUCH_FILE,
so make sure Samba returns the same. Otherwise the client will
get confused and display timestamps in the 'previous versions' dialog.
Signed-off-by: Christof Schmitt <christof.schmitt@us.ibm.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Sep 10 22:38:51 CEST 2013 on sn-devel-104
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/smb2_find.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/smbd/smb2_find.c b/source3/smbd/smb2_find.c index c2c0559371..c39a35d526 100644 --- a/source3/smbd/smb2_find.c +++ b/source3/smbd/smb2_find.c @@ -224,6 +224,8 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx, uint32_t dirtype = FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_DIRECTORY; bool dont_descend = false; bool ask_sharemode = true; + struct tm tm; + char *p; req = tevent_req_create(mem_ctx, &state, struct smbd_smb2_find_state); @@ -259,6 +261,17 @@ static struct tevent_req *smbd_smb2_find_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } + p = strptime(in_file_name, GMT_FORMAT, &tm); + if ((p != NULL) && (*p =='\0')) { + /* + * Bogus find that asks for a shadow copy timestamp as a + * directory. The correct response is that it does not exist as + * a directory. + */ + tevent_req_nterror(req, NT_STATUS_NO_SUCH_FILE); + return tevent_req_post(req, ev); + } + if (in_output_buffer_length > smb2req->sconn->smb2.max_trans) { DEBUG(2,("smbd_smb2_find_send: " "client ignored max trans:%s: 0x%08X: 0x%08X\n", |