diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-05-26 10:39:52 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-05-26 10:39:52 +0000 |
commit | d05c4b5b8ba3c1da61b25b801d8eb0e022f7b001 (patch) | |
tree | a30b68050dadda958aaf80a806b735cc9b641853 | |
parent | cfab99ab2bbd2bfca6dc0eada75f1a8da1d82b7f (diff) |
sync
-rw-r--r-- | usr.sbin/amd/amd/info_nis.c | 33 |
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); + } } /* |