summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-08-09 22:54:51 +0000
committerbrian <brian@FreeBSD.org>1999-08-09 22:54:51 +0000
commit460ac15b25646ba12f3ff3575aab39ae035a5342 (patch)
treec4d22e8ae6a27de4eeecfe8406d2545f10df1c46 /usr.sbin
parentf99d6448113d4c5d458e90e3e79f2fe499f54746 (diff)
downloadFreeBSD-src-460ac15b25646ba12f3ff3575aab39ae035a5342.zip
FreeBSD-src-460ac15b25646ba12f3ff3575aab39ae035a5342.tar.gz
Insist that ppp.conf and it's parent directories aren't `other'
writable rather than not being writable at all. PR: 13009 Kind-of submitted by: Anthony Kimball <alk@pobox.com>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index fb79b26..9a08747 100644
--- a/usr.sbin/ppp/main.c
+++ b/usr.sbin/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.154 1999/05/08 11:07:05 brian Exp $
+ * $Id: main.c,v 1.155 1999/05/13 16:34:57 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;
OpenPOWER on IntegriCloud