summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-05-26 10:39:51 +0000
committerderaadt <deraadt@openbsd.org>1996-05-26 10:39:51 +0000
commit191a65ac8046ad6e315fef95c4d19bc63dbdae6c (patch)
tree4bbb3bebfcdf5314837f1f7c357e3f6f1f99cef2
parentmaster.passwd is 600 by default (diff)
downloadwireguard-openbsd-191a65ac8046ad6e315fef95c4d19bc63dbdae6c.tar.xz
wireguard-openbsd-191a65ac8046ad6e315fef95c4d19bc63dbdae6c.zip
sync
-rw-r--r--usr.sbin/amd/amd/info_nis.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/usr.sbin/amd/amd/info_nis.c b/usr.sbin/amd/amd/info_nis.c
index 2d445a30d7b..f145dedb697 100644
--- a/usr.sbin/amd/amd/info_nis.c
+++ b/usr.sbin/amd/amd/info_nis.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)info_nis.c 8.1 (Berkeley) 6/6/93
- * $Id: info_nis.c,v 1.2 1996/04/25 00:53:43 deraadt Exp $
+ * $Id: info_nis.c,v 1.3 1996/05/26 10:39:51 deraadt Exp $
*/
/*
@@ -75,7 +75,7 @@ static int nis_not_running = 0;
if (!*default_domain) {
nis_not_running = 1;
- plog(XLOG_WARNING, "NIS domain name is not set. NIS ignored.");
+ plog(XLOG_INFO, "NIS domain name is not set. NIS ignored.");
return ENOENT;
}
@@ -206,14 +206,27 @@ time_t *tp;
}
}
- /*
- * Check if map has changed
- */
- if (yp_order(domain, map, &order))
- return EIO;
- if ((time_t) order > *tp) {
- *tp = (time_t) order;
- return -1;
+
+ if (has_yp_order) {
+ /*
+ * Check if map has changed
+ */
+ if (yp_order(domain, map, &order))
+ return EIO;
+ if ((time_t) order > *tp) {
+ *tp = (time_t) order;
+ return -1;
+ }
+ } else {
+ /*
+ * NIS+ server without yp_order
+ * Check if timeout has expired to invalidate the cache
+ */
+ order = time(NULL);
+ if ((time_t)order - *tp > am_timeo) {
+ *tp = (time_t)order;
+ return(-1);
+ }
}
/*