Index: trunk/docs/Changelog
===================================================================
--- trunk/docs/Changelog	(revision 354)
+++ trunk/docs/Changelog	(revision 355)
@@ -1,3 +1,4 @@
 2.8.6:
+	* Option to use a textfile with a list of files for update
 	* Fix --enable-db-reload option (reported by David L.)
 	* Fix samhain_kmem compilation, need to compile under chosen
Index: trunk/include/sh_utils.h
===================================================================
--- trunk/include/sh_utils.h	(revision 354)
+++ trunk/include/sh_utils.h	(revision 355)
@@ -96,4 +96,5 @@
 int sh_util_ask_update(const char * path);
 int sh_util_set_interactive(const char * str);
+int sh_util_update_file (const char * str);
 
 /* don't log output files
Index: trunk/src/sh_getopt.c
===================================================================
--- trunk/src/sh_getopt.c	(revision 354)
+++ trunk/src/sh_getopt.c	(revision 355)
@@ -80,4 +80,9 @@
     HAS_ARG_NO, 
     sh_util_set_interactive },
+  { N_("listfile"),  
+    '-', 
+    N_("Run update with listfile"),  
+    HAS_ARG_YES, 
+    sh_util_update_file },
 #endif
 #if defined(SH_WITH_SERVER) || defined(SH_WITH_CLIENT)
Index: trunk/src/sh_utils.c
===================================================================
--- trunk/src/sh_utils.c	(revision 354)
+++ trunk/src/sh_utils.c	(revision 355)
@@ -107,9 +107,40 @@
 
   sh_ask_update = S_TRUE;
-
   sh_unix_setnodeamon(NULL);
 
   return 0;
 }
+
+static char * sh_update_file = NULL;
+
+int sh_util_update_file (const char * str)
+{
+  if (str)
+    {
+      if (0 == access(str, R_OK)) /* flawfinder: ignore */
+	{
+	  if (NULL != sh_update_file)
+	    SH_FREE(sh_update_file);
+	  sh_update_file = sh_util_strdup(str);
+	  sh_ask_update = S_TRUE;
+	  sh_unix_setnodeamon(NULL);
+	  return 0;
+	}
+      else
+	{
+	  char ebuf[SH_ERRBUF_SIZE];
+	  int  errnum = errno;
+
+	  sh_error_message(errnum, ebuf, sizeof(ebuf));
+	  sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, errnum, MSG_E_SUBGEN,
+			   ebuf, _("sh_util_update_file") );
+	  
+	  return -1;
+	}
+    }
+
+  return -1;
+}
+
 
 #if !defined(STDIN_FILENO)
@@ -120,4 +151,53 @@
 #endif
 
+/* Returns S_FALSE if no update desired 
+ */
+int sh_util_update_checkfile(const char * path)
+{
+  FILE * fd = fopen(sh_update_file, "r");
+  char * line;
+
+  if (!fd)
+    {
+      uid_t  euid;
+      int errnum = errno;
+      sl_get_euid(&euid);
+      sh_error_handle (SH_ERR_ERR, FIL__, __LINE__, errnum, MSG_NOACCESS,
+		       (long) euid, sh_update_file);
+      aud_exit (FIL__, __LINE__, EXIT_FAILURE);
+      return S_FALSE;
+    }
+
+  line = SH_ALLOC(8192);
+
+  while (NULL != fgets(line, 8192, fd))
+    {
+      char * nl = strrchr(line, '\n');
+
+      if (nl)
+	{
+	  *nl = '\0';
+
+	  /* Check for MS Windows line terminator 
+	   */
+	  if (nl > line) --nl;
+	  if (*nl == '\r')
+	    *nl = '\0';
+	}
+
+      if (0 == sl_strcmp(line, path))
+	{
+	  SH_FREE(line);
+	  fclose(fd);
+	  return S_TRUE;
+	}
+    }
+  SH_FREE(line);
+  fclose(fd);
+  return S_FALSE;
+}
+
+/* Returns S_FALSE if no update desired 
+ */
 int sh_util_ask_update(const char * path)
 {
@@ -130,4 +210,10 @@
   if (sh_ask_update != S_TRUE)
     {
+      SL_RETURN(i, _("sh_util_ask_update"));
+    }
+
+  if (sh_update_file)
+    {
+      i = sh_util_update_checkfile(path);
       SL_RETURN(i, _("sh_util_ask_update"));
     }
