summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2022-02-01 23:15:53 +0800
committerMatt Johnston <matt@ucc.asn.au>2022-02-01 23:15:53 +0800
commit77b2d36fcd4ee88bcc3a730ed3dd52287be3ac2e (patch)
tree3601f2261294213c3d75f4ba6f931a67ec80eadd
parente42711e3812e72604203f16a4f0d56768fde9e7e (diff)
downloaddropbear-77b2d36fcd4ee88bcc3a730ed3dd52287be3ac2e.tar.gz
Fix regression in non-symlink dropbearmulti
Introduced in recent commit for re-exec
-rw-r--r--dbmulti.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dbmulti.c b/dbmulti.c
index 514d7be..28ee959 100644
--- a/dbmulti.c
+++ b/dbmulti.c
@@ -62,12 +62,16 @@ static int runprog(const char *multipath,
int main(int argc, char ** argv) {
int i;
for (i = 0; i < 2; i++) {
+ const char* multipath = NULL;
+ if (i == 1) {
+ multipath = argv[0];
+ }
/* Try symlink first, then try as an argument eg "dropbearmulti dbclient host ..." */
if (argc > i) {
int match, res;
/* figure which form we're being called as */
const char* progname = basename(argv[i]);
- res = runprog(argv[0], progname, argc-i, &argv[i], &match);
+ res = runprog(multipath, progname, argc-i, &argv[i], &match);
if (match == DROPBEAR_SUCCESS) {
return res;
}