mirror of
https://github.com/clearml/dropbear
synced 2025-01-31 10:57:01 +00:00
Add noreturn and format attribute hints for some functions.
--HG-- extra : convert_revision : 6cc8735d01f0360b918edc26be05681725c0022a
This commit is contained in:
parent
72a82cc0ac
commit
2028b1b517
@ -29,7 +29,7 @@
|
|||||||
#include "runopts.h"
|
#include "runopts.h"
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
|
|
||||||
static void cli_dropbear_exit(int exitcode, const char* format, va_list param);
|
static void cli_dropbear_exit(int exitcode, const char* format, va_list param) ATTRIB_NORETURN;
|
||||||
static void cli_dropbear_log(int priority, const char* format, va_list param);
|
static void cli_dropbear_log(int priority, const char* format, va_list param);
|
||||||
|
|
||||||
#ifdef ENABLE_CLI_PROXYCMD
|
#ifdef ENABLE_CLI_PROXYCMD
|
||||||
|
4
dbutil.c
4
dbutil.c
@ -57,11 +57,11 @@
|
|||||||
#define MAX_FMT 100
|
#define MAX_FMT 100
|
||||||
|
|
||||||
static void generic_dropbear_exit(int exitcode, const char* format,
|
static void generic_dropbear_exit(int exitcode, const char* format,
|
||||||
va_list param);
|
va_list param) ATTRIB_NORETURN;
|
||||||
static void generic_dropbear_log(int priority, const char* format,
|
static void generic_dropbear_log(int priority, const char* format,
|
||||||
va_list param);
|
va_list param);
|
||||||
|
|
||||||
void (*_dropbear_exit)(int exitcode, const char* format, va_list param)
|
void (*_dropbear_exit)(int exitcode, const char* format, va_list param) ATTRIB_NORETURN
|
||||||
= generic_dropbear_exit;
|
= generic_dropbear_exit;
|
||||||
void (*_dropbear_log)(int priority, const char* format, va_list param)
|
void (*_dropbear_log)(int priority, const char* format, va_list param)
|
||||||
= generic_dropbear_log;
|
= generic_dropbear_log;
|
||||||
|
28
dbutil.h
28
dbutil.h
@ -33,18 +33,34 @@
|
|||||||
void startsyslog();
|
void startsyslog();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void (*_dropbear_exit)(int exitcode, const char* format, va_list param);
|
#ifdef __GNUC__
|
||||||
|
#define ATTRIB_PRINTF(fmt,args) __attribute__((format(printf, fmt, args)))
|
||||||
|
#else
|
||||||
|
#define ATTRIB_PRINTF(fmt,args)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define ATTRIB_NORETURN __attribute__((noreturn))
|
||||||
|
#else
|
||||||
|
#define ATTRIB_NORETURN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern void (*_dropbear_exit)(int exitcode, const char* format, va_list param) ATTRIB_NORETURN;
|
||||||
extern void (*_dropbear_log)(int priority, const char* format, va_list param);
|
extern void (*_dropbear_log)(int priority, const char* format, va_list param);
|
||||||
|
|
||||||
void dropbear_exit(const char* format, ...);
|
void dropbear_exit(const char* format, ...) ATTRIB_PRINTF(1,2) ATTRIB_NORETURN;
|
||||||
void dropbear_close(const char* format, ...);
|
|
||||||
void dropbear_log(int priority, const char* format, ...);
|
void dropbear_close(const char* format, ...) ATTRIB_PRINTF(1,2) ;
|
||||||
void fail_assert(const char* expr, const char* file, int line);
|
void dropbear_log(int priority, const char* format, ...) ATTRIB_PRINTF(2,3) ;
|
||||||
|
|
||||||
|
void fail_assert(const char* expr, const char* file, int line) ATTRIB_NORETURN;
|
||||||
|
|
||||||
#ifdef DEBUG_TRACE
|
#ifdef DEBUG_TRACE
|
||||||
void dropbear_trace(const char* format, ...);
|
void dropbear_trace(const char* format, ...) ATTRIB_PRINTF(1,2);
|
||||||
void printhex(const char * label, const unsigned char * buf, int len);
|
void printhex(const char * label, const unsigned char * buf, int len);
|
||||||
extern int debug_trace;
|
extern int debug_trace;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char * stripcontrol(const char * text);
|
char * stripcontrol(const char * text);
|
||||||
void get_socket_address(int fd, char **local_host, char **local_port,
|
void get_socket_address(int fd, char **local_host, char **local_port,
|
||||||
char **remote_host, char **remote_port, int host_lookup);
|
char **remote_host, char **remote_port, int host_lookup);
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "packet.h"
|
#include "packet.h"
|
||||||
#include "tcpfwd.h"
|
#include "tcpfwd.h"
|
||||||
#include "chansession.h"
|
#include "chansession.h"
|
||||||
|
#include "dbutil.h"
|
||||||
|
|
||||||
extern int sessinitdone; /* Is set to 0 somewhere */
|
extern int sessinitdone; /* Is set to 0 somewhere */
|
||||||
extern int exitflag;
|
extern int exitflag;
|
||||||
@ -52,7 +53,7 @@ void fill_passwd(const char* username);
|
|||||||
|
|
||||||
/* Server */
|
/* Server */
|
||||||
void svr_session(int sock, int childpipe);
|
void svr_session(int sock, int childpipe);
|
||||||
void svr_dropbear_exit(int exitcode, const char* format, va_list param);
|
void svr_dropbear_exit(int exitcode, const char* format, va_list param) ATTRIB_NORETURN;
|
||||||
void svr_dropbear_log(int priority, const char* format, va_list param);
|
void svr_dropbear_log(int priority, const char* format, va_list param);
|
||||||
|
|
||||||
/* Client */
|
/* Client */
|
||||||
|
Loading…
Reference in New Issue
Block a user