Skip to content

Commit

Permalink
Remove "//" from prefix of ssh cmd line
Browse files Browse the repository at this point in the history
If the prefix is just "/", then we would end up with a prted
cmd that started with "//". Probably harmless, but IIRC there
are some environments that don't treat it well. So add a little
protection to avoid that scenario.

Signed-off-by: Ralph Castain <[email protected]>
  • Loading branch information
rhc54 committed Nov 17, 2023
1 parent 469e75d commit dd0e1ca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mca/plm/ssh/plm_ssh_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Copyright (c) 2014-2020 Intel, Inc. All rights reserved.
* Copyright (c) 2015-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2021-2022 Nanook Consulting. All rights reserved.
* Copyright (c) 2021-2023 Nanook Consulting. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -592,7 +592,11 @@ static int setup_launch(int *argcptr, char ***argvptr, char *nodename, int *node
if (0 == strcmp(orted_cmd, "prted")) {
/* if the cmd is our standard one, then add the prefix */
value = pmix_basename(prte_install_dirs.bindir);
pmix_asprintf(&tmp, "%s/%s", prefix_dir, value);
if (0 == strcmp(prefix_dir, "/")) {
pmix_asprintf(&tmp, "/%s", value);
} else {
pmix_asprintf(&tmp, "%s/%s", prefix_dir, value);
}
free(value);
pmix_asprintf(&full_orted_cmd, "%s/%s", tmp, orted_cmd);
free(tmp);
Expand Down

0 comments on commit dd0e1ca

Please sign in to comment.