[Pvfs2-cvs] commit by slang in pvfs2/src/common/misc: pint-util.c

CVS commit program cvs at parl.clemson.edu
Wed Dec 6 03:58:08 EST 2006


Update of /projects/cvsroot/pvfs2/src/common/misc
In directory parlweb1:/tmp/cvs-serv4108/src/common/misc

Modified Files:
      Tag: pvfs-2-6-branch
	pint-util.c 
Log Message:
fix getgrgid_r failure check.  getgrgid_r returns 0 even if the gid doesn't exist, so we need to check if the last parameter is null.


Index: pint-util.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/misc/pint-util.c,v
diff -p -u -r1.16 -r1.16.8.1
--- pint-util.c	26 Sep 2006 03:44:17 -0000	1.16
+++ pint-util.c	6 Dec 2006 08:58:08 -0000	1.16.8.1
@@ -526,7 +526,7 @@ static int PINT_check_group(uid_t uid, g
     if(ret != 0)
     {
         gen_mutex_unlock(&check_group_mutex);
-        return(-PVFS_ENOENT);
+        return(-PVFS_EINVAL);
     }
 
     /* check primary group */
@@ -539,7 +539,15 @@ static int PINT_check_group(uid_t uid, g
     if(ret != 0)
     {
         gen_mutex_unlock(&check_group_mutex);
-        return(-PVFS_ENOENT);
+        return(-PVFS_EINVAL);
+    }
+
+    if(grp_p == NULL)
+    { 
+	gen_mutex_unlock(&check_group_mutex);
+	gossip_err("User (uid=%d) isn't in group %d on storage node.\n",
+		   uid, gid);
+        return(-PVFS_EINVAL);
     }
 
     gen_mutex_unlock(&check_group_mutex);



More information about the Pvfs2-cvs mailing list