From: Jeremy Allison Date: Wed, 5 May 2010 16:50:48 +0000 (-0700) Subject: Return correct error on read request on directory. X-Git-Tag: samba-3.6.0pre1~2206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8ba02b73d53863d604ccbe0a4391d7b38590c1c;p=thirdparty%2Fsamba.git Return correct error on read request on directory. Jeremy. --- diff --git a/source3/smbd/smb2_read.c b/source3/smbd/smb2_read.c index a428c26ea26..2f36804bf6a 100644 --- a/source3/smbd/smb2_read.c +++ b/source3/smbd/smb2_read.c @@ -224,6 +224,10 @@ static struct tevent_req *smbd_smb2_read_send(TALLOC_CTX *mem_ctx, tevent_req_nterror(req, NT_STATUS_FILE_CLOSED); return tevent_req_post(req, ev); } + if (fsp->is_directory) { + tevent_req_nterror(req, NT_STATUS_INVALID_DEVICE_REQUEST); + return tevent_req_post(req, ev); + } state->out_data = data_blob_talloc(state, NULL, in_length); if (in_length > 0 && tevent_req_nomem(state->out_data.data, req)) {