Commit | Line | Data |
---|---|---|
dfa1e3c6 | 1 | #ifndef lint |
ff7f72d8 | 2 | static char sccsid[] = "@(#)anyread.c 5.4 (Berkeley) %G%"; |
dfa1e3c6 SL |
3 | #endif |
4 | ||
5 | #include "uucp.h" | |
dfa1e3c6 SL |
6 | #include <sys/stat.h> |
7 | ||
ff7f72d8 JB |
8 | /*LINTLIBRARY*/ |
9 | ||
88db71e9 | 10 | /* |
dfa1e3c6 | 11 | * anyread check if anybody can read |
88db71e9 | 12 | * return SUCCESS ok: FAIL not ok |
dfa1e3c6 | 13 | */ |
dfa1e3c6 SL |
14 | anyread(file) |
15 | char *file; | |
16 | { | |
17 | struct stat s; | |
18 | ||
88db71e9 | 19 | if (stat(subfile(file), &s) < 0) |
dfa1e3c6 | 20 | /* for security check a non existant file is readable */ |
88db71e9 | 21 | return SUCCESS; |
dfa1e3c6 | 22 | if (!(s.st_mode & ANYREAD)) |
88db71e9 RC |
23 | return FAIL; |
24 | return SUCCESS; | |
dfa1e3c6 | 25 | } |