Index: trunk/src/dnmalloc.c
===================================================================
--- trunk/src/dnmalloc.c	(revision 561)
+++ trunk/src/dnmalloc.c	(revision 562)
@@ -165,5 +165,5 @@
  *   HAVE_SYS_PARAM_H Define to #include <sys/param.h> (for pagesize)
  *
- *   HAVE_MALLOC_H    Define to #include <malloc.h> (for struct mallinfo)
+ *   HAVE_MALLOC_H    Define to #include <malloc.h> (for struct mallinfo2)
  *
  *   HAVE_FCNTL_H     Define to #include <fcntl.h>
@@ -531,5 +531,5 @@
 #define vALLOc      public_vALLOc
 #define pVALLOc     public_pVALLOc
-#define mALLINFo    public_mALLINFo
+#define mALLINFo2   public_mALLINFo2
 #define mALLOPt     public_mALLOPt
 #define mTRIm       public_mTRIm
@@ -547,5 +547,5 @@
 #define public_vALLOc    dlvalloc
 #define public_pVALLOc   dlpvalloc
-#define public_mALLINFo  dlmallinfo
+#define public_mALLINFo2 dlmallinfo2
 #define public_mALLOPt   dlmallopt
 #define public_mTRIm     dlmalloc_trim
@@ -561,5 +561,5 @@
 #define public_vALLOc    valloc
 #define public_pVALLOc   pvalloc
-#define public_mALLINFo  mallinfo
+#define public_mALLINFo2 mallinfo2
 #define public_mALLOPt   mallopt
 #define public_mTRIm     malloc_trim
@@ -791,25 +791,25 @@
 
 /*
-  This version of malloc supports the standard SVID/XPG mallinfo
+  This version of malloc supports the standard SVID/XPG mallinfo2
   routine that returns a struct containing usage properties and
   statistics. It should work on any SVID/XPG compliant system that has
-  a /usr/include/malloc.h defining struct mallinfo. (If you'd like to
+  a /usr/include/malloc.h defining struct mallinfo2. (If you'd like to
   install such a thing yourself, cut out the preliminary declarations
   as described above and below and save them in a malloc.h file. But
   there's no compelling reason to bother to do this.)
 
-  The main declaration needed is the mallinfo struct that is returned
-  (by-copy) by mallinfo().  The SVID/XPG malloinfo struct contains a
+  The main declaration needed is the mallinfo2 struct that is returned
+  (by-copy) by mallinfo2().  The SVID/XPG malloinfo2 struct contains a
   bunch of fields that are not even meaningful in this version of
-  malloc.  These fields are are instead filled by mallinfo() with
+  malloc.  These fields are are instead filled by mallinfo2() with
   other numbers that might be of interest.
 
   HAVE_MALLOC_H should be set if you have a
   /usr/include/malloc.h file that includes a declaration of struct
-  mallinfo.  If so, it is included; else an SVID2/XPG2 compliant
+  mallinfo2.  If so, it is included; else an SVID2/XPG2 compliant
   version is declared below.  These must be precisely the same for
-  mallinfo() to work.  The original SVID version of this struct,
-  defined on most systems with mallinfo, declares all fields as
-  ints. But some others define as unsigned long. If your system
+  mallinfo2() to work.  The original SVID version of this struct,
+  defined on most systems with mallinfo2, declares all fields as
+  size_2. But some others define as unsigned long. If your system
   defines the fields using a type of different width than listed here,
   you must #include your system version and #define
@@ -826,17 +826,17 @@
 #else
 
-/* SVID2/XPG mallinfo structure */
-
-struct mallinfo {
-  int arena;    /* non-mmapped space allocated from system */
-  int ordblks;  /* number of free chunks */
-  int smblks;   /* number of fastbin blocks */
-  int hblks;    /* number of mmapped regions */
-  int hblkhd;   /* space in mmapped regions */
-  int usmblks;  /* maximum total allocated space */
-  int fsmblks;  /* space available in freed fastbin blocks */
-  int uordblks; /* total allocated space */
-  int fordblks; /* total free space */
-  int keepcost; /* top-most, releasable (via malloc_trim) space */
+/* SVID2/XPG mallinfo2 structure */
+
+struct mallinfo2 {
+  size_t arena;    /* non-mmapped space allocated from system */
+  size_t ordblks;  /* number of free chunks */
+  size_t smblks;   /* number of fastbin blocks */
+  size_t hblks;    /* number of mmapped regions */
+  size_t hblkhd;   /* space in mmapped regions */
+  size_t usmblks;  /* maximum total allocated space */
+  size_t fsmblks;  /* space available in freed fastbin blocks */
+  size_t uordblks; /* total allocated space */
+  size_t fordblks; /* total free space */
+  size_t keepcost; /* top-most, releasable (via malloc_trim) space */
 };
 
@@ -1008,5 +1008,5 @@
 
 /*
-  mallinfo()
+  mallinfo2()
   Returns (by copy) a struct containing various summary statistics:
 
@@ -1031,7 +1031,7 @@
 */
 #if __STD_C
-struct mallinfo public_mALLINFo(void);
-#else
-struct mallinfo public_mALLINFo();
+struct mallinfo2 public_mALLINFo2(void);
+#else
+struct mallinfo2 public_mALLINFo2();
 #endif
 
@@ -1115,5 +1115,5 @@
 
   malloc_stats prints only the most commonly interesting statistics.
-  More information can be obtained by calling mallinfo.
+  More information can be obtained by calling mallinfo2.
 
 */
@@ -1366,5 +1366,5 @@
 static void     mSTATs();
 static int      mALLOPt(int, int);
-static struct mallinfo mALLINFo(void);
+static struct mallinfo2 mALLINFo2(void);
 #else
 static Void_t*  mALLOc();
@@ -1380,5 +1380,5 @@
 static void     mSTATs();
 static int      mALLOPt();
-static struct mallinfo mALLINFo();
+static struct mallinfo2 mALLINFo2();
 #endif
 
@@ -1687,12 +1687,12 @@
 }
 
-struct mallinfo public_mALLINFo() {
-  struct mallinfo m;
+struct mallinfo2 public_mALLINFo2() {
+  struct mallinfo2 m;
   if (MALLOC_PREACTION == 0) {
-    m = mALLINFo();
+    m = mALLINFo2();
     (void) MALLOC_POSTACTION;
     return m;
   } else {
-    struct mallinfo nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+    struct mallinfo2 nm = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
     return nm;
   }
@@ -5293,8 +5293,8 @@
 */
 
-DL_STATIC struct mallinfo mALLINFo()
+DL_STATIC struct mallinfo2 mALLINFo2()
 {
   mstate av = get_malloc_state();
-  static struct mallinfo mi;
+  static struct mallinfo2 mi;
   unsigned int i;
   mbinptr b;
@@ -5361,5 +5361,5 @@
 DL_STATIC void mSTATs()
 {
-  struct mallinfo mi = mALLINFo();
+  struct mallinfo2 mi = mALLINFo2();
 
   fprintf(stderr, "hashtable = %10lu MB\n", 
Index: trunk/src/sh_login_track.c
===================================================================
--- trunk/src/sh_login_track.c	(revision 561)
+++ trunk/src/sh_login_track.c	(revision 562)
@@ -402,5 +402,5 @@
   while(u)
     {
-      if (0 == strcmp(user, u->user))
+      if (0 == sl_strcmp(user, u->user))
 	{
 	  return u;
@@ -839,13 +839,15 @@
   else
     {
-      q = strchr(host, '.'); 
+      char * tmp = sh_util_strdup(host);
+      q = strchr(tmp, '.'); 
       if (q && *q)
 	{
 	  ++q;
 	  p = sh_util_strdup(q);
+	  SH_FREE(tmp);
 	}
       else
 	{
-	  p = sh_util_strdup(host);
+	  p = tmp;
 	}
     }
Index: trunk/src/sh_tools.c
===================================================================
--- trunk/src/sh_tools.c	(revision 561)
+++ trunk/src/sh_tools.c	(revision 562)
@@ -1386,4 +1386,5 @@
 }
 
+#ifdef SH_ENCRYPT
 static int probe_ok(int flag)
 {
@@ -1393,4 +1394,5 @@
   return S_FALSE;
 }
+#endif
 
 static unsigned char probe_header_set(unsigned char protocol)
@@ -1444,4 +1446,5 @@
 }
 
+#ifdef SH_ENCRYPT
 static int probe_ok(int flag)
 {
@@ -1450,4 +1453,6 @@
   return S_FALSE;
 }
+#endif
+
 #endif
 
Index: trunk/src/t-test0.c
===================================================================
--- trunk/src/t-test0.c	(revision 561)
+++ trunk/src/t-test0.c	(revision 562)
@@ -390,5 +390,5 @@
 		actions = RANDOM(&ld, ACTIONS_MAX);
 #if USE_MALLOC && MALLOC_DEBUG
-		if(actions < 2) { mallinfo(); }
+		if(actions < 2) { mallinfo2(); }
 #endif
 		for(j=0; j<actions; j++) {
Index: trunk/src/t-test1.c
===================================================================
--- trunk/src/t-test1.c	(revision 561)
+++ trunk/src/t-test1.c	(revision 562)
@@ -499,5 +499,5 @@
 		actions = RANDOM(&ld, ACTIONS_MAX);
 #if USE_MALLOC && MALLOC_DEBUG
-		if(actions < 2) { mallinfo(); }
+		if(actions < 2) { mallinfo2(); }
 #endif
 		for(j=0; j<actions; j++) {
Index: trunk/src/yulectl.c
===================================================================
--- trunk/src/yulectl.c	(revision 561)
+++ trunk/src/yulectl.c	(revision 562)
@@ -48,6 +48,8 @@
 #endif
 
+#define SH_PW_SIZE 15
+
 static int    sock     = -1;
-static char   password[15] = "";
+static char   password[SH_PW_SIZE] = "";
 static int    verbose = 0;
 
@@ -123,11 +125,8 @@
 static char * safe_copy(char * to, const char * from, size_t size)
 {
-  if (to && from)
-    {
-      strncpy (to, from, size);
-      if (size > 0)
-	to[size-1] = '\0';
-      else 
-	*to = '\0';
+  if (to && from && (size > 0))
+    {
+      strncpy (to, from, size-1);
+      to[size-1] = '\0';
     }
   return to;
@@ -144,5 +143,11 @@
    */
   name.sun_family = AF_UNIX;
-  strncpy (name.sun_path, serversock, sizeof(name.sun_path) - 1);
+  memcpy(name.sun_path, serversock, sizeof(name.sun_path));
+  name.sun_path[sizeof(name.sun_path)-1] = '\0';
+  if (strlen(serversock) > strlen(name.sun_path))
+    {
+      perror (_("ERROR: socket path too long"));
+      return -1;
+    }
   size = (offsetof (struct sockaddr_un, sun_path)
           + strlen (name.sun_path) + 1);
@@ -401,5 +406,5 @@
    */
   pw = getenv(_("YULECTL_PASSWORD"));
-  if (pw && strlen(pw) < 15)
+  if (pw && strlen(pw) < SH_PW_SIZE)
     {
       strcpy(password, pw);
@@ -413,5 +418,5 @@
     return -1;
 
-  if ( (strlen(home) + strlen(_("/.yulectl_cred")) + 1) > 4096)
+  if ( (strlen(home) + strlen(_("/.yulectl_cred")) + 1) > sizeof(home))
     {
       fprintf (stderr, "%s", _("ERROR: path for $HOME is too long.\n"));
@@ -451,5 +456,5 @@
   (void) rtrim(message2);
 
-  if (strlen(message2) > 14)
+  if (strlen(message2) > (SH_PW_SIZE -1))
     {
       fprintf (stderr, "%s", 
