]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
add comments and fix dumb typos
authorJim Meyering <jim@meyering.net>
Mon, 10 Feb 2003 13:19:00 +0000 (13:19 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 10 Feb 2003 13:19:00 +0000 (13:19 +0000)
src/test.c

index d52c3aef14c248ce148b8e0502ff1f724b695486..3b01f13d437858af3508134080e237e6a2f0866b 100644 (file)
@@ -155,6 +155,7 @@ eaccess (char const *file, int mode)
       egid = getegid ();
     }
 
+  /* Set the real user and group IDs to the effective ones.  */
   if (uid != euid)
     setreuid (euid, uid);
   if (gid != egid)
@@ -162,10 +163,11 @@ eaccess (char const *file, int mode)
 
   result = access (file, mode);
 
+  /* Restore them.  */
   if (uid != euid)
-    setreuid (euid, uid);
+    setreuid (uid, euid);
   if (gid != egid)
-    setregid (egid, gid);
+    setregid (gid, egid);
 
   return result;
 }