-UID match is sufficient if GID match is required
authorChristian Grothoff <christian@grothoff.org>
Sat, 24 Mar 2012 15:24:38 +0000 (15:24 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 24 Mar 2012 15:24:38 +0000 (15:24 +0000)
src/util/service.c

index 7583dccb6d78b6cd59d413f13eca09b46d01eb90..34d6761376e80097b7bb8ae6ce25ca6b18d09ad3 100644 (file)
@@ -626,9 +626,10 @@ check_access (void *cls, const struct GNUNET_CONNECTION_Credentials *uc,
       /* UID match required */
       ret = (uc != NULL) && (uc->uid == geteuid ());
     }
-    else if (sctx->match_gid == GNUNET_YES) 
+    else if ( (sctx->match_gid == GNUNET_YES) &&
+             ( (uc == NULL) || (uc->uid != geteuid ()) ) )
     {
-      /* group match required */
+      /* group match required and UID does not match */
       if (uc == NULL) 
       {
        /* no credentials, group match not possible */