misc.c (101293) | misc.c (141571) |
---|---|
1/* Copyright 1988,1990,1993,1994 by Paul Vixie 2 * All rights reserved 3 * 4 * Distribute freely, except: don't remove my name from the source or 5 * documentation (don't take credit for my work), mark your changes (don't 6 * get me blamed for your possible bugs), don't alter or remove this 7 * notice. May be sold if buildable source is provided to buyer. No 8 * warrantee of any kind, express or implied, is included with this 9 * software; use at your own risk, responsibility for damages (if any) to 10 * anyone resulting from the use of this software rests entirely with the 11 * user. 12 * 13 * Send bug reports, bug fixes, enhancements, requests, flames, etc., and 14 * I'll try to keep a version up to date. I can be reached as follows: 15 * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul 16 */ 17 18#if !defined(lint) && !defined(LINT) 19static const char rcsid[] = | 1/* Copyright 1988,1990,1993,1994 by Paul Vixie 2 * All rights reserved 3 * 4 * Distribute freely, except: don't remove my name from the source or 5 * documentation (don't take credit for my work), mark your changes (don't 6 * get me blamed for your possible bugs), don't alter or remove this 7 * notice. May be sold if buildable source is provided to buyer. No 8 * warrantee of any kind, express or implied, is included with this 9 * software; use at your own risk, responsibility for damages (if any) to 10 * anyone resulting from the use of this software rests entirely with the 11 * user. 12 * 13 * Send bug reports, bug fixes, enhancements, requests, flames, etc., and 14 * I'll try to keep a version up to date. I can be reached as follows: 15 * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul 16 */ 17 18#if !defined(lint) && !defined(LINT) 19static const char rcsid[] = |
20 "$FreeBSD: head/usr.sbin/cron/lib/misc.c 101293 2002-08-04 04:32:27Z tjr $"; | 20 "$FreeBSD: head/usr.sbin/cron/lib/misc.c 141571 2005-02-09 13:02:43Z stefanf $"; |
21#endif 22 23/* vix 26jan87 [RCS has the rest of the log] 24 * vix 30dec86 [written] 25 */ 26 27 28#include "cron.h" --- 381 unchanged lines hidden (view full) --- 410allowed(username) 411 char *username; 412{ 413 FILE *allow, *deny; 414 int isallowed; 415 416 isallowed = FALSE; 417 | 21#endif 22 23/* vix 26jan87 [RCS has the rest of the log] 24 * vix 30dec86 [written] 25 */ 26 27 28#include "cron.h" --- 381 unchanged lines hidden (view full) --- 410allowed(username) 411 char *username; 412{ 413 FILE *allow, *deny; 414 int isallowed; 415 416 isallowed = FALSE; 417 |
418 deny = NULL; |
|
418#if defined(ALLOW_FILE) && defined(DENY_FILE) 419 if ((allow = fopen(ALLOW_FILE, "r")) == NULL && errno != ENOENT) 420 goto out; 421 if ((deny = fopen(DENY_FILE, "r")) == NULL && errno != ENOENT) 422 goto out; 423 Debug(DMISC, ("allow/deny enabled, %d/%d\n", !!allow, !!deny)) 424#else 425 allow = NULL; | 419#if defined(ALLOW_FILE) && defined(DENY_FILE) 420 if ((allow = fopen(ALLOW_FILE, "r")) == NULL && errno != ENOENT) 421 goto out; 422 if ((deny = fopen(DENY_FILE, "r")) == NULL && errno != ENOENT) 423 goto out; 424 Debug(DMISC, ("allow/deny enabled, %d/%d\n", !!allow, !!deny)) 425#else 426 allow = NULL; |
426 deny = NULL; | |
427#endif 428 429 if (allow) 430 isallowed = in_file(username, allow); 431 else if (deny) 432 isallowed = !in_file(username, deny); 433 else { 434#if defined(ALLOW_ONLY_ROOT) --- 228 unchanged lines hidden --- | 427#endif 428 429 if (allow) 430 isallowed = in_file(username, allow); 431 else if (deny) 432 isallowed = !in_file(username, deny); 433 else { 434#if defined(ALLOW_ONLY_ROOT) --- 228 unchanged lines hidden --- |