Index: trunk/src/samhain.c
===================================================================
--- trunk/src/samhain.c	(revision 412)
+++ trunk/src/samhain.c	(revision 415)
@@ -712,4 +712,5 @@
 #if defined(SH_WITH_SERVER)
   extern int sh_socket_remove (void);
+  extern int sh_html_zero();
 #endif
 
@@ -743,5 +744,9 @@
    */
 #if defined(SH_WITH_SERVER)
-  sh_forward_html_write();
+  /* zero out the status file at exit, such that the status
+   * of client becomes unknown in the beltane interface
+   */
+  sh_html_zero();
+  /* sh_forward_html_write(); */
 #endif
 
@@ -1174,5 +1179,5 @@
       FileSchedIn = NULL;
       *status = 0;
-      return 0;
+      return NULL;
     }
 
@@ -1722,4 +1727,5 @@
   (void) sh_files_setrec();
   (void) sh_files_test_setup();
+  sh_audit_commit ();
 
   /* --------  NICE LEVEL   ---------
@@ -1858,4 +1864,12 @@
 	      (void) sh_files_setrec();
 	      (void) sh_files_test_setup();
+	      sh_audit_commit ();
+
+	      fprintf(stderr, "FIXME: %d\n", (int) sh.fileCheck.alarm_interval);
+	      fprintf(stderr, "FIXME: FileSchedOne %s\n", 
+		      FileSchedOne == NULL ? "NULL" : "NOT NULL");
+	      fprintf(stderr, "FIXME: FileSchedTwo %s\n", 
+		      FileSchedTwo == NULL ? "NULL" : "NOT NULL");
+
 
 	      if (0 != sh.flag.nice)
Index: trunk/src/samhain_setpwd.c
===================================================================
--- trunk/src/samhain_setpwd.c	(revision 412)
+++ trunk/src/samhain_setpwd.c	(revision 415)
@@ -279,6 +279,7 @@
   if (strlen(argv[3]) != 16)
     {
-      fprintf (stdout, _("ERROR <new_password> %s has not exactly 16 chars\n"),
-	       argv[0]);
+      fprintf (stdout, 
+	       _("ERROR <new_password> |%s| has not exactly 16 chars\n"),
+	       argv[3]);
       fflush(stdout);
       return  EXIT_FAILURE;
Index: trunk/src/sh_audit.c
===================================================================
--- trunk/src/sh_audit.c	(revision 412)
+++ trunk/src/sh_audit.c	(revision 415)
@@ -211,7 +211,7 @@
   if (p >= 0)
     {
-      char command[64];
-
-      sl_snprintf(command, sizeof(command), _("%s -D -k samhain"),
+      char ctl[64];
+
+      sl_snprintf(ctl, sizeof(ctl), _("%s -D -k samhain"),
 		  _(actl_paths[p]));
       sh_error_handle (SH_ERR_ALL, FIL__, __LINE__, 
@@ -219,10 +219,12 @@
 		       _("Deleting audit daemon rules with key samhain"),
 		       _("sh_audit_delete_all") );
-      sh_ext_system(command);
-    }
-  return;
-}
-
-void sh_audit_mark (const char * file)
+
+      sl_strlcpy(ctl, _(actl_paths[p]), sizeof(ctl));
+      sh_ext_system(ctl, ctl, "-D", "-k", _("samhain"), NULL);
+    }
+  return;
+}
+
+static void sh_audit_mark_int (const char * file)
 {
   static int flushRules = 0;
@@ -243,4 +245,5 @@
       char * command = SH_ALLOC(len);
       char * safe;
+      char   ctl[64];
 
       sl_snprintf(command, len, _("%s -w %s -p wa -k samhain"),
@@ -255,9 +258,107 @@
       SH_FREE(safe);
 
-      sh_ext_system(command);
-    }
-  return;
-}
-
+      sl_strlcpy(ctl, _(actl_paths[p]), sizeof(ctl));
+      sl_strlcpy(command, file, len);
+
+      sh_ext_system(ctl, ctl, "-w", command, "-p", "wa", "-k", _("samhain"), NULL);
+
+      SH_FREE(command);
+    }
+  return;
+}
+
+struct aud_list {
+  char * file;
+  struct aud_list * next;
+};
+
+struct aud_list * mark_these = NULL;
+
+static void add_this (char * file)
+{
+  struct aud_list * this = SH_ALLOC(sizeof(struct aud_list));
+  this->file = sh_utils_strdup(file);
+  this->next = mark_these;
+  return;
+}
+
+static int test_exchange (struct aud_list * this, char * file)
+{
+  size_t len0 = sl_strlen(this->file);
+  size_t len1 = sl_strlen(file);
+  int    ret  = -1;
+
+  if (len0 == len1)
+    {
+      return strcmp(this->file, file);
+    }
+  else
+    {
+      char * s0 = SH_ALLOC(len0 + 2);
+      char * s1 = SH_ALLOC(len1 + 2);
+
+       sl_strlcpy(s0, this->file, len0 + 2); 
+       sl_strlcpy(s1, file,       len1 + 2); 
+
+       if (s0 < s1)
+	 {
+	   sl_strlcat(s0, "/", len0 + 2);
+	   ret = strncmp(s0, s1, len0 + 1);
+	 }
+       else
+	 {
+	   sl_strlcat(s1, "/", len1 + 2);
+	   if (0 == strncmp(s0, s1, len1 + 1))
+	     {
+	       SH_FREE(this->file);
+	       this->file = sh_utils_strdup(file);
+	       ret = 0;
+	     }
+	 }
+       SH_FREE(s0);
+       SH_FREE(s1);
+    }
+  
+  return ret;
+}
+
+void sh_audit_mark (char * file)
+{
+  struct aud_list * all  = mark_these;
+  struct aud_list * this = mark_these;
+
+  if (!mark_these) {
+    add_this (file);
+    return;
+  }
+
+  while (this)
+    {
+      if (0 == test_exchange(this, file))
+	return;
+      this = this->next;
+    }
+
+  add_this (file);
+  return;
+}
+
+void sh_audit_commit ()
+{
+  struct aud_list * next;
+  struct aud_list * this = mark_these;
+
+  mark_these = NULL;
+
+  while (this)
+    {
+      sh_audit_mark_int (this->file);
+      next = this->next;
+      SH_FREE(this->file);
+      SH_FREE(this);
+      this = next;
+    }
+  
+}
 
 static int sh_audit_checkdaemon()
@@ -381,4 +482,8 @@
   return;
 }
+void sh_audit_commit ()
+{
+  return;
+}
 #endif
 
Index: trunk/src/sh_extern.c
===================================================================
--- trunk/src/sh_extern.c	(revision 412)
+++ trunk/src/sh_extern.c	(revision 415)
@@ -847,8 +847,6 @@
 }
 
-int sh_ext_popen_init (sh_tas_t * task, char * command)
-{
-  int status;
-
+static void task_init (sh_tas_t * task)
+{
   sh_ext_tas_init(task);
 
@@ -858,15 +856,45 @@
 			      _("/sbin:/bin:/usr/sbin:/usr/bin:/usr/ucb")); 
   (void) sh_ext_tas_add_envv (task, _("IFS"), " \n\t"); 
+
   if (sh.timezone != NULL)
     {
       (void) sh_ext_tas_add_envv(task,  "TZ", sh.timezone);
     }
+  return;
+}
+
+int sh_ext_popen_init (sh_tas_t * task, char * command, char * argv0, ...)
+{
+  va_list vl;
+  int status;
+
+  task_init (task);
   
-  sh_ext_tas_command(task,  _("/bin/sh"));
-
-  (void) sh_ext_tas_add_argv(task,  _("/bin/sh"));
-  (void) sh_ext_tas_add_argv(task,  _("-c"));
-  (void) sh_ext_tas_add_argv(task,  command);
-  
+  if (!argv0)
+    {
+      sh_ext_tas_command(task,  _("/bin/sh"));
+
+      (void) sh_ext_tas_add_argv(task,  _("/bin/sh"));
+      (void) sh_ext_tas_add_argv(task,  _("-c"));
+      (void) sh_ext_tas_add_argv(task,  command);
+    }
+  else
+    {
+      char * s;
+
+      sh_ext_tas_command(task,  command);
+
+      (void) sh_ext_tas_add_argv(task, argv0);
+
+      va_start (vl, argv0);
+      s = va_arg (vl, char * );
+      while (s != NULL)
+	{
+	  (void) sh_ext_tas_add_argv(task, s);
+	  s = va_arg (vl, char * );
+	}
+      va_end (vl);
+
+    }
   task->rw = 'r';
   task->fork_twice = S_FALSE;
@@ -879,12 +907,32 @@
 /* Execute a system command */
 
