xref: /csrg-svn/usr.bin/uucp/libuu/anyread.c (revision 23585)
113635Ssam #ifndef lint
2*23585Sbloom static char sccsid[] = "@(#)anyread.c	5.4 (Berkeley) 06/19/85";
313635Ssam #endif
413635Ssam 
513635Ssam #include "uucp.h"
613635Ssam #include <sys/stat.h>
713635Ssam 
8*23585Sbloom /*LINTLIBRARY*/
9*23585Sbloom 
1017767Sralph /*
1113635Ssam  *	anyread		check if anybody can read
1217767Sralph  *	return SUCCESS ok: FAIL not ok
1313635Ssam  */
1413635Ssam anyread(file)
1513635Ssam char *file;
1613635Ssam {
1713635Ssam 	struct stat s;
1813635Ssam 
1917767Sralph 	if (stat(subfile(file), &s) < 0)
2013635Ssam 		/* for security check a non existant file is readable */
2117767Sralph 		return SUCCESS;
2213635Ssam 	if (!(s.st_mode & ANYREAD))
2317767Sralph 		return FAIL;
2417767Sralph 	return SUCCESS;
2513635Ssam }
26