systems.c (50479) | systems.c (51005) |
---|---|
1/* 2 * System configuration routines 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 * System configuration routines 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 * $FreeBSD: head/usr.sbin/ppp/systems.c 50479 1999-08-28 01:35:59Z peter $ | 20 * $FreeBSD: head/usr.sbin/ppp/systems.c 51005 1999-09-06 08:16:33Z brian $ |
21 * 22 * TODO: 23 */ 24#include <sys/param.h> 25 26#include <ctype.h> 27#include <pwd.h> 28#include <stdio.h> --- 233 unchanged lines hidden (view full) --- 262 char line[LINE_LEN]; 263 char filename[MAXPATHLEN]; 264 int linenum; 265 int argc; 266 char *argv[MAXARGS]; 267 int allowcmd; 268 int indent; 269 char arg[LINE_LEN]; | 21 * 22 * TODO: 23 */ 24#include <sys/param.h> 25 26#include <ctype.h> 27#include <pwd.h> 28#include <stdio.h> --- 233 unchanged lines hidden (view full) --- 262 char line[LINE_LEN]; 263 char filename[MAXPATHLEN]; 264 int linenum; 265 int argc; 266 char *argv[MAXARGS]; 267 int allowcmd; 268 int indent; 269 char arg[LINE_LEN]; |
270 struct prompt *op; |
|
270 271 if (*file == '/') 272 snprintf(filename, sizeof filename, "%s", file); 273 else 274 snprintf(filename, sizeof filename, "%s/%s", _PATH_PPP, file); 275 fp = ID0fopen(filename, "r"); 276 if (fp == NULL) { 277 log_Printf(LogDEBUG, "ReadSystem: Can't open %s.\n", filename); --- 59 unchanged lines hidden (view full) --- 337 } 338 break; 339 } 340 341 len = strlen(cp); 342 argc = command_Interpret(cp, len, argv); 343 allowcmd = argc > 0 && !strcasecmp(argv[0], "allow"); 344 if ((!(how == SYSTEM_EXEC) && allowcmd) || | 271 272 if (*file == '/') 273 snprintf(filename, sizeof filename, "%s", file); 274 else 275 snprintf(filename, sizeof filename, "%s/%s", _PATH_PPP, file); 276 fp = ID0fopen(filename, "r"); 277 if (fp == NULL) { 278 log_Printf(LogDEBUG, "ReadSystem: Can't open %s.\n", filename); --- 59 unchanged lines hidden (view full) --- 338 } 339 break; 340 } 341 342 len = strlen(cp); 343 argc = command_Interpret(cp, len, argv); 344 allowcmd = argc > 0 && !strcasecmp(argv[0], "allow"); 345 if ((!(how == SYSTEM_EXEC) && allowcmd) || |
345 ((how == SYSTEM_EXEC) && !allowcmd)) | 346 ((how == SYSTEM_EXEC) && !allowcmd)) { 347 /* 348 * Disable any context so that warnings are given to everyone, 349 * including syslog. 350 */ 351 op = log_PromptContext; 352 log_PromptContext = NULL; |
346 command_Run(bundle, argc, (char const *const *)argv, prompt, 347 name, cx); | 353 command_Run(bundle, argc, (char const *const *)argv, prompt, 354 name, cx); |
355 log_PromptContext = op; 356 } |
|
348 } 349 350 fclose(fp); /* everything read - get out */ 351 return 0; 352 } 353 break; 354 } 355 } --- 55 unchanged lines hidden --- | 357 } 358 359 fclose(fp); /* everything read - get out */ 360 return 0; 361 } 362 break; 363 } 364 } --- 55 unchanged lines hidden --- |