- Timestamp:
- Jun 30, 2021, 10:29:32 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/config.h.in
r550 r564 770 770 /* Define if you have SA_SIGINFO */ 771 771 #undef HAVE_SA_SIGINFO 772 773 /* Define to 1 if you have the `scandir' function. */ 774 #undef HAVE_SCANDIR 772 775 773 776 /* Define to 1 if you have the <sched.h> header file. */ -
trunk/configure.ac
r560 r564 12 12 dnl start 13 13 dnl 14 AM_INIT_AUTOMAKE(samhain, 4.4. 3)14 AM_INIT_AUTOMAKE(samhain, 4.4.4) 15 15 AC_DEFINE([SAMHAIN], 1, [Application is samhain]) 16 16 AC_CANONICAL_HOST … … 391 391 strerror_r getgrgid_r getpwnam_r getpwuid_r \ 392 392 gmtime_r localtime_r rand_r readdir_r strtok_r \ 393 mincore posix_fadvise inotify_init1 393 mincore posix_fadvise inotify_init1 scandir 394 394 ) 395 395 AC_CHECK_FUNC(statfs, AC_DEFINE(HAVE_STATFS) statfs="yes", statfs="no") … … 1140 1140 # this is from the snort configure.in 1141 1141 # 1142 AC_DEFUN( FAIL_MESSAGE,[1142 AC_DEFUN([FAIL_MESSAGE],[ 1143 1143 echo 1144 1144 echo -
trunk/docs/Changelog
r562 r564 3 3 * fix bug with signify-openbsd in client/server setup (reported 4 4 by Sdoba) 5 * patch by K. Hacene for reproducible database generation 6 * fix recognition of invalid compiler options in configure.ac 5 7 6 8 4.4.3: -
trunk/src/sh_dbIO.c
r560 r564 1512 1512 } 1513 1513 } 1514 1515 if (!buf) { 1516 memset(&p, 0, sizeof(sh_filestore_t)); 1517 } 1514 1515 /* unconditionally initialize the structure */ 1516 memset(&p, 0, sizeof(sh_filestore_t)); 1518 1517 1519 1518 if (buf != NULL) -
trunk/src/sh_files.c
r543 r564 20 20 #include "config_xor.h" 21 21 22 #if defined(HAVE_PTHREAD_MUTEX_RECURSIVE) 22 #if defined(HAVE_PTHREAD_MUTEX_RECURSIVE) && defined(HAVE_DIRENT_H) && defined(HAVE_SCANDIR) 23 24 /* Linux */ 25 #if defined(__linux__) 26 #define _XOPEN_SOURCE 700 27 #define SH_USE_SCANDIR 1 28 29 /* FreeBSD */ 30 #elif defined(__FreeBSD__) 31 32 #if __FreeBSD__ >= 8 33 #define __XSI_VISIBLE 700 34 #define SH_USE_SCANDIR 1 35 #endif 36 37 /* OpenBSD */ 38 #elif defined(__OpenBSD__) 39 #define __POSIX_VISIBLE 200809 40 #define SH_USE_SCANDIR 1 41 42 #elif defined(__NetBSD__) 43 #define _NETBSD_SOURCE 44 #define SH_USE_SCANDIR 1 45 46 /* other os */ 47 #else 48 #define _XOPEN_SOURCE 500 49 50 #endif 51 52 #elif defined(HAVE_PTHREAD_MUTEX_RECURSIVE) 23 53 #define _XOPEN_SOURCE 500 24 54 #endif … … 36 66 #include <sys/types.h> 37 67 #include <unistd.h> 38 #include <sys/types.h>39 68 #include <sys/stat.h> 40 69 #include <fcntl.h> … … 2081 2110 DIR * thisDir = NULL; 2082 2111 struct dirent * thisEntry; 2112 #if defined(SH_USE_SCANDIR) 2113 struct dirent **entryList; 2114 int entry; 2115 #endif 2083 2116 int status; 2084 2117 int dummy = S_FALSE; … … 2267 2300 dirlist_orig = NULL; 2268 2301 2302 #if defined(SH_USE_SCANDIR) 2303 entry = scandir(iname, &entryList, 0, alphasort); 2304 while(entry > 0) { /* scandir() may return -1 on error! */ 2305 entry--; 2306 thisEntry = entryList[entry]; 2307 #else 2269 2308 do { 2270 2309 thisEntry = readdir (thisDir); 2310 #endif 2271 2311 if (thisEntry != NULL) 2272 2312 { … … 2284 2324 dirlist = addto_sh_dirlist (thisEntry, dirlist); 2285 2325 } 2286 } while (thisEntry != NULL); 2287 2326 } 2327 #if !defined(SH_USE_SCANDIR) 2328 while (thisEntry != NULL); 2329 #endif 2330 2288 2331 SH_MUTEX_UNLOCK(mutex_readdir); 2289 2332
Note:
See TracChangeset
for help on using the changeset viewer.