-static int have_ids = 0;
-
-/* Like euidaccess, except that a pointer to a filled-in stat structure
- describing the file is provided instead of a filename.
- Because this function is almost guaranteed to fail on systems that
- use ACLs, a third argument *PATH may be used. If it is non-NULL,
- it is assumed to be the name of the file corresponding to STATP.
- Then, if the user is not running set-uid or set-gid, use access
- instead of attempting a manual and non-portable comparison. */
-
-static int
-eaccess_stat (statp, mode, path)
- const struct stat *statp;
- int mode;
- const char *path;
-{
- int granted;
-
- mode &= (X_OK | W_OK | R_OK); /* Clear any bogus bits. */
-
- if (mode == F_OK)
- return 0; /* The file exists. */
-
- if (have_ids == 0)
- {
- have_ids = 1;
- uid = getuid ();
- gid = getgid ();
- euid = geteuid ();
- egid = getegid ();
- }