From ef0449cc06ad4915f0cd40aa28aed01ae2d6004c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Groenvall?= Date: Mon, 25 Sep 1995 16:34:40 +0000 Subject: [PATCH] Define KERBEROS. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@114 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/xnlock/xnlock.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/appl/xnlock/xnlock.c b/appl/xnlock/xnlock.c index dc7047e0b..020cbaba1 100644 --- a/appl/xnlock/xnlock.c +++ b/appl/xnlock/xnlock.c @@ -6,6 +6,8 @@ * "xnlock" is the X11 version of the program. * Original sunview version written by Dan Heller 1985 (not included here). */ +#define random rand +#define srandom srand #include #include #include @@ -15,6 +17,8 @@ #include #include +#define KERBEROS + #ifdef KERBEROS #include #endif @@ -413,11 +417,6 @@ XKeyEvent *event; * Try to verify as user. */ #ifdef KERBEROS -#ifdef AFS -#define LIFE 141 /* 25h, (via lookup table) */ -#else -#define LIFE 96 /* lifetime of ticket in 5-minute units */ -#endif { char realm[REALM_SZ]; if (krb_get_lrealm(realm, 1) == KSUCCESS) @@ -428,10 +427,9 @@ XKeyEvent *event; realm, "krbtgt", realm, - LIFE, + DEFAULT_TKT_LIFE, passwd)) { -#ifdef AFS if (k_hasafs()) { int k_errno; @@ -442,15 +440,14 @@ XKeyEvent *event; ProgName, krb_err_txt[k_errno]); } -#endif /* AFS */ leave(); } } } -#else /* ~KERBEROS */ +#endif /* KERBEROS */ if (!strcmp(crypt(passwd, pw->pw_passwd), pw->pw_passwd)) leave(); -#endif + XDrawImageString(dpy, XtWindow(widget), gc, time_x, time_y, FAIL_MSG, strlen(FAIL_MSG)); time_left = 0;