From 77b2d36fcd4ee88bcc3a730ed3dd52287be3ac2e Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Tue, 1 Feb 2022 23:15:53 +0800 Subject: Fix regression in non-symlink dropbearmulti Introduced in recent commit for re-exec --- dbmulti.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.1