From 45fa4228ee3716963ecdbd96478a8651357fb7a2 Mon Sep 17 00:00:00 2001 From: Vitezslav Crhonek Date: Tue, 9 Mar 2021 13:27:38 +0100 Subject: [PATCH 01/17] Rebuild because of soname change in openswman --- wsmancli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wsmancli.spec b/wsmancli.spec index 6d7b3bf..265644b 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.6.0 -Release: 13%{?dist} +Release: 14%{?dist} License: BSD Url: http://www.openwsman.org/ # You can get this tarball here: @@ -41,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Tue Mar 09 2021 Vitezslav Crhonek - 2.6.0-14 +- Rebuild because of soname change in openswman + * Wed Jan 27 2021 Fedora Release Engineering - 2.6.0-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 466e57a22688df4ad0db5cb468b0a41c84147d6f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 21:11:17 +0000 Subject: [PATCH 02/17] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- wsmancli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wsmancli.spec b/wsmancli.spec index 265644b..fefe452 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.6.0 -Release: 14%{?dist} +Release: 15%{?dist} License: BSD Url: http://www.openwsman.org/ # You can get this tarball here: @@ -41,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Fri Jul 23 2021 Fedora Release Engineering - 2.6.0-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Tue Mar 09 2021 Vitezslav Crhonek - 2.6.0-14 - Rebuild because of soname change in openswman From 1d912debe3d899489b6fb6361390ef75aac03be6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jan 2022 04:42:55 +0000 Subject: [PATCH 03/17] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- wsmancli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wsmancli.spec b/wsmancli.spec index fefe452..2baa5f9 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.6.0 -Release: 15%{?dist} +Release: 16%{?dist} License: BSD Url: http://www.openwsman.org/ # You can get this tarball here: @@ -41,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Sat Jan 22 2022 Fedora Release Engineering - 2.6.0-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Fri Jul 23 2021 Fedora Release Engineering - 2.6.0-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From fe5514576b0aafffc5bac3abab5fbde0c42520bc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 23 Jul 2022 12:40:52 +0000 Subject: [PATCH 04/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- wsmancli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wsmancli.spec b/wsmancli.spec index 2baa5f9..3f430a2 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.6.0 -Release: 16%{?dist} +Release: 17%{?dist} License: BSD Url: http://www.openwsman.org/ # You can get this tarball here: @@ -41,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Sat Jul 23 2022 Fedora Release Engineering - 2.6.0-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Sat Jan 22 2022 Fedora Release Engineering - 2.6.0-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From aa5540e0277435883513ff8a19b6aae273ad2c96 Mon Sep 17 00:00:00 2001 From: Vitezslav Crhonek Date: Thu, 8 Sep 2022 10:07:02 +0200 Subject: [PATCH 05/17] Improve handling of HTTP 401 Unauthorized Signed-off-by: Vitezslav Crhonek --- http-unauthorized-improve.patch | 127 ++++++++++++++++++++++++++++++++ wsmancli.spec | 9 ++- 2 files changed, 134 insertions(+), 2 deletions(-) create mode 100644 http-unauthorized-improve.patch diff --git a/http-unauthorized-improve.patch b/http-unauthorized-improve.patch new file mode 100644 index 0000000..1199eb9 --- /dev/null +++ b/http-unauthorized-improve.patch @@ -0,0 +1,127 @@ +diff -up wsmancli-2.6.0/src/wsman.c.orig wsmancli-2.6.0/src/wsman.c +--- wsmancli-2.6.0/src/wsman.c.orig 2015-06-11 10:50:04.000000000 +0200 ++++ wsmancli-2.6.0/src/wsman.c 2022-07-19 09:09:48.518951546 +0200 +@@ -63,7 +63,11 @@ static char *cert = NULL; + static char *sslkey = NULL; + static char *endpoint = NULL; + static char *username = NULL; ++static char *username_given = NULL; /* copy of either the username from env or cmdline*/ ++static char *username_prev = NULL; /* input username to request_usr_pwd() when called last time */ + static char *password = NULL; ++static char *password_given = NULL; /* copy of either the password from env or cmdline */ ++static char *password_prev = NULL; /* input password to request_usr_pwd() when called last time */ + static char *server = "localhost"; + static char *agent = NULL; + static char *url_path = NULL; +@@ -495,28 +499,79 @@ request_usr_pwd( WsManClient *client, ws + char user[21]; + char *p; + +- fprintf(stdout,"Authentication failed, please retry\n"); +- /* +- fprintf(stdout, "%s authentication is used\n", +- wsmc_transport_get_auth_name( auth)); +- */ +- printf("User name: "); +- fflush(stdout); +- if ( (p = fgets(user, 20, stdin) ) != NULL ) +- { +- +- if (strchr(user, '\n')) +- (*(strchr(user, '\n'))) = '\0'; +- *username = u_strdup_printf ("%s", user); +- } else { +- *username = NULL; ++ /* ++ * fprintf(stdout,"Authentication failed, please retry\n"); ++ * ++ * this message shall not be printed by this function as it cannot decide on the ++ * reason it was called for. It does not control the authentication process. ++ * wsmc_handler is better suited for such a decision making. ++ */ ++ ++ if (username_given) { ++ if (password_given) { ++ /* Initially provided combination of password and username is not valid. ++ * Request user to type both. Here I assume, that wsmc_handler called back to ++ * this function after trying a first authentication using these credentials. ++ */ ++ } else { ++ /* Initially no password was provided => no authentication tried during first ++ * iteration of while loop in wsmc_handler. Check previously typed credentials ++ */ ++ if (username_prev) { ++ /* This is a second call of this function, assuming only wsmc_handler is using it ++ * as a callback function. Therefore, there must have been a previous attempt to ++ * authenticate, but this previous combination of username and password did not ++ * lead to a successful authentication. Request new credentials, username_prev will ++ * be set each time after user has provided a username. ++ */ ++ } else { ++ /* First time wsmc_handler calls back to this function. No password given on the ++ * command line or via the environment variable. Therefore wsmc_handler cannot ++ * have tried http authentication. A username was given on the command line or ++ * via an environment variable. And the user wants us to try this name at least ++ * at first. So, let's do him a favour and use it. When we are called back again, ++ * we will ask the user to provide a new name or the same, but a different password. ++ */ ++ *username = u_strdup(username_given); ++ } ++ } ++ } ++ ++ if (*username == NULL) { ++ printf("User name: "); ++ fflush(stdout); ++ if ( (p = fgets(user, 20, stdin) ) != NULL ) ++ { ++ if (strchr(user, '\n')) ++ (*(strchr(user, '\n'))) = '\0'; ++ *username = u_strdup_printf ("%s", user); ++ } else { ++ *username = NULL; ++ } ++ } ++ ++ /* after successfull receipt of a new username, store a copy at username_prev */ ++ if (*username) { ++ if ( username_prev ) { ++ u_free(username_prev); ++ username_prev = NULL; ++ } ++ username_prev = u_strdup(*username); + } + ++ /* but always ask for the password !? */ + pw = (char *)getpass("Password: "); + *password = u_strdup_printf ("%s", pw); +-} +- + ++ /* make backup, *password will become free'd when next try of http-auth fails */ ++ if (*password) { ++ if (password_prev) { ++ u_free(password_prev); ++ password_prev = NULL; ++ } ++ password_prev = u_strdup(*password); ++ } ++} + + static void + wsman_options_set_properties(client_opt_t *options) +@@ -647,6 +702,14 @@ int main(int argc, char **argv) + exit(EXIT_FAILURE); + } + ++ /* save copies of username or password when given on the command line or via environment variables */ ++ if ( username != NULL ) { ++ username_given = u_strdup(username); ++ } ++ if ( password != NULL ) { ++ password_given = u_strdup(password); ++ } ++ + filename = (char *) config_file; + + if (filename) { diff --git a/wsmancli.spec b/wsmancli.spec index 3f430a2..086a7f4 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,10 +1,10 @@ Name: wsmancli Version: 2.6.0 -Release: 17%{?dist} +Release: 18%{?dist} License: BSD Url: http://www.openwsman.org/ # You can get this tarball here: -# https://github.com/Openwsman/wsmancli/archive/v%{version}.tar.gz +# https://github.com/Openwsman/wsmancli/archive/v%%{version}.tar.gz Source: wsmancli-%{version}.tar.gz Source1: COPYING Source2: README @@ -14,6 +14,7 @@ BuildRequires: openwsman-devel >= 2.1.0 pkgconfig curl-devel BuildRequires: autoconf automake libtool Requires: openwsman curl Patch0: missing-pthread-symbols.patch +Patch1: http-unauthorized-improve.patch Summary: WS-Management-Command line Interface %description @@ -23,6 +24,7 @@ systems using Web Services Management protocol. %prep %setup -q %patch0 -p1 +%patch1 -p1 -b .http-unauthorized-improve cp -fp %SOURCE1 %SOURCE2 %SOURCE3 .; %build @@ -41,6 +43,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Thu Sep 08 2022 Vitezslav Crhonek - 2.6.0-18 +- Improve handling of HTTP 401 Unauthorized + * Sat Jul 23 2022 Fedora Release Engineering - 2.6.0-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From 1c753c010f9bff550cf763c8980d94eabc02893f Mon Sep 17 00:00:00 2001 From: Vitezslav Crhonek Date: Tue, 10 Jan 2023 12:46:13 +0100 Subject: [PATCH 06/17] Replace obsolete getpass function --- replace-getpass.patch | 61 +++++++++++++++++++++++++++++++++++++++++++ wsmancli.spec | 7 ++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 replace-getpass.patch diff --git a/replace-getpass.patch b/replace-getpass.patch new file mode 100644 index 0000000..eb25fe3 --- /dev/null +++ b/replace-getpass.patch @@ -0,0 +1,61 @@ +diff -up wsmancli-2.6.0/src/wsman.c.orig wsmancli-2.6.0/src/wsman.c +--- wsmancli-2.6.0/src/wsman.c.orig 2023-01-09 11:46:15.771553135 +0100 ++++ wsmancli-2.6.0/src/wsman.c 2023-01-09 11:54:13.968830290 +0100 +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + + #ifdef HAVE_UNISTD_H + #include +@@ -57,6 +58,8 @@ + extern char *getpass (const char *__prompt); + #endif + ++#define BASE_LEN 21 ++ + static long int server_port = 0; + static char *cainfo = NULL; + static char *cert = NULL; +@@ -498,6 +501,10 @@ request_usr_pwd( WsManClient *client, ws + char *pw; + char user[21]; + char *p; ++ char c; ++ int len = BASE_LEN; ++ int pos = 0; ++ struct termios term; + + /* + * fprintf(stdout,"Authentication failed, please retry\n"); +@@ -560,8 +567,28 @@ request_usr_pwd( WsManClient *client, ws + } + + /* but always ask for the password !? */ +- pw = (char *)getpass("Password: "); ++ /* set no echo */ ++ tcgetattr(1, &term); ++ term.c_lflag &= ~ECHO; ++ tcsetattr(1, TCSANOW, &term); ++ /* get pass */ ++ pw = (char*) u_malloc(sizeof(char) * len); ++ pw[0] = '\0'; ++ printf("Password: "); ++ fflush(stdout); ++ while ((c = fgetc(stdin)) != '\n') { ++ pw[pos++] = (char) c; ++ if (pos >= len) { ++ len += BASE_LEN; ++ pw = realloc(pw, len); ++ } ++ } ++ pw[pos] = '\0'; + *password = u_strdup_printf ("%s", pw); ++ u_free(pw); ++ /* set echo back again */ ++ term.c_lflag |= ECHO; ++ tcsetattr(1, TCSANOW, &term); + + /* make backup, *password will become free'd when next try of http-auth fails */ + if (*password) { diff --git a/wsmancli.spec b/wsmancli.spec index 086a7f4..b057838 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.6.0 -Release: 18%{?dist} +Release: 19%{?dist} License: BSD Url: http://www.openwsman.org/ # You can get this tarball here: @@ -15,6 +15,7 @@ BuildRequires: autoconf automake libtool Requires: openwsman curl Patch0: missing-pthread-symbols.patch Patch1: http-unauthorized-improve.patch +Patch2: replace-getpass.patch Summary: WS-Management-Command line Interface %description @@ -25,6 +26,7 @@ systems using Web Services Management protocol. %setup -q %patch0 -p1 %patch1 -p1 -b .http-unauthorized-improve +%patch2 -p1 -b .replace-getpass cp -fp %SOURCE1 %SOURCE2 %SOURCE3 .; %build @@ -43,6 +45,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Tue Jan 10 2023 Vitezslav Crhonek - 2.6.0-19 +- Replace obsolete getpass function + * Thu Sep 08 2022 Vitezslav Crhonek - 2.6.0-18 - Improve handling of HTTP 401 Unauthorized From 96584a7c2dae748984db213eaebb1c1b4c0143ba Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 21 Jan 2023 07:02:32 +0000 Subject: [PATCH 07/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- wsmancli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wsmancli.spec b/wsmancli.spec index b057838..b467c30 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.6.0 -Release: 19%{?dist} +Release: 20%{?dist} License: BSD Url: http://www.openwsman.org/ # You can get this tarball here: @@ -45,6 +45,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Sat Jan 21 2023 Fedora Release Engineering - 2.6.0-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Tue Jan 10 2023 Vitezslav Crhonek - 2.6.0-19 - Replace obsolete getpass function From bc6857af642fa2d45102259e4de639c873c0d839 Mon Sep 17 00:00:00 2001 From: Vitezslav Crhonek Date: Tue, 25 Apr 2023 12:30:16 +0200 Subject: [PATCH 08/17] SPDX migration --- wsmancli.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wsmancli.spec b/wsmancli.spec index b467c30..ebd3a97 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,7 +1,7 @@ Name: wsmancli Version: 2.6.0 -Release: 20%{?dist} -License: BSD +Release: 21%{?dist} +License: BSD-3-Clause Url: http://www.openwsman.org/ # You can get this tarball here: # https://github.com/Openwsman/wsmancli/archive/v%%{version}.tar.gz @@ -45,6 +45,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Tue Apr 25 2023 Vitezslav Crhonek - 2.6.0-21 +- SPDX migration + * Sat Jan 21 2023 Fedora Release Engineering - 2.6.0-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From cc8bdd321816cac27fcb41662d00a22f15734e67 Mon Sep 17 00:00:00 2001 From: Vitezslav Crhonek Date: Fri, 19 May 2023 08:51:27 +0200 Subject: [PATCH 09/17] Update to wsmancli-2.6.2 --- .gitignore | 8 +- http-unauthorized-improve.patch | 127 -------------------------------- replace-getpass.patch | 61 --------------- sources | 2 +- wsmancli.spec | 13 ++-- 5 files changed, 8 insertions(+), 203 deletions(-) delete mode 100644 http-unauthorized-improve.patch delete mode 100644 replace-getpass.patch diff --git a/.gitignore b/.gitignore index f285c56..fdafa3d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1 @@ -wsmancli-2.2.3.tar.bz2 -/wsmancli-2.2.4.tar.bz2 -/wsmancli-2.2.5.tar.bz2 -/wsmancli-2.2.7.1.tar.bz2 -/wsmancli-2.3.0.tar.bz2 -/v2.3.1.tar.gz -/wsmancli-2.6.0.tar.gz +/wsmancli-2.6.2.tar.gz diff --git a/http-unauthorized-improve.patch b/http-unauthorized-improve.patch deleted file mode 100644 index 1199eb9..0000000 --- a/http-unauthorized-improve.patch +++ /dev/null @@ -1,127 +0,0 @@ -diff -up wsmancli-2.6.0/src/wsman.c.orig wsmancli-2.6.0/src/wsman.c ---- wsmancli-2.6.0/src/wsman.c.orig 2015-06-11 10:50:04.000000000 +0200 -+++ wsmancli-2.6.0/src/wsman.c 2022-07-19 09:09:48.518951546 +0200 -@@ -63,7 +63,11 @@ static char *cert = NULL; - static char *sslkey = NULL; - static char *endpoint = NULL; - static char *username = NULL; -+static char *username_given = NULL; /* copy of either the username from env or cmdline*/ -+static char *username_prev = NULL; /* input username to request_usr_pwd() when called last time */ - static char *password = NULL; -+static char *password_given = NULL; /* copy of either the password from env or cmdline */ -+static char *password_prev = NULL; /* input password to request_usr_pwd() when called last time */ - static char *server = "localhost"; - static char *agent = NULL; - static char *url_path = NULL; -@@ -495,28 +499,79 @@ request_usr_pwd( WsManClient *client, ws - char user[21]; - char *p; - -- fprintf(stdout,"Authentication failed, please retry\n"); -- /* -- fprintf(stdout, "%s authentication is used\n", -- wsmc_transport_get_auth_name( auth)); -- */ -- printf("User name: "); -- fflush(stdout); -- if ( (p = fgets(user, 20, stdin) ) != NULL ) -- { -- -- if (strchr(user, '\n')) -- (*(strchr(user, '\n'))) = '\0'; -- *username = u_strdup_printf ("%s", user); -- } else { -- *username = NULL; -+ /* -+ * fprintf(stdout,"Authentication failed, please retry\n"); -+ * -+ * this message shall not be printed by this function as it cannot decide on the -+ * reason it was called for. It does not control the authentication process. -+ * wsmc_handler is better suited for such a decision making. -+ */ -+ -+ if (username_given) { -+ if (password_given) { -+ /* Initially provided combination of password and username is not valid. -+ * Request user to type both. Here I assume, that wsmc_handler called back to -+ * this function after trying a first authentication using these credentials. -+ */ -+ } else { -+ /* Initially no password was provided => no authentication tried during first -+ * iteration of while loop in wsmc_handler. Check previously typed credentials -+ */ -+ if (username_prev) { -+ /* This is a second call of this function, assuming only wsmc_handler is using it -+ * as a callback function. Therefore, there must have been a previous attempt to -+ * authenticate, but this previous combination of username and password did not -+ * lead to a successful authentication. Request new credentials, username_prev will -+ * be set each time after user has provided a username. -+ */ -+ } else { -+ /* First time wsmc_handler calls back to this function. No password given on the -+ * command line or via the environment variable. Therefore wsmc_handler cannot -+ * have tried http authentication. A username was given on the command line or -+ * via an environment variable. And the user wants us to try this name at least -+ * at first. So, let's do him a favour and use it. When we are called back again, -+ * we will ask the user to provide a new name or the same, but a different password. -+ */ -+ *username = u_strdup(username_given); -+ } -+ } -+ } -+ -+ if (*username == NULL) { -+ printf("User name: "); -+ fflush(stdout); -+ if ( (p = fgets(user, 20, stdin) ) != NULL ) -+ { -+ if (strchr(user, '\n')) -+ (*(strchr(user, '\n'))) = '\0'; -+ *username = u_strdup_printf ("%s", user); -+ } else { -+ *username = NULL; -+ } -+ } -+ -+ /* after successfull receipt of a new username, store a copy at username_prev */ -+ if (*username) { -+ if ( username_prev ) { -+ u_free(username_prev); -+ username_prev = NULL; -+ } -+ username_prev = u_strdup(*username); - } - -+ /* but always ask for the password !? */ - pw = (char *)getpass("Password: "); - *password = u_strdup_printf ("%s", pw); --} -- - -+ /* make backup, *password will become free'd when next try of http-auth fails */ -+ if (*password) { -+ if (password_prev) { -+ u_free(password_prev); -+ password_prev = NULL; -+ } -+ password_prev = u_strdup(*password); -+ } -+} - - static void - wsman_options_set_properties(client_opt_t *options) -@@ -647,6 +702,14 @@ int main(int argc, char **argv) - exit(EXIT_FAILURE); - } - -+ /* save copies of username or password when given on the command line or via environment variables */ -+ if ( username != NULL ) { -+ username_given = u_strdup(username); -+ } -+ if ( password != NULL ) { -+ password_given = u_strdup(password); -+ } -+ - filename = (char *) config_file; - - if (filename) { diff --git a/replace-getpass.patch b/replace-getpass.patch deleted file mode 100644 index eb25fe3..0000000 --- a/replace-getpass.patch +++ /dev/null @@ -1,61 +0,0 @@ -diff -up wsmancli-2.6.0/src/wsman.c.orig wsmancli-2.6.0/src/wsman.c ---- wsmancli-2.6.0/src/wsman.c.orig 2023-01-09 11:46:15.771553135 +0100 -+++ wsmancli-2.6.0/src/wsman.c 2023-01-09 11:54:13.968830290 +0100 -@@ -40,6 +40,7 @@ - #include - #include - #include -+#include - - #ifdef HAVE_UNISTD_H - #include -@@ -57,6 +58,8 @@ - extern char *getpass (const char *__prompt); - #endif - -+#define BASE_LEN 21 -+ - static long int server_port = 0; - static char *cainfo = NULL; - static char *cert = NULL; -@@ -498,6 +501,10 @@ request_usr_pwd( WsManClient *client, ws - char *pw; - char user[21]; - char *p; -+ char c; -+ int len = BASE_LEN; -+ int pos = 0; -+ struct termios term; - - /* - * fprintf(stdout,"Authentication failed, please retry\n"); -@@ -560,8 +567,28 @@ request_usr_pwd( WsManClient *client, ws - } - - /* but always ask for the password !? */ -- pw = (char *)getpass("Password: "); -+ /* set no echo */ -+ tcgetattr(1, &term); -+ term.c_lflag &= ~ECHO; -+ tcsetattr(1, TCSANOW, &term); -+ /* get pass */ -+ pw = (char*) u_malloc(sizeof(char) * len); -+ pw[0] = '\0'; -+ printf("Password: "); -+ fflush(stdout); -+ while ((c = fgetc(stdin)) != '\n') { -+ pw[pos++] = (char) c; -+ if (pos >= len) { -+ len += BASE_LEN; -+ pw = realloc(pw, len); -+ } -+ } -+ pw[pos] = '\0'; - *password = u_strdup_printf ("%s", pw); -+ u_free(pw); -+ /* set echo back again */ -+ term.c_lflag |= ECHO; -+ tcsetattr(1, TCSANOW, &term); - - /* make backup, *password will become free'd when next try of http-auth fails */ - if (*password) { diff --git a/sources b/sources index bcc0165..d20b149 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -df418d6d78160fd4f88f890a8953907a wsmancli-2.6.0.tar.gz +SHA512 (wsmancli-2.6.2.tar.gz) = 9b1c99b18d2f9f6125a48bb4639ffa970b67fd4ac2dae401a0b9205ab7a0650ebd77737ce386761143aedefd18a59b92407a63831568ca5597e92281df8414b0 diff --git a/wsmancli.spec b/wsmancli.spec index ebd3a97..00416f6 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli -Version: 2.6.0 -Release: 21%{?dist} +Version: 2.6.2 +Release: 1%{?dist} License: BSD-3-Clause Url: http://www.openwsman.org/ # You can get this tarball here: @@ -14,8 +14,6 @@ BuildRequires: openwsman-devel >= 2.1.0 pkgconfig curl-devel BuildRequires: autoconf automake libtool Requires: openwsman curl Patch0: missing-pthread-symbols.patch -Patch1: http-unauthorized-improve.patch -Patch2: replace-getpass.patch Summary: WS-Management-Command line Interface %description @@ -24,9 +22,7 @@ systems using Web Services Management protocol. %prep %setup -q -%patch0 -p1 -%patch1 -p1 -b .http-unauthorized-improve -%patch2 -p1 -b .replace-getpass +%autopatch -p1 cp -fp %SOURCE1 %SOURCE2 %SOURCE3 .; %build @@ -45,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Fri May 19 2023 Vitezslav Crhonek - 2.6.2-1 +- Update to wsmancli-2.6.2 + * Tue Apr 25 2023 Vitezslav Crhonek - 2.6.0-21 - SPDX migration From 0d0716942ea9dd7ecd181c1f954ac027dd6eaed7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jul 2023 18:25:27 +0000 Subject: [PATCH 10/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- wsmancli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wsmancli.spec b/wsmancli.spec index 00416f6..d3118fe 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.6.2 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD-3-Clause Url: http://www.openwsman.org/ # You can get this tarball here: @@ -41,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Sat Jul 22 2023 Fedora Release Engineering - 2.6.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Fri May 19 2023 Vitezslav Crhonek - 2.6.2-1 - Update to wsmancli-2.6.2 From 622803c1400e43ab43c2bef1ad982199237112b6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 09:11:47 +0000 Subject: [PATCH 11/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- wsmancli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wsmancli.spec b/wsmancli.spec index d3118fe..7ce0497 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.6.2 -Release: 2%{?dist} +Release: 3%{?dist} License: BSD-3-Clause Url: http://www.openwsman.org/ # You can get this tarball here: @@ -41,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Sat Jan 27 2024 Fedora Release Engineering - 2.6.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sat Jul 22 2023 Fedora Release Engineering - 2.6.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 3f0c579f23cffe79eb4ead4f1986238f9abb36fb Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 09:35:22 +0000 Subject: [PATCH 12/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- wsmancli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wsmancli.spec b/wsmancli.spec index 7ce0497..5b261c0 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.6.2 -Release: 3%{?dist} +Release: 4%{?dist} License: BSD-3-Clause Url: http://www.openwsman.org/ # You can get this tarball here: @@ -41,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Sat Jul 20 2024 Fedora Release Engineering - 2.6.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Sat Jan 27 2024 Fedora Release Engineering - 2.6.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 1e5f4c387b97805877e49a2965d8ccd20467ceee Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 15:17:56 +0000 Subject: [PATCH 13/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- wsmancli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wsmancli.spec b/wsmancli.spec index 5b261c0..d358e00 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.6.2 -Release: 4%{?dist} +Release: 5%{?dist} License: BSD-3-Clause Url: http://www.openwsman.org/ # You can get this tarball here: @@ -41,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Sun Jan 19 2025 Fedora Release Engineering - 2.6.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Sat Jul 20 2024 Fedora Release Engineering - 2.6.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 7c71218baa3e4760d0bd0d31406d30c4b1cac93e Mon Sep 17 00:00:00 2001 From: Vitezslav Crhonek Date: Tue, 8 Apr 2025 10:27:03 +0200 Subject: [PATCH 14/17] Update to wsmancli-2.8.0 --- .gitignore | 2 +- sources | 2 +- wsmancli.spec | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index fdafa3d..6318edf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/wsmancli-2.6.2.tar.gz +/wsmancli-2.8.0.tar.gz diff --git a/sources b/sources index d20b149..93ee21a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (wsmancli-2.6.2.tar.gz) = 9b1c99b18d2f9f6125a48bb4639ffa970b67fd4ac2dae401a0b9205ab7a0650ebd77737ce386761143aedefd18a59b92407a63831568ca5597e92281df8414b0 +SHA512 (wsmancli-2.8.0.tar.gz) = 61f1fa57ba8106c8e9b0d96296e99e1dc04eb3a2468630aa73c594e6403bfed3cc0946bc4fd633176fda50eeb24a1c3d2cec9697b11d9b5c6a4016eef050b86c diff --git a/wsmancli.spec b/wsmancli.spec index d358e00..4cc18ef 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli -Version: 2.6.2 -Release: 5%{?dist} +Version: 2.8.0 +Release: 1%{?dist} License: BSD-3-Clause Url: http://www.openwsman.org/ # You can get this tarball here: @@ -41,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Tue Apr 08 2025 Vitezslav Crhonek - 2.8.0-1 +- Update to wsmancli-2.8.0 + * Sun Jan 19 2025 Fedora Release Engineering - 2.6.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 1452dc236e1ff833bd01c7663bfd9e0472eceb21 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 20:33:55 +0000 Subject: [PATCH 15/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- wsmancli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wsmancli.spec b/wsmancli.spec index 4cc18ef..7d71093 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.8.0 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD-3-Clause Url: http://www.openwsman.org/ # You can get this tarball here: @@ -41,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 2.8.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Tue Apr 08 2025 Vitezslav Crhonek - 2.8.0-1 - Update to wsmancli-2.8.0 From 52b7df0dcb0ecbf652d8c8a5cb0304107c5c1eab Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 20:23:27 +0000 Subject: [PATCH 16/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- wsmancli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wsmancli.spec b/wsmancli.spec index 7d71093..733e8d2 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.8.0 -Release: 2%{?dist} +Release: 3%{?dist} License: BSD-3-Clause Url: http://www.openwsman.org/ # You can get this tarball here: @@ -41,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Sat Jan 17 2026 Fedora Release Engineering - 2.8.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Fri Jul 25 2025 Fedora Release Engineering - 2.8.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 443e99b696a2a07361e404e8aeb1227731f69df6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 08:57:06 +0000 Subject: [PATCH 17/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- wsmancli.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wsmancli.spec b/wsmancli.spec index 733e8d2..11b2292 100644 --- a/wsmancli.spec +++ b/wsmancli.spec @@ -1,6 +1,6 @@ Name: wsmancli Version: 2.8.0 -Release: 3%{?dist} +Release: 4%{?dist} License: BSD-3-Clause Url: http://www.openwsman.org/ # You can get this tarball here: @@ -41,6 +41,9 @@ make DESTDIR=%{buildroot} install %doc COPYING README AUTHORS %changelog +* Fri Jul 17 2026 Fedora Release Engineering - 2.8.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Sat Jan 17 2026 Fedora Release Engineering - 2.8.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild