summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbillf <billf@FreeBSD.org>1999-07-01 01:07:30 +0000
committerbillf <billf@FreeBSD.org>1999-07-01 01:07:30 +0000
commit73d3a9b398335f16fd719e5c0bd288f1e56b9c83 (patch)
tree43bdab01ba19a9994d2d3c0fbef87e1ea92df297
parent3e4a05994fe145f664e66ee7300833a8056964f8 (diff)
downloadFreeBSD-src-73d3a9b398335f16fd719e5c0bd288f1e56b9c83.zip
FreeBSD-src-73d3a9b398335f16fd719e5c0bd288f1e56b9c83.tar.gz
(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
-rw-r--r--usr.bin/at/perm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/at/perm.c b/usr.bin/at/perm.c
index f1d4352..398b2a8 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;
}
OpenPOWER on IntegriCloud