main.c (47119) | main.c (49581) |
---|---|
1/* 2 * User Process PPP 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * | 1/* 2 * User Process PPP 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * |
20 * $Id: main.c,v 1.154 1999/05/08 11:07:05 brian Exp $ | 20 * $Id: main.c,v 1.155 1999/05/13 16:34:57 brian Exp $ |
21 * 22 * TODO: 23 */ 24 25#include <sys/param.h> 26#include <netinet/in.h> 27#include <netinet/in_systm.h> 28#include <netinet/ip.h> 29#include <sys/un.h> 30 31#include <errno.h> 32#include <fcntl.h> 33#include <paths.h> 34#include <signal.h> 35#include <stdio.h> 36#include <string.h> 37#include <sys/time.h> 38#include <termios.h> 39#include <unistd.h> | 21 * 22 * TODO: 23 */ 24 25#include <sys/param.h> 26#include <netinet/in.h> 27#include <netinet/in_systm.h> 28#include <netinet/ip.h> 29#include <sys/un.h> 30 31#include <errno.h> 32#include <fcntl.h> 33#include <paths.h> 34#include <signal.h> 35#include <stdio.h> 36#include <string.h> 37#include <sys/time.h> 38#include <termios.h> 39#include <unistd.h> |
40#include <sys/stat.h> |
|
40 41#ifndef NOALIAS 42#ifdef __FreeBSD__ 43#include <alias.h> 44#else 45#include "alias.h" 46#endif 47#endif --- 252 unchanged lines hidden (view full) --- 300 SignalPrompt = prompt = prompt_Create(NULL, NULL, PROMPT_STD); 301 302 ID0init(); 303 if (ID0realuid() != 0) { 304 char conf[200], *ptr; 305 306 snprintf(conf, sizeof conf, "%s/%s", _PATH_PPP, CONFFILE); 307 do { | 41 42#ifndef NOALIAS 43#ifdef __FreeBSD__ 44#include <alias.h> 45#else 46#include "alias.h" 47#endif 48#endif --- 252 unchanged lines hidden (view full) --- 301 SignalPrompt = prompt = prompt_Create(NULL, NULL, PROMPT_STD); 302 303 ID0init(); 304 if (ID0realuid() != 0) { 305 char conf[200], *ptr; 306 307 snprintf(conf, sizeof conf, "%s/%s", _PATH_PPP, CONFFILE); 308 do { |
308 if (!access(conf, W_OK)) { | 309 struct stat sb; 310 311 if (stat(conf, &sb) == 0 && sb.st_mode & S_IWOTH) { |
309 log_Printf(LogALERT, "ppp: Access violation: Please protect %s\n", 310 conf); 311 return -1; 312 } 313 ptr = conf + strlen(conf)-2; 314 while (ptr > conf && *ptr != '/') 315 *ptr-- = '\0'; 316 } while (ptr >= conf); --- 263 unchanged lines hidden --- | 312 log_Printf(LogALERT, "ppp: Access violation: Please protect %s\n", 313 conf); 314 return -1; 315 } 316 ptr = conf + strlen(conf)-2; 317 while (ptr > conf && *ptr != '/') 318 *ptr-- = '\0'; 319 } while (ptr >= conf); --- 263 unchanged lines hidden --- |