Minor cleanup.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@329 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
#define PATCHLEVEL 0
|
|
@@ -9,7 +9,6 @@
|
|||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <protos.h>
|
#include <protos.h>
|
||||||
#define KERBEROS
|
|
||||||
RCSID("$Id$");
|
RCSID("$Id$");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -23,28 +22,29 @@ RCSID("$Id$");
|
|||||||
#include <X11/Xos.h>
|
#include <X11/Xos.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <xnlock.h>
|
|
||||||
|
|
||||||
#ifdef KERBEROS
|
|
||||||
#include <krb.h>
|
#include <krb.h>
|
||||||
#include <kafs.h>
|
#include <kafs.h>
|
||||||
|
|
||||||
char inst[100];
|
char inst[100];
|
||||||
char name[100];
|
char name[100];
|
||||||
char realm[REALM_SZ + 1];
|
char realm[REALM_SZ + 1];
|
||||||
#endif
|
|
||||||
|
#define font_height(font) (font->ascent + font->descent)
|
||||||
|
|
||||||
char *SPACE_STRING = " ";
|
char *SPACE_STRING = " ";
|
||||||
char STRING[] = "****************";
|
char STRING[] = "****************";
|
||||||
|
|
||||||
#define MAX_PASSWD_LENGTH (sizeof(STRING))
|
#define MAX_PASSWD_LENGTH (sizeof(STRING))
|
||||||
|
|
||||||
/* The program should be something that outputs a small amount of text */
|
/* The program should be something that outputs a small amount of text */
|
||||||
#define DEFAULT_PROGRAM "fortune -s"
|
#define DEFAULT_PROGRAM "fortune -s"
|
||||||
#define DEFAULT_TEXT "I'm out running around."
|
#define DEFAULT_TEXT "I'm out running around."
|
||||||
#define font_height(font) (font->ascent + font->descent)
|
|
||||||
#define FONT_NAME "-*-new century schoolbook-*-*-*-18-*"
|
#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 PROMPT "Password: "
|
||||||
#define FAIL_MSG "Sorry, try again"
|
#define FAIL_MSG "Sorry, try again"
|
||||||
@@ -434,14 +434,10 @@ post_prompt_box(Window window)
|
|||||||
box_x = prompt_x - 105;
|
box_x = prompt_x - 105;
|
||||||
box_y = prompt_y - 3 * font_height(font);
|
box_y = prompt_y - 3 * font_height(font);
|
||||||
|
|
||||||
#ifdef KERBEROS
|
|
||||||
if (inst[0] == 0)
|
if (inst[0] == 0)
|
||||||
sprintf (s, "User: %s@%s", name, realm);
|
sprintf (s, "User: %s@%s", name, realm);
|
||||||
else
|
else
|
||||||
sprintf (s, "User: %s.%s@%s", name, inst, realm);
|
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 */
|
/* erase current guy -- text message may still exist */
|
||||||
XSetForeground(dpy, gc, Black);
|
XSetForeground(dpy, gc, Black);
|
||||||
XFillRectangle(dpy, window, gc, x, y, 64, 64);
|
XFillRectangle(dpy, window, gc, x, y, 64, 64);
|
||||||
@@ -475,7 +471,6 @@ RaiseWindow(Widget w, XEvent *ev, String *s, Cardinal *n)
|
|||||||
if(!XtIsRealized(w))
|
if(!XtIsRealized(w))
|
||||||
return;
|
return;
|
||||||
x = XtParent(w);
|
x = XtParent(w);
|
||||||
fprintf(stderr, "%s\n", XtName(x));
|
|
||||||
XRaiseWindow(dpy, XtWindow(x));
|
XRaiseWindow(dpy, XtWindow(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -600,7 +595,6 @@ GetPasswd(Widget w, XEvent *_event, String *_s, Cardinal *_n)
|
|||||||
* continue */
|
* continue */
|
||||||
signal(SIGHUP, SIG_DFL);
|
signal(SIGHUP, SIG_DFL);
|
||||||
}
|
}
|
||||||
#ifdef KERBEROS
|
|
||||||
/*
|
/*
|
||||||
* Try to verify as user with kerberos.
|
* Try to verify as user with kerberos.
|
||||||
*/
|
*/
|
||||||
@@ -627,7 +621,6 @@ GetPasswd(Widget w, XEvent *_event, String *_s, Cardinal *_n)
|
|||||||
leave();
|
leave();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* KERBEROS */
|
|
||||||
/*
|
/*
|
||||||
* Try to verify as user.
|
* Try to verify as user.
|
||||||
*/
|
*/
|
||||||
@@ -859,13 +852,16 @@ main (int argc, char **argv)
|
|||||||
ProgName = *argv;
|
ProgName = *argv;
|
||||||
|
|
||||||
/* getpwuid() returns static pointer, so get root's passwd first */
|
/* getpwuid() returns static pointer, so get root's passwd first */
|
||||||
if (!(pw = getpwuid(0)))
|
if (!(pw = getpwuid(0))){
|
||||||
printf("%s: can't get root's passwd!\n", ProgName), exit(1);
|
fprintf(stderr, "%s: can't get root's passwd!\n", ProgName);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
strcpy(root_pw, pw->pw_passwd);
|
strcpy(root_pw, pw->pw_passwd);
|
||||||
if (!(pw = getpwuid(getuid())))
|
if (!(pw = getpwuid(getuid()))){
|
||||||
printf("%s: Intruder alert!\n", ProgName), exit(1);
|
fprintf(stderr, "%s: Can't get your password entry!\n", ProgName);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef KERBEROS
|
|
||||||
{
|
{
|
||||||
int code = KSUCCESS;
|
int code = KSUCCESS;
|
||||||
char *file;
|
char *file;
|
||||||
@@ -882,8 +878,6 @@ main (int argc, char **argv)
|
|||||||
(code = tf_get_pinst(inst)) == KSUCCESS)
|
(code = tf_get_pinst(inst)) == KSUCCESS)
|
||||||
{
|
{
|
||||||
(void) tf_close(); /* Alles gut */
|
(void) tf_close(); /* Alles gut */
|
||||||
dest_tkt(); /* Nuke old ticket file */
|
|
||||||
creat(file, 0600); /* but keep a place holder */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (code != KSUCCESS)
|
if (code != KSUCCESS)
|
||||||
@@ -893,7 +887,6 @@ main (int argc, char **argv)
|
|||||||
realm[0] = 0; /* No kerberos today */
|
realm[0] = 0; /* No kerberos today */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* KERBEROS */
|
|
||||||
|
|
||||||
XtToolkitInitialize();
|
XtToolkitInitialize();
|
||||||
app = XtCreateApplicationContext();
|
app = XtCreateApplicationContext();
|
||||||
|
@@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* nlock.h -- "new"lockscreen, or, "nose"lockscreen
|
|
||||||
*
|
|
||||||
* Dan Heller
|
|
||||||
*/
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <X11/Intrinsic.h>
|
|
||||||
#include <X11/StringDefs.h>
|
|
||||||
#include <X11/keysym.h>
|
|
||||||
#include <X11/Xos.h>
|
|
||||||
|
|
||||||
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;
|
|
Reference in New Issue
Block a user