diff options
author | Bill Fumerola <billf@FreeBSD.org> | 1999-07-01 01:07:30 +0000 |
---|---|---|
committer | Bill Fumerola <billf@FreeBSD.org> | 1999-07-01 01:07:30 +0000 |
commit | 4d294cadd582051de85ecfcd381f875ff03673a4 (patch) | |
tree | 05b233bef34275c43182ea2ef4b74f178bb63206 | |
parent | 5f792a2cd308210a8adbe33068ce4a6e5eca4d64 (diff) | |
download | src-4d294cadd582051de85ecfcd381f875ff03673a4.tar.gz src-4d294cadd582051de85ecfcd381f875ff03673a4.zip |
(1) Don't perror() when at.deny doesn't exist, that's an accepted behavior.
(2) Die when there is a problem opening at.allow other then it not existing.
An error other then it not existing might be a trick to somehow
circumvent system security.
Mostly Reviewed By: msmith
Notes
Notes:
svn path=/head/; revision=48386
-rw-r--r-- | usr.bin/at/perm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/at/perm.c b/usr.bin/at/perm.c index f1d435246a7d..398b2a89a741 100644 --- a/usr.bin/at/perm.c +++ b/usr.bin/at/perm.c @@ -48,7 +48,7 @@ /* File scope variables */ -static const char rcsid[] = "$Id: perm.c,v 1.5 1997/02/22 19:54:08 peter Exp $"; +static const char rcsid[] = "$Id: perm.c,v 1.6 1998/12/06 07:42:09 archie Exp $"; /* Function declarations */ @@ -104,7 +104,7 @@ int check_permission() { return check_for_user(fp, pentry->pw_name); } - else + else if (errno == ENOENT) { PRIV_START @@ -117,7 +117,10 @@ int check_permission() { return !check_for_user(fp, pentry->pw_name); } - perror("at.deny"); + else if (errno != ENOENT) + perror("at.deny"); } + else + perror("at.allow"); return 0; } |