#include "gnunet_service_lib.h"
#if HAVE_MALLINFO
+#include <malloc.h>
#include "gauger.h"
#endif
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)
struct mallinfo mi;
mi = mallinfo ();
- GAUGER (service_name, counter, mi.usmblks, "blocks");
+ GAUGER (sctx->service_name, counter, mi.usmblks, "blocks");
GNUNET_free (counter);
}
}