Custom Query (453 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (7 - 9 of 453)

1 2 3 4 5 6 7 8 9 10 11 12 13
Ticket Resolution Summary Owner Reporter
#452 fixed reproducible database generation rainer rainer
Description

There has been a request (and patch) by K. Hacene for reproducible database generation, by means of initializing unused fields and using scandir() instead of readdir() for alphanumeric sorting:

 ---
 src/sh_dbIO.c  |  2 ++
 src/sh_files.c | 14 ++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/sh_dbIO.c b/src/sh_dbIO.c
index fbe4229..5ff1908 100644
--- a/src/sh_dbIO.c
+++ b/src/sh_dbIO.c
@@ -1408,6 +1408,8 @@ static void sh_dbIO_data_write_int (file_type * buf, char * fileHash,
 
   SL_ENTER(_("sh_dbIO_data_write_int"));
 
+  memset(&p, 0, sizeof(sh_filestore_t));
+
   do_writeout_checks(outpath);
 
   if (sh.flag.update == S_FALSE)
diff --git a/src/sh_files.c b/src/sh_files.c
index 8475208..13690d5 100644
--- a/src/sh_files.c
+++ b/src/sh_files.c
@@ -19,7 +19,9 @@
 
 #include "config_xor.h"
 
-#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
+#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE) && defined(HAVE_DIRENT_H)
+#define _XOPEN_SOURCE 700
+#elif defined(HAVE_PTHREAD_MUTEX_RECURSIVE)
 #define _XOPEN_SOURCE 500
 #endif
 
@@ -2091,6 +2093,8 @@ int sh_files_checkdir (int iclass, unsigned long check_flags,
 
   DIR *           thisDir = NULL;
   struct dirent * thisEntry;
+  struct dirent **entryList;
+  int             entry;
   int             status;
   int             dummy = S_FALSE;
   dir_type      * theDir;
@@ -2277,8 +2281,10 @@ int sh_files_checkdir (int iclass, unsigned long check_flags,
   dirlist = NULL;
   dirlist_orig = NULL;
 
-  do {
-      thisEntry = readdir (thisDir);
+  entry = scandir(iname, &entryList, 0, alphasort);
+  while(entry--)
+  {
+    thisEntry = entryList[entry];
       if (thisEntry != NULL) 
 	{
 	  ++theDir->NumAll;
@@ -2294,7 +2300,7 @@ int sh_files_checkdir (int iclass, unsigned long check_flags,
 	    }
 	  dirlist = addto_sh_dirlist (thisEntry, dirlist);
 	}
-  } while (thisEntry != NULL);
+  }
 
   SH_MUTEX_UNLOCK(mutex_readdir);
 
-- 
#451 fixed signify-openbsd does not work with client/server mode rainer rainer
Description

Config or database files downloaded from the server may fail to verify with signify-openbsd (reported by Sdoba).

Problem is caused by (obsolete) padding routine.

#450 fixed more gcc 10 compiler warnings rainer rainer
Description

There are more gcc compiler warnings with gcc 10.3

1 2 3 4 5 6 7 8 9 10 11 12 13
Note: See TracQuery for help on using queries.