--- ansh/src/anshd.c 2011/10/13 16:08:52 1.1.1.1.2.4 +++ ansh/src/anshd.c 2011/10/14 09:04:04 1.1.1.1.2.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: anshd.c,v 1.1.1.1.2.4 2011/10/13 16:08:52 misho Exp $ + * $Id: anshd.c,v 1.1.1.1.2.5 2011/10/14 09:04:04 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -53,6 +53,7 @@ int Verbose; u_int Crypted = 1; proc_head_t pH; int bpfLEN, Timeout, Daemon = 1; +char Key[STRSIZ]; extern char compiled[], compiledby[], compilehost[]; @@ -65,6 +66,7 @@ Usage() "\t-d \tBind to host interface, like 'em0' (default is first host interface)\n" "\t-U \tRun service with other user\n" "\t-C \tRun service into chroot directory\n" + "\t-k \tService cipher key\n" "\t-t \tTimeout of login if no activity (default is 0 sec)\n" "\t-u\t\tSwitch to unencrypted traffic between hosts\n" "\t-b\t\tRun into batch mode (default is daemon mode)\n" @@ -120,9 +122,11 @@ main(int argc, char **argv) sched_root_task_t *root = NULL; struct tagProc *proc; + strlcpy(Key, DEFAULT_KEY, sizeof Key); + Get1stEth(szDev, STRSIZ); - while ((ch = getopt(argc, argv, "hvubt:d:U:C:")) != -1) + while ((ch = getopt(argc, argv, "hvubt:d:U:C:k:")) != -1) switch (ch) { case 'U': pass = getpwnam(optarg); @@ -148,6 +152,9 @@ main(int argc, char **argv) break; case 'd': strlcpy(szDev, optarg, sizeof szDev); + break; + case 'k': + strlcpy(Key, optarg, sizeof Key); break; case 'u': Crypted ^= Crypted;