From ac2b546a13a466218d56245ee4b26931b00ad258 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 12 Jun 2006 15:57:14 +0000 Subject: Another stab at getting ss_family happy on older glibc --HG-- extra : convert_revision : 7a1e9b08a576d794c28275e1bf54cb603372a4a6 --- includes.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'includes.h') diff --git a/includes.h b/includes.h index 06c9692..02e8877 100644 --- a/includes.h +++ b/includes.h @@ -135,13 +135,6 @@ typedef u_int16_t uint16_t; #define LOG_AUTHPRIV LOG_AUTH #endif -/* glibc 2.1.3 systems have sockaddr_storage.__ss_family rather than - * sockaddr_storage.ss_family */ -#if !defined(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY) \ - && defined(HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY) -#define ss_family __ss_family -#endif - /* so we can avoid warnings about unused params (ie in signal handlers etc) */ #ifdef UNUSED #elif defined(__GNUC__) -- cgit v1.2.3 From 7b780efb42e3d9b369b4f00421fba1fc21ec2a22 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Wed, 6 Dec 2006 13:09:32 +0000 Subject: - Include netinet/in.h before arpa/inet.h for FreeBSD - Update Copyright year --HG-- extra : convert_revision : 182c2d8dbd5321ef4d1df8758936f4dc7127015f --- LICENSE | 2 +- includes.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'includes.h') diff --git a/LICENSE b/LICENSE index e0a11ac..ec93fa1 100644 --- a/LICENSE +++ b/LICENSE @@ -8,7 +8,7 @@ The majority of code is written by Matt Johnston, under the license below. Portions of the client-mode work are (c) 2004 Mihnea Stoenescu, under the same license: -Copyright (c) 2002-2004 Matt Johnston +Copyright (c) 2002-2006 Matt Johnston Portions copyright (c) 2004 Mihnea Stoenescu All rights reserved. diff --git a/includes.h b/includes.h index 06c9692..da974cc 100644 --- a/includes.h +++ b/includes.h @@ -72,12 +72,12 @@ #include #endif -#include - #ifdef HAVE_NETINET_IN_H #include #endif +#include + /* netbsd 1.6 needs this to be included before netinet/ip.h for some * undocumented reason */ #ifdef HAVE_NETINET_IN_SYSTM_H -- cgit v1.2.3 From 47e76de56a372796260b06a55f0be7765ee2f54f Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 12 Feb 2007 10:43:44 +0000 Subject: Disable core dumps --HG-- extra : convert_revision : ba8ebf724630561c6b9285247be7574a33853a17 --- cli-main.c | 2 ++ dbutil.c | 6 ++++++ dbutil.h | 1 + includes.h | 1 + svr-main.c | 2 ++ 5 files changed, 12 insertions(+) (limited to 'includes.h') diff --git a/cli-main.c b/cli-main.c index 3f767c9..68cf023 100644 --- a/cli-main.c +++ b/cli-main.c @@ -47,6 +47,8 @@ int main(int argc, char ** argv) { _dropbear_exit = cli_dropbear_exit; _dropbear_log = cli_dropbear_log; + disallow_core(); + cli_getopts(argc, argv); TRACE(("user='%s' host='%s' port='%s'", cli_opts.username, diff --git a/dbutil.c b/dbutil.c index f06b8bf..4559ba9 100644 --- a/dbutil.c +++ b/dbutil.c @@ -693,3 +693,9 @@ void setnonblocking(int fd) { } TRACE(("leave setnonblocking")) } + +void disallow_core() { + struct rlimit lim; + lim.rlim_cur = lim.rlim_max = 0; + setrlimit(RLIMIT_CORE, &lim); +} diff --git a/dbutil.h b/dbutil.h index d74e17e..856978d 100644 --- a/dbutil.h +++ b/dbutil.h @@ -63,6 +63,7 @@ void * m_realloc(void* ptr, size_t size); void __m_free(void* ptr); void m_burn(void* data, unsigned int len); void setnonblocking(int fd); +void disallow_core(); /* Used to force mp_ints to be initialised */ #define DEF_MP_INT(X) mp_int X = {0, 0, 0, NULL} diff --git a/includes.h b/includes.h index 1fcf634..017de66 100644 --- a/includes.h +++ b/includes.h @@ -38,6 +38,7 @@ #include #include #include +#include #include #include diff --git a/svr-main.c b/svr-main.c index e228acf..ddf5445 100644 --- a/svr-main.c +++ b/svr-main.c @@ -52,6 +52,8 @@ int main(int argc, char ** argv) _dropbear_exit = svr_dropbear_exit; _dropbear_log = svr_dropbear_log; + disallow_core(); + /* get commandline options */ svr_getopts(argc, argv); -- cgit v1.2.3