diff options
author | Noel Power <noel.power@suse.com> | 2014-03-24 11:52:48 +0000 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2014-04-02 20:25:07 +0200 |
commit | 57a4319baaee011f2604eadeac655ff1c84d4312 (patch) | |
tree | 63dc75cf299e010e334214a6adcbc60a720ae227 | |
parent | 027afd11ca404f24726013d0f9805f42b14e59d7 (diff) | |
download | samba-57a4319baaee011f2604eadeac655ff1c84d4312.tar.gz samba-57a4319baaee011f2604eadeac655ff1c84d4312.tar.xz samba-57a4319baaee011f2604eadeac655ff1c84d4312.zip |
Allow FSRVP access generic HRESULT error message descriptions
FSRVP can possibly return any HRESULT error in addition to it's own
specific errors. This change searches the HRESULT errors for a description
if the error doesn't match any of the known FSRVP ones.
Also removed some errors defined in fsrvp.idl (now that they are defined
in hresult.h)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | librpc/idl/fsrvp.idl | 6 | ||||
-rw-r--r-- | source3/rpcclient/cmd_fss.c | 8 | ||||
-rw-r--r-- | source4/torture/rpc/fsrvp.c | 5 |
3 files changed, 11 insertions, 8 deletions
diff --git a/librpc/idl/fsrvp.idl b/librpc/idl/fsrvp.idl index 3a11b87fdc..2adff15f32 100644 --- a/librpc/idl/fsrvp.idl +++ b/librpc/idl/fsrvp.idl @@ -22,12 +22,6 @@ import "misc.idl"; const uint32 FSRVP_E_OBJECT_NOT_FOUND = 0x80042308; const uint32 FSRVP_E_UNSUPPORTED_CONTEXT = 0x8004231B; const uint32 FSRVP_E_BAD_ID = 0x80042302; /* wire, not documented */ - - /* TODO move these to generic herror defines or COM in orpc.idl */ - const uint32 E_ACCESSDENIED = 0x80070005; - const uint32 E_INVALIDARG = 0x80070057; - const uint32 E_OUTOFMEMORY = 0x80000002; - typedef struct { GUID ShadowCopySetId; GUID ShadowCopyId; diff --git a/source3/rpcclient/cmd_fss.c b/source3/rpcclient/cmd_fss.c index 945f4d994e..54fade7ee1 100644 --- a/source3/rpcclient/cmd_fss.c +++ b/source3/rpcclient/cmd_fss.c @@ -23,6 +23,7 @@ #include "rpcclient.h" #include "../librpc/gen_ndr/ndr_fsrvp.h" #include "../librpc/gen_ndr/ndr_fsrvp_c.h" +#include "../libcli/util/hresult.h" static const struct { uint32_t error_code; @@ -100,6 +101,13 @@ static const char *get_error_str(uint32_t code) break; } } + /* error isn't specific fsrvp one, check hresult errors */ + if (result == default_err) { + const char *hres_err = hresult_errstr_const(HRES_ERROR(code)); + if (hres_err) { + result = hres_err; + } + } return result; }; diff --git a/source4/torture/rpc/fsrvp.c b/source4/torture/rpc/fsrvp.c index 3a98837db2..4a55d28963 100644 --- a/source4/torture/rpc/fsrvp.c +++ b/source4/torture/rpc/fsrvp.c @@ -36,6 +36,7 @@ #include "libcli/smb2/smb2_calls.h" #include "libcli/smb_composite/smb_composite.h" #include "libcli/resolve/resolve.h" +#include "libcli/util/hresult.h" #include "torture/torture.h" #include "torture/smb2/proto.h" #include "torture/rpc/torture_rpc.h" @@ -384,7 +385,7 @@ static bool test_fsrvp_sc_set_abort(struct torture_context *tctx, "following abort"); /* * XXX Windows 8 server beta returns FSRVP_E_BAD_STATE here rather than - * FSRVP_E_BAD_ID / E_INVALIDARG. + * FSRVP_E_BAD_ID / HRES_E_INVALIDARG. */ torture_assert(tctx, (r_scset_add.out.result != 0), "incorrect AddToShadowCopySet response following abort"); @@ -425,7 +426,7 @@ static bool test_fsrvp_bad_id(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "DeleteShareMapping failed"); torture_assert_int_equal(tctx, r_sharemap_del.out.result, - E_INVALIDARG, + HRES_ERROR_V(HRES_E_INVALIDARG), "incorrect DeleteShareMapping response"); torture_assert(tctx, test_fsrvp_sc_delete(tctx, p, sc_map), "sc del"); |