From 64dcdba8397c342bd862286b1d41492de657ff94 Mon Sep 17 00:00:00 2001 From: Jason Maloney Date: Sat, 13 Dec 2014 23:51:40 -0600 Subject: [PATCH 1/2] Throw out duplicate hosts Useful when the same host exists in multiple labels --- host.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/host.c b/host.c index 274da86..2c8ecf5 100644 --- a/host.c +++ b/host.c @@ -156,6 +156,7 @@ host_readlist(char *fname) { FILE *hstlist; struct host *hst; + struct host *hst_it; struct host *hst_head; char line[MAXNAME*3]; int i; @@ -238,6 +239,23 @@ host_readlist(char *fname) continue; } + /* check for duplicate host */ + hst_it = hst_head; + do + { + if ((hst_it->host != NULL && !strcmp(hst_it->host, hostname)) + && (hst_it->user != NULL && !strcmp(hst_it->user, login)) + && (hst_it->port == (uint16_t)port)) + { + break; + } + } + while ((hst_it = hst_it->next)); + + /* throw out duplicate host */ + if (hst_it) + continue; + /* add the host record */ hst = host_add(hst, login, hostname, (uint16_t)port); From e7a29f79197bfd84f5dcb24c5daeda4b3ce571be Mon Sep 17 00:00:00 2001 From: Jason Maloney Date: Mon, 2 Mar 2015 13:34:41 -0600 Subject: [PATCH 2/2] Fix quiet option not working with script option --- mpssh.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mpssh.c b/mpssh.c index b59731b..c75c1b1 100644 --- a/mpssh.c +++ b/mpssh.c @@ -178,8 +178,9 @@ child() != NON_DEFINED_PORT ? ps->hst->port : DEFAULT_PORT)); ssh_argv[sap++] = "-oPermitLocalCommand=yes"; lcmd = calloc(1, 2048); - snprintf(lcmd, 2048, "-oLocalCommand=%s %s -p %s %s@%s:%s", + snprintf(lcmd, 2048, "-oLocalCommand=%s %s %s -p %s %s@%s:%s", SCPPATH, + (ssh_quiet) ? "-q" : "", port_arg, script, ps->hst->user,