summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnas Nashif <nashif@intel.com>2007-05-13 04:45:09 +0000
committerAnas Nashif <nashif@intel.com>2007-05-13 04:45:09 +0000
commit4331107410d9546764581ffb02b5bb8956b2451b (patch)
tree67844f02594a5a332e26a3ddc4c4796650f77560 /src
parent87721e46f7143e0020ec3abd2a9cbdf63c696394 (diff)
downloadwsmancli-4331107410d9546764581ffb02b5bb8956b2451b.tar.gz
wsmancli-4331107410d9546764581ffb02b5bb8956b2451b.tar.xz
wsmancli-4331107410d9546764581ffb02b5bb8956b2451b.zip
fix resource uri and filter parsing for assoc. and references
Diffstat (limited to 'src')
-rw-r--r--src/wsman-client-options.c37
-rw-r--r--src/wsman.c11
2 files changed, 20 insertions, 28 deletions
diff --git a/src/wsman-client-options.c b/src/wsman-client-options.c
index efa355b..9547170 100644
--- a/src/wsman-client-options.c
+++ b/src/wsman-client-options.c
@@ -70,7 +70,8 @@ static char *server = "localhost";
static char *agent = NULL;
static char *url_path = NULL;
static char *authentication_method = NULL;
-static char no_verify_peer = 0;
+static char verify_peer = 1;
+static char verify_host = 1;
static int transport_timeout = 0;
static char *proxy = NULL;
static char *proxy_upwd = NULL;
@@ -162,8 +163,10 @@ char wsman_parse_options(int argc, char **argv)
"Alternate configuration file", "<file>"},
{"out-file", 'O', U_OPTION_ARG_STRING, &output_file,
"Write output to file", "<file>"},
- {"noverifypeer", 'V', U_OPTION_ARG_NONE, &no_verify_peer,
+ {"noverifypeer", 'V', U_OPTION_ARG_NONE, &verify_peer,
"Not to verify peer certificate", NULL},
+ {"noverifyhost", 'v', U_OPTION_ARG_NONE, &verify_host,
+ "Not to verify hostname", NULL},
{"transport-timeout", 'I', U_OPTION_ARG_INT, &transport_timeout,
"Transport timeout in seconds", "<time in sec>"},
{NULL}
@@ -318,28 +321,6 @@ int wsman_read_client_config(dictionary * ini)
}
return 1;
}
-#if 0
-void wsman_setup_transport_and_library_options()
-{
- // transport options
- wsman_transport_set_auth_method(cl, authentication_method);
- if (proxy) {
- wsman_transport_set_proxy(proxy);
- if (proxy_upwd) {
- wsman_transport_set_proxyauth(proxy_upwd);
- }
- }
- if (cafile) {
- wsman_transport_set_cafile(cafile);
- }
- wsman_transport_set_no_verify_peer(no_verify_peer);
- wsman_transport_set_timeout(transport_timeout);
-
- // library options
- wsman_debug_set_level(debug_level);
-}
-#endif
-
const char **wsman_options_get_argv(void)
{
@@ -521,9 +502,13 @@ char *wsman_options_get_proxy_upwd(void)
{
return proxy_upwd;
}
-char wsman_options_get_no_verify_peer(void)
+char wsman_options_get_verify_peer(void)
+{
+ return verify_peer;
+}
+char wsman_options_get_verify_host(void)
{
- return no_verify_peer;
+ return verify_host;
}
int wsman_options_get_debug_level(void)
{
diff --git a/src/wsman.c b/src/wsman.c
index 193b597..145ddf7 100644
--- a/src/wsman.c
+++ b/src/wsman.c
@@ -156,7 +156,8 @@ int main(int argc, char **argv)
if (wsman_options_get_cafile()) {
wsman_transport_set_cafile(cl, wsman_options_get_cafile());
}
- wsman_transport_set_no_verify_peer(cl, wsman_options_get_no_verify_peer());
+ wsman_transport_set_verify_peer(cl, wsman_options_get_verify_peer());
+ wsman_transport_set_verify_host(cl, wsman_options_get_verify_host());
wsman_transport_set_timeout(cl, wsman_options_get_transport_timeout());
// library options
@@ -165,11 +166,15 @@ int main(int argc, char **argv)
* Setup Resource URI and Selectors
*/
resource_uri_with_selectors = wsman_options_get_resource_uri();
- if (resource_uri_with_selectors) {
+ if (resource_uri_with_selectors &&
+ strcmp(resource_uri_with_selectors,CIM_ALL_AVAILABLE_CLASSES) != 0) {
wsman_set_options_from_uri(resource_uri_with_selectors,
options);
wsman_remove_query_string(resource_uri_with_selectors,
&resource_uri);
+ } else {
+ wsman_remove_query_string(resource_uri_with_selectors,
+ &resource_uri);
}
op = wsman_options_get_action();
@@ -329,10 +334,12 @@ int main(int argc, char **argv)
if (wsman_options_get_cim_ref()) {
wsman_set_action_option(options,
FLAG_CIM_REFERENCES);
+ options->dialect = WSM_ASSOCIATION_FILTER_DIALECT;
}
if (wsman_options_get_cim_assoc()) {
wsman_set_action_option(options,
FLAG_CIM_ASSOCIATORS);
+ options->dialect = WSM_ASSOCIATION_FILTER_DIALECT;
}
if (wsman_options_get_optimize_enum()) {
wsman_set_action_option(options,