wizkit fix

This commit is contained in:
nethack.allison
2002-01-23 17:52:53 +00:00
parent 579a42103e
commit 0011db11d3
+21 -22
View File
@@ -1596,31 +1596,31 @@ fopen_wizkit_file()
char *envp; char *envp;
#endif #endif
if (wizkit[0]) { if (!wizkit[0]) return (FILE *)0;
#ifdef UNIX #ifdef UNIX
if (access(wizkit, 4) == -1) { if (access(wizkit, 4) == -1) {
/* 4 is R_OK on newer systems */ /* 4 is R_OK on newer systems */
/* nasty sneaky attempt to read file through /* nasty sneaky attempt to read file through
* NetHack's setuid permissions -- this is a * NetHack's setuid permissions -- this is a
* place a file name may be wholly under the player's * place a file name may be wholly under the player's
* control * control
*/ */
raw_printf("Access to %s denied (%d).", raw_printf("Access to %s denied (%d).",
wizkit, errno); wizkit, errno);
wait_synch(); wait_synch();
/* fall through to standard names */ /* fall through to standard names */
} else } else
#endif #endif
if ((fp = fopenp(wizkit, "r")) != (FILE *)0) { if ((fp = fopenp(wizkit, "r")) != (FILE *)0) {
return(fp); return(fp);
#if defined(UNIX) || defined(VMS) #if defined(UNIX) || defined(VMS)
} else { } else {
/* access() above probably caught most problems for UNIX */ /* access() above probably caught most problems for UNIX */
raw_printf("Couldn't open requested config file %s (%d).", raw_printf("Couldn't open requested config file %s (%d).",
wizkit, errno); wizkit, errno);
wait_synch(); wait_synch();
#endif #endif
}
} }
#if defined(MICRO) || defined(MAC) || defined(__BEOS__) || defined(WIN32) #if defined(MICRO) || defined(MAC) || defined(__BEOS__) || defined(WIN32)
@@ -1652,7 +1652,6 @@ fopen_wizkit_file()
# endif # endif
#endif #endif
return (FILE *)0; return (FILE *)0;
} }
void void