-ecc sign/verify only
[oweals/gnunet.git] / src / util / service.c
index af0d0769aa2d6bd3c46b56469d16160cc5ed9a33..67d8583cc943f242b40f313f293c7bbc7d91b5a9 100644 (file)
@@ -660,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) 
@@ -1727,6 +1729,7 @@ GNUNET_SERVICE_run (int argc, char *const *argv, const char *service_name,
 #define HANDLE_ERROR do { GNUNET_break (0); goto shutdown; } while (0)
 
   int err;
+  int ret;
   char *cfg_fn;
   char *loglev;
   char *logfile;
@@ -1763,10 +1766,16 @@ GNUNET_SERVICE_run (int argc, char *const *argv, const char *service_name,
   sctx.task_cls = task_cls;
   sctx.service_name = service_name;
   sctx.cfg = cfg = GNUNET_CONFIGURATION_create ();
+
   /* setup subsystems */
-  if (GNUNET_SYSERR ==
-      GNUNET_GETOPT_run (service_name, service_options, argc, argv))
+  ret = GNUNET_GETOPT_run (service_name, service_options, argc, argv);
+  if (GNUNET_SYSERR == ret)
     goto shutdown;
+  if (GNUNET_NO == ret)
+  {
+    err = 0;
+    goto shutdown;
+  }
   if (GNUNET_OK != GNUNET_log_setup (service_name, loglev, logfile))
     HANDLE_ERROR;
   if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cfg_fn))