Index: trunk/src/sh_gpg.c
===================================================================
--- trunk/src/sh_gpg.c	(revision 109)
+++ trunk/src/sh_gpg.c	(revision 111)
@@ -292,7 +292,6 @@
       struct stat lbuf;
       int         status_stat = 0;
-      struct passwd * tempres = getpwnam(DEFAULT_IDENT);
-      if (!tempres)
-	tempres = sh_getpwnam(DEFAULT_IDENT);
+      struct passwd * tempres = sh_getpwnam(DEFAULT_IDENT);
+
       if (!tempres)
 	{
@@ -953,7 +952,6 @@
       TPT(((0), FIL__, __LINE__, _("msg=<GPG_CHECK: FD1 = %d>\n"), fd1));
 #if defined(SH_WITH_SERVER)
-      tempres = getpwnam(DEFAULT_IDENT);
-      if (!tempres)
-	tempres = sh_getpwnam(DEFAULT_IDENT);
+      tempres = sh_getpwnam(DEFAULT_IDENT);
+
       if ((tempres != NULL) && (0 == sl_ret_euid()))
 	{
@@ -971,7 +969,6 @@
       TPT(((0), FIL__, __LINE__, _("msg=<GPG_CHECK: FD2 = %d>\n"), fd2));
 #if defined(SH_WITH_SERVER)
-      tempres = getpwnam(DEFAULT_IDENT);
-      if (!tempres)
-	tempres = sh_getpwnam(DEFAULT_IDENT);
+      tempres = sh_getpwnam(DEFAULT_IDENT);
+
       if ((tempres != NULL) && (0 == sl_ret_euid()))
 	{
@@ -1080,7 +1077,6 @@
 
 #if defined(SH_WITH_SERVER)
-      struct passwd * e_tempres = getpwnam(DEFAULT_IDENT);
-      if (!e_tempres)
-	e_tempres = sh_getpwnam(DEFAULT_IDENT);
+      struct passwd * e_tempres = sh_getpwnam(DEFAULT_IDENT);
+
       if ((e_tempres != NULL) && (0 == sl_ret_euid()))   
 	{
Index: trunk/src/sh_userfiles.c
===================================================================
--- trunk/src/sh_userfiles.c	(revision 109)
+++ trunk/src/sh_userfiles.c	(revision 111)
@@ -39,4 +39,6 @@
 #include "sh_hash.h"
 #include "sh_files.h"
+#define SH_NEED_PWD_GRP 1
+#include "sh_static.h"
 
 #ifdef SH_USE_USERFILES
@@ -266,7 +268,7 @@
      * getpwent() too */
     /*@-unrecog@*/
-    setpwent();
+    sh_setpwent();
     /*@+unrecog@*/
-    while( ( cur_user = /*@-unrecog@*/getpwent()/*@+unrecog@*/ ) != NULL ) {
+    while( ( cur_user = /*@-unrecog@*/sh_getpwent()/*@+unrecog@*/ ) != NULL ) {
         int found = 0;
 
Index: trunk/src/trustfile.c
===================================================================
--- trunk/src/trustfile.c	(revision 109)
+++ trunk/src/trustfile.c	(revision 111)
@@ -429,5 +429,5 @@
 	  /* map user name to UID and compare */
 #ifdef TRUST_MAIN
-	  if ((w = getpwnam(*p)) != NULL && *u == (uid_t)(w->pw_uid) )
+	  if ((w = sh_getpwnam(*p)) != NULL && *u == (uid_t)(w->pw_uid) )
 	    SL_IRETURN(SL_TRUE, _("isingrp"));
 #else
@@ -445,5 +445,5 @@
     {
 #ifdef TRUST_MAIN
-      if ((w = getpwuid(*u)) != NULL && grp == (gid_t)(w->pw_gid) )
+      if ((w = sh_getpwuid(*u)) != NULL && grp == (gid_t)(w->pw_gid) )
 	SL_IRETURN(SL_TRUE, _("isingrp"));
 #else
@@ -961,5 +961,5 @@
   tf_path[0] = '\0';
 #if defined(SH_WITH_SERVER)
-  pass = getpwnam(SH_IDENT);
+  pass = sh_getpwnam(SH_IDENT);
   if (pass != NULL)
     tf_euid = pass->pw_uid;
