From a7d9e242acbd73ddafedb0808adf97cfe88ee7f9 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 4 Mar 2017 18:27:33 -0800 Subject: [PATCH 1/6] Linux ifdefs atime to atim. No need for this --- src/dictstat.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/dictstat.c b/src/dictstat.c index c30428fe5..47c8f4274 100644 --- a/src/dictstat.c +++ b/src/dictstat.c @@ -16,11 +16,7 @@ int sort_by_dictstat (const void *s1, const void *s2) dictstat_t *d1 = (dictstat_t *) s1; dictstat_t *d2 = (dictstat_t *) s2; - #if defined (__linux__) || defined (__CYGWIN__) - d2->stat.st_atim = d1->stat.st_atim; - #else d2->stat.st_atime = d1->stat.st_atime; - #endif return memcmp (&d1->stat, &d2->stat, sizeof (struct stat)); } From 84cbad2ba8d830fcdb223da30843704a09fce734 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 4 Mar 2017 18:28:50 -0800 Subject: [PATCH 2/6] Only Apple has a different cl.h location. Simplify a bit --- include/ext_OpenCL.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/include/ext_OpenCL.h b/include/ext_OpenCL.h index adaf313f2..beb9bbd0d 100644 --- a/include/ext_OpenCL.h +++ b/include/ext_OpenCL.h @@ -11,21 +11,7 @@ #if defined (__APPLE__) #include -#endif - -#if defined (_WIN) -#include -#endif - -#if defined (__linux__) -#include -#endif - -#if defined (__FreeBSD__) -#include -#endif - -#if defined (__CYGWIN__) +#else #include #endif From fdc0bf913d3cad3c74e0e9d23b4d57e131d18fbc Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 4 Mar 2017 18:30:39 -0800 Subject: [PATCH 3/6] Remove unnecessary includes --- include/pidfile.h | 3 --- include/restore.h | 3 --- 2 files changed, 6 deletions(-) diff --git a/include/pidfile.h b/include/pidfile.h index 3fa07bcae..e609a5e2b 100644 --- a/include/pidfile.h +++ b/include/pidfile.h @@ -13,9 +13,6 @@ #if defined (_WIN) #include #include -#else -#include -#include #endif // _WIN int pidfile_ctx_init (hashcat_ctx_t *hashcat_ctx); diff --git a/include/restore.h b/include/restore.h index d43e1b14c..740310f5b 100644 --- a/include/restore.h +++ b/include/restore.h @@ -13,9 +13,6 @@ #if defined (_WIN) #include #include -#else -#include -#include #endif // _WIN #define RESTORE_VERSION_MIN 340 From 184d69f574d941e6dd31e2b0e17a492397bb3dad Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 4 Mar 2017 18:51:01 -0800 Subject: [PATCH 4/6] Adjust version level for the *time_r functions --- include/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/common.h b/include/common.h index 2fb98e8ad..ac8ed2342 100644 --- a/include/common.h +++ b/include/common.h @@ -22,7 +22,7 @@ // needed for *time_r functions under MinGW #ifndef _POSIX_THREAD_SAFE_FUNCTIONS -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L +#define _POSIX_THREAD_SAFE_FUNCTIONS 200809L #endif // needed for 64-bit off_t on 32-bit OSes From df3c2e712e82d1404d352d784fc4a257d8ab6182 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 4 Mar 2017 18:51:46 -0800 Subject: [PATCH 5/6] Change c99 to gnu99. _GNU_SOURCE conflicts with c99 --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 5ffb11d39..1968602f7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -121,7 +121,7 @@ VERSION_TAG := $(shell test -d .git && git describe --tags --dirty=+ ## General compiler and linker options ## -CFLAGS += -pipe -std=c99 -Iinclude/ -Iinclude/lzma_sdk/ -IOpenCL/ +CFLAGS += -pipe -std=gnu99 -Iinclude/ -Iinclude/lzma_sdk/ -IOpenCL/ ifeq ($(PRODUCTION),0) CFLAGS += -W From bbdaf647f330ea446382c10bf688d43a2c9cdcd5 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 4 Mar 2017 19:11:28 -0800 Subject: [PATCH 6/6] Add _FORTIFY_SOURCE to check for overflows --- include/common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/common.h b/include/common.h index ac8ed2342..64958a1ee 100644 --- a/include/common.h +++ b/include/common.h @@ -30,6 +30,10 @@ #define _FILE_OFFSET_BITS 64 #endif +#ifndef _FORTIFY_SOURCE +#define _FORTIFY_SOURCE 2 +#endif + #define NOMINMAX 1 #define MIN(a,b) (((a) < (b)) ? (a) : (b))