From bfa3c99dc0f39a80fb8695909855ee6c5facfec9 Mon Sep 17 00:00:00 2001 From: Greg Alexander Date: Tue, 16 Dec 2014 16:13:04 -0500 Subject: [PATCH] actually call main... --- jni/config.h | 2 ++ jni/interface.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/jni/config.h b/jni/config.h index 69b978e..0770207 100644 --- a/jni/config.h +++ b/jni/config.h @@ -23,5 +23,7 @@ #define DROPBEAR_SERVER 1 +#define DBMULTI_dropbear 1 +#define DROPBEAR_MULTI 1 #endif /* __CONFIG_H__ */ diff --git a/jni/interface.c b/jni/interface.c index 96387f9..e615f32 100644 --- a/jni/interface.c +++ b/jni/interface.c @@ -11,6 +11,8 @@ static jclass cl_string; static jclass cl_simplesshdservice; static jfieldID fid_sss_sshd_pid; +extern int dropbear_main(int argc, char **argv); + static int jni_init(JNIEnv *env_) { @@ -65,7 +67,8 @@ Java_org_galexander_sshd_SimpleSSHDService_start_1sshd(JNIEnv *env_, pid = fork(); if (pid == 0) { - /* XXX - call dropbear main() */ + char *argv[2] = { "sshd", NULL }; + dropbear_main(1, argv); } else { (*env)->SetStaticIntField(env, cl_simplesshdservice, fid_sss_sshd_pid, pid);