Make re-exec work with "dropbearmulti dropbear"

The re-exec needs to know to use the dropbearmulti binary instead.
Add a test for this case.
This commit is contained in:
Matt Johnston
2022-02-01 22:18:23 +08:00
parent a95ca34a10
commit 3939321750
6 changed files with 94 additions and 51 deletions

View File

@@ -19,7 +19,8 @@ def dropbear(request):
yield None
return
args = [opt.dropbear,
# split so that "dropbearmulti dropbear" works
args = opt.dropbear.split() + [
"-p", LOCALADDR, # bind locally only
"-r", opt.hostkey,
"-p", opt.port,
@@ -43,9 +44,10 @@ def dropbear(request):
def dbclient(request, *args, **kwargs):
opt = request.config.option
host = opt.remote or LOCALADDR
base_args = [opt.dbclient, "-y", host, "-p", opt.port]
# split so that "dropbearmulti dbclient" works
base_args = opt.dbclient.split() + ["-y", host, "-p", opt.port]
if opt.user:
full_args.extend(['-l', opt.user])
base_args.extend(['-l', opt.user])
full_args = base_args + list(args)
bg = kwargs.get("background")
if "background" in kwargs: