diff options
author | brian <brian@cvs.openbsd.org> | 1999-08-09 23:01:37 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1999-08-09 23:01:37 +0000 |
commit | 8041968fca29692660edd7b48145390b406f95c5 (patch) | |
tree | 24b9623c9ed21ae46efdac1a1e296bf6da659e98 /usr.sbin/ppp | |
parent | 883e51f494cfcddec7daa3f5ebf865cb8e350973 (diff) |
Insist that ppp.conf and it's parent directories aren't `other'
writable rather than not being writable at all.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/ppp/main.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/ppp/ppp/main.c b/usr.sbin/ppp/ppp/main.c index f85c4adb490..9493a3cdfed 100644 --- a/usr.sbin/ppp/ppp/main.c +++ b/usr.sbin/ppp/ppp/main.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: main.c,v 1.13 1999/05/13 16:33:32 brian Exp $ + * $Id: main.c,v 1.14 1999/08/09 23:01:36 brian Exp $ * * TODO: */ @@ -37,6 +37,7 @@ #include <sys/time.h> #include <termios.h> #include <unistd.h> +#include <sys/stat.h> #ifndef NOALIAS #ifdef __FreeBSD__ @@ -305,7 +306,9 @@ main(int argc, char **argv) snprintf(conf, sizeof conf, "%s/%s", _PATH_PPP, CONFFILE); do { - if (!access(conf, W_OK)) { + struct stat sb; + + if (stat(conf, &sb) == 0 && sb.st_mode & S_IWOTH) { log_Printf(LogALERT, "ppp: Access violation: Please protect %s\n", conf); return -1; |