date and time created 83/07/02 17:57:37 by sam
[unix-history] / usr / src / usr.bin / uucp / libuu / anyread.c
#ifndef lint
static char sccsid[] = "@(#)anyread.c 5.1 (Berkeley) %G%";
#endif
#include "uucp.h"
#include <sys/types.h>
#include <sys/stat.h>
/*******
* anyread check if anybody can read
* return 0 ok: FAIL not ok
*/
anyread(file)
char *file;
{
struct stat s;
if (stat(subfile(file), &s) != 0)
/* for security check a non existant file is readable */
return(0);
if (!(s.st_mode & ANYREAD))
return(FAIL);
return(0);
}