summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-07-13 12:08:20 +0200
committerStefan Metzmacher <metze@samba.org>2009-07-15 11:56:18 +0200
commitd85cc986b85d3c8a6e40491f216c801a1cbde2ab (patch)
tree35bfb8fb2483dd612efe661750bafe751fcbec8e /source3
parent9df1c8f2ad25a1875f2ca98df8c600aecf058144 (diff)
downloadsamba-d85cc986b85d3c8a6e40491f216c801a1cbde2ab.tar.gz
samba-d85cc986b85d3c8a6e40491f216c801a1cbde2ab.tar.bz2
samba-d85cc986b85d3c8a6e40491f216c801a1cbde2ab.zip
s3:smbd: implement SMB2 GetInfo with Fs*Information
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/smb2_getinfo.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/source3/smbd/smb2_getinfo.c b/source3/smbd/smb2_getinfo.c
index cba6da45ce..f8c2d41e31 100644
--- a/source3/smbd/smb2_getinfo.c
+++ b/source3/smbd/smb2_getinfo.c
@@ -370,6 +370,53 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx,
break;
}
+ case 0x02:/* SMB2_GETINFO_FS */
+ {
+ uint16_t file_info_level;
+ char *data = NULL;
+ int data_size = 0;
+ NTSTATUS status;
+ SMB_STRUCT_STAT st;
+
+ /* the levels directly map to the passthru levels */
+ file_info_level = in_file_info_class + 1000;
+
+ if (vfs_stat_smb_fname(conn,".",&st)!=0) {
+ DEBUG(2,("call_trans2qfsinfo: stat of . failed (%s)\n",
+ strerror(errno)));
+ status = map_nt_error_from_unix(errno);
+ tevent_req_nterror(req, status);
+ return tevent_req_post(req, ev);
+ }
+
+ status = smbd_do_qfsinfo(conn, state,
+ file_info_level,
+ st,
+ STR_UNICODE,
+ in_output_buffer_length,
+ &data,
+ &data_size);
+ if (!NT_STATUS_IS_OK(status)) {
+ SAFE_FREE(data);
+ if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_LEVEL)) {
+ status = NT_STATUS_INVALID_INFO_CLASS;
+ }
+ tevent_req_nterror(req, status);
+ return tevent_req_post(req, ev);
+ }
+ if (data_size > 0) {
+ state->out_output_buffer = data_blob_talloc(state,
+ data,
+ data_size);
+ SAFE_FREE(data);
+ if (tevent_req_nomem(state->out_output_buffer.data, req)) {
+ return tevent_req_post(req, ev);
+ }
+ }
+ SAFE_FREE(data);
+ break;
+ }
+
default:
tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
return tevent_req_post(req, ev);