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;