Module Name: xsrc
Committed By: mrg
Date: Mon Nov 9 07:12:59 UTC 2009
Modified Files:
xsrc/external/mit/xdm/dist/config: Xresources.cpp
xsrc/external/mit/xdm/dist/greeter: greet.c
Removed Files:
xsrc/external/mit/xdm/dist: Chooser.ad
Log Message:
merge xdm 1.1.9.
To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 xsrc/external/mit/xdm/dist/Chooser.ad
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/xdm/dist/config/Xresources.cpp
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/xdm/dist/greeter/greet.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xdm/dist/config/Xresources.cpp
diff -u xsrc/external/mit/xdm/dist/config/Xresources.cpp:1.4 xsrc/external/mit/xdm/dist/config/Xresources.cpp:1.5
--- xsrc/external/mit/xdm/dist/config/Xresources.cpp:1.4 Mon Jan 19 04:39:23 2009
+++ xsrc/external/mit/xdm/dist/config/Xresources.cpp Mon Nov 9 07:12:59 2009
@@ -1,9 +1,7 @@
-! $Xorg: Xresources,v 1.3 2000/08/17 19:54:17 cpqbld Exp $
!
!
!
!
-! $XFree86: xc/programs/xdm/config/Xres.cpp,v 1.6 2003/01/04 03:11:31 dawes Exp $
!
Xcursor.theme: whiteglass
@@ -36,6 +34,15 @@
xlogin*face: Helvetica-18
xlogin*promptFace: Helvetica-18:bold
xlogin*failFace: Helvetica-18:bold
+XHASHelse
+xlogin*greetFont: -adobe-helvetica-bold-o-normal--17-120-100-100-p-92-iso8859-1
+xlogin*font: -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1
+xlogin*promptFont: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
+xlogin*failFont: -adobe-helvetica-bold-o-normal--14-140-75-75-p-82-iso8859-1
+xlogin*greetFace: Serif-18:bold:italic
+xlogin*face: Helvetica-12
+xlogin*promptFace: Helvetica-12:bold
+xlogin*failFace: Helvetica-14:bold
XHASHendif
XHASHifdef COLOR
@@ -65,7 +72,7 @@
XHASHendif
xlogin*useShape: true
xlogin*logoPadding: 10
-#endif
+#endif /* XPM */
XConsole.text.geometry: 480x130
XConsole.verbose: true
Index: xsrc/external/mit/xdm/dist/greeter/greet.c
diff -u xsrc/external/mit/xdm/dist/greeter/greet.c:1.2 xsrc/external/mit/xdm/dist/greeter/greet.c:1.3
--- xsrc/external/mit/xdm/dist/greeter/greet.c:1.2 Fri Jan 2 23:27:37 2009
+++ xsrc/external/mit/xdm/dist/greeter/greet.c Mon Nov 9 07:12:59 2009
@@ -1,5 +1,3 @@
-/* $Xorg: greet.c,v 1.4 2001/02/09 02:05:41 xorgcvs Exp $ */
-/* $XdotOrg: app/xdm/greeter/greet.c,v 1.5 2006/06/03 01:13:44 alanc Exp $ */
/*
Copyright 1988, 1998 The Open Group
@@ -55,7 +53,6 @@
* of the copyright holder.
*/
-/* $XFree86: xc/programs/xdm/greeter/greet.c,v 3.16tsi Exp $ */
/*
* xdm - display manager daemon
@@ -75,7 +72,7 @@
#include <X11/XKBlib.h>
#ifdef USE_XINERAMA
-#include <X11/extensions/Xinerama.h>
+# include <X11/extensions/Xinerama.h>
#endif
#include "dm.h"
@@ -83,10 +80,19 @@
#include "greet.h"
#include "Login.h"
-#ifdef __OpenBSD__
-#include <syslog.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);
@@ -99,13 +105,13 @@
int (*__xdm_PingServer)(struct display *d, Display *alternateDpy) = NULL;
void (*__xdm_SessionPingFailed)(struct display *d) = NULL;
-void (*__xdm_Debug)(char * fmt, ...) = 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)(char * fmt, ...) = 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;
@@ -115,34 +121,34 @@
char **(*__xdm_parseArgs)(char **argv, char *string) = NULL;
void (*__xdm_printEnv)(char **e) = NULL;
char **(*__xdm_systemEnv)(struct display *d, char *user, char *home) = NULL;
-void (*__xdm_LogOutOfMem)(char * fmt, ...) = 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 USESHADOW
+# ifdef USESHADOW
struct spwd *(*__xdm_getspnam)(GETSPNAM_ARGS) = NULL;
-# ifndef QNX4
+# ifndef QNX4
void (*__xdm_endspent)(void) = NULL;
-# endif /* QNX4 doesn't use endspent */
-#endif
+# endif /* QNX4 doesn't use endspent */
+# endif
struct passwd *(*__xdm_getpwnam)(GETPWNAM_ARGS) = NULL;
-#if defined(linux) || defined(__GLIBC__)
+# if defined(linux) || defined(__GLIBC__)
void (*__xdm_endpwent)(void) = NULL;
-#endif
+# endif
char *(*__xdm_crypt)(CRYPT_ARGS) = NULL;
-#ifdef USE_PAM
+# ifdef USE_PAM
pam_handle_t **(*__xdm_thepamhp)(void) = NULL;
-#endif
+# endif
#endif
#ifdef SECURE_RPC
-#include <rpc/rpc.h>
-#include <rpc/key_prot.h>
+# include <rpc/rpc.h>
+# include <rpc/key_prot.h>
#endif
#ifdef K5AUTH
-#include <krb5/krb5.h>
+# include <krb5/krb5.h>
#endif
extern Display *dpy;
@@ -158,9 +164,9 @@
#ifdef USE_PAM
static int pamconv(int num_msg,
-#ifndef sun
+# ifndef sun
const
-#endif
+# endif
struct pam_message **msg,
struct pam_response **response, void *appdata_ptr);
@@ -378,7 +384,7 @@
#ifndef USE_PAM
char *ptr;
unsigned int c,state = WHITESPACE;
-
+
/*
* Process the name string to get rid of white spaces.
*/
@@ -408,9 +414,7 @@
static void
FailedLogin (struct display *d, struct greet_info *greet)
{
-#ifdef __OpenBSD__
- syslog(LOG_NOTICE, "LOGIN FAILURE ON %s",
- d->name);
+#ifdef USE_SYSLOG
syslog(LOG_AUTHPRIV|LOG_NOTICE,
"LOGIN FAILURE ON %s, %s",
d->name, greet->name);
@@ -458,20 +462,20 @@
__xdm_setgrent = dlfuncs->_setgrent;
__xdm_getgrent = dlfuncs->_getgrent;
__xdm_endgrent = dlfuncs->_endgrent;
-#ifdef USESHADOW
+# ifdef USESHADOW
__xdm_getspnam = dlfuncs->_getspnam;
-# ifndef QNX4
+# ifndef QNX4
__xdm_endspent = dlfuncs->_endspent;
-# endif /* QNX4 doesn't use endspent */
-#endif
+# endif /* QNX4 doesn't use endspent */
+# endif
__xdm_getpwnam = dlfuncs->_getpwnam;
-#if defined(linux) || defined(__GLIBC__)
+# if defined(linux) || defined(__GLIBC__)
__xdm_endpwent = dlfuncs->_endpwent;
-#endif
+# endif
__xdm_crypt = dlfuncs->_crypt;
-#ifdef USE_PAM
+# ifdef USE_PAM
__xdm_thepamhp = dlfuncs->_thepamhp;
-#endif
+# endif
#endif
*dpy = InitGreet (d);
@@ -485,8 +489,8 @@
LogError ("Cannot reopen display %s for greet window\n", d->name);
exit (RESERVER_DISPLAY);
}
-#ifdef __OpenBSD__
- openlog("xdm", LOG_ODELAY, LOG_AUTH);
+#ifdef USE_SYSLOG
+ openlog("xdm", LOG_ODELAY|LOG_PID, LOG_AUTHPRIV);
#endif
for (;;) {
@@ -506,16 +510,16 @@
SetPrompt(login, 0, NULL, LOGIN_PROMPT_NOT_SHOWN, False);
login_prompt = GetPrompt(login, LOGIN_PROMPT_USERNAME);
SetPrompt(login, 1, NULL, LOGIN_PROMPT_NOT_SHOWN, False);
-
-#define RUN_AND_CHECK_PAM_ERROR(function, args) \
+
+# 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)
-
+ } while (0)
+
RUN_AND_CHECK_PAM_ERROR(pam_start,
("xdm", NULL, &pc, pamhp));
@@ -533,23 +537,23 @@
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
RUN_AND_CHECK_PAM_ERROR(pam_set_item, (*pamhp, PAM_TTY, d->name));
-
+
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";
@@ -565,7 +569,7 @@
PAM_ERROR_PRINT(pam_fname, *pamhp);
goto pam_done;
}
-
+
RUN_AND_CHECK_PAM_ERROR(pam_setcred,
(*pamhp, 0));
RUN_AND_CHECK_PAM_ERROR(pam_get_item,
@@ -575,7 +579,7 @@
greet->name = username;
greet->password = NULL;
}
-
+
pam_done:
if (code != 0)
{
@@ -587,9 +591,18 @@
SetValue (login, 1, NULL);
break;
} else {
+ /* Try to fill in username for failed login error log */
+ if (greet->name == NULL) {
+ if (username == NULL) {
+ RUN_AND_CHECK_PAM_ERROR(pam_get_item,
+ (*pamhp, PAM_USER,
+ (void *) &username));
+ }
+ greet->name = username;
+ }
+ FailedLogin (d, greet);
RUN_AND_CHECK_PAM_ERROR(pam_end,
(*pamhp, pam_error));
- FailedLogin (d, greet);
}
#else /* not PAM */
/*
@@ -635,7 +648,7 @@
XHostAddress addr;
char netname[MAXNETNAMELEN+1];
char domainname[MAXNETNAMELEN+1];
-
+
getdomainname(domainname, sizeof domainname);
user2netname (netname, verify->uid, domainname);
addr.family = FamilyNetname;
@@ -659,7 +672,7 @@
d->authorizations[i] =
Krb5GetAuthFor(14, "MIT-KERBEROS-5", d->name);
SaveServerAuthorizations (d, d->authorizations, d->authNum);
- }
+ }
#endif
}
@@ -669,9 +682,9 @@
#ifdef USE_PAM
static int pamconv(int num_msg,
-#ifndef sun
+# ifndef sun
const
-#endif
+# endif
struct pam_message **msg,
struct pam_response **response, void *appdata_ptr)
{
@@ -682,22 +695,19 @@
= { "<invalid pam msg style>",
"PAM_PROMPT_ECHO_OFF", "PAM_PROMPT_ECHO_ON",
"PAM_ERROR_MSG", "PAM_TEXT_INFO" } ;
-
-#ifndef sun
- const
-#endif
+
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 = *msg;
+ m = (struct pam_message *)*msg;
r = *response;
for (i = 0; i < num_msg; i++ , m++ , r++) {
@@ -711,8 +721,8 @@
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],
@@ -727,7 +737,7 @@
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 */
@@ -753,7 +763,7 @@
LogError("Unknown PAM msg_style: %d\n", m->msg_style);
}
}
- pam_error:
+ pam_error:
if (status != PAM_SUCCESS) {
/* free responses */
r = *response;