Index: trunk/src/sh_userfiles.c
===================================================================
--- trunk/src/sh_userfiles.c	(revision 582)
+++ trunk/src/sh_userfiles.c	(revision 1)
@@ -30,4 +30,5 @@
 #include <pwd.h>
 
+
 #include "samhain.h"
 #include "sh_modules.h"
@@ -38,7 +39,4 @@
 #include "sh_hash.h"
 #include "sh_files.h"
-#define SH_NEED_PWD_GRP 1
-#include "sh_static.h"
-#include "sh_pthread.h"
 
 #ifdef SH_USE_USERFILES
@@ -117,8 +115,8 @@
 }
   
-int sh_userfiles_set_uid (const char * str)
+int sh_userfiles_set_uid (char * str)
 {
   char * end;
-  const  char * p = str;
+  char * p = str;
   unsigned long lower;
   unsigned long upper = 0;
@@ -185,5 +183,5 @@
  * directory that should be checked. */
 
-int sh_userfiles_add_file(const char *c) {
+int sh_userfiles_add_file(char *c) {
     struct userfileslist *new;
     char *s, *orig;
@@ -215,16 +213,13 @@
      * So, compare longest strings first */
     if( s == NULL ) /* The default */          new->level = default_level;
-    else if ( strstr(s, _("attributes"))!= NULL ) new->level = SH_LEVEL_ATTRIBUTES;
-    else if ( strstr(s, _("allignore")) != NULL ) new->level = SH_LEVEL_ALLIGNORE;
-    else if ( strstr(s, _("noignore"))  != NULL ) new->level = SH_LEVEL_NOIGNORE;
-    else if ( strstr(s, _("logfiles"))  != NULL ) new->level = SH_LEVEL_LOGFILES;
-    else if ( strstr(s, _("readonly"))  != NULL ) new->level = SH_LEVEL_READONLY;
-    else if ( strstr(s, _("loggrow"))   != NULL ) new->level = SH_LEVEL_LOGGROW;
-    else if ( strstr(s, _("user0"))     != NULL ) new->level = SH_LEVEL_USER0;
-    else if ( strstr(s, _("user1"))     != NULL ) new->level = SH_LEVEL_USER1;
-    else if ( strstr(s, _("user2"))     != NULL ) new->level = SH_LEVEL_USER2;
-    else if ( strstr(s, _("user3"))     != NULL ) new->level = SH_LEVEL_USER3;
-    else if ( strstr(s, _("user4"))     != NULL ) new->level = SH_LEVEL_USER4;
-    else if ( strstr(s, _("prelink"))   != NULL ) new->level = SH_LEVEL_PRELINK;
+    else if ( strstr(s, "attributes")!= NULL ) new->level = SH_LEVEL_ATTRIBUTES;
+    else if ( strstr(s, "allignore") != NULL ) new->level = SH_LEVEL_ALLIGNORE;
+    else if ( strstr(s, "noignore")  != NULL ) new->level = SH_LEVEL_NOIGNORE;
+    else if ( strstr(s, "logfiles")  != NULL ) new->level = SH_LEVEL_LOGFILES;
+    else if ( strstr(s, "readonly")  != NULL ) new->level = SH_LEVEL_READONLY;
+    else if ( strstr(s, "loggrow")   != NULL ) new->level = SH_LEVEL_LOGGROW;
+    else if ( strstr(s, "user0")     != NULL ) new->level = SH_LEVEL_USER0;
+    else if ( strstr(s, "user1")     != NULL ) new->level = SH_LEVEL_USER1;
+    else if ( strstr(s, "prelink")   != NULL ) new->level = SH_LEVEL_PRELINK;
     else            /* The default */          new->level = default_level;
 
@@ -234,11 +229,21 @@
 }
 
-/* Decide if we're active. 
- */
-int sh_userfiles_set_active(const char *c) {
+/* Decide if we're active.  1 means yes, all else means no */
+
+int sh_userfiles_set_active(char *c) {
     int value;
     
     SL_ENTER(_("sh_userfiles_set_active"));
+
     value = sh_util_flagval(c, &ShUserfilesActive);
+
+    /*
+    if( value == 1 ) {
+        ShUserfilesActive = S_TRUE;
+    } else {
+        ShUserfilesActive = S_FALSE;
+    }
+    */
+
     SL_RETURN((value), _("sh_userfiles_set_active"));
 }
@@ -246,11 +251,9 @@
 /* Build the list of users, then use this to construct the filenames to
  * be checked. */
-int sh_userfiles_init(struct mod_type * arg) {
+int sh_userfiles_init(void) {
     struct passwd *cur_user;
     struct userhomeslist *end;
     struct userhomeslist *new;
     struct userhomeslist *homes;
-    char * filepath;
-    (void) arg;
 
     SL_ENTER(_("sh_userfiles_init"));
@@ -269,9 +272,8 @@
     /* We build a list in here because the samhain internals want to use
      * getpwent() too */
-    SH_MUTEX_LOCK(mutex_pwent);
     /*@-unrecog@*/
-    sh_setpwent();
+    setpwent();
     /*@+unrecog@*/
-    while( ( cur_user = /*@-unrecog@*/sh_getpwent()/*@+unrecog@*/ ) != NULL ) {
+    while( ( cur_user = /*@-unrecog@*/getpwent()/*@+unrecog@*/ ) != NULL ) {
         int found = 0;
 
@@ -295,11 +297,8 @@
         }
     }
-    sh_endpwent();
-    SH_MUTEX_UNLOCK(mutex_pwent);
-
-    filepath = SH_ALLOC(PATH_MAX);
 
     for (homes = userHomes; homes != NULL; homes = homes->next ) {
         struct userfileslist *file_ptr;
+        char filepath[PATH_MAX];
 
         for (file_ptr = userFiles; file_ptr != NULL; file_ptr = file_ptr->next) {
@@ -333,13 +332,4 @@
                     (void) sh_files_pushfile_user1(filepath);
                     break;
-                case SH_LEVEL_USER2:
-                    (void) sh_files_pushfile_user2(filepath);
-                    break;
-                case SH_LEVEL_USER3:
-                    (void) sh_files_pushfile_user3(filepath);
-                    break;
-                case SH_LEVEL_USER4:
-                    (void) sh_files_pushfile_user4(filepath);
-                    break;
                 case SH_LEVEL_PRELINK:
                     (void) sh_files_pushfile_prelink(filepath);
@@ -350,6 +340,4 @@
         }
     }
-
-    SH_FREE(filepath);
 
     SL_RETURN(0, _("sh_userfiles_init"));
@@ -393,7 +381,4 @@
     userHomes = NULL;
     userFiles = NULL;
-    userUids  = NULL;
-
-    ShUserfilesActive   = S_TRUE;
 
     SL_RETURN(0, _("sh_userfiles_reconf"));