-int sh_ext_system (char * command)
+int sh_ext_system (char * command, char * argv0, ...)
 {
   sh_tas_t task;
   int    status;
+  va_list vl;
+  char * s;
 
   SL_ENTER(_("sh_ext_system"));
 
-  status = sh_ext_popen_init (&task, command);
+  task_init (&task);
+  
+  sh_ext_tas_command(&task,  command);
+
+  (void) sh_ext_tas_add_argv(&task, argv0);
+  
+  va_start (vl, argv0);
+  s = va_arg (vl, char * );
+  while (s != NULL)
+    {
+      (void) sh_ext_tas_add_argv(&task, s);
+      s = va_arg (vl, char * );
+    }
+  va_end (vl);
+
+  task.rw = 'r';
+  task.fork_twice = S_FALSE;
+
+  status = sh_ext_popen(&task);
 
   if (status != 0)
@@ -915,5 +963,5 @@
   SL_ENTER(_("sh_ext_popen_str"));
 
-  status = sh_ext_popen_init (&task, command);
+  status = sh_ext_popen_init (&task, command, NULL, NULL);
 
   if (status != 0)
Index: trunk/src/sh_getopt.c
===================================================================
--- trunk/src/sh_getopt.c	(revision 412)
+++ trunk/src/sh_getopt.c	(revision 415)
@@ -401,5 +401,5 @@
   printf (_("Client executable (port %d)"), SH_DEFAULT_PORT); ++num;
 #endif
-#if defined(SH_WITH_CLIENT)
+#if defined(SH_WITH_SERVER)
   if (num > 0) fputc ('\n', stdout);
   printf (_("Server executable (port %d, user %s)"), 
Index: trunk/src/sh_html.c
===================================================================
--- trunk/src/sh_html.c	(revision 412)
+++ trunk/src/sh_html.c	(revision 415)
@@ -503,4 +503,30 @@
 }
 
+int sh_html_zero()
+{
+  long fd;
+
+  SL_ENTER(_("sh_html_zero"));
+
+  if (0 != (fd = tf_trust_check (DEFAULT_HTML_FILE, SL_YESPRIV)))
+    {
+      SL_RETURN((-1), _("sh_html_zero"));
+    }
+
+  fd = sl_open_write_trunc (FIL__, __LINE__, DEFAULT_HTML_FILE, SL_YESPRIV);
+
+  if (SL_ISERROR(fd))
+    {
+     SL_RETURN((-1), _("sh_html_zero"));
+    }
+
+  sh_html_head(fd);
+  sh_html_foot(fd);
+
+  sl_close(fd);
+
+  SL_RETURN((0), _("sh_html_zero"));
+}
+
 /* SH_WITH_SERVER */
 #endif
Index: trunk/src/sh_log_check.c
===================================================================
--- trunk/src/sh_log_check.c	(revision 412)
+++ trunk/src/sh_log_check.c	(revision 415)
@@ -915,5 +915,5 @@
   entry = SH_ALLOC(sizeof(struct task_entry));
 
-  status = sh_ext_popen_init (&(entry->task), logfile->filename);
+  status = sh_ext_popen_init (&(entry->task), logfile->filename, logfile->filename, NULL);
   if (0 == status)
     {
Index: trunk/src/sh_unix.c
===================================================================
--- trunk/src/sh_unix.c	(revision 412)
+++ trunk/src/sh_unix.c	(revision 415)
@@ -1519,7 +1519,13 @@
 #ifdef WITH_ORACLE
     /* 
-     * Skip the ORACLE_HOME environment variable; Oracle may need it.
+     * Skip the ORACLE_HOME and TNS_ADMIN environment variables; 
+     * Oracle may need them.
      */
     if (0 == sl_strncmp((*env), _("ORACLE_HOME="), 12))
+      {
+	++(env);
+	continue;
+      }
+    if (0 == sl_strncmp((*env), _("TNS_ADMIN="), 10))
       {
 	++(env);
