X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=src%2Fdumper.c;h=b60496c4ac4521572e5d6d22c0bdf56d0425e7e4;hp=b66681261f2401ece621cd6c5e76768becadcf7c;hb=d81014e89b5102527e5b50aac62edeed2955671d;hpb=1bbdeb3a4ec887b8a6bcacb0384a978cc3b1f6f5 diff --git a/src/dumper.c b/src/dumper.c index b666812..b60496c 100644 --- a/src/dumper.c +++ b/src/dumper.c @@ -1415,13 +1415,17 @@ pdump_load (const char *argv0) } strcpy (w, name); - /* ### #$%$#^$^@%$^#%@$ ! */ -#ifdef access -#undef access -#endif + /* Check that exe_path is executable and not a directory */ +#undef access /* avoid !@#$%^& encapsulated access */ +#undef stat /* avoid !@#$%^& encapsulated stat */ + { + struct stat statbuf; + if (access (exe_path, X_OK) == 0 + && stat (exe_path, &statbuf) == 0 + && ! S_ISDIR (statbuf.st_mode)) + break; + } - if (!access (exe_path, X_OK)) - break; if (!*p) { /* Oh well, let's have some kind of default */