-typo
[oweals/gnunet.git] / src / util / service.c
index cb2644d743c70bdb34eade10b32db1ae97431e92..e2d056d7ff79556f2ce60375b2fa924817bb23d9 100644 (file)
@@ -37,6 +37,7 @@
 #include "gnunet_service_lib.h"
 
 #if HAVE_MALLINFO
+#include <malloc.h>
 #include "gauger.h"
 #endif
 
@@ -659,10 +660,12 @@ check_access (void *cls, const struct GNUNET_CONNECTION_Credentials *uc,
     if (GNUNET_YES == sctx->match_uid) 
     {
       /* UID match required */
-      ret = (NULL != uc) && (uc->uid == geteuid ());
+      ret = (NULL != uc) && ( (0 == uc->uid) || (uc->uid == geteuid ()) );
     }
     else if ( (GNUNET_YES == sctx->match_gid) &&
-             ( (NULL == uc) || (uc->uid != geteuid ()) ) )
+             ( (NULL == uc) || 
+               ( (0 != uc->uid) &&
+                 (uc->uid != geteuid ()) ) ) )
     {
       /* group match required and UID does not match */
       if (NULL == uc) 
@@ -1939,7 +1942,7 @@ GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx)
       struct mallinfo mi;
       
       mi = mallinfo ();
-      GAUGER (service_name, counter, mi.usmblks, "blocks");
+      GAUGER (sctx->service_name, counter, mi.usmblks, "blocks");
       GNUNET_free (counter);
     }     
   }