mirror of
http://galexander.org/git/simplesshd.git
synced 2025-07-01 17:02:32 +00:00
pass '-p <portno>' on the virtual commandline
This commit is contained in:
parent
447ffa0b8f
commit
f0dcb8b2c0
@ -11,7 +11,7 @@
|
|||||||
/* IMPORTANT: Many options will require "make clean" after changes */
|
/* IMPORTANT: Many options will require "make clean" after changes */
|
||||||
|
|
||||||
#ifndef DROPBEAR_DEFPORT
|
#ifndef DROPBEAR_DEFPORT
|
||||||
#define DROPBEAR_DEFPORT "22"
|
#define DROPBEAR_DEFPORT "2222"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DROPBEAR_DEFADDRESS
|
#ifndef DROPBEAR_DEFADDRESS
|
||||||
|
@ -72,7 +72,8 @@ Java_org_galexander_sshd_SimpleSSHDService_start_1sshd(JNIEnv *env_,
|
|||||||
|
|
||||||
pid = fork();
|
pid = fork();
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
char *argv[2] = { "sshd", NULL };
|
char *argv[10] = { "sshd", NULL };
|
||||||
|
int argc = 1;
|
||||||
char *logfn;
|
char *logfn;
|
||||||
int logfd;
|
int logfd;
|
||||||
|
|
||||||
@ -84,6 +85,12 @@ Java_org_galexander_sshd_SimpleSSHDService_start_1sshd(JNIEnv *env_,
|
|||||||
/* replace stderr, so the output is preserved... */
|
/* replace stderr, so the output is preserved... */
|
||||||
dup2(logfd, 2);
|
dup2(logfd, 2);
|
||||||
}
|
}
|
||||||
|
if (port) {
|
||||||
|
argv[argc++] = "-p";
|
||||||
|
argv[argc] = malloc(20);
|
||||||
|
sprintf(argv[argc], "%d", (int)port);
|
||||||
|
argc++;
|
||||||
|
}
|
||||||
dropbear_main(1, argv);
|
dropbear_main(1, argv);
|
||||||
} else {
|
} else {
|
||||||
(*env)->SetStaticIntField(env, cl_simplesshdservice,
|
(*env)->SetStaticIntField(env, cl_simplesshdservice,
|
||||||
|
Loading…
Reference in New Issue
Block a user