3
|
1 /* $Id: expire.c,v 1.1.1.1 1997/12/06 05:41:29 darius Exp $ */
|
|
2
|
|
3 #ifndef hpux
|
|
4 #include <sys/time.h>
|
|
5 #endif
|
|
6 #include <time.h>
|
|
7 #include <stdio.h>
|
|
8
|
|
9
|
|
10 /* Here's a handy perl script to set any timeout you want:
|
|
11
|
|
12 perl -e 'require "timelocal.pl"; print &timelocal(0,0,0,9,9,93);'
|
|
13
|
|
14 The arguments to timelocal are (sec, min, hours, mday, mon, year).
|
|
15 These are all 0 based indexing so the 7th day of the month is
|
|
16 really 6 to the perl script.
|
|
17 */
|
|
18
|
|
19 static time_t expire = 915091200;
|
|
20
|
|
21 void
|
|
22 checkExpire(verbose)
|
|
23 int verbose;
|
|
24 {
|
|
25 time_t now;
|
|
26
|
|
27 now = time(NULL);
|
|
28 if (verbose) {
|
|
29 printf("This client expires on %s\n", ctime(&expire));
|
|
30 return;
|
|
31 }
|
|
32 if (now > expire) {
|
|
33 printf("\
|
|
34 I'm sorry. This client has expired. You may bypass the expire by\n\
|
|
35 using the -o option which disables RSA authentication. Expired\n\
|
|
36 clients are not supported by paradise-workers.\n\
|
|
37 You can find a new set of binaries on ftp.pnetrek.org OR ftp.cs.umn.edu \n\
|
|
38 in the directory /users/glamm/paradise/bin/. If you have any problems mail \n\
|
|
39 to paradise-workers@pnetrek.org\n");
|
|
40 exit(0);
|
|
41
|
|
42 } else if (now + 10 * 24 * 60 * 60 > expire) {
|
|
43 printf("This client expires in %d days.\n", (int) (expire - now) / (60 * 60 * 24));
|
|
44 }
|
|
45 }
|