comparison dbutil.c @ 1342:8747c2b19152

merge 2017.75
author Matt Johnston <matt@ucc.asn.au>
date Thu, 18 May 2017 22:59:38 +0800
parents efad433418c4 21156be2bb26
children bbc0a0ee3843
comparison
equal deleted inserted replaced
1341:ab35a9ccc2eb 1342:8747c2b19152
77 void (*_dropbear_exit)(int exitcode, const char* format, va_list param) ATTRIB_NORETURN 77 void (*_dropbear_exit)(int exitcode, const char* format, va_list param) ATTRIB_NORETURN
78 = generic_dropbear_exit; 78 = generic_dropbear_exit;
79 void (*_dropbear_log)(int priority, const char* format, va_list param) 79 void (*_dropbear_log)(int priority, const char* format, va_list param)
80 = generic_dropbear_log; 80 = generic_dropbear_log;
81 81
82 #ifdef DEBUG_TRACE 82 #if DEBUG_TRACE
83 int debug_trace = 0; 83 int debug_trace = 0;
84 #endif 84 #endif
85 85
86 #ifndef DISABLE_SYSLOG 86 #ifndef DISABLE_SYSLOG
87 void startsyslog(const char *ident) { 87 void startsyslog(const char *ident) {
147 _dropbear_log(priority, format, param); 147 _dropbear_log(priority, format, param);
148 va_end(param); 148 va_end(param);
149 } 149 }
150 150
151 151
152 #ifdef DEBUG_TRACE 152 #if DEBUG_TRACE
153 153
154 static double debug_start_time = -1; 154 static double debug_start_time = -1;
155 155
156 void debug_start_net() 156 void debug_start_net()
157 { 157 {
260 } 260 }
261 if (ret_errfd && pipe(errfds) != 0) { 261 if (ret_errfd && pipe(errfds) != 0) {
262 return DROPBEAR_FAILURE; 262 return DROPBEAR_FAILURE;
263 } 263 }
264 264
265 #ifdef USE_VFORK 265 #if DROPBEAR_VFORK
266 pid = vfork(); 266 pid = vfork();
267 #else 267 #else
268 pid = fork(); 268 pid = fork();
269 #endif 269 #endif
270 270
369 } 369 }
370 370
371 execv(usershell, argv); 371 execv(usershell, argv);
372 } 372 }
373 373
374 #ifdef DEBUG_TRACE 374 #if DEBUG_TRACE
375 void printhex(const char * label, const unsigned char * buf, int len) { 375 void printhex(const char * label, const unsigned char * buf, int len) {
376 376
377 int i; 377 int i;
378 378
379 fprintf(stderr, "%s\n", label); 379 fprintf(stderr, "%s\n", label);
463 463
464 /* get a line from the file into buffer in the style expected for an 464 /* get a line from the file into buffer in the style expected for an
465 * authkeys file. 465 * authkeys file.
466 * Will return DROPBEAR_SUCCESS if data is read, or DROPBEAR_FAILURE on EOF.*/ 466 * Will return DROPBEAR_SUCCESS if data is read, or DROPBEAR_FAILURE on EOF.*/
467 /* Only used for ~/.ssh/known_hosts and ~/.ssh/authorized_keys */ 467 /* Only used for ~/.ssh/known_hosts and ~/.ssh/authorized_keys */
468 #if defined(DROPBEAR_CLIENT) || defined(ENABLE_SVR_PUBKEY_AUTH) 468 #if DROPBEAR_CLIENT || DROPBEAR_SVR_PUBKEY_AUTH
469 int buf_getline(buffer * line, FILE * authfile) { 469 int buf_getline(buffer * line, FILE * authfile) {
470 470
471 int c = EOF; 471 int c = EOF;
472 472
473 buf_setpos(line, 0); 473 buf_setpos(line, 0);