diff options
author | Matt Johnston <matt@ucc.asn.au> | 2022-02-01 23:15:53 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2022-02-01 23:15:53 +0800 |
commit | 77b2d36fcd4ee88bcc3a730ed3dd52287be3ac2e (patch) | |
tree | 3601f2261294213c3d75f4ba6f931a67ec80eadd | |
parent | e42711e3812e72604203f16a4f0d56768fde9e7e (diff) | |
download | dropbear-77b2d36fcd4ee88bcc3a730ed3dd52287be3ac2e.tar.gz |
Fix regression in non-symlink dropbearmulti
Introduced in recent commit for re-exec
-rw-r--r-- | dbmulti.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; } |