|
|
@@ -13,35 +13,44 @@
|
|
|
#include "system.h"
|
|
|
|
|
|
#include "closeout.h"
|
|
|
---- src/test.c.orig Wed Sep 25 10:22:37 2002
|
|
|
-+++ src/test.c Sun Jan 12 11:49:50 2003
|
|
|
-@@ -151,7 +151,7 @@
|
|
|
- and don't make the mistake of telling root that any file is executable.
|
|
|
- But this loses when the containing filesystem is mounted e.g. read-only. */
|
|
|
+--- src/test.c.orig Mon Feb 10 10:19:09 2003
|
|
|
++++ src/test.c Sun Feb 23 20:44:50 2003
|
|
|
+@@ -139,7 +139,7 @@
|
|
|
+ /* Do the same thing access(2) does, but use the effective uid and gid. */
|
|
|
+
|
|
|
static int
|
|
|
--eaccess (char *path, int mode)
|
|
|
-+myeaccess (char *path, int mode)
|
|
|
+-eaccess (char const *file, int mode)
|
|
|
++my_eaccess (char const *file, int mode)
|
|
|
{
|
|
|
- struct stat st;
|
|
|
- static uid_t euid = -1;
|
|
|
-@@ -645,17 +645,17 @@
|
|
|
+ static int have_ids;
|
|
|
+ static uid_t uid, euid;
|
|
|
+@@ -172,7 +172,7 @@
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ #else
|
|
|
+-# define eaccess(F, M) euidaccess (F, M)
|
|
|
++# define my_eaccess(F, M) euidaccess (F, M)
|
|
|
+ #endif
|
|
|
+
|
|
|
+ /* Increment our position in the argument list. Check that we're not
|
|
|
+@@ -635,17 +635,17 @@
|
|
|
|
|
|
case 'r': /* file is readable? */
|
|
|
unary_advance ();
|
|
|
- value = -1 != eaccess (argv[pos - 1], R_OK);
|
|
|
-+ value = -1 != myeaccess (argv[pos - 1], R_OK);
|
|
|
++ value = -1 != my_eaccess (argv[pos - 1], R_OK);
|
|
|
return (TRUE == value);
|
|
|
|
|
|
case 'w': /* File is writable? */
|
|
|
unary_advance ();
|
|
|
- value = -1 != eaccess (argv[pos - 1], W_OK);
|
|
|
-+ value = -1 != myeaccess (argv[pos - 1], W_OK);
|
|
|
++ value = -1 != my_eaccess (argv[pos - 1], W_OK);
|
|
|
return (TRUE == value);
|
|
|
|
|
|
case 'x': /* File is executable? */
|
|
|
unary_advance ();
|
|
|
- value = -1 != eaccess (argv[pos - 1], X_OK);
|
|
|
-+ value = -1 != myeaccess (argv[pos - 1], X_OK);
|
|
|
++ value = -1 != my_eaccess (argv[pos - 1], X_OK);
|
|
|
return (TRUE == value);
|
|
|
|
|
|
case 'O': /* File is owned by you? */
|