comparison svr-main.c @ 290:94ee16f5b8a8

0.48 progress
author Matt Johnston <matt@ucc.asn.au>
date Thu, 09 Mar 2006 12:37:38 +0000
parents 1f5ec029dfe8
children 9d110777f345 7dad470ad4aa 0aaaf68e97dc
comparison
equal deleted inserted replaced
289:497fddd4a94e 290:94ee16f5b8a8
1 /* 1 /*
2 * Dropbear - a SSH2 server 2 * Dropbear - a SSH2 server
3 * 3 *
4 * Copyright (c) 2002,2003 Matt Johnston 4 * Copyright (c) 2002-2006 Matt Johnston
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal 8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights 9 * in the Software without restriction, including without limitation the rights
46 int dropbear_main(int argc, char ** argv) 46 int dropbear_main(int argc, char ** argv)
47 #else 47 #else
48 int main(int argc, char ** argv) 48 int main(int argc, char ** argv)
49 #endif 49 #endif
50 { 50 {
51
52
53 _dropbear_exit = svr_dropbear_exit; 51 _dropbear_exit = svr_dropbear_exit;
54 _dropbear_log = svr_dropbear_log; 52 _dropbear_log = svr_dropbear_log;
55 53
56 /* get commandline options */ 54 /* get commandline options */
57 svr_getopts(argc, argv); 55 svr_getopts(argc, argv);
137 } 135 }
138 } 136 }
139 137
140 commonsetup(); 138 commonsetup();
141 139
142
143 /* should be done after syslog is working */ 140 /* should be done after syslog is working */
144 if (svr_opts.forkbg) { 141 if (svr_opts.forkbg) {
145 dropbear_log(LOG_INFO, "Running in background"); 142 dropbear_log(LOG_INFO, "Running in background");
146 } else { 143 } else {
147 dropbear_log(LOG_INFO, "Not forking"); 144 dropbear_log(LOG_INFO, "Not forking");
159 childpipes[i] = -1; 156 childpipes[i] = -1;
160 } 157 }
161 bzero(preauth_addrs, sizeof(preauth_addrs)); 158 bzero(preauth_addrs, sizeof(preauth_addrs));
162 159
163 /* Set up the listening sockets */ 160 /* Set up the listening sockets */
164 /* XXX XXX ports */
165 listensockcount = listensockets(listensocks, MAX_LISTEN_ADDR, &maxsock); 161 listensockcount = listensockets(listensocks, MAX_LISTEN_ADDR, &maxsock);
166 if (listensockcount == 0) 162 if (listensockcount == 0)
167 { 163 {
168 dropbear_exit("No listening ports available."); 164 dropbear_exit("No listening ports available.");
169 } 165 }