From 260bc987b00b3fff6c9b99211627b14e9bd0789a Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Wed, 8 Jun 2011 19:00:18 +0200 Subject: s4:ntvfs subsystem - quiet enum warnings Simply return "NT_STATUS_INVALID_LEVEL" for unknown types of requests. Reviewed-by: Tridge --- source4/ntvfs/ntvfs_generic.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'source4/ntvfs/ntvfs_generic.c') diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index 8e1eb0bc66..9aa8e04787 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -576,9 +576,6 @@ static NTSTATUS ntvfs_map_fsinfo_finish(struct ntvfs_module_context *ntvfs, /* and convert it to the required level */ switch (fs->generic.level) { - case RAW_QFS_GENERIC: - return NT_STATUS_INVALID_LEVEL; - case RAW_QFS_DSKATTR: { /* map from generic to DSKATTR */ unsigned int bpunit = 64; @@ -666,10 +663,10 @@ static NTSTATUS ntvfs_map_fsinfo_finish(struct ntvfs_module_context *ntvfs, fs->objectid_information.out.guid = fs2->generic.out.guid; ZERO_STRUCT(fs->objectid_information.out.unknown); return NT_STATUS_OK; - } - - return NT_STATUS_INVALID_LEVEL; + default: + return NT_STATUS_INVALID_LEVEL; + } } /* @@ -715,8 +712,6 @@ NTSTATUS ntvfs_map_fileinfo(TALLOC_CTX *mem_ctx, int i; /* and convert it to the required level using results in info2 */ switch (info->generic.level) { - case RAW_FILEINFO_GENERIC: - return NT_STATUS_INVALID_LEVEL; case RAW_FILEINFO_GETATTR: info->getattr.out.attrib = info2->generic.out.attrib & 0xff; info->getattr.out.size = info2->generic.out.size; @@ -931,9 +926,9 @@ NTSTATUS ntvfs_map_fileinfo(TALLOC_CTX *mem_ctx, info->unix_link_info.out.link_dest = info2->generic.out.link_dest; return NT_STATUS_OK; #endif + default: + return NT_STATUS_INVALID_LEVEL; } - - return NT_STATUS_INVALID_LEVEL; } /* -- cgit From 75e77f9fa023d81a57e7913bcbd712eae7a677b1 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Thu, 16 Jun 2011 08:39:03 +0200 Subject: s4:ntvfs subsystems - rework it using concrete enum values This changes commit 260bc987b00b3fff6c9b99211627b14e9bd0789a to comply with metze's plans. --- source4/ntvfs/ntvfs_generic.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source4/ntvfs/ntvfs_generic.c') diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index 9aa8e04787..bed9c9c755 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -664,9 +664,12 @@ static NTSTATUS ntvfs_map_fsinfo_finish(struct ntvfs_module_context *ntvfs, ZERO_STRUCT(fs->objectid_information.out.unknown); return NT_STATUS_OK; - default: + case RAW_QFS_GENERIC: + case RAW_QFS_UNIX_INFO: return NT_STATUS_INVALID_LEVEL; } + + return NT_STATUS_INVALID_LEVEL; } /* @@ -926,9 +929,16 @@ NTSTATUS ntvfs_map_fileinfo(TALLOC_CTX *mem_ctx, info->unix_link_info.out.link_dest = info2->generic.out.link_dest; return NT_STATUS_OK; #endif - default: + case RAW_FILEINFO_GENERIC: + case RAW_FILEINFO_SEC_DESC: + case RAW_FILEINFO_EA_LIST: + case RAW_FILEINFO_UNIX_INFO2: + case RAW_FILEINFO_SMB2_ALL_EAS: + case RAW_FILEINFO_SMB2_ALL_INFORMATION: return NT_STATUS_INVALID_LEVEL; } + + return NT_STATUS_INVALID_LEVEL; } /* -- cgit