Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_file
Modified Files:
ecore_file.c
Log Message:
be more lenient and use access() to check
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_file/ecore_file.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- ecore_file.c 30 Sep 2005 08:41:21 -0000 1.22
+++ ecore_file.c 2 Oct 2005 15:44:24 -0000 1.23
@@ -189,31 +189,9 @@
int
ecore_file_can_exec(const char *file)
{
- static int have_uid = 0;
- static uid_t uid = -1;
- static gid_t gid = -1;
- struct stat st;
- int ok;
- char buf[PATH_MAX];
-
if (!file) return 0;
- if (!realpath(file, buf)) return 0;
- if (stat(buf, &st) < 0) return 0;
-
- ok = 0;
- if (!have_uid) uid = getuid();
- if (!have_uid) gid = getgid();
- have_uid = 1;
- if (st.st_uid == uid)
- {
- if (st.st_mode & S_IXUSR) ok = 1;
- }
- else if (st.st_gid == gid)
- {
- if (st.st_mode & S_IXGRP) ok = 1;
- }
- if (st.st_mode & S_IXOTH) ok = 1;
- return (ok);
+ if (!access(file, X_OK)) return 1;
+ return 0;
}
char *
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs