Deleted Added
sdiff udiff text old ( 47119 ) new ( 49581 )
full compact
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 $
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
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 {
308 if (!access(conf, W_OK)) {
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 ---