From 4b77e8a228dd486d22969cda51020f577c02591c Mon Sep 17 00:00:00 2001 From: Unknown User d91-jda Date: Fri, 22 Mar 1996 18:31:03 +0000 Subject: [PATCH] Minor cleanup. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@329 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/xnlock/patchlevel.h | 1 - appl/xnlock/xnlock.c | 37 +++++++++++++++---------------------- appl/xnlock/xnlock.h | 37 ------------------------------------- 3 files changed, 15 insertions(+), 60 deletions(-) delete mode 100644 appl/xnlock/patchlevel.h delete mode 100644 appl/xnlock/xnlock.h diff --git a/appl/xnlock/patchlevel.h b/appl/xnlock/patchlevel.h deleted file mode 100644 index 935ec354b..000000000 --- a/appl/xnlock/patchlevel.h +++ /dev/null @@ -1 +0,0 @@ -#define PATCHLEVEL 0 diff --git a/appl/xnlock/xnlock.c b/appl/xnlock/xnlock.c index c6ba4aa6a..924977344 100644 --- a/appl/xnlock/xnlock.c +++ b/appl/xnlock/xnlock.c @@ -9,7 +9,6 @@ #ifdef HAVE_CONFIG_H #include #include -#define KERBEROS RCSID("$Id$"); #endif @@ -23,28 +22,29 @@ RCSID("$Id$"); #include #include #include -#include -#ifdef KERBEROS #include #include char inst[100]; char name[100]; char realm[REALM_SZ + 1]; -#endif + +#define font_height(font) (font->ascent + font->descent) char *SPACE_STRING = " "; char STRING[] = "****************"; + #define MAX_PASSWD_LENGTH (sizeof(STRING)) /* The program should be something that outputs a small amount of text */ #define DEFAULT_PROGRAM "fortune -s" #define DEFAULT_TEXT "I'm out running around." -#define font_height(font) (font->ascent + font->descent) #define FONT_NAME "-*-new century schoolbook-*-*-*-18-*" -#define when break;case -#define otherwise break;default + +#ifndef MAXPATHLEN +#define MAXPATHLEN BUFSIZ +#endif /* MAXPATHLEN */ #define PROMPT "Password: " #define FAIL_MSG "Sorry, try again" @@ -434,14 +434,10 @@ post_prompt_box(Window window) box_x = prompt_x - 105; box_y = prompt_y - 3 * font_height(font); -#ifdef KERBEROS if (inst[0] == 0) sprintf (s, "User: %s@%s", name, realm); else sprintf (s, "User: %s.%s@%s", name, inst, realm); -#else - sprintf (s, "User: %s", pw->pw_name); -#endif /* erase current guy -- text message may still exist */ XSetForeground(dpy, gc, Black); XFillRectangle(dpy, window, gc, x, y, 64, 64); @@ -475,7 +471,6 @@ RaiseWindow(Widget w, XEvent *ev, String *s, Cardinal *n) if(!XtIsRealized(w)) return; x = XtParent(w); - fprintf(stderr, "%s\n", XtName(x)); XRaiseWindow(dpy, XtWindow(x)); } @@ -600,7 +595,6 @@ GetPasswd(Widget w, XEvent *_event, String *_s, Cardinal *_n) * continue */ signal(SIGHUP, SIG_DFL); } -#ifdef KERBEROS /* * Try to verify as user with kerberos. */ @@ -627,7 +621,6 @@ GetPasswd(Widget w, XEvent *_event, String *_s, Cardinal *_n) leave(); } } -#endif /* KERBEROS */ /* * Try to verify as user. */ @@ -859,13 +852,16 @@ main (int argc, char **argv) ProgName = *argv; /* getpwuid() returns static pointer, so get root's passwd first */ - if (!(pw = getpwuid(0))) - printf("%s: can't get root's passwd!\n", ProgName), exit(1); + if (!(pw = getpwuid(0))){ + fprintf(stderr, "%s: can't get root's passwd!\n", ProgName); + exit(1); + } strcpy(root_pw, pw->pw_passwd); - if (!(pw = getpwuid(getuid()))) - printf("%s: Intruder alert!\n", ProgName), exit(1); + if (!(pw = getpwuid(getuid()))){ + fprintf(stderr, "%s: Can't get your password entry!\n", ProgName); + exit(1); + } -#ifdef KERBEROS { int code = KSUCCESS; char *file; @@ -882,8 +878,6 @@ main (int argc, char **argv) (code = tf_get_pinst(inst)) == KSUCCESS) { (void) tf_close(); /* Alles gut */ - dest_tkt(); /* Nuke old ticket file */ - creat(file, 0600); /* but keep a place holder */ } } if (code != KSUCCESS) @@ -893,7 +887,6 @@ main (int argc, char **argv) realm[0] = 0; /* No kerberos today */ } } -#endif /* KERBEROS */ XtToolkitInitialize(); app = XtCreateApplicationContext(); diff --git a/appl/xnlock/xnlock.h b/appl/xnlock/xnlock.h deleted file mode 100644 index 252bf8cbd..000000000 --- a/appl/xnlock/xnlock.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * nlock.h -- "new"lockscreen, or, "nose"lockscreen - * - * Dan Heller - */ -#include -#include -#include -#include -#include - -char *crypt(const char *key, const char *salt); - -/* The program should be something that outputs a small amount of text */ -#define DEFAULT_PROGRAM "fortune -s" - -XtAppContext app; -Display *dpy; -unsigned short Width, Height; -#define win XtWindow(widget) -Widget widget; -GC gc; -XtIntervalId timeout_id; -#define font_height(font) (font->ascent + font->descent) - -#ifndef MAXPATHLEN -#define MAXPATHLEN BUFSIZ -#endif /* MAXPATHLEN */ -char *ProgName, *words; - -int x, y; -extern int getwordsfrom; - -Pixel Black, White; -XFontStruct *font; -extern Pixmap - left0, left1, right0, right1, left_front, right_front, front, down;