summaryrefslogtreecommitdiffstats
path: root/source3/modules
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2014-02-27 19:46:14 +0100
committerJeremy Allison <jra@samba.org>2014-02-27 22:42:50 +0100
commitca3998d0436747f637b04eb32eb6c17fce3e2159 (patch)
tree1755d9cd6417c7007b08ab99d8bd770510ed008b /source3/modules
parentabf08ed544ce05ea5a6e6ea2e531b6a2d97e15cc (diff)
downloadsamba-ca3998d0436747f637b04eb32eb6c17fce3e2159.tar.gz
samba-ca3998d0436747f637b04eb32eb6c17fce3e2159.tar.xz
samba-ca3998d0436747f637b04eb32eb6c17fce3e2159.zip
vfs: propagate snapshot enumeration errors
The current FSCTL_GET_SHADOW_COPY_DATA/FSCTL_SRV_ENUMERATE_SNAPSHOTS handler squashes all non-ENOSYS errors into an NT_STATUS_UNSUCCESSFUL response. This commit ensures that all errors are propagated up to the client, to aid debugging. The Windows Explorer "Previous Versions" dialogue doesn't appear to distinguish between error codes. It displays "There are no previous versions available". Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Feb 27 22:42:50 CET 2014 on sn-devel-104
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_default.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 81a0b1bb6d..7dd9c0ca3e 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -1021,12 +1021,12 @@ static NTSTATUS vfswrap_fsctl(struct vfs_handle_struct *handle,
{
const char *in_data = (const char *)_in_data;
char **out_data = (char **)_out_data;
+ NTSTATUS status;
switch (function) {
case FSCTL_SET_SPARSE:
{
bool set_sparse = true;
- NTSTATUS status;
if (in_len >= 1 && in_data[0] == 0) {
set_sparse = false;
@@ -1125,16 +1125,23 @@ static NTSTATUS vfswrap_fsctl(struct vfs_handle_struct *handle,
* Call the VFS routine to actually do the work.
*/
if (SMB_VFS_GET_SHADOW_COPY_DATA(fsp, shadow_data, labels)!=0) {
- TALLOC_FREE(shadow_data);
- if (errno == ENOSYS) {
- DEBUG(5,("FSCTL_GET_SHADOW_COPY_DATA: connectpath %s, not supported.\n",
- fsp->conn->connectpath));
- return NT_STATUS_NOT_SUPPORTED;
+ int log_lev = 0;
+ if (errno == 0) {
+ /* broken module didn't set errno on error */
+ status = NT_STATUS_UNSUCCESSFUL;
} else {
- DEBUG(0,("FSCTL_GET_SHADOW_COPY_DATA: connectpath %s, failed.\n",
- fsp->conn->connectpath));
- return NT_STATUS_UNSUCCESSFUL;
+ status = map_nt_error_from_unix(errno);
+ if (NT_STATUS_EQUAL(status,
+ NT_STATUS_NOT_SUPPORTED)) {
+ log_lev = 5;
+ }
}
+ DEBUG(log_lev, ("FSCTL_GET_SHADOW_COPY_DATA: "
+ "connectpath %s, failed - %s.\n",
+ fsp->conn->connectpath,
+ nt_errstr(status)));
+ TALLOC_FREE(shadow_data);
+ return status;
}
labels_data_count = (shadow_data->num_volumes * 2 *
@@ -1262,7 +1269,6 @@ static NTSTATUS vfswrap_fsctl(struct vfs_handle_struct *handle,
* and SEEK_DATA/SEEK_HOLE on Solaris is needed to make
* this FSCTL correct for sparse files.
*/
- NTSTATUS status;
uint64_t offset, length;
char *out_data_tmp = NULL;