diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2017-10-12 19:32:45 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2017-10-12 19:32:45 +0000 |
commit | f1e36f3665c79388184ecb6bea2c2025957a29f4 (patch) | |
tree | 098b4b84744b88fc119e9f1895692b3668d7094a /app/xdm/greeter | |
parent | 3aa0060bbdf0afcdd1b04f69ccdc8e1589b312a2 (diff) |
Remove xdm. Unhooked since more than 6 months.
Diffstat (limited to 'app/xdm/greeter')
-rw-r--r-- | app/xdm/greeter/Login.c | 2099 | ||||
-rw-r--r-- | app/xdm/greeter/Login.h | 227 | ||||
-rw-r--r-- | app/xdm/greeter/LoginP.h | 192 | ||||
-rw-r--r-- | app/xdm/greeter/Makefile.am | 34 | ||||
-rw-r--r-- | app/xdm/greeter/Makefile.in | 719 | ||||
-rw-r--r-- | app/xdm/greeter/greet.c | 802 | ||||
-rw-r--r-- | app/xdm/greeter/verify.c | 561 |
7 files changed, 0 insertions, 4634 deletions
diff --git a/app/xdm/greeter/Login.c b/app/xdm/greeter/Login.c deleted file mode 100644 index 6a9905043..000000000 --- a/app/xdm/greeter/Login.c +++ /dev/null @@ -1,2099 +0,0 @@ -/* - -Copyright 1988, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - - -/* - * xdm - display manager daemon - * Author: Keith Packard, MIT X Consortium - * - * Login.c - */ - -#include <X11/IntrinsicP.h> -#include <X11/StringDefs.h> -#include <X11/keysym.h> -#include <X11/DECkeysym.h> -#include <X11/Xfuncs.h> - -#include <stdio.h> -#include <ctype.h> -#include <time.h> -#include <string.h> - -#include "dm.h" -#include "dm_error.h" -#include "greet.h" -#include "LoginP.h" - -#ifdef XPM -# include <sys/stat.h> -# include <unistd.h> -# include <X11/Xlib.h> -# include <X11/xpm.h> -# include <X11/extensions/shape.h> -#endif /* XPM */ - -#include <X11/cursorfont.h> - -#ifdef USE_XINERAMA -# include <X11/extensions/Xinerama.h> -#endif - -#ifdef USE_XFT -# include <X11/extensions/Xrender.h> -#endif - -#ifndef DEBUG -# define XDM_ASSERT(a) /* do nothing */ -#else -# if defined(__STDC__) && __STDC_VERSION__ - 0 >= 199901L -# define XDM_ASSERT(a) if (!(a)) { \ - Debug("Assertion failed in %s() at file %s line %d\n", \ - __func__, __FILE__, __LINE__); } -# else -# define XDM_ASSERT(a) if (!(a)) { \ - Debug("Assertion failed at file %s line %d\n", __FILE__, __LINE__); } -# endif -#endif - -static void RedrawFail (LoginWidget w); -static void ResetLogin (LoginWidget w); -static void failTimeout (XtPointer client_data, XtIntervalId * id); -static void EraseCursor (LoginWidget w); -static void XorCursor (LoginWidget w); - -#define offset(field) XtOffsetOf(LoginRec, login.field) -#define goffset(field) XtOffsetOf(WidgetRec, core.field) - - -static XtResource resources[] = { - {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension), - goffset(width), XtRImmediate, (XtPointer) 0}, - {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension), - goffset(height), XtRImmediate, (XtPointer) 0}, - {XtNx, XtCX, XtRPosition, sizeof (Position), - goffset(x), XtRImmediate, (XtPointer) -1}, - {XtNy, XtCY, XtRPosition, sizeof (Position), - goffset(y), XtRImmediate, (XtPointer) -1}, -#ifndef USE_XFT - {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel), - offset(textpixel), XtRString, XtDefaultForeground}, - {XtNpromptColor, XtCForeground, XtRPixel, sizeof(Pixel), - offset(promptpixel), XtRString, XtDefaultForeground}, - {XtNgreetColor, XtCForeground, XtRPixel, sizeof(Pixel), - offset(greetpixel), XtRString, XtDefaultForeground}, - {XtNfailColor, XtCForeground, XtRPixel, sizeof (Pixel), - offset(failpixel), XtRString, XtDefaultForeground}, -#endif - -#ifdef DANCING -/* added by Caolan McNamara */ - {XtNlastEventTime, XtCLastEventTime, XtRInt , sizeof (int), - offset(lastEventTime), XtRImmediate, (XtPointer)0}, -/* end (caolan) */ -#endif /* DANCING */ - -#ifdef XPM -/* added by Ivan Griffin (ivan.griffin@ul.ie) */ - {XtNlogoFileName, XtCLogoFileName, XtRString, sizeof(char*), - offset(logoFileName), XtRImmediate, (XtPointer)0}, - {XtNuseShape, XtCUseShape, XtRBoolean, sizeof(Boolean), - offset(useShape), XtRImmediate, (XtPointer) True}, - {XtNlogoPadding, XtCLogoPadding, XtRInt, sizeof(int), - offset(logoPadding), XtRImmediate, (XtPointer) 5}, -/* end (ivan) */ -#endif /* XPM */ - -/* added by Amit Margalit */ - {XtNhiColor, XtCForeground, XtRPixel, sizeof (Pixel), - offset(hipixel), XtRString, XtDefaultForeground}, - {XtNshdColor, XtCForeground, XtRPixel, sizeof (Pixel), - offset(shdpixel), XtRString, XtDefaultForeground}, - {XtNinpColor, XtCForeground, XtRPixel, sizeof (Pixel), - offset(inppixel), XtRString, XtDefaultBackground}, - {XtNframeWidth, XtCFrameWidth, XtRInt, sizeof(int), - offset(outframewidth), XtRImmediate, (XtPointer) 1}, - {XtNinnerFramesWidth, XtCFrameWidth, XtRInt, sizeof(int), - offset(inframeswidth), XtRImmediate, (XtPointer) 1}, - {XtNsepWidth, XtCFrameWidth, XtRInt, sizeof(int), - offset(sepwidth), XtRImmediate, (XtPointer) 1}, -/* end (amit) */ - -#ifndef USE_XFT - {XtNfont, XtCFont, XtRFontStruct, sizeof (XFontStruct *), - offset (textFont), XtRString, "*-new century schoolbook-medium-r-normal-*-180-*"}, - {XtNpromptFont, XtCFont, XtRFontStruct, sizeof (XFontStruct *), - offset (promptFont), XtRString, "*-new century schoolbook-bold-r-normal-*-180-*"}, - {XtNgreetFont, XtCFont, XtRFontStruct, sizeof (XFontStruct *), - offset (greetFont), XtRString, "*-new century schoolbook-bold-i-normal-*-240-*"}, - {XtNfailFont, XtCFont, XtRFontStruct, sizeof (XFontStruct *), - offset (failFont), XtRString, "*-new century schoolbook-bold-r-normal-*-180-*"}, -#else /* USE_XFT */ - {XtNface, XtCFace, XtRXftFont, sizeof (XftFont *), - offset (textFace), XtRString, "Serif-18"}, - {XtNpromptFace, XtCFace, XtRXftFont, sizeof (XftFont *), - offset (promptFace), XtRString, "Serif-18:bold"}, - {XtNgreetFace, XtCFace, XtRXftFont, sizeof (XftFont *), - offset (greetFace), XtRString, "Serif-24:italic"}, - {XtNfailFace, XtCFace, XtRXftFont, sizeof (XftFont *), - offset (failFace), XtRString, "Serif-18:bold"}, - {XtNforeground, XtCForeground, XtRXftColor, sizeof(XftColor), - offset(textcolor), XtRString, XtDefaultForeground}, - {XtNpromptColor, XtCForeground, XtRXftColor, sizeof(XftColor), - offset(promptcolor), XtRString, XtDefaultForeground}, - {XtNgreetColor, XtCForeground, XtRXftColor, sizeof(XftColor), - offset(greetcolor), XtRString, XtDefaultForeground}, - {XtNfailColor, XtCForeground, XtRXftColor, sizeof (XftColor), - offset(failcolor), XtRString, XtDefaultForeground}, -#endif - {XtNgreeting, XtCGreeting, XtRString, sizeof (char *), - offset(greeting), XtRString, "X Window System"}, - {XtNunsecureGreeting, XtCGreeting, XtRString, sizeof (char *), - offset(unsecure_greet), XtRString, "This is an unsecure session"}, - {XtNnamePrompt, XtCNamePrompt, XtRString, sizeof (char *), - offset(namePrompt), XtRString, "Login: "}, - {XtNpasswdPrompt, XtCPasswdPrompt, XtRString, sizeof (char *), - offset(passwdPrompt), XtRString, "Password: "}, - {XtNfail, XtCFail, XtRString, sizeof (char *), - offset(failMsg), XtRString, - "Login incorrect or forbidden by policy" - }, - {XtNchangePasswdMessage, XtCChangePasswdMessage, XtRString, - sizeof (char *), offset(passwdChangeMsg), XtRString, - (XtPointer) "Password Change Required" }, - {XtNfailTimeout, XtCFailTimeout, XtRInt, sizeof (int), - offset(failTimeout), XtRImmediate, (XtPointer) 10}, - {XtNnotifyDone, XtCCallback, XtRFunction, sizeof (XtPointer), - offset(notify_done), XtRFunction, (XtPointer) 0}, - {XtNsessionArgument, XtCSessionArgument, XtRString, sizeof (char *), - offset(sessionArg), XtRString, (XtPointer) 0 }, - {XtNsecureSession, XtCSecureSession, XtRBoolean, sizeof (Boolean), - offset(secure_session), XtRImmediate, (XtPointer) False }, - {XtNallowAccess, XtCAllowAccess, XtRBoolean, sizeof (Boolean), - offset(allow_access), XtRImmediate, (XtPointer) False }, - {XtNallowNullPasswd, XtCAllowNullPasswd, XtRBoolean, sizeof (Boolean), - offset(allow_null_passwd), XtRImmediate, (XtPointer) False}, - {XtNallowRootLogin, XtCAllowRootLogin, XtRBoolean, sizeof(Boolean), - offset(allow_root_login), XtRImmediate, (XtPointer) True}, - {XtNechoPasswd, XtCEchoPasswd, XtRBoolean, sizeof(Boolean), - offset(echo_passwd), XtRImmediate, (XtPointer) False}, - {XtNechoPasswdChar, XtCEchoPasswdChar, XtRString, sizeof (char *), - offset(echo_passwd_char), XtRString, (XtPointer) "*" } -}; - -#undef offset -#undef goffset - -#ifdef USE_XFT -# define F_MAX_WIDTH(f) ((w)->login.f##Face->max_advance_width) -# define F_ASCENT(f) ((w)->login.f##Face->ascent) -# define F_DESCENT(f) ((w)->login.f##Face->descent) -#else -# define F_MAX_WIDTH(f) ((w)->login.f##Font->max_bounds.width) -# define F_ASCENT(f) ((w)->login.f##Font->max_bounds.ascent) -# define F_DESCENT(f) ((w)->login.f##Font->max_bounds.descent) -#endif - -#define TEXT_X_INC(w) F_MAX_WIDTH(text) -#define TEXT_Y_INC(w) (F_ASCENT(text) + F_DESCENT(text)) - -#define PROMPT_X_INC(w) F_MAX_WIDTH(prompt) -#define PROMPT_Y_INC(w) (F_ASCENT(prompt) + F_DESCENT(prompt)) - -#define GREET_X_INC(w) F_MAX_WIDTH(greet) -#define GREET_Y_INC(w) (F_ASCENT(greet) + F_DESCENT(greet)) - -#define FAIL_X_INC(w) F_MAX_WIDTH(fail) -#define FAIL_Y_INC(w) (F_ASCENT(fail) + F_DESCENT(fail)) - -#define Y_INC(w) max (TEXT_Y_INC(w), PROMPT_Y_INC(w)) - - -#define PROMPT_TEXT(w,n) ((w)->login.prompts[n].promptText) -#define DEF_PROMPT_TEXT(w,n) ((w)->login.prompts[n].defaultPrompt) -#define VALUE_TEXT(w,n) ((w)->login.prompts[n].valueText) -#define VALUE_TEXT_MAX(w,n) ((w)->login.prompts[n].valueTextMax) -#define VALUE_SHOW_START(w,n) ((w)->login.prompts[n].valueShownStart) -#define VALUE_SHOW_END(w,n) ((w)->login.prompts[n].valueShownEnd) -#define PROMPT_STATE(w,n) ((w)->login.prompts[n].state) -#define PROMPT_CURSOR(w,n) ((w)->login.prompts[n].cursor) - -#define CUR_PROMPT_CURSOR(w) PROMPT_CURSOR(w,w->login.activePrompt) - -#define CUR_PROMPT_TEXT(w, n) (PROMPT_TEXT(w,n) != NULL ? \ - PROMPT_TEXT(w,n) : DEF_PROMPT_TEXT(w,n)) - -#ifdef USE_XFT - -# define TEXT_COLOR(f) (w->login.f##color.pixel) - -# define TEXT_WIDTH(f, m, l) XmuXftTextWidth(XtDisplay (w), \ - w->login.f##Face, (FcChar8 *) m, l) -static int -XmuXftTextWidth(Display *dpy, XftFont *font, FcChar8 *string, int len); - -# define DRAW_STRING(f, x, y, m, l) \ - /* Debug("DRAW_STRING(%s, %d, %d, %s, %d)\n", #f, x, y, m, l); */ \ - XftDrawString8 (w->login.draw, &w->login.f##color, w->login.f##Face, \ - x, y, (FcChar8 *) m, l) - -#else - -# define TEXT_COLOR(f) (w->login.f##pixel) - -# define TEXT_WIDTH(f, m, l) (XTextWidth (w->login.f##Font, m, l)) - -# define DRAW_STRING(f, x, y, m, l) \ - XDrawString (XtDisplay (w), XtWindow (w), w->login.f##GC, x, y, m, l) - -#endif - - -#define STRING_WIDTH(f, s) TEXT_WIDTH (f, s, strlen(s)) - -/* Padded width of logo image, if compiled with XPM support */ -#ifdef XPM -# define LOGO_W(w) ((w)->login.logoWidth + ((w)->login.logoPadding * 2)) -#else -# define LOGO_W(w) 0 -#endif - -#define TEXT_PROMPT_W(w, m) (STRING_WIDTH(prompt, m) + w->login.inframeswidth) - -#define DEF_PROMPT_W(w,n) TEXT_PROMPT_W(w, w->login.prompts[n].defaultPrompt) -#define CUR_PROMPT_W(w,n) (max(MAX_DEF_PROMPT_W(w), PROMPT_TEXT(w,n) ? \ - TEXT_PROMPT_W(w, PROMPT_TEXT(w,n)) : 0)) - -#define MAX_DEF_PROMPT_W(w) (max(DEF_PROMPT_W(w,0), DEF_PROMPT_W(w,1))) - -#define GREETING(w) ((w)->login.secure_session && !(w)->login.allow_access ?\ - (w)->login.greeting : (w)->login.unsecure_greet) -#define GREET_X(w) ((int)((w->core.width - \ - STRING_WIDTH (greet, GREETING(w))) / 2)) -#define GREET_Y(w) (GREETING(w)[0] ? 2 * GREET_Y_INC (w) : 0) -#define GREET_W(w) (max (STRING_WIDTH (greet, w->login.greeting), \ - STRING_WIDTH (greet, w->login.unsecure_greet)) \ - + LOGO_W(w)) - -#define PROMPT_X(w) (2 * PROMPT_X_INC(w)) -#define PROMPT_Y(w,n) ((GREET_Y(w) + GREET_Y_INC(w) +\ - F_ASCENT(greet) + Y_INC(w)) + \ - (n * PROMPT_SPACE_Y(w))) -#define PROMPT_W(w) (w->core.width - (2 * TEXT_X_INC(w))) -#define PROMPT_H(w) (5 * Y_INC(w) / 4) -#define VALUE_X(w,n) (PROMPT_X(w) + CUR_PROMPT_W(w,n)) -#define CURSOR_W 5 -#define MAX_VALUE_W(w,n) (PROMPT_W(w) - VALUE_X (w,n) - CURSOR_W - 1 - \ - (w->login.inframeswidth * 2) - LOGO_W(w)) -#define PROMPT_SPACE_Y(w) (10 * Y_INC(w) / 5) - -#define ERROR_X(w,m) ((int)(w->core.width - LOGO_W(w) - STRING_WIDTH (fail, m)) / 2) -#define FAIL_X(w) ERROR_X(w, w->login.fail) -#define FAIL_Y(w) (PROMPT_Y(w,1) + 2 * FAIL_Y_INC (w) + F_ASCENT(fail)) - -#define ERROR_W(w,m) (STRING_WIDTH (fail, m) + LOGO_W(w)) - -#define FAIL_W(w) max(ERROR_W(w, w->login.failMsg), \ - ERROR_W(w, w->login.passwdChangeMsg)) - -#define PAD_X(w) (2 * (PROMPT_X(w) + max (GREET_X_INC(w), FAIL_X_INC(w)))) - -#define PAD_Y(w) (max (max (Y_INC(w), GREET_Y_INC(w)),\ - FAIL_Y_INC(w))) - -#ifndef max -static inline int max (int a, int b) { return a > b ? a : b; } -#endif - -static void -realizeValue (LoginWidget w, int cursor, int promptNum, GC gc) -{ - loginPromptState state = PROMPT_STATE(w, promptNum); - char *text = VALUE_TEXT(w, promptNum); - int x, y, height, width, curoff; - - XDM_ASSERT(promptNum >= 0 && promptNum <= LAST_PROMPT); - - /* replace all password characters with asterisks */ - if ((state == LOGIN_PROMPT_ECHO_OFF) && (w->login.echo_passwd == True)) - { - Cardinal length = strlen(text); - Cardinal i = 0; - - text = XtMalloc(length + 1); - - if (text == NULL) - { - LogOutOfMem("realizeValue"); - return; - } - - while (i < length) - { - text[i++] = w->login.echo_passwd_char[0]; - } - - text[i] = 0; - } - - x = VALUE_X (w,promptNum); - y = PROMPT_Y (w,promptNum); - - height = PROMPT_H(w) - (w->login.inframeswidth * 2); - width = MAX_VALUE_W(w,promptNum); - - if (cursor > VALUE_SHOW_START(w, promptNum)) - curoff = TEXT_WIDTH (text, text, cursor); - else - curoff = 0; - - - if (gc == w->login.bgGC) { - if (curoff < width) { - XFillRectangle (XtDisplay (w), XtWindow (w), gc, - x + curoff, y - TEXT_Y_INC(w), - width - curoff, height); - } - } else if ((state == LOGIN_PROMPT_ECHO_ON) || (state == LOGIN_TEXT_INFO) || - ((state == LOGIN_PROMPT_ECHO_OFF) && (w->login.echo_passwd == True))) - { - int offset = max(cursor, VALUE_SHOW_START(w, promptNum)); - int textlen = strlen (text + offset); - - if (TEXT_WIDTH (text, text + offset, textlen) > (width - curoff)) { - /* Recalculate amount of text that can fit in field */ - offset = VALUE_SHOW_START(w, promptNum); - textlen = strlen (text + offset); - - while ((textlen > 0) && - (TEXT_WIDTH (text, text + offset, textlen) > width)) - { - if (offset < PROMPT_CURSOR(w, promptNum)) { - offset++; - } - textlen--; - } - - VALUE_SHOW_START(w, promptNum) = offset; - VALUE_SHOW_END(w, promptNum) = offset + textlen; - - /* Erase old string */ - XFillRectangle (XtDisplay (w), XtWindow (w), w->login.bgGC, - x, y - TEXT_Y_INC(w), width, height); - - DRAW_STRING(text, x, y, text + offset, textlen); - } else { - DRAW_STRING(text, x + curoff, y, text + offset, textlen); - } - } - /* free memory */ - if ((state == LOGIN_PROMPT_ECHO_OFF) && (w->login.echo_passwd == True)) - { - XtFree(text); - } -} - -static void -EraseValue (LoginWidget w, int cursor, int promptNum) -{ - realizeValue(w, cursor, promptNum, w->login.bgGC); -} - -static void -DrawValue (LoginWidget w, int cursor, int promptNum) -{ - realizeValue(w, cursor, promptNum, w->login.textGC); -#ifdef DANCING - /*as good a place as any Caolan begin*/ - w->login.lastEventTime = time(NULL); - /*as good a place as any Caolan end*/ -#endif /* DANCING */ -} - -static void -realizeCursor (LoginWidget w, GC gc) -{ - int x, y; - int height, width; - - if (w->login.state != PROMPTING) { - return; - } - - x = VALUE_X (w, w->login.activePrompt); - y = PROMPT_Y (w, w->login.activePrompt); - height = (F_ASCENT(text) + F_DESCENT(text)); - width = 1; - - switch (PROMPT_STATE(w, w->login.activePrompt)) { - case LOGIN_PROMPT_NOT_SHOWN: - case LOGIN_TEXT_INFO: - return; - case LOGIN_PROMPT_ECHO_ON: - if (CUR_PROMPT_CURSOR(w) > 0) { - x += TEXT_WIDTH (text, - VALUE_TEXT(w, w->login.activePrompt) - + VALUE_SHOW_START(w, w->login.activePrompt), - PROMPT_CURSOR(w, w->login.activePrompt) - - VALUE_SHOW_START(w, w->login.activePrompt) ); - } - break; - case LOGIN_PROMPT_ECHO_OFF: - if (w->login.echo_passwd == True) { - if (w->login.echo_passwd_char[0] != 0) { - int len = PROMPT_CURSOR(w, w->login.activePrompt) - - VALUE_SHOW_START(w, w->login.activePrompt); - - x += len*TEXT_WIDTH(text, w->login.echo_passwd_char, 1); - } else { - /* Move cursor one pixel per character to give some feedback - without giving away the password length */ - if (PROMPT_CURSOR(w, w->login.activePrompt) < - MAX_VALUE_W(w, w->login.activePrompt)) - x += PROMPT_CURSOR(w, w->login.activePrompt); - else - x += MAX_VALUE_W(w, w->login.activePrompt); - } - } - break; - } - - XFillRectangle (XtDisplay (w), XtWindow (w), gc, - x, y+1 - F_ASCENT(text), width, height-1); - XDrawPoint (XtDisplay (w), XtWindow (w), gc, - x-1 , y - F_ASCENT(text)); - XDrawPoint (XtDisplay (w), XtWindow (w), gc, - x+1 , y - F_ASCENT(text)); - XDrawPoint (XtDisplay (w), XtWindow (w), gc, - x-1 , y - F_ASCENT(text)+height); - XDrawPoint (XtDisplay (w), XtWindow (w), gc, - x+1 , y - F_ASCENT(text)+height); - XDrawPoint (XtDisplay (w), XtWindow (w), gc, - x-2 , y - F_ASCENT(text)); - XDrawPoint (XtDisplay (w), XtWindow (w), gc, - x+2 , y - F_ASCENT(text)); - XDrawPoint (XtDisplay (w), XtWindow (w), gc, - x-2 , y - F_ASCENT(text)+height); - XDrawPoint (XtDisplay (w), XtWindow (w), gc, - x+2 , y - F_ASCENT(text)+height); - - XFlush (XtDisplay(w)); -} - -static void -EraseFail (LoginWidget w) -{ -#ifdef USE_XFT - w->login.failUp = 0; - RedrawFail(w); -#else - XSetForeground (XtDisplay (w), w->login.failGC, - w->core.background_pixel); - RedrawFail(w); - w->login.failUp = 0; - XSetForeground (XtDisplay (w), w->login.failGC, - TEXT_COLOR(fail)); -#endif -} - -static void -XorCursor (LoginWidget w) -{ - realizeCursor (w, w->login.xorGC); -} - -static void -RemoveFail (LoginWidget w) -{ - if (w->login.failUp) - EraseFail (w); -} - -static void -EraseCursor (LoginWidget w) -{ - realizeCursor (w, w->login.bgGC); -} - -/*ARGSUSED*/ -static void failTimeout (XtPointer client_data, XtIntervalId * id) -{ - LoginWidget w = (LoginWidget)client_data; - - Debug ("failTimeout\n"); - w->login.interval_id = 0; - EraseFail (w); -} - -_X_INTERNAL -void -DrawFail (Widget ctx) -{ - LoginWidget w; - - w = (LoginWidget) ctx; - XorCursor (w); - ResetLogin (w); - XorCursor (w); - ErrorMessage(ctx, w->login.failMsg, True); -} - -static void -RedrawFail (LoginWidget w) -{ - int x = FAIL_X(w); - int y = FAIL_Y(w); - int maxw = w->core.width - PAD_X(w); - -#ifndef USE_XFT - if (w->login.failUp) -#endif - { - Debug("RedrawFail('%s', %d)\n", w->login.fail, w->login.failUp); - if (ERROR_W(w, w->login.fail) > maxw) { - /* Too long to fit on one line, break into multiple lines */ - char *tempCopy = strdup(w->login.fail); - if (tempCopy != NULL) { - char *start, *next; - char lastspace = ' '; - - y = PROMPT_Y(w,LAST_PROMPT) + (2 * PROMPT_Y_INC(w)); - - for (start = next = tempCopy; start != NULL ; start = next) { - /* search for longest string broken by whitespace that - will fit on a single line */ - do { - if (next != start) { - *next = lastspace; - } - for (next = next + 1; - (*next != '\0') && !isspace(*next) ; next++) - { - /* this loop intentionally left blank */ - } - if (*next != '\0') { - lastspace = *next; - *next = '\0'; - } else { - next = NULL; - } - } while ((next != NULL) && ERROR_W(w, start) < maxw); - - x = ERROR_X(w, start); -#ifdef USE_XFT - if (w->login.failUp == 0) { - XClearArea(XtDisplay(w), XtWindow(w), x, y - F_ASCENT(fail), - ERROR_W(w, start), FAIL_Y_INC(w), False); - } else -#endif - DRAW_STRING (fail, x, y, start, strlen(start)); - - if (next != NULL) { - next++; - y += FAIL_Y_INC(w); - } - } - free(tempCopy); - return; - } - /* if strdup failed, fall through to draw all at once, even - though we know it can't all fit */ - LogOutOfMem("RedrawFail"); - } - -#ifdef USE_XFT - if (w->login.failUp == 0) { - XClearArea(XtDisplay(w), XtWindow(w), x, y - F_ASCENT(fail), - ERROR_W(w, w->login.fail), FAIL_Y_INC(w), False); - } else -#endif - DRAW_STRING (fail, x, y, w->login.fail, strlen (w->login.fail)); - } -} - -_X_INTERNAL -void -ErrorMessage(Widget ctx, const char *message, Bool timeout) -{ - LoginWidget w = (LoginWidget) ctx; - -/* Debug("ErrorMessage: %s\n", message); */ - if (w->login.interval_id != 0) { - XtRemoveTimeOut(w->login.interval_id); - w->login.interval_id = 0; - } - RemoveFail(w); - if (w->login.fail != w->login.failMsg) - free(w->login.fail); - w->login.fail = strdup(message); - if (w->login.fail == NULL) - w->login.fail = (char *) w->login.failMsg; - w->login.failUp = 1; - RedrawFail (w); - if (timeout && (w->login.failTimeout > 0)) { - Debug ("failTimeout: %d\n", w->login.failTimeout); - w->login.interval_id = - XtAppAddTimeOut(XtWidgetToApplicationContext ((Widget)w), - w->login.failTimeout * 1000, - failTimeout, (XtPointer) w); - } -} - -_X_INTERNAL -void -ShowChangePasswdMessage(Widget ctx) -{ - LoginWidget w = (LoginWidget) ctx; - - ErrorMessage(ctx, w->login.passwdChangeMsg, False); -} - -static void -draw_it (LoginWidget w) -{ - int p; - int i; - int gr_line_x, gr_line_y, gr_line_w; - - EraseCursor (w); - - /* draw window borders */ - for(i=1;i<=(w->login.outframewidth);i++) - { - XDrawLine(XtDisplay (w), XtWindow (w), w->login.hiGC, - i-1,i-1,w->core.width-i,i-1); - XDrawLine(XtDisplay (w), XtWindow (w), w->login.hiGC, - i-1,i-1,i-1,w->core.height-i); - XDrawLine(XtDisplay (w), XtWindow (w), w->login.shdGC, - w->core.width-i,i-1,w->core.width-i,w->core.height-i); - XDrawLine(XtDisplay (w), XtWindow (w), w->login.shdGC, - i-1,w->core.height-i,w->core.width-i,w->core.height-i); - } - - /* make separator line */ - gr_line_x = w->login.outframewidth; - gr_line_y = GREET_Y(w) + GREET_Y_INC(w); - gr_line_w = w->core.width - 2*(w->login.outframewidth); - -#ifdef XPM - gr_line_x += w->login.logoPadding; - gr_line_w -= w->login.logoWidth + (3 * (w->login.logoPadding)); -#endif /* XPM */ - - for(i=1;i<=(w->login.sepwidth);i++) - { - XDrawLine(XtDisplay (w), XtWindow (w), w->login.shdGC, - gr_line_x, gr_line_y + i-1, - gr_line_x+gr_line_w, gr_line_y + i-1); - XDrawLine(XtDisplay (w), XtWindow (w), w->login.hiGC, - gr_line_x, gr_line_y + 2*(w->login.inframeswidth) -i, - gr_line_x+gr_line_w, gr_line_y + 2*(w->login.inframeswidth) -i); - } - - for (p = 0; p < NUM_PROMPTS ; p++) - { - int in_frame_x = VALUE_X(w,p) - w->login.inframeswidth - 3; - int in_frame_y - = PROMPT_Y(w,p) - w->login.inframeswidth - 1 - TEXT_Y_INC(w); - - int in_width = PROMPT_W(w) - VALUE_X(w,p) - LOGO_W(w); - int in_height = PROMPT_H(w) + w->login.inframeswidth + 2; - - GC topLeftGC, botRightGC, inpGC; - - if ((PROMPT_STATE(w, p) == LOGIN_PROMPT_ECHO_ON) || - (PROMPT_STATE(w, p) == LOGIN_PROMPT_ECHO_OFF)) { - topLeftGC = w->login.shdGC; - botRightGC = w->login.hiGC; - inpGC = w->login.inpGC; - } else { - topLeftGC = botRightGC = inpGC = w->login.bgGC; - } - - /* draw borders of editboxes */ - for (i=1; i<=(w->login.inframeswidth); i++) - { - /* Make top/left sides */ - XDrawLine(XtDisplay (w), XtWindow (w), topLeftGC, - in_frame_x + i-1, in_frame_y + i-1, - in_frame_x + in_width-i, in_frame_y + i-1); - - XDrawLine(XtDisplay (w), XtWindow (w), topLeftGC, - in_frame_x + i-1, in_frame_y + i-1, - in_frame_x + i-1, in_frame_y + in_height-i); - - /* Make bottom/right sides */ - XDrawLine(XtDisplay (w), XtWindow (w), botRightGC, - in_frame_x + in_width-i, in_frame_y + i-1, - in_frame_x + in_width-i, in_frame_y + in_height-i); - - XDrawLine(XtDisplay (w), XtWindow (w), botRightGC, - in_frame_x + i-1, in_frame_y + in_height-i, - in_frame_x + in_width-i, in_frame_y + in_height-i); - } - XFillRectangle(XtDisplay (w), XtWindow (w), inpGC, - in_frame_x + w->login.inframeswidth, - in_frame_y + w->login.inframeswidth, - in_width - 2*w->login.inframeswidth, - in_height - 2*w->login.inframeswidth); - } - - if (GREETING(w)[0]) { - int gx = GREET_X(w); - -#ifdef XPM - gx -= ((w->login.logoWidth/2) + w->login.logoPadding); -#endif - DRAW_STRING (greet, gx, GREET_Y(w), GREETING(w), strlen (GREETING(w))); - } - for (p = 0; p < NUM_PROMPTS ; p++) { - if (PROMPT_STATE(w, p) != LOGIN_PROMPT_NOT_SHOWN) { - DRAW_STRING (prompt, PROMPT_X(w), PROMPT_Y(w,p), - CUR_PROMPT_TEXT(w,p), strlen (CUR_PROMPT_TEXT(w,p))); - DrawValue (w, 0, p); - } - } - RedrawFail (w); - XorCursor (w); - XSetInputFocus (XtDisplay (w), XtWindow (w), - RevertToPointerRoot, CurrentTime); -} - -/* Returns 0 on success, -1 on failure */ -_X_INTERNAL -int -SetPrompt (Widget ctx, int promptNum, const char *message, - loginPromptState state, Boolean minimumTime) -{ - LoginWidget w = (LoginWidget) ctx; - char *prompt; - int messageLen, e; - const char *stateNames[4] = { - "LOGIN_PROMPT_NOT_SHOWN", "LOGIN_PROMPT_ECHO_ON", - "LOGIN_PROMPT_ECHO_OFF", "LOGIN_TEXT_INFO" }; - loginPromptState priorState; - - Debug("SetPrompt(%d, %s, %s(%d))\n", promptNum, - message ? message : "<NULL>", stateNames[state], state); - - XDM_ASSERT(promptNum >= 0 && promptNum <= LAST_PROMPT); - - if (PROMPT_TEXT(w, promptNum) != NULL) { - XtFree(PROMPT_TEXT(w, promptNum)); - PROMPT_TEXT(w, promptNum) = NULL; - } - - priorState = PROMPT_STATE(w, promptNum); - PROMPT_STATE(w, promptNum) = state; - - if (state == LOGIN_PROMPT_NOT_SHOWN) { - return 0; - } - - if (message == NULL) { - message = DEF_PROMPT_TEXT(w, promptNum); - } - - messageLen = strlen(message); - - prompt = XtMalloc(messageLen + 3); - if (prompt == NULL) { - LogOutOfMem ("SetPrompt"); - return -1; - } - - strncpy(prompt, message, messageLen); - - /* Make sure text prompts have at least two spaces at end */ - e = messageLen; - - if (!isspace(message[messageLen - 2])) { - prompt[e] = ' '; - e++; - } - if (!isspace(message[messageLen - 1])) { - prompt[e] = ' '; - e++; - } - prompt[e] = '\0'; - - PROMPT_TEXT(w, promptNum) = prompt; - - if (w->login.state == INITIALIZING) { - return 0; - } - - if ((priorState == LOGIN_TEXT_INFO) && (w->login.msgTimeout != 0)) { - time_t now = time(NULL); - int timeleft = w->login.msgTimeout - now; - - if (timeleft > 0) { - sleep(timeleft); - } - w->login.msgTimeout = 0; - } - - if (state == LOGIN_TEXT_INFO) { - if (minimumTime) { - time_t now = time(NULL); - w->login.msgTimeout = now + w->login.failTimeout; - } - w->login.state = SHOW_MESSAGE; - } else { - w->login.activePrompt = promptNum; - w->login.state = PROMPTING; - } - - PROMPT_CURSOR(w, promptNum) = 0; - XClearArea (XtDisplay(w), XtWindow(w), 0, 0, 0, 0, FALSE); - draw_it(w); - return 0; -} - -_X_INTERNAL -const char * -GetPrompt(Widget ctx, int promptNum) -{ - LoginWidget w = (LoginWidget) ctx; - - XDM_ASSERT(promptNum >= 0 && promptNum <= LAST_PROMPT); - - return CUR_PROMPT_TEXT(w,promptNum); -} - -_X_INTERNAL -int -SetValue(Widget ctx, int promptNum, char *value) -{ - LoginWidget w = (LoginWidget) ctx; - - XDM_ASSERT(promptNum >= 0 && promptNum <= LAST_PROMPT); - - if ((promptNum < 0) || (promptNum > LAST_PROMPT)) - return -1; - - XDM_ASSERT(VALUE_TEXT(w, promptNum) != NULL); - - if (VALUE_TEXT(w, promptNum) == NULL) - return -1; - - if (value == NULL) { - bzero(VALUE_TEXT(w, promptNum), VALUE_TEXT_MAX(w, promptNum)); - } else { - strncpy(VALUE_TEXT(w, promptNum), value, VALUE_TEXT_MAX(w, promptNum)); - VALUE_TEXT(w, promptNum)[VALUE_TEXT_MAX(w, promptNum)] = '\0'; - } - - VALUE_SHOW_START(w, promptNum) = 0; - VALUE_SHOW_END(w, promptNum) = 0; - PROMPT_CURSOR(w, promptNum) = 0; - - return 0; -} - -_X_INTERNAL -const char * -GetValue(Widget ctx, int promptNum) -{ - LoginWidget w = (LoginWidget) ctx; - - XDM_ASSERT(promptNum >= 0 && promptNum <= LAST_PROMPT); - - if ((promptNum < 0) || (promptNum > LAST_PROMPT)) - return NULL; - - XDM_ASSERT(VALUE_TEXT(w, promptNum) != NULL); - - return VALUE_TEXT(w, promptNum); -} - - -static void -realizeDeleteChar (LoginWidget ctx) -{ - if (ctx->login.state == PROMPTING) { - int promptNum = ctx->login.activePrompt; - int redrawFrom = PROMPT_CURSOR(ctx, promptNum); - - if (PROMPT_CURSOR(ctx,promptNum) < (int)strlen(VALUE_TEXT(ctx,promptNum))) { - if (redrawFrom < VALUE_SHOW_START(ctx, ctx->login.activePrompt)) { - redrawFrom = 0; - EraseValue (ctx, redrawFrom, promptNum); - VALUE_SHOW_START(ctx, ctx->login.activePrompt) - = PROMPT_CURSOR(ctx,promptNum); - } else { - EraseValue (ctx, redrawFrom, promptNum); - } - strcpy(VALUE_TEXT(ctx, promptNum) + PROMPT_CURSOR(ctx, promptNum), - VALUE_TEXT(ctx, promptNum) + PROMPT_CURSOR(ctx, promptNum) + 1); - DrawValue (ctx, redrawFrom, promptNum); - } - } -} - -/*ARGSUSED*/ -static void -DeleteBackwardChar (Widget ctxw, XEvent *event, String *params, Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - - RemoveFail (ctx); - - if (ctx->login.state != PROMPTING) { - return; - } - - XorCursor (ctx); - if (CUR_PROMPT_CURSOR(ctx) > 0) { - CUR_PROMPT_CURSOR(ctx) -= 1; - realizeDeleteChar(ctx); - } - XorCursor (ctx); -} - -/*ARGSUSED*/ -static void -DeleteForwardChar (Widget ctxw, XEvent *event, String *params, Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - - RemoveFail (ctx); - - if (ctx->login.state != PROMPTING) { - return; - } - - XorCursor (ctx); - realizeDeleteChar(ctx); - XorCursor (ctx); -} - -/*ARGSUSED*/ -static void -MoveBackwardChar ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - - RemoveFail (ctx); - - if (ctx->login.state != PROMPTING) { - return; - } - - XorCursor (ctx); - if (CUR_PROMPT_CURSOR(ctx) > 0) - CUR_PROMPT_CURSOR(ctx) -= 1; - if (CUR_PROMPT_CURSOR(ctx) < VALUE_SHOW_START(ctx, ctx->login.activePrompt)) { - EraseValue(ctx, 0, ctx->login.activePrompt); - VALUE_SHOW_START(ctx, ctx->login.activePrompt) - = CUR_PROMPT_CURSOR(ctx); - DrawValue(ctx, 0, ctx->login.activePrompt); - } - XorCursor (ctx); -} - -/*ARGSUSED*/ -static void -MoveForwardChar ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - - RemoveFail (ctx); - - if (ctx->login.state != PROMPTING) { - return; - } - - XorCursor (ctx); - if (CUR_PROMPT_CURSOR(ctx) < - (int)strlen(VALUE_TEXT(ctx,ctx->login.activePrompt))) { - CUR_PROMPT_CURSOR(ctx) += 1; - if (VALUE_SHOW_END(ctx, ctx->login.activePrompt) - < CUR_PROMPT_CURSOR(ctx)) { - EraseValue(ctx, 0, ctx->login.activePrompt); - DrawValue(ctx, 0, ctx->login.activePrompt); - } - } - XorCursor (ctx); -} - -/*ARGSUSED*/ -static void -MoveToBegining ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - - RemoveFail (ctx); - - if (ctx->login.state != PROMPTING) { - return; - } - - XorCursor (ctx); - CUR_PROMPT_CURSOR(ctx) = 0; - if (VALUE_SHOW_START(ctx, ctx->login.activePrompt) > 0) { - EraseValue(ctx, 0, ctx->login.activePrompt); - VALUE_SHOW_START(ctx, ctx->login.activePrompt) = 0; - DrawValue(ctx, 0, ctx->login.activePrompt); - } - XorCursor (ctx); -} - -/*ARGSUSED*/ -static void -MoveToEnd ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - - RemoveFail (ctx); - - if (ctx->login.state != PROMPTING) { - return; - } - - XorCursor (ctx); - CUR_PROMPT_CURSOR(ctx) = strlen (VALUE_TEXT(ctx, ctx->login.activePrompt)); - if (VALUE_SHOW_END(ctx, ctx->login.activePrompt) < CUR_PROMPT_CURSOR(ctx)) { - EraseValue(ctx, 0, ctx->login.activePrompt); - DrawValue(ctx, 0, ctx->login.activePrompt); - } - XorCursor (ctx); -} - -/*ARGSUSED*/ -static void -EraseToEndOfLine ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - - RemoveFail (ctx); - - if (ctx->login.state != PROMPTING) { - return; - } - - XorCursor (ctx); - EraseValue (ctx, CUR_PROMPT_CURSOR(ctx), ctx->login.activePrompt); - bzero(VALUE_TEXT(ctx, ctx->login.activePrompt) + - CUR_PROMPT_CURSOR(ctx), - VALUE_TEXT_MAX(ctx, ctx->login.activePrompt) - - CUR_PROMPT_CURSOR(ctx)); - XorCursor (ctx); -} - -/*ARGSUSED*/ -static void -EraseLine ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - MoveToBegining (ctxw, event, params, num_params); - EraseToEndOfLine (ctxw, event, params, num_params); -} - -/*ARGSUSED*/ -static void -FinishField ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - int promptNum = ctx->login.activePrompt; - int nextPrompt; - - RemoveFail (ctx); - - if (ctx->login.state != PROMPTING) { - return; - } - - XorCursor (ctx); - - for (nextPrompt = promptNum + 1; nextPrompt <= LAST_PROMPT; nextPrompt++) { - if ((PROMPT_STATE(ctx, nextPrompt) == LOGIN_PROMPT_ECHO_ON) || - (PROMPT_STATE(ctx, nextPrompt) == LOGIN_PROMPT_ECHO_OFF)) { - ctx->login.activePrompt = nextPrompt; - break; - } - } - if (nextPrompt > LAST_PROMPT) { - ctx->login.state = DONE; - (*ctx->login.notify_done) (ctx, &ctx->login.data, NOTIFY_OK); - Debug("FinishField #%d: now DONE\n", promptNum); - } else { - Debug("FinishField #%d: %d next\n", promptNum, nextPrompt); - } - - XorCursor (ctx); -} - -/*ARGSUSED*/ -static void -TabField(Widget ctxw, XEvent *event, String *params, Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - int promptNum = ctx->login.activePrompt; - int nextPrompt; - - RemoveFail (ctx); - - if (ctx->login.state != PROMPTING) { - return; - } - - XorCursor (ctx); - - for (nextPrompt = promptNum + 1; nextPrompt != promptNum; nextPrompt++) { - if (nextPrompt > LAST_PROMPT) { - nextPrompt = 0; - } - - if ((PROMPT_STATE(ctx, nextPrompt) == LOGIN_PROMPT_ECHO_ON) || - (PROMPT_STATE(ctx, nextPrompt) == LOGIN_PROMPT_ECHO_OFF)) { - ctx->login.activePrompt = nextPrompt; - break; - } - } - XorCursor (ctx); -} - -/*ARGSUSED*/ -static void -AllowAccess ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - Arg arglist[1]; - Boolean allow; - - RemoveFail (ctx); - XtSetArg (arglist[0], XtNallowAccess, (char *) &allow); - XtGetValues ((Widget) ctx, arglist, 1); - XtSetArg (arglist[0], XtNallowAccess, !allow); - XtSetValues ((Widget) ctx, arglist, 1); -} - -/*ARGSUSED*/ -static void -SetSessionArgument ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - - RemoveFail (ctx); - if (ctx->login.sessionArg) - XtFree (ctx->login.sessionArg); - ctx->login.sessionArg = NULL; - if (*num_params > 0) { - ctx->login.sessionArg = XtMalloc (strlen (params[0]) + 1); - if (ctx->login.sessionArg) - strcpy (ctx->login.sessionArg, params[0]); - else - LogOutOfMem ("set session argument"); - } -} - -/*ARGSUSED*/ -static void -RestartSession ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - - XorCursor (ctx); - RemoveFail (ctx); - ctx->login.state = DONE; - (*ctx->login.notify_done) (ctx, &ctx->login.data, NOTIFY_RESTART); - XorCursor (ctx); -} - -/*ARGSUSED*/ -static void -AbortSession ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - - XorCursor (ctx); - RemoveFail (ctx); - ctx->login.state = DONE; - (*ctx->login.notify_done) (ctx, &ctx->login.data, NOTIFY_ABORT); - XorCursor (ctx); -} - -/*ARGSUSED*/ -static void -AbortDisplay ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - - XorCursor (ctx); - RemoveFail (ctx); - ctx->login.state = DONE; - (*ctx->login.notify_done) (ctx, &ctx->login.data, NOTIFY_ABORT_DISPLAY); - XorCursor (ctx); -} - -static void -ResetLogin (LoginWidget w) -{ - int i; - - for (i = 0; i < NUM_PROMPTS ; i++) { - EraseValue(w, 0, i); - bzero(VALUE_TEXT(w, i), VALUE_TEXT_MAX(w, i)); - VALUE_SHOW_START(w, i) = 0; - PROMPT_CURSOR(w, i) = 0; - } - w->login.state = PROMPTING; - w->login.activePrompt = 0; -} - -static void -InitI18N(Widget ctxw) -{ - LoginWidget ctx = (LoginWidget)ctxw; - XIM xim = (XIM) NULL; - char *p; - - ctx->login.xic = (XIC) NULL; - - if ((p = XSetLocaleModifiers("@im=none")) != NULL && *p) - xim = XOpenIM(XtDisplay(ctx), NULL, NULL, NULL); - - if (!xim) { - LogError("Failed to open input method\n"); - return; - } - - ctx->login.xic = XCreateIC(xim, - XNInputStyle, (XIMPreeditNothing|XIMStatusNothing), - XNClientWindow, ctx->core.window, - XNFocusWindow, ctx->core.window, NULL); - - if (!ctx->login.xic) { - LogError("Failed to create input context\n"); - XCloseIM(xim); - } - return; -} - -/* ARGSUSED */ -static void -InsertChar ( - Widget ctxw, - XEvent *event, - String *params, - Cardinal *num_params) -{ - LoginWidget ctx = (LoginWidget)ctxw; - - char strbuf[128]; - int len, promptNum = ctx->login.activePrompt; - KeySym keysym = 0; - - if (ctx->login.xic) { - static Status status; - len = XmbLookupString(ctx->login.xic, &event->xkey, strbuf, - sizeof (strbuf), &keysym, &status); - } else { - static XComposeStatus compose_status = {NULL, 0}; - len = XLookupString (&event->xkey, strbuf, sizeof (strbuf), - &keysym, &compose_status); - } - strbuf[len] = '\0'; - - /* - * Note: You can override this default key handling - * by the settings in the translation table - * loginActionsTable at the end of this file. - */ - switch (keysym) { - case XK_Return: - case XK_KP_Enter: - case XK_Linefeed: - case XK_Execute: - FinishField(ctxw, event, params, num_params); - return; - case XK_BackSpace: - DeleteBackwardChar(ctxw, event, params, num_params); - return; - case XK_Delete: - case XK_KP_Delete: - case DXK_Remove: - /* Sorry, it's not a telex machine, it's a terminal */ - DeleteForwardChar(ctxw, event, params, num_params); - return; - case XK_Left: - case XK_KP_Left: - MoveBackwardChar(ctxw, event, params, num_params); - return; - case XK_Right: - case XK_KP_Right: - MoveForwardChar(ctxw, event, params, num_params); - return; - case XK_End: - case XK_KP_End: - MoveToEnd(ctxw, event, params, num_params); - return; - case XK_Home: - case XK_KP_Home: - MoveToBegining(ctxw, event, params, num_params); - return; - default: - if (len == 0) { - if (!IsModifierKey(keysym)) /* it's not a modifier */ - XBell(XtDisplay(ctxw), 60); - return; - } else - break; - } - - if (ctx->login.state == PROMPTING) { - if ((len + (int)strlen(VALUE_TEXT(ctx, promptNum)) >= - (VALUE_TEXT_MAX(ctx,promptNum) - 1))) { - len = VALUE_TEXT_MAX(ctx,promptNum) - - strlen(VALUE_TEXT(ctx, promptNum)) - 2; - } - } - EraseCursor (ctx); - RemoveFail (ctx); - if (len != 0) - { - if (ctx->login.state == PROMPTING) { - EraseValue (ctx, PROMPT_CURSOR(ctx, promptNum), promptNum); - memmove(VALUE_TEXT(ctx, promptNum) + PROMPT_CURSOR(ctx, promptNum) + len, - VALUE_TEXT(ctx, promptNum) + PROMPT_CURSOR(ctx, promptNum), - strlen (VALUE_TEXT(ctx, promptNum) + PROMPT_CURSOR(ctx, promptNum))+1); - memmove(VALUE_TEXT(ctx, promptNum) + PROMPT_CURSOR(ctx, promptNum), - strbuf, len); - DrawValue (ctx, PROMPT_CURSOR(ctx, promptNum), promptNum); - PROMPT_CURSOR(ctx, promptNum) += len; - } - } - XorCursor (ctx); -} - - -/**** Copied from xclock.c - original author: Keith Packard ****/ -#ifdef USE_XFT -static XtConvertArgRec xftColorConvertArgs[] = { - {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen), - sizeof(Screen *)}, - {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap), - sizeof(Colormap)} -}; - -# define donestr(type, value, tstr) \ - { \ - if (toVal->addr != NULL) { \ - if (toVal->size < sizeof(type)) { \ - toVal->size = sizeof(type); \ - XtDisplayStringConversionWarning(dpy, \ - (char*) fromVal->addr, tstr); \ - return False; \ - } \ - *(type*)(toVal->addr) = (value); \ - } \ - else { \ - static type static_val; \ - static_val = (value); \ - toVal->addr = (XPointer)&static_val; \ - } \ - toVal->size = sizeof(type); \ - return True; \ - } - -static void -XmuFreeXftColor (XtAppContext app, XrmValuePtr toVal, XtPointer closure, - XrmValuePtr args, Cardinal *num_args) -{ - Screen *screen; - Colormap colormap; - XftColor *color; - - if (*num_args != 2) - { - XtAppErrorMsg (app, - "freeXftColor", "wrongParameters", - "XtToolkitError", - "Freeing an XftColor requires screen and colormap arguments", - (String *) NULL, (Cardinal *)NULL); - return; - } - - screen = *((Screen **) args[0].addr); - colormap = *((Colormap *) args[1].addr); - color = (XftColor *) toVal->addr; - XftColorFree (DisplayOfScreen (screen), - DefaultVisual (DisplayOfScreen (screen), - XScreenNumberOfScreen (screen)), - colormap, color); -} - -static Boolean -XmuCvtStringToXftColor(Display *dpy, - XrmValue *args, Cardinal *num_args, - XrmValue *fromVal, XrmValue *toVal, - XtPointer *converter_data) -{ - char *spec; - XRenderColor renderColor; - XftColor xftColor; - Screen *screen; - Colormap colormap; - - if (*num_args != 2) - { - XtAppErrorMsg (XtDisplayToApplicationContext (dpy), - "cvtStringToXftColor", "wrongParameters", - "XtToolkitError", - "String to render color conversion needs screen and colormap arguments", - (String *) NULL, (Cardinal *)NULL); - return False; - } - - screen = *((Screen **) args[0].addr); - colormap = *((Colormap *) args[1].addr); - - spec = (char *) fromVal->addr; - if (strcasecmp (spec, XtDefaultForeground) == 0) - { - renderColor.red = 0; - renderColor.green = 0; - renderColor.blue = 0; - renderColor.alpha = 0xffff; - } - else if (strcasecmp (spec, XtDefaultBackground) == 0) - { - renderColor.red = 0xffff; - renderColor.green = 0xffff; - renderColor.blue = 0xffff; - renderColor.alpha = 0xffff; - } - else if (!XRenderParseColor (dpy, spec, &renderColor)) - return False; - if (!XftColorAllocValue (dpy, - DefaultVisual (dpy, - XScreenNumberOfScreen (screen)), - colormap, - &renderColor, - &xftColor)) - return False; - - donestr (XftColor, xftColor, XtRXftColor); -} - -static void -XmuFreeXftFont (XtAppContext app, XrmValuePtr toVal, XtPointer closure, - XrmValuePtr args, Cardinal *num_args) -{ - Screen *screen; - XftFont *font; - - if (*num_args != 1) - { - XtAppErrorMsg (app, - "freeXftFont", "wrongParameters", - "XtToolkitError", - "Freeing an XftFont requires screen argument", - (String *) NULL, (Cardinal *)NULL); - return; - } - - screen = *((Screen **) args[0].addr); - font = *((XftFont **) toVal->addr); - if (font) - XftFontClose (DisplayOfScreen (screen), font); -} - -static Boolean -XmuCvtStringToXftFont(Display *dpy, - XrmValue *args, Cardinal *num_args, - XrmValue *fromVal, XrmValue *toVal, - XtPointer *converter_data) -{ - char *name; - XftFont *font; - Screen *screen; - - if (*num_args != 1) - { - XtAppErrorMsg (XtDisplayToApplicationContext (dpy), - "cvtStringToXftFont", "wrongParameters", - "XtToolkitError", - "String to XftFont conversion needs screen argument", - (String *) NULL, (Cardinal *)NULL); - return False; - } - - screen = *((Screen **) args[0].addr); - name = (char *) fromVal->addr; - - font = XftFontOpenName (dpy, - XScreenNumberOfScreen (screen), - name); - if (font) - { - donestr (XftFont *, font, XtRXftFont); - } - XtDisplayStringConversionWarning(dpy, (char *) fromVal->addr, XtRXftFont); - return False; -} - -static XtConvertArgRec xftFontConvertArgs[] = { - {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen), - sizeof(Screen *)}, -}; - - -static int -XmuXftTextWidth(Display *dpy, XftFont *font, FcChar8 *string, int len) -{ - XGlyphInfo extents; - - XftTextExtents8 (dpy, font, string, len, &extents); - - return extents.xOff; -} - -#endif /* USE_XFT */ - -static void -ClassInitialize(void) -{ -#ifdef USE_XFT - XtSetTypeConverter (XtRString, XtRXftColor, - XmuCvtStringToXftColor, - xftColorConvertArgs, XtNumber(xftColorConvertArgs), - XtCacheByDisplay, XmuFreeXftColor); - XtSetTypeConverter (XtRString, XtRXftFont, - XmuCvtStringToXftFont, - xftFontConvertArgs, XtNumber(xftFontConvertArgs), - XtCacheByDisplay, XmuFreeXftFont); -#endif /* USE_XFT */ -} -/**** End of portion borrowed from xclock ****/ - -/* ARGSUSED */ -static void Initialize ( - Widget greq, - Widget gnew, - ArgList args, - Cardinal *num_args) -{ - LoginWidget w = (LoginWidget)gnew; - XtGCMask valuemask, xvaluemask; - XGCValues myXGCV; - Arg position[2]; - Position x, y; -#ifdef USE_XINERAMA - XineramaScreenInfo *screens; - int s_num; -#endif - int rv = 0; - - myXGCV.foreground = w->login.hipixel; - myXGCV.background = w->core.background_pixel; - valuemask = GCForeground | GCBackground; - w->login.hiGC = XtGetGC(gnew, valuemask, &myXGCV); - - myXGCV.foreground = w->login.shdpixel; - myXGCV.background = w->core.background_pixel; - valuemask = GCForeground | GCBackground; - w->login.shdGC = XtGetGC(gnew, valuemask, &myXGCV); - - myXGCV.foreground = w->login.inppixel; - myXGCV.background = w->core.background_pixel; - valuemask = GCForeground | GCBackground; - w->login.inpGC = XtGetGC(gnew, valuemask, &myXGCV); - - myXGCV.foreground = TEXT_COLOR(text); - myXGCV.background = w->core.background_pixel; - valuemask = GCForeground | GCBackground; -#ifndef USE_XFT - if (w->login.textFont) { - myXGCV.font = w->login.textFont->fid; - valuemask |= GCFont; - } -#endif - w->login.textGC = XtGetGC(gnew, valuemask, &myXGCV); - myXGCV.foreground = w->login.inppixel; - w->login.bgGC = XtGetGC(gnew, valuemask, &myXGCV); - - myXGCV.foreground = TEXT_COLOR(text) ^ w->login.inppixel; - myXGCV.function = GXxor; - xvaluemask = valuemask | GCFunction; - w->login.xorGC = XtGetGC (gnew, xvaluemask, &myXGCV); - -#ifndef USE_XFT - /* - * Note that the second argument is a GCid -- QueryFont accepts a GCid and - * returns the curently contained font. - */ - - if (w->login.textFont == NULL) - w->login.textFont = XQueryFont (XtDisplay (w), - XGContextFromGC (XDefaultGCOfScreen (XtScreen (w)))); - - xvaluemask = valuemask; - if (w->login.promptFont == NULL) - w->login.promptFont = w->login.textFont; - else - xvaluemask |= GCFont; - - myXGCV.foreground = TEXT_COLOR(prompt); - myXGCV.font = w->login.promptFont->fid; - w->login.promptGC = XtGetGC (gnew, xvaluemask, &myXGCV); - - xvaluemask = valuemask; - if (w->login.greetFont == NULL) - w->login.greetFont = w->login.textFont; - else - xvaluemask |= GCFont; - - myXGCV.foreground = TEXT_COLOR(greet); - myXGCV.font = w->login.greetFont->fid; - w->login.greetGC = XtGetGC (gnew, xvaluemask, &myXGCV); - - xvaluemask = valuemask; - if (w->login.failFont == NULL) - w->login.failFont = w->login.textFont; - else - xvaluemask |= GCFont; - myXGCV.foreground = TEXT_COLOR(fail); - myXGCV.font = w->login.failFont->fid; - w->login.failGC = XtGetGC (gnew, xvaluemask, &myXGCV); -#endif /* USE_XFT */ - -#ifdef XPM - w->login.logoValid = False; - - if (NULL != w->login.logoFileName) - { - XpmAttributes myAttributes = { 0 }; - Window tmpWindow = { 0 }; - struct stat myBuffer = { 0 }; - unsigned int myPixmapDepth = 0; - - if (0 != stat(w->login.logoFileName, &myBuffer)) - { - LogError("Unable to stat() pixmap file %s\n", - w->login.logoFileName); - w->login.logoValid = False; - goto SkipXpmLoad; - } - - myAttributes.valuemask |= XpmReturnPixels; - myAttributes.valuemask |= XpmReturnExtensions; - - rv = XpmReadFileToPixmap(XtDisplay(w), /* display */ - RootWindowOfScreen(XtScreen(w)), /* window */ - w->login.logoFileName, /* XPM filename */ - &(w->login.logoPixmap), /* pixmap */ - &(w->login.logoMask), /* pixmap mask */ - &myAttributes); /* XPM attributes */ - - if ( rv < 0 ) - { - LogError("Cannot load xpm file %s: %s.\n", w->login.logoFileName, - XpmGetErrorString(rv)); - goto SkipXpmLoad; - } - - w->login.logoValid = True; - - XGetGeometry(XtDisplay(w), w->login.logoPixmap, - &tmpWindow, - &(w->login.logoX), - &(w->login.logoY), - &(w->login.logoWidth), - &(w->login.logoHeight), - &(w->login.logoBorderWidth), - &myPixmapDepth); - } else { - w->login.logoX = 0; - w->login.logoY = 0; - w->login.logoWidth = 0; - w->login.logoHeight = 0; - w->login.logoBorderWidth = 0; - } - - -SkipXpmLoad: -#endif /* XPM */ - w->login.data.name[0] = '\0'; - w->login.data.passwd[0] = '\0'; - w->login.state = INITIALIZING; - w->login.activePrompt = LOGIN_PROMPT_USERNAME; - w->login.failUp = 0; - w->login.fail = (char *) w->login.failMsg; - - /* Set prompt defaults */ - PROMPT_TEXT(w, LOGIN_PROMPT_USERNAME) = NULL; - DEF_PROMPT_TEXT(w, LOGIN_PROMPT_USERNAME) = w->login.namePrompt; - VALUE_TEXT(w, LOGIN_PROMPT_USERNAME) = w->login.data.name; - VALUE_TEXT_MAX(w, LOGIN_PROMPT_USERNAME) = sizeof(w->login.data.name); - VALUE_SHOW_START(w, LOGIN_PROMPT_USERNAME) = 0; - - PROMPT_TEXT(w, LOGIN_PROMPT_PASSWORD) = NULL; - DEF_PROMPT_TEXT(w, LOGIN_PROMPT_PASSWORD) = w->login.passwdPrompt; - VALUE_TEXT(w, LOGIN_PROMPT_PASSWORD) = w->login.data.passwd; - VALUE_TEXT_MAX(w, LOGIN_PROMPT_PASSWORD) = sizeof(w->login.data.passwd); - VALUE_SHOW_START(w, LOGIN_PROMPT_PASSWORD) = 0; - - SetPrompt(gnew, LOGIN_PROMPT_PASSWORD, NULL, LOGIN_PROMPT_ECHO_OFF, False); - SetPrompt(gnew, LOGIN_PROMPT_USERNAME, NULL, LOGIN_PROMPT_ECHO_ON, False); - - if (w->core.width == 0) - w->core.width = max (GREET_W(w), FAIL_W(w)) + PAD_X(w); - if (w->core.height == 0) { - int fy = FAIL_Y(w); - int pady = PAD_Y(w); - -#ifndef XPM - w->core.height = fy + pady; /* for stupid compilers */ -#else -/* w->core.height = fy + pady; * for stupid compilers */ - - w->core.height = max(fy + pady, - (w->login.logoHeight + (2*w->login.logoPadding)) + pady); - -#endif /* XPM */ - } -#ifdef USE_XINERAMA - if ( - XineramaIsActive(XtDisplay(w)) && - (screens = XineramaQueryScreens(XtDisplay(w), &s_num)) != NULL - ) - { - if ((x = w->core.x) == -1) - x = screens[0].x_org + (int)(screens[0].width - w->core.width) / 2; - if ((y = w->core.y) == -1) - y = screens[0].y_org + (int)(screens[0].height - w->core.height) / 3; - - XFree(screens); - } - else -#endif - { - if ((x = w->core.x) == -1) - x = (int)(XWidthOfScreen (XtScreen (w)) - w->core.width) / 2; - if ((y = w->core.y) == -1) - y = (int)(XHeightOfScreen (XtScreen (w)) - w->core.height) / 3; - } - XtSetArg (position[0], XtNx, x); - XtSetArg (position[1], XtNy, y); - XtSetValues (XtParent (w), position, (Cardinal) 2); - - w->login.state = PROMPTING; -} - - -static void Realize ( - Widget gw, - XtValueMask *valueMask, - XSetWindowAttributes *attrs) -{ - LoginWidget w = (LoginWidget) gw; - Cursor cursor; - - XtCreateWindow( gw, (unsigned)InputOutput, (Visual *)CopyFromParent, - *valueMask, attrs ); - InitI18N(gw); - -#ifdef USE_XFT - w->login.draw = XftDrawCreate (XtDisplay (w), XtWindow(w), - DefaultVisual (XtDisplay (w), DefaultScreen(XtDisplay (w))), - w->core.colormap); - -#endif - - cursor = XCreateFontCursor(XtDisplay(gw), XC_left_ptr); - XDefineCursor(XtDisplay(gw), DefaultRootWindow(XtDisplay(gw)), cursor); - -#ifdef XPM - /* - * Check if Pixmap was valid - */ - if (True == w->login.logoValid) - { - /* - * Create pixmap window - */ - { - XSetWindowAttributes windowAttributes = { - .background_pixel = w->core.background_pixel, - .background_pixmap = None - }; - - w->login.logoWindow = XCreateWindow(XtDisplay(w), - XtWindow(w), - w->core.width - w->login.outframewidth - - w->login.logoWidth - w->login.logoPadding, - (w->core.height - w->login.logoHeight) /2, - w->login.logoWidth, w->login.logoHeight, 0, - CopyFromParent, InputOutput, CopyFromParent, - CWBackPixel | CWBackPixmap, &windowAttributes); - } - - /* - * check if we can use shape extension - */ - if (True == w->login.useShape) - { - int foo, bar; - - if (XShapeQueryExtension(XtDisplay(w), &foo, &bar) == TRUE) - { - XShapeCombineMask(XtDisplay(w), w->login.logoWindow, - ShapeBounding, w->login.logoX, w->login.logoY, - w->login.logoMask, ShapeSet); - } - } - - XSetWindowBackgroundPixmap(XtDisplay(w), w->login.logoWindow, - w->login.logoPixmap); - XMapWindow(XtDisplay(w), w->login.logoWindow); - } -#endif /* XPM */ -} - -static void Destroy (Widget gw) -{ - LoginWidget w = (LoginWidget)gw; - bzero (w->login.data.name, NAME_LEN); - bzero (w->login.data.passwd, PASSWORD_LEN); - - if (PROMPT_TEXT(w,0) != NULL) - XtFree(PROMPT_TEXT(w,0)); - if (PROMPT_TEXT(w,1) != NULL) - XtFree(PROMPT_TEXT(w,1)); - -#ifdef USE_XFT - if (w->login.draw) { - XftDrawDestroy(w->login.draw); - w->login.draw = NULL; - } -#endif - - XtReleaseGC(gw, w->login.textGC); - XtReleaseGC(gw, w->login.bgGC); - XtReleaseGC(gw, w->login.xorGC); -#ifndef USE_XFT - XtReleaseGC(gw, w->login.promptGC); - XtReleaseGC(gw, w->login.greetGC); - XtReleaseGC(gw, w->login.failGC); -#endif - XtReleaseGC(gw, w->login.hiGC); - XtReleaseGC(gw, w->login.shdGC); - XtReleaseGC(gw, w->login.inpGC); - -#ifdef XPM - if (True == w->login.logoValid) - { - if (w->login.logoPixmap != 0) - XFreePixmap(XtDisplay(w), w->login.logoPixmap); - - if (w->login.logoMask != 0) - XFreePixmap(XtDisplay(w), w->login.logoMask); - } -#endif /* XPM */ -} - -/* ARGSUSED */ -static void Redisplay( - Widget gw, - XEvent *event, - Region region) -{ - draw_it ((LoginWidget) gw); -} - -/*ARGSUSED*/ -static Boolean SetValues ( - Widget current, - Widget request, - Widget new, - ArgList args, - Cardinal *num_args) -{ - LoginWidget currentL, newL; - - currentL = (LoginWidget) current; - newL = (LoginWidget) new; - if (GREETING (currentL) != GREETING (newL)) - return True; - return False; -} - -static -char defaultLoginTranslations [] = -"Ctrl<Key>H: delete-previous-character() \n" -"Ctrl<Key>D: delete-character() \n" -"Ctrl<Key>B: move-backward-character() \n" -"Ctrl<Key>F: move-forward-character() \n" -"Ctrl<Key>A: move-to-begining() \n" -"Ctrl<Key>E: move-to-end() \n" -"Ctrl<Key>K: erase-to-end-of-line() \n" -"Ctrl<Key>U: erase-line() \n" -"Ctrl<Key>X: erase-line() \n" -"Ctrl<Key>C: restart-session() \n" -"Ctrl<Key>\\\\: abort-session() \n" -":Ctrl<Key>plus: allow-all-access() \n" -"<Key>BackSpace: delete-previous-character() \n" -#ifdef linux -"<Key>Delete: delete-character() \n" -#else -"<Key>Delete: delete-previous-character() \n" -#endif -"<Key>Return: finish-field() \n" -"<Key>Tab: tab-field() \n" -"<KeyPress>: insert-char()" -; - -static -XtActionsRec loginActionsTable [] = { - {"delete-previous-character", DeleteBackwardChar}, - {"delete-character", DeleteForwardChar}, - {"move-backward-character", MoveBackwardChar}, - {"move-forward-character", MoveForwardChar}, - {"move-to-begining", MoveToBegining}, - {"move-to-end", MoveToEnd}, - {"erase-to-end-of-line", EraseToEndOfLine}, - {"erase-line", EraseLine}, - {"finish-field", FinishField}, - {"tab-field", TabField}, - {"abort-session", AbortSession}, - {"abort-display", AbortDisplay}, - {"restart-session", RestartSession}, - {"insert-char", InsertChar}, - {"set-session-argument", SetSessionArgument}, - {"allow-all-access", AllowAccess}, -}; - -LoginClassRec loginClassRec = { - { /* core fields */ - /* superclass */ &widgetClassRec, - /* class_name */ "Login", - /* size */ sizeof(LoginRec), - /* class_initialize */ ClassInitialize, - /* class_part_initialize */ NULL, - /* class_inited */ FALSE, - /* initialize */ Initialize, - /* initialize_hook */ NULL, - /* realize */ Realize, - /* actions */ loginActionsTable, - /* num_actions */ XtNumber (loginActionsTable), - /* resources */ resources, - /* num_resources */ XtNumber(resources), - /* xrm_class */ NULLQUARK, - /* compress_motion */ TRUE, - /* compress_exposure */ TRUE, - /* compress_enterleave */ TRUE, - /* visible_interest */ FALSE, - /* destroy */ Destroy, - /* resize */ NULL, - /* expose */ Redisplay, - /* set_values */ SetValues, - /* set_values_hook */ NULL, - /* set_values_almost */ XtInheritSetValuesAlmost, - /* get_values_hook */ NULL, - /* accept_focus */ NULL, - /* version */ XtVersion, - /* callback_private */ NULL, - /* tm_table */ defaultLoginTranslations, - /* query_geometry */ XtInheritQueryGeometry, - /* display_accelerator */ XtInheritDisplayAccelerator, - /* extension */ NULL - } -}; - -WidgetClass loginWidgetClass = (WidgetClass) &loginClassRec; diff --git a/app/xdm/greeter/Login.h b/app/xdm/greeter/Login.h deleted file mode 100644 index 6af33694d..000000000 --- a/app/xdm/greeter/Login.h +++ /dev/null @@ -1,227 +0,0 @@ -/* - -Copyright 1988, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* - * xdm - display manager daemon - * Author: Keith Packard, MIT X Consortium - */ - - -#ifndef _XtLogin_h -# define _XtLogin_h - -/*********************************************************************** - * - * Login Widget - * - ***********************************************************************/ - -/* Parameters: - - Name Class RepType Default Value - ---- ----- ------- ------------- - background Background pixel White - border BorderColor pixel Black - borderWidth BorderWidth int 1 - foreground Foreground Pixel Black - height Height int 120 - mappedWhenManaged MappedWhenManaged Boolean True - width Width int 120 - x Position int 0 - y Position int 0 - -*/ - -# define XtNgreeting "greeting" -# define XtNunsecureGreeting "unsecureGreeting" -# define XtNnamePrompt "namePrompt" -# define XtNpasswdPrompt "passwdPrompt" -# define XtNfail "fail" -# define XtNnotifyDone "notifyDone" -# define XtNpromptColor "promptColor" -# define XtNgreetColor "greetColor" -# define XtNfailColor "failColor" -# define XtNpromptFont "promptFont" -# define XtNgreetFont "greetFont" -# define XtNfailFont "failFont" -# define XtNpromptFace "promptFace" -# define XtNgreetFace "greetFace" -# define XtNfailFace "failFace" -# define XtNfailTimeout "failTimeout" -# define XtNsessionArgument "sessionArgument" -# define XtNsecureSession "secureSession" -# define XtNallowAccess "allowAccess" -# define XtNallowNullPasswd "allowNullPasswd" -# define XtNallowRootLogin "allowRootLogin" -# define XtNechoPasswd "echoPasswd" -# define XtNechoPasswdChar "echoPasswdChar" - -# define XtNface "face" -# define XtCFace "Face" -# define XtRXftFont "XftFont" -# define XtRXftColor "XftColor" - -/* added by Amit Margalit Oct 1996 */ -# define XtNhiColor "hiColor" -# define XtNshdColor "shdColor" -# define XtNinpColor "inpColor" -# define XtNframeWidth "frameWidth" -# define XtCFrameWidth "FrameWidth" -# define XtNinnerFramesWidth "innerFramesWidth" -# define XtNsepWidth "sepWidth" - -# ifdef DANCING -/* caolan begin */ -# define XtNlastEventTime "lastEventTime" -# define XtCLastEventTime "LastEventTime" -/* caolan end */ -# endif /* DANCING */ - -# ifdef XPM -# define XtNuseShape "useShape" -# define XtCUseShape "UseShape" -# define XtNlogoFileName "logoFileName" -# define XtCLogoFileName "LogoFileName" -# define XtNlogoPadding "logoPadding" -# define XtCLogoPadding "LogoPadding" -# endif /* XPM */ - -# define XtCGreeting "Greeting" -# define XtCNamePrompt "NamePrompt" -# define XtCPasswdPrompt "PasswdPrompt" -# define XtCFail "Fail" -# define XtCFailTimeout "FailTimeout" -# define XtCSessionArgument "SessionArgument" -# define XtCSecureSession "SecureSession" -# define XtCAllowAccess "AllowAccess" -# define XtCAllowNullPasswd "AllowNullPasswd" -# define XtCAllowRootLogin "AllowRootLogin" -# define XtCEchoPasswd "EchoPasswd" -# define XtCEchoPasswdChar "EchoPasswdChar" - -# define XtNchangePasswdMessage "changePasswdMessage" -# define XtCChangePasswdMessage "ChangePasswdMessage" - -/* notifyDone interface definition */ - -# ifdef __OpenBSD__ -# include <sys/param.h> -# endif - -# include <pwd.h> -# include <limits.h> - -# ifdef USE_PAM -# define NAME_LEN PAM_MAX_RESP_SIZE -# define PASSWORD_LEN PAM_MAX_RESP_SIZE -# endif - -/* Defined to be in <limits.h> by SUSv2 */ -# if !defined(PASSWORD_LEN) && defined(PASS_MAX) -# define PASSWORD_LEN PASS_MAX -# endif - -/* _PW_NAME_LEN is found in <pwd.h> on OpenBSD > 2.8 (200012) */ -# if !defined(NAME_LEN) && defined(_PW_NAME_LEN) -# define NAME_LEN (_PW_NAME_LEN + 2) -# endif - -/* _PASSWORD_LEN appears to come from 4.4BSD-Lite <pwd.h> */ -# if !defined(PASSWORD_LEN) && defined(_PASSWORD_LEN) -# define PASSWORD_LEN (_PASSWORD_LEN + 2) -# endif - -/* Fallbacks if no other definition found */ -# ifndef NAME_LEN -# define NAME_LEN 32 -# endif - -# ifndef PASSWORD_LEN -# define PASSWORD_LEN 32 -# endif - -typedef struct _LoginData { - char name[NAME_LEN], passwd[PASSWORD_LEN]; -} LoginData; - -# define NOTIFY_OK 0 -# define NOTIFY_ABORT 1 -# define NOTIFY_RESTART 2 -# define NOTIFY_ABORT_DISPLAY 3 - -typedef struct _LoginRec *LoginWidget; /* completely defined in LoginPrivate.h */ -typedef struct _LoginClassRec *LoginWidgetClass; /* completely defined in LoginPrivate.h */ - -extern WidgetClass loginWidgetClass; - -extern void ErrorMessage(Widget ctx, const char *message, Bool timeout); -extern void ShowChangePasswdMessage(Widget ctx); - -typedef enum { - LOGIN_PROMPT_NOT_SHOWN, /* Neither prompt nor input shown */ - LOGIN_PROMPT_ECHO_ON, /* Both prompt and input shown */ - LOGIN_PROMPT_ECHO_OFF, /* Prompt shown, input accepted but not - shown (bullets may be shown instead) */ - LOGIN_TEXT_INFO /* Prompt shown, no input area */ -} loginPromptState; - -/* Default prompt meanings for simple username/password auth systems */ -# define LOGIN_PROMPT_USERNAME 0 -# define LOGIN_PROMPT_PASSWORD 1 - -extern int SetPrompt(Widget ctx, int promptId, const char *message, - loginPromptState state, Boolean minimumTime); -extern const char *GetPrompt(Widget ctx, int promptId); - -extern int SetValue(Widget ctx, int promptId, char *value); -extern const char *GetValue(Widget ctx, int promptId); - -#endif /* _XtLogin_h */ -/* DON'T ADD STUFF AFTER THIS #endif */ diff --git a/app/xdm/greeter/LoginP.h b/app/xdm/greeter/LoginP.h deleted file mode 100644 index 57ed18241..000000000 --- a/app/xdm/greeter/LoginP.h +++ /dev/null @@ -1,192 +0,0 @@ -/* - -Copyright 1988, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* - * xdm - display manager daemon - * Author: Keith Packard, MIT X Consortium - */ - -#ifndef _LoginP_h -# define _LoginP_h - -# include "Login.h" -# include <X11/IntrinsicP.h> -# include <X11/CoreP.h> -# include <X11/Xlib.h> -# ifdef USE_XFT -# include <X11/Xft/Xft.h> -# endif - -# define INITIALIZING 0 -# define PROMPTING 1 -# define SHOW_MESSAGE 2 -# define DONE 3 - -typedef void (*LoginFunc)(LoginWidget, LoginData *, int); - -typedef struct { - char * promptText; /* Prompt displayed */ - const char * defaultPrompt; /* Default text for prompt */ - char * valueText; /* Value entered for prompt */ - size_t valueTextMax; /* Size of valueText buffer */ - int valueShownStart;/* Amount of string shown if too */ - int valueShownEnd; /* long to fit in field */ - int cursor; /* current cursor position */ - loginPromptState state; -} loginPromptData; - -# define NUM_PROMPTS 2 /* Currently only 2 prompt fields supported */ -# define LAST_PROMPT (NUM_PROMPTS - 1) - -/* New fields for the login widget instance record */ -typedef struct { -# ifndef USE_XFT - Pixel textpixel; /* foreground pixel */ - Pixel promptpixel; /* prompt pixel */ - Pixel greetpixel; /* greeting pixel */ - Pixel failpixel; /* failure pixel */ -# endif - Pixel hipixel; /* frame hilite pixel */ - Pixel shdpixel; /* shadow frame pixel */ - Pixel inppixel; /* input field bg pixel */ - GC textGC; /* pointer to GraphicsContext */ - GC bgGC; /* pointer to GraphicsContext */ - GC xorGC; /* pointer to GraphicsContext */ -# ifndef USE_XFT - GC promptGC; - GC greetGC; - GC failGC; -# endif - GC hiGC; /* for hilight part of frame */ - GC shdGC; /* for shaded part of frame */ - GC inpGC; /* for input field of frame */ - char *greeting; /* greeting */ - char *unsecure_greet;/* message displayed when insecure */ - char *namePrompt; /* name prompt */ - char *passwdPrompt; /* password prompt */ - char *failMsg; /* failure message */ - char *fail; /* current error message */ - char *passwdChangeMsg; /* message when passwd expires */ -# ifndef USE_XFT - XFontStruct *textFont; /* font for text */ - XFontStruct *promptFont; /* font for prompts */ - XFontStruct *greetFont; /* font for greeting */ - XFontStruct *failFont; /* font for failure message */ -# endif /* USE_XFT */ - int state; /* state */ - int activePrompt; /* which prompt is active */ - int failUp; /* failure message displayed */ - LoginData data; /* name/passwd */ - char *sessionArg; /* argument passed to session */ - LoginFunc notify_done; /* proc to call when done */ - int failTimeout; /* seconds til drop fail msg */ - XtIntervalId interval_id; /* drop fail message note */ - Boolean secure_session; /* session is secured */ - Boolean allow_access; /* disable access control on login */ - Boolean allow_null_passwd; /* allow null password on login */ - Boolean allow_root_login; /* allow root login */ - /* option to display characters such as asterisks, i.e. '**...' - for no-echo prompts like passwords */ - Boolean echo_passwd; - char * echo_passwd_char; - XIC xic; /* input method of input context */ - loginPromptData prompts[NUM_PROMPTS]; - time_t msgTimeout; - -# ifdef DANCING - /*caolan begin*/ - int lastEventTime; - /*caolan end*/ -# endif /* DANCING */ - - int outframewidth; /* outer frame thickness */ - int inframeswidth; /* inner frames thickness */ - int sepwidth; /* width of separator line */ - -# ifdef XPM - char *logoFileName; - unsigned int logoWidth, logoHeight, logoPadding, logoBorderWidth; - int logoX, logoY; - Window logoWindow; - Boolean useShape, logoValid; - Pixmap logoPixmap, logoMask; -# endif /* XPM */ -# ifdef USE_XFT - XftDraw *draw; - XftFont *textFace; /* font for text */ - XftFont *promptFace; /* font for prompts */ - XftFont *greetFace; /* font for greeting */ - XftFont *failFace; /* font for failure message */ - XftColor textcolor; /* foreground color */ - XftColor promptcolor; /* prompt color */ - XftColor greetcolor; /* greeting color */ - XftColor failcolor; /* failure color */ -# endif - } LoginPart; - -/* Full instance record declaration */ -typedef struct _LoginRec { - CorePart core; - LoginPart login; - } LoginRec; - -/* New fields for the Login widget class record */ -typedef struct {int dummy;} LoginClassPart; - -/* Full class record declaration. */ -typedef struct _LoginClassRec { - CoreClassPart core_class; - LoginClassPart login_class; - } LoginClassRec; - -/* Class pointer. */ -extern LoginClassRec loginClassRec; - -#endif /* _LoginP_h */ diff --git a/app/xdm/greeter/Makefile.am b/app/xdm/greeter/Makefile.am deleted file mode 100644 index 4e0d0a171..000000000 --- a/app/xdm/greeter/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -xdmlibdir = $(XDMLIBDIR) - -if DYNAMIC_GREETER -xdmlib_LTLIBRARIES = libXdmGreet.la -else -noinst_LTLIBRARIES = libXdmGreet.la -endif - -libXdmGreet_la_SOURCES = \ - Login.c \ - Login.h \ - LoginP.h \ - greet.c \ - verify.c - -libXdmGreet_la_LIBADD = $(XDMGREET_LIBS) - -AM_CPPFLAGS = -I$(top_srcdir)/include -AM_CFLAGS = $(CWARNFLAGS) $(XDMGREET_CFLAGS) -DGREET_LIB - -if DYNAMIC_GREETER -libXdmGreet_la_LDFLAGS = -module -avoid-version -else -libXdmGreet_la_LDFLAGS = -static -endif - -if LINT -ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) - -lint: - $(LINT) $(ALL_LINT_FLAGS) $(libXdmGreet_la_SOURCES) - -endif LINT diff --git a/app/xdm/greeter/Makefile.in b/app/xdm/greeter/Makefile.in deleted file mode 100644 index 2cc30b7e6..000000000 --- a/app/xdm/greeter/Makefile.in +++ /dev/null @@ -1,719 +0,0 @@ -# Makefile.in generated by automake 1.12.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2012 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = greeter -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/depcomp -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(xdmlibdir)" -LTLIBRARIES = $(noinst_LTLIBRARIES) $(xdmlib_LTLIBRARIES) -am__DEPENDENCIES_1 = -libXdmGreet_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libXdmGreet_la_OBJECTS = Login.lo greet.lo verify.lo -libXdmGreet_la_OBJECTS = $(am_libXdmGreet_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libXdmGreet_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(libXdmGreet_la_LDFLAGS) $(LDFLAGS) -o \ - $@ -@DYNAMIC_GREETER_FALSE@am_libXdmGreet_la_rpath = -@DYNAMIC_GREETER_TRUE@am_libXdmGreet_la_rpath = -rpath $(xdmlibdir) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libXdmGreet_la_SOURCES) -DIST_SOURCES = $(libXdmGreet_la_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ -ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -APPDEFS_CFLAGS = @APPDEFS_CFLAGS@ -APPDEFS_LIBS = @APPDEFS_LIBS@ -APP_MAN_DIR = @APP_MAN_DIR@ -APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ -AR = @AR@ -AUTH_CFLAGS = @AUTH_CFLAGS@ -AUTH_LIBS = @AUTH_LIBS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASE_CFLAGS = @BASE_CFLAGS@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CHANGELOG_CMD = @CHANGELOG_CMD@ -CHOOSER_CFLAGS = @CHOOSER_CFLAGS@ -CHOOSER_LIBS = @CHOOSER_LIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CWARNFLAGS = @CWARNFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFAULTVT = @DEFAULTVT@ -DEFS = @DEFS@ -DEF_AUTH_DIR = @DEF_AUTH_DIR@ -DEF_CHOOSER = @DEF_CHOOSER@ -DEF_FAILSAFE_CLIENT = @DEF_FAILSAFE_CLIENT@ -DEF_GREETER_LIB = @DEF_GREETER_LIB@ -DEF_SERVER_LINE = @DEF_SERVER_LINE@ -DEF_SESSION = @DEF_SESSION@ -DEF_SYSTEM_PATH = @DEF_SYSTEM_PATH@ -DEF_SYSTEM_SHELL = @DEF_SYSTEM_SHELL@ -DEF_USER_PATH = @DEF_USER_PATH@ -DEF_XDM_CONFIG = @DEF_XDM_CONFIG@ -DEPDIR = @DEPDIR@ -DEV_RANDOM = @DEV_RANDOM@ -DLLTOOL = @DLLTOOL@ -DMCP_CFLAGS = @DMCP_CFLAGS@ -DMCP_LIBS = @DMCP_LIBS@ -DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ -DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILE_MAN_DIR = @FILE_MAN_DIR@ -FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -GREP = @GREP@ -HAVE_ARC4RANDOM = @HAVE_ARC4RANDOM@ -INSTALL = @INSTALL@ -INSTALL_CMD = @INSTALL_CMD@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIB_MAN_DIR = @LIB_MAN_DIR@ -LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ -LINT = @LINT@ -LINT_FLAGS = @LINT_FLAGS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MAN_SUBSTS = @MAN_SUBSTS@ -MISC_MAN_DIR = @MISC_MAN_DIR@ -MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ -MKDIR_P = @MKDIR_P@ -MKTEMP_COMMAND = @MKTEMP_COMMAND@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -RANLIB = @RANLIB@ -RAWCPP = @RAWCPP@ -RAWCPPFLAGS = @RAWCPPFLAGS@ -SED = @SED@ -SERVERSTYPE = @SERVERSTYPE@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -SHELL_CMD = @SHELL_CMD@ -STRICT_CFLAGS = @STRICT_CFLAGS@ -STRIP = @STRIP@ -SU = @SU@ -SYSTEMD_DAEMON_CFLAGS = @SYSTEMD_DAEMON_CFLAGS@ -SYSTEMD_DAEMON_LIBS = @SYSTEMD_DAEMON_LIBS@ -TRADITIONALCPPFLAGS = @TRADITIONALCPPFLAGS@ -UTMP_FILE = @UTMP_FILE@ -VERSION = @VERSION@ -WTMP_FILE = @WTMP_FILE@ -XDMCONFIGDIR = @XDMCONFIGDIR@ -XDMGREET_CFLAGS = @XDMGREET_CFLAGS@ -XDMGREET_LIBS = @XDMGREET_LIBS@ -XDMLIBDIR = @XDMLIBDIR@ -XDMLOGDIR = @XDMLOGDIR@ -XDMPIDDIR = @XDMPIDDIR@ -XDMSCRIPTDIR = @XDMSCRIPTDIR@ -XDMSHELL_CFLAGS = @XDMSHELL_CFLAGS@ -XDMSHELL_LIBS = @XDMSHELL_LIBS@ -XDMXAUTHDIR = @XDMXAUTHDIR@ -XDM_BWPIXMAP = @XDM_BWPIXMAP@ -XDM_CFLAGS = @XDM_CFLAGS@ -XDM_LIBS = @XDM_LIBS@ -XDM_PIXMAP = @XDM_PIXMAP@ -XDM_PIXMAPDIR = @XDM_PIXMAPDIR@ -XDM_TOOLKIT_CFLAGS = @XDM_TOOLKIT_CFLAGS@ -XDM_TOOLKIT_LIBS = @XDM_TOOLKIT_LIBS@ -XFT_CFLAGS = @XFT_CFLAGS@ -XFT_LIBS = @XFT_LIBS@ -XINERAMA_CFLAGS = @XINERAMA_CFLAGS@ -XINERAMA_LIBS = @XINERAMA_LIBS@ -XLIB_CFLAGS = @XLIB_CFLAGS@ -XLIB_LIBS = @XLIB_LIBS@ -XORG_MAN_PAGE = @XORG_MAN_PAGE@ -XPM_CFLAGS = @XPM_CFLAGS@ -XPM_LIBS = @XPM_LIBS@ -XRDB_PROGRAM = @XRDB_PROGRAM@ -XT_CFLAGS = @XT_CFLAGS@ -XT_LIBS = @XT_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -appdefaultdir = @appdefaultdir@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -systemdsystemunitdir = @systemdsystemunitdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -xdmlibdir = $(XDMLIBDIR) -@DYNAMIC_GREETER_TRUE@xdmlib_LTLIBRARIES = libXdmGreet.la -@DYNAMIC_GREETER_FALSE@noinst_LTLIBRARIES = libXdmGreet.la -libXdmGreet_la_SOURCES = \ - Login.c \ - Login.h \ - LoginP.h \ - greet.c \ - verify.c - -libXdmGreet_la_LIBADD = $(XDMGREET_LIBS) -AM_CPPFLAGS = -I$(top_srcdir)/include -AM_CFLAGS = $(CWARNFLAGS) $(XDMGREET_CFLAGS) -DGREET_LIB -@DYNAMIC_GREETER_FALSE@libXdmGreet_la_LDFLAGS = -static -@DYNAMIC_GREETER_TRUE@libXdmGreet_la_LDFLAGS = -module -avoid-version -@LINT_TRUE@ALL_LINT_FLAGS = $(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ -@LINT_TRUE@ $(AM_CPPFLAGS) $(CPPFLAGS) - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign greeter/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign greeter/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } -install-xdmlibLTLIBRARIES: $(xdmlib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(xdmlib_LTLIBRARIES)'; test -n "$(xdmlibdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(xdmlibdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(xdmlibdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(xdmlibdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(xdmlibdir)"; \ - } - -uninstall-xdmlibLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(xdmlib_LTLIBRARIES)'; test -n "$(xdmlibdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(xdmlibdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(xdmlibdir)/$$f"; \ - done - -clean-xdmlibLTLIBRARIES: - -test -z "$(xdmlib_LTLIBRARIES)" || rm -f $(xdmlib_LTLIBRARIES) - @list='$(xdmlib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } -libXdmGreet.la: $(libXdmGreet_la_OBJECTS) $(libXdmGreet_la_DEPENDENCIES) $(EXTRA_libXdmGreet_la_DEPENDENCIES) - $(AM_V_CCLD)$(libXdmGreet_la_LINK) $(am_libXdmGreet_la_rpath) $(libXdmGreet_la_OBJECTS) $(libXdmGreet_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Login.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/greet.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verify.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -cscopelist: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: - for dir in "$(DESTDIR)$(xdmlibdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - clean-xdmlibLTLIBRARIES mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-xdmlibLTLIBRARIES - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-xdmlibLTLIBRARIES - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES clean-xdmlibLTLIBRARIES \ - cscopelist ctags distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip \ - install-xdmlibLTLIBRARIES installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-xdmlibLTLIBRARIES - - -@LINT_TRUE@lint: -@LINT_TRUE@ $(LINT) $(ALL_LINT_FLAGS) $(libXdmGreet_la_SOURCES) - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/app/xdm/greeter/greet.c b/app/xdm/greeter/greet.c deleted file mode 100644 index 9fb6b8256..000000000 --- a/app/xdm/greeter/greet.c +++ /dev/null @@ -1,802 +0,0 @@ -/* - -Copyright 1988, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ -/* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - - -/* - * xdm - display manager daemon - * Author: Keith Packard, X Consortium - * - * widget to get username/password - * - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include <X11/Intrinsic.h> -#include <X11/StringDefs.h> -#include <X11/Shell.h> -#include <X11/XKBlib.h> - -#ifdef USE_XINERAMA -# include <X11/extensions/Xinerama.h> -#endif - -#include "dm.h" -#include "dm_error.h" -#include "greet.h" -#include "LoginP.h" - -#if defined(HAVE_OPENLOG) && defined(HAVE_SYSLOG_H) -# define USE_SYSLOG -# include <syslog.h> -# ifndef LOG_AUTHPRIV -# define LOG_AUTHPRIV LOG_AUTH -# endif -# ifndef LOG_PID -# define LOG_PID 0 -# endif -#endif - -#include <string.h> - -#if defined(SECURE_RPC) && defined(sun) -/* Go figure, there's no getdomainname() prototype available */ -extern int getdomainname(char *name, size_t len); -#endif - -/* - * Function pointers filled in by the initial call ito the library - */ -#ifdef GREET_LIB -int (*__xdm_PingServer)(struct display *d, Display *alternateDpy) = NULL; -void (*__xdm_SessionPingFailed)(struct display *d) = NULL; -void (*__xdm_Debug)(const char * fmt, ...) = NULL; -void (*__xdm_RegisterCloseOnFork)(int fd) = NULL; -void (*__xdm_SecureDisplay)(struct display *d, Display *dpy) = NULL; -void (*__xdm_UnsecureDisplay)(struct display *d, Display *dpy) = NULL; -void (*__xdm_ClearCloseOnFork)(int fd) = NULL; -void (*__xdm_SetupDisplay)(struct display *d) = NULL; -void (*__xdm_LogError)(const char * fmt, ...) = NULL; -void (*__xdm_SessionExit)(struct display *d, int status, int removeAuth) = NULL; -void (*__xdm_DeleteXloginResources)(struct display *d, Display *dpy) = NULL; -int (*__xdm_source)(char **environ, char *file) = NULL; -char **(*__xdm_defaultEnv)(void) = NULL; -char **(*__xdm_setEnv)(char **e, const char *name, const char *value) = NULL; -char **(*__xdm_putEnv)(const char *string, char **env) = NULL; -char **(*__xdm_parseArgs)(char **argv, const char *string) = NULL; -void (*__xdm_printEnv)(char **e) = NULL; -char **(*__xdm_systemEnv)(struct display *d, char *user, char *home) = NULL; -void (*__xdm_LogOutOfMem)(const char * fmt, ...) = NULL; -void (*__xdm_setgrent)(void) = NULL; -struct group *(*__xdm_getgrent)(void) = NULL; -void (*__xdm_endgrent)(void) = NULL; -# ifdef HAVE_GETSPNAM -struct spwd *(*__xdm_getspnam)(GETSPNAM_ARGS) = NULL; -# ifndef QNX4 -void (*__xdm_endspent)(void) = NULL; -# endif /* QNX4 doesn't use endspent */ -# endif -struct passwd *(*__xdm_getpwnam)(GETPWNAM_ARGS) = NULL; -# if defined(linux) || defined(__GLIBC__) -void (*__xdm_endpwent)(void) = NULL; -# endif -char *(*__xdm_crypt)(CRYPT_ARGS) = NULL; -# ifdef USE_PAM -pam_handle_t **(*__xdm_thepamhp)(void) = NULL; -# endif -#endif - -#ifdef SECURE_RPC -# include <rpc/rpc.h> -# include <rpc/key_prot.h> -#endif - -#ifdef K5AUTH -# include <krb5/krb5.h> -#endif - -static int done, code; -#ifndef USE_PAM -static char name[NAME_LEN], password[PASSWORD_LEN]; -#endif -static Widget toplevel; -static Widget login; -static XtAppContext context; -static XtIntervalId pingTimeout; - -#ifdef USE_PAM -static int pamconv(int num_msg, -# ifndef sun - const -# endif - struct pam_message **msg, - struct pam_response **response, void *appdata_ptr); - -# define PAM_ERROR_PRINT(pamfunc, pamh) \ - LogError("%s failure: %s\n", pamfunc, pam_strerror(pamh, pam_error)) - - -struct myconv_data { - struct display *d; - struct greet_info *greet; - char *username_display; -}; -#endif - - -/*ARGSUSED*/ -static void -GreetPingServer ( - XtPointer closure, - XtIntervalId *intervalId) -{ - struct display *d; - - d = (struct display *) closure; - if (!PingServer (d, XtDisplay (toplevel))) - SessionPingFailed (d); - pingTimeout = XtAppAddTimeOut (context, d->pingInterval * 60 * 1000, - GreetPingServer, (closure)); -} - -/*ARGSUSED*/ -static void -GreetDone ( - Widget w, - LoginData *data, - int status) -{ - Debug ("GreetDone: %s, (password is %d long)\n", - data->name, strlen (data->passwd)); - switch (status) { - case NOTIFY_OK: -#ifndef USE_PAM - strncpy (name, data->name, sizeof(name)); - name[sizeof(name)-1] = '\0'; - strncpy (password, data->passwd, sizeof(password)); - password[sizeof(password)-1] = '\0'; -#endif - code = 0; - done = 1; - break; - case NOTIFY_ABORT: - Debug ("RESERVER_DISPLAY\n"); - code = RESERVER_DISPLAY; - done = 1; - break; - case NOTIFY_RESTART: - Debug ("REMANAGE_DISPLAY\n"); - code = REMANAGE_DISPLAY; - done = 1; - break; - case NOTIFY_ABORT_DISPLAY: - Debug ("UNMANAGE_DISPLAY\n"); - code = UNMANAGE_DISPLAY; - done = 1; - break; - } -#ifndef USE_PAM - if (done) { - bzero (data->name, NAME_LEN); - bzero (data->passwd, PASSWORD_LEN); - } -#endif -} - -static Display * -InitGreet (struct display *d) -{ - Arg arglist[10]; - int i; - static int argc; - Screen *scrn; - static char *argv[] = { "xlogin", NULL }; - Display *dpy; -#ifdef USE_XINERAMA - XineramaScreenInfo *screens; - int s_num; -#endif - - Debug ("greet %s\n", d->name); - argc = 1; - XtToolkitInitialize (); - context = XtCreateApplicationContext(); - dpy = XtOpenDisplay (context, d->name, "xlogin", "Xlogin", NULL, 0, - &argc, argv); - - if (!dpy) - return NULL; - -#ifdef XKB - { - int opcode, evbase, errbase, majret, minret; - unsigned int value = XkbPCF_GrabsUseXKBStateMask; - if (XkbQueryExtension (dpy, &opcode, &evbase, &errbase, &majret, &minret)) { - if (!XkbSetPerClientControls (dpy, XkbPCF_GrabsUseXKBStateMask, &value)) - LogError ("%s\n", "SetPerClientControls failed"); - } - } -#endif - RegisterCloseOnFork (ConnectionNumber (dpy)); - - SecureDisplay (d, dpy); - - i = 0; - scrn = XDefaultScreenOfDisplay(dpy); - XtSetArg(arglist[i], XtNscreen, scrn); i++; - XtSetArg(arglist[i], XtNargc, argc); i++; - XtSetArg(arglist[i], XtNargv, argv); i++; - - toplevel = XtAppCreateShell ((String) NULL, "Xlogin", - applicationShellWidgetClass, dpy, arglist, i); - - i = 0; - XtSetArg (arglist[i], XtNnotifyDone, (XtPointer)GreetDone); i++; - if (!d->authorize || d->authorizations || !d->authComplain) - { - XtSetArg (arglist[i], XtNsecureSession, True); i++; - } - login = XtCreateManagedWidget ("login", loginWidgetClass, toplevel, - arglist, i); - XtRealizeWidget (toplevel); - -#ifdef USE_XINERAMA - if ( - XineramaIsActive(dpy) && - (screens = XineramaQueryScreens(dpy, &s_num)) != NULL - ) - { - XWarpPointer(dpy, None, XRootWindowOfScreen (scrn), - 0, 0, 0, 0, - screens[0].x_org + screens[0].width / 2, - screens[0].y_org + screens[0].height / 2); - - XFree(screens); - } - else -#endif - XWarpPointer(dpy, None, XRootWindowOfScreen (scrn), - 0, 0, 0, 0, - XWidthOfScreen(scrn) / 2, - XHeightOfScreen(scrn) / 2); - - if (d->pingInterval) - { - pingTimeout = XtAppAddTimeOut (context, d->pingInterval * 60 * 1000, - GreetPingServer, (XtPointer) d); - } - return dpy; -} - -static void -CloseGreet (struct display *d) -{ - Boolean allow; - Arg arglist[1]; - Display *dpy = XtDisplay(toplevel); - - if (pingTimeout) - { - XtRemoveTimeOut (pingTimeout); - pingTimeout = 0; - } - UnsecureDisplay (d, dpy); - XtSetArg (arglist[0], XtNallowAccess, (char *) &allow); - XtGetValues (login, arglist, 1); - if (allow) - { - Debug ("Disabling access control\n"); - XSetAccessControl (dpy, DisableAccess); - } - XtDestroyWidget (toplevel); - toplevel = NULL; - login = NULL; /* child of toplevel, which we just destroyed */ - ClearCloseOnFork (XConnectionNumber (dpy)); - XCloseDisplay (dpy); - Debug ("Greet connection closed\n"); -} - -#define WHITESPACE 0 -#define ARGUMENT 1 - -static int -Greet (struct display *d, struct greet_info *greet) -{ - XEvent event; - Arg arglist[1]; - - XtSetArg (arglist[0], XtNallowAccess, False); - XtSetValues (login, arglist, 1); - - Debug ("dispatching %s\n", d->name); - done = 0; - while (!done) { - XtAppNextEvent (context, &event); - switch (event.type) { - case MappingNotify: - XRefreshKeyboardMapping(&event.xmapping); - break; - default: - XtDispatchEvent (&event); - break; - } - } - XFlush (XtDisplay (toplevel)); - Debug ("Done dispatch %s\n", d->name); - if (code == 0) - { -#ifndef USE_PAM - char *ptr; - unsigned int c,state = WHITESPACE; - - /* - * Process the name string to get rid of white spaces. - */ - for (ptr = name; state == WHITESPACE; ptr++) - { - c = (unsigned int)(*ptr); - if (c == ' ') - continue; - - state = ARGUMENT; - break; - } - - greet->name = ptr; - greet->password = password; -#endif /* USE_PAM */ - XtSetArg (arglist[0], XtNsessionArgument, (char *) &(greet->string)); - XtGetValues (login, arglist, 1); - Debug ("sessionArgument: %s\n", greet->string ? greet->string : "<NULL>"); - } - return code; -} - - -static void -FailedLogin (struct display *d, const char *username) -{ -#ifdef USE_SYSLOG - if (username == NULL) - username = "username unavailable"; - - syslog(LOG_AUTHPRIV|LOG_NOTICE, - "LOGIN FAILURE ON %s, %s", - d->name, username); -#endif - DrawFail (login); -} - -_X_EXPORT -greet_user_rtn GreetUser( - struct display *d, - Display ** dpy, - struct verify_info *verify, - struct greet_info *greet, - struct dlfuncs *dlfuncs) -{ - int i; - Arg arglist[2]; - -#ifdef GREET_LIB -/* - * These must be set before they are used. - */ - __xdm_PingServer = dlfuncs->_PingServer; - __xdm_SessionPingFailed = dlfuncs->_SessionPingFailed; - __xdm_Debug = dlfuncs->_Debug; - __xdm_RegisterCloseOnFork = dlfuncs->_RegisterCloseOnFork; - __xdm_SecureDisplay = dlfuncs->_SecureDisplay; - __xdm_UnsecureDisplay = dlfuncs->_UnsecureDisplay; - __xdm_ClearCloseOnFork = dlfuncs->_ClearCloseOnFork; - __xdm_SetupDisplay = dlfuncs->_SetupDisplay; - __xdm_LogError = dlfuncs->_LogError; - __xdm_SessionExit = dlfuncs->_SessionExit; - __xdm_DeleteXloginResources = dlfuncs->_DeleteXloginResources; - __xdm_source = dlfuncs->_source; - __xdm_defaultEnv = dlfuncs->_defaultEnv; - __xdm_setEnv = dlfuncs->_setEnv; - __xdm_putEnv = dlfuncs->_putEnv; - __xdm_parseArgs = dlfuncs->_parseArgs; - __xdm_printEnv = dlfuncs->_printEnv; - __xdm_systemEnv = dlfuncs->_systemEnv; - __xdm_LogOutOfMem = dlfuncs->_LogOutOfMem; - __xdm_setgrent = dlfuncs->_setgrent; - __xdm_getgrent = dlfuncs->_getgrent; - __xdm_endgrent = dlfuncs->_endgrent; -# ifdef HAVE_GETSPNAM - __xdm_getspnam = dlfuncs->_getspnam; -# ifndef QNX4 - __xdm_endspent = dlfuncs->_endspent; -# endif /* QNX4 doesn't use endspent */ -# endif - __xdm_getpwnam = dlfuncs->_getpwnam; -# if defined(linux) || defined(__GLIBC__) - __xdm_endpwent = dlfuncs->_endpwent; -# endif - __xdm_crypt = dlfuncs->_crypt; -# ifdef USE_PAM - __xdm_thepamhp = dlfuncs->_thepamhp; -# endif -#endif - *dpy = InitGreet (d); - /* - * Run the setup script - note this usually will not work when - * the server is grabbed, so we don't even bother trying. - */ - if (!d->grabServer) - SetupDisplay (d); - if (!*dpy) { - LogError ("Cannot reopen display %s for greet window\n", d->name); - exit (RESERVER_DISPLAY); - } - - XtSetArg (arglist[0], XtNallowNullPasswd, - (char *) &(greet->allow_null_passwd)); - XtSetArg (arglist[1], XtNallowRootLogin, - (char *) &(greet->allow_root_login)); - XtGetValues (login, arglist, 2); - - for (;;) { -#ifdef USE_PAM - - /* Run PAM conversation */ - pam_handle_t **pamhp = thepamhp(); - int pam_error; - unsigned int pam_flags = 0; - struct myconv_data pcd = { d, greet, NULL }; - struct pam_conv pc = { pamconv, &pcd }; - const char * pam_fname; - const char * login_prompt; - - - SetPrompt(login, LOGIN_PROMPT_USERNAME, NULL, LOGIN_PROMPT_NOT_SHOWN, False); - login_prompt = GetPrompt(login, LOGIN_PROMPT_USERNAME); - SetPrompt(login, LOGIN_PROMPT_PASSWORD, NULL, LOGIN_PROMPT_NOT_SHOWN, False); - -# define RUN_AND_CHECK_PAM_ERROR(function, args) \ - do { \ - pam_error = function args; \ - if (pam_error != PAM_SUCCESS) { \ - PAM_ERROR_PRINT(#function, *pamhp); \ - goto pam_done; \ - } \ - } while (0) - - - RUN_AND_CHECK_PAM_ERROR(pam_start, - ("xdm", NULL, &pc, pamhp)); - - /* Set default login prompt to xdm's default from Xresources */ - if (login_prompt != NULL) { - RUN_AND_CHECK_PAM_ERROR(pam_set_item, - (*pamhp, PAM_USER_PROMPT, login_prompt)); - } - - if (d->name[0] != ':') { /* Displaying to remote host */ - char *hostname = strdup(d->name); - - if (hostname == NULL) { - LogOutOfMem("GreetUser"); - } else { - char *colon = strrchr(hostname, ':'); - - if (colon != NULL) - *colon = '\0'; - - RUN_AND_CHECK_PAM_ERROR(pam_set_item, - (*pamhp, PAM_RHOST, hostname)); - free(hostname); - } - } else { /* Displaying on local host */ - const char *ttyname = NULL; - -#ifdef __sun - /* Solaris PAM & auditing insist this is a device file that can - be found under /dev, so we can't use the display name */ - char vtpath[16]; - - if ((d->windowPath) && !(strchr(d->windowPath, ':'))) { - /* if path is simply a VT, with no intermediaries, use it */ - snprintf(vtpath, sizeof(vtpath), "/dev/vt/%s", d->windowPath); - ttyname = vtpath; - } -#else - /* On all other OS'es we just pass the display name for PAM_TTY */ - ttyname = d->name; -#endif - RUN_AND_CHECK_PAM_ERROR(pam_set_item, (*pamhp, PAM_TTY, ttyname)); - } - - if (!greet->allow_null_passwd) { - pam_flags |= PAM_DISALLOW_NULL_AUTHTOK; - } - RUN_AND_CHECK_PAM_ERROR(pam_authenticate, - (*pamhp, pam_flags)); - - /* handle expired passwords */ - pam_error = pam_acct_mgmt(*pamhp, pam_flags); - pam_fname = "pam_acct_mgmt"; - if (pam_error == PAM_NEW_AUTHTOK_REQD) { - ShowChangePasswdMessage(login); - do { - pam_error = pam_chauthtok(*pamhp, PAM_CHANGE_EXPIRED_AUTHTOK); - } while ((pam_error == PAM_AUTHTOK_ERR) || - (pam_error == PAM_TRY_AGAIN)); - pam_fname = "pam_chauthtok"; - } - if (pam_error != PAM_SUCCESS) { - PAM_ERROR_PRINT(pam_fname, *pamhp); - goto pam_done; - } - - RUN_AND_CHECK_PAM_ERROR(pam_setcred, - (*pamhp, 0)); - { - char *username = NULL; - - RUN_AND_CHECK_PAM_ERROR(pam_get_item, - (*pamhp, PAM_USER, (void *) &username)); - if (username != NULL) { - Debug("PAM_USER: %s\n", username); - greet->name = username; - greet->password = NULL; - } - } - - pam_done: - if (code != 0) - { - CloseGreet (d); - SessionExit (d, code, FALSE); - } - if ((pam_error == PAM_SUCCESS) && (Verify (d, greet, verify))) { - SetPrompt (login, 1, "Login Successful", LOGIN_TEXT_INFO, False); - SetValue (login, 1, NULL); - break; - } else { - /* Try to fill in username for failed login error log */ - char *username = greet->name; - - if (username == NULL) { - RUN_AND_CHECK_PAM_ERROR(pam_get_item, - (*pamhp, PAM_USER, - (void *) &username)); - } - FailedLogin (d, username); - RUN_AND_CHECK_PAM_ERROR(pam_end, - (*pamhp, pam_error)); - } -#else /* not PAM */ - /* - * Greet user, requesting name/password - */ - code = Greet (d, greet); - if (code != 0) - { - CloseGreet (d); - SessionExit (d, code, FALSE); - } - /* - * Verify user - */ - if (Verify (d, greet, verify)) - break; - else - { - FailedLogin (d, greet->name); - bzero (greet->name, strlen(greet->name)); - bzero (greet->password, strlen(greet->password)); - } -#endif - } - DeleteXloginResources (d, *dpy); - CloseGreet (d); - Debug ("Greet loop finished\n"); - /* - * Run system-wide initialization file - */ - if (source (verify->systemEnviron, d->startup) != 0) - { - Debug ("Startup program %s exited with non-zero status\n", - d->startup); - SessionExit (d, OBEYSESS_DISPLAY, FALSE); - } - /* - * for user-based authorization schemes, - * add the user to the server's allowed "hosts" list. - */ - for (i = 0; i < d->authNum; i++) - { -#ifdef SECURE_RPC - if (d->authorizations[i]->name_length == 9 && - memcmp(d->authorizations[i]->name, "SUN-DES-1", 9) == 0) - { - XHostAddress addr; - char netname[MAXNETNAMELEN+1]; - char domainname[MAXNETNAMELEN+1]; - - getdomainname(domainname, sizeof domainname); - user2netname (netname, verify->uid, domainname); - addr.family = FamilyNetname; - addr.length = strlen (netname); - addr.address = netname; - XAddHost (*dpy, &addr); - } -#endif -#ifdef K5AUTH - if (d->authorizations[i]->name_length == 14 && - memcmp(d->authorizations[i]->name, "MIT-KERBEROS-5", 14) == 0) - { - /* Update server's auth file with user-specific info. - * Don't need to AddHost because X server will do that - * automatically when it reads the cache we are about - * to point it at. - */ - extern Xauth *Krb5GetAuthFor(); - - XauDisposeAuth (d->authorizations[i]); - d->authorizations[i] = - Krb5GetAuthFor(14, "MIT-KERBEROS-5", d->name); - SaveServerAuthorizations (d, d->authorizations, d->authNum); - } -#endif - } - - return Greet_Success; -} - - -#ifdef USE_PAM -static int pamconv(int num_msg, -# ifndef sun - const -# endif - struct pam_message **msg, - struct pam_response **response, void *appdata_ptr) -{ - int i; - int greetCode; - int status = PAM_SUCCESS; - const char *pam_msg_styles[5] - = { "<invalid pam msg style>", - "PAM_PROMPT_ECHO_OFF", "PAM_PROMPT_ECHO_ON", - "PAM_ERROR_MSG", "PAM_TEXT_INFO" } ; - - struct pam_message *m; - struct pam_response *r; - - struct myconv_data *d = (struct myconv_data *) appdata_ptr; - - pam_handle_t **pamhp = thepamhp(); - - *response = calloc(num_msg, sizeof (struct pam_response)); - if (*response == NULL) - return (PAM_BUF_ERR); - - m = (struct pam_message *)*msg; - r = *response; - - if (login == NULL) { - status = PAM_CONV_ERR; - goto pam_error; - } - - for (i = 0; i < num_msg; i++ , m++ , r++) { - char *username; - int promptId = 0; - loginPromptState pStyle = LOGIN_PROMPT_ECHO_OFF; - - if ((pam_get_item(*pamhp, PAM_USER, (void *) &username) == PAM_SUCCESS) - && (username != NULL) && (*username != '\0')) { - SetPrompt(login, LOGIN_PROMPT_USERNAME, - NULL, LOGIN_TEXT_INFO, False); - SetValue(login, LOGIN_PROMPT_USERNAME, username); - promptId = 1; - } - - Debug("pam_msg: %s (%d): '%s'\n", - ((m->msg_style > 0) && (m->msg_style <= 4)) ? - pam_msg_styles[m->msg_style] : pam_msg_styles[0], - m->msg_style, m->msg); - - switch (m->msg_style) { - case PAM_ERROR_MSG: - ErrorMessage(login, m->msg, True); - break; - - case PAM_TEXT_INFO: - SetPrompt (login, promptId, m->msg, LOGIN_TEXT_INFO, True); - SetValue (login, promptId, NULL); - break; - - case PAM_PROMPT_ECHO_ON: - pStyle = LOGIN_PROMPT_ECHO_ON; - /* FALLTHROUGH */ - case PAM_PROMPT_ECHO_OFF: - SetPrompt (login, promptId, m->msg, pStyle, False); - SetValue (login, promptId, NULL); - greetCode = Greet (d->d, d->greet); - if (greetCode != 0) { - status = PAM_CONV_ERR; - goto pam_error; - } else { - r->resp = strdup(GetValue(login, promptId)); - SetValue(login, promptId, NULL); - if (r->resp == NULL) { - status = PAM_BUF_ERR; - goto pam_error; - } - /* Debug("pam_resp: '%s'\n", r->resp); */ - } - break; - - default: - LogError("Unknown PAM msg_style: %d\n", m->msg_style); - } - } - pam_error: - if (status != PAM_SUCCESS) { - /* free responses */ - r = *response; - for (i = 0; i < num_msg; i++, r++) { - if (r->resp) { - bzero(r->resp, strlen(r->resp)); - free(r->resp); - } - } - free(*response); - *response = NULL; - } - return status; -} -#endif diff --git a/app/xdm/greeter/verify.c b/app/xdm/greeter/verify.c deleted file mode 100644 index a2817b23e..000000000 --- a/app/xdm/greeter/verify.c +++ /dev/null @@ -1,561 +0,0 @@ -/* - -Copyright 1988, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall -not be used in advertising or otherwise to promote the sale, use or -other dealings in this Software without prior written authorization -from The Open Group. - -*/ - -/* - * xdm - display manager daemon - * Author: Keith Packard, MIT X Consortium - * - * verify.c - * - * typical unix verification routine. - */ - -#include "dm.h" -#include "dm_error.h" - -#include <pwd.h> - -#if defined(USE_PAM) -# include <security/pam_appl.h> -# include <stdlib.h> -#elif defined(HAVE_GETSPNAM) -# include <shadow.h> -# include <errno.h> -#elif defined(USE_BSDAUTH) -# include <login_cap.h> -# include <stdarg.h> -# include <bsd_auth.h> -#elif defined(USESECUREWARE) -# include <sys/types.h> -# include <prot.h> -#endif - -#include "greet.h" - -#ifdef QNX4 -extern char *crypt(const char *, const char *); -#endif - -static const char *envvars[] = { - "TZ", /* SYSV and SVR4, but never hurts */ -#if defined(sony) && !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV) - "bootdev", - "boothowto", - "cputype", - "ioptype", - "machine", - "model", - "CONSDEVTYPE", - "SYS_LANGUAGE", - "SYS_CODE", -#endif -#if (defined(SVR4) || defined(SYSV)) && defined(i386) && !defined(sun) - "XLOCAL", -#endif - NULL -}; - -#ifdef KERBEROS -# include <sys/param.h> -# include <kerberosIV/krb.h> -/* OpenBSD 2.8 needs this. */ -# if defined(OpenBSD) && (OpenBSD <= 200012) -# include <kerberosIV/kafs.h> -# endif -static char krbtkfile[MAXPATHLEN]; -#endif - -static char ** -userEnv (struct display *d, int useSystemPath, char *user, char *home, char *shell) -{ - char **env; - const char **envvar; - const char *str; - - env = defaultEnv (); - env = setEnv (env, "DISPLAY", d->name); - env = setEnv (env, "HOME", home); - env = setEnv (env, "LOGNAME", user); /* POSIX, System V */ - env = setEnv (env, "USER", user); /* BSD */ - env = setEnv (env, "PATH", useSystemPath ? d->systemPath : d->userPath); - env = setEnv (env, "SHELL", shell); -#ifdef KERBEROS - if (krbtkfile[0] != '\0') - env = setEnv (env, "KRBTKFILE", krbtkfile); -#endif - for (envvar = envvars; *envvar; envvar++) - { - str = getenv(*envvar); - if (str) - env = setEnv (env, *envvar, str); - } - return env; -} - -#ifdef USE_BSDAUTH -_X_INTERNAL -int -Verify (struct display *d, struct greet_info *greet, struct verify_info *verify) -{ - struct passwd *p; - login_cap_t *lc; - auth_session_t *as; - char *style, *shell, *home, *s, **argv; - char path[MAXPATHLEN]; - int authok; - size_t passwd_len; - - /* User may have specified an authentication style. */ - if ((style = strchr(greet->name, ':')) != NULL) - *style++ = '\0'; - - Debug ("Verify %s, style %s ...\n", greet->name, - style ? style : "default"); - - p = getpwnam (greet->name); - endpwent(); - - if (!p || strlen (greet->name) == 0) { - Debug("getpwnam() failed.\n"); - bzero(greet->password, strlen(greet->password)); - return 0; - } - - if ((lc = login_getclass(p->pw_class)) == NULL) { - Debug("login_getclass() failed.\n"); - bzero(greet->password, strlen(greet->password)); - return 0; - } - if ((style = login_getstyle(lc, style, "xdm")) == NULL) { - Debug("login_getstyle() failed.\n"); - bzero(greet->password, strlen(greet->password)); - return 0; - } - if ((as = auth_open()) == NULL) { - Debug("auth_open() failed.\n"); - login_close(lc); - bzero(greet->password, strlen(greet->password)); - return 0; - } - if (auth_setoption(as, "login", "yes") == -1) { - Debug("auth_setoption() failed.\n"); - login_close(lc); - bzero(greet->password, strlen(greet->password)); - return 0; - } - passwd_len = strlen(greet->password); - /* Set up state for no challenge, just check a response. */ - auth_setstate(as, 0); - auth_setdata(as, "", 1); - auth_setdata(as, greet->password, passwd_len + 1); -#if !defined(SECURE_RPC) && !defined(K5AUTH) - /* wipe password now, otherwise it'll be copied fork() in auth_call */ - bzero(greet->password, passwd_len); -#endif - /* Build path of the auth script and call it */ - snprintf(path, sizeof(path), _PATH_AUTHPROG "%s", style); - auth_call(as, path, style, "-s", "response", greet->name, - lc->lc_class, (void *)NULL); - authok = auth_getstate(as); - - if ((authok & AUTH_ALLOW) == 0) { - Debug("password verify failed\n"); - bzero(greet->password, passwd_len); - auth_close(as); - login_close(lc); - return 0; - } - /* Run the approval script */ - if (!auth_approval(as, lc, greet->name, "auth-xdm")) { - Debug("login not approved\n"); - bzero(greet->password, passwd_len); - auth_close(as); - login_close(lc); - return 0; - } - auth_close(as); - login_close(lc); - /* Check empty passwords against allowNullPasswd */ - if (!greet->allow_null_passwd && passwd_len == 0) { - Debug("empty password not allowed\n"); - return 0; - } - /* Only accept root logins if allowRootLogin resource is set */ - if (p->pw_uid == 0 && !greet->allow_root_login) { - Debug("root logins not allowed\n"); - bzero(greet->password, passwd_len); - return 0; - } - - /* - * Shell must be in /etc/shells - */ - for (;;) { - s = getusershell(); - if (s == NULL) { - /* did not found the shell in /etc/shells - -> failure */ - Debug("shell not in /etc/shells\n"); - bzero(greet->password, passwd_len); - endusershell(); - return 0; - } - if (strcmp(s, p->pw_shell) == 0) { - /* found the shell in /etc/shells */ - endusershell(); - break; - } - } -#elif defined(USESECUREWARE) /* !USE_BSDAUTH */ -/* - * This is a global variable and will be referenced in at least session.c - */ -struct smp_user_info *userp = 0; - -_X_INTERNAL -int -Verify (struct display *d, struct greet_info *greet, struct verify_info *verify) -{ - int ret, pwtries = 0, nis, delay; - char *reason = 0; - struct passwd *p; - char *shell, *home, **argv; - - Debug ("Verify %s ...\n", greet->name); - - p = getpwnam (greet->name); - endpwent(); - - if (!p || strlen (greet->name) == 0) { - LogError ("getpwnam() failed.\n"); - bzero(greet->password, strlen(greet->password)); - return 0; - } - - ret = smp_check_user (SMP_LOGIN, greet->name, 0, 0, &userp, &pwtries, - &reason, &nis, &delay); - if (ret != SMP_RETIRED && userp->retired) - ret = userp->result = SMP_RETIRED; - Debug ("smp_check_user returns %d\n", ret); - - switch (ret) { - case SMP_FAIL: - Debug ("Out of memory in smp_check_user\n"); - goto smp_fail; - case SMP_EXTFAIL: - Debug ("SMP_EXTFAIL: %s", reason); - goto smp_fail; - case SMP_NOTAUTH: - Debug ("Not authorized\n"); - goto smp_fail; - case SMP_TERMLOCK: - Debug ("Terminal is locked!\n"); - goto smp_fail; - case SMP_ACCTLOCK: - Debug ("Account is locked\n"); - goto smp_fail; - case SMP_RETIRED: - Debug ("Account is retired\n"); - goto smp_fail; - case SMP_OVERRIDE: - Debug ("On override device ... proceeding\n"); - break; - case SMP_NULLPW: - Debug ("NULL password entry\n"); - if (!greet->allow_null_passwd) { - goto smp_fail; - } - break; - case SMP_BADUSER: - Debug ("User not found in protected password database\n"); - goto smp_fail; - case SMP_PWREQ: - Debug ("Password change required\n"); - goto smp_fail; - case SMP_HASPW: - break; - default: - Debug ("Unhandled smp_check_user return %d\n", ret); -smp_fail: - sleep(delay); - smp_audit_fail (userp, 0); - bzero(greet->password, strlen(greet->password)); - return 0; - break; - } - - if (ret != SMP_NULLPW) { - /* - * If we require a password, check it. - */ - ret = smp_check_pw (greet->password, userp, &reason); - switch (ret) { - case SMP_CANCHANGE: - case SMP_CANTCHANGE: - case SMP_OVERRIDE: - break; - default: - goto smp_fail; - } - } -#else /* !USE_BSDAUTH && !USESECUREWARE */ -_X_INTERNAL -int -Verify (struct display *d, struct greet_info *greet, struct verify_info *verify) -{ - struct passwd *p; -# ifndef USE_PAM -# ifdef HAVE_GETSPNAM - struct spwd *sp; -# endif - char *user_pass = NULL; -# endif -# ifdef __OpenBSD__ - char *s; - struct timeval tp; -# endif - char *shell, *home; - char **argv; - - Debug ("Verify %s ...\n", greet->name); - - p = getpwnam (greet->name); - endpwent(); - - if (!p || strlen (greet->name) == 0) { - Debug ("getpwnam() failed.\n"); - if (greet->password != NULL) - bzero(greet->password, strlen(greet->password)); - return 0; - } - - /* - * Only accept root logins if allowRootLogin resource is not false - */ - if ((p->pw_uid == 0) && !greet->allow_root_login) { - Debug("root logins not allowed\n"); - if (greet->password != NULL) - bzero(greet->password, strlen(greet->password)); - return 0; - } - -# if defined(sun) && defined(SVR4) - /* Solaris: If CONSOLE is set to /dev/console in /etc/default/login, - then root can only login on system console */ - -# define SOLARIS_LOGIN_DEFAULTS "/etc/default/login" - - if (p->pw_uid == 0) { - char *console = NULL, *tmp = NULL; - FILE *fs; - - if ((fs= fopen(SOLARIS_LOGIN_DEFAULTS, "r")) != NULL) - { - char str[120]; - while (!feof(fs)) - { - fgets(str, 120, fs); - if(str[0] == '#' || strlen(str) < 8) - continue; - if((tmp = strstr(str, "CONSOLE=")) != NULL) - console = strdup((tmp+8)); - } - fclose(fs); - if ( console != NULL && - (strncmp(console, "/dev/console", 12) == 0) && - (strncmp(d->name,":0",2) != 0) ) - { - Debug("Not on system console\n"); - if (greet->password != NULL) - bzero(greet->password, strlen(greet->password)); - free(console); - return 0; - } - free(console); - } - else - { - Debug("Could not open %s\n", SOLARIS_LOGIN_DEFAULTS); - } - } -# endif - -# ifndef USE_PAM /* PAM authentication happened in GreetUser already */ -# ifdef linux - if (!strcmp(p->pw_passwd, "!") || !strcmp(p->pw_passwd, "*")) { - Debug ("The account is locked, no login allowed.\n"); - bzero(greet->password, strlen(greet->password)); - return 0; - } -# endif - user_pass = p->pw_passwd; -# ifdef KERBEROS - if(strcmp(greet->name, "root") != 0){ - char name[ANAME_SZ]; - char realm[REALM_SZ]; - char *q; - int ret; - - if(krb_get_lrealm(realm, 1)){ - Debug ("Can't get Kerberos realm.\n"); - } else { - - snprintf(krbtkfile, sizeof(krbktfile), "%s.%s", - TKT_ROOT, d->name); - krb_set_tkt_string(krbtkfile); - unlink(krbtkfile); - - ret = krb_verify_user(greet->name, "", realm, - greet->password, 1, "rcmd"); - - if(ret == KSUCCESS){ - chown(krbtkfile, p->pw_uid, p->pw_gid); - Debug("kerberos verify succeeded\n"); - if (k_hasafs()) { - if (k_setpag() == -1) - LogError ("setpag() failed for %s\n", - greet->name); - - if((ret = k_afsklog(NULL, NULL)) != KSUCCESS) - LogError("Warning %s\n", - krb_get_err_text(ret)); - } - goto done; - } else if(ret != KDC_PR_UNKNOWN && ret != SKDC_CANT){ - /* failure */ - Debug("kerberos verify failure %d\n", ret); - krbtkfile[0] = '\0'; - } - } - } -# endif -# ifdef HAVE_GETSPNAM - errno = 0; - sp = getspnam(greet->name); - if (sp == NULL) { - Debug ("getspnam() failed: %s\n", _SysErrorMsg (errno)); - } else { - user_pass = sp->sp_pwdp; - } -# ifndef QNX4 - endspent(); -# endif /* QNX4 doesn't need endspent() to end shadow passwd ops */ -# endif /* HAVE_GETSPNAM */ -# if defined(ultrix) || defined(__ultrix__) - if (authenticate_user(p, greet->password, NULL) < 0) -# else - if (strcmp (crypt (greet->password, user_pass), user_pass)) -# endif - { - if(!greet->allow_null_passwd || strlen(p->pw_passwd) > 0) { - Debug ("password verify failed\n"); - bzero(greet->password, strlen(greet->password)); - return 0; - } /* else: null passwd okay */ - } -# ifdef KERBEROS -done: -# endif - /* - * Only accept root logins if allowRootLogin resource is set - */ - if ((p->pw_uid == 0) && !greet->allow_root_login) { - Debug("root logins not allowed\n"); - bzero(greet->password, strlen(greet->password)); - return 0; - } -# ifdef __OpenBSD__ - /* - * Shell must be in /etc/shells - */ - for (;;) { - s = getusershell(); - if (s == NULL) { - /* did not found the shell in /etc/shells - -> failure */ - Debug("shell not in /etc/shells\n"); - bzero(greet->password, strlen(greet->password)); - endusershell(); - return 0; - } - if (strcmp(s, p->pw_shell) == 0) { - /* found the shell in /etc/shells */ - endusershell(); - break; - } - } - /* - * Test for expired password - */ - if (p->pw_change || p->pw_expire) - (void)gettimeofday(&tp, (struct timezone *)NULL); - if (p->pw_change) { - if (tp.tv_sec >= p->pw_change) { - Debug("Password has expired.\n"); - bzero(greet->password, strlen(greet->password)); - return 0; - } - } - if (p->pw_expire) { - if (tp.tv_sec >= p->pw_expire) { - Debug("account has expired.\n"); - bzero(greet->password, strlen(greet->password)); - return 0; - } - } -# endif /* __OpenBSD__ */ - bzero(user_pass, strlen(user_pass)); /* in case shadow password */ - -# endif /* USE_PAM */ -#endif /* USE_BSDAUTH */ - - Debug ("verify succeeded\n"); - /* The password is passed to StartClient() for use by user-based - authorization schemes. It is zeroed there. */ - verify->uid = p->pw_uid; - verify->gid = p->pw_gid; - home = p->pw_dir; - shell = p->pw_shell; - argv = NULL; - if (d->session) - argv = parseArgs (argv, d->session); - if (greet->string) - argv = parseArgs (argv, greet->string); - if (!argv) - argv = parseArgs (argv, "xsession"); - verify->argv = argv; - verify->userEnviron = userEnv (d, p->pw_uid == 0, - greet->name, home, shell); - Debug ("user environment:\n"); - printEnv (verify->userEnviron); - verify->systemEnviron = systemEnv (d, greet->name, home); - Debug ("system environment:\n"); - printEnv (verify->systemEnviron); - Debug ("end of environments\n"); - return 1; -} |