2 Unix SMB/CIFS implementation.
4 POSIX NTVFS backend - open and close
6 Copyright (C) Andrew Tridgell 2004
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "vfs_posix.h"
24 #include "../libcli/smb/smb_constants.h"
29 static NTSTATUS
pvfs_ioctl_old(struct ntvfs_module_context
*ntvfs
,
30 struct ntvfs_request
*req
, union smb_ioctl
*io
)
32 return NT_STATUS_DOS(ERRSRV
, ERRerror
);
38 static NTSTATUS
pvfs_ntioctl(struct ntvfs_module_context
*ntvfs
,
39 struct ntvfs_request
*req
, union smb_ioctl
*io
)
41 struct pvfs_state
*pvfs
= talloc_get_type(ntvfs
->private_data
,
45 f
= pvfs_find_fd(pvfs
, req
, io
->ntioctl
.in
.file
.ntvfs
);
47 return NT_STATUS_INVALID_HANDLE
;
50 switch (io
->ntioctl
.in
.function
) {
51 case FSCTL_SET_SPARSE
:
52 /* maybe some posix systems have a way of marking
54 io
->ntioctl
.out
.blob
= data_blob(NULL
, 0);
58 return NT_STATUS_NOT_SUPPORTED
;
64 NTSTATUS
pvfs_ioctl(struct ntvfs_module_context
*ntvfs
,
65 struct ntvfs_request
*req
,
68 switch (io
->generic
.level
) {
70 return pvfs_ioctl_old(ntvfs
, req
, io
);
72 case RAW_IOCTL_NTIOCTL
:
73 return pvfs_ntioctl(ntvfs
, req
, io
);
76 case RAW_IOCTL_SMB2_NO_HANDLE
:
77 /* see WSPP SMB2 test 46 */
78 return NT_STATUS_INVALID_DEVICE_REQUEST
;
81 return NT_STATUS_INVALID_LEVEL
;