# HG changeset patch # User Matt Johnston # Date 1614862982 -28800 # Node ID 8dc43b30c6bfb7856026990789488a869d262c3a # Parent f680a19bd559bccf3e3bbad9776198933c2371ae Define _GNU_SOURCE properly, other header fixes This lets -std=c89 build for gcc 8.4.0 diff -r f680a19bd559 -r 8dc43b30c6bf cli-authpubkey.c --- a/cli-authpubkey.c Thu Mar 04 21:02:16 2021 +0800 +++ b/cli-authpubkey.c Thu Mar 04 21:03:02 2021 +0800 @@ -125,7 +125,7 @@ static void cli_buf_put_sign(buffer* buf, sign_key *key, enum signature_type sigtype, const buffer *data_buf) { #if DROPBEAR_CLI_AGENTFWD - // TODO: rsa-sha256 agent + /* TODO: rsa-sha256 agent */ if (key->source == SIGNKEY_SOURCE_AGENT) { /* Format the agent signature ourselves, as buf_put_sign would. */ buffer *sigblob; diff -r f680a19bd559 -r 8dc43b30c6bf configure.ac --- a/configure.ac Thu Mar 04 21:02:16 2021 +0800 +++ b/configure.ac Thu Mar 04 21:03:02 2021 +0800 @@ -47,6 +47,9 @@ AC_MSG_NOTICE([Checking if compiler '$CC' supports -fno-strict-overflow]) DB_TRYADDCFLAGS([-fno-strict-overflow]) +# needed for various extensions. define early before autoconf tests +AC_DEFINE([_GNU_SOURCE], [], [Use GNU extensions if glibc]) + STATIC=0 AC_ARG_ENABLE(static, [ --enable-static Build static binaries], diff -r f680a19bd559 -r 8dc43b30c6bf dbmalloc.h --- a/dbmalloc.h Thu Mar 04 21:02:16 2021 +0800 +++ b/dbmalloc.h Thu Mar 04 21:03:02 2021 +0800 @@ -1,9 +1,9 @@ #ifndef DBMALLOC_H_ #define DBMALLOC_H_ -#include "stdint.h" -#include "stdlib.h" #include "options.h" +#include +#include void * m_malloc(size_t size); void * m_calloc(size_t nmemb, size_t size); diff -r f680a19bd559 -r 8dc43b30c6bf fuzz.h --- a/fuzz.h Thu Mar 04 21:02:16 2021 +0800 +++ b/fuzz.h Thu Mar 04 21:03:02 2021 +0800 @@ -80,7 +80,7 @@ int do_jmp; sigjmp_buf jmp; - // write out decrypted session data to this FD if it's set + // write out decrypted session data to this FD if it is set // flag - this needs to be set manually in cli-main.c etc int dumping; // the file descriptor @@ -114,6 +114,6 @@ #define getpwuid(x) fuzz_getpwuid(x) #endif // FUZZ_NO_REPLACE_GETPW -#endif // DROPBEAR_FUZZ +#endif /* DROPBEAR_FUZZ */ #endif /* DROPBEAR_FUZZ_H */ diff -r f680a19bd559 -r 8dc43b30c6bf includes.h --- a/includes.h Thu Mar 04 21:02:16 2021 +0800 +++ b/includes.h Thu Mar 04 21:03:02 2021 +0800 @@ -25,9 +25,6 @@ #ifndef DROPBEAR_INCLUDES_H_ #define DROPBEAR_INCLUDES_H_ -/* uclibc needs _GNU_SOURCE, maybe other things? */ -#define _GNU_SOURCE - #include "options.h" #include "debug.h" diff -r f680a19bd559 -r 8dc43b30c6bf svr-auth.c --- a/svr-auth.c Thu Mar 04 21:02:16 2021 +0800 +++ b/svr-auth.c Thu Mar 04 21:03:02 2021 +0800 @@ -25,7 +25,6 @@ /* This file (auth.c) handles authentication requests, passing it to the * particular type (auth-passwd, auth-pubkey). */ -#include #include "includes.h" #include "dbutil.h"