Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/* dtlogin client */
2 account.c
3 auth.c
4 daemon.c
5 server.c
6 dpylist.c
7 dm.c
8 error.c
9 file.c
10 reset.c
11 resource.c
12 protodpy.c
13 policy.c
14 session.c
15 socket.c
16 util.c
17 verify.c
18 mitauth.c
19 cryptokey.c
20 xdmauth.c
/* dtgreet */
2 vgauth.c
3 vgcallback.c
4 vglogo.c
5 vgmain.c
/* unknown */
2 sessreg.c

View File

@@ -0,0 +1,493 @@
XCOMM $TOG: Imakefile /main/21 1999/03/01 18:26:06 mgreess $
#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
SUBDIRS = config $(XDMSUBDIRS) $(BLSSUBDIRS) $(AFSSUBDIRS)
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
#if InstallXdmConfig
XDMCONFIGDIR = XdmConfigurationSubdirectory
XDMSUBDIRS = $(XDMCONFIGDIR) bootxutil
#endif
/* please list any new dtlogin headers for use by krb and rgy */
HEADERS = dm.h vg.h vglogo.h vgmsg.h vgproto.h
#if HasXdmAuth
DESDEFS = -DHASDES -DHASXDMAUTH -DSILLYEXPORTRULE
DESOBJS = xdmauth.o
DESSRCS = xdmauth.c
#else
#if HasDESLibrary
DESDEFS = -DHASDES
DESOBJS = xdmauth.o
DESSRCS = xdmauth.c
#else
DESDEFS =
DESOBJS =
DESSRCS =
#endif
#endif
#ifndef UsePamLibrary
# define UsePamLibrary NO
#endif
#if UsePamLibrary
PAM_SRCS = pam_svc.c
PAM_OBJS = pam_svc.o
PAM_LIB = -lpam
#else
PAM_SRCS =
PAM_OBJS =
PAM_LIB =
#endif
#ifdef SunArchitecture
SOLARIS_SRCS = solaris.c
SOLARIS_OBJS = solaris.o
#else
SOLARIS_SRCS =
SOLARIS_OBJS =
#endif
#if defined(SunArchitecture) && !UsePamLibrary
PAM_LIB = -lauth
#endif
XDMDIR = $(CDE_LOGFILES_TOP)
/****************** DTLOGIN ARCHIVE SECTION *****************
A better long-term solution is a dtgreet subdirectory since dtgreet
is built with shared libraries.
dtlogin is always built archived in HP because of
its importance for user startup. DEPLIBS needs to be explicitly set
because default is null DEPLIBS for shared libraries.
Does this need to be ifdef'd hp? */
/* Defaults */
LOGINDEPXMULIB = $(DEPXMULIB)
LOGINXMULIB = $(XMULIB)
LOGINDEPXLIB = $(DEPXLIB)
LOGINXLIB = $(XLIB)
#ifdef HPArchitecture
# if (! defined(UseInstalled)) && (! defined(UseMitLibrariesFromSystemOnly))
# ifdef SHLIB
LOGINDEPXMULIB = $(XMUSRC)/libXmu.a
LOGINXMULIB = $(LOGINDEPXMULIB)
LOGINDEPXLIB = $(XLIBSRC)/libX11.a
LOGINXLIB = $(LOGINDEPXLIB)
/* This is really a kludge !! */
LOGINLDOPTIONS = -Wl,-a archive
# endif
# endif
# if OSMajorVersion >= 10
SYS_LIBRARIES = -lsec
# endif
#endif
#if defined(SunArchitecture)
/* note: libcmd.a is a Sun static private lib for login related work.
* It should come before $(PAM_LIB) in link line, at least when compiled
* on Solaris 2.4 and run on Solaris 2.5. In Solaris 2.4 some of
* libcmd.a functions are also in libauth.so. But on Solaris 2.5
* these Sun private functions have been removed from libauth.so. */
SYS_LIBRARIES = -lm -ldl -lgen -lresolv -lC -lbsm -lcmd -lauth $(PAM_LIB)
# if UsePamLibrary
EXTRA_DEFINES = -DPAM
# else
EXTRA_DEFINES = -DSUNAUTH
# endif
#endif
#if defined(USLArchitecture)
SYS_LIBRARIES = -lm -ldl -lgen -lresolv
#endif
#if defined(UXPArchitecture)
SYS_LIBRARIES = -lm -ldl -lgen -lresolv
#endif
#if defined(RsArchitecture)
SYS_LIBRARIES = -ls
#endif
#ifdef AlphaArchitecture
SYS_LIBRARIES = -lm -lXdmcp
#endif
#ifdef LinuxArchitecture
SYS_LIBRARIES = -lm -lcrypt
#endif
/**************************************************************************
*
* Source and object modules
*
* SRCS1 = Dtlogin sources
* OBJS1 = Dtlogin objects
*
* SRCS2 = Dtgreet sources
* OBJS2 = Dtgreet objects
*
* SRCS3 = Dtchooser sources
* OBJS3 - Dtchooser objects
*
**************************************************************************/
PROG1 = dtlogin
SRCS1 = access.c account.c auth.c genauth.c daemon.c dm.c \
dpylist.c error.c file.c mitauth.c protodpy.c policy.c \
reset.c resource.c server.c session.c socket.c util.c \
verify.c version.c apollo.c sysauth.c fontpath.c $(DESSRCS) \
qualify.c usl_ptty.c choose.c netaddr.c xdmcp.c \
$(PAM_SRCS) $(SOLARIS_SRCS)
OBJS1 = access.o account.o auth.o genauth.o daemon.o dm.o \
dpylist.o error.o file.o mitauth.o protodpy.o policy.o \
reset.o resource.o server.o session.o socket.o util.o \
verify.o version.o apollo.o sysauth.o fontpath.o $(DESOBJS) \
qualify.o usl_ptty.o choose.o netaddr.o xdmcp.o \
$(PAM_OBJS) $(SOLARIS_OBJS)
PROG2 = dtgreet
#ifdef AlphaArchitecture
SRCS2 = vgcallback.c vglogo.c vgmain.c vgutil.c \
vgversion.c vgapollo.c vglang.c vgsiaform.c
OBJS2 = vgcallback.o vglogo.o vgmain.o vgutil.o \
vgversion.o vgapollo.o vglang.o vgsiaform.o
#else
SRCS2 = vgcallback.c vglogo.c vgmain.c vgutil.c \
vgversion.c vgapollo.c vglang.c
OBJS2 = vgcallback.o vglogo.o vgmain.o vgutil.o \
vgversion.o vgapollo.o vglang.o
#endif
PROG3 = dtchooser
SRCS3 = chooser.c dtchooser.c vglogo.c vgutil.c \
vgcallback.c vglang.c
OBJS3 = chooser.o dtchooser.o vglogo.o vgutil.o \
vgcallback.o vglang.o
PROGRAMS = $(PROG1) $(PROG2) $(PROG3)
/**************************************************************************
*
* Defines
*
**************************************************************************/
#if defined (SunArchitecture)
NATIVEXBINDIR = /usr/openwin/bin
#else
NATIVEXBINDIR = /usr/bin/X11
#endif
SIGDEFS = $(SIGNAL_DEFINES)
XBINDIR = $(XPROJECTROOT)/bin
OSMAJORVERSION = OSMajorVersion
OSMINORVERSION = OSMinorVersion
DTDEFINES = $(DESDEFS) ConnectionFlags \
-DBINDIR=\"$(XBINDIR)\" -DXDMDIR=\"$(XDMDIR)\" $(SIGDEFS) \
-DOSMAJORVERSION=$(OSMAJORVERSION) \
-DOSMINORVERSION=$(OSMINORVERSION) \
-DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" \
-DCDE_CONFIGURATION_TOP=\"$(CDE_CONFIGURATION_TOP)\"
#if defined (HPArchitecture)
DEFINES = $(DTDEFINES) -D_XPG2 -DAUDIT -DBYPASSLOGIN ServerExtraDefines
#elif defined (RsArchitecture)
DEFINES = $(DTDEFINES) -D_ILS_MACROS -DBSD44SOCKETS \
-D__NetBSD__ -DENABLE_DYNAMIC_LANGLIST
#elif defined (AlphaArchitecture)
DEFINES = $(DTDEFINES) -DXDMCP -DSIA
#else
DEFINES = $(DTDEFINES) -D_NO_PROTO
#endif
XCOMM
XCOMM Special definitions for compiling default resources; these parameters
XCOMM should be set in util/imake.includes/site.def or the appropriate .macros
XCOMM file in that directory. The lack of initial spaces is to prevent imake
XCOMM from accidently turning the lines into rules by putting a leading tab.
XCOMM
XCOMM Do NOT change these lines!
XCOMM
DEF_SERVER = $(XBINDIR)/X
DEF_USER_PATH = DefaultUserPath:/usr/ccs/bin:$(NATIVEXBINDIR):$(XBINDIR)
DEF_SYSTEM_PATH = DefaultSystemPath:$(NATIVEXBINDIR):$(XBINDIR)
BOURNE_SHELL = DefaultSystemShell
CPP_PROGRAM = CppCmd
DEF_BM_PATH = /etc/dt/appconfig/icons/%L/%B%M.bm:/etc/dt/appconfig/icons/%L/%B%M.pm:/etc/dt/appconfig/icons/%L/%B:/etc/dt/appconfig/icons/C/%B%M.bm:/etc/dt/appconfig/icons/C/%B%M.pm:/etc/dt/appconfig/icons/C/%B:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%B
DEF_PM_PATH=/etc/dt/appconfig/icons/%L/%B%M.pm:/etc/dt/appconfig/icons/%L/%B%M.bm:/etc/dt/appconfig/icons/%L/%B:/etc/dt/appconfig/icons/C/%B%M.pm:/etc/dt/appconfig/icons/C/%B%M.bm:/etc/dt/appconfig/icons/C/%B:/usr/dt/appconfig/icons/%L/%B%M.pm:/usr/dt/appconfig/icons/%L/%B%M.bm:/usr/dt/appconfig/icons/%L/%B:/usr/dt/appconfig/icons/C/%B%M.pm:/usr/dt/appconfig/icons/C/%B%M.bm:/usr/dt/appconfig/icons/C/%B
RES_DEFINES = '-DDEF_SERVER_LINE=":0 Local local $(DEF_SERVER) :0"' \
'-DXRDB_PROGRAM="$(XBINDIR)/xrdb"' \
'-DDEF_USER_PATH="$(DEF_USER_PATH)"' \
'-DDEF_SYSTEM_PATH="$(DEF_SYSTEM_PATH)"' \
'-DDEF_FAILSAFE_CLIENT="$(XBINDIR)/xterm"' \
'-DDEF_AUTH_FILE="$(XDMDIR)/auth-server"' \
'-DDEF_AUTH_DIR="$(XDMDIR)"' \
'-DCPP_PROGRAM="$(CPP_PROGRAM)"' \
'-DDEF_PM_SEARCH_PATH="$(DEF_PM_PATH)"' \
'-DDEF_BM_SEARCH_PATH="$(DEF_BM_PATH)"'
XCOMM
XCOMM These -D flags had to be taken out of the RES_DEFINES macro in order
XCOMM to get around a buffer limitation in the Sun C compiler code generation
XCOMM phase. The code generation phase creates a temporary assembler file
XCOMM containing the command line to the compiler and all the .ident pragmas.
XCOMM With resent changes to the Imakefile, the command line had gotten so
XCOMM long that it exceeded an internal buffer length resulting in errors in
XCOMM the generated assembler code. The EXTRA_RES_DEFINES were extracted
XCOMM from the RES_DEFINES macro in order to shorten the command line on
XCOMM the Sun platform. These particular -D flags were chosen as the
XCOMM least likely to change or be system dependent.
XCOMM
#ifdef SunArchitecture
EXTRA_RES_DEFINES =
#else
EXTRA_RES_DEFINES = \
'-DDEF_SESSION="$(CDE_INSTALLATION_TOP)/bin/Xsession"' \
'-DDEF_SYSTEM_SHELL="$(BOURNE_SHELL)"' \
'-DDEF_CHOOSER="$(CDE_INSTALLATION_TOP)/bin/dtchooser"' \
'-DDEF_XDM_CONFIG="Xconfig"'
#endif
/**************************************************************************
*
* Libraries
*
* BASE_LIBS1 = dtlogin base libraries
* BASE_LIBS2 = dtgreet base libraries
*
**************************************************************************/
DEPLIBS1 = $(DEPXAUTHLIB) $(DEPXDMCPLIB) $(LOGINDEPXMULIB) $(LOGINDEPXLIB)
DEPLIBS2 = $(DEPDTWIDGETLIB) $(DEPDTSVCLIB) $(DEPTTLIB) $(DEPXMLIB) \
$(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB)
DEPLIBS3 = $(DEPXDMCPLIB) $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB)
BASE_LIBS1 = $(XAUTHLIB) $(LOGINXMULIB) $(XDMCPLIB) $(LOGINXLIB)
BASE_LIBS2 = $(DTWIDGETLIB) $(DTSVCLIB) $(TTLIB) $(XMLIB) \
$(XTOOLLIB) $(XPLIB) $(XLIB)
BASE_LIBS3 = $(DTWIDGETLIB) $(DTSVCLIB) $(TTLIB) $(XDMCPLIB) $(XMLIB) \
$(XTOOLLIB) $(XPLIB) $(XLIB)
LOCAL_LIBRARIES1 = $(BASE_LIBS1) $(IAFSYSLIB)
LOCAL_LIBRARIES2 = $(BASE_LIBS2)
LOCAL_LIBRARIES3 = $(BASE_LIBS3)
/* USL needs to resolve all Xt symbols invoked by Xmu at shared
* library link time.
* Likewise for the BMS references from libDt for vuegreet.
*/
#if defined(USLArchitecture)
# if HasSharedLibraries
BASE_LIBS1 = $(XAUTHLIB) $(LOGINXMULIB) $(XDMCPLIB) $(XTOOLLIB) \
$(LOGINXLIB)
BASE_LIBS2 = $(DTWIDGETLIB) $(DTSVCLIB) $(TTLIB) \
$(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB)
# endif
#endif
#if defined(UXPArchitecture)
# if HasSharedLibraries
BASE_LIBS1 = $(XAUTHLIB) $(LOGINXMULIB) $(XDMCPLIB) $(XTOOLLIB) \
$(LOGINXLIB)
BASE_LIBS2 = $(DTWIDGETLIB) $(DTSVCLIB) $(TTLIB) \
$(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB)
# endif
#endif
/**************************************************************************
*
* Extra things for the HP-UX BLS version
*
**************************************************************************/
#ifndef BLS
# ifdef HPArchitecture
# if (OSMajorVersion == 8) && (OSMinorVersion == 8)
# define BLS
# endif
# endif
#endif
#ifdef BLS
BLSSUBDIRS = bls
BLSLIBSRC = ./bls
EXTRA_DEFINES = -UAUDIT -D_NO_PROTO
EXTRA_CFLAGS = -Wp,-H256000
EXTRA_LIBRARIES = $(BLSLIBSRC)/libbls.a -lsec ExtraLibraries
STD_CPP_DEFINES = -DSYSV -DBLS
#endif
/**************************************************************************
*
* Extra things for the Kerberos/AFS version (dtlogin.krb)
*
**************************************************************************/
#ifdef USE_KRB
AFSSUBDIRS = afs
KRBLIBSRC = $(LIBSRC)/krb
DEPKRBLIB = $(KRBLIBSRC)/libkrb.a
KRBLIB = $(DEPKRBLIB)
DESLIBSRC = $(LIBSRC)/des
DEPDESLIB = $(DESLIBSRC)/libdes.a
DESLIB = $(DEPDESLIB)
KRBINCLUDESRC = $(KRBLIBSRC)/include
AFSLIBSRC = ./afs
AFSINCLUDESRC = $(AFSLIBSRC)
EXTRA_INCLUDES = -I$(KRBINCLUDESRC) -I$(AFSINCLUDESRC)
EXTRA_DEFINES = -D__KERBEROS -D__AFS
LOCAL_LIBRARIES1 = $(BASE_LIBS1) \
$(KRBLIB) \
$(IAFSYSLIB) \
$(AFSLIBSRC)/libafsutil.a \
$(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libdes.a
LOCAL_LIBRARIES2 = $(BASE_LIBS2) \
$(KRBLIB) \
$(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libkauth.a \
$(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libprot.a \
$(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libubik.a \
$(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libauth.a \
$(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/librxkad.a \
$(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libsys.a \
$(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libdes.a \
$(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/librx.a \
$(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/liblwp.a \
$(AFSLIBSRC)/$(VENDOR)/$(HARDWARE)/libcom_err.a \
$(AFSLIBSRC)/libafsutil.a \
-lBSD
#endif
/**************************************************************************
*
* Extra things for the Passwd Etc. version (dtlogin.rgy)
*
**************************************************************************/
#ifdef USE_RGY
EXTRA_INCLUDES = -I$(RGYINCLUDESRC)
EXTRA_DEFINES = -D__PASSWD_ETC +e
EXTRA_LIBRARIES = $(RGYLIB) $(NCKLIB) -lndbm -lBSD ExtraLibraries
#endif
/**************************************************************************
*
* Extra things for Dtge
*
* HIDDEN_SYMBOLS1 = dtlogin hidden symbols
* HIDDEN_SYMBOLS2 = dtgreet hidden symbols
*
**************************************************************************/
#ifdef HPArchitecture
# ifdef __hp9000s300
HIDDEN_SYMBOLS1 = -h _main -h _BecomeDaemon -h _GetHourGlass \
-h _Verify
HIDDEN_SYMBOLS2 = -h _main -h _LogError -h _PingServer
# else
HIDDEN_SYMBOLS1 = -h main -h BecomeDaemon -h GetHourGlass \
-h Verify
HIDDEN_SYMBOLS2 = -h main -h LogError -h PingServer
# endif
#endif
/**************************************************************************
*
* Rules
*
**************************************************************************/
#if defined(USE_KRB) || defined(USE_RGY)
includes::
@for i in $(SRCS1) $(SRCS2) $(HEADERS); do \
$(RM) $$i; \
echo "linking $(DTLOGINSRC)/$$i to $$i";\
ln -f -s $(DTLOGINSRC)/$$i .; \
done
#endif
ComplexProgramTarget_1($(PROG1),$(LOCAL_LIBRARIES1), $(LOGINLDOPTIONS))
ComplexProgramTarget_2($(PROG2),$(LOCAL_LIBRARIES2), /**/)
ComplexProgramTarget_3($(PROG3),$(LOCAL_LIBRARIES3), /**/)
#ifdef __ppc
/* Problem with "-O" in dtgreet ... wrong size login widget. */
/* Override "-O" (xO2) with "-xO1". */
vgutil.o:
$(RM) $@
$(CC) -c $(CFLAGS) -xO1 $(_NOOP_) $*.c
#endif
SpecialObjectRule(resource.o, $(ICONFIGFILES), $(EXTRA_RES_DEFINES) $(RES_DEFINES) $(CCINLIBS))
#ifdef HPArchitecture
#ifndef DEBUGTREE
SpecialObjectRule(session.o,,+O1 $(CCINLIBS))
#endif
#endif
#if !defined(USE_KRB) && !defined(USE_RGY)
LOCAL_CPP_DEFINES = -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \
-DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
-DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP)
#endif /* USE_KRB && USE_RGY */
#if InstallXdmConfig
MakeDirectories(install,$(XDMDIR))
#endif
/*
* Don't install; let people read the instructions about putting in the
* abort-display() resource:
*/
#ifdef comment
InstallProgramWithFlags(xdmshell,$(XBINDIR), /**/)
#endif
#if !defined(USE_KRB) && !defined(USE_RGY)
/***** For dtge make a client_OBJS.o using client_main.o ******/
/***** This implies the existence of client_main.c ******/
# ifdef BuildHugeObject
# if defined (HPArchitecture) && ! defined (BLS)
SpecialRelocatableTarget(dtlogin,$(HIDDEN_SYMBOLS1),$(OBJS1))
SpecialRelocatableTarget(dtgreet,$(HIDDEN_SYMBOLS2),$(OBJS2))
# endif
# endif
#endif

View File

@@ -0,0 +1,41 @@
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* @DEC_COPYRIGHT@
*/
/*
* HISTORY
* $Log$
* Revision 1.1.2.2 1995/04/21 13:05:12 Peter_Derr
* dtlogin auth key fixes from deltacde
* [1995/04/14 18:03:37 Peter_Derr]
*
* Copy for use by dtlogin.
* [1995/04/10 16:52:11 Peter_Derr]
*
* Revision 1.1.3.2 1994/07/08 21:01:55 Peter_Derr
* Hide names for silly export rule.
* [1994/05/18 17:57:54 Peter_Derr]
*
* $EndLog$
*/
/* $XConsortium: Wrap.h /main/2 1996/01/29 18:00:15 mgreess $ */
/*
* header file for compatibility with something useful
*/
typedef unsigned char auth_cblock[8]; /* block size */
typedef struct auth_ks_struct { auth_cblock _; } auth_wrapper_schedule[16];
extern void _XdmcpWrapperToOddParity();
#ifdef SILLYEXPORTRULE
#define _XdmcpAuthSetup _xX_a1
#define _XdmcpAuthDoIt _xX_b2
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,431 @@
/* $XConsortium: account.c /main/6 1996/10/30 11:12:13 drk $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* account.c
*
* routines for handling accounting
*
* ex. utmp/wtmp/btmp, user-license restrictions,
*
*/
/***************************************************************************
*
* Includes
*
***************************************************************************/
#ifdef __apollo
#include <X11/apollosys.h> /* for pid_t struct in hp-ux sys/types.h */
#include <sys/types.h>
#else
#include <sys/types.h>
#include <sys/stat.h>
#endif
#ifdef AIXV3
#include <usersec.h>
#endif
#include <fcntl.h>
#include <utmp.h>
#include <time.h>
#include "dm.h"
#ifdef __PASSWD_ETC
#include "rgy_base.h"
#endif
/***************************************************************************
*
* External declarations
*
***************************************************************************/
#if defined(AIXV3) && !defined(_POWER)
extern void
GetLoginInfo(struct display *d, int *loginType, char *ttyName, char **hostname);
#endif
/***************************************************************************
*
* Procedure declarations
*
***************************************************************************/
#if defined(AIXV3) && !defined(_POWER)
void dt_lastlogin ( char * user, struct lastlogin * llogin);
#endif
/***************************************************************************
*
* Global variables
*
***************************************************************************/
#ifdef __PASSWD_ETC
struct rtmp {
char rt_line[8]; /* tty name */
rgy_$login_name_t rt_name; /* user id (full SID) */
char rt_host[16]; /* hostname, if remote */
long rt_time; /* time on */
};
#endif
#ifdef AIXV3
struct lastlogin {
time_t ftime;
time_t stime;
int fcount;
char user[32];
char *stty;
char *ftty;
char *shost;
char *fhost;
};
static struct lastlogin last_login;
#endif
/***************************************************************************
*
* Account
*
* update utmp/wtmp files.
***************************************************************************/
void
Account( struct display *d, char *user, char *line, pid_t pid,
#if NeedWidePrototypes
int type,
#else
short type,
#endif /* NeedWidePrototypes */
waitType exitcode )
{
struct utmp utmp; /* local struct for new entry */
struct utmp *u; /* pointer to entry in utmp file */
int fd;
char buf[32];
char* user_str = user ? user : "NULL";
char* line_str = line ? line : "NULL";
#ifdef __PASSWD_ETC
struct rtmp rtmp;
struct rtmp *r;
int tty_slot;
int rtmp_fd;
#endif
if (d->utmpId == NULL) return;
switch (type) {
case INIT_PROCESS: strcpy(buf, "INIT_PROCESS"); break;
case LOGIN_PROCESS: strcpy(buf, "LOGIN_PROCESS"); break;
case USER_PROCESS: strcpy(buf, "USER_PROCESS"); break;
case DEAD_PROCESS: strcpy(buf, "DEAD_PROCESS"); break;
default: strcpy(buf, "UNKNOWN"); break;
}
Debug("Account: id=%s, user=%s, line=%s, pid=%d, type=%s\n",
d->utmpId, user_str, line_str, pid, buf);
#ifdef PAM
PamAccounting("dtlogin", d->name, d->utmpId, user,
line, pid, type, exitcode);
#else
# ifdef SUNAUTH
solaris_accounting("dtlogin", d->name, d->utmpId, user,
line, pid, type, exitcode);
# endif
#endif
#ifdef sun
return;
#else
bzero(&utmp, sizeof(struct utmp));
strncpy(utmp.ut_id, d->utmpId, sizeof(u->ut_id));
utmp.ut_type = LOGIN_PROCESS;
setutent();
if ( (u = getutid(&utmp)) == NULL ) u = &utmp;
/*
* make sure process ID's match if this is DEAD_PROCESS...
* don't update an already DEAD_PROCESS...
*/
if ((type == DEAD_PROCESS && pid != 0 && u->ut_pid != pid) ||
(type == DEAD_PROCESS && u->ut_type == DEAD_PROCESS) ) {
endutent();
return;
}
/*
* fill in required fields of utmp structure...
*
* Note: for USER_PRCESS the "e_exit" field is overloaded to contain
* the method for counting this user. This is used later to
* determine if restricted user licenses have been exceeded.
* Currently, an unlimited number of foreign displays can log in.
*/
if (user) strncpy(u->ut_user, user, sizeof(u->ut_user));
if (line) {
#ifdef _AIX
/*
For AIX the Init process writes the exact mapped device name for console
to the utmp file (like hft/0), if a getty on /dev/console record exists
in the Inittab file.Hitherto, we need to have a similar logic to make
sure for having the correct entry in the utmp file in order for the correct
operation of the GettyRunning function. It should be noted that by having
the correct value in the d->gettyLine field, the utmp file eventuallly
updated by the Account function in dm.c will have the right value. And
thus the GettyRunning function returns the appropriate value. So, it
is important that the following logic be included here for AIX platform
only.
Raghu Krovvidi 07.06.93
*/
if (!strcmp(line,"console")) {
char *ttynm;
int fd=0;
fd = open("/dev/console",O_RDONLY);
ttynm = ttyname(fd);
ttynm += 5;
strcpy(u->ut_line,ttynm);
close(fd);
}
else
strncpy(u->ut_line, line, sizeof(u->ut_line));
#else
strncpy(u->ut_line, line, sizeof(u->ut_line));
#endif
}
if (pid ) u->ut_pid = pid;
if (type) {
u->ut_type = type;
if (type == DEAD_PROCESS) {
u->ut_exit.e_termination = waitSig(exitcode);
u->ut_exit.e_exit = waitCode(exitcode);
#ifndef SVR4
(void) memset((char *) u->ut_host, '\0', sizeof(u->ut_host));
#endif
}
if (type == LOGIN_PROCESS && d->displayType.location != Local ) {
#ifndef SVR4
strncpy(u->ut_host, d->name, sizeof(u->ut_host));
#endif
#ifdef __hpux
u->ut_addr = 0;
#endif
}
if (type == USER_PROCESS)
u->ut_exit.e_exit = (d->displayType.location == Local ? 1 : 0 );
}
(void) time(&u->ut_time);
/*
* write to utmp...
*
* (Do not close utmp yet. If "u" points to the static structure, it is
* cleared upon close. This does not bode well for the following write
* to wtmp!)
*/
pututline(u);
/*
* write the same entry to wtmp...
*/
if ((fd = open(WTMP_FILE, O_WRONLY | O_APPEND)) >= 0) {
write(fd, u, sizeof(utmp));
close(fd);
}
/*
* close utmp...
*/
endutent();
#ifdef __PASSWD_ETC
/* Now fill in the "rgy utmp" struct */
if (line) strncpy(rtmp.rt_line, u->ut_line, sizeof(u->ut_line));
bzero(rtmp.rt_host, sizeof(rtmp.rt_host));
rtmp.rt_time = u->ut_time;
r = &rtmp;
/* Write entry to rtmp */
tty_slot = ttyslot();
if (tty_slot > 0 && (rtmp_fd = open("/etc/rtmp", O_WRONLY|O_CREAT, 0644)) >= 0) {
lseek(rtmp_fd, (long) (tty_slot * sizeof(struct rtmp)), 0);
write(rtmp_fd, (char *) r, sizeof(struct rtmp));
close(rtmp_fd);
}
#endif
#if defined(AIXV3) && !defined(_POWER)
/* Log the lastlogin data .. RK 09.13.93 */
/** in AIX 4.1 this is taken care of during authentication **/
if(type == USER_PROCESS) {
int loginType;
char tempTtyName[128];
char *hostname;
GetLoginInfo(d, &loginType, tempTtyName, &hostname);
time(&last_login.stime);
if(line) {
Debug("tty_last_login is (line=%s)\n",line);
last_login.stty = (char *)malloc(strlen(line) + 1);
strcpy(last_login.stty,line);
} else {
last_login.stty = (char *)malloc(strlen(tempTtyName) + 1);
strcpy(last_login.stty,tempTtyName);
}
last_login.shost = (char *) malloc (MAXHOSTNAMELEN);
if (hostname == NULL) {
gethostname (last_login.shost , MAXHOSTNAMELEN);
} else {
strncpy(last_login.shost, hostname, MAXHOSTNAMELEN);
last_login.shost[MAXHOSTNAMELEN -1] = '\0';
}
Debug("logging lastlogin entry (user=%s)\n",user);
dt_lastlogin(user,&last_login);
free(last_login.stty);
free(last_login.shost);
}
#endif
#endif /* !sun */
}
/***************************************************************************
*
* UtmpIdOpen
*
* see if a particular utmp ID is available
*
* return codes: 0 = ID is in use
* 1 = ID is open
***************************************************************************/
int
UtmpIdOpen( char *utmpId )
{
struct utmp *u; /* pointer to entry in utmp file */
int status = 1; /* return code */
while ( (u = getutent()) != NULL ) {
if ( (strncmp(u->ut_id, utmpId, 4) == 0 ) &&
u->ut_type != DEAD_PROCESS ) {
status = 0;
break;
}
}
endutent();
return (status);
}
#if defined(AIXV3) && !defined(_POWER)
void dt_lastlogin ( user, llogin)
char * user;
struct lastlogin * llogin;
{
char *tmp_char;
char *tmp_int;
/*
* We are loading all the lastlogin info into a struct and then dealing
* with that so if the technique of storing the values is redone it
* will be easy
*/
/* set id back to root */
seteuid(0);
/*
* Open up the user data base
*/
setuserdb(S_READ | S_WRITE);
/*
* setting new unsuccessful login attempts times
*/
if (llogin->ftime) {
/*
* Get the old Failure count and increment it
*/
if (getuserattr(user, S_ULOGCNT, &tmp_int, SEC_INT) != 0)
llogin->fcount = 0;
else
llogin->fcount = (int)tmp_int;
/*
* put all the new data
*/
putuserattr(user, S_ULASTTTY, llogin->ftty, SEC_CHAR);
llogin->fcount++;
putuserattr(user, S_ULOGCNT, (void *)llogin->fcount,
SEC_INT);
putuserattr(user, S_ULASTTIME, (void *)llogin->ftime,
SEC_INT);
putuserattr(user, S_ULASTHOST, llogin->fhost, SEC_CHAR);
putuserattr(user, NULL, NULL, SEC_COMMIT);
/*
* Close data base and zero out indicator fields
*/
llogin->ftime = 0;
llogin->fcount = 0;
}
/*
* New Successful login data
*/
if (llogin->stime) {
putuserattr(user, S_LASTTIME, (void *)llogin->stime,
SEC_INT);
putuserattr(user, S_LASTTTY, llogin->stty, SEC_CHAR);
Debug("hostname logged is %s\n",llogin->shost);
putuserattr(user, S_LASTHOST, llogin->shost, SEC_CHAR);
putuserattr(user, S_ULOGCNT, 0, SEC_INT);
putuserattr(user, NULL, NULL, SEC_COMMIT);
}
enduserdb();
}
#endif

View File

@@ -0,0 +1,156 @@
/* $XConsortium: apollo.c /main/4 1995/10/27 16:11:14 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/************************************<+>*************************************
****************************************************************************
**
** File: apollo.c
**
** Project: HP Visual User Environment (DT)
**
** Description: Dtlogin user setup routines for Domain/OS 10.4
**
** These routines set up the user's state before starting
** the DT session.
**
**
** (c) Copyright 1987, 1988, 1989 by Hewlett-Packard Company
**
**
** Conditional compiles:
**
** __apollo Domain OS only
**
****************************************************************************
************************************<+>*************************************/
#include <stdio.h> /* just so file isn't empty */
#ifdef __apollo
/***************************************************************************
*
* Includes & Defines
*
***************************************************************************/
#include <pwd.h>
#include <apollo/base.h>
#include <apollo/error.h>
#include "apollo/passwd.h" /* copy of <apollo/sys/passwd.h> */
#include "apollo/login.h" /* copy of <apollo/sys/login.h> */
#include "dm.h"
#include "vgmsg.h"
#define SCMPN(a, b) strncmp(a, b, sizeof(a))
#define SCPYN(a, b) strncpy(a, b, sizeof(a))
#define eq(a,b) !strcmp(a,b)
#define NMAX strlen(name)
#define HMAX strlen(host)
#define STRING(str) (str), (short) strlen(str)
#define STRNULL(s, l) ((s)[(l)] = '\0')
#define ISTRING(str) (str), (int) strlen(str)
/***************************************************************************
*
* External declarations
*
***************************************************************************/
/***************************************************************************
*
* Procedure declarations
*
***************************************************************************/
/***************************************************************************
*
* Global variables
*
***************************************************************************/
/***************************************************************************
*
* Stub routines
*
***************************************************************************/
/***************************************************************************
*
* DoLogin
*
* set up user environment
***************************************************************************/
int
DoLogin( char *user, char *passwd, char *host )
{
ios_$id_t logid;
login_$opt_set_t opts;
status_$t status;
error_$string_t subsystem, module, error;
short sslen, modlen, errlen;
char buf[BUFSIZ];
Debug("DoLogin(): for %s\n", user);
login_$set_host(host, strlen(host));
opts = login_$no_prompt_name_sm |
login_$no_prompt_pass_sm |
login_$addut_sm |
login_$chown_tty_sm;
Debug("DoLogin(): before calling login_$chk_login()\n");
if ((!login_$chk_login(opts, STRING(user), STRING(passwd),
(login_$open_log_p) NULL, STRING(""),
&logid, &status))
&& (status.all != status_$ok)) {
Debug("DoLogin(): login_$chk_login() failed\n");
error_$get_text(status, subsystem, &sslen, module, &modlen,
error, &errlen);
STRNULL(error, errlen);
STRNULL(module, modlen);
STRNULL(subsystem, sslen);
sprintf(buf,ReadCatalog(MC_LOG_SET,MC_LOG_DOMAIN,MC_DEF_LOG_DOMAIN),
error, subsystem, module);
LogError (buf);
bzero (passwd, strlen(passwd));
return (false);
}
Debug("DoLogin(): login_$chk_login() succeeded\n");
/*
* clear password...
*/
bzero (passwd, strlen(passwd));
return (true);
}
#endif

View File

@@ -0,0 +1,78 @@
/* $XConsortium: des.h /main/3 1995/10/27 16:19:08 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
{ DES, USX/LIB/DESLIB, PJL, 04/05/82 }
{ DES routines }
{ CHANGES:
12/21/88 gilbert Modifications for C++.
03/25/88 brian Created ANSI C version
01/13/86 nazgul Created C version
08/25/83 spf Added us_des_ins_pas declaration
}
*/
#ifndef apollo_sys_des_h
#define apollo_sys_des_h
/* Enable function prototypes for ANSI C and C++ */
#if defined(__STDC__) || defined(c_plusplus) || defined(__cplusplus)
# define _PROTOTYPES
#endif
/* Required for C++ V2.0 */
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _PROTOTYPES
#define std_$call extern
#endif
typedef char des_$key[8];
/*
packed record { NOTE THIS WELL!!! }
bits: 0..127; { 56 bits: LEFT ADJUSTED in 8 bytes }
parity: 0..1 { reserved for parity, but ignored }
end;
*/
typedef char des_$text[8]; /* Actually a 64 bit set */
typedef char des_$key_sched[16][8];
std_$call void des_$encrypt(
#ifdef _PROTOTYPES
des_$text & plain, /* input 64 bits to encrypt */
des_$text * cipher, /* ...get back result */
des_$key_sched & key_sched /* made with des_$compute_key_sched */
#endif
);
std_$call void des_$decrypt(
#ifdef _PROTOTYPES
des_$text & cipher, /* input 64 bits to decrypt */
des_$text * plain, /* ...get back result */
des_$key_sched & key_sched /* made with des_$compute_key_sched */
#endif
);
std_$call void des_$compute_key_sched(
#ifdef _PROTOTYPES
des_$key & key, /* eight byte key */
des_$key_sched * key_sched /* output key schedule */
#endif
);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,232 @@
/* $XConsortium: login.h /main/3 1995/10/27 16:19:16 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/* LOGIN.INS.C, /us/ins, rod, 12/09/88 */
/* changes:
12/21/88 gilbert Modifications for C++.
12/09/88 betsy add login_$logins_disabled
04/19/88 betsy cast values for login_$opt_set_t ( to be consistent )
03/30/88 betsy add login_$set_host
03/21/88 betsy add options login_$addut & login_$chown_tty
01/04/88 brian Fixed param decl of login_$chk_login
12/31/87 brian Converted to ANSII from /us/ins/login.ins.c/6
*/
#define login_$mod 2
#define login_$err_shut 0x07020001 /*user wants to caller to shut down*/
#define login_$err_exit 0x07020002 /*user wants to caller to exit*/
#define login_$no_room 0x07020003 /*no room for rep at open */
#define login_$bad_passwd 0x07020004 /*passwd check failed */
#define login_$inv_acct 0x07020005 /* account expired */
#define login_$logins_disabled 0x07020006 /* logins disabled */
#define login_$log_stream_index 4 /* 4th stream in streams array is the open log */
typedef void *login_$ptr;
typedef short enum { login_$read, login_$update } login_$mode_t;
typedef short enum {
login_$log_events, /* log all events */
login_$log_inv_only, /* log only unsuccessful attempts to log in */
login_$no_passwd, /* don't require password (!) */
login_$no_setsid, /* implies no_setpm, but allows set of wd/nd */
login_$no_setpm, /* not done unless setsid successfully done */
login_$no_setwd, /* not done if setsid attempted and failed */
login_$fail_ret, /* return if failure logged */
login_$no_prompt_name, /* no prompt for name */
login_$no_prompt_pass, /* no prompt for password */
login_$preserve_sub, /* preserve subsystem */
login_$leave_log_open, /* leave log file open on return */
login_$addut, /* add utmp/wtmp/lastlog entry */
login_$chown_tty, /* chown the login device */
login_$extra14, /* pad to 32-bit set */
login_$extra15,
login_$extra16,
login_$extra17 /* just over the border */
} login_$opt_t;
typedef long login_$opt_set_t;
#define login_$log_events_sm ((login_$opt_set_t) (1 << (int) login_$log_events))
#define login_$log_inv_only_sm ((login_$opt_set_t) (1 << (int) login_$log_inv_only))
#define login_$no_passwd_sm ((login_$opt_set_t) (1 << (int) login_$no_passwd))
#define login_$no_setsid_sm ((login_$opt_set_t) (1 << (int) login_$no_setsid))
#define login_$no_setpm_sm ((login_$opt_set_t) (1 << (int) login_$no_setpm))
#define login_$no_setwd_sm ((login_$opt_set_t) (1 << (int) login_$no_setwd))
#define login_$fail_ret_sm ((login_$opt_set_t) (1 << (int) login_$fail_ret))
#define login_$no_prompt_name_sm ((login_$opt_set_t) (1 << (int) login_$no_prompt_name))
#define login_$no_prompt_pass_sm ((login_$opt_set_t) (1 << (int) login_$no_prompt_pass))
#define login_$preserve_sub_sm ((login_$opt_set_t) (1 << (int) login_$preserve_sub))
#define login_$leave_log_open_sm ((login_$opt_set_t) (1 << (int) login_$leave_log_open))
#define login_$addut_sm ((login_$opt_set_t) (1 << (int) login_$addut))
#define login_$chown_tty_sm ((login_$opt_set_t) (1 << (int) login_$chown_tty))
typedef char login_$string_t[256];
typedef ios_$id_t login_$streams_t[4];
typedef char (*login_$open_log_p)(
char * log_file,
short & log_flen,
stream_$id_t * logstr
);
typedef struct {
int (*help)(stream_$id_t & stream);
login_$open_log_p open_log;
/* A note to you: aug-87
These next two routines are here only for callers that cannot provide streams
for their i/o (i.e. the dm. It was just too hard, esp since he is 'going away'.)
To have them used, pass the number -2 as your first stream in login_$streams_t.
A bit of a hack, true, but as long as we all understand each other, it will work.
Login_$login promises NOT to ref these routines if you pass real streams. (Note
that the fillbuf stuff is gone (since changing home dir is no longer supported.)
*/
short (*pread)(
stream_$id_t & stream,
char * inbuf,
short & inlen,
char * pstr,
short & plen,
boolean & echo,
char * fillbuf, /* pre-fill buffer with string */
short & fillbuflen
);
int (*pwrite)(
stream_$id_t & stream,
char * pstr,
short & plen
);
} login_$proc_rec_t;
/* Required for C++ V2.0 */
#ifdef __cplusplus
extern "C" {
#endif
/* FULL_LOGIN --- performs the login function with prompting, implementing system policy,
setting wd, nd, pm_$sid_text, pm_$home_txt and default shell (unless
already set), prints /etc/dmmsg if exists. Supports 'shut, 'exit' and
'help' and all options EXCEPT login_$no_setsid. Takes optional strings
for pre-read user name [passwd]. */
extern boolean
login_$full_login(
login_$opt_set_t & opts,
login_$streams_t * streams, /* in, out, err, log_stream */
char * login_name, /* login string - iff login_$no_prompt_name */
short & login_nlen,
char * pass, /* passwd string - iff login_$no_prompt_pass */
short & passlen,
login_$proc_rec_t & ioprocs, /* procedure vectors */
char * log_file, /* used iff login_$log_events/inv in opts */
short & log_flen,
status_$t * status
);
/* CHK_LOGIN --- performs the login function based on the strings passed in with no
prompting. DOES NOT fully implement system policy. i.e. does nothing
if passwd needs to be changed, but returns bad status if expired or
invalid accounts. Gives no error msgs. */
extern boolean
login_$chk_login (
login_$opt_set_t & opts,
char * login_name, /* login string - iff login_$no_prompt_name */
short & login_nlen,
char * pass, /* passwd string - iff login_$no_prompt_pass */
short & passlen,
login_$open_log_p & open_log, /* used iff login_$log_events/inv in opts */
char * log_file, /* used iff login_$log_events/inv in opts */
short & log_flen, /* used iff login_$log_events/inv in opts */
ios_$id_t * log_stream, /* stream for open log file iff login_$leave_log_open */
status_$t * status
);
/*-----------------------------------------------------------------------------
LOGIN_$SET_HOST - sets the host name to be used in the addut on a subsequent
login_$full_login or login_$chk_login call */
extern void
login_$set_host(
char * host_name, /* max len is 64 */
int & host_len
);
/* O P E N --- prepare to do login type stuff */
extern void
login_$open(
login_$mode_t & lmode,
login_$ptr * lptr,
status_$t * st
);
/* S E T _ P P O -- set the PPO to operate on
if ppo length is zero, use currently logged in user's PPO
if set_ppo not call before chpass, ckpass or chhdir called, one
will automatically be done (for current user)
*/
extern void
login_$set_ppo(
login_$ptr & lptr,
char * ppo,
short & plen,
status_$t * st
);
/* C K P A S S -- check password
checks the supplied password against that of the set PPO
*/
extern void
login_$ckpass(
login_$ptr & lptr,
char * pass,
short & plen,
status_$t * st
);
/* C H P A S S --- change password in the registry */
extern void
login_$chpass(
login_$ptr & lptr,
char * pass,
short & plen,
status_$t * st
);
/* C H H D I R --- change home directory in the registry */
extern void
login_$chhdir(
login_$ptr & lptr,
char * hdir,
short & hlen,
status_$t * st
);
/* E R R _ C O N T E X T --- file name that had problems */
extern void
login_$err_context(
login_$ptr & lptr,
status_$t * errst,
char * badf,
short * blen,
status_$t * st
);
/* C L O S E --- release all acquired resources */
/* NOTE --- call even if open FAILS! */
extern void
login_$close(
login_$ptr & lptr,
status_$t * st
);
#ifdef __cplusplus
}
#endif

View File

@@ -0,0 +1,84 @@
/* $XConsortium: passwd.h /main/3 1995/10/27 16:19:23 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/* passwd.h us/unix/include/apollo/sys, brian
Password definitions
--------------------------------------------------------------------------
| THE FOLLOWING PROGRAMS ARE THE SOLE PROPERTY OF APOLLO COMPUTER INC. |
| AND CONTAIN ITS PROPRIETARY AND CONFIDENTIAL INFORMATION. |
--------------------------------------------------------------------------
Changes:
12/27/88 gilbert Modifications for C++.
03/25/88 brian ANSI version (from .ins.c)
11/05/87 betsy need to include des.ins.c
08/31/87 betsy add support for unix encryption, remove passwd_$create
for sr10 registry
07/07/87 pato drop the (wrong) explicit values for passwd_$encrypt_t
04/02/86 lwa Change enum to short enum.
01/13/86 nazgul Created C version
04/05/82 PJL changes for DES encryption
*/
#ifndef apollo_sys_passwd_ins_c
#define apollo_sys_passwd_ins_c
/* Enable function prototypes for ANSI C and C++ */
#if defined(__STDC__) || defined(c_plusplus) || defined(__cplusplus)
# define _PROTOTYPES
#endif
/* Required for C++ V2.0 */
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _PROTOTYPES
#define std_$call extern
#endif
#include "apollo/des.h" /* copy from <apollo/sys/des.h> */
#define passwd_$mod 3
#define passwd_$maxlen 8
typedef short enum { passwd_$none, passwd_$des,
passwd_$unix, passwd_$unix_bits } passwd_$encrypt_t;
typedef struct {
passwd_$encrypt_t ptype;
union {
char plain[8]; /* passwd_$none */
struct { /* passwd_$des, passwd_$unix_bits */
short rand;
des_$text bits;
} des;
struct { /* passwd_$unix */
char salt[2];
char cipher[12];
} unix_encrypted;
} pw_union;
} passwd_$rec_t;
typedef char passwd_$str_t[passwd_$maxlen];
std_$call boolean passwd_$check(
#ifdef _PROTOTYPES
passwd_$str_t & pass_str,
short & pass_len,
passwd_$rec_t & enc_passwd,
status_$t * status
#endif
);
#ifdef __cplusplus
}
#endif
#endif

1392
cde/programs/dtlogin/auth.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,23 @@
XCOMM $XConsortium: Imakefile /main/3 1995/10/27 16:19:32 rswiston $
INSTALLFLAGS = $(INSTINCFLAGS)
LINTLIBS =
DEFINES = -DTAC3
SRCS = get_level.c validate.c debug.c
OBJS = get_level.o validate.o debug.o
all::
NormalLibraryObjectRule()
NormalLibraryTarget(bls,$(OBJS))
LintLibraryTarget(bls,$(SRCS))
DependTarget()
NormalLintTarget($(SRCS))

View File

@@ -0,0 +1,90 @@
/*
* xdm - display manager daemon
*
* $XConsortium: bls.h /main/4 1996/10/30 11:35:48 drk $
*
* Copyright 1988 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Author: Keith Packard, MIT X Consortium
*/
/*
* bls.h
*
* public interfaces for B1 greet/verify functionality
*/
#ifndef _BLS_H
#define _BLS_H
typedef unsigned char BOOL;
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#ifdef BLS
#include <sys/security.h>
#include <sys/audit.h> /* for passwd and pr_passwd */
#endif
#ifdef pegasus
#undef dirty /* Some bozo put a macro called dirty in sys/param.h */
#endif /* pegasus */
struct greet_info {
char *name; /* user name */
char *password; /* user password */
#ifdef BLS
char *b1security; /* user's b1 security */
#endif
char *string; /* random string */
};
struct verify_info {
int uid; /* user id */
#ifdef NGROUPS
int groups[NGROUPS];/* group list */
int ngroups; /* number of elements in groups */
#else
int gid; /* group id */
#endif
char **argv; /* arguments to session */
char **userEnviron; /* environment for session */
char **systemEnviron;/* environment for startup/reset */
#ifdef BLS
char *user_name;
struct mand_ir_t *sec_label_ir;
struct mand_ir_t *clearance_ir;
/* save these for logout time */
struct pr_passwd *prpwd;
struct passwd *pwd;
char terminal[16];
#endif
};
/***************************************************************************
*
* Global variables
*
***************************************************************************/
extern struct pr_passwd *b1_pwd;
extern struct verify_info *verify;
extern struct greet_info *greet;
#endif /* _BLS_H */

View File

@@ -0,0 +1,118 @@
/*
* xdm - display manager daemon
*
* $XConsortium: debug.c /main/3 1995/07/14 13:23:25 drk $
*
* Copyright 1988 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Author: Keith Packard, MIT X Consortium
*/
/***************
debug.c
****************/
#ifndef NDEBUG
/* don't compile anything in this file unless this is pre-release code */
#include <stdio.h>
#include <signal.h>
#include "../vg.h"
#include "bls.h"
# include <stdarg.h>
# define Va_start(a,b) va_start(a,b)
char *DisplayName=NULL;
/****************************************************************************
*
* Debug
*
* Write a debug message to stderr
*
****************************************************************************/
static int DoName=TRUE;
static int debugLevel=0;
int
BLS_ToggleDebug( int arg)
{
debugLevel = !debugLevel;
(void) signal(SIGHUP,BLS_ToggleDebug);
}
void
Debug( char *fmt, ...)
{
static int sentinel = 0;
static char *debugLog;
va_list args;
Va_start(args,fmt);
if ( !sentinel ) {
/*
* open up an error log for dtgreet
*/
if ((debugLog = getenv("VG_DEBUG")) == 0)
debugLog = "/usr/lib/X11/dt/Dtlogin/dtgreet.log";
if ( !freopen(debugLog,"a",stderr)) {
perror("Debug:");
}
DisplayName=dpyinfo.name;
sentinel = 1;
}
if (debugLevel > 0)
{
if ( strlen(DisplayName) > 0 && DoName)
fprintf(stderr, "(%s) ", DisplayName);
vfprintf (stderr,fmt, args);
fflush (stderr);
/*
* don't prepend the display name next time if this debug message
* does not contain a "new line" character...
*/
if ( strchr(fmt,'\n') == NULL )
DoName=FALSE;
else
DoName=TRUE;
}
va_end(args);
}
#else
/*
* Debug stub for product purposes
*/
void
Debug( )
{ }
#endif /* NDEBUG */

View File

@@ -0,0 +1,644 @@
/* $XConsortium: get_level.c /main/4 1995/10/27 16:19:39 rswiston $ */
/*
* get_level.c
* last modified by:
* David Dolson June 7/92
* - rewrote most of B1 security routines. Much of it is based on
* parallel routines in login.
* Ron Voll July 7/92
* - rolled the xdm version of this file into dtlogin.
*/
#ifdef BLS /* Brackets entire file */
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
#include <pwd.h>
#include <grp.h>
#include <stdio.h>
#include <termio.h>
#include <errno.h>
#ifdef SEC_NET_TTY
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#endif
#include <sys/security.h>
#include <sys/audit.h>
#include <prot.h>
#include <protcmd.h>
#if defined(TAC3) && !defined(TPLOGIN)
#include <sys/secpolicy.h>
#include <mandatory.h>
#include <fcntl.h>
#endif
#include <stdlib.h>
#include <time.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <string.h>
#if 0
#include <strings.h>
#endif
#include <sys/wait.h>
#include <grp.h>
/*
* Local include file for bls specific definitions.
* Also defines some of the structures from dm.h for bls usage.
*/
#include "bls.h"
/* drop those privs from the base set which are not needed by xdm */
void
drop_privs(void)
{
priv_t privs[SEC_SPRIVVEC_SIZE];
getpriv(SEC_BASE_PRIV, privs);
RMBIT(privs, SEC_ALLOWNETACCESS);
RMBIT(privs, SEC_NETPRIVSESSION);
RMBIT(privs, SEC_NETNOAUTH);
RMBIT(privs, SEC_MULTILEVELDIR);
setpriv(SEC_BASE_PRIV, privs);
return;
}
/* stuff to do at the start */
void
init_security(void)
{
/* set default file creation mode to be restrictive */
umask(~SEC_DEFAULT_MODE);
drop_privs();
}
/* check that the requested security level is valid for this user,
* return 1 = success, return 0 is fail(fatal)
*/
int
verify_user_seclevel( struct verify_info verify, char *desired_label)
{
int uid;
mand_ir_t *dl_ir, *clearance_ir;
struct pr_passwd *prpwd;
struct passwd *pwd;
prpwd = verify->prpwd;
pwd = verify->pwd;
uid = verify->uid;
/* check that desired_label falls within user's range */
dl_ir = mand_er_to_ir(desired_label);
if (dl_ir ==NULL) {
audit_login(prpwd, pwd, verify->terminal,
"Unknown clearance level", ES_LOGIN_FAILED);
Debug("unable to translate clearance\n");
return 0;
}
/* get user clearance from prpwd database */
if (prpwd->uflg.fg_clearance)
clearance_ir = &prpwd->ufld.fd_clearance;
else if (prpwd->sflg.fg_clearance)
clearance_ir = &prpwd->sfld.fd_clearance;
else
clearance_ir = mand_syslo;
/* make sure clearance dominates or equals desired_label */
switch(mand_ir_relationship(/* subject */ dl_ir,
/* object */ clearance_ir)) {
case MAND_ODOM:
case MAND_EQUAL:
/* Within range */
break;
default:
audit_login(prpwd, pwd, verify->terminal,
"Security label out of range", ES_LOGIN_FAILED);
Debug("Invalid clearance for this user\n");
mand_free_ir(dl_ir);
return 0;
}
verify->clearance_ir = clearance_ir;
verify->sec_label_ir = dl_ir;
return 1;
}
/* check the proper structures to determine if the user has a password.
* If the nullpw field is set, the user does not need one, and this
* overrides the rest of the checking.
* return 1 means that a password exists (or is not needed)
*/
int
password_exists(struct verify_info *verify)
{
struct pr_passwd *prpwd;
BOOL nocheck;
Debug("password_exists()\n");
prpwd = verify->prpwd;
if (prpwd->uflg.fg_nullpw)
nocheck=prpwd->ufld.fd_nullpw;
else if (prpwd->sflg.fg_nullpw)
nocheck=prpwd->sfld.fd_nullpw;
else
nocheck=FALSE;
if (!nocheck) { /* user needs password */
Debug("password required for user\n");
if (!prpwd->uflg.fg_encrypt ||
prpwd->ufld.fd_encrypt[0] == '\0' ) {
return 0;
}
}
return 1;
}
/* check that the requested security level can be used on this X terminal,
* and that it is not locked.
* Currently there is no support for locking xterms like there is for
* /dev/tty* terminals.
*/
int
verify_sec_xterm(struct verify_info *verify, char *desired_label)
{
return 1;
}
/* set clearance and label for the user. Audit all failures.
* return 0=fail, 1=pass
*/
int
set_sec_label(struct verify_info *verify)
{
struct pr_passwd *prpwd;
struct passwd *pwd;
/* set clearance */
prpwd = verify->prpwd;
pwd = verify->pwd;
if (setclrnce(verify->sec_label_ir)==-1) {
switch(errno) {
case EPERM:
audit_login(prpwd, pwd, verify->terminal,
"Insufficient privs to set clearance", ES_LOGIN_FAILED);
Debug ("login failed: EPERM on setclrnce()\n");
break;
case EFAULT:
/* audit:login failed: xdm memory fault */
default:
audit_login(prpwd, pwd, verify->terminal,
"Unable to set clearance", ES_LOGIN_FAILED);
Debug ("setclrnce failed: error: %d\n", errno);
break;
}
return 0;
}
/* set label */
if (setslabel(verify->sec_label_ir)==-1) {
switch(errno) {
case EPERM:
audit_login(prpwd, pwd, verify->terminal,
"Insufficient privs to set sec label", ES_LOGIN_FAILED);
Debug ("login failed: insufficient priv. to setslabel()\n");
break;
case EFAULT:
/* audit:login failed: xdm memory fault */
default:
audit_login(prpwd, pwd, verify->terminal,
"Unable to set sec label", ES_LOGIN_FAILED);
Debug ("setslabel() failed: error: %d\n", errno);
break;
}
return 0;
}
return 1;
}
/* set the effective, base, and maximum priv vectors for the
* new process, based on values from the pr_passwd entry.
* Inability to find either user priv's or default priv's
* results in failure. One or the other must be there.
* Function returns 1 for success, 0 for failure.
* A failure of this function should be considered fatal.
*/
int
set_sec_privs(struct verify_info *verify)
{
priv_t *maxprivs, *bprivs;
priv_t curr_bprivs[SEC_SPRIVVEC_SIZE];
priv_t curr_sprivs[SEC_SPRIVVEC_SIZE];
struct pr_passwd *prpwd;
struct passwd *pwd;
int bit;
prpwd = verify->prpwd;
pwd = verify->pwd;
/* kernal authorizations */
if (prpwd->uflg.fg_sprivs) {
maxprivs = &prpwd->ufld.fd_sprivs[0];
}else if(prpwd->sflg.fg_sprivs) {
maxprivs = &prpwd->sfld.fd_sprivs[0];
Debug("Using default kernel priv's\n");
}else {
audit_login(prpwd, pwd, verify->terminal,
"Unable to find kernal priv set for user",
ES_LOGIN_FAILED);
Debug("Can't find max. priv set for user-quitting\n");
return 0;
}
/* base priv's and initial effective priv's */
if (verify->prpwd->uflg.fg_bprivs) {
bprivs = &verify->prpwd->ufld.fd_bprivs[0];
}else if (verify->prpwd->sflg.fg_bprivs) { /* use system defaults */
bprivs = &verify->prpwd->sfld.fd_bprivs[0];
Debug("Using default base priv's\n");
}else{
audit_login(prpwd, pwd, verify->terminal,
"Unable to find base priv set for user",
ES_LOGIN_FAILED);
Debug("Can't find base priv set for user-quitting\n");
return 0;
}
getpriv(SEC_MAXIMUM_PRIV, curr_sprivs);
getpriv(SEC_BASE_PRIV, curr_bprivs);
/* remove those privs which the current process does not have,
* to avoid any error in the following system calls
*/
for (bit=0; bit<=SEC_MAX_SPRIV; bit++) {
if (!ISBITSET(curr_sprivs, bit))
RMBIT(maxprivs, bit);
if (!ISBITSET(curr_bprivs, bit))
RMBIT(bprivs, bit);
}
/* login removes those bits from maxprivs which the current process
* does not have. - This program assumes the system config
* utilities will enforce the rules for setpriv(3). Any failure
* of setpriv will indicate a corrupt database.
*/
if (setpriv(SEC_MAXIMUM_PRIV, maxprivs)==-1) {
switch(errno) {
case EPERM:
Debug("setpriv (max) failed: EPERM\n");
break;
case EINVAL:
Debug("setpriv (max) failed: EINVAL\n");
break;
case EFAULT:
Debug("setpriv (max) failed: EFAULT\n");
break;
default:
Debug("setpriv (max) failed for unknown error: %d\n",errno);
break;
}
audit_login(prpwd, pwd, verify->terminal,
"Unable to set Kernal privs", ES_LOGIN_FAILED);
Debug("Unable to set Kernal privs (error %d): aborting\n",errno);
return 0;
}
if (setpriv(SEC_BASE_PRIV, bprivs)==-1) {
switch(errno) {
case EPERM:
Debug("setpriv (base) failed: EPERM\n");
break;
case EINVAL:
Debug("setpriv (base) failed: EINVAL\n");
break;
case EFAULT:
Debug("setpriv (base) failed: EFAULT\n");
break;
default:
Debug("setpriv (base) failed for unknown error: %d\n",errno);
break;
}
audit_login(prpwd, pwd, verify->terminal,
"Unable to set base privs", ES_LOGIN_FAILED);
return 0;
}
if (setpriv(SEC_EFFECTIVE_PRIV, bprivs)==-1) {
switch(errno) {
case EPERM:
Debug("setpriv (effective) failed: EPERM\n");
break;
case EINVAL:
Debug("setpriv (effective) failed: EINVAL\n");
break;
case EFAULT:
Debug("setpriv (effective) failed: EFAULT\n");
break;
default:
Debug("setpriv (effective) failed for unknown error: %d\n",
errno);
break;
}
audit_login(prpwd, pwd, verify->terminal,
"Unable to set effective privs", ES_LOGIN_FAILED);
Debug("Unable to set effective privs (error %d): aborting\n",errno);
return 0;
}
return 1;
}
/* change the current process over to be owned by the user verify->uid.
* Also properly set the privs, sec label, etc.
* Also audits failures.
* return=1 for success, 0 for fail. A failure should be considered fatal.
*/
int
change_to_user(struct verify_info *verify)
{
struct pr_passwd *prpwd;
struct passwd *pwd;
int new_nice;
prpwd = verify->prpwd;
pwd = verify->pwd;
Debug("change_to_user()\n");
/* 1. set the login user id - settable only once */
if (setluid(verify->uid)==-1) {
switch(errno) {
case EPERM:
Debug("Unable to set luid - EPERM\n");
audit_login(prpwd, pwd, verify->terminal,
"Unable to set luid - insufficient privs",
ES_LOGIN_FAILED);
break;
case EINVAL:
Debug("Unable to set luid - suspicious of pwd db.\n");
audit_login(prpwd, pwd, verify->terminal,
"Unable to set luid - out of range", ES_LOGIN_FAILED);
break;
default:
Debug("Can't set luid-Unknown error %d\n",errno);
audit_login(prpwd, pwd, verify->terminal,
"Unable to set luid-unknown error", ES_LOGIN_FAILED);
break;
}
return 0;
}
/*
* Set the 'nice' priority if necessary. Since the return value
* of nice(2) can normally be -1 from the documentation, and
* -1 is the error condition, we key off of errno, not the
* return value to find if the change were successful.
* Note we must do this before the setuid(2) below.
*/
errno = 0;
prpwd = verify->prpwd;
if (prpwd->uflg.fg_nice)
new_nice = prpwd->ufld.fd_nice;
else if (prpwd->sflg.fg_nice)
new_nice = prpwd->sfld.fd_nice;
if (prpwd->uflg.fg_nice || prpwd->sflg.fg_nice) {
(void) nice(new_nice);
if (errno != 0) {
audit_login(prpwd, verify->pwd, NULL,
"bad 'nice' setting", ES_LOGIN_FAILED);
Debug("Bad priority setting.\n");
return 0;
}
}
/* 2. set the group(s) id and
* 3. set the regular user id */
#ifdef NGROUPS
/* setgroups (verify->ngroups, verify->groups);
*/
if(setgid (verify->groups[0])) {
switch(errno) {
case EPERM:
Debug("setgid EPERM\n");
break;
case EINVAL:
Debug("setgid EINVAL\n");
break;
default:
Debug("setgid unknown error: %d\n",errno);
break;
}
return 0;
}
initgroups(verify->user_name, verify->groups[0]);
#else
if(setgid (verify->gid)) {
switch(errno) {
case EPERM: Debug("setgid EPERM\n");break;
case EINVAL: Debug("setgid EINVAL\n");break;
default: Debug("setgid unknown error\n");break;
}
return 0;
}
#endif
if(setuid (verify->uid)) {
switch(errno) {
case EPERM: Debug("setgid EPERM\n");break;
case EINVAL: Debug("setgid EINVAL\n");break;
default: Debug("setgid unknown error\n");break;
}
return 0;
}
/* 4. set security clearance and label for the new process */
if (!set_sec_label(verify))
return 0;
/* 5. set audit parameters */
audit_adjust_mask(prpwd);
/* 6. set privlege levels - maximum, base, and effective */
if (!set_sec_privs(verify))
return 0;
return 1;
}
/*
* Try to read back everything, and print it. If a fatal error occurs,
* return code is 0. 1=success.
*/
int
dump_sec_debug_info(struct verify_info *verify)
{
mand_ir_t *level_ir;
priv_t privs[SEC_SPRIVVEC_SIZE];
Debug ("luid: %d, real uid: %d, effective uid:%d,\n",
getluid(),getuid(),geteuid());
Debug ("real gid:%d, effective gid: %d\n", getgid(),getegid());
level_ir = mand_alloc_ir();
if (getclrnce(level_ir)==-1) {
switch(errno) {
case EFAULT: Debug("getclrnce EFAULT\n");break;
case EINVAL: Debug("getclrnce EINVAL\n");break;
default: Debug("getclrnce unknown error:%d\n",errno);break;
}
return 0;
}else Debug ("Clearance: %s\n", mand_ir_to_er(level_ir) );
if (getslabel(level_ir)==-1) {
switch(errno) {
case EFAULT: Debug("getslabel EFAULT\n");break;
case EINVAL: Debug("getslabel EINVAL\n");break;
default: Debug("getslabel unknown error:%d\n",errno);break;
}
return 0;
}else Debug ("Level: %s\n", mand_ir_to_er(level_ir));
mand_free_ir(level_ir);
if(getpriv(SEC_MAXIMUM_PRIV, privs)==-1) {
switch(errno) {
case EFAULT: Debug("getpriv max EFAULT\n");break;
case EINVAL: Debug("getpriv max EINVAL\n");break;
default: Debug("getpriv max unknown error:%d\n",errno);
break;
}
return 0;
}else Debug ("max priv: %x.%x\n", privs[0],privs[1]);
if(getpriv(SEC_EFFECTIVE_PRIV, privs)==-1) {
switch(errno) {
case EFAULT: Debug("getpriv eff EFAULT\n");break;
case EINVAL: Debug("getpriv eff EINVAL\n");break;
default: Debug("getpriv eff unknown error:%d\n",errno);
break;
}
return 0;
}else Debug ("eff priv: %x.%x\n", privs[0],privs[1]);
if(getpriv(SEC_BASE_PRIV, privs)==-1) {
switch(errno) {
case EFAULT: Debug("getpriv base EFAULT\n");break;
case EINVAL: Debug("getpriv base EINVAL\n");break;
default: Debug("getpriv base unknown error:%d\n",errno);
break;
}
return 0;
}else Debug ("base priv: %x.%x\n", privs[0],privs[1]);
return 1;
}
/*
* writeLoginInfo
* Input: file name string (ex. $HOME/.dtlogininfo)
* verify structure with password stuff
* Write login information to a file to be displayed later, after a
* successful login.
*
* Xsession will need to be modified something like this...
* DTHELLO="$DTDIR/bin/dthello -f /etc/copyright -f $HOME/.dtlogininfo"
*/
int
writeLoginInfo( char *filename, struct verify_info *verify)
{
char *s1="Last successful login: %s";
char *s2="Last unsuccessful login: %s";
char *s3;
char s[80];
char term[15];
char *label;
char *message="Sensitivity level for process: ";
int i;
int nl;
time_t slogin, ulogin;
char *slabel;
char *uterminal, *sterminal;
FILE *fp;
Debug("Writing login info\n");
if ((fp = fopen (filename, "w")) == 0 )
return 0;
if (verify->prpwd->uflg.fg_slogin)
slogin=verify->prpwd->ufld.fd_slogin;
else
slogin=(time_t)0;
if (verify->prpwd->uflg.fg_ulogin)
ulogin=verify->prpwd->ufld.fd_ulogin;
else
ulogin=(time_t)0;
if (verify->prpwd->uflg.fg_suctty)
sterminal=verify->prpwd->ufld.fd_suctty;
else
sterminal="UNKNOWN";
if (verify->prpwd->uflg.fg_unsuctty)
uterminal=verify->prpwd->ufld.fd_unsuctty;
else
uterminal="UNKNOWN";
slabel = mand_ir_to_er(verify->sec_label_ir);
fprintf(fp,"-----------------------------------\n");
fprintf(fp,"\nPrevious login information:\n\n");
/* tricky formatting */
if (slogin != 0) {
sprintf(s, s1, ctime(&slogin));
nl=strlen(s)-1;
s[nl]='\0'; /* remove new-line */
}else{
sprintf(s,s1,"NEVER");
}
strcat(s, " from ");
strncpy(term, sterminal, 14);
term[14]='\0';
strcat(s, term);
fprintf(fp,"%s\n",s);
if (ulogin != 0) {
sprintf(s, s2, ctime(&ulogin));
nl=strlen(s)-1;
s[nl]='\0'; /* remove new-line */
}else{
sprintf(s,s2,"NEVER");
}
strcat(s, " from ");
strncpy(term, uterminal, 14);
term[14]='\0';
strcat(s, term);
fprintf(fp,"%s\n",s);
label = (char*)malloc(strlen(message)+strlen(slabel)+1);
sprintf(label, "%s%s", message, slabel);
if (strlen (label) > 77) {
for(i=75; label[i]!=',' && i>0; i--);
if (i==0) for(i=75; label[i]!=' ' && i>0; i--);
if (i==0) i=75;
strncpy(s, label, i+1);
s[i+1]='\0';
fprintf(fp,"%s\n",s);
strncpy(s, &label[i+1], 75);
s[75]='\0';
fprintf(fp,"%s\n",s);
}else{
fprintf(fp,"%s\n",label);
}
fclose(fp);
return 1;
}
#endif /* BLS */

View File

@@ -0,0 +1,809 @@
/* $XConsortium: validate.c /main/4 1995/10/27 16:19:47 rswiston $ */
/************************************<+>*************************************
****************************************************************************
**
** File: validate.c
**
** Project: HP Visual User Environment (DT)
**
** Description: Dtgreet BLS user authentication routines
**
** These routines validate the user; checking name, password,
** number of users on the system, password aging, etc.
**
**
** (c) Copyright 1987, 1988, 1989 by Hewlett-Packard Company
**
**
** Conditional compiles:
**
** OSMAJORVERSION < 8
** HP-UX 7.0/7.03 restricted license counting algorithms
** are used. Otherwise HP-UX 8.0 and beyond is used
**
** BLS HP BLS B1 simple authentication.
**
** __hpux HP-UX OS only
**
****************************************************************************
************************************<+>*************************************/
#ifdef BLS
/***************************************************************************
*
* Includes & Defines
*
***************************************************************************/
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <pwd.h>
#include "../vg.h"
/***************************************************************************
*
* HP-UX BLS authentication routines
*
***************************************************************************/
#include <sys/param.h> /* for MAXUID macro */
#include <sys/types.h>
#include <sys/utsname.h>
#include <string.h>
#include <utmp.h>
#include <time.h>
#include <grp.h>
/* BLS only headers */
# include <sys/security.h>
# include <prot.h>
# include "bls.h"
#define how_to_count ut_exit.e_exit
#ifdef __hp9000s300
static int num_users[] = { 2, 32767 };
# define MIN_VERSION 'A'
# define UNLIMITED 'B'
#else
static int num_users[] = { 2, 16, 32, 64 , 8 };
# define MIN_VERSION 'A'
# define UNLIMITED 'U'
#endif
/* Maximum number of users allowed with restricted license */
#if OSMAJORVERSION < 8
# define MAX_STRICT_USERS 2
#else
# define MAX_STRICT_USERS 8
#endif
#define NUM_VERSIONS (sizeof(num_users)/sizeof(num_users[0])) - 1
/***************************************************************************
*
* External declarations
*
***************************************************************************/
extern Widget focusWidget; /* login or password text field */
extern long groups[NGROUPS];
/***************************************************************************
*
* Procedure declarations
*
***************************************************************************/
static int CheckPassword( char *name, char *passwd );
static int CountUsers( int added_users) ;
static int CountUsersStrict( char *new_user) ;
static void WriteBtmp( char *name) ;
/***************************************************************************
*
* Global variables
*
***************************************************************************/
/* BLS only data */
struct pr_passwd *b1_pwd;
struct verify_info verify_data;
struct verify_info *verify = &verify_data;
struct greet_info greet_data;
struct greet_info *greet = &greet_data;
static int UserHasPassword = 1;
/***************************************************************************
*
* CountUsers
*
* see if new user has exceeded the maximum.
***************************************************************************/
#define NCOUNT 16
static int
CountUsers( int added_users )
{
int count[NCOUNT], nusers, i;
struct utmp *entry;
for (i=0; i<NCOUNT; i++)
count[i] = 0;
count[added_users]++;
while ( (entry = getutent()) != NULL) {
if (entry->ut_type == USER_PROCESS) {
i = entry->how_to_count;
if (i < 0 || i >= NCOUNT)
i = 1; /* if out of range, then count */
/* as ordinary user */
count[i]++;
}
}
endutent();
/*
* KEY:
* [0] does not count at all
* [1] counts as real user
* [2] logins via a pty which have not gone trough login. These
* collectively count as 1 user IF count[3] is 0, otherwise,
* they are not counted. Starting with HP-UX 8.0 they are
* no longer counted at all.
* [3] logins via a pty which have been logged through login (i.e.
* rlogin and telnet). these count as 1 "real" user per
* unique user name.
* [4-15] may be used for groups of users which collectively
* count as 1
*/
nusers = count[1];
#if OSMAJORVERSION < 8
for (i=2; i<NCOUNT; i++)
#else
for (i=3; i<NCOUNT; i++)
#endif
if (count[i] > 0)
nusers++;
return(nusers);
}
/***************************************************************************
*
* CountUsersStrict
*
* see if new user has exceeded the maximum.
***************************************************************************/
static int
CountUsersStrict( char *new_user )
{
char pty_users[MAX_STRICT_USERS][8];
int count[NCOUNT], nusers, i, cnt, pty_off = -1, uname_off;
struct utmp *entry;
/*
* Initialize count array...
*/
for (i = 0; i < NCOUNT; i++)
count[i] = 0;
/*
* Add in the new user (we know it's not a pty)...
*/
count[1]++;
while ( (entry = getutent()) != NULL ) {
if (entry->ut_type == USER_PROCESS) {
i = entry->how_to_count;
/* if out of range, then count as ordinary user logged in
via a tty */
if (i == 1 || (i < 0 || i >= NCOUNT))
count[1]++;
/* See if it is a pty login granted by login program */
else if (i == 3) {
count[3]++;
/* See if user is already logged in via login pty */
uname_off = -1;
for (cnt = 0; cnt <= pty_off; cnt++)
if (strncmp(pty_users[cnt], entry->ut_user, 8) == 0)
uname_off = cnt;
if (uname_off == -1) { /* user is not logged in via pty yet */
if (pty_off >= MAX_STRICT_USERS) /* cannot add any
more users */
return(MAX_STRICT_USERS + 1);
/* add the user name to the array of pty users */
else
strncpy(pty_users[++pty_off], entry->ut_user, 8);
}
} /* end if (i == 3) */
else
count[i]++;
} /* end if entry->ut_type == USER_PROCESS */
} /* end while (entry = getutent()) */
endutent();
/*
* KEY:
* [0] does not count at all
* [1] counts as "real" user
* [2] logins via a pty which have not gone trough login. These
* collectively count as 1 user IF count[3] is 0, otherwise,
* they are not counted. Starting with HP-UX 8.0 they are
* no longer counted at all.
* [3] logins via a pty which have been logged through login (i.e.
* rlogin and telnet). these count as 1 "real" user per
* unique user name.
* [4-15] may be used for groups of users which collectively count
* as 1
*/
nusers = pty_off + 1 + count[1]; /* Current number of users is sum of
users logged in via tty + the
number of unique users logged in
via pty which have gone through
login */
#if OSMAJORVERSION < 8
if ((count[3] == 0) && (count[2] != 0))
nusers++; /* Add 1 user for all pty logins IF
none of pty logins have been
granted by the login program */
#else
/*
* Don't count any hpterm logins (exit status of 2). We already
* counted all pty logins granted by the login program.
*/
#endif
for (i = 4; i < NCOUNT; i++)
if (count[i] > 0)
nusers++;
return(nusers);
}
/***************************************************************************
*
* CheckPassword
*
* Check validity of user password.
*
***************************************************************************/
static int
CheckPassword( char *name, char *passwd )
{
char *crypt();
struct passwd *p;
char *reason;
/*
* HP BLS B1 password authentication...
*/
if ( ISSECURE ) {
b1_pwd = getprpwnam(name);
if ( b1_pwd == NULL || strlen(name) == 0 ) {
Debug("unknown user '%s'\n", name);
audit_login((struct pr_passwd *)0, (struct passwd *)0,
dpyinfo.name, "No entry in protected password db",
ES_LOGIN_FAILED);
return(FALSE);
}
/*
* look up user's regular account information...
*/
p = getpwnam(name);
if ( p == NULL || strlen(name) == 0 ) {
Debug("unknown user '%s'\n", name);
audit_login((struct pr_passwd *)0, (struct passwd *)0,
dpyinfo.name, "No entry in password file",
ES_LOGIN_FAILED);
return(FALSE);
}
/* verify_info has become a catchall for info needed later */
verify->user_name = name;
verify->prpwd = b1_pwd;
verify->pwd = p;
strncpy(verify->terminal, dpyinfo.name, 15);
verify->terminal[15]='\0';
}
Debug("Verify %s \n",name);
/* if the password doesn't exists, we can't check it, but
* the user will be forced to change it later */
if ( (UserHasPassword = password_exists(verify)) != 0 )
if ( strcmp(bigcrypt(passwd,b1_pwd->ufld.fd_encrypt),
b1_pwd->ufld.fd_encrypt) ) {
Debug("verify failed\n");
audit_login( b1_pwd, p ,dpyinfo.name,
"Password incorrect",
ES_LOGIN_FAILED);
return(FALSE);
} else {
Debug ("username/password verify succeeded\n");
return(TRUE);
}
/*
* all password checks failed...
*/
return (FALSE);
}
/***************************************************************************
*
* BLS_Verify
*
* verify the user
*
* return codes indicate authentication results.
***************************************************************************/
#define MAXATTEMPTS 3
static struct passwd nouser = {"", "nope"}; /* invalid user password struct */
int
BLS_Verify( char *name, char *passwd )
{
static int login_attempts = 0; /* # failed authentications */
struct passwd *p; /* password structure */
struct pr_passwd *prpwd;
struct utsname utsnam;
int n;
int uid;
/*
* Desparate maneuvre to give dtgreet the privledges it needs
*/
if ( login_attempts == 0 ) {
Debug("Setting luid for dtgreet\n");
if ( getluid() == -1 )
setluid(getuid());
}
/*
* validate password...
*/
if ( CheckPassword(name, passwd) == FALSE) {
p = verify->pwd;
if ( focusWidget == passwd_text ) {
WriteBtmp(name);
if ((++login_attempts % MAXATTEMPTS) == 0 ) {
if (p->pw_name == NULL )
p = &nouser;
audit_login( b1_pwd, p ,dpyinfo.name,
"Failed login(bailout)",
ES_LOGIN_FAILED);
}
} else if ( !UserHasPassword ) {
/*
* The user has not password -- this must be the initial login for this
* user. Treat it like an expired password. This should invoke the
* password program on behalf of the user.
*/
UserHasPassword = 1;
return VF_PASSWD_AGED;
}
return(VF_INVALID);
}
prpwd = verify->prpwd;
p = verify->pwd;
/* check that the uid of both passwd and pr_passwd struct's agree */
uid = p->pw_uid;
if (uid != prpwd->ufld.fd_uid) {
audit_login(prpwd, p, verify->terminal,
"User id's inconsistent across password database\n",
ES_LOGIN_FAILED);
Debug("login failed - uid's do not match\n");
return VF_BAD_UID;
}
verify->uid = uid;
/* check if user's account is locked
* This can be by dead password (lifetime exceeded),
* fd_lock is set, or fd_max_tries is exceeded.
* locked_out is from libsec, but is poorly documented.
*/
if (locked_out(prpwd)) {
Debug("Account locked\n");
audit_login(prpwd, p, verify->terminal,
"Account locked", ES_LOGIN_FAILED);
return VF_INVALID;
}
/* can user log in at this time?
* time_lock is in libsec, but poorly documented
*/
if (time_lock(prpwd)) {
Debug("Account time-locked\n");
audit_login(prpwd, p, verify->terminal,
"Account time-locked", ES_LOGIN_FAILED);
return VF_INVALID;
}
/****************************************************
xdm checks the security level here using
verify_sec_user
We do it later from the dtgreet callback rountine
VerifySensitivityLevel()
****************************************************/
#if 0
/*
* check restricted license...
*
* Note: This only applies to local displays. Foreign displays
* (i.e. X-terminals) apparently do not count.
*/
/* Get the version info via uname. If it doesn't look right,
* assume the smallest user configuration
*/
if (getenv(LOCATION) != NULL) {
if (uname(&utsnam) < 0)
utsnam.version[0] = MIN_VERSION;
/*
* Mappings:
* 834 -> 834
* 844 -> 844
* 836 -> 635
* 846 -> 645
* 843 -> 642
* 853 -> 652
*/
if ((!strncmp(utsnam.machine, "9000/834", UTSLEN)) ||
(!strncmp(utsnam.machine, "9000/844", UTSLEN)) ||
(!strncmp(utsnam.machine, "9000/836", UTSLEN)) ||
(!strncmp(utsnam.machine, "9000/846", UTSLEN)) ||
(!strncmp(utsnam.machine, "9000/843", UTSLEN)) ||
(!strncmp(utsnam.machine, "9000/853", UTSLEN))) {
/* strict_count = 1;*/
if (CountUsersStrict(name) > MAX_STRICT_USERS) {
audit_login( b1_pwd, p ,dpyinfo.name,
"Attempted to login - too many users on the system",
ES_LOGIN_FAILED);
return(VF_MAX_USERS);
}
}
else {
if (utsnam.version[0] != UNLIMITED) {
if ((utsnam.version[0]-'A' < 0) ||
(utsnam.version[0]-'A' > NUM_VERSIONS))
utsnam.version[0] = MIN_VERSION;
n = (int) utsnam.version[0] - 'A';
if (CountUsers(1) > num_users[n]) {
audit_login( b1_pwd, p ,dpyinfo.name,
"Attempted to login - too many users on the system",
ES_LOGIN_FAILED);
return(VF_MAX_USERS);
}
}
}
}
#endif /* 0 */
/*
* check password aging...
*/
if ( passwordExpired(verify)) {
audit_login( b1_pwd, p ,dpyinfo.name,
"Password expired",
ES_LOGIN_FAILED);
return(VF_PASSWD_AGED);
}
/*
* verify home directory exists...
*/
if(chdir(p->pw_dir) < 0) {
Debug("Attempted to login -- no home directory\n");
audit_login( b1_pwd, p ,dpyinfo.name,
" Attempted to login - no home directory",
ES_LOGIN_FAILED);
return(VF_HOME);
}
/*
* validate uid and gid...
*/
#ifdef NGROUPS
getGroups(greet->name, verify, p->pw_gid);
#else
verify->gid = pwd->pw_gid;
if ((p->pw_gid < 0) ||
(p->pw_gid > MAXUID) ||
(setgid(p->pw_gid) == -1)) {
Debug("Attempted to login -- bad group id");
audit_login( b1_pwd, p ,dpyinfo.name,
"Attempted to login - bad group id",
ES_LOGIN_FAILED);
return(VF_BAD_GID);
}
#endif /* NGROUPS */
if ((p->pw_uid < 0) ||
(p->pw_uid > MAXUID) ||
(setresuid(p->pw_uid, p->pw_uid, 0) == -1)) {
Debug("Attempted to login -- bad user id\n");
audit_login( b1_pwd, p ,dpyinfo.name,
"Attempted to login - bad user id",
ES_LOGIN_FAILED);
return(VF_BAD_UID);
}
/*
* verify ok...
*/
Debug ("Successful login\n");
audit_login( b1_pwd, p ,dpyinfo.name,
"Successful login",
ES_LOGIN_REMOTE);
return(VF_OK);
}
/***************************************************************************
*
* WriteBtmp
*
* log bad login attempts
*
***************************************************************************/
static void
WriteBtmp( char *name )
{
int fd;
struct utmp utmp, *u;
Boolean found=FALSE;
bzero(&utmp, sizeof(struct utmp));
utmp.ut_pid = getppid();
while ((u = getutent()) != NULL) {
if ( (u->ut_type == INIT_PROCESS ||
u->ut_type == LOGIN_PROCESS ||
u->ut_type == USER_PROCESS) &&
u->ut_pid == utmp.ut_pid ) {
found = TRUE;
break;
}
}
/*
* if no utmp entry, this may be an X-terminal. Construct a utmp
* entry for it...
*/
if ( ! found ) {
strncpy(utmp.ut_id, "??", sizeof(utmp.ut_id));
strncpy(utmp.ut_line, dpyinfo.name, sizeof(utmp.ut_line));
utmp.ut_type = LOGIN_PROCESS;
strncpy(utmp.ut_host, dpyinfo.name, sizeof(utmp.ut_host));
u = &utmp;
}
/*
* If btmp exists, then record the bad attempt
*/
if ( (fd = open(BTMP_FILE,O_WRONLY|O_APPEND)) >= 0) {
strncpy(u->ut_user, name, sizeof(u->ut_user));
(void) time(&u->ut_time);
write(fd, (char *)u, sizeof(utmp));
(void) close(fd);
}
endutent(); /* Close utmp file */
}
/***************************************************************************
*
* VerifySensitivityLevel
*
* verify B1 Sensitivity Level
**************************************************************************/
extern char *sensitivityLevel;
int
VerifySensitivityLevel( void)
{
int i;
greet->b1security = sensitivityLevel =
(char *) XmTextFieldGetString(passwd_text);
/* new functions: (side effects: auditing, change verify) */
if (verify_user_seclevel(verify, sensitivityLevel)
&& verify_sec_xterm(verify, sensitivityLevel)) {
Debug("verify_user_seclevel succeeded.\n");
return VF_OK;
}
Debug("verify_user_seclevel failed\n");
return (VF_BAD_SEN_LEVEL);
}
#ifdef NGROUPS
groupMember ( char *name, char **members )
{
while (*members) {
if (!strcmp (name, *members))
return 1;
++members;
}
return 0;
}
getGroups ( char *name, struct verify_info *verify, int gid)
{
int ngroups;
struct group *g;
int i;
ngroups = 0;
verify->groups[ngroups++] = gid;
setgrent ();
while (g = getgrent()) {
/*
* make the list unique
*/
for (i = 0; i < ngroups; i++)
if (verify->groups[i] == g->gr_gid)
break;
if (i != ngroups)
continue;
if (groupMember (name, g->gr_mem)) {
if (ngroups >= NGROUPS)
LogError ("%s belongs to more than %d groups, %s ignored\n",
name, NGROUPS, g->gr_name);
else
verify->groups[ngroups++] = g->gr_gid;
}
}
verify->ngroups = ngroups;
endgrent ();
}
#endif
/* check whether the password has expired or not.
* return 1 means that the password has expired.
*/
int
passwordExpired( struct verify_info *verify)
{
register struct pr_passwd *pr;
register time_t expiration;
register time_t last_change;
time_t expiration_time;
register time_t now;
register int passwd_status;
struct pr_passwd save_data;
struct pr_default *df;
char *ttime;
char ptime[64];
pr = verify->prpwd;
/*
* If null password, do not check expiration.
*/
if (!pr->uflg.fg_encrypt || (pr->ufld.fd_encrypt[0] == '\0'))
return 0;
now = time((long *) 0);
if (pr->uflg.fg_schange)
last_change = pr->ufld.fd_schange;
else
last_change = (time_t) 0;
if (pr->uflg.fg_expire)
expiration = pr->ufld.fd_expire;
else if (pr->sflg.fg_expire)
expiration = pr->sfld.fd_expire;
else
expiration = (time_t) 0;
df = getprdfnam(AUTH_DEFAULT);
/*
* A 0 or missing expiration field means there is no
* expiration.
*/
expiration_time = expiration ? last_change + expiration : 0;
if (expiration_time && now > expiration_time ) {
/*
* The password has expired
*/
Debug("The password is expired\n");
return 1;
}
Debug("The password is not expired\n");
return 0;
}
/***************************************************************************
*
* end HP-UX authentication routines
*
***************************************************************************/
#endif /* BLS */

View File

@@ -0,0 +1,24 @@
/*
* (c) Copyright 1995 Digital Equipment Corporation.
* (c) Copyright 1995 Hewlett-Packard Company.
* (c) Copyright 1995 International Business Machines Corp.
* (c) Copyright 1995 Sun Microsystems, Inc.
* (c) Copyright 1995 Novell, Inc.
* (c) Copyright 1995 FUJITSU LIMITED.
* (c) Copyright 1995 Hitachi.
*
* $XConsortium: Imakefile /main/2 1995/12/07 16:10:41 rswiston $
*/
DESKTOP_VERSION_STRING = DesktopVersionString
MODULE=bootxutil
HEADERS =
SRCS = bootxutil.c
OBJS = bootxutil.o
DEPLIBS = $(DEPXLIB)
LOCAL_LIBRARIES = $(XLIB)
ComplexProgramTarget(bootxutil)

View File

@@ -0,0 +1,167 @@
/* $XConsortium: bootxutil.c /main/4 1996/05/08 20:08:17 drk $ */
static char sccsid[] = "@(#)31 1.1 src/cde/cde1/dtlogin/bootxutil/bootxutil.c, desktop, cde41J, 9522A_c 5/31/95 18:45:53";
/*
*
* COMPONENT_NAME: desktop
*
* FUNCTIONS: usage
* dpyinfo
* arrow
* main
*
* ORIGINS: 27
*
*
* (C) COPYRIGHT International Business Machines Corp. 1995
* All Rights Reserved
* Licensed Materials - Property of IBM
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
/*
* Cursor definitions
*/
#define CURSOR_ARROW XC_left_ptr
/*
* Application modes
*/
#define MODE_UNKNOWN 0
#define MODE_DPYINFO 1
#define MODE_ARROW 2
/*
* Option table
*/
const struct _options {
char *arg;
int mode;
} options[] = {
{"-dpyinfo", MODE_DPYINFO},
{"-cursorarrow", MODE_ARROW},
{ NULL, MODE_UNKNOWN}};
/*
* usage()
*
* prints a usage statement to stderr and exits
*/
void
usage(char *name)
{
fprintf(stderr, "usage: %s -dpyinfo|-cursorarrow\n", name);
exit(1);
}
/*
* dpyinfo()
*
* prints a string of the form:
*
* let SCREEN_WIDTH=1280;
* let SCREEN_HEIGHT=1024;
*
*/
void
dpyinfo(Display *display, int screen_num)
{
printf("let SCREEN_WIDTH=%d;\nlet SCREEN_HEIGHT=%d;\n",
DisplayWidth(display, screen_num),
DisplayHeight(display, screen_num));
}
/*
* arrow()
*
* changes the root window pointer to an arrow
*/
void
arrow(Display *display, int screen_num)
{
Cursor cursor;
/*
* Create cursor
*/
cursor = XCreateFontCursor(display, CURSOR_ARROW);
if (cursor == NULL) exit (1);
/*
* Display cursor on root window
*/
XDefineCursor (display, RootWindow(display, screen_num), cursor);
}
main(int argc, char *argv[])
{
Display *display;
int screen_num;
int mode = MODE_UNKNOWN;
/*
* Check usage.
*
* progname -dpyinfo
* progname -arrow
*/
if (argc == 2)
{
int i = 0;
while (options[i].arg)
{
if (strcmp(argv[1], options[i].arg) == 0)
{
mode = options[i].mode;
break;
}
i++;
}
}
/*
* Bail on incorrect usage
*/
if (mode == MODE_UNKNOWN)
{
usage(argv[0]);
/* does not return */
}
/*
* Open display connection using DISPLAY env value
*/
if ((display = XOpenDisplay(NULL)) == NULL) {
fprintf(stderr, "%s: cannot connect to display '%s'\n",
argv[0], XDisplayName(NULL));
exit(1);
}
/*
* Get default screen
*/
screen_num = DefaultScreen(display);
switch(mode)
{
case MODE_DPYINFO: dpyinfo(display, screen_num); break;
case MODE_ARROW: arrow(display, screen_num); break;
}
/*
* Flush all pending protocol to server
*/
XFlush(display);
/*
* Our job is done.
*/
XCloseDisplay(display);
exit(0);
}

View File

@@ -0,0 +1,475 @@
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* $TOG: choose.c /main/5 1997/08/13 11:42:50 kaleb $
*
* Copyright 1990 Massachusetts Institute of Technology
*
* 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, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, MIT X Consortium
*/
/*
* choose.c
*
* xdm interface to chooser program
*/
# include "dm.h"
# include "vg.h"
# include <X11/X.h>
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <sys/un.h>
# include <ctype.h>
# include <errno.h>
char *
Print8Address (ARRAY8Ptr Address);
static
FormatBytes (
unsigned char *data,
int length,
char *buf,
int buflen)
{
int i;
static char HexChars[] = "0123456789abcdef";
if (buflen < length * 2 + 1)
return 0;
for (i = 0; i < length; i++)
{
*buf++ = HexChars[(data[i] >> 4) & 0xf];
*buf++ = HexChars[(data[i]) & 0xf];
}
*buf++ = '\0';
return 1;
}
static
FormatARRAY8 (
ARRAY8Ptr a,
char *buf,
int buflen)
{
return FormatBytes (a->data, a->length, buf, buflen);
}
typedef struct _IndirectUsers {
struct _IndirectUsers *next;
ARRAY8 client;
CARD16 connectionType;
} IndirectUsersRec, *IndirectUsersPtr;
static IndirectUsersPtr indirectUsers;
RememberIndirectClient (
ARRAY8Ptr clientAddress,
CARD16 connectionType)
{
IndirectUsersPtr i;
for (i = indirectUsers; i; i = i->next)
if (XdmcpARRAY8Equal (clientAddress, &i->client) &&
connectionType == i->connectionType)
return 1;
i = (IndirectUsersPtr) malloc (sizeof (IndirectUsersRec));
if (!XdmcpCopyARRAY8 (clientAddress, &i->client))
{
free ((char *) i);
return 0;
}
i->connectionType = connectionType;
i->next = indirectUsers;
indirectUsers = i;
return 1;
}
ForgetIndirectClient (
ARRAY8Ptr clientAddress,
CARD16 connectionType)
{
IndirectUsersPtr i, prev;
prev = 0;
for (i = indirectUsers; i; i = i->next)
{
if (XdmcpARRAY8Equal (clientAddress, &i->client) &&
connectionType == i->connectionType)
{
if (prev)
prev->next = i->next;
else
indirectUsers = i->next;
XdmcpDisposeARRAY8 (&i->client);
free ((char *) i);
break;
}
prev = i;
}
}
IsIndirectClient (
ARRAY8Ptr clientAddress,
CARD16 connectionType)
{
IndirectUsersPtr i;
for (i = indirectUsers; i; i = i->next)
if (XdmcpARRAY8Equal (clientAddress, &i->client) &&
connectionType == i->connectionType)
return 1;
return 0;
}
extern char *NetaddrPort();
static
FormatChooserArgument (
char *buf,
int len)
{
unsigned char addr_buf[1024];
int addr_len = sizeof (addr_buf);
unsigned char result_buf[1024];
int result_len = 0;
int netfamily;
if (GetChooserAddr (addr_buf, &addr_len) == -1)
{
LogError ((unsigned char *)"Cannot get return address for chooser socket\n");
Debug ("Cannot get chooser socket address\n");
return 0;
}
netfamily = NetaddrFamily((XdmcpNetaddr)addr_buf);
switch (netfamily) {
case AF_INET:
{
char *port;
int portlen;
ARRAY8Ptr localAddress, getLocalAddress ();
port = NetaddrPort((XdmcpNetaddr)addr_buf, &portlen);
result_buf[0] = netfamily >> 8;
result_buf[1] = netfamily & 0xFF;
result_buf[2] = port[0];
result_buf[3] = port[1];
localAddress = getLocalAddress ();
bcopy ((char *)localAddress->data, (char *)result_buf+4, 4);
result_len = 8;
}
break;
#ifdef AF_DECnet
case AF_DECnet:
break;
#endif
default:
Debug ("Chooser family %d isn't known\n", netfamily);
return 0;
}
return FormatBytes (result_buf, result_len, buf, len);
}
typedef struct _Choices {
struct _Choices *next;
ARRAY8 client;
CARD16 connectionType;
ARRAY8 choice;
long time;
} ChoiceRec, *ChoicePtr;
static ChoicePtr choices;
ARRAY8Ptr
IndirectChoice (
ARRAY8Ptr clientAddress,
CARD16 connectionType)
{
ChoicePtr c, next, prev;
long now;
now = time (0);
prev = 0;
for (c = choices; c; c = next)
{
next = c->next;
if (now - c->time > 15)
{
Debug ("Timeout choice\n");
if (prev)
prev->next = next;
else
choices = next;
XdmcpDisposeARRAY8 (&c->client);
XdmcpDisposeARRAY8 (&c->choice);
free ((char *) c);
}
else
{
if (XdmcpARRAY8Equal (clientAddress, &c->client) &&
connectionType == c->connectionType)
return &c->choice;
prev = c;
}
}
return 0;
}
static int
RegisterIndirectChoice (
ARRAY8Ptr clientAddress,
CARD16 connectionType,
ARRAY8Ptr choice)
{
ChoicePtr c;
int insert;
int found;
Debug ("Got indirect choice back (%s)\n", Print8Address(clientAddress));
for (c = choices; c; c = c->next) {
if (XdmcpARRAY8Equal (clientAddress, &c->client) &&
connectionType == c->connectionType) {
found = 1;
break;
}
}
if (!found)
return 0;
insert = 0;
if (!c)
{
c = (ChoicePtr) malloc (sizeof (ChoiceRec));
insert = 1;
if (!c)
return 0;
c->connectionType = connectionType;
if (!XdmcpCopyARRAY8 (clientAddress, &c->client))
{
free ((char *) c);
return 0;
}
}
else
{
XdmcpDisposeARRAY8 (&c->choice);
}
if (!XdmcpCopyARRAY8 (choice, &c->choice))
{
XdmcpDisposeARRAY8 (&c->client);
free ((char *) c);
return 0;
}
if (insert)
{
c->next = choices;
choices = c;
}
c->time = time (0);
Debug("choice=(%s)\n", Print8Address(choice));
return 1;
}
#ifdef notdef
static
RemoveIndirectChoice (clientAddress, connectionType)
ARRAY8Ptr clientAddress;
CARD16 connectionType;
{
ChoicePtr c, prev;
prev = 0;
for (c = choices; c; c = c->next)
{
if (XdmcpARRAY8Equal (clientAddress, &c->client) &&
connectionType == c->connectionType)
{
if (prev)
prev->next = c->next;
else
choices = c->next;
XdmcpDisposeARRAY8 (&c->client);
XdmcpDisposeARRAY8 (&c->choice);
free ((char *) c);
return;
}
prev = c;
}
}
#endif
/*ARGSUSED*/
static void
AddChooserHost (
CARD16 connectionType,
ARRAY8Ptr addr,
char *closure)
{
char ***argp, **parseArgs();
char hostbuf[1024];
argp = (char ***) closure;
if (addr->length == strlen ("BROADCAST") &&
!strncmp ((char *)addr->data, "BROADCAST", addr->length))
{
*argp = parseArgs (*argp, "BROADCAST");
}
else if (FormatARRAY8 (addr, hostbuf, sizeof (hostbuf)))
{
*argp = parseArgs (*argp, hostbuf);
}
}
ProcessChooserSocket (
int fd)
{
int client_fd;
char buf[1024];
int len;
XdmcpBuffer buffer;
ARRAY8 clientAddress;
CARD16 connectionType;
ARRAY8 choice;
Debug ("Process chooser socket\n");
len = sizeof (buf);
client_fd = accept (fd, (struct sockaddr *)buf, &len);
if (client_fd == -1)
{
LogError ((unsigned char *)"Cannot accept chooser connection\n");
return;
}
Debug ("Accepted %d\n", client_fd);
len = read (client_fd, buf, sizeof (buf));
Debug ("Read returns %d\n", len);
if (len > 0)
{
buffer.data = (BYTE *) buf;
buffer.size = sizeof (buf);
buffer.count = len;
buffer.pointer = 0;
clientAddress.data = 0;
clientAddress.length = 0;
choice.data = 0;
choice.length = 0;
if (XdmcpReadARRAY8 (&buffer, &clientAddress) &&
XdmcpReadCARD16 (&buffer, &connectionType) &&
XdmcpReadARRAY8 (&buffer, &choice))
{
Debug ("Read from chooser succesfully\n");
if (!RegisterIndirectChoice (&clientAddress, connectionType, &choice))
Debug ("Invalid chooser reply\n");
}
XdmcpDisposeARRAY8 (&clientAddress);
XdmcpDisposeARRAY8 (&choice);
}
else
{
LogError ((unsigned char *)"Choice response read error %s\n", strerror(errno));
}
close (client_fd);
}
RunChooser (
struct display *d)
{
char **args, **parseArgs(), **systemEnv();
char buf[1024];
char **env;
Debug ("RunChooser %s\n", d->name);
SetTitle (d->name, "chooser");
LoadXloginResources (d);
args = parseArgs ((char **) 0, d->chooser);
strcpy (buf, "-xdmaddress ");
if (FormatChooserArgument (buf + strlen (buf), sizeof (buf) - strlen (buf)))
args = parseArgs (args, buf);
strcpy (buf, "-clientaddress ");
if (FormatARRAY8 (&d->clientAddr, buf + strlen (buf), sizeof (buf) - strlen (buf)))
args = parseArgs (args, buf);
sprintf (buf, "-connectionType %d", d->connectionType);
args = parseArgs (args, buf);
ForEachChooserHost (&d->clientAddr,
d->connectionType,
(int (*)()) AddChooserHost,
(char *) &args);
env = systemEnv (d, (char *) 0, (char *) 0);
if (d->authFile)
env = setEnv (env, "XAUTHORITY", d->authFile);
if (d->pmSearchPath)
env = setEnv(env, "XMICONSEARCHPATH", d->pmSearchPath);
if (d->bmSearchPath)
env = setEnv(env, "XMICONBMSEARCHPATH", d->bmSearchPath);
if ( d->language && strlen(d->language) > 0 )
env = setEnv(env, "LANG", d->language);
if ( d->langList && strlen(d->langList) > 0 )
env = setEnv(env, LANGLIST, d->langList);
#if !defined (ENABLE_DYNAMIC_LANGLIST)
else
if (languageList && strlen(languageList) > 0 )
env = setEnv(env, LANGLIST, languageList);
#endif /* ENABLE_DYNAMIC_LANGLIST */
if ( d->setup)
env = setEnv(env, "XSETUP", d->setup);
if(d->displayType.location == Local)
env = setEnv (env, LOCATION, "local");
else
env = setEnv (env, LOCATION, "remote");
Debug ("Running %s\n", args[0]);
execute (args, env);
Debug ("Couldn't run %s\n", args[0]);
LogError ((unsigned char *)"Cannot execute %s\n", args[0]);
exit (REMANAGE_DISPLAY);
}
char *
Print8Address (
ARRAY8Ptr Address)
{
static char buf[200];
char *b;
int i;
b = buf;
b[0]='\0';
for (i = 0; i < (int)Address->length; i++) {
sprintf(b, " %d", Address->data[i]);
b = buf + strlen(buf);
}
return(buf);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,156 @@
XCOMM!/bin/ksh
XCOMM ####################################################################
XCOMM ## File: 0015.sun.env.src
XCOMM ##
XCOMM ## Default Location: /usr/dt/config/Xsession.d/
XCOMM ##
XCOMM ## Purpose: Setup various items for Solaris desktop support
XCOMM ##
XCOMM ## Description: This script is invoked by means of the Xsession file
XCOMM ## at user login.
XCOMM ##
XCOMM ## Invoked by: /usr/dt/bin/Xsession
XCOMM ##
XCOMM ## Product: @(#)Common Desktop Environment 1.0
XCOMM ##
XCOMM ## $XConsortium: 0015.sun.env.src /main/3 1996/04/23 11:41:31 drk $
XCOMM ##
XCOMM ## (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM ##
XCOMM ####################################################################
#define HASH #
XCOMM ##########################################################################
XCOMM
XCOMM Directory specifications
XCOMM
XCOMM ##########################################################################
HASH
HASH Set OPENWINHOME
HASH
if [ -z "$OPENWINHOME" ]
then
export OPENWINHOME="/usr/openwin"
fi
HASH
HASH Set MANPATH
HASH
if [ -z "$MANPATH" ]
then
export MANPATH=/usr/man:$OPENWINHOME/share/man
else
export MANPATH=$MANPATH:$OPENWINHOME/share/man
fi
HASH
HASH Set HELPPATH
HASH
if [ -z "$HELPPATH" ]
then
export HELPPATH=$OPENWINHOME/lib/locale:$OPENWINHOME/lib/help
else
export HELPPATH=$HELPPATH:$OPENWINHOME/lib/locale:$OPENWINHOME/lib/help
fi
HASH
HASH Set AnswerBook path
HASH
if [ -z "$AB_CARDCATALOG" ]
then
export AB_CARDCATALOG=/usr/dt/share/answerbooks/$LANG/ab_cardcatalog
else
export AB_CARDCATALOG=/usr/dt/share/answerbooks/$LANG/ab_cardcatalog:$AB_CARDCATALOG
fi
HASH
HASH Set XFILESEARCHPATH
HASH
if [ -z "$XFILESEARCHPATH" ]
then
export XFILESEARCHPATH="$OPENWINHOME/lib/locale/%L/%T/%N%S:$OPENWINHOME/lib/%T/%N%S"
else
export XFILESEARCHPATH="$XFILESEARCHPATH:$OPENWINHOME/lib/locale/%L/%T/%N%S:$OPENWINHOME/lib/%T/%N%S"
fi
HASH Allocate default colormaps for dynamic non-default visuals
if [ -x $OPENWINHOME/bin/cmap_alloc ]
then
$OPENWINHOME/bin/cmap_alloc -allscreens
fi
HASH start virtual keyboard backend
HASH
HASH To start old OpenLook virtual keyboard for use with the OpenLook deskset
HASH applications, uncomment (remove "#" character from) the following 4 lines.
HASH Note, this may add a few extra seconds to your desktop start time.
HASH if [ -x $OPENWINHOME/bin/vkbd ]
HASH then
HASH $OPENWINHOME/bin/vkbd -nopopup &
HASH fi
HASH Init DeskSet colors (for OpenWindow applications)
if [ -x $OPENWINHOME/bin/ds_server_init ]
then
$OPENWINHOME/bin/ds_server_init
fi
HASH Add font paths in $HOME/.OWfontpath
if [ "$DTXSERVERLOCATION" != "remote" ]; then
HASH
HASH Since X server is local,
HASH making one call to xset.
HASH
ADDFONTPATH() {
HASH Combine lines together to make arguments for the xset command
FP=`nawk '
BEGIN { fp="fp+ " }
/^[ ]*$/ { fp=" +fp " ; continue }
{ fontsdir = sprintf("%s%s", $0,"/fonts.dir")
getline fontsdata < fontsdir
if (fontsdata != 0) {
printf("%s%s", fp, $0) ; fp="," ; fontsdata=0 } } ' $1`
if [ -n "$FP" ]; then
eval "$OPENWINHOME/bin/xset $FP"
fi
}
HASH Add personal fontpaths
if [ -r $HOME/.OWfontpath ]; then
ADDFONTPATH $HOME/.OWfontpath
fi
else
HASH
HASH Since X server is not local, we don't know if the font
HASH directories exist on the X server machine, so
HASH setting them one at a time.
HASH
if [ -r $HOME/.OWfontpath ]; then
nawk ' BEGIN {
fp=" fp+ "
XDIR=0
}
/^[ ]*$/ {
fp=" +fp " ; continue }
{cmd = sprintf("%s%s%s%s%s",XDIR,"/xset",fp, $0," 1>/dev/null");
system(cmd); } ' XDIR=$OPENWINHOME/bin .OWfontpath
fi
fi
XCOMM ######################### eof #####################

View File

@@ -0,0 +1,115 @@
XCOMM!/bin/ksh
XCOMM ####################################################################
XCOMM ## File: 0050.dtxmodmap
XCOMM ##
XCOMM ## Default Location: CDE_INSTALLATION_TOP/config/Xsession.d/
XCOMM ##
XCOMM ## Purpose: Perform keyboard mapping
XCOMM ##
XCOMM ## Description:
XCOMM ## This script is invoked by means of the Xsession file
XCOMM ## at user login. It invokes xmodmap to setup the
XCOMM ## keyboard mapping required for selected locales.
XCOMM ##
XCOMM ## Invoked by: CDE_INSTALLATION_TOP/bin/Xsession
XCOMM ##
XCOMM ## Product: @(#)Common Desktop Environment 1.0
XCOMM ##
XCOMM ## Note:
XCOMM ##
XCOMM ## The CDE_INSTALLATION_TOP/config/Xsession.d/0050.dtxmodmap file is a
XCOMM ## factory-default file and will be unconditionally overwritten upon
XCOMM ## subsequent installation. To customize keyboard mapping
XCOMM ## behavior, copy this file to the configuration directory,
XCOMM ## CDE_CONFIGURATION_TOP/config/Xsession.d and customize that version
XCOMM ## of the file.
XCOMM ##
XCOMM ## Revision: $XConsortium: 0050.dtxmodmap.src /main/5 1996/07/18 15:26:04 drk $
XCOMM ##
XCOMM ## (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM ## (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM ## (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM ## (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM ## Novell, Inc.
XCOMM ##
XCOMM ####################################################################
XCOMM
XCOMM Determine the xmodmap keyboard to be used.
XCOMM
sys_version=`uname -v`
if [ "$sys_version" = "3" ]
then
Cname=C.hft
else
Cname=C
fi
if [ ${DISPLAY%.*} = ":0" ]
then
KBD=""
XDIR=/usr/lpp/X11/defaults/xmodmap
KBD_LANG=`/usr/lpp/X11/bin/querykbd`
if [ "$KBD_LANG" = "NULL" ]
then
dspmsg $XINITRCMSG/xinit.cat 2 'xinit: Odm keyboard id is NULL.\n'
else
if [ "$KBD_LANG" != "$Cname" ]
then
if [ -r $IMKEYMAPPATH/$KBD_LANG/keyboard ]
then
KBD=$IMKEYMAPPATH/$KBD_LANG/keyboard
else
if [ "$IMKEYMAPPATH" = "/usr/lib/nls/im.alt" ]
then
if [ "$sys_version" = "3" /
-a -r $XDIR/$KBD_LANG/keyboard.alt ]
then
KBD=$XDIR/$KBD_LANG/keyboard.alt
else
if [ -r $XDIR/${KBD_LANG}@alt/keyboard ]
then
KBD=$XDIR/${KBD_LANG}@alt/keyboard
fi
fi
fi
if [ "$KBD" = "" ]
then
if [ -r $XDIR/$KBD_LANG/keyboard ]
then
KBD=$XDIR/$KBD_LANG/keyboard
fi
fi
fi
fi
fi
if [ "$KBD" != "" ]
then
xmodmap $KBD
else
if [ "$IMKEYMAPPATH" = "/usr/lib/nls/im.alt" ]
then
if [ "$sys_version" = "3" /
-a -r $XDIR/$KBD_LANG/keyboard.alt ]
then
xmodmap $XDIR/$KBD_LANG/keyboard.alt
exit
fi
if [ -r $XDIR/${KBD_LANG}@alt/keyboard ]
then
xmodmap $XDIR/${KBD_LANG}@alt/keyboard
exit
fi
fi
if [ -r $XDIR/$LANG/keyboard ]
then
xmodmap $XDIR/$LANG/keyboard
fi
fi
fi
XCOMM ######################### eof #####################

View File

@@ -0,0 +1,60 @@
XCOMM !/usr/bin/ksh
XCOMM ####################################################################
XCOMM ## File: 0060.srcsysenv
XCOMM ##
XCOMM ## Default Location: /usr/dt/config/Xsession.d/
XCOMM ##
XCOMM ## Purpose: Source system-defined environment variables
XCOMM ##
XCOMM ## Description:
XCOMM ## This script is invoked by means of the Xsession
XCOMM ## file at user login.
XCOMM ##
XCOMM ## Invoked by: /usr/dt/bin/Xsession
XCOMM ##
XCOMM ## $TOG: 0060.srcsysenv.src /main/1 1998/08/03 18:10:08 devobj $
XCOMM ##
XCOMM ## (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM ## (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM ## (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM ## (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM ## (c) Copyright 1993, 1994 Novell, Inc.
XCOMM ##
XCOMM ####################################################################
XCOMM ##
XCOMM ####################################################################
#define HASH #
HASH
HASH Source TIMEZONE
HASH
TZ_FILE=/etc/TIMEZONE
if [ -f $TZ_FILE -a -r $TZ_FILE ]; then
. $TZ_FILE
fi
unset TZ_FILE
HASH
HASH Source PATH - it does NOT set the variable so this
HASH this script must take of it
HASH
PATH_FILE=/etc/PATH
if [ -f $PATH_FILE -a -r $PATH_FILE ]; then
export PATH="$PATH:`cat $PATH_FILE`"
fi
unset PATH_FILE
HASH
HASH Source MANPATH - it does NOT set the variable so this
HASH this script must take of it
HASH
MANPATH_FILE=/etc/MANPATH
if [ -f $MANPATH_FILE -a -r $MANPATH_FILE ]; then
export MANPATH="$MANPATH:`cat $MANPATH_FILE`"
fi
unset MANPATH_FILE
XCOMM ######################### eof #####################

View File

@@ -0,0 +1,75 @@
!! $XConsortium: Dtlogin.src /main/3 1996/04/21 19:31:02 drk $
!!######################################################################
!!
!! Dtlogin
!!
!! Application Defaults for the Login Manager
!!
!!
!! (c) Copyright 1993, 1994 Hewlett-Packard Company
!! (c) Copyright 1993, 1994 International Business Machines Corp.
!! (c) Copyright 1993, 1994 Sun Microsystems, Inc.
!! (c) Copyright 1993, 1994 Novell, Inc.
!!
!! ************ DO NOT EDIT THIS FILE *************
!!
!! CDE_INSTALLATION_TOP/app-defaults/$LANG/Dtlogin is a factory-default file
!! and will be unconditionally overwritten upon subsequent installation.
!! Modification is discouraged.
!!
!!######################################################################
!!
!! This file contains appearance and behaviour resources for the Dtlogin
!! login screen.
!!
!!######################################################################
!!
!! FONTS
!!
!! labelFont button and label text
!! textFont help and error dialog text
!!
XCOMM if WIDTH >= 1280
!! Dtlogin*labelFont: -*-swiss 742-medium-r-normal-*-140-*-p-110-*
!! Dtlogin*textFont: -*-prestige-medium-r-normal-*-128-72-*
XCOMM else
XCOMM if WIDTH >= 1024
!! Dtlogin*labelFont: -*-swiss 742-bold-r-normal-*-140-*-p-100-*
!! Dtlogin*textFont: -*-prestige-medium-r-normal-*-128-72-*
XCOMM else
!! Dtlogin*textFont: -*-helvetica-bold-r-normal-*-100-*
XCOMM endif
XCOMM endif
Dtlogin*labelFont: %|nls-1-#labelFont#|
Dtlogin*textFont: %|nls-2-#textFont#|
!!######################################################################
!!
!! GREETING
!!
!! Dtlogin*greeting.foreground: black
!! Dtlogin*greeting.background: #a8a8a8
!! Dtlogin*greeting.fontList: -*-*schoolbook-medium-i-normal--18-*
!! Dtlogin*greeting.labelString: Welcome to %LocalHost%
!! Dtlogin*greeting.alignment: ALIGNMENT_CENTER
Dtlogin*greeting.fontList: %|nls-3-#greeting.fontList#|
!!######################################################################
!!
!! Size of Text Input Area
!!
Dtlogin*login_text.columns: %|nls-4-#20#|
Dtlogin*passwd_text.columns: %|nls-5-#20#|

View File

@@ -0,0 +1,79 @@
XCOMM $TOG: Imakefile /main/10 1999/02/26 11:28:56 mgreess $
#if InstallXdmConfig
XDMCONFIG = xdm-config
XDMRESOURCES = Xresources
XDMSERVERS = Xservers
XDMSESSION = Xsession
InstallNonExec($(XDMCONFIG),$(XDMDIR))
InstallNonExec($(XDMRESOURCES),$(XDMDIR))
InstallNonExec($(XDMSERVERS),$(XDMDIR))
InstallNonExec($(XDMSESSION),$(XDMDIR))
Xservers:
echo "Choose one of" Xservers.* "and copy it to Xservers"
exit 1
#endif
LOCAL_CPP_DEFINES = -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) \
-DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \
-DCDE_LOGFILES_TOP=$(CDE_LOGFILES_TOP) \
-DXPROJECTROOT=X11ProjectRoot
#ifdef SunArchitecture
EXTRA_CPP_TARGETS = \
0015.sun.env \
Xresources.ow \
Xsession.ow \
Xsession.ow2
#else
EXTRA_CPP_TARGETS =
#endif
CPP_TARGETS = \
0060.dtsysenv Dtlogin \
Xaccess Xconfig \
Xconfig.con Xconfig.nc \
Xfailsafe Xreset \
Xresources Xresources.ive \
Xservers Xservers.con \
Xservers.nc Xsession \
Xsession.ive Xsetup \
Xstartup current.session \
display.current.session display.home.session \
dtlslocale dtprofile \
home.session $(EXTRA_CPP_TARGETS)
AllTarget($(CPP_TARGETS))
CppScriptTarget(0015.sun.env,0015.sun.env.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(0020.dtims,0020.dtims.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(0060.dtsysenv,0060.dtsysenv.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(Dtlogin,Dtlogin.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(Xaccess,Xaccess.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(Xconfig,Xconfig.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(Xconfig.con,Xconfig.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(Xconfig.nc,Xconfig.src,-D_NO_CONSOLE $(LOCAL_CPP_DEFINES),)
CppScriptTarget(Xfailsafe,Xfailsafe.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(Xreset,Xreset.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(Xresources,Xresources.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(Xresources.ive,Xresources.src,-DIVE $(LOCAL_CPP_DEFINES),)
CppSourceFile(Xresources.ow,Xresources.ow.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(Xservers,Xservers.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(Xservers.con,Xservers.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(Xservers.nc,Xservers.src,-D_NO_CONSOLE $(LOCAL_CPP_DEFINES),)
CppSourceFile(Xservers.nc,Xservers.src,-D_NO_CONSOLE,)
CppScriptTarget(Xsession,Xsession.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(Xsession.ive,Xsession.src,-DIVE $(LOCAL_CPP_DEFINES),)
CppScriptTarget(Xsession.ow,Xsession.ow.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(Xsession.ow2,Xsession.ow2.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(Xsetup,Xsetup.src,$(LOCAL_CPP_DEFINES),)
CppScriptTarget(Xstartup,Xstartup.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(current.session,current.session.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(display.current.session,display.current.session.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(display.home.session,display.home.session.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(dtlslocale,dtlslocale.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(dtprofile,dtprofile.src,$(LOCAL_CPP_DEFINES),)
CppSourceFile(home.session,home.session.src,$(LOCAL_CPP_DEFINES),)

View File

@@ -0,0 +1,17 @@
/* $XConsortium: README /main/2 1996/07/15 14:15:04 drk $ */
* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*
Xdm Sample Configuration
This directory contains a collection of files which describe a sample
configuration of xdm. Choose between the sample Xservers.* files; copy the
appropriate one to "/usr/lib/X11/xdm/Xservers" along with the other
files in this directory.
Only a few of the many configuration parameters which xdm can be tuned with
are set in this sample, read the xdm manual page for a complete description.

View File

@@ -0,0 +1,126 @@
XCOMM #####################################################################
XCOMM
XCOMM Xaccess
XCOMM Common Desktop Environment
XCOMM
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Novell, Inc.
XCOMM
XCOMM ************** DO NOT EDIT THIS FILE **************
XCOMM
XCOMM CDE_INSTALLATION_TOP/config/Xaccess is a factory-default file and will
XCOMM be unconditionally overwritten upon subsequent installation.
XCOMM Before making changes to the file, copy it to the configuration
XCOMM directory, CDE_CONFIGURATION_TOP/config. You must also update the accessFile
XCOMM resource in CDE_CONFIGURATION_TOP/config/Xconfig.
XCOMM
XCOMM $XConsortium: Xaccess.src /main/5 1996/04/23 11:42:01 drk $
XCOMM
XCOMM #####################################################################
XCOMM
XCOMM This file contains a list of host names which are allowed or
XCOMM denied XDMCP connection access to this machine. When a remote
XCOMM display (typically an X-termimal) requests login service, Dtlogin
XCOMM will consult this file to determine if service should be granted
XCOMM or denied.
XCOMM
XCOMM # Access control file for XDMCP connections
XCOMM
XCOMM To control Direct and Broadcast access:
XCOMM
XCOMM pattern
XCOMM
XCOMM To control Indirect queries:
XCOMM
XCOMM pattern list of hostnames and/or macros ...
XCOMM
XCOMM To use the chooser:
XCOMM
XCOMM pattern CHOOSER BROADCAST
XCOMM
XCOMM or
XCOMM
XCOMM pattern CHOOSER list of hostnames and/or macros ...
XCOMM
XCOMM To define macros:
XCOMM
XCOMM %name list of hosts ...
XCOMM
XCOMM
XCOMM The first form tells dtlogin which displays to respond to itself.
XCOMM The second form tells dtlogin to forward indirect queries from hosts
XCOMM matching the specified pattern to the indicated list of hosts.
XCOMM The third form tells dtlogin to handle indirect queries using the
XCOMM chooser; the chooser is directed to send its own queries out via the
XCOMM broadcast address and display the results on the terminal.
XCOMM The fourth form is similar to the third, except instead of using the
XCOMM broadcast address, it sends DirectQuerys to each of the hosts in
XCOMM the list
XCOMM
XCOMM In all cases, dtlogin uses the first entry which matches the terminal;
XCOMM for IndirectQuery messages only entries with right hand sides can
XCOMM match, for Direct and Broadcast Query messages, only entries without
XCOMM right hand sides can match.
XCOMM
XCOMM Information regarding the format of entries in this file is
XCOMM included at the end of the file.
XCOMM
XCOMM #####################################################################
XCOMM Entries...
* # grant service to all remote displays
XCOMM
XCOMM The nicest way to run the chooser is to just ask it to broadcast
XCOMM requests to the network - that way new hosts show up automatically.
XCOMM Sometimes, however, the chooser can't figure out how to broadcast,
XCOMM so this may not work in all environments.
XCOMM
* CHOOSER BROADCAST # any indirect host can get a chooser
XCOMM
XCOMM If you'd prefer to configure the set of hosts each terminal sees,
XCOMM then just uncomment these lines (and comment the CHOOSER line above)
XCOMM and edit the %hostlist line as appropriate
XCOMM
XCOMM %hostlist host-a host-b
XCOMM * CHOOSER %hostlist #
XCOMM #####################################################################
XCOMM
XCOMM ENTRY FORMAT
XCOMM
XCOMM An entry in this file is either a host name or a pattern. A
XCOMM pattern may contain one or more meta characters (`*' matches any
XCOMM sequence of 0 or more characters, and `?' matches any single
XCOMM character) which are compared against the host name of the remote
XCOMM device requesting service.
XCOMM
XCOMM If the entry is a host name, all comparisons are done using
XCOMM network addresses, so any name which converts to the correct
XCOMM network address may be used. For patterns, only canonical host
XCOMM names are used in the comparison, so do not attempt to match
XCOMM aliases.
XCOMM
XCOMM Preceding either a host name or a pattern with a `!' character
XCOMM causes hosts which match that entry to be excluded.
XCOMM
XCOMM When checking access for a particular display host, each entry is
XCOMM scanned in turn and the first matching entry determines the
XCOMM response.
XCOMM
XCOMM Blank lines are ignored, `#' is treated as a comment delimiter
XCOMM causing the rest of that line to be ignored,
XCOMM
XCOMM ex.
XCOMM !xtra.lcs.mit.edu # disallow direct/broadcast service for xtra
XCOMM bambi.ogi.edu # allow access from this particular display
XCOMM *.lcs.mit.edu # allow access from any display in LCS

View File

@@ -0,0 +1,188 @@
XCOMM ##########################################################################
XCOMM
XCOMM Xconfig
XCOMM
XCOMM Common Desktop Environment (CDE)
XCOMM
XCOMM Configuration file for the Login Manager
XCOMM
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Novell, Inc.
XCOMM
XCOMM $XConsortium: Xconfig.src /main/6 1996/06/27 11:10:38 mgreess $
XCOMM
XCOMM ************** DO NOT EDIT THIS FILE **************
XCOMM
XCOMM CDE_INSTALLATION_TOP/config/Xconfig is a factory-default file and will
XCOMM be unconditionally overwritten upon subsequent installation.
XCOMM Before making changes to the file, copy it to the configuration
XCOMM directory, CDE_CONFIGURATION_TOP/config.
XCOMM
XCOMM This file contains behaviour resources for the CDE DT Login Manager.
XCOMM It also specifies the location of other configuration files used by
XCOMM the Login Manager.
XCOMM
XCOMM Appearance resources for the login screen are contained in the file
XCOMM specified by the "*resources" resource below.
XCOMM
XCOMM Most resources can be limited to a single display by including the
XCOMM display name in the resource. If the display name is not included, the
XCOMM resource will apply to all displays managed by the Login Manager. When
XCOMM specifying the display name, replace the ":" character in the name
XCOMM with an underscore "_". If the name is fully qualified, also replace
XCOMM dot "." characters with underscores.
XCOMM
XCOMM Example:
XCOMM
XCOMM Dtlogin*machine_domain_name_0*startup: CDE_CONFIGURATION_TOP/config/Xstartup.aa
XCOMM
XCOMM For more information see the man page, Dtlogin(1X).
XCOMM
XCOMM ##########################################################################
Dtlogin.errorLogFile: CDE_LOGFILES_TOP/Xerrors
Dtlogin.pidFile: CDE_LOGFILES_TOP/Xpid
XCOMM #########################################################################
XCOMM Note: If you do not specify a full path beginning with a "/"
XCOMM dtlogin will first search for the following files in
XCOMM /etc/dt/config then in /usr/dt/config.
XCOMM
XCOMM #########################################################################
Dtlogin.accessFile: Xaccess
#if defined (_NO_CONSOLE)
Dtlogin.servers: Xservers.nc
#else
#if defined (__osf__)
Dtlogin.servers: Xservers.con
#else
Dtlogin.servers: Xservers
#endif
#endif
Dtlogin*resources: %L/Xresources
Dtlogin*startup: Xstartup
Dtlogin*reset: Xreset
Dtlogin*setup: Xsetup
#if defined (__hpux) || defined (_AIX) || defined (sun) || defined (__osf__)
Dtlogin*failsafeClient: Xfailsafe
#else
Dtlogin*failsafeClient: /usr/bin/X11/xterm
#endif
XCOMM #########################################################################
XCOMM To specify the system env vars to be exported to the users session
XCOMM
XCOMM Dtlogin.exportList: ODMDIR NLSPATH TZ ...
#ifdef _AIX
Dtlogin.exportList: ODMDIR NLSPATH TZ
#endif
XCOMM #########################################################################
XCOMM To specify the languages listed in the [Options] [Languages] menu.
XCOMM
XCOMM Dtlogin*languageList: <lang1> <lang2> <lang3>
XCOMM #########################################################################
XCOMM To specify a default language for the display.
XCOMM
XCOMM Dtlogin*language: <lang>
XCOMM #########################################################################
XCOMM #
XCOMM # To specify the system languages that should not be displayed in
XCOMM # the default [Options] [Languages] menu. The default menu includes
XCOMM # all the locales installed on the system, except for the ones
XCOMM # in this resource. Filename patterns may be used.
XCOMM #
XCOMM # The resource is typically used to filter out locale synonyms
XCOMM # and locales that don't have desktop support.
XCOMM #
XCOMM # Each locale in the NLS directory is compared against each of the
XCOMM # language patterns in the ignoreLocales list using "fnmatch".
XCOMM # Any locales which match are NOT included in the list of locales
XCOMM # displayed to the user.
XCOMM #
XCOMM # Dtlogin*ignoreLocales: <lang_pattern1> <lang_pattern2>
XCOMM #
#if defined (__osf__)
Dtlogin*ignoreLocales: *.88591* *@ucs4 *@chuyin *@pinyin *@radical *@stroke \
ca_ES cs_CZ hu_HU iw_IL lt_LT pl_PL ru_RU sk_SK sl_SI
#endif
XCOMM #########################################################################
XCOMM To specify global environment variables for the X-server and all users
XCOMM on the display. User variables can also be specified in the Xsession file.
XCOMM
XCOMM Dtlogin*environment: <name=value> <name=value>
XCOMM #########################################################################
XCOMM To specify a default user PATH environment variable.
XCOMM
XCOMM Dtlogin*userPath: <path>
XCOMM #########################################################################
XCOMM To set a display to run the user's XDM $HOME/.xsession script as the
XCOMM default session. Ensure that the $HOME/.xsession script is executable.
XCOMM
XCOMM Dtlogin*xdmMode: True
XCOMM #########################################################################
XCOMM To terminate and restart the X-server at user logout.
XCOMM
XCOMM Dtlogin*terminateServer: True
XCOMM #########################################################################
XCOMM To disable listening for XDMCP requests from X-terminals.
XCOMM
XCOMM Dtlogin.requestPort: 0
XCOMM #########################################################################
XCOMM To disable R4 MIT-MAGIC-COOKIE-1 per-user authorization.
XCOMM
XCOMM Dtlogin*authorize: False
XCOMM #########################################################################
XCOMM To specify how long the Login Manager waits to connect to an X-server.
XCOMM
XCOMM Dtlogin*openTimeout: <seconds>
XCOMM #########################################################################
XCOMM To specify how often the Login Manager "pings" a remote display to
XCOMM determine if it is still active.
XCOMM
XCOMM Dtlogin*pingInterval: <minutes>
XCOMM Dtlogin*pingTimeout: <minutes>
XCOMM #########################################################################
XCOMM To release the server grab on the display when the login screen is
XCOMM present. Doing so will reduce security capabilities of the Login Manager.
XCOMM
XCOMM Dtlogin*grabServer: False
XCOMM #########################################################################
XCOMM To specify the maximum size of the Login Manager error log file in
XCOMM kilobytes.
XCOMM
XCOMM Dtlogin.errorLogSize: 50

View File

@@ -0,0 +1,93 @@
XCOMM!/bin/sh
XCOMM #####################################################################
XCOMM
XCOMM Xfailsafe
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM Configuration file for the Login Manager
XCOMM
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Novell, Inc.
XCOMM
XCOMM ************** DO NOT EDIT THIS FILE **************
XCOMM
XCOMM CDE_INSTALLATION_TOP/config/Xfailsafe is a factory-default file and will
XCOMM be unconditionally overwritten upon subsequent installation.
XCOMM Before making changes to the file, copy it to the configuration
XCOMM directory, CDE_CONFIGURATION_TOP/config. You must also update the
XCOMM failsafeClient resource in CDE_CONFIGURATION_TOP/config/Xconfig.
XCOMM
XCOMM $XConsortium: Xfailsafe.src /main/5 1996/07/02 11:39:20 mgreess $
XCOMM #####################################################################
XCOMM
XCOMM
XCOMM This file contains commands to invoke a simple session for repairs of
XCOMM a dysfunctional environment.
XCOMM
XCOMM All clients should be run in the background with the exception of the
XCOMM last client. When the last client is terminated by the user, the session
XCOMM will be terminated and the login screen will be presented.
XCOMM
#ifdef sun
XCOMM This simple session consists of a single terminal emulator.
#else
XCOMM This simple session consists of a window manager and a single terminal
XCOMM emulator.
#endif
#ifdef sun
XDIR=/usr/openwin/bin
$XDIR/xterm -C -ls
#else
XCOMM
XCOMM Global variables
XCOMM
XDIR=/usr/bin/X11
DELAY=2
XCOMM
XCOMM Set background to default weave.
XCOMM
$XDIR/xsetroot -default &
#if defined(_AIX) && defined(AIXV4)
XCOMM
XCOMM Clear the LFT message locale override if set
XCOMM
if [ "$LC_MESSAGES" = "C@lft" ]
then
unset LC_MESSAGES
fi
#endif
XCOMM
XCOMM Start a window manager.
XCOMM
$XDIR/mwm &
sleep $DELAY
#if defined(_AIX) && defined(AIXV4)
XCOMM
XCOMM Setup xmodmap
XCOMM
if [ -x CDE_INSTALLATION_TOP/config/Xsession.d/0050.dtxmodmap ]
then
CDE_INSTALLATION_TOP/config/Xsession.d/0050.dtxmodmap
fi
#endif
XCOMM
XCOMM Start the terminal emulator (also the session terminator client).
XCOMM
#if defined (_AIX)
$XDIR/aixterm -ls
#else
$XDIR/xterm -ls
#endif
#endif

View File

@@ -0,0 +1,80 @@
XCOMM! /bin/ksh
XCOMM ##########################################################################
XCOMM
XCOMM Xreset
XCOMM
XCOMM Common Desktop Environment (CDE)
XCOMM
XCOMM Configuration file for the Login Manager
XCOMM
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Novell, Inc.
XCOMM
XCOMM ************** DO NOT EDIT THIS FILE **************
XCOMM
XCOMM CDE_INSTALLATION_TOP/config/Xreset is a factory-default file and will
XCOMM be unconditionally overwritten upon subsequent installation.
XCOMM Before making changes to the file, copy it to the configuration
XCOMM directory, CDE_CONFIGURATION_TOP/config. You must also update the reset
XCOMM resource in CDE_CONFIGURATION_TOP/config/Xconfig.
XCOMM
XCOMM $XConsortium: Xreset.src /main/6 1996/08/15 16:51:53 rswiston $
XCOMM
XCOMM
XCOMM This file is symmetrical with Xstartup. This script is run after the user
XCOMM session is terminated. Run as root, it should probably contain commands
XCOMM that undo the effects of commands in Xstartup, such as unmounting directories
XCOMM from file servers. The collection of environment variables that were passed
XCOMM to Xstartup are also passed to Xreset.
XCOMM
XCOMM ##########################################################################
XCOMM
XCOMM This script is run as root after the session terminates but
XCOMM before the display is closed...
XCOMM
XCOMM
XCOMM Update action types for any printers created during the session
XCOMM
if [ -x /usr/dt/bin/dtprintinfo ]
then
/usr/dt/bin/dtprintinfo -populate
fi
XCOMM
XCOMM Reset console ownership if local session
XCOMM
if [ "$DTXSERVERLOCATION" = "local" ]
then
if [[ ! -z "$ITE" && "$ITE" != "??" && -a "/dev/$ITE" ]]
then
chown root /dev/$ITE
chgrp $ROOT_GID /dev/$ITE
fi
fi
XCOMM
XCOMM If Xsession did not exit gracefully for this user, the dtdbcache
XCOMM file will still be left around. Remove it if this user owns it.
XCOMM
XCOMM dtdbcache file's directory should match
XCOMM _DTDTSMMTEMPDIR in DtSvc/DtUtil1/DtsMM.h
#ifdef __osf__
DTDBFILE=/var/tmp/dtdbcache_$DISPLAY
#else
DTDBFILE=/tmp/dtdbcache_$DISPLAY
#endif
if [ -f $DTDBFILE ]
then
DTDBFILEOWNER=`/bin/ls -l $DTDBFILE | /bin/awk '{print $3}'`
if [ $USER = $DTDBFILEOWNER ]
then
/bin/rm -f $DTDBFILE
fi
fi

View File

@@ -0,0 +1,22 @@
!!######################################################################
!! $XConsortium: Xresources.ow.src /main/3 1996/11/19 11:40:46 drk $
!!
!! Xresources.ow
!!
!! Configuration file for the OpenWindow alternate desktop resources
!!
!! (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
!!
!! @(#)Xresources.ow.src 1.1 95/03/10
!!
!!######################################################################
!!
!! This file used by the Solaris Desktop Login manager
Dtlogin*altDtsIncrement: True
Dtlogin*altDtName: %|nls-291-#OpenWindows#|
Dtlogin*altDtKey: /usr/openwin/bin/olwm
Dtlogin*altDtStart: /usr/dt/config/Xsession.ow
Dtlogin*altDtLogo: OWlogo

View File

@@ -0,0 +1,595 @@
!!######################################################################
!!
!! Xresources
!!
!! Common Desktop Environment
!!
!! Configuration file for the Login Manager
!!
!! (c) Copyright 1993, 1994 Hewlett-Packard Company
!! (c) Copyright 1993, 1994 International Business Machines Corp.
!! (c) Copyright 1993, 1994 Sun Microsystems, Inc.
!! (c) Copyright 1993, 1994 Novell, Inc.
!!
!! ************** DO NOT EDIT THIS FILE **************
!!
!! CDE_INSTALLATION_TOP/config/Xresources is a factory-default file and will
!! be unconditionally overwritten upon subsequent installation.
!! Before making changes to the file, copy it to the configuration
!! directory, CDE_CONFIGURATION_TOP/config. You must also update the resources
!! resource in CDE_CONFIGURATION_TOP/config/Xconfig.
!!
!! $TOG: Xresources.src /main/12 1998/11/03 19:16:07 mgreess $
!!
!!######################################################################
!!
!!
!! This file contains appearance and behaviour resources for the Dtlogin
!! login screen. These are designed to be read into the root window
!! property via the 'xrdb' program. Dtlogin will do this automatically
!! after the server is reset and will remove them before the session
!! starts.
!!
!! Dtlogin contains internal default values for all resources. To
!! override a default value, uncomment the appropriate line below and
!! supply the desired value.
!!
!! Customization hints are included at the end of this file.
!!
!!
!!######################################################################
!!
!! Motif visuals
!!
*DtMenuButton*shadowThickness: 1
*enableThinThickness:1
*highlightThickness:1
*enableButtonTab: True
*enableDefaultButton: True
*enableEtchedInMenu: True
*enableMenuInCascade: True
*enableMultiKeyBindings: True
*enableToggleColor: True
*enableToggleVisual: True
!#################################################################
!# translations for the text field widget
!#
!#
!#
!#################################################################
*XmTextField*Translations:#override\n\
Ctrl<Key>u:delete-to-start-of-line()\n\
Ctrl<Key>k:delete-to-end-of-line()\n\
Ctrl<Key>a:beginning-of-line()\n\
Ctrl<Key>e:end-of-line()\n\
Ctrl<Key>b:backward-character()\n\
Ctrl<Key>f:forward-character()
!!######################################################################
!!
!! COLORS
!!
!! #a8a8a8 = lightgray
!! #7e7e7e = gray (darker shade)
!! #ef506f = burgundy
!!
!! Dtlogin*foreground: black
XCOMM ifdef COLOR
!! Dtlogin*background: #a8a8a8
#ifdef IVE
Dtlogin*highlightColor: #7D7DCBCBD4D4
#else /* IVE */
!! Dtlogin*highlightColor: #ef506f
#endif /* IVE */
#ifdef IVE
Dtlogin*logo*Background: #7D7DCBCBD4D4
#else /* IVE */
!! Dtlogin*logo*Background: #ef506f
#endif /* IVE */
XCOMM else
!! Dtlogin*background: white
XCOMM endif
!!######################################################################
!!
!! FONTS
!!
!! labelFont button and label text
!! textFont help and error dialog text
!!
XCOMM if WIDTH < 1024
Dtlogin*labelFont: %|nls-8-#labelFont#|
Dtlogin*textFont: %|nls-9-#textFont#|
Dtlogin*greeting.fontList: %|nls-10-#greeting.fontList#|
Dtlogin*MessageBox*labelFontList: %|nls-8-#labelFont#|
XCOMM else
Dtlogin*labelFont: %|nls-1-#labelFont#|
Dtlogin*textFont: %|nls-2-#labelFont#|
Dtlogin*greeting.fontList: %|nls-3-#greeting.fontList#|
Dtlogin*MessageBox*labelFontList: %|nls-1-#labelFont#|
XCOMM endif
!!######################################################################
!!
!! CURSOR
!!
!! False = The MIT "X" cursor (default)
!! True = The left pointer cursor
Dtlogin*workspaceCursor: True
!!######################################################################
!!
!! GREETING
!!
!! Dtlogin*greeting.foreground: black
!! Dtlogin*greeting.background: #a8a8a8
!! Dtlogin*greeting.labelString: Welcome to %LocalHost%
!! Dtlogin*greeting.persLabelString: Welcome %s
!! Dtlogin*greeting.alignment: ALIGNMENT_CENTER
!!######################################################################
!!
!! Size of Text Input Area
!!
Dtlogin*login_text.columns: %|nls-4-#20#|
Dtlogin*passwd_text.columns: %|nls-5-#20#|
!!######################################################################
!!
!! MISC
!!
#ifdef IVE
Dtlogin*logo*bitmapFile: MPowerLogo
#else /* IVE */
!! Dtlogin*logo*bitmapFile: < bitmap or pixmap file >
#endif /* IVE */
Dtlogin*preeditType:
#if defined (_AIX) && defined (AIXV4)
!!######################################################################
!!
!! LANGUAGE LIST COMMAND
!!
!! The Dtlogin*languageListCmd is used to generate the list of
!! languages available on the login screen. The Dtlogin*languageList
!! resource takes precidence over this resource.
!!
Dtlogin*languageListCmd: /usr/dt/bin/dtlslocale
#undef C
XCOMM undef C
!!######################################################################
!!
!! LANGUAGE MENU NAME MAPPINGS
!!
!! Dtlogin*Fr_FR.languageName: French
!! Dtlogin*pt_PT.languageName: Portuguese - ISO8859-1
!!
#endif /* _AIX && AIXV4 */
#if defined (_AIX) && !defined (AIXV4)
!!######################################################################
!!
!! LANGUAGE MENU NAME MAPPINGS
#undef C
XCOMM undef C
Dtlogin*Ar_AA.languageName: %|nls-100-##|
Dtlogin*C.languageName: %|nls-101-##|
Dtlogin*Da_DK.languageName: %|nls-102-##|
Dtlogin*De_CH.languageName: %|nls-103-##|
Dtlogin*De_DE.languageName: %|nls-104-##|
Dtlogin*En_GB.languageName: %|nls-105-##|
Dtlogin*En_US.languageName: %|nls-106-##|
Dtlogin*Es_ES.languageName: %|nls-107-##|
Dtlogin*Fi_FI.languageName: %|nls-108-##|
Dtlogin*Fr_BE.languageName: %|nls-109-##|
Dtlogin*Fr_CA.languageName: %|nls-110-##|
Dtlogin*Fr_CH.languageName: %|nls-111-##|
Dtlogin*Fr_FR.languageName: %|nls-112-##|
Dtlogin*Is_IS.languageName: %|nls-113-##|
Dtlogin*It_IT.languageName: %|nls-114-##|
Dtlogin*Iw_IL.languageName: %|nls-115-##|
Dtlogin*Ja_JP.languageName: %|nls-116-##|
Dtlogin*Jp_JP.languageName: %|nls-117-##|
Dtlogin*Nl_BE.languageName: %|nls-118-##|
Dtlogin*Nl_NL.languageName: %|nls-119-##|
Dtlogin*No_NO.languageName: %|nls-120-##|
Dtlogin*POSIX.languageName: %|nls-121-##|
Dtlogin*Pt_PT.languageName: %|nls-122-##|
Dtlogin*Sv_SE.languageName: %|nls-123-##|
Dtlogin*UNIVERSAL.languageName: %|nls-124-##|
Dtlogin*ar_AA.languageName: %|nls-125-##|
Dtlogin*bg_BG.languageName: %|nls-126-##|
Dtlogin*cs_CS.languageName: %|nls-127-##|
Dtlogin*da_DK.languageName: %|nls-128-##|
Dtlogin*de_CH.languageName: %|nls-129-##|
Dtlogin*de_DE.languageName: %|nls-130-##|
Dtlogin*el_GR.languageName: %|nls-131-##|
Dtlogin*en_GB.languageName: %|nls-132-##|
Dtlogin*en_US.languageName: %|nls-133-##|
Dtlogin*es_ES.languageName: %|nls-134-##|
Dtlogin*fi_FI.languageName: %|nls-135-##|
Dtlogin*fr_BE.languageName: %|nls-136-##|
Dtlogin*fr_CA.languageName: %|nls-137-##|
Dtlogin*fr_CH.languageName: %|nls-138-##|
Dtlogin*fr_FR.languageName: %|nls-139-##|
Dtlogin*hr_HR.languageName: %|nls-140-##|
Dtlogin*hu_HU.languageName: %|nls-141-##|
Dtlogin*is_IS.languageName: %|nls-142-##|
Dtlogin*it_IT.languageName: %|nls-143-##|
Dtlogin*iw_IL.languageName: %|nls-144-##|
Dtlogin*ja_JP.languageName: %|nls-145-##|
Dtlogin*ko_KR.languageName: %|nls-146-##|
Dtlogin*mk_MK.languageName: %|nls-147-##|
Dtlogin*nl_BE.languageName: %|nls-148-##|
Dtlogin*nl_NL.languageName: %|nls-149-##|
Dtlogin*no_NO.languageName: %|nls-150-##|
Dtlogin*pl_PL.languageName: %|nls-151-##|
Dtlogin*pt_PT.languageName: %|nls-152-##|
Dtlogin*ro_RO.languageName: %|nls-153-##|
Dtlogin*ru_RU.languageName: %|nls-154-##|
Dtlogin*sh_YU.languageName: %|nls-155-##|
Dtlogin*si_SI.languageName: %|nls-156-##|
Dtlogin*sk_SK.languageName: %|nls-157-##|
Dtlogin*sp_YU.languageName: %|nls-158-##|
Dtlogin*sv_SE.languageName: %|nls-159-##|
Dtlogin*tr_TR.languageName: %|nls-160-##|
Dtlogin*zh_TW.languageName: %|nls-161-##|
#endif /* _AIX && !AIXV4 */
#if defined (sun)
!!######################################################################
!!
!! LANGUAGE MENU NAME MAPPINGS
#undef C
XCOMM undef C
Dtlogin*C.languageName : %|nls-200-##|
Dtlogin*de.languageName : %|nls-201-##|
Dtlogin*fr.languageName : %|nls-202-##|
Dtlogin*it.languageName : %|nls-203-##|
Dtlogin*sv.languageName : %|nls-204-##|
Dtlogin*es.languageName : %|nls-205-##|
Dtlogin*en_US.languageName : %|nls-206-##|
Dtlogin*ja.languageName : %|nls-207-##|
Dtlogin*japanese.languageName: %|nls-208-##|
Dtlogin*ko.languageName : %|nls-209-##|
Dtlogin*korean.languageName : %|nls-210-##|
Dtlogin*zh.languageName : %|nls-211-##|
Dtlogin*chinese.languageName : %|nls-212-##|
Dtlogin*zh_TW.languageName : %|nls-213-##|
Dtlogin*tchinese.languageName: %|nls-214-##|
Dtlogin*ca.languageName : %|nls-215-##|
Dtlogin*en_AU.languageName : %|nls-216-##|
Dtlogin*en_CA.languageName : %|nls-217-##|
Dtlogin*en_IE.languageName : %|nls-218-##|
Dtlogin*en_NZ.languageName : %|nls-219-##|
Dtlogin*en_UK.languageName : %|nls-220-##|
Dtlogin*da.languageName : %|nls-221-##|
Dtlogin*nl.languageName : %|nls-222-##|
Dtlogin*nl_BE.languageName : %|nls-223-##|
Dtlogin*su.languageName : %|nls-224-##|
Dtlogin*fr_CA.languageName : %|nls-225-##|
Dtlogin*fr_BE.languageName : %|nls-226-##|
Dtlogin*fr_CH.languageName : %|nls-227-##|
Dtlogin*de_CH.languageName : %|nls-228-##|
Dtlogin*no.languageName : %|nls-229-##|
Dtlogin*pt.languageName : %|nls-230-##|
Dtlogin*es_AR.languageName : %|nls-231-##|
Dtlogin*es_BO.languageName : %|nls-232-##|
Dtlogin*es_CL.languageName : %|nls-233-##|
Dtlogin*es_CO.languageName : %|nls-234-##|
Dtlogin*es_CR.languageName : %|nls-235-##|
Dtlogin*es_EC.languageName : %|nls-236-##|
Dtlogin*es_SV.languageName : %|nls-237-##|
Dtlogin*es_GT.languageName : %|nls-238-##|
Dtlogin*es_MX.languageName : %|nls-239-##|
Dtlogin*es_NI.languageName : %|nls-240-##|
Dtlogin*es_PA.languageName : %|nls-241-##|
Dtlogin*es_PY.languageName : %|nls-242-##|
Dtlogin*es_PE.languageName : %|nls-243-##|
Dtlogin*es_UY.languageName : %|nls-244-##|
Dtlogin*es_VE.languageName : %|nls-245-##|
Dtlogin*pt_BR.languageName : %|nls-246-##|
#endif /* sun */
#if defined (__hpux)
!!######################################################################
!!
!! LANGUAGE MENU NAME MAPPINGS
#undef C
XCOMM undef C
Dtlogin*C.languageName: %|nls-300-##|
Dtlogin*C.iso88591.languageName: %|nls-301-##|
Dtlogin*POSIX.languageName: %|nls-302-##|
Dtlogin*ar_DZ.arabic8.languageName: %|nls-303-##|
Dtlogin*ar_SA.arabic8.languageName: %|nls-304-##|
Dtlogin*ar_SA.iso88596.languageName: %|nls-305-##|
Dtlogin*bg_BG.iso88595.languageName: %|nls-306-##|
Dtlogin*cs_CZ.iso88592.languageName: %|nls-307-##|
Dtlogin*da_DK.iso88591.languageName: %|nls-308-##|
Dtlogin*da_DK.roman8.languageName: %|nls-309-##|
Dtlogin*de_DE.iso8859.languageName: %|nls-310-##|
Dtlogin*de_DE.roman8.languageName: %|nls-311-##|
Dtlogin*el_GR.greek8.languageName: %|nls-312-##|
Dtlogin*el_GR.iso88597.languageName: %|nls-313-##|
Dtlogin*en_GB.iso88591.languageName: %|nls-314-##|
Dtlogin*en_GB.roman8.languageName: %|nls-315-##|
Dtlogin*en_US.iso88591.languageName: %|nls-316-##|
Dtlogin*en_US.roman8.languageName: %|nls-317-##|
Dtlogin*es_ES.iso88591.languageName: %|nls-318-##|
Dtlogin*es_ES.roman8.languageName: %|nls-319-##|
Dtlogin*fi_FI.iso88591.languageName: %|nls-320-##|
Dtlogin*fi_FI.roman8.languageName: %|nls-321-##|
Dtlogin*fr_CA.iso88591.languageName: %|nls-322-##|
Dtlogin*fr_CA.roman8.languageName: %|nls-323-##|
Dtlogin*fr_FR.iso88591.languageName: %|nls-324-##|
Dtlogin*fr_FR.roman8.languageName: %|nls-325-##|
Dtlogin*hu_HU.iso88592.languageName: %|nls-327-##|
Dtlogin*is_IS.iso88591.languageName: %|nls-328-##|
Dtlogin*is_IS.roman8.languageName: %|nls-329-##|
Dtlogin*it_IT.iso88591.languageName: %|nls-330-##|
Dtlogin*it_IT.roman8.languageName: %|nls-331-##|
Dtlogin*iw_IL.hebrew8.languageName: %|nls-332-##|
Dtlogin*iw_IL.iso88598.languageName: %|nls-333-##|
Dtlogin*ja_JP.SJIS.languageName: %|nls-334-##|
Dtlogin*ja_JP.eucJP.languageName: %|nls-335-##|
Dtlogin*ja_JP.kana8.languageName: %|nls-336-##|
Dtlogin*ko_KR.eucKR.languageName: %|nls-337-##|
Dtlogin*nl_NL.iso88591.languageName: %|nls-338-##|
Dtlogin*nl_NL.roman8.languageName: %|nls-339-##|
Dtlogin*no_NO.iso88591.languageName: %|nls-340-##|
Dtlogin*no_NO.roman8.languageName: %|nls-341-##|
Dtlogin*pl_PL.iso88592.languageName: %|nls-342-##|
Dtlogin*pt_PT.iso88591.languageName: %|nls-343-##|
Dtlogin*pt_PT.roman8.languageName: %|nls-344-##|
Dtlogin*ro_RO.iso88592.languageName: %|nls-345-##|
Dtlogin*ru_RU.iso88595.languageName: %|nls-346-##|
Dtlogin*sh_HR.iso88592.languageName: %|nls-347-##|
Dtlogin*sl_SI.iso88592.languageName: %|nls-348-##|
Dtlogin*sv_SE.iso88591.languageName: %|nls-349-##|
Dtlogin*sv_SE.roman8.languageName: %|nls-350-##|
Dtlogin*th_TH.tis620.languageName: %|nls-351-##|
Dtlogin*tr_TR.iso88599.languageName: %|nls-352-##|
Dtlogin*tr_TR.turkish8.languageName: %|nls-353-##|
Dtlogin*zh_CN.hp15CN.languageName: %|nls-354-##|
Dtlogin*zh_TW.big5.languageName: %|nls-355-##|
Dtlogin*zh_TW.ccdc.languageName: %|nls-356-##|
#endif /* __hpux */
#if defined (__osf__)
!!######################################################################
!!
!! LANGUAGE MENU NAME MAPPINGS
\#undef C
Dtlogin*C.languageName: %|nls-400-#C#|
Dtlogin*POSIX.languageName: %|nls-401-#POSIX#|
Dtlogin*ca_ES.ISO8859-1.languageName: %|nls-448-#Catalan#|
Dtlogin*zh_CN.languageName: %|nls-402-#Chinese China#|
Dtlogin*zh_CN.dechanzi.languageName: %|nls-403-#Chinese China (DEC Hanzi)#|
Dtlogin*zh_HK.big5.languageName: %|nls-404-#Chinese Hong Kong (Big 5)#|
Dtlogin*zh_HK.eucTW.languageName: %|nls-405-#Chinese Hong Kong (EUC Taiwan)#|
Dtlogin*zh_HK.dechanyu.languageName: %|nls-406-#Chinese Hong Kong (DEC Hanyu)#|
Dtlogin*zh_HK.dechanzi.languageName: %|nls-407-#Chinese Hong Kong (DEC Hanzi)#|
Dtlogin*zh_TW.languageName: %|nls-408-#Chinese Taiwan#|
Dtlogin*zh_TW.big5.languageName: %|nls-409-#Chinese Taiwan (Big5)#|
Dtlogin*zh_TW.dechanyu.languageName: %|nls-410-#Chinese Taiwan (DEC Hanyu)#|
Dtlogin*zh_TW.eucTW.languageName: %|nls-411-#Chinese Taiwan (EUC)#|
Dtlogin*cs_CZ.ISO8859-2.languageName: %|nls-412-#Czech#|
Dtlogin*da_DK.ISO8859-1.languageName: %|nls-413-#Danish#|
Dtlogin*nl_NL.ISO8859-1.languageName: %|nls-414-#Dutch#|
Dtlogin*nl_BE.ISO8859-1.languageName: %|nls-415-#Dutch Belgian#|
Dtlogin*en_GB.ISO8859-1.languageName: %|nls-416-#English (Great Britain)#|
Dtlogin*en_US.ISO8859-1.languageName: %|nls-417-#English (United States)#|
Dtlogin*fi_FI.ISO8859-1.languageName: %|nls-418-#Finnish#|
Dtlogin*fr_FR.ISO8859-1.languageName: %|nls-419-#French#|
Dtlogin*fr_CA.ISO8859-1.languageName: %|nls-420-#French-Canadian#|
Dtlogin*fr_BE.ISO8859-1.languageName: %|nls-421-#French-Belgian#|
Dtlogin*de_DE.ISO8859-1.languageName: %|nls-422-#German#|
Dtlogin*el_GR.ISO8859-7.languageName: %|nls-423-#Greek#|
Dtlogin*iw_IL.ISO8859-8.languageName: %|nls-424-#Hebrew#|
Dtlogin*hu_HU.ISO8859-2.languageName: %|nls-425-#Hungarian#|
Dtlogin*is_IS.ISO8859-1.languageName: %|nls-426-#Icelandic#|
Dtlogin*it_IT.ISO8859-1.languageName: %|nls-427-#Italian#|
Dtlogin*ja_JP.languageName: %|nls-428-#Japanese#|
Dtlogin*ja_JP.deckanji.languageName: %|nls-429-#Japanese (DEC Kanji)#|
Dtlogin*ja_JP.eucJP.languageName: %|nls-430-#Japanese (EUC)#|
Dtlogin*ja_JP.sdeckanji.languageName: %|nls-431-#Japanese (Super DEC Kanji)#|
Dtlogin*ja_JP.SJIS.languageName: %|nls-432-#Japanese (Shift JIS)#|
Dtlogin*ko_KR.languageName: %|nls-433-#Korean#|
Dtlogin*ko_KR.deckorean.languageName: %|nls-434-#Korean (DEC Korean)#|
Dtlogin*ko_KR.eucKR.languageName: %|nls-435-#Korean (EUC)#|
Dtlogin*lt_LT.ISO8859-4.languageName: %|nls-450-#Lithuanian#|
Dtlogin*no_NO.ISO8859-1.languageName: %|nls-436-#Norwegian#|
Dtlogin*pl_PL.ISO8859-2.languageName: %|nls-437-#Polish#|
Dtlogin*pt_PT.ISO8859-1.languageName: %|nls-438-#Portugese#|
Dtlogin*ru_RU.ISO8859-5.languageName: %|nls-439-#Russian#|
Dtlogin*sk_SK.ISO8859-2.languageName: %|nls-440-#Slovak#|
Dtlogin*sl_SI.ISO8859-2.languageName: %|nls-449-#Slovene#|
Dtlogin*es_ES.ISO8859-1.languageName: %|nls-441-#Spanish#|
Dtlogin*sv_SE.ISO8859-1.languageName: %|nls-442-#Swedish#|
Dtlogin*fr_CH.ISO8859-1.languageName: %|nls-443-#Swiss-french#|
Dtlogin*de_CH.ISO8859-1.languageName: %|nls-444-#Swiss-German#|
Dtlogin*th_TH.languageName: %|nls-445-#Thai#|
Dtlogin*th_TH.TACTIS.languageName: %|nls-446-#Thai (TACTIS)#|
Dtlogin*tr_TR.ISO8859-9.languageName: %|nls-447-#Turkish#|
#endif /* __osf__ */
#if defined (__uxp__)
!!######################################################################
!!
!! LANGUAGE MENU NAME MAPPINGS
#undef C
XCOMM undef C
Dtlogin*C.languageName: %|nls-500-##|
Dtlogin*POSIX.languageName: %|nls-501-##|
Dtlogin*iso_8859_1.languageName: %|nls-502-##|
Dtlogin*ja.languageName: %|nls-503-##|
Dtlogin*ja_JP.languageName: %|nls-504-##|
Dtlogin*ja_JP.EUC.languageName: %|nls-505-##|
Dtlogin*ja_JP.S90.languageName: %|nls-506-##|
Dtlogin*ja_JP.SJIS.languageName: %|nls-507-##|
Dtlogin*ja_JP.U90.languageName: %|nls-508-##|
Dtlogin*ja_JP.eucJP.languageName: %|nls-509-##|
Dtlogin*japan.languageName: %|nls-510-##|
#endif /* __uxp__ */
#if defined (USL)
!!######################################################################
!!
!! LANGUAGE MENU NAME MAPPINGS
#undef C
XCOMM undef C
Dtlogin*C.languageName: %|nls-600-##|
Dtlogin*POSIX.languageName: %|nls-601-##|
Dtlogin*da.languageName: %|nls-602-##|
Dtlogin*da_DK.850.languageName: %|nls-603-##|
Dtlogin*da_DK.865.languageName: %|nls-604-##|
Dtlogin*de.languageName: %|nls-605-##|
Dtlogin*de_DE.437.languageName: %|nls-606-##|
Dtlogin*de_DE.850.languageName: %|nls-607-##|
Dtlogin*de_AT.languageName: %|nls-608-##|
Dtlogin*de_AT.437.languageName: %|nls-609-##|
Dtlogin*de_AT.850.languageName: %|nls-610-##|
Dtlogin*de_CH.languageName: %|nls-611-##|
Dtlogin*de_CH.437.languageName: %|nls-612-##|
Dtlogin*de_CH.850.languageName: %|nls-613-##|
Dtlogin*el.languageName: %|nls-614-##|
Dtlogin*en.languageName: %|nls-615-##|
Dtlogin*en_GB.437.languageName: %|nls-616-##|
Dtlogin*en_GB.646.languageName: %|nls-617-##|
Dtlogin*en_GB.850.languageName: %|nls-618-##|
Dtlogin*en_AU.languageName: %|nls-619-##|
Dtlogin*en_AU.437.languageName: %|nls-620-##|
Dtlogin*en_AU.646.languageName: %|nls-621-##|
Dtlogin*en_AU.850.languageName: %|nls-622-##|
Dtlogin*en_CA.languageName: %|nls-623-##|
Dtlogin*en_CA.437.languageName: %|nls-624-##|
Dtlogin*en_CA.646.languageName: %|nls-625-##|
Dtlogin*en_CA.850.languageName: %|nls-626-##|
Dtlogin*en_IR.languageName: %|nls-627-##|
Dtlogin*en_IR.437.languageName: %|nls-628-##|
Dtlogin*en_IR.850.languageName: %|nls-629-##|
Dtlogin*en_IR.646.languageName: %|nls-630-##|
Dtlogin*en_NZ.languageName: %|nls-631-##|
Dtlogin*en_NZ.437.languageName: %|nls-632-##|
Dtlogin*en_NZ.850.languageName: %|nls-633-##|
Dtlogin*en_NZ.646.languageName: %|nls-634-##|
Dtlogin*en_US.languageName: %|nls-635-##|
Dtlogin*en_US.437.languageName: %|nls-636-##|
Dtlogin*en_US.646.languageName: %|nls-637-##|
Dtlogin*en_US.850.languageName: %|nls-638-##|
Dtlogin*es.languageName: %|nls-639-##|
Dtlogin*es_ES.437.languageName: %|nls-640-##|
Dtlogin*es_ES.850.languageName: %|nls-641-##|
Dtlogin*es_AR.languageName: %|nls-642-##|
Dtlogin*es_AR.437.languageName: %|nls-643-##|
Dtlogin*es_AR.850.languageName: %|nls-644-##|
Dtlogin*es_CL.languageName: %|nls-645-##|
Dtlogin*es_CL.437.languageName: %|nls-646-##|
Dtlogin*es_CL.850.languageName: %|nls-647-##|
Dtlogin*es_MX.languageName: %|nls-648-##|
Dtlogin*es_MX.437.languageName: %|nls-649-##|
Dtlogin*es_MX.850.languageName: %|nls-650-##|
Dtlogin*es_VE.languageName: %|nls-651-##|
Dtlogin*es_VE.437.languageName: %|nls-652-##|
Dtlogin*es_VE.850.languageName: %|nls-653-##|
Dtlogin*fi.languageName: %|nls-654-##|
Dtlogin*fi_FI.437.languageName: %|nls-655-##|
Dtlogin*fi_FI.850.languageName: %|nls-656-##|
Dtlogin*fr.languageName: %|nls-657-##|
Dtlogin*fr_FR.437.languageName: %|nls-658-##|
Dtlogin*fr_FR.850.languageName: %|nls-659-##|
Dtlogin*fr_BE.languageName: %|nls-660-##|
Dtlogin*fr_BE.437.languageName: %|nls-661-##|
Dtlogin*fr_BE.850.languageName: %|nls-662-##|
Dtlogin*fr_CA.languageName: %|nls-663-##|
Dtlogin*fr_CA.850.languageName: %|nls-664-##|
Dtlogin*fr_CA.863.languageName: %|nls-665-##|
Dtlogin*fr_CH.languageName: %|nls-666-##|
Dtlogin*fr_CH.437.languageName: %|nls-667-##|
Dtlogin*fr_CH.850.languageName: %|nls-668-##|
Dtlogin*is.languageName: %|nls-669-##|
Dtlogin*is_IS.850.languageName: %|nls-670-##|
Dtlogin*it.languageName: %|nls-671-##|
Dtlogin*it_IT.437.languageName: %|nls-672-##|
Dtlogin*it_IT.850.languageName: %|nls-673-##|
Dtlogin*it_CH.languageName: %|nls-674-##|
Dtlogin*it_CH.437.languageName: %|nls-675-##|
Dtlogin*it_CH.850.languageName: %|nls-676-##|
Dtlogin*ja.languageName: %|nls-677-##|
Dtlogin*ja_JP.EUC.languageName: %|nls-678-##|
Dtlogin*nl.languageName: %|nls-679-##|
Dtlogin*nl_NL.437.languageName: %|nls-680-##|
Dtlogin*nl_NL.850.languageName: %|nls-681-##|
Dtlogin*nl_BE.languageName: %|nls-682-##|
Dtlogin*nl_BE.437.languageName: %|nls-683-##|
Dtlogin*nl_BE.850.languageName: %|nls-684-##|
Dtlogin*no.languageName: %|nls-685-##|
Dtlogin*no_NO.850.languageName: %|nls-686-##|
Dtlogin*no_NO.865.languageName: %|nls-687-##|
Dtlogin*pt.languageName: %|nls-688-##|
Dtlogin*pt_BR.languageName: %|nls-689-##|
Dtlogin*pt_PT.850.languageName: %|nls-690-##|
Dtlogin*pt_PT.860.languageName: %|nls-691-##|
Dtlogin*sv.languageName: %|nls-692-##|
Dtlogin*sv_SE.437.languageName: %|nls-693-##|
Dtlogin*sv_SE.850.languageName: %|nls-694-##|
#endif /* USL */
!!######################################################################
!!
!! CHOOSER
!!
dtchooser*chlistFont: %|nls-7-#chlistlFont#|
dtchooser*visibleItemCount: 10
!!****************************************************************************
!!
!! CUSTOMIZATION HINTS
!!
!!
!! The login screen was designed to be easy to customize for a variety of
!! attributes. These include...
!!
!! 1. custom logo bitmap
!! 2. custom greeting message
!! 3. colors
!! 4. fonts
!!
!! Users may replace the default logo with a custom one of their choice.
!!
!! Colors and fonts can be changed using the standard Motif resources for
!! the appropriate widget and/or class.

View File

@@ -0,0 +1,116 @@
XCOMM ##########################################################################
XCOMM
XCOMM Xservers
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM Configuration file for all Xservers started or managed by the Login Manager
XCOMM
XCOMM (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Novell, Inc.
XCOMM
XCOMM BEST TO NOT EDIT CDE_INSTALLATION_TOP/config/Xservers directly.
XCOMM
XCOMM CDE_INSTALLATION_TOP/config/Xservers is a factory-default file and will
XCOMM be unconditionally overwritten upon subsequent installation.
XCOMM Before making changes to the file, should copy it to the configuration
XCOMM directory, CDE_CONFIGURATION_TOP/config.
XCOMM
XCOMM $XConsortium: Xservers.src /main/7 1996/08/25 02:01:08 cde-fuj $
XCOMM
XCOMM ##########################################################################
XCOMM
XCOMM This file should contain an entry to start the server on the
XCOMM local display. If you have more than one display (not screen),
XCOMM add entries to the list (one per line).
XCOMM
XCOMM If the local display has an associated character device, it should be
XCOMM specified here also. This allows Dtlogin to correctly monitor that
XCOMM device when [No Windows] mode is selected from the login screen. If
XCOMM no character device is available, then "none" should be specified.
XCOMM
XCOMM By default, the ":0" display is associated with the "/dev/console"
XCOMM character device. If the true console on the system is not the same
XCOMM as the ":0" graphics display, then the appropriate device or "none"
XCOMM should be specified for the ":0" display.
XCOMM
XCOMM If you want multiple-displays running dtlogin then make sure the
XCOMM connection number matches the display name, for example.
XCOMM
XCOMM <HostName>:1 local@none /usr/openwin/bin/X :1 <options>
XCOMM
XCOMM This means the X-server is started on connection number "1" and the
XCOMM display is connecting to the X-server on "1" through display name
XCOMM "LocalHost:1".
XCOMM
XCOMM If you have some X terminals connected which do not support XDMCP,
XCOMM you can add them here as well. Using XDMCP is recommended over
XCOMM entries in this file and should be used whenever possible.
XCOMM
XCOMM Example Syntax, the items between "< >" are optional:
XCOMM
XCOMM <HostName>:0 <class> local@console /usr/openwin/bin/X :0 <options>
XCOMM <HostName>:1 <class> local@none /usr/openwin/bin/X :1 <options>
XCOMM <HostName>:0 <class> local_uid@console <uid> /usr/openwin/bin/X :0 <options>
XCOMM XTermName:0 <class> foreign
XCOMM
XCOMM A "*" in the first field of the entry for a local server
XCOMM will be expanded to "<hostname>:0" by Dtlogin. This
XCOMM syntax is valid only within this file.
XCOMM
XCOMM * Local local@console /usr/openwin/bin/Xsun :0
XCOMM
XCOMM If the display type of "local_uid" is used, a user name such as "root"
XCOMM must follow in next field. In this example, by placing "root" here,
XCOMM Login will start a local Xserver under the user id of "root". On Sun
XCOMM system's this will give Xserver the ability to raise interactive
XCOMM scheduling priority of a client with mouse/keyboard focus to increase
XCOMM performance of the application.
XCOMM
XCOMM :0 Local local_uid@console root /usr/openwin/bin/Xsun :0
XCOMM
XCOMM In limited situations, the Xserver should not be run under a "root" id
XCOMM for security reasons. Examples are usually specific to Xserver extensions.
XCOMM On Sun Xservers one example involves the Display Postscript extension.
XCOMM If the DPS extension is granted access (via Xserver option line) to read
XCOMM and write Unix files via the "-dpsfileops" option (see Xsun man page) it
XCOMM should not be run under a "root" user id. For increaseced security,
XCOMM could instead run it as the "nobody" user.
XCOMM
XCOMM :0 Local local_uid@console nobody /usr/openwin/bin/Xsun :0 -dpsfileops
XCOMM
XCOMM Another options of interest here for Sun's Xserver is how to start on
XCOMM two or more screens. A two screen example follows.
XCOMM
XCOMM :0 Local local_uid@console root /usr/openwin/bin/X -dev /dev/fb0 -dev /dev/fb1
XCOMM
XCOMM See the Xsun.1 and Xserver.1 man pages for additional options of
XCOMM interest.
XCOMM
XCOMM ##########################################################################
#if defined (__apollo)
* Local local /etc/Xdomain :0
#elif defined (_AIX) && defined (AIXV4)
:0 Local local@console /usr/lpp/X11/defaults/xserverrc -T -force :0
#elif defined (_AIX)
:0 Local local@console /usr/bin/X11/X -T -force :0
#elif defined (sun)
:0 Local local_uid@console root /usr/openwin/bin/Xsun :0 -nobanner
#elif defined (__osf__)
#if defined (_NO_CONSOLE)
XCOMM * Local local_uid@console root /usr/bin/X11/X :0 -nice -2
#else
:0 Local local_uid@console root /usr/bin/X11/X :0 -nice -2
#endif
#elif defined (__hpux)
* Local local@console /usr/bin/X11/X :0
#elif defined (_NO_CONSOLE)
XCOMM * Local local@console /usr/bin/X11/X :0
#elif defined (__uxp__)
:0 Local local@console /usr/bin/X11/X :0
#else
* Local local@console /usr/bin/X11/X :0
#endif

View File

@@ -0,0 +1,48 @@
XCOMM!/bin/ksh
XCOMM $XConsortium: Xsession.ow.src /main/3 1996/11/19 11:41:19 drk $
XCOMM ####################################################################
XCOMM ## File: Xsession.ow
XCOMM ##
XCOMM ## Default Location: /usr/dt/config/Xsession.ow
XCOMM ##
XCOMM ## Purpose: OpenWindows session start script
XCOMM ##
XCOMM ## Invoked by: Solaris Desktop Login Manager (dtlogin)
XCOMM ##
XCOMM ## Revision: @(#)Xsession.ow.src 1.4 95/08/10
XCOMM ##
XCOMM ## (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
XCOMM ##
XCOMM ####################################################################
DTDSPMSG=/usr/dt/bin/dtdspmsg
if [ -z "$SESSIONTYPE" ]
then
export SESSIONTYPE="altDt"
fi
if [ -z "$DTSTARTIMS" ]
then
export DTSTARTIMS="False"
fi
if [ -z "$SDT_ALT_SESSION" ]
then
export SDT_ALT_SESSION="/usr/dt/config/Xsession.ow2"
fi
if [ -z "$SDT_ALT_HELLO" ]
then
if [ -x $DTDSPMSG ]; then
export SDT_ALT_HELLO="/usr/dt/bin/dthello -string '`$DTDSPMSG -s 37 /usr/dt/lib/nls/msg/$LANG/dthello.cat 1 'Starting the OpenWindows Desktop'`' &"
else
export SDT_ALT_HELLO="/usr/dt/bin/dthello -string 'Starting the OpenWindows Desktop' &"
fi
fi
export SDT_NO_DSDM=""
/usr/dt/bin/Xsession

View File

@@ -0,0 +1,52 @@
XCOMM!/bin/ksh
XCOMM $XConsortium: Xsession.ow2.src /main/3 1996/11/19 11:41:57 drk $
XCOMM ####################################################################
XCOMM ## File: Xsession.ow2
XCOMM ##
XCOMM ## Default Location: /usr/dt/config/Xsession.ow2
XCOMM ##
XCOMM ## Purpose: OpenWindows Desktop start script
XCOMM ##
XCOMM ## Invoked by: /usr/dt/bin/Xsession
XCOMM ##
XCOMM ## Revision: @(#)Xsession.ow2.src 1.3 95/02/16
XCOMM ##
XCOMM ## (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.
XCOMM ##
XCOMM ####################################################################
XCOMM First a little namespace cleanup of vars associated with this
XCOMM (and /usr/dt/bin/Xsession.ow) scripts.
unset SDT_ALT_SESSION
unset SDT_ALT_HELLO
unset SDT_NO_DSDM
XCOMM
XCOMM Find "xinitrc" file by standard precedence rules and start
XCOMM the user's OpenWindows Desktop.
XCOMM
DEFAULT_XINITRC="/usr/openwin/lib/Xinitrc"
HOME_XINITRC="$HOME/.xinitrc"
if [ -z "$XINITRC" ]; then
if [ -f $HOME_XINITRC ]; then
XINITRC=$HOME_XINITRC
else
XINITRC=$DEFAULT_XINITRC
fi
fi
echo "OpenWindows Desktop Login"
if [ -f $XINITRC ]; then
echo "using xinitrc file: $XINITRC"
/bin/ksh $XINITRC
else
echo "xinitrc file: $XINITRC not found"
if [ -f $DEFAULT_XINITRC ]; then
echo "using xinitrc: $DEFAULT_XINITRC"
/bin/ksh $DEFAULT_XINITRC
fi
fi

View File

@@ -0,0 +1,603 @@
XCOMM! /bin/ksh
XCOMM ##########################################################################
XCOMM
XCOMM Xsession
XCOMM
XCOMM Common Desktop Environment (CDE)
XCOMM
XCOMM Configuration script for the Login Manager
XCOMM
XCOMM (c) Copyright 1996 Digital Equipment Corporation.
XCOMM (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
XCOMM (c) Copyright 1993,1994,1996 International Business Machines Corp.
XCOMM (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993,1994,1996 Novell, Inc.
XCOMM (c) Copyright 1996 FUJITSU LIMITED.
XCOMM (c) Copyright 1996 Hitachi.
XCOMM
XCOMM ************** DO NOT EDIT THIS FILE **************
XCOMM
XCOMM CDE_INSTALLATION_TOP/bin/Xsession is a factory-default file and will
XCOMM be unconditionally overwritten upon subsequent installation.
XCOMM Modification is discouraged.
XCOMM
XCOMM $TOG: Xsession.src /main/19 1999/03/30 09:38:50 mgreess $
XCOMM
XCOMM Usage: $0 [-session session_name]
XCOMM
XCOMM ##########################################################################
#define HASH #
#ifdef sun
HASH
HASH Set OPENWINHOME
HASH
if [ -z "$OPENWINHOME" ]
then
export OPENWINHOME="/usr/openwin"
fi
#endif
#if 0
/*
* Platform specific definitions
*
* cpp_XINITUSER - user's xinit startup file
* cpp_MAIL - system mail file
* cpp_HELLO - dthello command line
* cpp_XDMSYS - xdm system session file
*/
#endif
#if defined (_AIX)
# define cpp_XINITUSER "$HOME/.xinitrc"
# define cpp_MAIL "/var/spool/mail/$USER"
#elif defined (__hpux)
# define cpp_XDMSYS "/usr/lib/X11/xdm/sys.xsession"
#elif defined (sun)
# define cpp_MAIL "/var/mail/$USER"
#endif
#ifdef __osf__
# undef cpp_MAIL
# define cpp_MAIL "/usr/spool/mail/$USER"
#endif
#if defined (__hpux) && defined (BLS)
# undef cpp_HELLO
# define cpp_HELLO "$DT_BINPATH/dthello -file /etc/copyright -file $HOME/.dtlogininfo &"
#endif
#if 0
/*
* Fallback definitions
*/
#endif
#if !defined (cpp_XINITUSER)
# define cpp_XINITUSER "$HOME/.x11start"
#endif
#if !defined (cpp_MAIL)
# define cpp_MAIL "/usr/mail/$USER"
#endif
#if !defined (cpp_HELLO)
# define cpp_HELLO "$DT_BINPATH/dthello &"
#endif
#if !defined (cpp_XDMSYS)
# define cpp_XDMSYS "/usr/lib/X11/xdm/Xsession"
#endif
XCOMM ##########################################################################
XCOMM
XCOMM
XCOMM This script starts the user's session. It searches for one of three
XCOMM types of startup mechanisms, in the following order:
XCOMM
XCOMM DT existence of CDE DT Session Manager on the system
XCOMM XDM "$HOME/.xsession" (executable)
XCOMM xinit cpp_XINITUSER (executable)
XCOMM
XCOMM If none of these startup mechanisms exist, a default window manager
XCOMM and terminal emulator client are started.
XCOMM
XCOMM ##########################################################################
XCOMM
XCOMM Variables must be explicitly exported
XCOMM
set +a
XCOMM ##########################################################################
XCOMM
XCOMM Initialize session startup logging
XCOMM
XCOMM ##########################################################################
exec >/dev/null 2>/dev/null
LOGDIR=$HOME/.dt
LOGFILENAME=$LOGDIR/startlog
MSGLOGFILENAME=$LOGDIR/errorlog
if [ ! -d $LOGDIR ]; then
mkdir $LOGDIR
if [ -d $LOGDIR ]; then
chmod 755 $LOGDIR
fi
fi
[ -f $LOGFILENAME.older ] && rm -f $LOGFILENAME.older
[ -f $LOGFILENAME.old ] && mv -f $LOGFILENAME.old $LOGFILENAME.older
[ -f $LOGFILENAME ] && mv -f $LOGFILENAME $LOGFILENAME.old
touch $LOGFILENAME
[ ! -f $MSGLOGFILENAME ] && touch $MSGLOGFILENAME
if [ -w $LOGFILENAME ]; then
exec >>$LOGFILENAME 2>&1
fi
Log()
{
echo "--- $1" >>$LOGFILENAME 2>&1
}
Log "$(date)"
Log "$0 starting..."
XCOMM ##########################################################################
XCOMM
XCOMM Global environment section
XCOMM
XCOMM DT pre-sets the following environment variables for each user.
XCOMM
XCOMM (internal)
XCOMM
XCOMM DISPLAY set to the value of the first field in the Xservers file.
XCOMM HOME set to the user's home directory (from /etc/passwd)
XCOMM LANG set to the display's current NLS language (if any)
XCOMM LC_ALL set to the value of $LANG
XCOMM LOGNAME set to the user name
XCOMM PATH set to the value of the Dtlogin "userPath" resource
XCOMM USER set to the user name
XCOMM SHELL set to the user's default shell (from /etc/passwd)
XCOMM TZ set to the value of the Dtlogin "timeZone" resource
XCOMM
XCOMM
XCOMM (Xsession)
XCOMM
XCOMM TERM set to xterm
XCOMM EDITOR set to the default editor
XCOMM KBD_LANG set to the value of $LANG for certain languages
XCOMM MAIL set to cpp_MAIL
XCOMM
XCOMM
XCOMM Three methods are available to modify or add to this list depending
XCOMM on the desired scope of the resulting environment variable.
XCOMM
XCOMM 1. X server and/or all users on a display (Xconfig file)
XCOMM 2. all users on a display (Xsession file)
XCOMM 3. individual users (.dtprofile file)
XCOMM
XCOMM See DT on-line help, the DT Users Guide, or the Dtlogin(1X) man
XCOMM page for details on setting environment variables.
XCOMM
XCOMM
XCOMM ##########################################################################
[ -z "$EDITOR" ] && EDITOR=CDE_INSTALLATION_TOP/bin/dtpad
[ -z "$MAIL" ] && MAIL=cpp_MAIL
[ -z "$LANG" ] && LANG="C"
TERM=dtterm
SESSION_SVR=`hostname`
export PATH EDITOR MAIL TERM SESSION_SVR LANG
#if defined (_AIX) && defined (AIXV4)
XCOMM
XCOMM Clear the LFT message locale override if set
XCOMM
if [ "$LC_MESSAGES" = "C@lft" ]
then
unset LC_MESSAGES
fi
#endif
#if defined (__osf__)
HASH
HASH Set XFILESEARCHPATH if necessary
HASH
if [ -z "$XFILESEARCHPATH" ]
then
export XFILESEARCHPATH="%D"
fi
HASH
HASH check if network is configured. If not, set environment variable
HASH so that tooltalk will use localhost/loopback rather than system
HASH name
RCMGR=/usr/sbin/rcmgr
NUM_NETCONFIG=`$RCMGR get NUM_NETCONFIG`
if [ "$NUM_NETCONFIG" = '' -o "$NUM_NETCONFIG" = 0 ]; then
export DTNONETWORK=true
fi
#endif
#if defined (__hpux)
HASH
HASH Set the keyboard language if necessary...
HASH
if [ ! -z "$LANG" ]
then
case $LANG in
bulgarian | czech | hebrew | hungarian | \
japanese | korean | polish | rumanian | \
russian | serbocroatian)
KBD_LANG=$LANG
export KBD_LANG;;
chinese-t) KBD_LANG=t_chinese
export KBD_LANG;;
chinese-s) KBD_LANG=s_chinese
export KBD_LANG;;
*);;
esac
fi
#endif
HASH
HASH Locate configuration file directories
HASH
XDIR=XPROJECTROOT/bin
DT_BINPATH=CDE_INSTALLATION_TOP/bin
DT_INSTALL_CONFIG=CDE_INSTALLATION_TOP/config
DT_CONFIG=CDE_CONFIGURATION_TOP/config
DT_CONFIG_PATH="$DT_INSTALL_CONFIG $DT_CONFIG"
XCOMM ##########################################################################
XCOMM
XCOMM Default desktop component configuration variable settings
XCOMM
XCOMM This section sets the default value for variables controlling
XCOMM some desktop components.
XCOMM
XCOMM ##########################################################################
HASH
HASH Input method server startup
HASH
if [ -z "$DTSTARTIMS" ]; then
DTSTARTIMS=True
fi
if [ "$DTSTARTIMS" = "False" ]; then
unset DTSTARTIMS
fi
HASH
HASH Default desktop screen saver action list
HASH
export DTSCREENSAVERLIST="StartDtscreenSwarm StartDtscreenQix \
StartDtscreenFlame StartDtscreenHop StartDtscreenImage StartDtscreenLife \
StartDtscreenRotor StartDtscreenPyro StartDtscreenWorm StartDtscreenBlank"
HASH
HASH Session startup clients and args
HASH
if [ "$SESSIONTYPE" = "altDt" ]; then
dtstart_session[0]="$SDT_ALT_SESSION"
dtstart_hello[0]="$SDT_ALT_HELLO"
else
DTSESSION_ARGS=""
if [ $# -ge 2 ]; then
if [ "$1" = "-session" ]; then
DTSESSION_ARGS="$1 $2"
fi
fi
dtstart_session[0]="$DT_BINPATH/dtsession $DTSESSION_ARGS"
dtstart_hello[0]=cpp_HELLO
fi
dtstart_session[1]="$HOME/.xsession"
dtstart_session[2]=cpp_XINITUSER
dtstart_session[3]="$XDIR/xterm -geometry 80x24+10+10"
dtstart_hello[1]="$XDIR/xsetroot -default &"
dtstart_searchpath="$DT_BINPATH/dtsearchpath -ksh"
dtstart_ttsession="$DT_BINPATH/ttsession -s"
dtstart_dtdbcache="$DT_BINPATH/dtdbcache -init"
HASH
HASH dtdbcache file's directory should match
HASH _DTDTSMMTEMPDIR in DtSvc/DtUtil1/DtsMM.h
HASH
#ifdef __osf__
dtdbcacherm="rm -f /var/tmp/dtdbcache_$DISPLAY"
#else
dtdbcacherm="rm -f /tmp/dtdbcache_$DISPLAY"
#endif
dtstart_appgather="$DT_BINPATH/dtappgather &"
#if defined(USL) || defined(sun) || defined(__uxp__)
dtstart_dsdm="$DT_BINPATH/dsdm &"
#endif
xdmstart_session[0]="$HOME/.xsession"
xdmstart_session[1]=cpp_XDMSYS
xdmstart_session[2]="xterm -geometry 80x24+10+10 -ls"
xdmstart_hello="$XDIR/xsetroot -default &"
SESSIONLOGDIR=$LOGDIR/sessionlogs
SESSIONLOGFILENAME="$SESSIONLOGDIR/$SESSION_SVR"_DISPLAY=$DISPLAY
if [ ! -d $SESSIONLOGDIR ]; then
mkdir $SESSIONLOGDIR
if [ -d $SESSIONLOGDIR ]; then
chmod 755 $SESSIONLOGDIR
fi
fi
touch $SESSIONLOGFILENAME
if [ -w $SESSIONLOGFILENAME ]; then
dtstart_sessionlogfile="$SESSIONLOGFILENAME"
else
dtstart_sessionlogfile="/dev/null"
fi
rm -f $SESSIONLOGFILENAME
#ifdef sun
if [ "$DTXSERVERLOCATION" != "remote" ]
then
HASH
HASH Start fallback console
HASH
if [ -x $XDIR/fbconsole ]
then
$XDIR/fbconsole &
fi
fi
#endif
#define cpp_Xsession
#include "_common.ksh.src"
#undef cpp_Xsession
#if defined (__osf__)
XCOMM
XCOMM Bring up the sysman checklist if it hasn't been run before
XCOMM
if [ -f /usr/sbin/start_checklist ]
then
Log "Starting the checklist setup"
/usr/sbin/start_checklist&
fi
#endif
XCOMM ##########################################################################
XCOMM
XCOMM Source user's desktop profile
XCOMM
XCOMM This section determines if the user has a desktop profile in their
XCOMM home directory. If not, the desktop default profile is copied to
XCOMM the home directory. The desktop profile is then sourced. The purpose
XCOMM is to incorporate any per-user/per-session environment customizations
XCOMM and thereby propagate them to applications and desktop components.
XCOMM
XCOMM ##########################################################################
DTSYSPROFILE=sys.dtprofile
DTPROFILE=.dtprofile
if [ ! -f $HOME/$DTPROFILE ]; then
for i in $DT_CONFIG_PATH
do
if [ -f $i/$DTSYSPROFILE ]; then
/usr/bin/awk '
BEGIN {printit=1}
/SYSPROFILE COMMENT START/ {printit=0; next}
/SYSPROFILE COMMENT END/ {printit=1; next}
printit==1 {print}' <$i/$DTSYSPROFILE >$HOME/$DTPROFILE
/bin/chmod 755 $HOME/$DTPROFILE
break
fi
done
fi
HASH
HASH source the .dtprofile.
HASH
if [ -f $HOME/$DTPROFILE ]; then
dtprofile_errors=`/bin/ksh -n $HOME/$DTPROFILE 2>&1`
if [ "0" = "$?" ]; then
Log "sourcing $HOME/$DTPROFILE..."
. $HOME/$DTPROFILE
else
Log "not sourcing $HOME/$DTPROFILE due to errors..."
Log "$dtprofile_errors"
fi
fi
XCOMM ##########################################################################
XCOMM
XCOMM External Xsession processing section
XCOMM
XCOMM This section searches the Xsession.d subdirectory and sources
XCOMM the files contained therein. The purpose is to set up any
XCOMM per-user/per-session environment customizations and thereby propagate
XCOMM them to applications and desktop components.
XCOMM
XCOMM ##########################################################################
DT_XSESSION_DIR=Xsession.d
for i in $DT_CONFIG_PATH
do
if [[ -d $i/$DT_XSESSION_DIR ]]; then
HASH
HASH Run custom Xsession scripts for this session.
HASH
for SCRIPT in $(ls $i/$DT_XSESSION_DIR); do
if [ -x $i/$DT_XSESSION_DIR/$SCRIPT -a \
\( ! -d $i/$DT_XSESSION_DIR/$SCRIPT \) ]; then
Log "sourcing $i/$DT_XSESSION_DIR/$SCRIPT..."
. $i/$DT_XSESSION_DIR/$SCRIPT
fi
done
fi
done
XCOMM ##########################################################################
XCOMM
XCOMM Startup section.
XCOMM
XCOMM Note: The ksh syntax ${parameter%% *} is used when appropriate to
XCOMM remove any command line options that may have been included
XCOMM in the definition of a DT executable below.
XCOMM
XCOMM ##########################################################################
XCOMM
XCOMM Return first command in array named by $1 that is executable
XCOMM
GetFirst()
{
let i=0
while true; do
eval "cmd=\${$1[$i]}"
[ -z "$cmd" ] && break
[ -x "${cmd%% *}" ] && echo "$cmd" && break
Log "could not start $cmd"
let i=$i+1
done
}
XCOMM
XCOMM Start first command in array named by $1 that is executable. If
XCOMM $2 is 'eval', command result will be 'eval'ed.
XCOMM
StartFirst()
{
first=$(GetFirst $1)
if [ ! -z "$first" ]; then
Log "starting $first"
if [ "$2" = "eval" ]; then
eval `eval "PATH=$DT_BINPATH:$PATH $first"`
else
eval "PATH=$DT_BINPATH:$PATH $first"
fi
fi
}
HASH
HASH Prepare for session startup
HASH
if [ "$DTSOURCEPROFILE" = "true" ]
then
case ${SHELL##*/} in
sh | ksh | dtksh) shellprofile="$HOME/.profile";;
bash) shellprofile="$HOME/.bash_profile";;
csh | tcsh) shellprofile="$HOME/.login";;
*) Log "non-standard shell $SHELL"
esac
fi
if [ "$shellprofile" -a ! -f "$shellprofile" ]
then
Log "could not read $shellprofile"
unset shellprofile
fi
if [ "$SESSIONTYPE" = "xdm" ]; then
startup=$(GetFirst xdmstart_session) # get xdm session client
StartFirst xdmstart_hello # start xdm hello client
else
startup=$(GetFirst dtstart_session) # get desktop session client
StartFirst dtstart_hello # start desktop hello client
StartFirst dtstart_searchpath eval # setup desktop search paths
tooltalk=$(GetFirst dtstart_ttsession) # get tooltalk client
dtdbcache=$(GetFirst dtstart_dtdbcache) # get dtdbcache client
#if defined(USL) || defined(sun) || defined(__uxp__)
if [ -z "$SDT_NO_DSDM" ]; then
StartFirst dtstart_dsdm # start drag and drop proxy
fi
#endif
StartFirst dtstart_appgather # setup session applications
fi
HASH
HASH Start the session.
HASH
if [ $shellprofile ]; then
Log "execing $startup using $shellprofile..."
case ${SHELL##*/} in
sh | bash | ksh | dtksh)
dotprofile_errors=`$SHELL -n $shellprofile 2>&1`
if [ "0" = "$?" ]; then
source_profile=". $shellprofile"
source_login="source $shellprofile"
else
Log "parse errors found in $shellprofile..."
Log "$dotprofile_errors"
source_profile="echo 'not execing $shellprofile due to errors'"
source_login="echo 'not execing $shellprofile due to errors'"
fi;;
*)
source_profile=". $shellprofile"
source_login="source $shellprofile";;
esac
else
Log "execing $startup..."
source_profile="echo 'not execing $HOME/.profile (see $HOME/.dtprofile)'"
source_login="echo 'not execing $HOME/.login (see $HOME/.dtprofile)'"
fi
if [ -z "$dtdbcache" ]; then
dtdbcache="echo could not start $dtstart_dtdbcache"
fi
export DT=true;
case ${SHELL##*/} in
sh | bash) $SHELL -c "$source_profile; \
unset DT; \
$dtdbcache; \
PATH=/usr/dt/bin:\$PATH $tooltalk; \
$startup > $dtstart_sessionlogfile 2>&1" ;;
ksh | dtksh) $SHELL -c "$source_profile; \
unset DT; \
$dtdbcache; \
PATH=/usr/dt/bin:\$PATH $tooltalk;\
$startup >| $dtstart_sessionlogfile 2>&1" ;;
csh | tcsh) $SHELL -c "unsetenv _ PWD; \
$source_login; \
unsetenv DT; \
$dtdbcache; \
(set path = ( $DT_BINPATH \$path ); $tooltalk ); \
$startup >&! $dtstart_sessionlogfile" ;;
*) unset DT
$dtdbcache
StartFirst dtstart_ttsession
$startup >| $dtstart_sessionlogfile 2>&1 ;;
esac
$dtdbcacherm # remove the actions/datatypes cachefile
XCOMM #################### eof #################################

View File

@@ -0,0 +1,74 @@
XCOMM!/bin/ksh
XCOMM $XConsortium: Xsetup.src /main/8 1996/07/02 11:40:32 mgreess $
XCOMM ##########################################################################
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Novell, Inc.
XCOMM
XCOMM ************** DO NOT EDIT THIS FILE **************
XCOMM
XCOMM CDE_INSTALLATION_TOP/config/Xsetup is a factory-default file and will
XCOMM be unconditionally overwritten upon subsequent installation.
XCOMM Before making changes to the file, copy it to the configuration
XCOMM directory, CDE_CONFIGURATION_TOP/config. You must also update the setup
XCOMM resource in CDE_CONFIGURATION_TOP/config/Xconfig.
XCOMM
XCOMM ##########################################################################
#if defined (_AIX)
XCOMM
XCOMM List of displays and keyboard languages
XCOMM
XCOMM This list is used to determine the keyboard language mapping for a
XCOMM particular X station. Each item in the list is a display name
XCOMM followed by a locale name to use for that display's keyboard
XCOMM language mapping. To add a new mapping, simply add a new item to
XCOMM the list. For example, if you have displays named chili:0, carp:0
XCOMM and pecos:0 with japanese, french and german keyboards, respectively,
XCOMM your KBD_MAP list would be:
XCOMM
XCOMM KBD_MAP[0]="chili:0 Ja_JP"
XCOMM KBD_MAP[1]="carp:0 Fr_FR"
XCOMM KBD_MAP[2]="pecos:0 Gr_GR"
XCOMM
XCOMM
KBD_MAP[0]=""
#endif
XCOMM ##########################################################################
XCOMM
XCOMM Directory specifications
XCOMM
XCOMM ##########################################################################
#if defined (_AIX) && defined (AIXV4)
XCOMM
XCOMM Wait for boot sequence to end (if booting)
XCOMM
if [ "$LOCATION" != "remote" ]; then
/usr/sbin/rc.bootx
fi
#endif
#ifdef sun
XDIR=/usr/openwin/bin
#else
XDIR=/usr/bin/X11
#endif
#define cpp_Xsetup
#include "_common.ksh.src"
#undef cpp_Xsetup
#ifdef sun
if [ ! -f /etc/pam.conf ]; then
if [ -f /usr/dt/config/sys.pam.conf ]; then
/bin/cp /usr/dt/config/sys.pam.conf /etc/pam.conf
/bin/chmod 644 /etc/pam.conf
fi
fi
#endif

View File

@@ -0,0 +1,66 @@
XCOMM! /bin/ksh
XCOMM ##########################################################################
XCOMM
XCOMM Xstartup
XCOMM
XCOMM Common Desktop Environment (CDE)
XCOMM
XCOMM Configuration file for the Login Manager
XCOMM
XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
XCOMM (c) Copyright 1993, 1994 Novell, Inc.
XCOMM
XCOMM ************** DO NOT EDIT THIS FILE **************
XCOMM
XCOMM CDE_INSTALLATION_TOP/config/Xstartup is a factory-default file and will
XCOMM be unconditionally overwritten upon subsequent installation.
XCOMM Before making changes to the file, copy it to the configuration
XCOMM directory, CDE_CONFIGURATION_TOP/config. You must also update the startup
XCOMM resource in CDE_CONFIGURATION_TOP/config/Xconfig.
XCOMM
XCOMM $XConsortium: Xstartup.src /main/6 1996/08/15 16:52:10 rswiston $
XCOMM
XCOMM This file is typically a shell script. It is run as "root" and should be
XCOMM very careful about security. This is the place to put commands that
XCOMM display the message of the day or do other system-level functions on
XCOMM behalf of the user. The following are the environment variables set for
XCOMM use in the script:
XCOMM
XCOMM DISPLAY, HOME, PATH, USER, SHELL, TZ (timeZone)
XCOMM
XCOMM System Administrators are encouraged to use this file as a base to run
XCOMM system-wide initialization commands with good security.
XCOMM
XCOMM ##########################################################################
XCOMM
XCOMM This script is run as root after the user is verified...
XCOMM
XCOMM dtdbcache file's directory should match
XCOMM _DTDTSMMTEMPDIR in DtSvc/DtUtil1/DtsMM.h
#ifdef __osf__
DTDBFILE=/var/tmp/dtdbcache_$DISPLAY
#else
DTDBFILE=/tmp/dtdbcache_$DISPLAY
#endif
if [ -f $DTDBFILE ]
then
/bin/rm -f $DTDBFILE
fi
if [ "$DTXSERVERLOCATION" = "local" ]
then
if [[ ! -z "$ITE" && "$ITE" != "??" && -a "/dev/$ITE" ]]
then
/bin/chown $USER /dev/$ITE
/bin/chgrp $USER_GID /dev/$ITE
fi
fi

View File

@@ -0,0 +1,469 @@
#if 0
/*
* _common.ksh.src
*
* Common Desktop Environment (CDE)
*
* Common code for dtlogin config scripts
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
* (c) Copyright 1993,1994,1996 International Business Machines Corp.
* (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
* (c) Copyright 1993,1994,1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
* (c) Copyright 1997, The Open Group.
*
* $TOG: _common.ksh.src /main/12 1998/05/13 17:48:34 rafi $
*/
#endif
#define HASH #
#if 0
/*
* Note: this file is included by Xsession.src and Xsetup.src. If
* Xsession is being built, cpp_Xsession will be defined. If Xsetup
* is being built, cpp_Xsetup will be defined.
*/
#endif
#ifdef cpp_Xsession
HASH
HASH Determine Xsession parent
HASH
#if defined (__osf__)
pexec=$(LC_TIME=C ps -p $PPID | awk 'NR==2 {print $5}')
#elif defined(USL) && (OSMAJORVERSION > 1)
pexec=$(LC_TIME=C ps -p $PPID | awk 'NR==2 {print $6}')
#else
pexec=$(LC_TIME=C /usr/bin/ps -p $PPID | awk 'NR==2 {print $4}')
#endif
Log "Xsession started by $pexec"
#endif
XCOMM ##########################################################################
XCOMM
XCOMM Append desktop font aliases to font path
XCOMM
XCOMM ##########################################################################
#if defined(sun)
ADDFONTPATH() {
HASH Combine lines together to make arguments for the xset command
FP=`awk '
BEGIN { fp="fp+ " }
/^[ ]*$/ { fp=" +fp " ; continue }
{ printf("%s%s", fp, $0) ; fp="," } ' $1`
if [ -n "$FP" ]; then
#ifdef cpp_Xsession
Log "setting auxiliary font path..."
#endif
eval "xset $FP"
fi
}
#endif /* sun */
#ifdef cpp_Xsession
if [ "${pexec##*/}" != "dtlogin" ]; then
HASH
HASH If Xsession launched by dtlogin, it is assumed that the desktop
HASH font path has already been added by Xsetup, so no need to add it here.
HASH
#endif
#if defined (sun)
if [ -r $OPENWINHOME/lib/locale/${LANG-C}/OWfontpath ]; then
ADDFONTPATH $OPENWINHOME/lib/locale/${LANG-C}/OWfontpath
fi
HASH
HASH Switch Sun's Alt and Meta mod mappings to work with Motif
HASH
if $XDIR/xmodmap | /bin/grep mod4 | /bin/grep Alt > /dev/null 2>/dev/null
then
$XDIR/xmodmap -e "clear Mod1" \
-e "clear Mod4" \
-e "add Mod1 = Alt_L" \
-e "add Mod1 = Alt_R" \
-e "add Mod4 = Meta_L" \
-e "add Mod4 = Meta_R"
fi
#endif /* sun */
HASH
HASH Append desktop font paths. Note: these directories should be
HASH accessable by the X server. The file precedence is:
HASH
HASH CDE_CONFIGURATION_TOP/config/xfonts/$LANG
HASH CDE_INSTALLATION_TOP/config/xfonts/$LANG
HASH CDE_CONFIGURATION_TOP/config/xfonts/C
HASH CDE_INSTALLATION_TOP/config/xfonts/C
HASH
#ifdef cpp_Xsession
Log "setting font path..."
#endif
#if defined (_AIX)
if [ "$DTXSERVERLOCATION" != "remote" -a -z "$XSTATION" ]; then
#else
if [ "$DTXSERVERLOCATION" != "remote" ]; then
#endif
HASH
HASH Since X server is local, optimize by checking local desktop
HASH font directories and making one call to xset.
HASH
if [ "${LANG-C}" != "C" ]; then
if [ -f CDE_CONFIGURATION_TOP/config/xfonts/$LANG/fonts.dir ]; then
fontpath=CDE_CONFIGURATION_TOP/config/xfonts/$LANG
fi
if [ -f CDE_INSTALLATION_TOP/config/xfonts/$LANG/fonts.dir ]; then
if [ -z "$fontpath" ]; then
fontpath=CDE_INSTALLATION_TOP/config/xfonts/$LANG
else
fontpath=$fontpath,CDE_INSTALLATION_TOP/config/xfonts/$LANG
fi
fi
fi
if [ -f CDE_CONFIGURATION_TOP/config/xfonts/C/fonts.dir ]; then
if [ -z "$fontpath" ]; then
fontpath=CDE_CONFIGURATION_TOP/config/xfonts/C
else
fontpath=$fontpath,CDE_CONFIGURATION_TOP/config/xfonts/C
fi
fi
if [ -f CDE_INSTALLATION_TOP/config/xfonts/C/fonts.dir ]; then
if [ -z "$fontpath" ]; then
fontpath=CDE_INSTALLATION_TOP/config/xfonts/C
else
fontpath=$fontpath,CDE_INSTALLATION_TOP/config/xfonts/C
fi
fi
if [ ! -z "$fontpath" ]; then
$XDIR/xset fp+ $fontpath
fi
else
HASH
HASH Since X server not local, we don't know if the desktop font
HASH directories exist on the X server machine, so we have to
HASH set them one at a time.
HASH
if [ "${LANG-C}" != "C" ]; then
$XDIR/xset fp+ CDE_CONFIGURATION_TOP/config/xfonts/$LANG 1>/dev/null
$XDIR/xset fp+ CDE_INSTALLATION_TOP/config/xfonts/$LANG 1>/dev/null
fi
$XDIR/xset fp+ CDE_CONFIGURATION_TOP/config/xfonts/C 1>/dev/null
$XDIR/xset fp+ CDE_INSTALLATION_TOP/config/xfonts/C 1>/dev/null
fi
#ifdef cpp_Xsession
fi
#endif
#if defined (__osf__)
#ifdef cpp_Xsetup
if [ "$DTXSERVERLOCATION" != "remote" ]; then
HASH
HASH We can only modify the font path or the keymap if the X server is
HASH local.
HASH
HASH Since X server is local, optimize by checking local desktop
HASH font directories and making one call to xset.
HASH
HASH
HASH
HASH check if the system has a Low or High Resolution Monitor
HASH - High Resolution (1280 x 1024) uses 100 dpi fonts.
HASH - Medium Resolution (1024 x 864 ) uses 75 dpi fonts.
HASH - Low Resolution (1024 x 768 or lower) uses 75 dpi fonts.
HASH This will only switch to 75dpi fonts if there is a low or medium
HASH resolution monitor found.
HASH
HASH
fd=""
prefplist=""
appfplist=""
setfont="No"
FONTLIB="/usr/lib/X11/fonts"
I18N="/usr/i18n/lib/X11/fonts/decwin"
pixwidth=`/usr/sbin/sizer -gr | awk -Fx ' { print $1 } ' `
if [ ${pixwidth} -lt 1280 ]
then
nat_res="75dpi"
alt_res="100dpi"
else
nat_res="100dpi"
alt_res="75dpi"
fi
HASH
HASH Add scalable fonts to the font path, based on
HASH screen resolution
HASH
if [ ${pixwidth} -lt 1024 ]
then
HASH
HASH Prepend fontpaths
HASH
prefplist="${FONTLIB}/Speedo ${FONTLIB}/Type1 ${FONTLIB}/Type1Adobe"
else
HASH
HASH Append fontpaths
HASH
appfplist="${FONTLIB}/Type1Adobe"
fi
HASH
HASH Append fontpaths
HASH add optional extra fonts
HASH
cde_configuration_top=CDE_CONFIGURATION_TOP
cde_installation_top=CDE_INSTALLATION_TOP
appfplist="${appfplist} ${FONTLIB}/user/${nat_res} ${FONTLIB}/user/misc"
if [ "${LANG-C}" != "C" ]; then
appfplist="${appfplist} $cde_configuration_top/config/xfonts/$LANG/$nat_res"
appfplist="${appfplist} $cde_configuration_top/config/xfonts/$LANG/$alt_res"
fi
appfplist="${appfplist} $cde_configuration_top/config/xfonts/C"
appfplist="${appfplist} $cde_configuration_top/config/xfonts/C/$nat_res"
appfplist="${appfplist} $cde_configuration_top/config/xfonts/C/$alt_res"
if [ "${LANG-C}" != "C" ]; then
appfplist="${appfplist} $cde_installation_top/config/xfonts/$LANG/$nat_res"
appfplist="${appfplist} $cde_installation_top/config/xfonts/$LANG/$alt_res"
fi
appfplist="${appfplist} $cde_installation_top/config/xfonts/C"
appfplist="${appfplist} $cde_installation_top/config/xfonts/C/$nat_res"
appfplist="${appfplist} $cde_installation_top/config/xfonts/C/$alt_res"
HASH
HASH Prepend fontpaths
HASH add i18n fonts if they exist
HASH
prefplist="${I18N}/${nat_res} ${I18N}/${alt_res} ${prefplist}"
HASH
HASH Prepend to fontpath
HASH
for i in ${prefplist}
do
if [ -f ${i}/fonts.dir ]
then
if [ $fd ]
then
fd="${fd},${i}/"
else
fd="${i}/"
setfont="Yes"
fi
fi
done
if [ ${setfont} = Yes ]
then
$XDIR/xset +fp ${fd}
if [ $? -ne 0 ]
then
HASH
HASH set the old slow way.....
HASH
for i in ${prefplist}
do
if [ -f ${i}/fonts.dir ]
then
$XDIR/xset +fp ${i}
fi
done
fi
HASH
HASH End of the setting the old slow way.........
HASH
fd=""
setfont='No'
fi
HASH
HASH Append to fontpath
HASH
for i in ${appfplist}
do
if [ -f ${i}/fonts.dir ]
then
if [ $fd ]
then
fd="${fd},${i}/"
else
fd="${i}/"
setfont="Yes"
fi
fi
done
if [ ${setfont} = Yes ]
then
$XDIR/xset fp+ ${fd}
if [ $? -ne 0 ]
then
HASH
HASH set the old slow way.....
HASH
for i in ${appfplist}
do
if [ -f ${i}/fonts.dir ]
then
$XDIR/xset fp+ ${i}
fi
done
fi
HASH
HASH End of the setting the old slow way.........
HASH
fi
fi
#endif
#endif
#if defined (_AIX)
XCOMM ##########################################################################
XCOMM
XCOMM Setup keyboard mapping for local display if required
XCOMM
XCOMM ##########################################################################
#if 0
/*
* The keyboard mapping method depends upon how the session is started:
*
* - from dtlogin with a local X server
*
* This is generally the case for the console. Since the keyboard is
* on the login server, the keyboard mapping will be done in Xsetup
* and the language will be determined via querybkd.
*
* - from dtlogin with a remote X server
*
* The is generally the case for X stations. Since the keyboard is not
* on the login server, we cannot query for the language. The keyboard
* language will thus be provided in the KBD_MAP table setup by the
* sysadmin and the keyboard mapping will be done in Xsetup.
*
* - using 'xinit /usr/dt/bin/Xsession' from an HFT/LFT
*
* Since the keyboard is local, the keyboard mapping will be done in
* Xsession and the language will be determined via querykbd.
*
* - starting Xsession from an x_st_mgr provided aixterm on an X station
*
* The X station manager sets up the keyboard mapping in this case, so
* no work is required.
*/
#endif
SetKeyboardMap()
{
HASH $1 = language name
#if defined (AIXV4)
# define cpp_KBDALTFILE "$KBD_LIST $XMODDIR/${1}@alt/keyboard"
#else
# define cpp_KBDALTFILE "$KBD_LIST $XMODDIR/$1/keyboard.alt"
#endif
KBD_LIST=""
KBD_LIST="$KBD_LIST $IMKEYMAPPATH/$1/keyboard"
if [ "$IMKEYMAPPATH" = "/usr/lib/nls/im.alt" ]; then
KBD_LIST=cpp_KBDALTFILE
fi
KBD_LIST="$KBD_LIST $XMODDIR/$1/keyboard"
for i in $KBD_LIST; do
if [ -r $i ]; then
#ifdef cpp_Xsession
Log "starting xmodmap $i"
#endif
$XDIR/xmodmap $i
return 0
fi
done
return 1
}
#ifdef cpp_Xsession
if [ "${pexec##*/}" != "dtlogin" -a -z "$XSTATION" ]; then
HASH
HASH If Xsession started by dtlogin, it is assumed that the keyboard mapping
HASH was set up in Xsetup. If Xsession not started by dtlogin, but XSTATION
HASH set, it is assumed that the keyboard mapping was set up by x_st_mgr.
HASH
#endif
#if defined (AIXV4)
# define cpp_CNAME "C"
#else
# define cpp_CNAME "C.hft"
#endif
#ifdef cpp_Xsetup
HASH
HASH Determine keyboard language
HASH
KBD_LANG=""
if [ "$DTXSERVERLOCATION" = "local" ]; then
HASH
HASH Local display so query for keyboard map
HASH
KBD_LANG=`/usr/lpp/X11/bin/querykbd`
else
HASH
HASH Non-local display so use KEY_MAP list
HASH
let i=0
while true; do
[ -z "${KBD_MAP[i]}" ] && break
if [ "$DISPLAY" = "${KBD_MAP[i]%% *}" ]; then
KBD_LANG=${KBD_MAP[i]##* }
break
fi
let i=$i+1
done
fi
#endif
#ifdef cpp_Xsession
KBD_LANG=`/usr/lpp/X11/bin/querykbd`
#endif
HASH
HASH Set up keyboard mapping
HASH
KBD=""
XMODDIR=/usr/lpp/X11/defaults/xmodmap
if [ ! -z "$KBD_LANG" ]; then
if [ "$KBD_LANG" != "NULL" -a "$KBD_LANG" != cpp_CNAME ]; then
SetKeyboardMap $KBD_LANG
if [ $? != 0 ]; then
SetKeyboardMap $LANG
fi
else
SetKeyboardMap $LANG
fi
fi
#ifdef cpp_Xsession
fi
#endif
#endif

View File

@@ -0,0 +1,22 @@
(c) Copyright 1990, Open Software Foundation, Inc.
(c)Copyright 1983-1991 Hewlett-Packard Co.
(c)Copyright 1979 The Regents of the University of Colorado, a body corporate.
(c)Copyright 1979, 1980, 1983, 1985-1990 The Regents of the Univ. of California
(c)Copyright 1980, 1984, 1986 AT&T Technologies.
(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology
(c)Copyright 1986 Digital Equipment Corp.
(c)Copyright 1990 Motorola, Inc. All Rights Reserved.
(c) Copyright 1993, 1994 Hewlett-Packard Company
(c) Copyright 1993, 1994 International Business Machines Corp.
(c) Copyright 1993, 1994 Sun Microsystems, Inc.
(c) Copyright 1993, 1994 Novell, Inc.
RESTRICTED RIGHTS LEGEND
Use, duplication or disclosure by the U.S. Government is subject to
restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
Technical Data and Computer Software clause at DFARS 252.227-7013 for DOD
agencies, and subparagraphs (c)(1) and (c)(2) of the Commercial Computer
Software Restricted Rights clause at FAR 52.227-19 for other agencies.
HEWLETT-PACKARD COMPANY
3000 Hanover Street
Palo Alto, California 94304 U.S.A.

View File

@@ -0,0 +1,42 @@
!!######################################################################
!!
!! Session database file
!!
!! Common Desktop Environment
!!
!! (c) Copyright 1995 Digital Equipment Corporation.
!! (c) Copyright 1995 Hewlett-Packard Company.
!! (c) Copyright 1995 International Business Machines Corp.
!! (c) Copyright 1995 Sun Microsystems, Inc.
!! (c) Copyright 1995 Novell, Inc.
!! (c) Copyright 1995 FUJITSU LIMITED.
!! (c) Copyright 1995 Hitachi.
!!
!! ************** DO NOT EDIT THIS FILE **************
!!
!! CDE_INSTALLATION_TOP/config/%L/Xresources.d/current.session is a
!! factory-default file and will be unconditionally overwritten
!! upon subsequent installations.
!!
!! Before making changes to the file, copy it to the configuration
!! directory, CDE_CONFIGURATION_TOP/config/%L/Xresources.d/
!!
!! $XConsortium: current.session.src /main/4 1996/04/21 20:05:09 drk $
!!
!!######################################################################
!!######################################################################
!!
!! Resources for a generic current session
!!
!! Note that %DisplayName% will be replaced with the display
!! name where dtgreet is running. For example, if the display name
!! is thrush:0 and the altDtName resource is %DisplayName%Home,
!! the session name will be "thrush:0 - Home".
!!
Dtlogin*altDtsIncrement: True
Dtlogin*altDtName: %|nls-2-#Current#|
Dtlogin*altDtKey: /usr/dt/bin/Xsession
Dtlogin*altDtStart: /usr/dt/bin/Xsession -session current

View File

@@ -0,0 +1,41 @@
!!######################################################################
!!
!! Session database file
!!
!! Common Desktop Environment
!!
!! (c) Copyright 1995 Digital Equipment Corporation.
!! (c) Copyright 1995 Hewlett-Packard Company.
!! (c) Copyright 1995 International Business Machines Corp.
!! (c) Copyright 1995 Sun Microsystems, Inc.
!! (c) Copyright 1995 Novell, Inc.
!! (c) Copyright 1995 FUJITSU LIMITED.
!! (c) Copyright 1995 Hitachi.
!!
!! ************** DO NOT EDIT THIS FILE **************
!!
!! CDE_INSTALLATION_TOP/config/%L/Xresources.d/display.current is a
!! factory-default file and will be unconditionally overwritten
!! upon subsequent installations.
!!
!! Before making changes to the file, copy it to the configuration
!! directory, CDE_CONFIGURATION_TOP/config/%L/Xresources.d/
!!
!! $XConsortium: display.current.session.src /main/4 1996/04/21 20:05:12 drk $
!!
!!######################################################################
!!######################################################################
!!
!! Resources for a display-specific current session
!!
!! Note that %DisplayName% will be replaced with the display
!! name where dtgreet is running. For example, if the display name
!! is thrush:0 and the altDtName resource is %DisplayName%Home,
!! the session name will be "thrush:0 - Home".
!!
Dtlogin*altDtsIncrement: True
Dtlogin*altDtName: %DisplayName%%|nls-2-#Current#|
Dtlogin*altDtKey: /usr/dt/bin/Xsession
Dtlogin*altDtStart: /usr/dt/bin/Xsession -session display-current

View File

@@ -0,0 +1,41 @@
!!######################################################################
!!
!! Session database file
!!
!! Common Desktop Environment
!!
!! (c) Copyright 1995 Digital Equipment Corporation.
!! (c) Copyright 1995 Hewlett-Packard Company.
!! (c) Copyright 1995 International Business Machines Corp.
!! (c) Copyright 1995 Sun Microsystems, Inc.
!! (c) Copyright 1995 Novell, Inc.
!! (c) Copyright 1995 FUJITSU LIMITED.
!! (c) Copyright 1995 Hitachi.
!!
!! ************** DO NOT EDIT THIS FILE **************
!!
!! CDE_INSTALLATION_TOP/config/%L/Xresources.d/display.home.session is
!! a factory-default file and will be unconditionally overwritten
!! upon subsequent installations.
!!
!! Before making changes to the file, copy it to the configuration
!! directory, CDE_CONFIGURATION_TOP/config/%L/Xresources.d/
!!
!! $XConsortium: display.home.session.src /main/3 1996/04/21 20:05:16 drk $
!!
!!######################################################################
!!######################################################################
!!
!! Resources for a display-specific home session
!!
!! Note that %DisplayName% will be replaced with the display
!! name where dtgreet is running. For example, if the display name
!! is thrush:0 and the altDtName resource is %DisplayName%Home,
!! the session name will be "thrush:0 - Home".
!!
Dtlogin*altDtsIncrement: True
Dtlogin*altDtName: %DisplayName%%|nls-1-#Home#|
Dtlogin*altDtKey: /usr/dt/bin/Xsession
Dtlogin*altDtStart: /usr/dt/bin/Xsession -session display-home

View File

@@ -0,0 +1,49 @@
XCOMM!/bin/ksh
XCOMM $XConsortium: dtlslocale.src /main/6 1996/11/19 11:42:40 drk $
XCOMM
XCOMM Common Desktop Environment
XCOMM
XCOMM (c) Copyright 1996 Digital Equipment Corporation.
XCOMM (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
XCOMM (c) Copyright 1993,1994,1996 International Business Machines Corp.
XCOMM (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
XCOMM (c) Copyright 1996 Novell, Inc.
XCOMM (c) Copyright 1996 FUJITSU LIMITED.
XCOMM (c) Copyright 1996 Hitachi.
XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
XCOMM Novell, Inc.
XCOMM
XCOMM Generate list of installed locales and locale desciptive names
XCOMM
(
echo "LOCALELIST" # indicate start of locale list
/usr/bin/locale -a # generate locale list
echo "LSMLELIST" # indicate start of locale information list
/usr/lib/nls/lsmle -c # generate locale information list
) |
/usr/bin/awk '
/LOCALELIST/ {state=0; next} # start of installed locale list
/LSMLELIST/ {state=1; next} # start of locale information list
state==0 { # processing locale list item
split($0, a, "\."); # split item on blank
lang[a[1]]=" " a[1]; # first element is language name
}
state==1 { # item format is: codeset desc desc [locale]
split($0, a, " "); # split item on blank
name=a[NF]; # get locale name
sub(/\[/, "", name); # strip [
sub(/\]/, "", name); # strip ]
if (name in lang) { # was locale returned by locale -a?
a[NF]=a[1]; # move codeset from front to end of array
delete a[1]; # delete old codeset element in array
lang[name]=""; # blank description
for (i in a) { # use resulting array as desciption
lang[name]=lang[name] " " a[i];
}
}
}
END {
for (i in lang) { # if locale returned by locale -a
print i lang[i]; # print "locale description"
}
}'

View File

@@ -0,0 +1,159 @@
XCOMM ##########################################################################
XCOMM #
XCOMM # .dtprofile
XCOMM #
XCOMM # user personal environment variables
XCOMM #
XCOMM # Common Desktop Environment (CDE)
XCOMM #
XCOMM # (c) Copyright 1996 Digital Equipment Corporation.
XCOMM # (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
XCOMM # (c) Copyright 1993,1994,1996 International Business Machines Corp.
XCOMM # (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
XCOMM # (c) Copyright 1993,1994,1996 Novell, Inc.
XCOMM # (c) Copyright 1996 FUJITSU LIMITED.
XCOMM # (c) Copyright 1996 Hitachi.
XCOMM #
XCOMM # SYSPROFILE COMMENT START
XCOMM #
XCOMM # ************** DO NOT EDIT THIS FILE **************
XCOMM #
XCOMM # CDE_INSTALLATION_TOP/config/sys.dtprofile is a factory-default file
XCOMM # and will be unconditionally overwritten upon subsequent installation.
XCOMM # Before making changes to the file, copy it to the configuration
XCOMM # directory, CDE_CONFIGURATION_TOP/config.
XCOMM #
XCOMM # The sys.dtprofile file is copied to $HOME/.dtprofile the first
XCOMM # time a user logs into the desktop. Any lines in sys.dtprofile
XCOMM # located between "SYSPROFILE COMMENT START" and "SYSPROFILE COMMENT END"
XCOMM # are filtered out during the copy.
XCOMM #
XCOMM # SYSPROFILE COMMENT END
XCOMM #
XCOMM # $TOG: dtprofile.src /main/5 1999/03/30 10:32:43 mgreess $
XCOMM #
XCOMM ##########################################################################
XCOMM ##########################################################################
XCOMM #
XCOMM # Your $HOME/.dtprofile is read each time you login to the Common Desktop
XCOMM # Environment (CDE) and is the place to set or override desktop
XCOMM # environment variables for your session. Environment variables set in
XCOMM # $HOME/.dtprofile are made available to all applications on the desktop.
XCOMM # The desktop will accept either sh or ksh syntax for the commands in
XCOMM # $HOME/.dtprofile.
XCOMM #
XCOMM ##########################################################################
XCOMM ##########################################################################
XCOMM #
XCOMM # Random stdout and stderr output from apps started by Session Mgr or
XCOMM # by actions via front panel or workspace menu can be directed into
XCOMM # the user's $HOME/.dt/sessionlogs directory. By default this output
XCOMM # is not recorded. Instead it is sent off to /dev/null (Unix's "nothing"
XCOMM # device).
XCOMM #
XCOMM # If this random application output is wanted (usually only wanted for
XCOMM # debugging purposes), commenting out following "dtstart_sessionlogfile"
XCOMM # lines will send output to your $HOME/.dt/sessionlogs directory.
XCOMM #
XCOMM # Alternatively, can change "/dev/null" to "/dev/console" to see this
XCOMM # debugging output on your console device. Can start a console via the
XCOMM # Workspace programs menu or via Application Mgr's Desktop Tools
XCOMM # "Terminal Console" icon.
XCOMM #
XCOMM ##########################################################################
echo "This session log file is currently disabled." > $dtstart_sessionlogfile
echo "To enable logging, edit $HOME/.dtprofile and" >> $dtstart_sessionlogfile
echo "remove dtstart_sessionlogfile=/dev/null line." >> $dtstart_sessionlogfile
export dtstart_sessionlogfile="/dev/null"
XCOMM ##########################################################################
XCOMM #
XCOMM # By default, the desktop does not read your standard $HOME/.profile
XCOMM # or $HOME/.login files. This can be changed by uncommenting the
XCOMM # DTSOURCEPROFILE variable assignment at the end of this file. The
XCOMM # desktop reads .profile if your $SHELL is "sh" or "ksh", or .login
XCOMM # if your $SHELL is "csh".
XCOMM #
XCOMM # The desktop reads the .dtprofile and .profile/.login without an
XCOMM # associated terminal emulator such as xterm or dtterm. This means
XCOMM # there is no available command line for interaction with the user.
XCOMM # This being the case, these scripts must avoid using commands that
XCOMM # depend on having an associated terminal emulator or that interact
XCOMM # with the user. Any messages printed in these scripts will not be
XCOMM # seen when you log in and any prompts such as by the 'read' command
XCOMM # will return an empty string to the script. Commands that set a
XCOMM # terminal state, such as "tset" or "stty" should be avoided.
XCOMM #
XCOMM # With minor editing, it is possible to adapt your .profile or .login
XCOMM # for use both with and without the desktop. Group the statements not
XCOMM # appropriate for your desktop session into one section and enclose them
XCOMM # with an "if" statement that checks for the setting of the "DT"
XCOMM # environment variable. When the desktop reads your .profile or .login
XCOMM # file, it will set "DT" to a non-empty value for which your .profile or
XCOMM # .login can test.
XCOMM #
XCOMM # example for sh/ksh
XCOMM #
XCOMM # if [ ! "$DT" ]; then
XCOMM # #
XCOMM # # commands and environment variables not appropriate for desktop
XCOMM # #
XCOMM # stty ...
XCOMM # tset ...
XCOMM # DISPLAY=mydisplay:0
XCOMM # ...
XCOMM # fi
XCOMM #
XCOMM # #
XCOMM # # environment variables common to both desktop and non-desktop
XCOMM # #
XCOMM # PATH=$HOME/bin:$PATH
XCOMM # MYVAR=value
XCOMM # export MYVAR
XCOMM # ...
XCOMM #
XCOMM # example for csh
XCOMM #
XCOMM # if ( ! ${?DT} ) then
XCOMM # #
XCOMM # # commands and environment variables not appropriate for desktop
XCOMM # #
XCOMM # stty ...
XCOMM # tset ...
XCOMM # setenv DISPLAY mydisplay:0
XCOMM # ...
XCOMM # endif
XCOMM #
XCOMM # #
XCOMM # # environment variables common to both desktop and non-desktop
XCOMM # #
XCOMM # setenv PATH $HOME/bin:$PATH
XCOMM # setenv MYVAR value
XCOMM # ...
XCOMM #
XCOMM # Errors in .dtprofile or .profile (.login) may prevent a successful
XCOMM # login. The login process scans .dtprofile and .profile (.login)
XCOMM # for errors (using the '-n' option to the shell). It avoids running
XCOMM # them if errors are found and prints the errors to the
XCOMM # $HOME/.dt/startlog file. However, his process is not fool proof
XCOMM # as some shells are better at finding errors thant others.
XCOMM # If after you login, your session startup terminates and you
XCOMM # are presented with the login screen, this might be the cause. If this
XCOMM # happens, select the Options->Sessions->Failsafe Session item on the
XCOMM # login screen, login and correct the error. The $HOME/.dt/startlog and
XCOMM # $HOME/.dt/errorlog files may be helpful in identifying errors.
XCOMM #
XCOMM ##########################################################################
XCOMM
XCOMM If $HOME/.profile (.login) has been edited as described above, uncomment
XCOMM the following line.
XCOMM
XCOMM DTSOURCEPROFILE=true

View File

@@ -0,0 +1,41 @@
!!######################################################################
!!
!! Session database file
!!
!! Common Desktop Environment
!!
!! (c) Copyright 1995 Digital Equipment Corporation.
!! (c) Copyright 1995 Hewlett-Packard Company.
!! (c) Copyright 1995 International Business Machines Corp.
!! (c) Copyright 1995 Sun Microsystems, Inc.
!! (c) Copyright 1995 Novell, Inc.
!! (c) Copyright 1995 FUJITSU LIMITED.
!! (c) Copyright 1995 Hitachi.
!!
!! ************** DO NOT EDIT THIS FILE **************
!!
!! CDE_INSTALLATION_TOP/config/%L/Xresources.d/home.session is a
!! factory-default file and will be unconditionally overwritten
!! upon subsequent installations.
!!
!! Before making changes to the file, copy it to the configuration
!! directory, CDE_CONFIGURATION_TOP/config/%L/Xresources.d/
!!
!! $XConsortium: home.session.src /main/3 1996/04/21 20:05:05 drk $
!!
!!######################################################################
!!######################################################################
!!
!! Resources for a generic home session
!!
!! Note that %DisplayName% will be replaced with the display
!! name where dtgreet is running. For example, if the display name
!! is thrush:0 and the altDtName resource is %DisplayName%Home,
!! the session name will be "thrush:0 - Home".
!!
Dtlogin*altDtsIncrement: True
Dtlogin*altDtName: %|nls-1-#Home#|
Dtlogin*altDtKey: /usr/dt/bin/Xsession
Dtlogin*altDtStart: /usr/dt/bin/Xsession -session home

View File

@@ -0,0 +1,64 @@
XCOMM!/bin/ksh
XCOMM $XConsortium: rc.bootx.src /main/4 1996/04/21 19:52:52 drk $
XCOMM
XCOMM COMPONENT_NAME: desktop
XCOMM
XCOMM FUNCTIONS: none
XCOMM
XCOMM ORIGINS: 27
XCOMM
XCOMM
XCOMM (C) COPYRIGHT International Business Machines Corp. 1994, 1995
XCOMM All Rights Reserved
XCOMM Licensed Materials - Property of IBM
XCOMM US Government Users Restricted Rights - Use, duplication or
XCOMM disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
XCOMM
if [ ! -f /.bootsequence ]; then
XCOMM
XCOMM boot sequence has already ended
XCOMM
return 0
fi
echo "XAUTHORITY=$XAUTHORITY" >/.bootsequence
/usr/bin/chown root.system /dev/console
XCOMM
XCOMM Start up aixconsole to display console messages and save PID
XCOMM
/usr/bin/X11/aixconsole -fg black -bg "light grey" &
XCONS_PID=$!
XCOMM
XCOMM Determine if X resolution is 1024
XCOMM This command will set the variables SCREEN_WIDTH, SCREEN_HEIGHT
XCOMM
eval `/usr/sbin/bootxutil -dpyinfo`
XCOMM
XCOMM If X resolution is 1280X1024 then display big graphic, else display small
XCOMM graphic.
XCOMM
if [ "$SCREEN_WIDTH" -eq 1280 ] ; then
/usr/bin/X11/xdi -onroot -center -border black /usr/lpp/X11/lib/X11/images/logo2.gif >/dev/null
else
/usr/bin/X11/xdi -onroot -center -border black /usr/lpp/X11/lib/X11/images/logo1.gif >/dev/null
fi
XCOMM
XCOMM wait for boot sequence to end
XCOMM
while [ -f /.bootsequence ]; do
sleep 2
done
XCOMM
XCOMM clean up...
XCOMM remove any left over backgrounds (such as logo or install_assist backdrop)
XCOMM
/usr/bin/kill $XCONS_PID
/usr/bin/X11/xsetroot -solid black

View File

@@ -0,0 +1,89 @@
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* xdm - display manager daemon
*
* $TOG: daemon.c /main/5 1998/04/06 13:21:16 mgreess $
*
* Copyright 1988 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Author: Keith Packard, MIT X Consortium
*/
#include <X11/Xos.h>
#include <sys/ioctl.h>
#ifdef hpux
#include <sys/ptyio.h>
#endif
#ifdef SVR4
#include <termio.h>
#endif
extern void exit ();
void
BecomeDaemon( void )
{
register int i;
/*
* fork so that the process goes into the background automatically. Also
* has a nice side effect of having the child process get inherited by
* init (pid 1).
*/
if (fork ()) /* if parent */
exit (0); /* then no more work to do */
/*
* Close standard file descriptors and get rid of controlling tty
*/
#ifdef __osf__
/* use setsid() instead of setpgrp() */
setsid();
#else
#if defined(SYSV) || defined (SVR4) || defined(linux)
setpgrp ();
#else
setpgrp (0, getpid());
#endif
#endif /* __osf__ */
close (0);
close (1);
close (2);
if ((i = open ("/dev/tty", O_RDWR)) >= 0) { /* did open succeed? */
#if defined(SYSV) && defined(TIOCTTY)
int zero = 0;
(void) ioctl (i, TIOCTTY, &zero);
#else
(void) ioctl (i, TIOCNOTTY, (char *) 0); /* detach, BSD style */
#endif
(void) close (i);
}
/*
* Set up the standard file descriptors.
*/
(void) open ("/", O_RDONLY); /* root inode already in core */
(void) dup2 (0, 1);
(void) dup2 (0, 2);
}

1858
cde/programs/dtlogin/dm.c Normal file

File diff suppressed because it is too large Load Diff

1010
cde/programs/dtlogin/dm.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,284 @@
/* (c) Copyright 1997 The Open Group */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* xdm - display manager daemon
*
* $TOG: dpylist.c /main/5 1997/03/14 13:44:46 barstow $
*
* Copyright 1988 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Author: Keith Packard, MIT X Consortium
*/
/*
* a simple linked list of known displays
*/
# include "dm.h"
# include "vgmsg.h"
struct display *displays;
int
AnyDisplaysLeft( void )
{
return displays != (struct display *) 0;
}
void
ForEachDisplay( void (*f)() )
{
struct display *d, *next;
for (d = displays; d; d = next) {
next = d->next;
(*f) (d);
}
}
struct display *
FindDisplayByName( char *name )
{
struct display *d;
for (d = displays; d; d = d->next)
if (!strcmp (name, d->name))
return d;
return 0;
}
struct display *
FindDisplayByPid( int pid )
{
struct display *d;
for (d = displays; d; d = d->next)
if (pid == d->pid)
return d;
return 0;
}
struct display *
FindDisplayByServerPid( int serverPid )
{
struct display *d;
for (d = displays; d; d = d->next)
if (serverPid == d->serverPid)
return d;
return 0;
}
struct display *
FindDisplayBySessionID( CARD32 sessionID )
{
struct display *d;
for (d = displays; d; d = d->next)
if (sessionID == d->sessionID)
return d;
return 0;
}
struct display *
FindDisplayByAddress(struct sockaddr *addr, int addrlen,
#if NeedWidePrototypes
int displayNumber )
#else
CARD16 displayNumber )
#endif /* NeedWidePrototypes */
{
struct display *d;
for (d = displays; d; d = d->next)
if (d->displayType.origin == FromXDMCP &&
d->displayNumber == displayNumber &&
addressEqual ((char *)d->from, d->fromlen, (char *)addr, addrlen))
{
return d;
}
return 0;
}
#define IfFree(x) if (x) free ((char *) x)
void
RemoveDisplay( struct display *old )
{
struct display *d, *p;
char **x;
int i;
extern int wakeupTime;
Debug("Removing display %s from display list.\n", old->name);
p = 0;
for (d = displays; d; d = d->next) {
if (d == old) {
if (p)
p->next = d->next;
else
displays = d->next;
IfFree (d->name);
IfFree (d->class);
for (x = d->argv; x && *x; x++)
IfFree (*x);
IfFree (d->argv);
IfFree (d->resources);
IfFree (d->xrdb);
IfFree (d->cpp);
IfFree (d->setup);
IfFree (d->startup);
IfFree (d->reset);
IfFree (d->session);
IfFree (d->userPath);
IfFree (d->systemPath);
IfFree (d->systemShell);
IfFree (d->failsafeClient);
IfFree (d->chooser);
if (d->authorizations)
{
for (i = 0; i < d->authNum; i++)
XauDisposeAuth (d->authorizations[i]);
free ((char *) d->authorizations);
}
IfFree (d->clientAuthFile);
if (d->authFile)
(void) unlink (d->authFile);
IfFree (d->authFile);
IfFree (d->userAuthDir);
IfFree (d->authNames);
IfFree (d->peer);
IfFree (d->from);
XdmcpDisposeARRAY8(&d->clientAddr);
IfFree (d->language);
IfFree (d->langList);
IfFree (d->utmpId);
IfFree (d->gettyLine);
IfFree (d->gettySpeed);
IfFree (d->environStr);
IfFree (d->verifyName);
/*
* turn off polling if we are removing a suspended display...
*/
if ( d->status == suspended )
wakeupTime = -1;
free ((char *) d);
break;
}
p = d;
}
}
struct display *
NewDisplay( char *name, char *class )
{
struct display *d;
d = (struct display *) malloc (sizeof (struct display));
if (!d) {
LogOutOfMem (ReadCatalog(MC_LOG_SET,MC_LOG_NEW_DPY,MC_DEF_LOG_NEW_DPY));
return 0;
}
d->next = displays;
d->name = malloc ((unsigned) (strlen (name) + 1));
if (!d->name) {
LogOutOfMem (ReadCatalog(MC_LOG_SET,MC_LOG_NEW_DPY,MC_DEF_LOG_NEW_DPY));
free ((char *) d);
return 0;
}
strcpy (d->name, name);
if (class)
{
d->class = malloc ((unsigned) (strlen (class) + 1));
if (!d->class) {
LogOutOfMem(
ReadCatalog(MC_LOG_SET,MC_LOG_NEW_DPY,MC_DEF_LOG_NEW_DPY));
free (d->name);
free ((char *) d);
return 0;
}
strcpy (d->class, class);
}
else
{
d->class = (char *) 0;
}
/* initialize every field to avoid possible problems */
d->argv = 0;
d->status = notRunning;
d->pid = -1;
d->serverPid = -1;
d->state = NewEntry;
d->resources = NULL;
d->xrdb = NULL;
d->cpp = NULL;
d->setup = NULL;
d->startup = NULL;
d->reset = NULL;
d->session = NULL;
d->userPath = NULL;
d->systemPath = NULL;
d->systemShell = NULL;
d->failsafeClient = NULL;
d->chooser = NULL;
d->authorize = FALSE;
d->authorizations = NULL;
d->authNum = 0;
d->authNameNum = 0;
d->clientAuthFile = NULL;
d->authFile = NULL;
d->userAuthDir = NULL;
d->authNames = NULL;
d->authNameLens = NULL;
d->openDelay = 0;
d->openRepeat = 0;
d->openTimeout = 0;
d->startAttempts = 0;
d->startTries = 0;
d->terminateServer = 0;
d->grabTimeout = 0;
d->sessionID = 0;
d->peer = 0;
d->peerlen = 0;
d->from = 0;
d->fromlen = 0;
d->displayNumber = 0;
d->useChooser = 0;
d->clientAddr.data = NULL;
d->clientAddr.length = 0;
d->language = NULL;
d->langList = NULL;
d->utmpId = NULL;
d->gettyLine = NULL;
d->gettySpeed = NULL;
d->environStr = NULL;
d->dtlite = FALSE;
d->verifyName = NULL;
d->pmSearchPath = NULL;
d->bmSearchPath = NULL;
displays = d;
return d;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
/* $XConsortium: dtgreet_main.c /main/2 1995/07/16 00:46:19 drk $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
dtgreet(argc,argv)
int argc;
char *argv[];
{
main(argc,argv);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,410 @@
$ * *
$ * (c) Copyright 1993, 1994 Hewlett-Packard Company *
$ * (c) Copyright 1993, 1994 International Business Machines Corp. *
$ * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
$ * (c) Copyright 1993, 1994 Novell, Inc. *
$ *
$ "$XConsortium: dtlogin.msg /main/6 1996/11/15 08:46:31 barstow $"
$ *************************************<+>*************************************
$ *****************************************************************************
$ **
$ ** File: dtlogin.msg
$ **
$ ** Project: CDE dtlogin
$ **
$ ** Description:
$ ** -----------
$ ** This file is the source for the message catalog for dtlogin
$ **
$ **
$ *****************************************************************************
$ **
$ ** (c) Copyright 1990 Hewlett-Packard Company
$ ** All Rights reserved
$ **
$ **
$ *****************************************************************************
$ **
$ **
$ ** ------------------------- MODIFICATION RECORD --------------------------
$ *
$ *
$ ** ----------------------- MODIFICATION RECORD END ------------------------
$ *****************************************************************************
$ *************************************<+>*************************************
$ *************************************<L>*************************************
$ ** -----------------GENERAL LOCALIZATION NOTES SECTION---------------------
$ * Comment lines begin with a $ except $set which indicates the start of a
$ * new set.
$ *
$ * Do not delete any comments; you may add comments for your use.
$ *
$ ** ----------------GENERAL LOCALIZATION NOTES SECTION END------------------
$ *************************************<L>*************************************
$set 1
$ set 1 is labels
$
$ messages 1 through 6 are button labels on the login screen
1 Please enter your user name
2 Please enter your password
3 OK
4 Start Over
5 Options
6 Help
$
$ messages 7 through 11 are options button menu items
$
7 Reset Login Screen
8 Command Line Login
9 Version...
$ message 10 is replaced by 27
10 Single-window Session
11 Language
$
$ messages 12 through 14 are miscellaneous button labels
$
12 Start DT
13 Cancel
14 Help
$
$ message 15, 17 are more option button menu items
$ message 16 is the welcome message
$
15 DT Lite Session
16 Welcome to
17 Regular Desktop
$
$ message 18-24
$
18 * Suspending Desktop Login...\r\n*\r\n
19 * Press [Enter] for a login prompt.\r\n*\r\n
20 * Log in. Desktop Login will resume shortly after you log out.\r\n*\r\n
21 * Resuming Desktop Login...\r\n*\r\n
22 * Starting Desktop Login on display %1$s...\r\n*\r\n
23 * Wait for the Desktop Login screen before logging in.\r\n*\r\n
24 * The X-server can not be started on display %1$s...\r\n*\r\n
$ messages 25 is a options button menu item
25 Session
$
$ 26 replaces 16 as the greeting after a user name has been
$ entered. The %s is replaced by the user name.
$
26 Welcome %s
$
$ 27 replaces 10 as the label for the failsafe option menu item
$
27 Failsafe Session
$
$ Sun specific message catalog id numbers in MC_LABEL_SET messages.
$ (Starting at a random uneven higher number, 73, to allow some room
$ for some shared sample source message additions.
$
73 User's Last Desktop
$
$ Following used in Language menu.
$ "to" used in phrases like "ja to zh" locales
74 to
$set 2
$ set 2 is error messages
$
1 Login incorrect; please try again.
2 Unable to change to home directory.
3 Sorry. Maximum number of users already logged in.
$ message 4 is a lengthy message that should be localized to correspond to
$ the language.
4 \n\
You need to choose an initial password for your account,\n\
or your current password has expired.\n\
\n\
After you set your password, you must log in again\n\
using the new password.
5 Login error, invalid user id.
6 Login error, invalid group id.
7 Login error, invalid audit id.
8 Login error, invalid audit flag.
9 Logins are currently disabled.
10 Only root wants to run %1$s\n
11 Rebuilding default language list from %1$s\n
12 Rescanning both config and servers files\n
13 Rereading configuration file %1$s\n
14 Rereading servers file %1$s\n
15 Rereading access file %1$s\n
16 dtlogin: out of memory in routine\n
$set 3
$ set 3 is help text
$
$ message 1 is generated when the help button on the login screen is clicked.
$ 1 \n\
$ Login Help:\n\
$ \n\
$ Use the login screen to identify yourself to the computer.\n\
$ \n\
$ To log in:\n\
$ 1) Type your user name and press <Enter> or click [OK].\n\
$ (if you have not created a user, enter "root" as the\n\
$ user name)\n\
$ 2) Type your password and press <Enter> or click [OK].\n\
$ \n\
$ [Start Over]\n\
$ Erases your entries so you can re-enter your user name and\n\
$ try again.\n\
$ \n\
$ [Options]\n\
$ Allows you to change session options:\n\
$ \n\
$ With the mouse pointer over the [Options] button, press and\n\
$ hold mouse button 1. Drag the pointer through the choices.\n\
$ Releasing the mouse button with the pointer on an item will\n\
$ select that item. You may choose:\n\
$ \n\
$ Language - to change the session language\n\
$ Session - to select preferred user Desktop\n\
$ OpenWindows Desktop - for OW \n\
$ Common Desktop Desktop - for CDE \n\
$ User's Last Desktop - from previous login \n\
$ FailSafe Session - for a single terminal window\n\
$ Command Line Login - to switch to a command line environment\n\
$ Reset Login Screen - to restart the X-server\n\
$ \n\
$ Click anywhere on the background with any mouse button to\n\
$ refresh the screen, for example, if system messages make the\n\
$ screen unreadable.\n\
$ \n\
$ For more help information, log in first, then click on the Help\n\
$ Manager icon in the Front Panel (Books with a question mark).\n\
$ Then find the Login Manager help volume.\n\
$
$ 1 NEW-
$
$ Under [Options] there is an item called "Session". Under
$ Session there are five items and these items have been
$ translated in other files. To be consistent with the other
$ translations, the translations used below should be the same
$ as the other translations. The items and their file are
$ listed below:
$
$ 1. Current - _common.session.tmsg ; set 1, message 2
$
$ 2. Home - _common.session.tmsg ; set 1, message 1
$
$ 3. <display-name> - Current - <display-name> on the options
$ menu will be replaced with the workstations display
$ name so does not need to be translated. "Current" should
$ be the same as _common.session.tmsg ; set 1, message 2
$
$ 4. <display-name> - Home - <display-name> on the options
$ menu will be replaced with the workstations display
$ name so does not need to be translated. "Home" should
$ be the same as _common.session.tmsg ; set 1, message 1
$
1 \n\
Login Help:\n\
\n\
Use the login screen to identify yourself to the computer.\n\
\n\
To log in:\n\
1) Type your user name and press <Enter> or click [OK].\n\
(if you have not created a user, enter "root" as the\n\
user name)\n\
2) Type your password and press <Enter> or click [OK].\n\
\n\
[Start Over]\n\
Erases your entries so you can re-enter your user name and\n\
try again.\n\
\n\
[Options]\n\
Allows you to change session options:\n\
\n\
With the mouse pointer over the [Options] button, press and\n\
hold mouse button 1. Drag the pointer through the choices.\n\
Releasing the mouse button with the pointer on an item will\n\
select that item. You may choose:\n\
\n\
Language - to change the session language\n\
Session - to select preferred user Desktop\n\
Current - Starts your most recent session\n\
Home - Starts your home session (if you set one)\n\
<display-name> - Current - starts your most recent session for\n\
the given display\n\
<display-name> - Home - starts your home session for\n\
the given display\n\
FailSafe Session - Starts a failsafe session.\n\
Command Line Login - to switch to a command line environment\n\
Reset Login Screen - to restart the X-server\n\
\n\
Click anywhere on the background with any mouse button to\n\
refresh the screen, for example, if system messages make the\n\
screen unreadable.\n\
\n\
For more help information, log in first, then click on the Help\n\
Manager icon that is in the Information Manager slide-up menu\n\
in the Front Panel (Book with an information symbol).\n\
Then find the Login Manager help volume.\n
$ message 2 is generated when you attempt to start a system whose id is
$ set to unknown or if it is not configured for networking.
2 \n\
Your workstation does not have a unique name. It is currently\n\
set to "unknown". It is recommended that you name this\n\
workstation.\n\
\n\
$ message 3 is generated when the help button on the chooser screen is clicked.
3 \n\
Chooser Help:\n\
\n\
Use the chooser screen to choose which server to log into.\n\
\n\
The chooser screen contains a list that has 2 parts for each\n\
entry. The first part (Server Name) contains the network\n\
name for each available server. The second part (Server\n\
Information) will contain different information depending on\n\
what login manager is being run on each server. If a server\n\
is running the CDE Desktop, it should provide information\n\
about the number of users (or tty devices) currently in use,\n\
and load averages (average CPU usage) for the last 5, 10, and\n\
15 minutes.\n\
\n\
To choose a server to log into, just select the line in the\n\
list that contains the name of the server you wish.\n\
\n\
Once you have made your selection, press the ok button.\n\
This will bring up a login screen from the server you selected.\n\
\n\
[Update List]\n\
This will clear the list and rebuild it by querying the\n\
servers on the network to see if they will allow logins.\n\
\n\
[Options]\n\
Allows you to change session options:\n\
\n\
With the mouse pointer over the [Options] button, press and\n\
hold mouse button 1. Drag the pointer through the choices.\n\
Releasing the mouse button with the pointer on an item will\n\
select that item. You may choose:\n\
\n\
Language - to change the session language\n\
Reset Login Screen - to restart the X-server\n\
\n\
Click anywhere on the background with any mouse button to\n\
refresh the screen, for example, if system messages make the\n\
screen unreadable.\n\
\n\
$set 4
$ set 4 is log error messages
$
1 Access file \"%1$s\", host \"%2$s\" not found\n
2 ReadHostEntry\n
3 Access file %1$s, display %2$s unknown\n
4 Cannot open access control file %1$s, no XDMCP reqeusts will be granted\n
5 Domain/OS authentication error: %1$s (%2$s/%3$s)
6 Can not open server authorization file %1$s\n
7 Cannot write server authorization file %1$s\n
8 saveAddr
9 Trouble getting network interface configuration
10 setAuthNumber
11 Can not lock authorization file %1$s or backup %2$s\n
12 Can not move authorization into place\n
13 Can not create/lock pid file %1$s\n
14 Can not lock pid file %1$s, another Dtlogin is running (pid %2$d)\n
15 Can not access servers file %1$s\n
16 NewDisplay
17 Can not open errorLogFile %1$s\n
18 TrimErrorLog(): maximum size of error log file is 200Kb.\n
19 Missing display name in servers file\n
20 Missing display type for %1$s\n
21 Hostname %1$s is invalid. Setting DISPLAY to ':0'\n
22 Unacceptable display type %1$s for display %2$s\n
23 Pseudo reset timed out.\n
24 GetResource
25 no space for argument realloc\n
26 Can not open configuration file %1$s\n
27 Extra arguments on command line:
28 StartServer(): no arguments\n
29 Server %1$s cannot be executed\n
30 StartServer() fork failed, sleeping\n
31 Server unexpectedly died\n
32 Hung in XOpenDisplay(%1$s) attempt #%2$d, aborting.\n
33 Server open attempt #%1$d failed for %2$s, giving up\n
34 Fatal IO error %d (%1$s)\n
35 X error\n
36 Session start failed\n
37 WARNING: display %1$s could not be secured\n
38 WARNING: keyboard on display %1$s could not be secured\n
39 BLS - Could not obtain account information.\n
40 BLS - Could not obtain protected account information.\n
41 BLS - Could not verify sensitivity level.\n
42 BLS - Could not change to user: %1$s.\n
43 AFS - setgroups() failure when starting session\n
44 Setuid failed for user %s, errno = %d\n
45 No home directory %1$s for user %2$s, using /\n
46 Session execution failed %1$s\n
47 Session has no command/arguments\n
48 Can not start session for %s, fork failed\n
49 Dtlogin can not kill client\n
50 Can not execute %1$s\n
51 Can not fork to execute %1$s\n
52 Improper authentication name \"%1$s\". Use AFS, Kerberos or the default.\n
53 Can not execute Dtgreet %1$s for %2$s\n
54 Can not fork to execute Dtgreet %1$s\n
55 Socket creation failed on port %1$d\n
56 error binding socket address %1$d, errno = %2$d\n
57 makeEnv
58 setEnv
59 parseArgs
60 Scan of %1$s directory exceeded %2$d seconds. Terminating scan...\n
61 %s belongs to more than %1$d groups, %2$s ignored\n
62 audwrite() error: caller is not superuser\n
63 audwrite() error: invalid event number in audit record.\n
64 audwrite() error: errno = %1$d\n
65 AFS authentication failure: %1$s\n
66 Account for %1$s has expired. Please see your System Administrator.\n
67 Server dead %1$s\n
68 Can't open logo bitmap file: %1$s\n
69 cannot read \"%1$s\" message catalog. Using default language.
70 display %1$s could not be initialized, server may be grabbed.\n
71 (%1$s): Login matte width exceeds display, using default. Matte units are pixels.\n
72 (%1$s) Login matte height exceeds display, using default. Matte units are pixels.\n
$set 5
$ set 5 is for other stuff specific to chooser.
1 Select a server to log into:
$ 1 is the title/instructions for the chooser dialog
2 Server Name Server Information
$ ^
$ | This needs to start in this column
$ 2 is the headings for the list
3 Update List
$set 99
$ DO NOT TRANSLATE THESE MESSAGES
$ DO NOT CHANGE THESE MESSAGES
$ DO NOT LOCALIZE THESE MESSAGES
$ These messages are used for the version information.
1 @(#)version_goes_here
2 \n@(#)_DtMessage catalog source $XConsortium: dtlogin.msg /main/6 1996/11/15 08:46:31 barstow $

View File

@@ -0,0 +1,13 @@
/* $XConsortium: dtlogin_main.c /main/2 1995/07/16 00:46:25 drk $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
dtlogin(argc,argv)
int argc;
char *argv[];
{
main(argc,argv);
}

View File

@@ -0,0 +1,423 @@
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* xdm - display manager daemon
*
* $XConsortium: error.c /main/6 1996/10/21 12:50:31 mgreess $
*
* Copyright 1988 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Author: Keith Packard, MIT X Consortium
*/
/*
* error.c
*
* Log display manager errors to a file as
* we generally do not have a terminal to talk to
*/
# include <sys/stat.h>
# include <time.h>
# include "dm.h"
# include "vgmsg.h"
# include <stdarg.h>
# define Va_start(a,b) va_start(a,b)
extern char DisplayName[];
void
InitErrorLog( void )
{
int i;
static char tz[32];
/*
* add TimeZone to our environment so error message time stamps
* have the correct value...
*/
if (timeZone != NULL && strlen(timeZone) < 29) {
strcpy(tz,"TZ=");
strcat(tz,timeZone);
putenv(tz);
}
if (errorLogFile && errorLogFile[0]) {
i = creat (errorLogFile, 0666);
if (i != -1) {
if (i != 2) {
dup2 (i, 2);
close (i);
}
} else
LogError(ReadCatalog(
MC_LOG_SET,MC_LOG_NO_ERRLOG,MC_DEF_LOG_NO_ERRLOG),
errorLogFile);
}
}
/****************************************************************************
*
* CheckErrorFile
*
* Just a quick check to verify that we can open an error log.
* Do this before we do BecomeDeamon.
*
****************************************************************************/
void
CheckErrorFile( void )
{
int i;
if (errorLogFile && errorLogFile[0]) {
i = creat (errorLogFile, 0666);
if (i != -1) {
close (i);
} else {
fprintf(stderr, (char *)ReadCatalog(
MC_LOG_SET,MC_LOG_NO_ERRLOG,MC_DEF_LOG_NO_ERRLOG),
errorLogFile);
}
} else {
fprintf(stderr, (char *)ReadCatalog(
MC_LOG_SET,MC_LOG_NO_ERRLOG,MC_DEF_LOG_NO_ERRLOG),
"\"\"");
}
}
/****************************************************************************
*
* SyncErrorFile
*
* point the stderr stream to the most current Error Log File. This allows
* the user to muck with the file while XDM is running and have everything
* sync up later.
*
* optionally, write a time stamp to the file
****************************************************************************/
int
SyncErrorFile( int stamp )
{
time_t timer;
TrimErrorFile();
if (errorLogFile && errorLogFile[0] &&
(freopen(errorLogFile, "a", stderr) != NULL)) {
if (stamp) {
timer = time(NULL);
fprintf(stderr, "\n%s", ctime(&timer));
}
return(1);
}
else
return(0);
}
/****************************************************************************
*
* TrimErrorFile
*
* Trim the length of the error log file until it is 75% of the maximum
* specified by the resource "errorLogSize".
*
****************************************************************************/
void
TrimErrorFile( void )
{
int f1, f2;
int deleteBytes;
char buf[BUFSIZ];
char *p;
int n;
off_t status;
struct stat statb;
/*
* convert user-specified units of 1Kb to bytes...
* put an upper cap of 200Kb on the file...
*/
if (errorLogSize < 1024) errorLogSize *= 1024;
if (errorLogSize > (200*1024) ) {
errorLogSize = 200*1024;
LogError(ReadCatalog(
MC_LOG_SET,MC_LOG_MAX_LOGFILE,MC_DEF_LOG_MAX_LOGFILE));
}
if ( errorLogFile && errorLogFile[0] &&
(stat(errorLogFile, &statb) == 0) &&
(statb.st_size > errorLogSize) ) {
deleteBytes = (statb.st_size - errorLogSize) + (errorLogSize / 4);
Debug("TrimErrorLog(): discarding oldest %d bytes from logfile %s\n",
deleteBytes, errorLogFile);
/*
* get two pointers to the file...
*/
if ( (f1 = open(errorLogFile, O_RDWR)) < 0 ||
(f2 = open(errorLogFile, O_RDWR)) < 0 ) {
Debug("TrimErrorLog(): Cannot open file %s, error number = %d\n",
errorLogFile, errno);
return;
}
/*
* position read pointer to the first full line after the trim
* point...
*/
if ( (status = lseek(f2, deleteBytes, SEEK_SET)) < 0 ) {
Debug("TrimErrorLog(): Cannot lseek() in file %s, error number = %d\n",
errorLogFile, errno);
return;
}
n = read(f2, buf, BUFSIZ);
if ( (p = strchr(buf,'\n')) != NULL ) {
p++;
n -= p - buf;
deleteBytes += p - buf;
}
else {
p = buf;
}
/*
* shift bytes to be saved to the beginning of the file...
*/
write (f1, p, n);
while ( (n = read(f2, buf, BUFSIZ)) > 0 )
write(f1, buf, n);
/*
* truncate file to new length and close file pointers...
*/
truncate(errorLogFile, statb.st_size - deleteBytes);
close(f1);
close(f2);
}
}
/****************************************************************************
*
* LogInfo
*
* Write an information message to the log file
*
****************************************************************************/
void
LogInfo( unsigned char *fmt, ...)
{
va_list args;
Va_start(args,fmt);
if ( SyncErrorFile(1) ) {
fprintf (stderr, "info (pid %ld): ", (long)getpid());
vfprintf (stderr, (char *)fmt, args);
fflush (stderr);
}
va_end(args);
}
/****************************************************************************
*
* LogError
*
* Write an error message to the log file.
*
****************************************************************************/
void
LogError( unsigned char *fmt, ...)
{
va_list args;
Va_start(args,fmt);
if ( SyncErrorFile(1) ) {
fprintf (stderr, "error (pid %ld): ", (long)getpid());
vfprintf (stderr, (char *)fmt, args);
fflush (stderr);
}
va_end(args);
}
/****************************************************************************
*
* LogOutOfMem
*
* Write an "out of memory" message to the log file.
*
****************************************************************************/
void
LogOutOfMem( unsigned char *fmt, ...)
{
va_list args;
Va_start(args,fmt);
if ( SyncErrorFile(1) ) {
fprintf(stderr,(char *)ReadCatalog(MC_ERROR_SET,MC_NO_MEMORY,MC_DEF_NO_MEMORY));
vfprintf (stderr, (char *)fmt, args);
fflush (stderr);
}
va_end(args);
}
/***************************************************************************
*
* CODE DISABLED!!! The following routines...
*
* getLocalAddress()
* scanHostList()
* indirectAlias()
* ForEachMatchingIndirectHost()
* UseChooser()
* ForEachChooserHost()
*
* are disabled until indirect queries are supported...
*
***************************************************************************/
#if 0
/****************************************************************************
*
* LogPanic
*
* Write a panic message to the log file.
*
****************************************************************************/
void
LogPanic( char *fmt, ...)
{
va_list args;
Va_start(args,fmt);
if ( SyncErrorFile(1) ) {
fprintf (stderr, "panic (pid %ld): ", (long)getpid());
vfprintf (stderr, fmt, args);
fflush (stderr);
}
va_end(args);
}
/****************************************************************************
*
* Panic
*
* Write a panic message to the console
*
****************************************************************************/
int
Panic( char *mesg )
{
int i;
i = creat ("/dev/console", 0666);
write (i, "panic: ", 7);
write (i, mesg, strlen (mesg));
exit (1);
}
#endif /* DISABLED CODE */
/****************************************************************************
*
* Debug
*
* Write a debug message to stdout
*
****************************************************************************/
static int DoName=True;
void
Debug( char *fmt, ...)
{
va_list args;
Va_start(args,fmt);
if (debugLevel > 0)
{
if ( strlen(DisplayName) > 0 && DoName)
fprintf(stdout, "(%s) ", DisplayName);
vprintf (fmt, args);
fflush (stdout);
/*
* don't prepend the display name next time if this debug message
* does not contain a "new line" character...
*/
if ( strchr(fmt,'\n') == NULL )
DoName=False;
else
DoName=True;
}
va_end(args);
}

385
cde/programs/dtlogin/file.c Normal file
View File

@@ -0,0 +1,385 @@
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* xdm - display manager daemon
*
* $XConsortium: file.c /main/4 1995/10/27 16:13:19 rswiston $
*
* Copyright 1988 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Author: Keith Packard, MIT X Consortium
*/
/*
* file.c
*/
# include "dm.h"
# include "vgmsg.h"
# include <ctype.h>
# include <signal.h>
# include <pwd.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netdb.h>
/***************************************************************************
*
* Local procedure declarations
*
***************************************************************************/
static int DisplayTypeMatch( DisplayType d1, DisplayType d2) ;
static void freeArgs( char **args) ;
static void freeSomeArgs( char **args, int n) ;
static DisplayType parseDisplayType( char *string, int *usedDefaultType, int *parse_uid) ;
static char ** splitIntoWords( char *s) ;
static char ** copyArgs( char **args) ;
/***************************************************************************
*
* main
*
***************************************************************************/
static int
DisplayTypeMatch( DisplayType d1, DisplayType d2 )
{
return d1.location == d2.location &&
d1.lifetime == d2.lifetime &&
d1.origin == d2.origin;
}
static void
freeArgs( char **args )
{
char **a;
for (a = args; *a; a++)
free (*a);
free ((char *) args);
}
static char **
splitIntoWords( char *s )
{
char **args, **newargs;
char *wordStart;
int nargs;
args = 0;
nargs = 0;
while (*s)
{
while (*s && isspace (*s))
++s;
if (!*s || *s == '#')
break;
wordStart = s;
while (*s && *s != '#' && !isspace (*s))
++s;
if (!args)
{
args = (char **) malloc (2 * sizeof (char *));
if (!args)
return NULL;
}
else
{
newargs = (char **) realloc ((char *) args,
(nargs+2)*sizeof (char *));
if (!newargs)
{
freeArgs (args);
return NULL;
}
args = newargs;
}
args[nargs] = malloc (s - wordStart + 1);
if (!args[nargs])
{
freeArgs (args);
return NULL;
}
strncpy (args[nargs], wordStart, s - wordStart);
args[nargs][s-wordStart] = '\0';
++nargs;
args[nargs] = NULL;
}
return args;
}
static char **
copyArgs( char **args )
{
char **a, **new, **n;
for (a = args; *a; a++)
;
new = (char **) malloc ((a - args + 1) * sizeof (char *));
if (!new)
return NULL;
n = new;
a = args;
while (*n++ = *a++)
;
return new;
}
static void
freeSomeArgs( char **args, int n )
{
char **a;
a = args;
while (n--)
free (*a++);
free ((char *) args);
}
int
ParseDisplay( char *source,
DisplayType *acceptableTypes,
int numAcceptable,
struct passwd *puser)
{
char **args, **argv, **a;
char *name, *class, *type;
struct display *d;
int usedDefaultType;
int parse_uid;
DisplayType displayType;
char *device=NULL; /* ITE device associated with display */
args = splitIntoWords (source);
if (!args)
return;
if (!args[0])
{
LogError(ReadCatalog(MC_LOG_SET,MC_LOG_MISS_NAME,MC_DEF_LOG_MISS_NAME));
freeArgs (args);
return;
}
name = args[0];
if (!args[1])
{
LogError(ReadCatalog(MC_LOG_SET,MC_LOG_MISS_TYPE,MC_DEF_LOG_MISS_TYPE),
args[0]);
freeArgs (args);
return;
}
/*
* strip off display device if found in second field...
*/
if ( (device = strchr(args[1],'@')) != NULL) {
*device = '\0';
device++;
}
displayType = parseDisplayType (args[1], &usedDefaultType, &parse_uid);
class = NULL;
type = args[1];
argv = args + 2;
/*
* check for special syntax "*" and expand to host name.
* if hostname cannot be found in a database, assume invalid and
* delete.
*/
if ( strcmp(name, "*") == 0) {
char tname[128];
struct hostent *hostent;
strcpy(tname,"");
gethostname(tname, sizeof(tname));
if ( (hostent = gethostbyname(tname)) == NULL ) {
LogError(
ReadCatalog(MC_LOG_SET,MC_LOG_INV_HOSTNM,MC_DEF_LOG_INV_HOSTNM),
tname);
strcpy(tname,"");
}
/*
else
strcpy(tname,hostent->h_name);
*/
strcat(tname, ":0");
name = tname;
}
/*
* extended syntax; if the second argument doesn't
* exactly match a legal display type and the third
* argument does, use the second argument as the
* display class string
*/
if (usedDefaultType && args[2])
{
/*
* strip off display device if found in third field...
*/
if ( device == NULL && (device = strchr(args[2],'@')) != NULL) {
*device = '\0';
device++;
}
displayType = parseDisplayType (args[2], &usedDefaultType, &parse_uid);
if (!usedDefaultType)
{
class = args[1];
type = args[2];
argv = args + 3;
}
}
/*
* extended syntax; if the display type argument was
* "local_uid", then next argument is pseudo user id
* under which the local Xserver is to be run.
*/
if (parse_uid) {
struct passwd *p;
Debug("Xservers 'local_uid' pseudo user = %s\n", *argv);
if ( (p = getpwnam (*argv)) != NULL) {
*puser = *p;
} else {
Debug("Could not get password entry for user name '%s'\n", *argv);
Debug("Using default pseudo user = %s\n", puser->pw_name);
}
argv = argv + 1;
} else {
Debug("Default pseudo user = %s\n", puser->pw_name);
}
while (numAcceptable)
{
if (DisplayTypeMatch (*acceptableTypes, displayType))
break;
--numAcceptable;
++acceptableTypes;
}
if (!numAcceptable)
{
LogError(ReadCatalog(
MC_LOG_SET,MC_LOG_BAD_DPYTYPE,MC_DEF_LOG_BAD_DPYTYPE),
type, name);
}
/*
* see if this display is already being managed...
*/
d = FindDisplayByName (name);
if (d)
{
d->state = OldEntry;
if (class && strcmp (d->class, class))
{
char *newclass;
newclass = malloc ((unsigned) (strlen (class) + 1));
if (newclass)
{
free (d->class);
strcpy (newclass, class);
d->class = newclass;
}
}
Debug ("Found existing display: %s %s %s", d->name, d->class ? d->class : "", type);
freeArgs (d->argv);
}
else
{
d = NewDisplay (name, class);
Debug ("Found new display: %s %s %s", d->name, d->class ? d->class : "", type);
}
d->displayType = displayType;
d->argv = copyArgs (argv);
for (a = d->argv; a && *a; a++)
Debug (" %s", *a);
Debug ("\n");
/*
* add device to display information...
*/
if ( device != NULL && strlen(device) != 0 ) {
if (d->gettyLine != NULL)
free(d->gettyLine);
d->gettyLine = strdup(device);
}
if (d->gettyLine &&
(strcmp(d->gettyLine, "None") == 0 ||
strcmp(d->gettyLine, "none") == 0 ) ) {
strcpy(d->gettyLine,"??");
}
freeSomeArgs (args, argv - args);
}
static struct displayMatch {
char *name;
DisplayType type;
} displayTypes[] = {
"local", { Local, Permanent, FromFile },
"local_uid", { Local, Permanent, FromFile },
"foreign", { Foreign, Permanent, FromFile },
0, { Local, Permanent, FromFile },
};
static DisplayType
parseDisplayType( char *string, int *usedDefaultType, int *parse_uid )
{
struct displayMatch *d;
*parse_uid = 0;
for (d = displayTypes; d->name; d++) {
if (strcmp(d->name, string) == 0)
{
if (strcmp(d->name, "local_uid") == 0) {
*parse_uid = 1;
}
*usedDefaultType = 0;
return d->type;
}
}
*usedDefaultType = 1;
return d->type;
}

View File

@@ -0,0 +1,296 @@
/* $XConsortium: fontpath.c /main/4 1995/10/27 16:13:29 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
** fontpath.c - font path modification routines
**
** $fontpath.c,v 1.1 93/06/24 14:52:10 bill Exp $
**
** Copyright 1993 Hewlett-Packard Company
*/
# include "dm.h"
# include <signal.h>
# include <X11/Xatom.h>
# include <setjmp.h>
# include <utmp.h>
# include "vgproto.h"
/*
** Prototypes
*/
int ApplyFontPathMods( struct display *d, Display *dpy );
void GetSysParms( char **tzpp, char **fhpp, char **ftpp );
static int PathInPList(char *path, char **fplist, int listlen);
static int PathInZList(char *path, char *fplist, int listlen);
static int SeparateParts( char **path );
static
DebugFontPath(char *note, char **path, int nelems)
{
int i;
Debug(" %s: %d elements\n",note,nelems);
for (i=0; i<nelems; i++)
Debug(" %s\n",path[i]);
}
static int
ErrorHandler(Display *dpy, XErrorEvent *event)
{
XmuPrintDefaultErrorMessage(dpy, event, stderr);
return 0; /* nonfatal */
}
/* ________________________________________________________________
**| |
**| ApplyFontPathMods(d) - |
**| |
**| If new font path mods are mandated, fabricate and apply |
**| an appropriate new complete X server font path. |
**| |
**| Specify: d = pointer to display structure |
**| |
**| Returns: nothing |
**|________________________________________________________________|
*/
int
ApplyFontPathMods( struct display *d, Display *dpy )
{
FILE *fin;
char *s,*t;
char *fph = NULL;
char *fpt = NULL;
char **fontPath,**newList;
int numHeads = 0;
int numTails = 0;
int i,j,k,numPaths;
Debug("ApplyFontPathMods() for %s\n",d->name);
if (d->displayType.location == Foreign) {
Debug(" Foreign display\n");
return;
}
if (!(fontPath=XGetFontPath(dpy, &numPaths))) {
Debug(" Can't get font path\n");
return;
}
/*
** Font path mods can come from (in priority order):
**
** 1. FONT_PATH_HEAD/TAIL definitions in /etc/src.sh
** 2. fontPathHead/Tail resources
*/
GetSysParms(0,&fph,&fpt);
if (fph) { s = "sys parm file"; }
else if (fpHead) { s = "resource"; fph = strdup(fpHead); }
if (fph && !*fph) { free(fph); fph = NULL; }
if (fph) Debug(" +fp (%s) %s\n",s,fph);
if (fpt) { s = "sys parm file"; }
else if (fpTail) { s = "resource"; fpt = strdup(fpTail); }
if (fpt && !*fpt) { free(fpt); fpt = NULL; }
if (fpt) Debug(" fp+ (%s) %s\n",s,fpt);
/*
** Break up fph and fpt into constituent parts and
** then reconstruct the complete, modified font path.
** During reconstruction we also eliminate redundancies.
*/
numHeads = SeparateParts(&fph);
numTails = SeparateParts(&fpt);
if (numHeads || numTails) {
newList = (char **) malloc((numHeads+numPaths+numTails)
* sizeof(char *));
if (newList) {
for (s=fph, i=j=0; j<numHeads; j++) {
if (!PathInPList(s,newList,i))
newList[i++] = s;
while (*s) s++; s++;
}
for (j=0; j<numPaths; j++) {
if (!PathInPList(fontPath[j],newList,i) &&
!PathInZList(fontPath[j],fpt,numTails)) {
newList[i++] = fontPath[j];
}
}
for (s=fpt, j=0; j<numTails; j++) {
if (!PathInPList(s,newList,i))
newList[i++] = s;
while (*s) s++; s++;
}
if (debugLevel > 0)
DebugFontPath("Request (XSetFontPath)",newList,i);
/*
** Tell X server to set new font path now. Log failure,
** but don't let it be fatal. (Note that caller should
** reset error handler to elsewhere when we return.)
*/
(void)XSetErrorHandler(ErrorHandler);
XSetFontPath(dpy, newList, i);
XSync(dpy, True);
free(newList);
if (debugLevel > 0) {
newList = XGetFontPath(dpy, &i);
DebugFontPath("Confirm (XGetFontPath)",newList,i);
XFreeFontPath(newList);
}
}
}
if (fph) free(fph);
if (fpt) free(fpt);
XFreeFontPath(fontPath);
}
/* ___________________________________________________________________
**| |
**| PathInPList(path,fplist,listlen) - |
**| |
**| Determine if a specific fontpath element is in a list, |
**| taking into account that identical elements may be formed |
**| differently (with multiple embedded and trailing slashes). |
**| |
**| Specify: (char *)path = the single element to be tested |
**| (char **)fplist = list of ptrs to asciz elements |
**| (int)listlen = number of pointers in the list |
**| |
**| Returns: TRUE if element is in the list |
**|___________________________________________________________________|
*/
static int
PathInPList(char *path, char **fplist, int listlen)
{
char *s,*t;
while (listlen-- > 0) {
for (s=path, t=fplist[listlen]; *s && (*s == *t); ) {
t++; while (*t == '/') t++;
s++; while (*s == '/') s++;
}
if (!*s && !*t) return 1;
}
return 0;
}
/* ___________________________________________________________________
**| |
**| PathInZList(path,fplist,listlen) - |
**| |
**| Determine if a specific fontpath element is in a list, |
**| taking into account that identical elements may be formed |
**| differently (with multiple embedded and trailing slashes). |
**| |
**| Specify: (char *)path = the single element to be tested |
**| (char *)fplist = list of concatenated asciz elements |
**| (int)listlen = number of elements in the list |
**| |
**| Returns: TRUE if element is in the list |
**|___________________________________________________________________|
*/
static int
PathInZList(char *path, char *fplist, int listlen)
{
char *s,*t;
for (t=fplist; listlen > 0; listlen--) {
for (s=path; *s && (*s == *t); ) {
t++; while (*t == '/') t++;
s++; while (*s == '/') s++;
}
if (!*s && !*t) return 1;
while (*t) t++; t++;
}
return 0;
}
/* ________________________________________________________________
**| |
**| SeparateParts(path) |
**| |
**| Break a comma-delimited asciz path string into its |
**| separate asciz constituent parts. |
**| |
**| Specify: path = ptr to asciz path string (e.g., "as,df,jk") |
**| |
**| Returns: number of constituent parts, with path string |
**| converted into as many sequential asciz strings |
**| (e.g., "as\0df\0jk"). |
**|________________________________________________________________|
*/
static int
SeparateParts( char **path )
{
char *t,*s;
int nparts = 0;
if (path && *path)
for (s=*path; t=strtok(s,","); s=NULL, nparts++);
return nparts;
}
/* ___________________________________________________________________
**| |
**| GetSysParms(tzpp,fhpp,ftpp) - |
**| |
**| Extract TZ, FONT_PATH_HEAD, and FONT_PATH_TAIL definitions |
**| from the sys parms file (typically /etc/src.sh). |
**| |
**| Specify: (char **)tzpp = where to put ptr to TZ string |
**| (char **)fhpp = where to put ptr to FONT_PATH_HEAD |
**| (char **)ftpp = where to put ptr to FONT_PATH_TAIL |
**| |
**| Specify a NULL (char **) for any undesired strings. |
**| |
**| Returns: Appropriate pointers to malloc'ed strings (NULL pointer |
**| if a string is neither requested nor defined). |
**|___________________________________________________________________|
*/
void
GetSysParms( char **tzpp, char **fhpp, char **ftpp )
{
FILE *fin;
char *s,*t,buf[256];
if (tzpp) *tzpp = NULL;
if (fhpp) *fhpp = NULL;
if (ftpp) *ftpp = NULL;
if ((*sysParmsFile != '/') || !(fin=fopen(sysParmsFile,"r"))) {
Debug("(GetSysParms) Can't open sys parms file\n");
return;
}
Debug("(GetSysParms) Reading sys parms file\n");
while (fgets(buf,255,fin)) {
for (t=buf; *t && *t<=' '; t++); /* t -> EOS or nonblank */
if (!*t || *t=='#') continue; /* ignore comment lines */
while (*t && *t!='\n') t++; /* t -> EOS or newline */
if (*t) *t = '\0'; /* discard newline char */
if (tzpp && !*tzpp)
if ((s=strstr(buf,"TZ=")) && (t=strtok(s+3,"; \t")))
*tzpp = (char *) strdup(t);
if (fhpp && !*fhpp)
if ((s=strstr(buf,"FONT_PATH_HEAD=")) && (t=strtok(s+15,"; \t")))
*fhpp = (char *) strdup(t);
if (ftpp && !*ftpp)
if ((s=strstr(buf,"FONT_PATH_TAIL=")) && (t=strtok(s+15,"; \t")))
*ftpp = (char *) strdup(t);
}
fclose(fin);
}

View File

@@ -0,0 +1,408 @@
/* $TOG: genauth.c /main/6 1997/03/25 12:33:13 barstow $ */
/* (c) Copyright 1997, The Open Group */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* @DEC_COPYRIGHT@
*/
/*
* HISTORY
* $Log$
* Revision 1.1.2.2 1995/04/21 13:05:23 Peter_Derr
* dtlogin auth key fixes from deltacde
* [1995/04/14 18:03:41 Peter_Derr]
*
* R6 xdm code used in dtlogin.
* [1995/04/10 16:52:31 Peter_Derr]
*
* Revision 1.1.3.3 1995/02/20 21:03:19 Peter_Derr
* merge XC fix-11
* [1995/02/20 20:13:02 Peter_Derr]
*
* Revision 1.1.3.2 1994/07/13 19:26:25 Peter_Derr
* Include Wrap.h to get definitions for XDM-AUTHENTICATION-1
* authorization mechanism.
* [1994/07/13 12:15:59 Peter_Derr]
*
* $EndLog$
*/
#ifndef lint
static char *rcsid = "@(#)$RCSfile: genauth.c $ $Revision: /main/6 $ (DEC) $Date: 1997/03/25 12:33:13 $";
#endif
/*
Copyright (c) 1988 X Consortium
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 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 X CONSORTIUM 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 X Consortium 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 X Consortium.
*/
/*
* xdm - display manager daemon
* Author: Keith Packard, MIT X Consortium
*/
# include <X11/Xauth.h>
# include <X11/Xos.h>
# include "dm.h"
#include <errno.h>
#ifdef X_NOT_STDC_ENV
#define Time_t long
extern Time_t time ();
extern int errno;
#else
#include <time.h>
#define Time_t time_t
#endif
#ifndef DONT_USE_DES
# ifndef USE_CRYPT
# ifdef AIXV3
# define USE_CRYPT
# endif
# ifdef ultrix
# define USE_CRYPT
# endif
# ifdef hpux
# define USE_CRYPT
# endif
# ifdef macII
# define USE_CRYPT
# endif
# ifdef sun
# define USE_CRYPT
# if (OSMAJORVERSION >= 4)
/* avoid strange sun crypt hackery */
# define crypt _crypt
# endif
# endif
# endif
#endif
#if !defined (DONT_USE_DES) && !defined (USE_CRYPT)
# define USE_ENCRYPT
#endif
#ifdef HASXDMAUTH
static unsigned char key[8];
#else
static long key[2];
#endif
static sumFile (char *name, long sum[2]);
#ifdef HASXDMAUTH
typedef unsigned char auth_cblock[8]; /* block size */
typedef struct auth_ks_struct { auth_cblock _; } auth_wrapper_schedule[16];
extern void _XdmcpWrapperToOddParity();
static
longtochars (l, c)
long l;
unsigned char *c;
{
c[0] = (l >> 24) & 0xff;
c[1] = (l >> 16) & 0xff;
c[2] = (l >> 8) & 0xff;
c[3] = l & 0xff;
}
static
InitXdmcpWrapper ()
{
long sum[2];
unsigned char tmpkey[8];
/*
* randomFile is and xdm resource not defined in dtlogin.
*
* if (!sumFile (randomFile, sum)) {
*/
if (!sumFile ("/dev/mem", sum)) {
sum[0] = time ((Time_t *) 0);
sum[1] = time ((Time_t *) 0);
}
longtochars (sum[0], tmpkey+0);
longtochars (sum[1], tmpkey+4);
tmpkey[0] = 0;
_XdmcpWrapperToOddParity (tmpkey, key);
}
#endif /* HASXDMAUTH */
#ifndef HASXDMAUTH
/* A random number generator that is more unpredictable
than that shipped with some systems.
This code is taken from the C standard. */
static unsigned long int next = 1;
static int
xdm_rand()
{
next = next * 1103515245 + 12345;
return (unsigned int)(next/65536) % 32768;
}
static void
xdm_srand(seed)
unsigned int seed;
{
next = seed;
}
#endif /* no HASXDMAUTH */
#ifdef USE_ENCRYPT
static
bitsToBytes (bits, bytes)
unsigned long bits[2];
char bytes[64];
{
int bit, byte;
int i;
i = 0;
for (byte = 0; byte < 2; byte++)
for (bit = 0; bit < 32; bit++)
bytes[i++] = ((bits[byte] & (1 << bit)) != 0);
}
#endif /* USE_ENCRYPT */
# define FILE_LIMIT 1024 /* no more than this many buffers */
static
sumFile (name, sum)
char *name;
long sum[2];
{
long buf[1024*2];
int cnt;
int fd;
int loops;
int reads;
int i;
int ret_status = 0;
fd = open (name, 0);
if (fd < 0) {
LogError((unsigned char *) "Cannot open randomFile \"%s\", errno = %d\n", name, errno);
return 0;
}
#ifdef FRAGILE_DEV_MEM
if (strcmp(name, "/dev/mem") == 0) lseek (fd, (off_t) 0x100000, SEEK_SET);
#endif
reads = FILE_LIMIT;
sum[0] = 0;
sum[1] = 0;
while ((cnt = read (fd, (char *) buf, sizeof (buf))) > 0 && --reads > 0) {
loops = cnt / (2 * sizeof (long));
for (i = 0; i < loops; i+= 2) {
sum[0] += buf[i];
sum[1] += buf[i+1];
ret_status = 1;
}
}
if (cnt < 0)
LogError((unsigned char *) "Cannot read randomFile \"%s\", errno = %d\n", name, errno);
close (fd);
return ret_status;
}
GenerateAuthData (auth, len)
char *auth;
int len;
{
long ldata[2];
#ifdef ITIMER_REAL
{
struct timeval now;
X_GETTIMEOFDAY (&now);
ldata[0] = now.tv_sec;
ldata[1] = now.tv_usec;
}
#else
{
long time ();
ldata[0] = time ((long *) 0);
ldata[1] = getpid ();
}
#endif /* ITIMER_REAL */
#ifdef HASXDMAUTH
{
int bit;
int i;
auth_wrapper_schedule schedule;
unsigned char tdata[8];
static int xdmcpAuthInited;
longtochars (ldata[0], tdata+0);
longtochars (ldata[1], tdata+4);
if (!xdmcpAuthInited)
{
InitXdmcpWrapper ();
xdmcpAuthInited = 1;
}
_XdmcpAuthSetup (key, schedule);
for (i = 0; i < len; i++) {
auth[i] = 0;
for (bit = 1; bit < 256; bit <<= 1) {
_XdmcpAuthDoIt (tdata, tdata, schedule, 1);
if (tdata[0] + tdata[1] & 0x4)
auth[i] |= bit;
}
}
}
#else
InitCryptoKey ();
#if defined(USE_CRYPT)
{
int i, j, k;
char *result, *crypt ();
char cdata[9];
long sdata;
for (j = 0; j < 2; j++)
{
sdata = ldata[j];
for (i = 0; i < 4; i++)
{
k = j * 4 + i;
cdata[k] = sdata & 0xff;
if (cdata[k] == 0)
cdata[k] = 1;
sdata >>= 8;
}
}
cdata[8] = '\0';
for (i = 0; i < len; i += 4)
{
result = crypt (cdata, (const char *) key);
k = 4;
if (i + k > len)
k = len - i;
for (j = 0; j < k; j++)
auth[i + j] = result[2 + j];
for (j = 0; j < 8; j++)
cdata[j] = result[2 + j];
}
}
#elif defined(USE_ENCRYPT)
{
char key_bits[64];
char data_bits[64];
int bit;
int i;
bitsToBytes (key, key_bits);
bitsToBytes (ldata, data_bits);
setkey (key_bits);
for (i = 0; i < len; i++) {
auth[i] = 0;
for (bit = 1; bit < 256; bit <<= 1) {
encrypt (data_bits, 0);
if (data_bits[bit])
auth[i] |= bit;
}
}
}
#else
{
int seed;
int value;
int i;
seed = (ldata[0] + key[0]) +
((ldata[1] + key[1]) << 16);
xdm_srand (seed);
for (i = 0; i < len; i++)
{
value = xdm_rand ();
auth[i] = (value & 0xff00) >> 8;
}
value = len;
if (value > sizeof (key))
value = sizeof (key);
memmove( (char *) key, auth, value);
}
#endif
#endif
}
#ifndef HASXDMAUTH
static int cryptoInited = 0;
int
InitCryptoKey( void )
{
char *key_file = "/dev/mem";
if (cryptoInited)
return;
/*
* If the sumFile fails to produce a result
* use the time of day.
*/
if (!sumFile (key_file, key)) {
#ifdef ITIMER_REAL
{
struct timeval now;
struct timezone zone;
gettimeofday (&now, &zone);
key[0] = now.tv_sec;
key[1] = now.tv_usec;
}
#else
{
long time ();
key[0] = time ((long *) 0);
key[1] = getpid ();
}
#endif
}
cryptoInited = 1;
}
#endif /* HASXDMAUTH */

View File

@@ -0,0 +1,126 @@
/* $TOG: mitauth.c /main/7 1997/03/25 12:03:56 barstow $ */
/* (c) Copyright 1997 The Open Group */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* @DEC_COPYRIGHT@
*/
/*
* HISTORY
* $Log$
* Revision 1.1.2.2 1995/04/21 13:05:26 Peter_Derr
* dtlogin auth key fixes from deltacde
* [1995/04/12 19:21:06 Peter_Derr]
*
* R6 xdm code with minor changes used in dtlogin to handle multiple
* authorizations.
* [1995/04/12 18:05:42 Peter_Derr]
*
* $EndLog$
*/
/*
Copyright (c) 1988 X Consortium
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 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 X CONSORTIUM 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 X Consortium 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 X Consortium.
*/
/*
* xdm - display manager daemon
* Author: Keith Packard, MIT X Consortium
*
* mitauth
*
* generate authorization keys
* for MIT-MAGIC-COOKIE-1 type authorization
*/
# include <X11/Xos.h>
# include "dm.h"
# define AUTH_DATA_LEN 16 /* bytes of authorization data */
static char auth_name[256];
static int auth_name_len;
int MitInitAuth (name_len, name)
#if NeedWidePrototypes
unsigned int name_len;
#else
unsigned short name_len;
#endif /* NeedWidePrototypes */
char *name;
{
if (name_len > 256)
name_len = 256;
auth_name_len = name_len;
memmove( auth_name, name, name_len);
return(0);
}
Xauth *
MitGetAuth (namelen, name)
#if NeedWidePrototypes
unsigned int namelen;
#else
unsigned short namelen;
#endif /* NeedWidePrototypes */
char *name;
{
Xauth *new;
new = (Xauth *) malloc (sizeof (Xauth));
if (!new)
return (Xauth *) 0;
new->family = FamilyWild;
new->address_length = 0;
new->address = 0;
new->number_length = 0;
new->number = 0;
new->data = (char *) malloc (AUTH_DATA_LEN);
if (!new->data)
{
free ((char *) new);
return (Xauth *) 0;
}
new->name = (char *) malloc (namelen);
if (!new->name)
{
free ((char *) new->data);
free ((char *) new);
return (Xauth *) 0;
}
memmove( (char *)new->name, name, namelen);
new->name_length = namelen;
GenerateAuthData (new->data, AUTH_DATA_LEN);
new->data_length = AUTH_DATA_LEN;
return new;
}

View File

@@ -0,0 +1,262 @@
/* $TOG: netaddr.c /main/5 1997/03/14 13:44:57 barstow $ */
/* (c) Copyright 1997 The Open Group */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* @DEC_COPYRIGHT@
*/
/*
* HISTORY
* $Log$
* Revision 1.1.2.2 1995/04/21 13:05:31 Peter_Derr
* dtlogin auth key fixes from deltacde
* [1995/04/12 19:21:13 Peter_Derr]
*
* R6 version used for XDMCP improvements
* [1995/04/12 18:32:12 Peter_Derr]
*
* $EndLog$
*/
/*
Copyright (c) 1991 X Consortium
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 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 X CONSORTIUM 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 X Consortium 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 X Consortium.
*/
/*
* xdm - X display manager
*
* netaddr.c - Interpretation of XdmcpNetaddr object.
*/
#include "dm.h"
#include <X11/X.h> /* FamilyInternet, etc. */
#include <sys/socket.h> /* struct sockaddr */
#include <netinet/in.h> /* struct sockaddr_in */
#ifdef UNIXCONN
#include <sys/un.h> /* struct sockaddr_un */
#endif
#ifdef DNETCONN
#include <netdnet/dn.h> /* struct sockaddr_dn */
#endif
/* given an XdmcpNetaddr, returns the socket protocol family used,
e.g., AF_INET */
int NetaddrFamily(netaddrp)
XdmcpNetaddr netaddrp;
{
#ifdef STREAMSCONN
short family = *(short *)netaddrp;
return family;
#else
return ((struct sockaddr *)netaddrp)->sa_family;
#endif
}
/* given an XdmcpNetaddr, returns a pointer to the TCP/UDP port used
and sets *lenp to the length of the address
or 0 if not using TCP or UDP. */
char * NetaddrPort(netaddrp, lenp)
XdmcpNetaddr netaddrp;
int *lenp; /* return */
{
#ifdef STREAMSCONN
*lenp = 2;
return netaddrp+2;
#else
switch (NetaddrFamily(netaddrp))
{
case AF_INET:
*lenp = 2;
return (char *)&(((struct sockaddr_in *)netaddrp)->sin_port);
default:
*lenp = 0;
return NULL;
}
#endif
}
/* given an XdmcpNetaddr, returns a pointer to the network address
and sets *lenp to the length of the address */
char * NetaddrAddress(netaddrp, lenp)
XdmcpNetaddr netaddrp;
int *lenp; /* return */
{
#ifdef STREAMSCONN
*lenp = 4;
return netaddrp+4;
#else
switch (NetaddrFamily(netaddrp)) {
#ifdef UNIXCONN
case AF_UNIX:
*lenp = strlen(((struct sockaddr_un *)netaddrp)->sun_path);
return (char *) (((struct sockaddr_un *)netaddrp)->sun_path);
#endif
#ifdef TCPCONN
case AF_INET:
*lenp = sizeof (struct in_addr);
return (char *) &(((struct sockaddr_in *)netaddrp)->sin_addr);
#endif
#ifdef DNETCONN
case AF_DECnet:
*lenp = sizeof (struct dn_naddr);
return (char *) &(((struct sockaddr_dn *)netaddrp)->sdn_add);
#endif
#ifdef AF_CHAOS
case AF_CHAOS:
#endif
default:
*lenp = 0;
return NULL;
}
#endif /* STREAMSCONN else */
}
/* given an XdmcpNetaddr, sets *addr to the network address used and
sets *len to the number of bytes in addr.
Returns the X protocol family used, e.g., FamilyInternet */
int ConvertAddr (saddr, len, addr)
XdmcpNetaddr saddr;
int *len; /* return */
char **addr; /* return */
{
int retval;
if (len == NULL)
return -1;
*addr = NetaddrAddress(saddr, len);
#ifdef STREAMSCONN
/* kludge */
if (NetaddrFamily(saddr) == 2)
retval = FamilyInternet;
#else
switch (NetaddrFamily(saddr))
{
#ifdef AF_UNSPEC
case AF_UNSPEC:
retval = FamilyLocal;
break;
#endif
#ifdef AF_UNIX
#ifndef hpux
case AF_UNIX:
retval = FamilyLocal;
break;
#endif
#endif
#ifdef TCPCONN
case AF_INET:
retval = FamilyInternet;
break;
#endif
#ifdef DNETCONN
case AF_DECnet:
retval = FamilyDECnet;
break;
#endif
#ifdef AF_CHAOS
case AF_CHAOS:
retval = FamilyChaos;
break;
#endif
default:
retval = -1;
break;
}
#endif /* STREAMSCONN else */
Debug ("ConvertAddr returning %d for family %d\n", retval,
NetaddrFamily(saddr));
return retval;
}
addressEqual (a1, len1, a2, len2)
XdmcpNetaddr a1, a2;
int len1, len2;
{
int partlen1, partlen2;
char *part1, *part2;
if (len1 != len2)
{
return FALSE;
}
if (NetaddrFamily(a1) != NetaddrFamily(a2))
{
return FALSE;
}
part1 = NetaddrPort(a1, &partlen1);
part2 = NetaddrPort(a2, &partlen2);
if (partlen1 != partlen2 || memcmp(part1, part2, partlen1) != 0)
{
return FALSE;
}
part1 = NetaddrAddress(a1, &partlen1);
part2 = NetaddrAddress(a2, &partlen2);
if (partlen1 != partlen2 || memcmp(part1, part2, partlen1) != 0)
{
return FALSE;
}
return TRUE;
}
#ifdef DEBUG
/*ARGSUSED*/
PrintSockAddr (a, len) /* Debugging routine */
struct sockaddr *a;
int len;
{
unsigned char *t, *p;
Debug ("family %d, ", a->sa_family);
switch (a->sa_family) {
#ifdef AF_INET
case AF_INET:
p = (unsigned char *) &((struct sockaddr_in *) a)->sin_port;
t = (unsigned char *) &((struct sockaddr_in *) a)->sin_addr;
Debug ("port %d, host %d.%d.%d.%d\n",
(p[0] << 8) + p[1], t[0], t[1], t[2], t[3]);
break;
}
#endif
}
#endif

View File

@@ -0,0 +1,238 @@
# $XConsortium: nlsMsgChk.txt /main/2 1996/11/11 11:30:33 drk $
# * *
# * (c) Copyright 1993, 1994 Hewlett-Packard Company *
# * (c) Copyright 1993, 1994 International Business Machines Corp. *
# * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
# * (c) Copyright 1993, 1994 Novell, Inc. *
# *
#############################################################################
#
# Component: $(TOP)/hp/rivers/dtlogin/dtlogin
#
############################################################################
# NOTE: The easiest way to reproduce the various screen images is to run the
# dtgreet client manually, rather than letting dtlogin invoke it. It
# is best if dtgreet can be pointed at a display that is only running
# the X-server, not a window manager. If that is not possible, ignore
# the window borders around the dialog boxes. They do not appear when
# the product is normally executed.
#
#
# 1. Run the X-server on some display.
#
#
# 2. Set the DISPLAY variable to the target display. Set the
# environment variable LOCATION to the string "Local".
#
# export DISPLAY=<target>
# export LOCATION=Local
#
#
# 3. Run an xclock in the background to the display.
#
# xclock &
#
#
# 4. Load the login screen resources. Replace "<language>" with the
# appropriate value of $LANG for the target language.
#
# xrdb -load -D<language> /usr/dt/config/Xresources
#
#
# 5. Run the dtgreet client.
#
# /usr/dt/bin/dtgreet -nograb <options>
#
#
# 6. Follow the instructions for each dialog
#
#
# 7. Select [Options] [Restart Server] to terminate dtgreet or hit
# CNTL-C from where it was invoked.
#
#
# 8. Repeat steps 4-7 each time the Xresources file is changed.
# Repeat steps 5-7 when only the message catalog changes.
#
#
#
# NOTE: Some of the dialogs exercise messages which are in different message
# sets. The syntax used to specify this is:
#
# (set #, msg #)
#
# Note: Each dialog has two screen dumps available, one in color and one in
# black & white. Choose the one that best fits your display...
#
#
1. Screendump file name: 1.Z 1.bw.Z
_DtMessage catalog set number: 1
_DtMessage numbers: 1 - 6, 16
Instructions: The main login matte
Run "dtgreet -nograb".
Observe the greeting below the logo, the labels on the two
login fields, and the four buttons.
2. Screendump file name: 2.Z 2.bw.Z
_DtMessage catalog set number: 2
_DtMessage numbers: 1
Instructions: The 'Invalid password' error dialog
Run "dtgreet -nograb -showerror 2".
Enter any name and password.
3. Screendump file name: 3.Z 3.bw.Z
_DtMessage catalog set number: 2
_DtMessage numbers: 2
Instructions: The 'No home directory' error dialog
Run "dtgreet -nograb -showerror 3".
Enter any character and press [Return]
4. Screendump file name: 4.Z 4.bw.Z
_DtMessage catalog set number: 2
_DtMessage number: 3
Instructions: The 'Too many users' error dialog
Run "dtgreet -nograb -showerror 4".
Enter any character and press [Return]
5. Screendump file name: 5.Z 5.bw.Z
_DtMessage catalog set number: 2
_DtMessage number: 4 (1,3) (1,13)
Instructions: The 'Expired password' error dialog
Run "dtgreet -nograb -showerror 5".
Enter any character and press [Return]
6. Screendump file name: 6.Z 6.bw.Z
_DtMessage catalog set number: 2
_DtMessage numbers: 5
Instructions: The 'Invalid user id' error dialog
Run "dtgreet -nograb -showerror 6".
Enter any character and press [Return]
7. Screendump file name: 7.Z 7.bw.Z
_DtMessage catalog set number: 2
_DtMessage numbers: 6
Instructions: The 'Invalid group id' error dialog
Run "dtgreet -nograb -showerror 7".
Enter any character and press [Return]
8. Screendump file name: 8.Z 8.bw.Z
_DtMessage catalog set number: 2
_DtMessage numbers: 7
Instructions: The 'Invalid audit id' error dialog
Run "dtgreet -nograb -showerror 8".
Enter any character and press [Return]
9. Screendump file name: 9.Z 9.bw.Z
_DtMessage catalog set number: 2
_DtMessage numbers: 8
Instructions: The 'Invalid audit flag' dialog
Run "dtgreet -nograb -showerror 9".
Enter any character and press [Return]
10. Screendump file name: 10.Z 10.bw.Z
_DtMessage catalog set number: 2
_DtMessage numbers: 9
Instructions: The 'Logins disabled' dialog
Run "dtgreet -nograb -showerror 10".
Enter any character and press [Return]
11. Screendump file name: 11.Z 11.bw.Z
_DtMessage catalog set number: 3
_DtMessage numbers: 2 (1,8) (1,12)
Instructions: The 'Unknown hostname' dialog
Run "dtgreet -nograb -showerror 11".
Enter any character and press [Return]
12. Screendump file name: 12.Z 12.bw.Z
_DtMessage catalog set number: 1
_DtMessage numbers: 7 - 11, 15, 17
Instructions: The [Options] menu
Run "dtgreet -nograb".
Press the [Options] button with the left mouse button.
Alternatively, use the tab and arrow keys to highlight the
[Options] button and press F4.
13. Screendump file name: 13.Z 13.bw.Z
_DtMessage catalog set number: 3
_DtMessage numbers: 1
Instructions: Help text
Run dtgreet and press the [Help] button with the left
mouse button.

View File

@@ -0,0 +1,140 @@
# $XConsortium: nlsREADME.txt /main/2 1996/11/11 11:30:53 drk $
# * *
# * (c) Copyright 1993, 1994 Hewlett-Packard Company *
# * (c) Copyright 1993, 1994 International Business Machines Corp. *
# * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
# * (c) Copyright 1993, 1994 Novell, Inc. *
# *
#############################################################################
#
# Component: Dtlogin
#
############################################################################
_DtMessage catalog source:
File name: dtlogin.msg
Target: /usr/lib/nls/%L/dtlogin.cat
If additional files are to be localized, for each file include:
File name: Xresources
Target: /usr/dt/config/Xresources
Purpose:
This file contains the appearance resources for the login screen. The
traditional 'app-defaults' technology is not used since these resources
are specified on a per-display rather than a per-user basis. When the
login screen is drawn, the user that will eventually log in is not yet
known.
There is only one file containing the login appearance resources to
service all languages, rather than an individual file per language.
Before the login screen is drawn, this file is scanned (with the xrdb
program) and the appropriate resources are used. The current value of
the $LANG variable is available so that language specified resources
(such as font) can be selected.
Instructions:
If the font to be used for the localized login screen is different from
the default, then an entry must be made in this file to indicate the
desired font.
At the end of the section labeled...
!!#################################################################
!!
!! FONTS
!!
1. add...
#ifdef <LANG>
where <LANG> is replaced by the value of the $LANG
variable appropriate for this language.
2. add...
Dtlogin.labelFont: <font for button labels>
Dtlogin.textFont: <font for dialog & help text>
Dtlogin.greeting.fontList: <font for greeting text>
3. add...
#endif
ex. for LANG=japanese
#ifdef japanese
Dtlogin*labelFont: jpn.16x32
Dtlogin*textFont: jpn.12x24
Dtlogin.greeting.fontList: <italic font of equivalent size>
#endif
The message catalog contains the text for the first part of the
greeting message displayed below the HP logo. This text is "Welcome
to" (set 1,16). Dtlogin appends the system name to the text to
generate the complete greeting message.
This text can be overridden by the user via a resource in the
Xresources file. The file is shipped with the resource commented out
so that the message catalog takes precedence. The resource value
should be localized identically to the message catalog.
At the end of the section labeled...
!!#################################################################
!!
!! GREETING
!!
1. add...
#ifdef <LANG>
where <LANG> is replaced by the value of the $LANG
variable appropriate for this language.
2. add...
!! Dtlogin*greeting.labelString: <Welcome to> %LocalHost%
^^^^^^^^^^
localized value
3. add...
#endif
ex. for LANG=japanese
#ifdef japanese
!! Dtlogin*greeting.labelString: <Welcome to> %LocalHost%
#endif
To test this text, remove the comment characters "!!" from the line. To
test the text in the message catalog, insert the comment characters.
The localized Xresources file along with the message catalog should be
returned to the DT development team. In addition, it may be necessary
for the customize script (run after installing a language) to contain
instructions that would append the above lines to an existing
Xresources.

View File

@@ -0,0 +1,467 @@
/* $TOG: pam_svc.c /main/5 1997/06/04 16:30:21 samborn $ */
/*******************************************************************************
**
** pam_svc.c 1.10 95/11/25
**
** Copyright 1993, 1994, 1995 Sun Microsystems, Inc. All rights reserved.
**
** This file contains procedures specific to dtlogin's use of
** PAM (Pluggable Authentication Module) security library.
**
*******************************************************************************/
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* Header Files
*/
#include <utmpx.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include <sys/param.h>
#include <pwd.h>
#include <security/pam_appl.h>
#include "pam_svc.h"
#include "dm.h"
#include "solaris.h"
/*
* Local function declarations
*/
static int login_conv(int num_msg, struct pam_message **msg,
struct pam_response **response, void *appdata_ptr);
static char* create_devname(char* short_devname);
/*
* Local structures and variables
*/
static struct pam_conv pam_conv = {login_conv, NULL};
static char *saved_user_passwd;
static pam_handle_t *pamh = NULL;
static int pam_auth_trys = 0;
/****************************************************************************
* PamInit
*
* Initialize or Update PAM datastructures.
*
****************************************************************************/
int
PamInit(char* prog_name,
char* user,
char* line_dev,
char* display_name)
{
int status=PAM_SUCCESS;
if (!pamh) {
/* Open PAM (Plugable Authentication module ) connection */
status = pam_start( prog_name, user, &pam_conv, &pamh );
if (status != PAM_SUCCESS) {
Debug("PamInit: pam_start error=%d\n", status);
pamh = NULL;
} else {
Debug("PamInit: pam_start success\n");
}
} else {
if (prog_name) pam_set_item(pamh, PAM_SERVICE, prog_name);
if (user) pam_set_item(pamh, PAM_USER, user);
}
if (status == PAM_SUCCESS) {
if (line_dev) pam_set_item(pamh, PAM_TTY, line_dev);
if (display_name) pam_set_item(pamh, PAM_RHOST, display_name);
}
return(status);
}
/****************************************************************************
* PamAuthenticate
*
* Authenticate that user / password combination is legal for this system
*
****************************************************************************/
int
PamAuthenticate ( char* prog_name,
char* display_name,
char* user_passwd,
char* user,
char* line )
{
int status;
char* user_str = user ? user : "NULL";
char* line_str = line ? line : "NULL";
char* line_dev = create_devname(line_str);
Debug("PamAuthenticate: prog_name=%s\n", prog_name);
Debug("PamAuthenticate: display_name=%s\n", display_name);
Debug("PamAuthenticate: user=%s\n", user_str);
Debug("PamAuthenticate: line=%s\n", line_str);
Debug("PamAuthenticate: line_dev=%s\n", line_dev);
if (user_passwd) {
if (strlen(user_passwd) == 0) {
Debug("PamAuthenticate: user passwd empty\n");
} else {
Debug("PamAuthenticate: user passwd present\n");
}
}
else {
Debug("PamAuthenticate: user passwd NULL\n");
/* Password challenge required for dtlogin authentication */
return(PAM_AUTH_ERR);
}
#ifdef sun
/* Solaris BSM Audit trail */
audit_login_save_host(display_name);
audit_login_save_ttyn(line_dev);
audit_login_save_port();
#endif
status = PamInit(prog_name, user, line_dev, display_name);
if (status == PAM_SUCCESS) {
struct passwd *pwd;
saved_user_passwd = user_passwd;
status = pam_authenticate( pamh, 0 );
pam_auth_trys++;
#ifdef sun
pwd = getpwnam(user);
audit_login_save_pw(pwd);
if (status != PAM_SUCCESS) {
audit_login_bad_pw();
if (status == PAM_MAXTRIES) {
pam_auth_trys = PAM_LOGIN_MAXTRIES+1;
}
if (pam_auth_trys > PAM_LOGIN_MAXTRIES) {
audit_login_maxtrys();
}
}
#endif sun
if (status != PAM_SUCCESS) {
sleep(PAM_LOGIN_SLEEPTIME);
if (pam_auth_trys > PAM_LOGIN_MAXTRIES) {
sleep(PAM_LOGIN_DISABLETIME);
}
}
};
if (status != PAM_SUCCESS) {
Debug("PamAuthenticate: PAM error=%d\n", status);
if (pamh) {
Debug("PamAuthenticate: calling pam_end\n");
pam_end(pamh, PAM_ABORT);
pamh=NULL;
}
}
return(status);
}
/****************************************************************************
* PamAccounting
*
* Work related to open and close of user sessions
****************************************************************************/
int
PamAccounting( char* prog_name,
char* display_name,
char* entry_id,
char* user,
char* line,
pid_t pid,
int entry_type,
int exitcode )
{
int session_type, status;
char *user_str = user ? user : "NULL";
char *line_str = line ? line : "NULL";
char *line_dev = create_devname(line_str);
char *tty_line;
Debug("PamAccounting: prog_name=%s\n", prog_name);
Debug("PamAccounting: display_name=%s\n", display_name);
Debug("PamAccounting: entry_id=%c %c %c %c\n", entry_id[0],
entry_id[1], entry_id[2], entry_id[3]);
Debug("PamAccounting: user=%s\n", user_str);
Debug("PamAccounting: line=%s\n", line_str);
Debug("PamAccounting: line_dev=%s\n", line_dev);
Debug("PamAccounting: pid=%d\n", pid);
Debug("PamAccounting: entry_type=%d\n", entry_type);
Debug("PamAccounting: exitcode=%d\n", exitcode);
/* Open Solaris PAM (Plugable Authentication module ) connection */
if (entry_type == ACCOUNTING) {
tty_line = line;
}
else {
tty_line = line_dev;
}
status = PamInit(prog_name, user, tty_line, display_name);
/* Session accounting */
if (status == PAM_SUCCESS) switch(entry_type) {
case USER_PROCESS:
/* New user session, open session accounting logs */
status = pam_open_session(pamh, 0);
if (status != PAM_SUCCESS) {
Debug("PamAccounting: USER_PROCESS open_session error=%d\n",
status);
}
#ifdef sun
if (status == PAM_SUCCESS) audit_login_success();
#endif
session_type = SOLARIS_LOGIN;
status = solaris_setutmp_mgmt(user, tty_line, display_name,
session_type, entry_type, entry_id);
if (status != SOLARIS_SUCCESS) {
Debug("PamAccounting: USER_PRCESS set_utmp error=%d\n",
status);
}
break;
case ACCOUNTING:
/*
* User session has terminated, mark it DEAD and close
* the sessions accounting logs.
*/
status = pam_open_session(pamh, 0);
if (status != PAM_SUCCESS) {
Debug("PamAccounting: ACCOUNTING open_session error=%d\n",
status);
}
entry_type = DEAD_PROCESS;
session_type = SOLARIS_NOLOG;
status = solaris_setutmp_mgmt(user, tty_line, display_name,
session_type, entry_type, entry_id);
if (status != SOLARIS_SUCCESS) {
Debug("PamAccounting: ACCOUNTING set_utmp error=%d\n",
status);
}
/* Intentional fall thru */
case DEAD_PROCESS:
/* Cleanup account files for dead processes */
status = pam_close_session(pamh, 0);
if (status != PAM_SUCCESS) {
Debug("PamAccounting: DEAD_PROCES close_session error=%d\n",
status);
}
status = solaris_reset_utmp_mgmt(&user, &tty_line,
&display_name, 0,
entry_type, entry_id);
if (status != SOLARIS_SUCCESS) {
Debug("PamAccounting: DEAD_PROCESS reset_utmp error=%d\n",
status);
}
break;
case LOGIN_PROCESS:
default:
status = pam_open_session(pamh, 0);
if (status != PAM_SUCCESS) {
Debug("PamAccounting:LOGIN_PROCESS open_session error=%d\n",
status);
}
session_type = 0;
status = solaris_setutmp_mgmt(user, tty_line, display_name,
session_type, entry_type, entry_id);
if (status != SOLARIS_SUCCESS) {
Debug("PamAccounting: LOGIN_PRCESS set_utmp error=%d\n",
status);
}
break;
}
free(line_dev);
return(status);
}
/****************************************************************************
* PamSetCred
*
* Set Users login credentials: uid, gid, and group lists
****************************************************************************/
int
PamSetCred(char* prog_name, char* user, uid_t uid, gid_t gid)
{
int cred_type, status;
char* user_str = user ? user : "NULL";
Debug("PamSetCred: prog_name=%s\n", prog_name);
Debug("PamSetCred: user=%s\n", user_str);
Debug("PamSetCred: uid=%d\n", uid);
Debug("PamSetCred: gid=%d\n", gid);
status = PamInit(prog_name, user, NULL, NULL);
/* Set users credentials */
if (status == PAM_SUCCESS && setgid(gid) == -1)
status = SOLARIS_BAD_GID;
if (status == PAM_SUCCESS &&
( !user) || (initgroups(user, gid) == -1) )
status = SOLARIS_INITGROUP_FAIL;
if (status == PAM_SUCCESS)
status = pam_setcred(pamh, PAM_ESTABLISH_CRED);
if (status == PAM_SUCCESS && (setuid(uid) == -1))
status = SOLARIS_BAD_UID;
if (status != PAM_SUCCESS) {
Debug("PamSetCred: user=%s, err=%d)\n", user, status);
}
return(status);
}
/***************************************************************************
* create_devname
*
* A utility function. Takes short device name like "console" and returns
* a long device name like "/dev/console"
***************************************************************************/
static char*
create_devname(char* short_devname)
{
char* long_devname;
if (short_devname == NULL)
short_devname = "";
long_devname = (char *) malloc (strlen(short_devname) + 5);
if (long_devname == NULL)
return(NULL);
strcpy(long_devname,"/dev/");
strcat(long_devname, short_devname);
return(long_devname);
}
/*****************************************************************************
* login_conv():
*
* This is a conv (conversation) function called from the PAM
* authentication scheme. It returns the user's password when requested by
* internal PAM authentication modules and also logs any internal PAM error
* messages.
*****************************************************************************/
static int
login_conv(int num_msg, struct pam_message **msg,
struct pam_response **response, void *appdata_ptr)
{
struct pam_message *m;
struct pam_response *r;
char *temp;
int k;
#ifdef lint
conv_id = conv_id;
#endif
if (num_msg <= 0)
return (PAM_CONV_ERR);
*response = (struct pam_response*)
calloc(num_msg, sizeof (struct pam_response));
if (*response == NULL)
return (PAM_CONV_ERR);
(void) memset(*response, 0, sizeof (struct pam_response));
k = num_msg;
m = *msg;
r = *response;
while (k--) {
switch (m->msg_style) {
case PAM_PROMPT_ECHO_OFF:
if (saved_user_passwd != NULL) {
r->resp = (char *) malloc(strlen(saved_user_passwd)+1);
if (r->resp == NULL) {
__pam_free_resp(num_msg, *response);
*response = NULL;
return (PAM_CONV_ERR);
}
(void) strcpy(r->resp, saved_user_passwd);
r->resp_retcode=0;
}
m++;
r++;
break;
case PAM_ERROR_MSG:
if (m->msg != NULL) {
Debug ("login_conv ERROR: %s\n", m->msg);
}
m++;
r++;
break;
case PAM_TEXT_INFO:
if (m->msg != NULL) {
Debug ("login_conv INFO: %s\n", m->msg);
}
m++;
r++;
break;
default:
Debug ("login_conv: Unexpected case %d\n",
m->msg_style);
break;
}
}
return (PAM_SUCCESS);
}

View File

@@ -0,0 +1,54 @@
/* $XConsortium: pam_svc.h /main/3 1996/10/30 11:13:40 drk $ */
/*******************************************************************************
**
** "@(#)pam_svc.h 1.4 95/09/12
**
** Copyright 1993, 1994, 1995 Sun Microsystems, Inc. All rights reserved.
**
** This file contains header info related to dtlogin use of PAM
** (Pluggable Authentication Module) library.
**
*******************************************************************************/
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
#ifndef _DTLOGIN_PAM_SVC_H
#define _DTLOGIN_PAM_SVC_H
#include <sys/types.h>
#define PAM_LOGIN_MAXTRIES 5
#define PAM_LOGIN_SLEEPTIME 4
#define PAM_LOGIN_DISABLETIME 20
/*
* External procedure declarations
*/
extern int _DtAuthentication(char*, char*, char*, char*, char*);
extern int _DtAccounting(char*, char*, char[], char*,
char*, pid_t, int, int);
extern int _DtSetCred(char*, char *, uid_t, gid_t);
extern int _DtSetDevPerm(char *, uid_t, gid_t);
extern int _DtResetDevPerm(char *);
#ifdef sun
extern int audit_login_save_host(char *host);
extern int audit_login_save_ttyn(char *ttyn);
extern int audit_login_save_port(void);
extern int audit_login_success(void);
extern int audit_login_save_pw(struct passwd *pwd);
extern int audit_login_bad_pw(void);
extern int audit_login_maxtrys(void);
#endif sun
#endif /* _DTLOGIN_PAM_SVC_H */

View File

@@ -0,0 +1,260 @@
/* (c) Copyright 1997 The Open Group */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* xdm - display manager daemon
*
* $TOG: policy.c /main/6 1997/03/14 13:45:03 barstow $
*
* Copyright 1988 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Author: Keith Packard, MIT X Consortium
*/
/*
* policy.c. Implement site-dependent policy for XDMCP connections
*/
# include "dm.h"
static ARRAY8 noAuthentication = { (CARD16) 0, (CARD8Ptr) 0 };
static ARRAY8 loopbackAddress = { (CARD16) 0, (CARD8Ptr) 0 };
typedef struct _XdmAuth {
ARRAY8 authentication;
ARRAY8 authorization;
} XdmAuthRec, *XdmAuthPtr;
XdmAuthRec auth[] = {
#ifdef HASXDMAUTH
{ {(CARD16) 20, (CARD8 *) "XDM-AUTHENTICATION-1"},
{(CARD16) 19, (CARD8 *) "XDM-AUTHORIZATION-1"},
},
#endif
{ {(CARD16) 0, (CARD8 *) 0},
{(CARD16) 0, (CARD8 *) 0},
}
};
#define NumAuth (sizeof auth / sizeof auth[0])
/***************************************************************************
*
* Local procedure declarations
*
***************************************************************************/
static char * WillingMsg( void ) ;
/******** End Local Function Declarations ********/
ARRAY8Ptr
ChooseAuthentication( ARRAYofARRAY8Ptr authenticationNames )
{
int i, j;
for (i = 0; i < authenticationNames->length; i++)
for (j = 0; j < NumAuth; j++)
if (XdmcpARRAY8Equal (&authenticationNames->data[i],
&auth[j].authentication))
return &authenticationNames->data[i];
return &noAuthentication;
}
int
CheckAuthentication( struct protoDisplay *pdpy, ARRAY8Ptr displayID,
ARRAY8Ptr name, ARRAY8Ptr data )
{
#ifdef HASXDMAUTH
if (name->length && !strncmp (name->data, "XDM-AUTHENTICATION-1", 20))
return XdmCheckAuthentication (pdpy, displayID, name, data);
#endif
return TRUE;
}
int
SelectAuthorizationTypeIndex( ARRAY8Ptr authenticationName,
ARRAYofARRAY8Ptr authorizationNames )
{
int i, j;
for (j = 0; j < NumAuth; j++)
if (XdmcpARRAY8Equal (authenticationName,
&auth[j].authentication))
break;
if (j < NumAuth)
{
for (i = 0; i < authorizationNames->length; i++)
if (XdmcpARRAY8Equal (&authorizationNames->data[i],
&auth[j].authorization))
return i;
}
for (i = 0; i < authorizationNames->length; i++)
if (ValidAuthorization (authorizationNames->data[i].length,
(char *) authorizationNames->data[i].data))
return i;
return -1;
}
#if 0
int
Willing( struct sockaddr *addr, int addrlen, ARRAY8Ptr authenticationName,
ARRAY8Ptr status )
#endif
int
Willing(
ARRAY8Ptr addr,
#if NeedWidePrototypes
int connectionType,
#else
CARD16 connectionType,
#endif /* NeedWidePrototypes */
ARRAY8Ptr authenticationName,
ARRAY8Ptr status,
xdmOpCode type )
{
static char statusBuf[256];
int ret;
#if 0
extern char *localHostname ();
#endif
ret = AcceptableDisplayAddress (addr, connectionType, type);
if (!ret)
sprintf (statusBuf, "Display not authorized to connect");
else
sprintf (statusBuf, "%s", WillingMsg());
#if 0
sprintf (statusBuf, "host %s", localHostname());
#endif
status->length = strlen (statusBuf);
status->data = (CARD8Ptr) malloc (status->length);
if (!status->data)
status->length = 0;
else
bcopy (statusBuf, (char *)status->data, status->length);
return ret;
}
ARRAY8Ptr
Accept( struct sockaddr *from, int fromlen,
#if NeedWidePrototypes
int displayNumber )
#else
CARD16 displayNumber )
#endif /* NeedWidePrototypes */
{
return 0;
}
int
SelectConnectionTypeIndex( ARRAY16Ptr connectionTypes,
ARRAYofARRAY8Ptr connectionAddresses )
{
int i;
/*
* the current selection policy is to use the first connection address
* that is not the loopback address...
*/
/*
* initialize loopback address array if not already done so...
*
*/
if (loopbackAddress.length == 0 &&
XdmcpAllocARRAY8 (&loopbackAddress, 4) ) {
loopbackAddress.data[0] = 127;
loopbackAddress.data[1] = 0;
loopbackAddress.data[2] = 0;
loopbackAddress.data[3] = 1;
}
for (i = 0; i < connectionAddresses->length; i++) {
if (!XdmcpARRAY8Equal (&connectionAddresses->data[i],
&loopbackAddress))
break;
}
return i;
}
/***************************************************************************
*
* WillingMsg
*
* Generate a message for the "Willing" status field.
*
***************************************************************************/
# define LINEBUFSIZE 32
static char *
WillingMsg( void )
{
static char retbuf[LINEBUFSIZE];
char tmpbuf[LINEBUFSIZE * 8];
char *cp;
char tmpfilename[L_tmpnam + 1];
FILE *f;
/* Return selected part from an 'uptime' to Server */
/* for use in hosts status field when XDMCP broadcast is used */
/* (useful for selecting host to be managed by) */
strcpy(retbuf, "Willing to Manage");
strcpy(tmpbuf,"uptime | ");
strcat(tmpbuf,"awk '{printf(\"%s %-.5s load: %.3s, %.3s, %.3s\",$(NF-6),$(NF-5),$(NF-2),$(NF-1),$NF)}'");
strcat(tmpbuf," > ");
if ( tmpnam(tmpfilename) != (char *)NULL ) {
strcat(tmpbuf,tmpfilename);
system(tmpbuf);
if ((f = fopen(tmpfilename,"r")) != (FILE *) NULL) {
fgets(tmpbuf,LINEBUFSIZE,f);
if ( (cp = strchr(tmpbuf,'\n')) != NULL)
*cp = '\0';
if (strlen(tmpbuf) > 10) /* seems reasonable? */
strcpy(retbuf, tmpbuf);
fclose(f);
}
unlink(tmpfilename);
}
return (retbuf);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,145 @@
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* $XConsortium: protodpy.c /main/4 1995/10/27 16:14:24 rswiston $
*
* Copyright 1989 Massachusetts Institute of Technology
*
* 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, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Keith Packard, MIT X Consortium
*/
/*
* protodpy.c
*
* manage a collection of proto-displays. These are displays for
* which sessionID's have been generated, but no session has been
* started.
*/
#include "dm.h"
struct protoDisplay *protoDisplays;
struct protoDisplay *
FindProtoDisplay( struct sockaddr *address, int addrlen,
#if NeedWidePrototypes
int displayNumber )
#else
CARD16 displayNumber )
#endif /* NeedWidePrototypes */
{
struct protoDisplay *pdpy;
for (pdpy = protoDisplays; pdpy; pdpy=pdpy->next)
if (pdpy->displayNumber == displayNumber &&
addressEqual ((char *)address, addrlen, (char *)pdpy->address, pdpy->addrlen))
{
return pdpy;
}
return (struct protoDisplay *) 0;
}
void
TimeoutProtoDisplays( long now )
{
struct protoDisplay *pdpy, *next;
for (pdpy = protoDisplays; pdpy; pdpy = next)
{
next = pdpy->next;
if (pdpy->date < now - PROTO_TIMEOUT)
DisposeProtoDisplay (pdpy);
}
}
struct protoDisplay *
NewProtoDisplay( struct sockaddr *address, int addrlen,
#if NeedWidePrototypes
int displayNumber,
int connectionType,
#else
CARD16 displayNumber,
CARD16 connectionType,
#endif /* NeedWidePrototypes */
ARRAY8Ptr connectionAddress, CARD32 sessionID )
{
struct protoDisplay *pdpy;
time_t date;
time (&date);
TimeoutProtoDisplays (date);
pdpy = (struct protoDisplay *) malloc (sizeof *pdpy);
if (!pdpy)
return NULL;
pdpy->address = (struct sockaddr *) malloc (addrlen);
if (!pdpy->address)
{
free ((char *) pdpy);
return NULL;
}
pdpy->addrlen = addrlen;
bcopy ((char *)address, (char *)pdpy->address, addrlen);
pdpy->displayNumber = displayNumber;
pdpy->connectionType = connectionType;
pdpy->date = date;
if (!XdmcpCopyARRAY8 (connectionAddress, &pdpy->connectionAddress))
{
free ((char *) pdpy->address);
free ((char *) pdpy);
return NULL;
}
pdpy->sessionID = sessionID;
pdpy->fileAuthorization = (Xauth *) NULL;
pdpy->xdmcpAuthorization = (Xauth *) NULL;
pdpy->next = protoDisplays;
protoDisplays = pdpy;
return pdpy;
}
int
DisposeProtoDisplay( struct protoDisplay *pdpy )
{
struct protoDisplay *p, *prev;
prev = 0;
for (p = protoDisplays; p; p=p->next)
{
if (p == pdpy)
break;
prev = p;
}
if (!p)
return;
if (prev)
prev->next = pdpy->next;
else
protoDisplays = pdpy->next;
XdmcpDisposeARRAY8 (&pdpy->connectionAddress);
if (pdpy->fileAuthorization)
XauDisposeAuth (pdpy->fileAuthorization);
if (pdpy->xdmcpAuthorization)
XauDisposeAuth (pdpy->xdmcpAuthorization);
free ((char *) pdpy->address);
free ((char *) pdpy);
}

View File

@@ -0,0 +1,84 @@
/* $XConsortium: qualify.c /main/3 1995/10/27 16:14:33 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
#include <stdio.h>
#include <string.h>
/*********************************************************************
* qualifyWithFirst
*
* takes: an unqualified filename like foo.txt, and
* a colon-separated list of pathnames, such as
* /etc/opt/dt:/opt/dt/config
*
* returns: a fully qualified filename. Space for the filename
* has been allocated off the heap. It is the responsibility
* of the calling function to dispose of the space.
**********************************************************************/
char * qualifyWithFirst
(
char * filename,
char * searchPath
)
{
char * paths = strdup(searchPath);
char * savepaths = paths;
char * path;
char * chance;
FILE * f;
/* assert that the arguments cannot be NULL */
if (filename == NULL || searchPath == NULL)
return NULL;
while (1) {
/* if there is a :, zero it */
if ((path = strchr(paths, ':')) != NULL)
*path = 0;
/* allocate space and create the qualified filename */
chance = (char *)malloc(strlen(paths) + strlen(filename) + 2);
sprintf(chance,"%s/%s",paths,filename);
/* see if it is there by opening it for reading */
if (f = fopen(chance,"r")) {
/* it's there so close it, .... */
fclose(f);
/* ... restore the colon, .... */
if (path)
*path = ':';
/* return the fully qualified filename */
free(savepaths);
return chance;
}
free(chance);
/* reached the end of the list of paths */
if (path == NULL)
break;
/* try the next path */
paths = path + 1;
}
free(savepaths);
return NULL;
}

View File

@@ -0,0 +1,127 @@
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* xdm - display manager daemon
*
* $XConsortium: reset.c /main/4 1995/10/27 16:14:40 rswiston $
*
* Copyright 1988 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Author: Keith Packard, MIT X Consortium
*/
/*
* pseudoReset -- pretend to reset the server by killing all clients
* with windows. It will reset the server most of the time, unless
* a client remains connected with no windows.
*/
# include <setjmp.h>
# include <sys/signal.h>
# include "dm.h"
# include "vgmsg.h"
/***************************************************************************
*
* Local procedure declarations
*
***************************************************************************/
static SIGVAL abortReset( int arg ) ;
static int ignoreErrors( Display *dpy, XErrorEvent *event) ;
static void killWindows( Display *dpy, Window window) ;
/***************************************************************************
*
*
*
***************************************************************************/
/*ARGSUSED*/
static int
ignoreErrors( Display *dpy, XErrorEvent *event )
{
Debug ("Ignoring error...\n");
return 1;
}
/*
* this is mostly bogus -- but quite useful. I wish the protocol
* had some way of enumerating and identifying clients, that way
* this code wouldn't have to be this kludgy.
*/
static void
killWindows( Display *dpy, Window window )
{
Window root, parent, *children;
int child;
unsigned int nchildren = 0;
while (XQueryTree (dpy, window, &root, &parent, &children, &nchildren)
&& nchildren > 0)
{
for (child = 0; child < nchildren; child++) {
Debug ("Calling XKillClient() for window 0x%x\n",
children[child]);
XKillClient (dpy, children[child]);
}
XFree ((char *)children);
}
}
static jmp_buf resetJmp;
static SIGVAL
abortReset( int arg )
{
longjmp (resetJmp, 1);
}
/*
* this display connection better not have any windows...
*/
void
pseudoReset( Display *dpy )
{
Window root;
int screen;
if (setjmp (resetJmp)) {
LogError(
ReadCatalog(MC_LOG_SET,MC_LOG_PSEUDO,MC_DEF_LOG_PSEUDO));
} else {
signal (SIGALRM, abortReset);
alarm (30);
XSetErrorHandler (ignoreErrors);
for (screen = 0; screen < ScreenCount (dpy); screen++) {
Debug ("Pseudo reset screen %d\n", screen);
root = RootWindow (dpy, screen);
killWindows (dpy, root);
}
Debug ("Before XSync\n");
XSync (dpy, False);
(void) alarm (0);
}
signal (SIGALRM, SIG_DFL);
XSetErrorHandler ((int (*)()) 0);
Debug ("pseudoReset() done\n");
}

View File

@@ -0,0 +1,845 @@
/* $TOG: resource.c /main/7 1997/03/14 13:45:09 barstow $ */
/* (c) Copyright 1997 The Open Group */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* xdm - display manager daemon
*
* Copyright 1988 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Author: Keith Packard, MIT X Consortium
*/
/*
* resource.c
*/
# include "dm.h"
# include "vgmsg.h"
# include <X11/Xresource.h>
# include <X11/Xmu/CharSet.h>
# include <string.h>
void CleanUpName( char *src, char *dst, int len) ;
static char * getFullFileName(char *name, int special, char * lang);
extern char * qualifyWithFirst(char *, char *);
/* XtOffset() hack for ibmrt BandAidCompiler */
int session_set = False;
char *config;
char *servers;
int request_port;
int debugLevel;
char *errorLogFile;
int errorLogSize;
int daemonMode;
char *pidFile;
int lockPidFile;
char *authDir;
int autoRescan;
int removeDomainname;
char *keyFile;
char *accessFile;
char **exportList; /* List of all export env vars */
char *sysParmsFile;
char *timeZone;
char *fpHead = NULL;
char *fpTail = NULL;
int wakeupInterval;
int langListTimeout;
#ifdef DEF_NETWORK_DEV
char *networkDev;
#endif
#if defined(__osf__)
char *ignoreLocales;
#endif
/*
* Dtlogin will accept both Dtlogin and XDM resources. The string variable
* "AppName" contains the proper application name to use in looking up
* resources.
*/
# define DISPLAYMANAGER "DisplayManager"
# define DTLOGIN "Dtlogin"
static char AppName[16] = DTLOGIN;
# define DM_STRING 0
# define DM_INT 1
# define DM_BOOL 2
# define DM_ARGV 3
#ifdef BLS
# define DEF_XDM_CONFIG CDE_INSTALLATION_TOP "/lib/X11/Dtlogin/Xconfig"
# define DEF_AUTH_DIR CDE_INSTALLATION_TOP "/lib/X11/Dtlogin"
# define DEF_KEY_FILE CDE_INSTALLATION_TOP "/lib/X11/Dtlogin/Xkeys"
#endif
/*
* the following constants are supposed to be set in the makefile from
* parameters set util/imake.includes/site.def (or *.macros in that directory
* if it is server-specific). DO NOT CHANGE THESE DEFINITIONS!
*/
#ifndef DEF_SERVER_LINE
# ifdef sun
#define DEF_SERVER_LINE ":0 local /usr/openwin/bin/X :0"
# else
#define DEF_SERVER_LINE ":0 local /usr/bin/X11/X :0"
# endif /* sun */
#endif
#ifndef XRDB_PROGRAM
# ifdef sun
#define XRDB_PROGRAM "/usr/openwin/bin/xrdb"
# else
#define XRDB_PROGRAM "/usr/bin/X11/xrdb"
# endif /* sun */
#endif
#ifndef DEF_SESSION
#define DEF_SESSION CDE_INSTALLATION_TOP "/bin/Xsession"
#endif
#ifndef DEF_USER_PATH
# ifdef sun
# define DEF_USER_PATH "/usr/openwin/bin:/bin:/usr/bin:/usr/contrib/bin:/usr/local/bin:."
# else
# define DEF_USER_PATH "/usr/bin/X11:/bin:/usr/bin:/usr/contrib/bin:/usr/local/bin"
# endif /* sun */
#endif
#ifndef DEF_SYSTEM_PATH
# ifdef sun
# define DEF_SYSTEM_PATH "/usr/openwin/bin:/etc:/bin:/usr/bin"
# else
# define DEF_SYSTEM_PATH "/usr/bin/X11:/etc:/bin:/usr/bin"
# endif /* sun */
#endif
#ifndef DEF_SYSTEM_SHELL
#define DEF_SYSTEM_SHELL "/bin/sh"
#endif
#ifndef DEF_FAILSAFE_CLIENT
# ifdef sun
#define DEF_FAILSAFE_CLIENT "/usr/openwin/bin/xterm"
# else
#define DEF_FAILSAFE_CLIENT "/usr/bin/X11/xterm"
# endif /* sun */
#endif
#ifndef DEF_XDM_CONFIG
#define DEF_XDM_CONFIG "Xconfig"
#endif
#ifndef DEF_CHOOSER
#define DEF_CHOOSER CDE_INSTALLATION_TOP "/bin/chooser"
#endif
#ifndef CPP_PROGRAM
#define CPP_PROGRAM "/lib/cpp"
#endif
#ifndef DEF_XDM_AUTH_GEN
#define DEF_XDM_AUTH_GEN CDE_CONFIGURATION_TOP "/xdmauthgen"
#endif
#ifndef DEF_AUTH_NAME
#define DEF_AUTH_NAME "MIT-MAGIC-COOKIE-1"
#endif
#ifndef DEF_AUTH_DIR
#define DEF_AUTH_DIR CDE_CONFIGURATION_TOP
#endif
#ifndef DEF_USER_AUTH_DIR
#define DEF_USER_AUTH_DIR "/tmp"
#endif
#ifndef DEF_KEY_FILE
#define DEF_KEY_FILE CDE_CONFIGURATION_TOP "/Xkeys"
#endif
#ifndef DEF_ACCESS_FILE
#define DEF_ACCESS_FILE ""
#endif
#ifndef DEF_TIMEZONE
#define DEF_TIMEZONE "MST7MDT"
#endif
#ifndef DEF_SYS_PARMS_FILE
# if defined( __hpux )
# define DEF_SYS_PARMS_FILE "/etc/src.sh"
# else
# define DEF_SYS_PARMS_FILE "/etc/TIMEZONE"
# endif
#endif
#define DEF_UDP_PORT "177" /* registered XDMCP port, don't change */
#ifndef DEF_ENV
# ifdef sun /* need to set the environment for Sun OpenWindows */
# define DEF_ENV "OPENWINHOME=/usr/openwin"
# else
# define DEF_ENV ""
# endif
#endif
#ifndef DEF_LANG /* LANG default settings for various architectures */
# ifdef __apollo
# define DEF_LANG "C"
# endif
# ifdef __osf__
# define DEF_LANG "C"
# endif
# ifdef __hp_osf
# define DEF_LANG "en_US.88591"
# endif
# ifdef sun /* default language under Solaris */
# define DEF_LANG "C"
# endif
#endif
#ifndef DEF_LANG /* set LANG to NULL if not already defined */
#define DEF_LANG ""
#endif
struct dmResources {
char *name, *class;
int type;
char **dm_value;
char *default_value;
} DmResources[] = {
"servers", "Servers", DM_STRING, &servers,
DEF_SERVER_LINE,
"requestPort", "RequestPort", DM_INT, (char **) &request_port,
DEF_UDP_PORT,
"debugLevel", "DebugLevel", DM_INT, (char **) &debugLevel,
"0",
"errorLogFile", "ErrorLogFile", DM_STRING, &errorLogFile,
"",
"errorLogSize", "ErrorLogSize", DM_INT, (char **) &errorLogSize,
"50",
"daemonMode", "DaemonMode", DM_BOOL, (char **) &daemonMode,
"false",
"pidFile", "PidFile", DM_STRING, &pidFile,
"",
"lockPidFile", "LockPidFile", DM_BOOL, (char **) &lockPidFile,
"true",
"authDir", "AuthDir", DM_STRING, &authDir,
DEF_AUTH_DIR,
"autoRescan", "AutoRescan", DM_BOOL, (char **) &autoRescan,
"true",
"removeDomainname","RemoveDomainname",DM_BOOL, (char **) &removeDomainname,
"true",
"keyFile", "KeyFile", DM_STRING, &keyFile,
DEF_KEY_FILE,
"accessFile", "AccessFile", DM_STRING, &accessFile,
DEF_ACCESS_FILE,
/* exportList env var resource RK 08.17.93 */
"exportList", "ExportList", DM_ARGV, (char **) &exportList,
"",
"timeZone", "TimeZone", DM_STRING, &timeZone,
"",
"fontPathHead", "FontPathHead", DM_STRING, &fpHead,
"",
"fontPathTail", "FontPathTail", DM_STRING, &fpTail,
"",
"sysParmsFile", "SysParmsFile", DM_STRING, &sysParmsFile,
DEF_SYS_PARMS_FILE,
"wakeupInterval","WakeupInterval",DM_INT, (char **) &wakeupInterval,
"10",
"langListTimeout","langListTimeout",DM_INT, (char **) &langListTimeout,
"30",
#ifdef DEF_NETWORK_DEV
"networkDevice","NetworkDevice",DM_STRING, &networkDev,
DEF_NETWORK_DEV,
#endif
#if defined(__osf__)
"ignoreLocales", "IgnoreLocales", DM_STRING, &ignoreLocales,
"",
#endif
};
# define NUM_DM_RESOURCES (sizeof DmResources / sizeof DmResources[0])
# define boffset(f) ((char *) &(((struct display *) 0)->f) - (char *) 0)
struct displayResources {
char *name, *class;
int type;
int offset;
char *default_value;
} DisplayResources[] = {
/*
* resources for managing the server...
*/
"serverAttempts","ServerAttempts", DM_INT, boffset(serverAttempts),
"1",
"openDelay", "OpenDelay", DM_INT, boffset(openDelay),
"5",
"openRepeat", "OpenRepeat", DM_INT, boffset(openRepeat),
"5",
"openTimeout", "OpenTimeout", DM_INT, boffset(openTimeout),
"30",
"startAttempts","StartAttempts",DM_INT, boffset(startAttempts),
"4",
"pingInterval", "PingInterval", DM_INT, boffset(pingInterval),
"5",
"pingTimeout", "PingTimeout", DM_INT, boffset(pingTimeout),
"5",
"terminateServer","TerminateServer",DM_BOOL, boffset(terminateServer),
"false",
"grabServer", "GrabServer", DM_BOOL, boffset(grabServer),
"true",
"grabTimeout", "GrabTimeout", DM_INT, boffset(grabTimeout),
"3",
"resetSignal", "Signal", DM_INT, boffset(resetSignal),
"1", /* SIGHUP */
"termSignal", "Signal", DM_INT, boffset(termSignal),
"15", /* SIGTERM */
"resetForAuth", "ResetForAuth", DM_BOOL, boffset(resetForAuth),
"false",
"authorize", "Authorize", DM_BOOL, boffset(authorize),
"true",
"authName", "AuthName", DM_ARGV, boffset(authNames),
DEF_AUTH_NAME,
"authFile", "AuthFile", DM_STRING, boffset(authFile),
"",
#if 0
"gettyLine", "GettyLine", DM_STRING, boffset(gettyLine),
"",
"gettySpeed", "GettySpeed", DM_STRING, boffset(gettySpeed),
"9600",
#endif
/*
* resources which control the session behavior...
*/
"resources", "Resources", DM_STRING, boffset(resources),
"",
"xrdb", "Xrdb", DM_STRING, boffset(xrdb),
XRDB_PROGRAM,
"cpp", "Cpp", DM_STRING, boffset(cpp),
CPP_PROGRAM,
"setup", "Setup", DM_STRING, boffset(setup),
"",
"startup", "Startup", DM_STRING, boffset(startup),
"",
"reset", "Reset", DM_STRING, boffset(reset),
"",
"session", "Session", DM_STRING, boffset(session),
DEF_SESSION,
"userPath", "Path", DM_STRING, boffset(userPath),
DEF_USER_PATH,
"systemPath", "Path", DM_STRING, boffset(systemPath),
DEF_SYSTEM_PATH,
"systemShell", "Shell", DM_STRING, boffset(systemShell),
DEF_SYSTEM_SHELL,
"failsafeClient","FailsafeClient", DM_STRING, boffset(failsafeClient),
DEF_FAILSAFE_CLIENT,
"userAuthDir", "UserAuthDir", DM_STRING, boffset(userAuthDir),
DEF_AUTH_DIR,
"chooser", "Chooser", DM_STRING, boffset(chooser),
DEF_CHOOSER,
"language", "Language", DM_STRING, boffset(language),
DEF_LANG,
"languageList", "LanguageList", DM_STRING, boffset(langList),
"",
"environment", "Environment", DM_STRING, boffset(environStr),
DEF_ENV,
"dtlite", "Dtlite", DM_BOOL, boffset(dtlite),
"false",
"xdmMode", "XdmMode", DM_BOOL, boffset(xdmMode),
"false",
"authenticationName","AuthenticationName", DM_STRING, boffset(verifyName),
"",
"pmSearchPath", "PmSearchPath", DM_STRING, boffset(pmSearchPath),
DEF_PM_SEARCH_PATH,
"bmSearchPath", "bmSearchPath", DM_STRING, boffset(bmSearchPath),
DEF_BM_SEARCH_PATH,
};
# define NUM_DISPLAY_RESOURCES (sizeof DisplayResources/sizeof DisplayResources[0])
XrmDatabase DmResourceDB;
int
GetResource( char *name, char *class, int valueType, char **valuep,
char *default_value )
{
char *type;
XrmValue value;
char *string, *new_string;
char str_buf[50];
int len;
if (DmResourceDB && XrmGetResource (DmResourceDB,
name, class,
&type, &value))
{
string = value.addr;
len = value.size;
}
else
{
string = default_value;
len = (string == NULL ? 0 : strlen (string));
}
Debug ("%s/%s value %*.*s\n", name, class, len, len, string);
/*
* check if new resource is the same as old...
*/
if (valueType == DM_STRING && *valuep) {
if (string != NULL && strlen (*valuep) == len && !strncmp (*valuep, string, len))
return;
else {
free (*valuep);
*(valuep) = NULL;
}
}
switch (valueType) {
case DM_STRING:
if ( len > 0 ) {
new_string = malloc ((unsigned) (len+1));
if (!new_string) {
LogOutOfMem(
ReadCatalog(MC_LOG_SET,MC_LOG_GET_RSC,MC_DEF_LOG_GET_RSC));
return;
}
strncpy (new_string, string, len);
new_string[len] = '\0';
*(valuep) = new_string;
}
break;
case DM_INT:
strncpy (str_buf, string, sizeof (str_buf));
str_buf[sizeof (str_buf)-1] = '\0';
*((int *) valuep) = atoi (str_buf);
break;
case DM_BOOL:
strncpy (str_buf, string, sizeof (str_buf));
str_buf[sizeof (str_buf)-1] = '\0';
XmuCopyISOLatin1Lowered (str_buf, str_buf);
if (!strcmp (str_buf, "true") ||
!strcmp (str_buf, "on") ||
!strcmp (str_buf, "yes"))
*((int *) valuep) = 1;
else if (!strcmp (str_buf, "false") ||
!strcmp (str_buf, "off") ||
!strcmp (str_buf, "no"))
*((int *) valuep) = 0;
break;
case DM_ARGV:
*((char ***) valuep) = parseArgs ((char **) 0, string);
break;
}
}
XrmOptionDescRec configTable [] = {
{"-server", NULL, XrmoptionSkipArg, (caddr_t) NULL },
{"-udpPort", NULL, XrmoptionSkipArg, (caddr_t) NULL },
{"-error", NULL, XrmoptionSkipArg, (caddr_t) NULL },
{"-resources", NULL, XrmoptionSkipArg, (caddr_t) NULL },
{"-session", NULL, XrmoptionSkipArg, (caddr_t) NULL },
{"-debug", NULL, XrmoptionSkipArg, (caddr_t) NULL },
{"-xrm", NULL, XrmoptionSkipArg, (caddr_t) NULL },
{"-config", ".configFile", XrmoptionSepArg, (caddr_t) NULL }
};
XrmOptionDescRec optionTable [] = {
{"-server", ".servers", XrmoptionSepArg, (caddr_t) NULL },
{"-udpPort", ".requestPort", XrmoptionSepArg, (caddr_t) NULL },
{"-error", ".errorLogFile", XrmoptionSepArg, (caddr_t) NULL },
{"-resources", "*resources", XrmoptionSepArg, (caddr_t) NULL },
{"-session", "*session", XrmoptionSepArg, (caddr_t) NULL },
{"-debug", "*debugLevel", XrmoptionSepArg, (caddr_t) NULL },
{"-xrm", NULL, XrmoptionResArg, (caddr_t) NULL },
{"-daemon", ".daemonMode", XrmoptionNoArg, "true" },
{"-nodaemon", ".daemonMode", XrmoptionNoArg, "false" }
};
static int originalArgc;
static char **originalArgv;
void
InitResources( int argc, char **argv )
{
XrmInitialize ();
originalArgc = argc;
originalArgv = argv;
ReinitResources ();
}
void
ReinitResources( void )
{
int argc;
char **a;
char **argv;
XrmDatabase newDB;
char * configFileName;
char *type;
XrmValue value;
argv = (char **) malloc ((originalArgc + 1) * sizeof (char *));
if (!argv)
LogOutOfMem(
ReadCatalog(MC_LOG_SET,MC_LOG_NO_SPACE,MC_DEF_LOG_NO_SPACE));
for (argc = 0; argc < originalArgc; argc++)
argv[argc] = originalArgv[argc];
argv[argc] = 0;
if (DmResourceDB)
XrmDestroyDatabase (DmResourceDB);
DmResourceDB = XrmGetStringDatabase ("");
/* pre-parse the command line to get the -config option, if any */
XrmParseCommand (&DmResourceDB, configTable,
sizeof (configTable) / sizeof (configTable[0]),
"Dtlogin", &argc, argv);
configFileName = qualifyWithFirst(DEF_XDM_CONFIG,
CDE_CONFIGURATION_TOP "/config:"
CDE_INSTALLATION_TOP "/config");
GetResource ("Dtlogin.configFile", "Dtlogin.ConfigFile",
DM_STRING, &config, configFileName);
free(configFileName);
newDB = XrmGetFileDatabase ( config );
if (newDB)
{
if (DmResourceDB)
XrmDestroyDatabase (DmResourceDB);
DmResourceDB = newDB;
}
else if (argc != originalArgc)
LogError(
ReadCatalog(MC_LOG_SET,MC_LOG_NO_OPENCFG,MC_DEF_LOG_NO_OPENCFG),
config );
/*
* scan the resource database to set the application name...
*/
SetAppName();
XrmParseCommand (&DmResourceDB, optionTable,
sizeof (optionTable) / sizeof (optionTable[0]),
AppName, &argc, argv);
/*
* test to see if the session variable is set.
* for enabling the toggle in the options menu, if it is set..
*/
if((XrmGetResource (DmResourceDB, "Dtlogin*session", "Dtlogin*Session", &type, &value)) == True)
session_set = True;
if (argc > 1)
{
LogError(ReadCatalog(MC_LOG_SET,MC_LOG_EXTRA_ARG,MC_DEF_LOG_EXTRA_ARG));
for (a = argv + 1; *a; a++)
LogError ((unsigned char *)" \"%s\"", *a);
LogError ((unsigned char *)"\n");
}
free (argv);
}
void
LoadDMResources( void )
{
int i;
char name[1024], class[1024];
FILE *fp;
if (servers) {free(servers); servers=NULL;}
if (keyFile) {free(keyFile); keyFile=NULL;}
if (accessFile) {free(accessFile); accessFile=NULL;}
for (i = 0; i < NUM_DM_RESOURCES; i++) {
sprintf (name, "%s.%s", AppName, DmResources[i].name);
sprintf (class, "%s.%s", AppName, DmResources[i].class);
GetResource (name, class, DmResources[i].type,
(char **) DmResources[i].dm_value,
DmResources[i].default_value);
}
servers = getFullFileName(servers, 1, NULL);
keyFile = getFullFileName(keyFile, 0, NULL);
accessFile = getFullFileName(accessFile, 0, NULL);
#ifndef __apollo /* set a TZ default for all OS except Domain */
if (timeZone == NULL || strlen(timeZone) == 0)
{
/*
* dynamically determine the timeZone resource default value...
*/
GetSysParms(&timeZone,0,0);
}
#endif
}
void
CleanUpName( char *src, char *dst, int len )
{
while (*src) {
if (--len <= 0)
break;
switch (*src)
{
case ':':
case '.':
*dst++ = '_';
break;
default:
*dst++ = *src;
}
++src;
}
*dst = '\0';
}
void
LoadDisplayResources( struct display *d )
{
int i;
char name[1024], class[1024];
char dpyName[512], dpyClass[512];
char *lang;
Debug("Loading display resources for %s\n", d->name);
if (d->resources) {free(d->resources); d->resources=NULL;}
if (d->setup) {free(d->setup); d->setup=NULL;}
if (d->startup) {free(d->startup); d->startup=NULL;}
if (d->reset) {free(d->reset); d->reset=NULL;}
if (d->session) {free(d->session); d->session=NULL;}
if (d->failsafeClient) {free(d->failsafeClient); d->failsafeClient=NULL;}
CleanUpName (d->name, dpyName, sizeof (dpyName));
CleanUpName (d->class ? d->class : d->name, dpyClass, sizeof (dpyClass));
if((lang = getenv("LANG")) != NULL)
for (i = NUM_DISPLAY_RESOURCES - 1; i >= 0; i--) {
if(strcmp(DisplayResources[i].name,"language") == 0){
DisplayResources[i].default_value = lang;
break;
}
}
for (i = 0; i < NUM_DISPLAY_RESOURCES; i++) {
sprintf (name, "%s.%s.%s", AppName,
dpyName, DisplayResources[i].name);
sprintf (class, "%s.%s.%s", AppName,
dpyClass, DisplayResources[i].class);
GetResource (name, class, DisplayResources[i].type,
(char **) (((char *) d) + DisplayResources[i].offset), DisplayResources[i].default_value);
}
#ifdef _AIX
if(d->language == NULL || strlen(d->language) == 0)
SetDefaultLanguage(d);
#endif /* _AIX */
d->resources = getFullFileName(d->resources, 2, d->language);
d->setup = getFullFileName(d->setup, 0, NULL);
d->startup = getFullFileName(d->startup, 0, NULL);
d->reset = getFullFileName(d->reset, 0, NULL);
d->session = getFullFileName(d->session, 0, NULL);
d->failsafeClient = getFullFileName(d->failsafeClient, 0, NULL);
}
/***************************************************************************
*
* SetAppName
*
* Probe the resource database to see whether the config file is using
* "Dtlogin" or "DisplayManager" as the application name.
*
* If it cannot be determined, "Dtlogin" is used.
***************************************************************************/
void
SetAppName( void )
{
int i;
char name[1024], class[1024];
char *type;
XrmValue value;
for (i = 0; i < NUM_DM_RESOURCES; i++) {
/*
* try "Dtlogin" (default) ...
*/
sprintf (name, "%s.%s", DTLOGIN, DmResources[i].name);
sprintf (class, "%s.%s", DTLOGIN, DmResources[i].class);
if (DmResourceDB && XrmGetResource (DmResourceDB, name, class,
&type, &value)) {
strcpy(AppName, DTLOGIN);
break;
}
/*
* try "DisplayManager" ...
*/
sprintf (name, "%s.%s", DISPLAYMANAGER, DmResources[i].name);
sprintf (class, "%s.%s", DISPLAYMANAGER, DmResources[i].class);
if (DmResourceDB && XrmGetResource (DmResourceDB, name, class,
&type, &value)) {
strcpy(AppName, DISPLAYMANAGER);
break;
}
}
}
/***************************************************************************
*
* getFullFileName
*
* Try to produce a fully qualified file name by prepending
* /etc/dt/config or /usr/dt/config to a resource file name.
* There are 2 special cases: servers - which can be a command, and
* resources - which can an imbeded %L.
***************************************************************************/
extern char *_ExpandLang( char *string, char *lang );
static char *
getFullFileName(char *name, int special, char *lang)
{
char * newname;
if (name == NULL)
return(NULL);
/** if the file already starts with a '/' **/
/** then just return a copy of it **/
if (name[0] == '/') {
if ((newname = (char *)malloc((strlen(name)+1)*sizeof(char))) == NULL) {
return (NULL);
} else {
strcpy(newname, name);
return(newname);
}
}
switch (special) {
/*********************/
case 0: /** no special case **/
/*********************/
newname = qualifyWithFirst(name,
CDE_CONFIGURATION_TOP "/config:"
CDE_INSTALLATION_TOP "/config");
return (newname);
/***************************************/
case 1: /** special handling for servers file **/
/***************************************/
if (strchr(name, ':') != NULL) {
/** This is probably a command and not a file name **/
/** so just return a copy of it. **/
if ((newname = (char *)malloc((strlen(name)+1)*sizeof(char)))
== NULL) {
return (NULL);
} else {
strcpy(newname, name);
return(newname);
}
} else {
newname = qualifyWithFirst(name,
CDE_CONFIGURATION_TOP "/config:"
CDE_INSTALLATION_TOP "/config");
return (newname);
}
/********************************************/
case 2: /** special handling for d->resources file **/
/********************************************/
if (strchr(name, '%') == NULL) {
/** no special processing needed **/
newname = qualifyWithFirst(name,
CDE_CONFIGURATION_TOP "/config:"
CDE_INSTALLATION_TOP "/config");
return (newname);
} else {
char *langString;
char *tempName;
int tempLen;
/** need to remember the %L **/
if (lang == NULL)
lang = "C";
langString = _ExpandLang(name, lang);
if ( (tempName = qualifyWithFirst(langString,
CDE_CONFIGURATION_TOP "/config:"
CDE_INSTALLATION_TOP "/config") )
== NULL) {
free(langString);
langString = _ExpandLang(name, "C");
if ( (tempName = qualifyWithFirst(langString,
CDE_CONFIGURATION_TOP "/config:"
CDE_INSTALLATION_TOP "/config") )
== NULL) {
free(langString);
return(NULL);
}
}
/** We have a fully qualified and expanded file name **/
/** but we need to return a fully qualified but NOT **/
/** expanded file name. **/
tempLen = strlen(tempName) - strlen(langString)
+ strlen(name) + 1;
if ((newname = (char *)malloc(tempLen * sizeof(char))) == NULL){
free(langString);
return(tempName);
} else {
tempLen = strlen(tempName) - strlen(langString);
strncpy(newname, tempName, tempLen);
strcpy(newname+tempLen, name);
free (langString);
return(newname);
}
}
}
}

View File

@@ -0,0 +1,478 @@
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* xdm - display manager daemon
*
* $XConsortium: server.c /main/4 1995/10/27 16:14:56 rswiston $
*
* Copyright 1988 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Author: Keith Packard, MIT X Consortium
*/
# include <sys/signal.h>
# include <setjmp.h>
# include <pwd.h>
# include "dm.h"
# include "vgmsg.h"
static receivedUsr1;
/***************************************************************************
*
* Local procedure declarations
*
***************************************************************************/
static char * _SysErrorMsg( int n) ;
static SIGVAL CatchUsr1( int arg ) ;
static void GetRemoteAddress( struct display *d, int fd) ;
static SIGVAL PingBlocked( int arg ) ;
static SIGVAL PingLost( int arg ) ;
static SIGVAL abortOpen( int arg ) ;
static int serverPause( unsigned t, int serverPid) ;
static SIGVAL serverPauseAbort( int arg ) ;
static SIGVAL serverPauseUsr1( int arg ) ;
/***************************************************************************
*
* Global variables
*
***************************************************************************/
static Display *dpy;
static SIGVAL
CatchUsr1( int arg )
{
#if defined(SYSV) || defined(SVR4)
(void) signal (SIGUSR1, CatchUsr1);
#endif
Debug ("Display Manager caught SIGUSR1\n");
++receivedUsr1;
}
static char *
_SysErrorMsg( int n )
{
char *s = ((n >= 0 && n < sys_nerr) ? sys_errlist[n] : "unknown error");
return (s ? s : "no such error");
}
int
StartServerOnce( struct display *d )
{
char **f;
char **argv;
char arg[1024];
int pid;
char **env;
extern struct passwd puser; /* pseudo_user password entry */
Debug ("Starting server for %s\n", d->name);
receivedUsr1 = 0;
signal (SIGUSR1, CatchUsr1);
argv = d->argv;
switch (pid = fork ()) {
case 0:
CleanUpChild ();
if (d->authFile) {
sprintf (arg, "-auth %s", d->authFile);
argv = parseArgs (argv, arg);
}
if (!argv) {
LogError(ReadCatalog(MC_LOG_SET,MC_LOG_NO_ARGS,MC_DEF_LOG_NO_ARGS));
exit(1);
}
Debug("Server invoked as ");
for (f = argv; *f; f++)
Debug ("'%s' ", *f);
Debug ("\n");
/*
* set the permissions on console devices to pseudo-user.
* run the server as a pseudo-user, not root...
*/
#ifdef sun
if (solaris_setdevperm(d->gettyLine, puser.pw_uid, puser.pw_gid) == 0)
Debug ("Unable to set permissions on console devices ..\n");
else {
#endif
setgid (puser.pw_gid);
setuid (puser.pw_uid);
#ifdef sun
}
#endif
/*
* build the server environment (if any)...
*/
env = 0;
if (d->environStr && strlen(d->environStr) > 0)
env = parseEnv(env, d->environStr);
#ifdef sun
if (getEnv (env, "OPENWINHOME") == NULL)
env = setEnv(env, "OPENWINHOME", "/usr/openwin");
#endif
#ifdef _AIX
if (getEnv (env, "ODMDIR") == NULL)
env = setEnv(env, "ODMDIR", "/etc/objrepos");
#ifdef _POWER
env = setEnv(env, "XTOEXEC", "true"); /* flag for xserverrc */
#endif
#endif
/*
* give the server SIGUSR1 ignored,
* it will notice that and send SIGUSR1
* when ready
*/
signal (SIGUSR1, SIG_IGN);
(void) execve (argv[0], argv, env);
LogError(ReadCatalog(
MC_LOG_SET,MC_LOG_NO_EXESRV,MC_DEF_LOG_NO_EXESRV),argv[0]);
exit(1);
case -1:
LogError(ReadCatalog(MC_LOG_SET,MC_LOG_FAIL_FORK,MC_DEF_LOG_FAIL_FORK));
return 0;
default:
break;
}
Debug ("Server started. Process ID = %d\n", pid);
d->serverPid = pid;
if (serverPause ((unsigned) d->openDelay, pid))
return FALSE;
return TRUE;
}
int
StartServer( struct display *d )
{
int i;
int ret = FALSE;
i = 0;
while (d->serverAttempts == 0 || i < d->serverAttempts)
{
if ((ret = StartServerOnce (d)) == TRUE)
break;
sleep (d->openDelay);
i++;
}
return ret;
}
/*
* sleep for t seconds, return 1 if the server is dead when
* the sleep finishes, 0 else
*/
static jmp_buf pauseAbort;
static int serverPauseRet;
static SIGVAL
serverPauseAbort( int arg )
{
Debug ("Display Manager pause timed out\n");
longjmp (pauseAbort, 1);
}
static SIGVAL
serverPauseUsr1( int arg )
{
Debug ("Display Manager pause received SIGUSR1\n");
++receivedUsr1;
longjmp (pauseAbort, 1);
}
static int
serverPause( unsigned t, int serverPid )
{
int pid;
serverPauseRet = 0;
Debug ("Display Manager pausing until SIGUSR1 from server or timeout\n");
if (!setjmp (pauseAbort)) {
signal (SIGALRM, serverPauseAbort);
signal (SIGUSR1, serverPauseUsr1);
#ifdef SYSV
if (receivedUsr1)
alarm ((unsigned) 1);
else
alarm (t);
#else
if (!receivedUsr1)
alarm (t);
else
Debug ("ServerPause(): already received USR1\n");
#endif
for (;;) {
#ifdef SYSV
pid = wait ((waitType *) 0);
#else
if (!receivedUsr1)
pid = wait ((waitType *) 0);
else
# ifdef SVR4
{
int dummy;
pid = waitpid ((pid_t) 0,&dummy,WNOHANG);
}
# else
pid = wait3 ((waitType *) 0, WNOHANG,
(struct rusage *) 0);
# endif
#endif
if (pid == serverPid ||
pid == -1 && errno == ECHILD)
{
Debug ("Server dead\n");
serverPauseRet = 1;
break;
}
#ifndef SYSV
if (pid == 0) {
Debug ("Server alive and kicking\n");
break;
}
#endif
}
}
alarm ((unsigned) 0);
signal (SIGALRM, SIG_DFL);
signal (SIGUSR1, CatchUsr1);
if (serverPauseRet) {
Debug ("Server died\n");
LogError(ReadCatalog(MC_LOG_SET,MC_LOG_SRV_DIED,MC_DEF_LOG_SRV_DIED));
}
return serverPauseRet;
}
/*
* this code is complicated by some TCP failings. On
* many systems, the connect will occasionally hang forever,
* this trouble is avoided by setting up a timeout to longjmp
* out of the connect (possibly leaving piles of garbage around
* inside Xlib) and give up, terminating the server.
*/
static jmp_buf openAbort;
static SIGVAL
abortOpen( int arg )
{
longjmp (openAbort, 1);
}
static void
GetRemoteAddress( struct display *d, int fd )
{
char buf[512];
int len = sizeof (buf);
if (d->peer)
free ((char *) d->peer);
getpeername (fd, (struct sockaddr *) buf, &len);
d->peerlen = 0;
if (len)
{
d->peer = (struct sockaddr *) malloc (len);
if (d->peer)
{
bcopy (buf, (char *) d->peer, len);
d->peerlen = len;
}
}
Debug ("Got remote address %s %d\n", d->name, d->peerlen);
}
/****************************************************************************
*
* LogOpenError()
*
* If d->startAttempts is a large number and a connection cannot be made to
* the server, the error log can fill up rapidly with error messages. This
* could be common in X-terminals that do not support XDMCP and are turned
* off over a weekend. This routine attempts to reduce the number of error
* messages logged in this scenario.
*
****************************************************************************/
int
LogOpenError( int count )
{
if ( count <= 10 ) return 1;
if ( count <= 100 && (count % 10 == 0) ) return 1;
if ( count <= 500 && (count % 50 == 0) ) return 1;
if ( (count % 100 == 0) ) return 1;
return 0;
}
int
WaitForServer( struct display *d )
{
int i;
for (i = 0; i < (d->openRepeat > 0 ? d->openRepeat : 1); i++) {
(void) signal (SIGALRM, abortOpen);
(void) alarm ((unsigned) d->openTimeout);
if (!setjmp (openAbort)) {
Debug ("Before XOpenDisplay(%s)\n", d->name);
errno = 0;
dpy = XOpenDisplay (d->name);
(void) alarm ((unsigned) 0);
(void) signal (SIGALRM, SIG_DFL);
Debug ("After XOpenDisplay()\n");
if (dpy) {
if (d->displayType.location == Foreign)
GetRemoteAddress (d, ConnectionNumber (dpy));
RegisterCloseOnFork (ConnectionNumber (dpy));
(void) fcntl (ConnectionNumber (dpy), F_SETFD, 0);
return 1;
} else {
Debug ("OpenDisplay failed %d (%s)\n",
errno, _SysErrorMsg (errno));
}
Debug ("Waiting for server to start %d\n", i);
sleep ((unsigned) d->openDelay);
} else {
Debug ("Hung in open, aborting\n");
if (LogOpenError(d->startTries))
LogError(ReadCatalog(
MC_LOG_SET,MC_LOG_HUNG_DPY,MC_DEF_LOG_HUNG_DPY),
d->name, d->startTries);
(void) signal (SIGALRM, SIG_DFL);
break;
}
}
Debug ("Giving up on server\n");
if (LogOpenError(d->startTries))
LogError(ReadCatalog(
MC_LOG_SET,MC_LOG_FAIL_SRVOPEN,MC_DEF_LOG_FAIL_SRVOPEN),
d->startTries, d->name);
return 0;
}
void
ResetServer( struct display *d )
{
if (dpy && d->displayType.origin != FromXDMCP)
pseudoReset (dpy);
}
/****************************************************************************
*
* Server pinging routines...
*
* These routines attempt to determine if the server is still alive.
* Periodically (d->pingInterval) an XSync is sent to the server. If an I/O
* error occurs, then the connection has been lost and the server needs to
* be reset. If the server is blocked for some reason (i.e. server grab) the
* XSync will block until a local timer expires. In this case, we just note
* the block and continue...
*
* 7/26/90 - prr
* The XSync was replaced by a socket-level ping. For some reason, an XSync
* to a grabbed server causes a subsequent pseudoReset (KillClients) to not
* kill all clients. The socket ping is not affected by a grabbed server,
* but it cannot detect a server shutdown and restart within one ping
* interval.
*
****************************************************************************/
static jmp_buf pingTime;
static int serverDead = FALSE;
static SIGVAL
PingLost( int arg )
{
serverDead = TRUE;
longjmp (pingTime, 1);
}
static SIGVAL
PingBlocked( int arg )
{
serverDead = FALSE;
longjmp (pingTime, 1);
}
int
PingServer( struct display *d, Display *alternateDpy )
{
int (*oldError)();
SIGVAL (*oldSig)();
int oldAlarm;
if (!alternateDpy)
alternateDpy = dpy;
oldError = XSetIOErrorHandler ((XIOErrorHandler)PingLost);
oldAlarm = alarm (0);
oldSig = signal (SIGALRM, PingBlocked);
alarm (d->pingTimeout * 60);
if (!setjmp (pingTime))
{
Debug ("Ping server\n");
XNoOp (alternateDpy);
XSync (alternateDpy, 0);
Debug ("Server alive\n");
while (XPending(alternateDpy)) {
XEvent event;
XNextEvent(alternateDpy, &event);
}
}
else
{
if ( serverDead ) {
Debug ("Server dead\n");
alarm (0);
signal (SIGALRM, SIG_DFL);
XSetIOErrorHandler (oldError);
return 0;
}
else
Debug ("Server blocked, continuing...\n");
}
alarm (0);
signal (SIGALRM, oldSig);
alarm (oldAlarm);
XSetIOErrorHandler (oldError);
return 1;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,154 @@
/* $TOG: socket.c /main/9 1997/12/23 12:25:32 bill $ */
/* (c) Copyright 1997 The Open Group */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* @DEC_COPYRIGHT@
*/
/*
* HISTORY
* $Log$
* Revision 1.1.2.3 1995/06/06 20:24:26 Chris_Beute
* Code snapshot merge from March 15 and SIA changes
* [1995/05/31 20:15:01 Chris_Beute]
*
* Revision 1.1.2.2 1995/04/21 13:05:38 Peter_Derr
* dtlogin auth key fixes from deltacde
* [1995/04/12 19:21:26 Peter_Derr]
*
* R6 xdm version used to pick up XDMCP improvements.
* [1995/04/12 18:05:54 Peter_Derr]
*
* $EndLog$
*/
/*
Copyright (c) 1988 X Consortium
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 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 X CONSORTIUM 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 X Consortium 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 X Consortium.
*/
/*
* xdm - display manager daemon
* Author: Keith Packard, MIT X Consortium
*
* socket.c - Support for BSD sockets
*/
#include "dm.h"
#include "vgmsg.h"
#include <errno.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/un.h>
#include <netdb.h>
#ifdef X_NOT_STDC_ENV
extern int errno;
#endif
extern int xdmcpFd;
extern int chooserFd;
extern FD_TYPE WellKnownSocketsMask;
extern int WellKnownSocketsMax;
CreateWellKnownSockets ()
{
struct sockaddr_in sock_addr;
char *name, *localHostname();
if (request_port == 0)
return;
Debug ("creating socket %d\n", request_port);
xdmcpFd = socket (AF_INET, SOCK_DGRAM, 0);
if (xdmcpFd == -1) {
LogError (ReadCatalog(MC_LOG_SET,MC_LOG_FAIL_SOCK,MC_DEF_LOG_FAIL_SOCK),
request_port);
return;
}
name = localHostname ();
registerHostname (name, strlen (name));
RegisterCloseOnFork (xdmcpFd);
/* zero out the entire structure; this avoids 4.4 incompatibilities */
bzero ((char *) &sock_addr, sizeof (sock_addr));
#ifdef BSD44SOCKETS
sock_addr.sin_len = sizeof(sock_addr);
#endif
sock_addr.sin_family = AF_INET;
sock_addr.sin_port = htons ((short) request_port);
sock_addr.sin_addr.s_addr = htonl (INADDR_ANY);
if (bind (xdmcpFd, (struct sockaddr *)&sock_addr, sizeof (sock_addr)) == -1)
{
LogError (ReadCatalog(MC_LOG_SET,MC_LOG_ERR_BIND,MC_DEF_LOG_ERR_BIND),
request_port, errno);
close (xdmcpFd);
xdmcpFd = -1;
return;
}
WellKnownSocketsMax = xdmcpFd;
FD_SET (xdmcpFd, &WellKnownSocketsMask);
chooserFd = socket (AF_INET, SOCK_STREAM, 0);
Debug ("Created chooser socket %d\n", chooserFd);
if (chooserFd == -1)
{
LogError ((unsigned char *)"chooser socket creation failed, errno %d\n", errno);
return;
}
listen (chooserFd, 5);
if (chooserFd > WellKnownSocketsMax)
WellKnownSocketsMax = chooserFd;
FD_SET (chooserFd, &WellKnownSocketsMask);
}
GetChooserAddr (addr, lenp)
char *addr;
int *lenp;
{
struct sockaddr_in in_addr;
int len;
len = sizeof in_addr;
#if defined (_AIX) && (OSMAJORVERSION==4) && (OSMINORVERSION==2)
if (getsockname (chooserFd, (struct sockaddr *)&in_addr, (size_t *)&len) < 0)
#else
if (getsockname (chooserFd, (struct sockaddr *)&in_addr, &len) < 0)
#endif
return -1;
Debug ("Chooser socket port: %d\n", ntohs(in_addr.sin_port));
memmove( addr, (char *) &in_addr, len);
*lenp = len;
return 0;
}

View File

@@ -0,0 +1,946 @@
/* $XConsortium: solaris.c /main/4 1995/10/27 16:15:38 rswiston $ */
/*******************************************************************************
**
** solaris.c 1.15 95/09/10
**
** Copyright 1993, 1994, 1995 Sun Microsystems, Inc. All rights reserved.
**
** This file contains procedures specific to Sun Solaris login
**
*******************************************************************************/
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*******************************************************************************
**
** RESTRICTED CONFIDENTIAL INFORMATION:
**
** The information in this document is subject to special
** restrictions in a confidential disclosure agreement between
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
** document outside HP, IBM, Sun, USL, SCO, or Univel without
** Sun's specific written approval. This document and all copies
** and derivative works thereof must be returned or destroyed at
** Sun's request.
**
** Copyright 1994 Sun Microsystems, Inc. All rights reserved.
**
*******************************************************************************/
/*
* Header Files
*/
#include <sys/types.h>
#include <utmpx.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <dirent.h>
#include <sys/param.h>
#include <pwd.h>
#include "solaris.h"
#ifdef SUNAUTH
#include <security/ia_appl.h>
#endif
/*
* Local function declarations, structures, and variables
*/
static char* create_devname(char* short_devname);
static void dir_dev_acc(char *, uid_t, gid_t, mode_t, char *);
static void logindevperm(char *, uid_t, gid_t);
static void resetdevperm(char *);
#ifdef SUNAUTH
static int login_conv(int conv_id, int num_msg, struct ia_message **msg,
struct ia_response **response, void *appdata_ptr);
static void end_conv();
static struct ia_conv ia_conv = {login_conv, login_conv, end_conv, NULL};
static char *saved_user_passwd;
#endif SUNAUTH
/****************************************************************************
* solaris_setdevperm
*
* Modify permission of devices as specified in Solaris /etc/logindevperm file
****************************************************************************/
int
solaris_setdevperm(char* gettyLine, uid_t uid, gid_t gid)
{
char *devname = create_devname(gettyLine);
if (devname == NULL) {
Debug ("solaris_setdevperm: NULL devname\n");
return(0);
};
logindevperm(devname, uid, gid);
free(devname);
return(1);
}
/****************************************************************************
* solaris_resetdevperm
*
* Reset permission on devices specified in /etc/logindevperm file
****************************************************************************/
int
solaris_resetdevperm(char* gettyLine)
{
char *devname = create_devname(gettyLine);
if (devname == NULL) {
Debug ("solaris_resetdevperm: NULL devname\n");
return(0);
}
resetdevperm(devname);
free(devname);
return(1);
}
#ifdef SUNAUTH
/****************************************************************************
* solaris_authentication
*
* Authenticate that user / password combination is legal for this system
*
****************************************************************************/
int
solaris_authenticate ( char* prog_name,
char* display_name,
char* user_passwd,
char* user,
char* line )
{
int status;
struct ia_status out;
void *iah; /* PAM authentication handle */
char* user_str = user ? user : "NULL";
char* line_str = line ? line : "NULL";
char *line_dev = create_devname(line_str);
Debug("solaris_authenticate: prog_name=%s\n", prog_name);
Debug("solaris_authenticate: display_name=%s\n", display_name);
Debug("solaris_authenticate: user=%s\n", user_str);
Debug("solaris_authenticate: line=%s\n", line_str);
Debug("solaris_authenticate: line_dev=%s\n", line_dev);
if (user_passwd) {
if (strlen(user_passwd) == 0) {
Debug("solaris_authenticate: user passwd empty\n");
} else {
Debug("solaris_authenticate: user passwd present\n");
}
}
else {
Debug("solaris_authenticate: user passwd NULL\n");
/* Password challenge required for solaris authentication */
return(IA_AUTHTEST_FAIL);
}
/* Solaris BSM Audit trail */
audit_login_save_host(display_name);
audit_login_save_ttyn(line_dev);
audit_login_save_port();
/* Open Solaris PAM (Plugable Authentication module ) connection */
status = ia_start( prog_name, user, line_dev,
display_name, &ia_conv, &iah );
if (status == 0) {
int flags = AU_CHECK_PASSWD | AU_CONTINUE;
struct passwd *pwd;
saved_user_passwd = user_passwd;
status = ia_auth_user( iah, flags, &pwd, &out );
audit_login_save_pw(pwd);
if (status != 0) {
audit_login_bad_pw();
if (status == IA_MAXTRYS) {
audit_login_maxtrys();
}
}
}
if (status != 0) {
Debug("solaris_authenticate: PAM error=%d\n", status);
}
ia_end(iah);
return(status);
}
/****************************************************************************
* solaris_accounting
*
* Updates "utmp/utmpx: and "wtmp/wtmpx" system accounting entries
*
****************************************************************************/
int
solaris_accounting( char* prog_name,
char* display_name,
char* entry_id,
char* user,
char* line,
pid_t pid,
int entry_type,
int exitcode )
{
int session_type, status;
struct ia_status out;
void *iah; /* PAM authentication handle */
char* user_str = user ? user : "NULL";
char* line_str = line ? line : "NULL";
char *line_dev = create_devname(line_str);
Debug("solaris_accounting: prog_name=%s\n", prog_name);
Debug("solaris_accounting: display_name=%s\n", display_name);
Debug("solaris_accounting: entry_id=%c %c %c %c\n", entry_id[0],
entry_id[1], entry_id[2], entry_id[3]);
Debug("solaris_accounting: user=%s\n", user_str);
Debug("solaris_accounting: line=%s\n", line_str);
Debug("solaris_accounting: line_dev=%s\n", line_dev);
Debug("solaris_accounting: pid=%d\n", pid);
Debug("solaris_accounting: entry_type=%d\n", entry_type);
Debug("solaris_accounting: exitcode=%d\n", exitcode);
/* Open Solaris PAM (Plugable Authentication module ) connection */
if (entry_type == ACCOUNTING) {
status = ia_start(prog_name, user, line,
display_name, &ia_conv, &iah);
}
else {
status = ia_start(prog_name, user, line_dev,
display_name, &ia_conv, &iah);
}
/* Session accounting */
if (status != IA_SUCCESS) {
Debug("solaris_accounting: PAM error=%d)\n", status);
}
else {
switch(entry_type) {
case USER_PROCESS:
/* New user session, open session accounting logs */
session_type = IS_LOGIN;
status = ia_open_session(iah, session_type,
entry_type, entry_id, &out);
if (status == IA_SUCCESS) audit_login_success();
break;
case ACCOUNTING:
/*
* User session has terminated, mark it DEAD and close
* the sessions accounting logs.
*/
entry_type = DEAD_PROCESS;
session_type = IS_NOLOG;
status = ia_open_session(iah, session_type,
entry_type, entry_id, &out);
if (status != IA_SUCCESS) {
Debug("solaris_accounting: PAM check seuser error=%d\n",
status);
}
/* Intentional fall thru */
case DEAD_PROCESS:
/* Cleanup account files for dead processes */
status = ia_close_session(iah, 0, pid,
exitcode, entry_id, &out);
break;
case LOGIN_PROCESS:
default:
session_type = 0;
status = ia_open_session(iah, session_type,
entry_type, entry_id, &out);
break;
}
}
if (status != IA_SUCCESS) {
Debug("solaris_accounting: PAM session error=%d\n", status);
}
ia_end(iah);
free(line_dev);
return(status);
}
/****************************************************************************
* solaris_setcred
*
* Set Users login credentials: uid, gid, and group lists
****************************************************************************/
int
solaris_setcred(char* prog_name, char* user, uid_t uid, gid_t gid)
{
int cred_type, status;
struct ia_status out;
void *iah; /* PAM authentication handle */
char* user_str = user ? user : "NULL";
Debug("solaris_setcred: prog_name=%s\n", prog_name);
Debug("solaris_setcred: user=%s\n", user_str);
Debug("solaris_setcred: uid=%d\n", uid);
Debug("solaris_setcred: gid=%d\n", gid);
/* Open PAM connection */
status = ia_start(prog_name, user, NULL, NULL, &ia_conv, &iah);
if (status != 0) {
Debug("solaris_setcred: PAM start error=%d\n", status);
return(status);
}
/* Set users credentials */
ia_set_item(iah, IA_AUTHTOK, saved_user_passwd);
cred_type = SC_INITGPS|SC_SETRID;
status = ia_setcred(iah, cred_type, uid, gid, 0, NULL, &out);
if (status != 0) {
Debug("solaris_setcred: user=%s, err=%d)\n", user, status);
}
ia_end(iah);
Debug("solaris_setcred: return status =%d\n", status);
return(status);
}
#endif SUNAUTH
/***************************************************************************
* create_devname
*
* A utility function. Takes short device name like "console" and returns
* a long device name like "/dev/console"
***************************************************************************/
static char*
create_devname(char* short_devname)
{
char* long_devname;
if (short_devname == NULL)
short_devname = "";
long_devname = (char *) malloc (strlen(short_devname) + 5);
if (long_devname == NULL)
return(NULL);
strcpy(long_devname,"/dev/");
strcat(long_devname, short_devname);
return(long_devname);
}
/****************************************************************************
* logindevperm
*
* change owner/group/permissions of devices list in /etc/logindevperm.
*
* This code is directly from Sun Solaris 5.3 login. Eventually this will
* be a fuction in a Solaris library. Till then, this is duplicate copy.
***************************************************************************/
#define LOGINDEVPERM "/etc/logindevperm"
#define DIRWILD "/*" /* directory wildcard */
#define DIRWLDLEN 2 /* strlen(DIRWILD) */
static void
logindevperm(char *ttyn, uid_t uid, gid_t gid)
{
char *field_delims = " \t\n";
char *permfile = LOGINDEVPERM;
char line[MAXPATHLEN];
char *console;
char *mode_str;
char *dev_list;
char *device;
char *ptr;
int mode;
FILE *fp;
size_t l;
int lineno;
if ((fp = fopen(permfile, "r")) == NULL)
return;
lineno = 0;
while (fgets(line, MAXPATHLEN, fp) != NULL) {
lineno++;
if ((ptr = strchr(line, '#')) != NULL)
*ptr = '\0'; /* handle comments */
if ((console = strtok(line, field_delims)) == NULL)
continue; /* ignore blank lines */
if (strcmp(console, ttyn) != 0)
continue; /* not our tty, skip */
mode_str = strtok((char *)NULL, field_delims);
if (mode_str == NULL) {
(void) fprintf(stderr,
"%s: line %d, invalid entry -- %s\n", permfile,
lineno, line);
continue;
}
/* convert string to octal value */
mode = strtol(mode_str, &ptr, 8);
if (mode < 0 || mode > 0777 || *ptr != '\0') {
(void) fprintf(stderr,
"%s: line %d, invalid mode -- %s\n", permfile,
lineno, mode_str);
continue;
}
dev_list = strtok((char *)NULL, field_delims);
if (dev_list == NULL) {
(void) fprintf(stderr,
"%s: line %d, %s -- empty device list\n",
permfile, lineno, console);
continue;
}
device = strtok(dev_list, ":");
while (device != NULL) {
l = strlen(device);
ptr = &device[l - DIRWLDLEN];
if ((l > DIRWLDLEN) && (strcmp(ptr, DIRWILD) == 0)) {
*ptr = '\0'; /* chop off wildcard */
dir_dev_acc(device, uid, gid, mode, permfile);
} else {
/*
* change the owner/group/permission;
* nonexistent devices are ignored
*/
if (chown(device, uid, gid) == -1) {
if (errno != ENOENT) {
(void) fprintf(stderr, "%s: ",
permfile);
perror(device);
}
} else {
if ((chmod(device, mode) == -1) &&
(errno != ENOENT)) {
(void) fprintf(stderr, "%s: ",
permfile);
perror(device);
}
}
}
device = strtok((char *)NULL, ":");
}
}
(void) fclose(fp);
}
/***************************************************************************
* dir_dev_acc
*
* Apply owner/group/perms to all files (except "." and "..") in a directory.
*
* This code is directly Sun Solaris 5.3 login. Eventually this will
* be internal to a Solaris library. Till then, this is a duplicate copy.
***************************************************************************/
static void
dir_dev_acc(char *dir, uid_t uid, gid_t gid, mode_t mode, char *permfile)
{
DIR *dirp;
struct dirent *direntp;
char *name, path[MAXPATHLEN];
dirp = opendir(dir);
if (dirp == NULL)
return;
while ((direntp = readdir(dirp)) != NULL) {
name = direntp->d_name;
if ((strcmp(name, ".") == 0) || (strcmp(name, "..") == 0))
continue;
(void) sprintf(path, "%s/%s", dir, name);
if (chown(path, uid, gid) == -1) {
if (errno != ENOENT) {
(void) fprintf(stderr, "%s: ", permfile);
perror(path);
}
} else {
if ((chmod(path, mode) == -1) && (errno != ENOENT)) {
(void) fprintf(stderr, "%s: ", permfile);
perror(path);
}
}
}
(void) closedir(dirp);
}
/*****************************************************************************
* resetdevperm
*
* Clean up access of devices in /etc/logindevperm by resetting the
* owner/group/permissions back to the login pseudo user.
*
*****************************************************************************/
extern struct passwd puser; /* pseudo_user password entry */
static void
resetdevperm(char *ttyn)
{
logindevperm(ttyn, puser.pw_uid, puser.pw_gid);
}
#ifdef SUNAUTH
/*****************************************************************************
* login_conv():
*
* This is a conv (conversation) function called from the PAM
* authentication scheme. It returns the user's password when requested by
* internal PAM authentication modules and also logs any internal PAM error
* messages.
*****************************************************************************/
static int
login_conv(int conv_id, int num_msg, struct ia_message **msg,
struct ia_response **response, void *appdata_ptr)
{
struct ia_message *m;
struct ia_response *r;
char *temp;
int k;
#ifdef lint
conv_id = conv_id;
#endif
if (num_msg <= 0)
return (IA_CONV_FAILURE);
*response = (struct ia_response*)
calloc(num_msg, sizeof (struct ia_response));
if (*response == NULL)
return (IA_CONV_FAILURE);
(void) memset(*response, 0, sizeof (struct ia_response));
k = num_msg;
m = *msg;
r = *response;
while (k--) {
switch (m->msg_style) {
case IA_PROMPT_ECHO_OFF:
if (saved_user_passwd != NULL) {
r->resp = (char *) malloc(strlen(saved_user_passwd)+1);
if (r->resp == NULL) {
free_resp(num_msg, *response);
*response = NULL;
return (IA_CONV_FAILURE);
}
(void) strcpy(r->resp, saved_user_passwd);
r->resp_len = strlen(r->resp);
}
m++;
r++;
break;
case IA_ERROR_MSG:
if (m->msg != NULL) {
Debug ("login_conv: %s\n", m->msg);
}
m++;
r++;
break;
default:
Debug ("login_conv: Unexpected case %d\n",
m->msg_style);
break;
}
}
return (IA_SUCCESS);
}
/*****************************************************************************
* end_conv():
*
* End of conversation function. Called from PAM.
* Currently a noop for dtlogin.
*****************************************************************************/
static void
end_conv()
{}
#endif SUNAUTH
#ifdef PAM
/****************************************************************************
* Following Solaris utmp management code was taken from portions of the
* private libauth open and close session code. There are no equivalent calls
* in libpam that replaces it, so the code is copied to here. Eventually this
* code may become functions in either PAM or other appropriate libraries.
***************************************************************************/
#define INIT_PROC_PID 1
#define PAMTXD "SUNW_OST_SYSOSPAM"
#define SCPYN(a, b) (void) strncpy(a, b, sizeof (a))
/* utility function to do UTMP/WTMP management */
int
solaris_setutmp_mgmt(
char *user, /* user */
char *ttyn, /* ttyn */
char *rhost, /* remote hostname */
int flags, /* Flags - see below */
int type, /* type of utmp/wtmp entry */
char id[] /* 4 byte id field for utmp */
);
/*
* solaris_reset_utmp_mgmt
* a utility function which terminates UTMP/WTMP mgmt
*/
int
solaris_reset_utmp_mgmt(
char **user, /* user */
char **ttyn, /* tty name */
char **rhost, /* remote host */
int flags, /* flags - see below */
int status, /* logout process status */
char id[] /* logout ut_id (/etc/inittab id) */
);
/* flags for the flags field */
#define __NOOP 8 /* No utmp action desired */
/* __setproc_cred is a utility function to set process credentials */
int
__setproc_cred(
char *user, /* user */
int flags, /* flags - see below */
uid_t uid, /* User ID to set for this process */
gid_t gid, /* Group ID */
int ngroups, /* Number of groups */
gid_t *grouplist /* Group list */
);
/* flags indicates specific set credential actions */
#define __INITGROUPS 0x00000001 /* Request to initgroups() */
#define __SETGROUPS 0x00000002 /* Request to setgroups() */
#define __SETEGID 0x00000004 /* Set effective gid only */
#define __SETGID 0x00000008 /* Set real gid */
#define __SETEUID 0x00000010 /* Set effective uid only */
#define __SETUID 0x00000020 /* Set real uid */
#define __SETEID (__SETEGID|__SETEUID) /* Set effective ids only */
#define __SETRID (__SETGID|__SETUID) /* Set real ids */
/*
* solaris_setutmp_mgmt - A utility function used to do UTMP/WTMP management.
*
* "user" is the current username.
* "ttyn" is the tty name.
* "rhost" is the remote hostname.
* The following flags may be set in the "flags" field:
*
* SOLARIS_UPDATE_ENTRY No new entry will be created if utmp
* entry not found - return __NOENTRY
* SOLARIS_NOLOG Generate a wtmp/wtmpx entry only
* SOLARIS_LOGIN Caller is a login application - update
* utmp entry accordingly
*
* "type" is used to indicate the type of utmp/wtmp entry written
* (see also utmp.h and utmpx.h)
* "id is an optional application-defined 4 byte array that represents
* the /sbin/inittab id (created by the process that puts an entry in
* utmp).
*
* Upon successful completion, SOLARIS_SUCCESS is returned.
* Error values may include:
*
* SOLARIS_NOENTRY An entry for the specified process was not found
* SOLARIS_ENTRYFAIL Could not make/remove entry for specified process
*/
int
solaris_setutmp_mgmt(
char *user,
char *ttyn,
char *rhost,
int flags,
int type,
char id[])
{
int tmplen;
struct utmpx *u = (struct utmpx *)0;
struct utmpx utmp;
char *ttyntail;
int err = PAM_SUCCESS;
Debug("Enter: solaris_setutmp_mgmt()\n");
(void) memset((void *)&utmp, 0, sizeof (utmp));
(void) time(&utmp.ut_tv.tv_sec);
utmp.ut_pid = getpid();
if (rhost != NULL && rhost[0] != '\0') {
(void) strcpy(utmp.ut_host, rhost);
tmplen = strlen(rhost) + 1;
if (tmplen < sizeof (utmp.ut_host))
utmp.ut_syslen = tmplen;
else
utmp.ut_syslen = sizeof (utmp.ut_host);
} else {
(void) memset(utmp.ut_host, 0, sizeof (utmp.ut_host));
utmp.ut_syslen = 0;
}
(void) strcpy(utmp.ut_user, user);
/*
* Copy in the name of the tty minus the "/dev/" if a /dev/ is
* in the path name.
*/
if (!(flags&SOLARIS_LOGIN))
SCPYN(utmp.ut_line, ttyn);
ttyntail = ttyn;
utmp.ut_type = type;
if (id != NULL)
(void) memcpy(utmp.ut_id, id, sizeof (utmp.ut_id));
if ((flags & SOLARIS_NOLOG) == SOLARIS_NOLOG) {
updwtmpx(WTMPX_FILE, &utmp);
} else {
/*
* Go through each entry one by one, looking only at INIT,
* LOGIN or USER Processes. Use the entry found if flags == 0
* and the line name matches, or if the process ID matches if
* the UPDATE_ENTRY flag is set. The UPDATE_ENTRY flag is
* mainly for login which normally only wants to update an
* entry if the pid fields matches.
*/
if (flags & SOLARIS_LOGIN) {
while ((u = getutxent()) != NULL) {
if ((u->ut_type == INIT_PROCESS ||
u->ut_type == LOGIN_PROCESS ||
u->ut_type == USER_PROCESS) &&
((flags == SOLARIS_LOGIN && ttyn != NULL &&
strncmp(u->ut_line, ttyntail,
sizeof (u->ut_line)) == 0) ||
u->ut_pid == utmp.ut_pid)) {
if (ttyn)
SCPYN(utmp.ut_line,
(ttyn + sizeof ("/dev/") - 1));
if (id == NULL) {
(void) memcpy(utmp.ut_id, u->ut_id,
sizeof (utmp.ut_id));
}
(void) pututxline(&utmp);
break;
}
} /* end while */
endutxent(); /* Close utmp file */
}
if (u == (struct utmpx *)NULL) {
/* audit_login_main11(); */
if (flags & SOLARIS_UPDATE_ENTRY)
err = SOLARIS_NOENTRY;
else
(void) makeutx(&utmp);
}
else
updwtmpx(WTMPX_FILE, &utmp);
}
return (err);
}
/*
* solaris_reset_utmp_mgmt
* A utility function used to terminate UTMP/WTMP mgmt.
*
* "user" is the current username.
* "ttyn" is the tty name.
* "rhost" is the remote hostname.
* The following flags may be set in the "flags" field:
*
* SOLARIS_NOLOG Write a wtmp/wtmpx entry only
* SOLARIS_NOOP Ignore utmp/wtmp processing
*
* "status" is the logout process status.
* "id is an optional application-defined 4 byte array that represents
* the /sbin/inittab id (created by the process that puts an entry in
* utmp).
*
* Upon successful completion, PAM_SUCCESS is returned.
* Error values may include:
*
* SOLARIS_NOENTRY An entry for the specified process was not found
* SOLARIS_ENTRYFAIL Could not make/remove entry for specified process
*/
int
solaris_reset_utmp_mgmt(
char **user,
char **ttyn,
char **rhost,
int flags,
int status,
char id[])
{
struct utmpx *up;
struct utmpx ut;
int err = 0;
int pid;
Debug("Enter: solaris_reset_utmp_mgmt()\n");
pid = (int) getpid();
if ((flags & SOLARIS_NOLOG) == SOLARIS_NOLOG) {
/* only write to wtmp files */
/* clear utmpx entry */
(void) memset((char *)&ut, 0, sizeof (ut));
if (id != NULL)
(void) memcpy(ut.ut_id, id, sizeof (ut.ut_id));
if (*ttyn != NULL && **ttyn != '\0') {
if (strstr(*ttyn, "/dev/") != NULL)
(void) strncpy(ut.ut_line, (*ttyn+sizeof ("/dev/")-1),
sizeof (ut.ut_line));
else
(void) strncpy(ut.ut_line, *ttyn,
sizeof (ut.ut_line));
}
ut.ut_pid = pid;
ut.ut_type = DEAD_PROCESS;
ut.ut_exit.e_termination = 0;
ut.ut_exit.e_exit = 0;
ut.ut_syslen = 1;
(void) gettimeofday(&ut.ut_tv, NULL);
updwtmpx(WTMPX_FILE, &ut);
return (PAM_SUCCESS);
} else {
setutxent();
while (up = getutxent()) {
if (up->ut_pid == pid) {
if (up->ut_type == DEAD_PROCESS) {
/*
* Cleaned up elsewhere.
*/
endutxent();
return (0);
}
if ((*user = (char *) strdup (up->ut_user))
== NULL ||
(*ttyn = (char *) strdup (up->ut_line))
== NULL ||
(*rhost = (char *) strdup (up->ut_host))
== NULL)
return (PAM_BUF_ERR);
up->ut_type = DEAD_PROCESS;
up->ut_exit.e_termination = status & 0xff;
up->ut_exit.e_exit = (status >> 8) & 0xff;
if (id != NULL)
(void) memcpy(up->ut_id, id,
sizeof (up->ut_id));
(void) time(&up->ut_tv.tv_sec);
/*
* For init (Process ID 1) we don't write to
* init's pipe, since we are init.
*/
if (getpid() == INIT_PROC_PID) {
(void) pututxline(up);
/*
* Now attempt to add to the end of the
* wtmp and wtmpx files. Do not create
* if they don't already exist.
*/
updwtmpx("wtmpx", up);
} else {
if (modutx(up) == NULL) {
Debug("modutx failed\n");
/*
* Since modutx failed we'll
* write out the new entry
* ourselves.
*/
(void) pututxline(up);
updwtmpx("wtmpx", up);
}
}
endutxent();
return (PAM_SUCCESS);
}
}
endutxent();
return (SOLARIS_NOENTRY);
}
}
#endif PAM

View File

@@ -0,0 +1,86 @@
/* $XConsortium: solaris.h /main/7 1996/10/30 11:12:37 drk $ */
/*******************************************************************************
**
** solaris.h 1.9 95/09/10
**
** Copyright 1993, 1994, 1995 Sun Microsystems, Inc. All rights reserved.
**
** This file contains header info specific to Sun Solaris login
*******************************************************************************/
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*******************************************************************************
**
** RESTRICTED CONFIDENTIAL INFORMATION:
**
** The information in this document is subject to special
** restrictions in a confidential disclosure agreement between
** HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
** document outside HP, IBM, Sun, USL, SCO, or Univel without
** Sun's specific written approval. This document and all copies
** and derivative works thereof must be returned or destroyed at
** Sun's request.
**
** Copyright 1994 Sun Microsystems, Inc. All rights reserved.
**
*******************************************************************************/
#ifndef _DTLOGIN_SOLARIS_H
#define _DTLOGIN_SOLARIS_H
#include <sys/types.h>
#ifdef PAM
#include <security/pam_appl.h>
#define SOLARIS_SUCCESS PAM_SUCCESS
#endif
#ifdef SUNAUTH
#include <security/ia_appl.h>
#define SOALRIS_SUCCESS IA_SUCCESS
#endif
/* Solaris utmp mgt flags */
#define SOLARIS_UPDATE_ENTRY 1 /* Update an existing entry */
#define SOLARIS_NOLOG 2 /* Don't log the new session */
#define SOLARIS_LOGIN 4 /* login type entry (sigh...) */
/* Errors returned by solaris_setutmp_mgmt/solaris_reset_utmp_mgmt() */
#define SOLARIS_NOENTRY 27 /* No entry found */
#define SOLARIS_ENTRYFAIL 28 /* Couldn't edit the entry */
/* user credential UID/GID erros */
#define SOLARIS_BAD_GID 29 /* Invalid Group ID */
#define SOLARIS_INITGROUP_FAIL 30 /* group IDs init failed */
#define SOLARIS_BAD_UID 31 /* Invaid User ID */
#define SOLARIS_SETGROUP_FAIL 32 /* Set of group IDs failed */
/*
* External procedure declarations
*/
extern int solaris_authentication(char*, char*, char*, char*, char*);
extern int solaris_accounting(char*, char*, char[], char*,
char*, pid_t, int, int);
extern int solaris_setcred(char*, char *, uid_t, gid_t);
extern int solaris_setdevperm(char *, uid_t, gid_t);
extern int solaris_resetdevperm(char *);
extern int audit_login_save_host(char *host);
extern int audit_login_save_ttyn(char *ttyn);
extern int audit_login_save_port(void);
extern int audit_login_success(void);
extern int audit_login_save_pw(struct passwd *pwd);
extern int audit_login_bad_pw(void);
extern int audit_login_maxtrys(void);
#endif /* _DTLOGIN_SOLARIS_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,69 @@
/* $XConsortium: sysauth.h /main/4 1995/10/27 16:16:09 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/************************************<+>*************************************
****************************************************************************
**
** File: sysauth.h
**
** Project: HP Visual User Environment (DT)
**
** Description: Header file for system authentication routine
**
** Defines, structure definitions, and external declarations
** are specified here.
**
**
** (c) Copyright 1987, 1988, 1989 by Hewlett-Packard Company
**
**
**
****************************************************************************
************************************<+>*************************************/
#ifndef _SYSAUTH_H
#define _SYSAUTH_H
/****************************************************************************
*
* Defines
*
****************************************************************************/
/*
* Authenticate return codes...
*/
#define VF_OK 1
#define VF_INVALID 2
#define VF_HOME 3
#define VF_MAX_USERS 4
#define VF_PASSWD_AGED 5
#define VF_BAD_UID 6
#define VF_BAD_GID 7
#define VF_BAD_AID 8
#define VF_BAD_AFLAG 9
#define VF_NO_LOGIN 10
#define VF_BAD_HOSTNAME 11
#define VF_CHALLENGE 12
#define VF_MESSAGE 13
#ifdef BLS
#define VF_BAD_SEN_LEVEL 14
#endif
/****************************************************************************
*
* External procedure declarations
*
****************************************************************************/
extern int Authenticate(struct display *d, char *name, char *passwd,
char **msg) ;
#endif /* _SYSAUTH_H */

View File

@@ -0,0 +1,138 @@
/* $XConsortium: usl_ptty.c /main/3 1995/10/27 16:16:16 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/* usl_ptty.c: routines to perform USL's password authentication */
#include <stdio.h> /* just so file isn't empty */
#if defined (USL) || defined(__uxp__)
#include <sys/byteorder.h>
#include <termio.h>
#include <stropts.h>
#include <sys/stream.h>
#include <fcntl.h>
#include <utmpx.h>
#include <sys/types.h>
#include <pwd.h>
#include <errno.h>
#include <stdio.h>
#include <rx.h>
/* system calls */
extern int close();
extern int ioctl();
extern int getmsg();
/* externally defined routines */
extern int grantpt();
extern int unlockpt();
extern char *ptsname();
extern char *strncpy();
/* externally defined global variables */
int Termios_received = 0; /* received termios structure flag */
struct termios Termios; /* termios buffer */
#define RX_SLAVENAMELEN 32
/* locally defined global variables */
int Ptty_open; /* ptty open flag */
int Ptty_fd; /* master ptty fd */
int Slaveptty_fd; /* slave ptty fd */
char Slaveptty_name[RX_SLAVENAMELEN]; /* slave ptty device file name */
/*
* makepttypair()
*
* This function creates and opens a master/slave pair of pseudo ttys.
* It returns 0 for success, -1 for failure
*
*/
int
makepttypair()
{
char *ttyname; /* file name of slave pseudo tty */
pid_t mypid = getpid(); /* my process id */
struct passwd *pwp; /* password file entry */
Debug("makettypair\n");
if ((Ptty_fd = open("/dev/ptmx", O_RDWR)) == -1) {
Debug ("ptty: open ptmx failed, errno = %d\n", errno);
return(-1);
}
if (grantpt(Ptty_fd) == -1) {
Debug ("ptty: grantpt failed\n");
return(-1);
}
if (unlockpt(Ptty_fd) == -1) {
Debug ("ptty: unlockpt failed\n");
return(-1);
}
if ((ttyname = ptsname(Ptty_fd)) == NULL) {
Debug ("ptty: ptsname failed\n");
return(-1);
}
(void) strncpy(Slaveptty_name, ttyname, RX_SLAVENAMELEN);
if ((Slaveptty_fd = open(Slaveptty_name, O_RDWR)) == -1) {
Debug ("ptty: could not open pts %s, errno = %d\n",
Slaveptty_name, errno);
return(-1);
}
if (ioctl(Slaveptty_fd, I_PUSH, "ptem") == -1) {
Debug ("ptty: push ptem failed\n");
return(-1);
}
if (ioctl(Slaveptty_fd, I_PUSH, "ldterm") == -1) {
Debug ("ptty: push ldterm failed\n");
return(-1);
}
/*
* Note that since the following ioctl() is performed
* before the pckt module is pushed, it will not be sent back
* to the client. This is what we want.
*
*/
if (Termios_received)
if (ioctl(Slaveptty_fd, TCSETS, &Termios) == -1) {
Debug ("ptty: TCSETS failed\n");
return(-1);
}
if (ioctl(Ptty_fd, I_PUSH, "pckt") == -1) {
Debug ("ptty: push pckt failed\n");
return(-1);
}
/* disable ldterm input processing on server end */
if (ioctl(Ptty_fd, TIOCREMOTE, 1) == -1) {
Debug ("ptty: ioctl(TIOCREMOTE) failed\n");
return(-1);
}
Ptty_open = 1;
Debug ("ptty: pttys created\n");
return(0);
}
#endif /* USL || __uxp__ */

1206
cde/programs/dtlogin/util.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,618 @@
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* xdm - display manager daemon
*
* $TOG: verify.c /main/7 1998/11/02 15:25:40 mgreess $
*
* Copyright 1988 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Author: Keith Packard, MIT X Consortium
*/
/*
* verify.c
*
* typical unix verification routine.
*/
# include "dm.h"
# include "vgmsg.h"
# include "vgproto.h"
#include <X11/Xresource.h>
#ifdef _AIX
# include <usersec.h>
#endif
# include <pwd.h>
# ifdef NGROUPS
# include <grp.h>
# endif
#ifdef sun
# include <deflt.h>
#endif
struct passwd nobody = {
"Nobody", "***************"
};
static char *Pndefault = "/etc/default/login";
extern char *_ExpandLang( char *string, char *lang );
int
Verify(
struct display *d,
struct greet_info *greet,
struct verify_info *verify )
{
struct passwd *p;
char *shell, *home;
char **argv;
FILE *lastsession;
char last_sess[MAXPATHLEN];
int notify_dt;
int i;
Debug ("Verify(): %s\n", greet->name);
/*
* The user has already been verified by the Greeter. This is
* really just to look up the rest of his environment. Better
* performance would be realized by having the Greeter look this up
* and pass it back in the pipe (saving an additional getpwnam).
*/
p = getpwnam (greet->name);
if (!p || strlen (greet->name) == 0) {
Debug ("Can't get user information for %s\n", greet->name);
return 0;
}
#ifdef BYPASSLOGIN
Debug ("BypassLogin = %d\n",d->bypassLogin);
if ( d->bypassLogin ) {
char *s = NULL;
if ( !strcmp (p->pw_name, "Nobody" ))
s = "Greetless login failed; user invalid\n";
else if ( access ( p->pw_dir, F_OK ))
s = "Greetless login failed; bad user home dir access\n";
else if ( p->pw_uid == 0 )
s = "Greetless login failed; root bypass disallowed\n";
if (s) {
Debug(s); LogError((unsigned char *) s);
bzero(greet->password, strlen(greet->password));
return 0;
}
}
#endif /* BYPASSLOGIN */
#ifdef AthenaWidgets
#ifdef BYPASSLOGIN
if (strcmp(crypt(greet->password,p->pw_passwd),p->pw_passwd)
&& !d->bypassLogin) {
#else
if (strcmp(crypt(greet->password,p->pw_passwd),p->pw_passwd)) {
#endif /* BYPASSLOGIN */
Debug ("verify failed\n");
bzero(greet->password, strlen(greet->password));
return 0;
}
Debug ("verify succeeded\n");
bzero(greet->password, strlen(greet->password));
#endif
Debug ("User information for %s acquired\n", greet->name);
verify->uid = p->pw_uid;
#ifdef __AFS
if ( IsVerifyName(VN_AFS) ) {
(void)setgid(p->pw_gid);
verify->groups[2] = p->pw_gid;
}
#else
# ifdef NGROUPS
getGroups (greet->name, verify, p->pw_gid);
# else
verify->gid = p->pw_gid;
# endif
#endif /* __AFS */
#ifdef AUDIT
verify->audid = p->pw_audid;
verify->audflg = p->pw_audflg;
#endif
home = p->pw_dir;
shell = p->pw_shell;
argv = 0;
if(d->sessionType > NOTIFY_ALT_DTS)
notify_dt = NOTIFY_ALT_DTS;
else
notify_dt = d->sessionType;
switch (notify_dt) {
case NOTIFY_DT:
case NOTIFY_OK:
if(d->session)
argv = parseArgs (argv,d->session);
break;
case NOTIFY_ALT_DTS:
if((argv = setDt(d,argv,notify_dt)) == NULL)
/*if no startup file, startup the regular desktop*/
if(d->session) {
argv = parseArgs (argv,d->session);
Debug ("No Startup file \n");
}
break;
case NOTIFY_LAST_DT:
strcpy(last_sess,home);
strcat(last_sess,LAST_SESSION_FILE);
if((lastsession = fopen(last_sess,"r")) == NULL) {
/*
* if no lastsession file, execute the logically
* first alternate desktop
*/
if((argv = setDt(d,argv,notify_dt)) == NULL)
if(d->session) {
argv = parseArgs (argv,d->session);
/* No altdts, set the Default Regular session */
Debug ("No AltDestops in the resources file \n");
}
}
else{
strcpy(last_sess,"\0");
fgets(last_sess,MAXPATHLEN,lastsession);
if(access(last_sess, X_OK) != 0) {
if((argv = setDt(d,argv,notify_dt)) == NULL)
if(d->session){
argv = parseArgs (argv,d->session);
/* No altdts, set the Default Regular session */
Debug ("No AltDestops in the resources file setting to %s \n",argv[0]);
}
}
else {
argv = parseArgs (argv, last_sess);
}
fclose(lastsession);
}
break;
default:
break;
}
if (greet->string)
argv = parseArgs (argv, greet->string);
if (!argv)
argv = parseArgs (argv, "xsession");
verify->argv = argv;
verify->userEnviron = userEnv (d, greet->name, home, shell,p);
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");
#ifdef __osf__
if (setlogin(greet->name) == -1) {
Debug ("setlogin failed for %s, errno = %d\n", greet->name,
errno);
}
#endif /* __osf__ */
return 1;
}
char **
setDt(
struct display *d,
char **argv,
int dt_type)
{
int i;
char *resources = NULL;
char altdts[MAXPATHLEN];
char altdtsclass[MAXPATHLEN];
char altdtstart[MAXPATHLEN];
char altdtstartclass[MAXPATHLEN];
int adts;
XrmValue value_dts;
char *rmtype;
XrmValue rmvalue;
int altdtrequested;
if(!XresourceDB) {
Debug ("Verify - No resources \n");
return 0;
}
if(dt_type == NOTIFY_LAST_DT) {
sprintf(altdts,"%s","Dtlogin*altDts");
sprintf(altdtsclass,"%s","Dtlogin*AltDts");
if(XrmGetResource(XresourceDB, altdts, altdtsclass,
&rmtype, &value_dts) == True){
adts = atoi(value_dts.addr);
for(i = 0; i < adts; i++) {
sprintf(altdtstart,"%s%d","Dtlogin*altDtStart",i+1);
sprintf(altdtstartclass,"%s%d","Dtlogin*AltDtStart",i+1);
if(XrmGetResource(XresourceDB, altdtstart, altdtstartclass,
&rmtype, &rmvalue) == True){
Debug ("Start up file is %s\n",rmvalue.addr);
argv = parseArgs (argv, rmvalue.addr);
return argv;
}
}
}
}
else {
altdtrequested = d->sessionType - NOTIFY_ALT_DTS;
sprintf(altdtstart,"%s%d",
"Dtlogin*altDtStart",altdtrequested);
sprintf(altdtstartclass,"%s%d",
"Dtlogin*AltDtStart",altdtrequested);
if(XrmGetResource(XresourceDB, altdtstart, altdtstartclass,
&rmtype, &rmvalue) == True){
Debug ("Start up file is %s\n",rmvalue.addr);
argv = parseArgs (argv, rmvalue.addr);
return argv;
}
}
return 0;
}
char **
userEnv(
struct display *d,
char *user,
char *home,
char *shell,
struct passwd *p)
{
char **env;
char *value;
char **exp;
char *Def_path;
char *langlist;
#ifdef _AIX
/*
* For AIX, we must delimit protected variables. This is done by
* adding special tags to the environment list. The setpenv()
* routine serched the environent for these special tags.
*
* NOTE: If you change the location of PENV_SYSSTR or PENV_USRSTR
* in this environment list, you MUST change the index
* in session.c prior to the call to setpenv().
*/
env = 0;
env = setEnv(env,PENV_SYSSTR,""); /* protected vars */
env = setEnv(env,"LOGNAME",user);
env = setEnv(env,"LOGIN",user);
env = setEnv(env,PENV_USRSTR,""); /* regular vars */
#else
env = 0;
env = setEnv (env,"LOGNAME", user);
#endif
for (exp = exportList; exp && *exp; ++exp)
{
value = getenv (*exp);
if (value)
env = setEnv (env, *exp, value);
}
env = setEnv (env, "DISPLAY", d->name);
env = setEnv (env, "HOME", home);
env = setEnv (env, "USER", user);
#ifdef sun
if ((Def_path = login_defaults(p,d)) != NULL)
env = setEnv (env, "PATH", Def_path);
#else
if (d->userPath && strlen(d->userPath) > 0)
env = setEnv (env, "PATH", d->userPath);
#endif
env = setEnv (env, "SHELL", shell);
if (timeZone && strlen(timeZone) > 0 )
env = setEnv(env, "TZ", timeZone);
if ( d->langList && strlen(d->langList) > 0 )
langlist = d->langList;
#if defined (ENABLE_DYNAMIC_LANGLIST)
if (d->language && strlen(d->language) > 0)
langlist = d->language;
#else
else if (languageList && strlen(languageList) > 0 )
langlist = languageList;
#endif /* ENABLE_DYNAMIC_LANGLIST */
if (d->language && strlen(d->language) > 0)
env = setLang(d, env, langlist);
#if 0 /* setting LC_ALL can cause undesirable side effects -- bf@hp */
/*
* Don't set LC_MESSAGES to LANG since:
* 1) if LC_MESSAGES is unset, it will by default take on the value of LANG
* 2) if set, we don't want to override the user's setting
*/
env = setEnv (env, "LC_ALL", d->language);
env = setEnv (env, "LC_MESSAGES", d->language);
#endif
#if 0 /* setting XAUTHORITY here is a bug, needs further study... */
if (d->authFile)
env = setEnv (env, "XAUTHORITY", d->authFile);
#endif
if (d->displayType.location != Local)
env = setEnv (env, XFORCEINTERNET, "True");
if (d->environStr && strlen(d->environStr) > 0)
env = parseEnv(env, d->environStr);
/*
* set SESSIONTYPE environment variable if requested by user, or
* if the "dtlite" resource is set...
*
* Note: the dtlite resource takes precedence over xdmMode.
*/
if (d->dtlite == True)
d->sessionType = NOTIFY_DTLITE;
else if (d->xdmMode == True)
d->sessionType = NOTIFY_XDM;
switch (d->sessionType) {
case NOTIFY_DTLITE:
Debug("Setting SESSIONTYPE to 'dtlite'.\n");
env = setEnv(env, SESSIONTYPE, "dtlite");
break;
case NOTIFY_XDM:
Debug("Setting SESSIONTYPE to 'xdm'.\n");
env = setEnv(env, SESSIONTYPE, "xdm");
break;
case NOTIFY_DT:
Debug("Setting SESSIONTYPE to 'dt'.\n");
env = setEnv(env, SESSIONTYPE, "dt");
break;
default:
Debug("SESSIONTYPE NOT set.\n");
break;
}
return env;
}
/*
* read login defaults
*/
#ifdef sun
char *
login_defaults(
struct passwd *p,
struct display *d )
{
extern int defcntl();
register int flags;
register char *ptr;
char *Def_path;
char final_path[MAXPATHLEN];
char *element;
if (defopen(Pndefault) == 0) {
/*
* ignore case
* code taken from login.c
*/
flags = defcntl(DC_GETFLAGS, 0);
TURNOFF(flags, DC_CASE);
defcntl(DC_SETFLAGS, flags);
if ( p->pw_uid == 0 ) {
if ((Def_path = defread("SUPATH=")) != NULL)
Def_path = strdup(Def_path);
else
Def_path = DEF_SUPATH;
}
else {
if ((Def_path = defread("PATH=")) != NULL)
Def_path = strdup(Def_path);
else
Def_path = DEF_PATH;
}
}
/*
* close the file..(/etc/default/login)
*/
(void) defopen((char *)NULL);
Debug ("login_defaults(): \n");
if (d->userPath && strlen(d->userPath) > 0) {
if(Def_path && strlen(Def_path) > 0)
element = strtok(Def_path,":");
else
return d->userPath;
strcpy(final_path,d->userPath);
while(element) {
if((strstr(d->userPath,element)) == NULL) {
strcat (final_path,":");
strcat (final_path,element);
}
element = strtok(NULL,":");
}
return final_path;
}
else {
if(Def_path && strlen(Def_path) > 0)
return Def_path;
else
return 0;
}
}
#endif
char **
systemEnv( struct display *d, char *user, char *home )
{
char **env;
char *value;
char **exp;
char *langlist;
env = 0;
for (exp = exportList; exp && *exp; ++exp)
{
value = getenv (*exp);
if (value)
env = setEnv (env, *exp, value);
}
value = getenv("TZ");
if (value)
env = setEnv (env, "TZ", value);
else if (timeZone && strlen(timeZone) > 0 )
env = setEnv(env, "TZ", timeZone);
env = setEnv (env, "DISPLAY", d->name);
if (home)
env = setEnv (env, "HOME", home);
if (user)
env = setEnv (env, "USER", user);
env = setEnv (env, "PATH", d->systemPath);
env = setEnv (env, "SHELL", d->systemShell);
if ( d->langList && strlen(d->langList) > 0 )
langlist = d->langList;
#if defined (ENABLE_DYNAMIC_LANGLIST)
else if (d->language && strlen(d->language) > 0 )
langlist = d->language;
#else
else if (languageList && strlen(languageList) > 0 )
langlist = languageList;
#endif /* ENABLE_DYNAMIC_LANGLIST */
if (d->language && strlen(d->language) > 0)
env = setLang(d, env, langlist);
if (d->displayType.location != Local)
env = setEnv (env, XFORCEINTERNET, "True");
#if defined (sun)
if (getEnv (env, "OPENWINHOME") == NULL)
env = setEnv(env, "OPENWINHOME", "/usr/openwin");
#endif
return env;
}
#ifdef NGROUPS
#ifndef __hpux
/*
* groupMember() not used in HP-UX
*/
int
groupMember(
char *name,
char **members )
{
while (*members) {
if (!strcmp (name, *members))
return 1;
++members;
}
return 0;
}
#endif /* ! __hpux */
void
getGroups(
char *name,
struct verify_info *verify,
int gid )
{
int ngroups;
struct group *g;
int i;
ngroups = 0;
verify->groups[ngroups++] = gid;
setgrent ();
/*
* if your system does not support "initgroups(3C)", activate
* this code...
*/
#if !(defined(__hpux) || defined(__osf__))
while ( (g = getgrent()) != NULL ) {
/*
* make the list unique
*/
for (i = 0; i < ngroups; i++)
if (verify->groups[i] == g->gr_gid)
break;
if (i != ngroups)
continue;
if (groupMember (name, g->gr_mem)) {
if (ngroups >= NGROUPS)
LogError(ReadCatalog(MC_LOG_SET,
MC_LOG_MORE_GRP,MC_DEF_LOG_MORE_GRP),
name, NGROUPS, g->gr_name);
else
verify->groups[ngroups++] = g->gr_gid;
}
}
#endif
verify->ngroups = ngroups;
endgrent ();
}
#endif

View File

@@ -0,0 +1,56 @@
/* $XConsortium: version.c /main/6 1996/08/30 15:33:21 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
* (c) Copyright 1993,1994,1996 International Business Machines Corp.
* (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
* (c) Copyright 1993,1994,1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/********************************************************
Copyright (c) 1988, 1990 by Hewlett-Packard Company
Copyright (c) 1988 by the Massachusetts Institute of Technology
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the names of
Hewlett-Packard or M.I.T. not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.
********************************************************/
#include <include/hpversion.h>
#ifndef lint
version_tag("dtlogin: $XConsortium: version.c /main/6 1996/08/30 15:33:21 drk $")
#ifdef __AFS
static char _afs_version[] = "@(#)AFS 3 Authentication";
#endif
#ifdef __KERBEROS
static char _krb_version[] = "@(#)Kerberos Authentication";
#endif
#ifdef __PASSWD_ETC
static char _rgy_version[] = "@(#)Passwd Etc. - Domain Registry Authentication";
#endif
#ifdef BLS
static char _bls_version[] = "@(#)HP BLS Authentication";
#endif
#endif /* lint */

403
cde/programs/dtlogin/vg.h Normal file
View File

@@ -0,0 +1,403 @@
/* $TOG: vg.h /main/10 1998/09/14 18:30:15 mgreess $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/************************************<+>*************************************
****************************************************************************
**
** File: vg.h
**
** Project: HP Visual User Environment (DT)
**
** Description: Main header file for Dtgreet application.
**
** Defines, structure definitions, and external declarations
** are specified here.
**
**
** (c) Copyright 1987, 1988, 1989 by Hewlett-Packard Company
**
**
**
****************************************************************************
************************************<+>*************************************/
#ifndef _VG_H
#define _VG_H
#include <X11/Xosdefs.h>
#include <errno.h>
#ifdef X_NOT_STDC_ENV
extern int errno;
#endif
#include <sys/errno.h>
#include <sys/param.h>
#include <stdlib.h>
#include <Xm/Xm.h>
#include "vgproto.h"
#ifdef BLS
# include <sys/security.h>
#endif
#ifdef SIGNALRETURNSINT
#define SIGVAL int
#else
#define SIGVAL void
#endif
/****************************************************************************
*
* Defines
*
****************************************************************************/
/*
* SAIC DT copyright is in a dt directory
*/
#if defined( _SUN_OS )
# define COPYRIGHT "/usr/lib/X11/dt/etc/copyright"
#else
# if defined( __hp_osf )
# define COPYRIGHT "/usr/X11/copyright"
# else
# define COPYRIGHT "/etc/copyright"
# endif
#endif
#define NO_LOGIN_FILE "/etc/nologin"
#define DTLITESESSION "/usr/dt/bin/dtlitesession"
#define LOGIN_STR_LEN 1024
/*
* option menu items...
*/
#define OB_RESTART_SERVER 1
#define OB_NO_WINDOWS 2
#define OB_COPYRIGHT 3
#define OB_FAILSAFE 4
#define OB_LANGUAGE 5
#define OB_DTLITE 6
#define OB_DT 7
#define OB_ALT_DTS 8
#define OB_LAST_DT 10
#ifndef LAST_SESSION_FILE
#define LAST_SESSION_FILE "/.dt/sessions/lastsession"
#endif
#ifndef DEF_SESSION
#define DEF_SESSION CDE_INSTALLATION_TOP "/bin/Xsession"
#endif
/*
* default resources... (Dimensions are in units of 100TH_MILLIMETER)
*
* - width/height of main matte
* - percentage offsets of login matte within main matte
* - shadow thickness
* - margin height for message box buttons
* - fonts
* - colors
*/
#ifndef XmNPIXELS
#define XmNPIXELS "PIXELS"
#endif
#ifndef XmN100TH_MILLIMETERS
#define XmN100TH_MILLIMETERS "100TH_MILLIMETERS"
#endif
#define VnNmatteUnitType "Dtlogin*matte.unitType"
#define VnNmatteWidth "Dtlogin*matte.width"
#define VnNmatteHeight "Dtlogin*matte.height"
#define VnCMatteUnitType "Dtlogin*Form.UnitType"
#define VnCMatteWidth "Dtlogin*Form.Width"
#define VnCMatteHeight "Dtlogin*Form.Height"
#define MATTE_WIDTH 18500
#define MATTE_HEIGHT 6746
#define HRES_MATTE_WIDTH "835" /* pixels */
#define HRES_MATTE_HEIGHT "425" /* pixels */
#define MRES_MATTE_WIDTH "775" /* pixels */
#define MRES_MATTE_HEIGHT "400" /* pixels */
#define LRES_MATTE_WIDTH "585" /* pixels */
#define LRES_MATTE_HEIGHT "300" /* pixels */
#define LOGIN_TOP_POSITION "31" /* percent */
#define LOGIN_BOTTOM_POSITION "79" /* percent */
#define LOGIN_LEFT_POSITION "12" /* percent */
#define LOGIN_RIGHT_POSITION "88" /* percent */
#define SHADOW_THICKNESS FromMM(100) /* general border size */
#define ETCH_THICKNESS FromMM(150) /* login etch thickness */
#define MBOX_MARGIN_WIDTH FromMM(300)
#define MBOX_MARGIN_HEIGHT FromMM(300)
#define DROP_SHADOW_THICKNESS FromMM(400) /* logo drop shadow size */
/*#define MIN_BUTTON_SIZE FromMM(3600) minimum button size */
#define MIN_BUTTON_SIZE FromMM(3100) /* minimum button size */
#define TEXT_MARGIN_WIDTH FromMM(200) /* text wgt margin width */
#define TEXT_MARGIN_HEIGHT FromMM(100) /* text wgt margin height */
# define LABEL_FONT "-*-swiss 742-bold-r-normal-*-140-*-p-100-*"
# define LABEL_FONT_HRES "-*-swiss 742-medium-r-normal-*-140-*-p-110-*"
# define TEXT_FONT "-*-prestige-medium-r-normal-*-128-72-*"
# define TEXT_FONT_LRES "-*-helvetica-bold-r-normal-*-100-*"
# define GREET_FONT "-*-*schoolbook-medium-i-normal--18-*"
#if 0
# define GREET_FONT "-*-*schoolbook-medium-i-normal--18-*-*-*-*-*-ISO8859-1"
#endif
#define TABLE_BACKGROUND "black"
#define TEXT_FOREGROUND "white"
#define BW_BACKGROUND "white"
#define BW_FOREGROUND "black"
#define BW_TEXT_BACKGROUND "black"
#define BW_LOGO_BACKGROUND "#a8a8a8"
#define BW_LOGO_TOPSHPIXMAP "25_foreground"
#define BW_DROP_BACKGROUND "black"
#define BW_DROP_FOREGROUND "white"
#define BW_DROP_BACKPIXMAP "25_foreground"
/*
* define colors by rgb value rather than name. On other systems the name
* may map to a different shade of the desired color.
*
* on hp-ux...
*
* #a8a8a8 = lightgray
* #7e7e7e = gray
* #ef506f = burgundy
*
*/
#define CO_BACKGROUND "#a8a8a8"
#define CO_FOREGROUND "black"
#define CO_TEXT_BACKGROUND "#7e7e7e"
#define CO_HIGHLIGHT "#ef506f"
#define CO_SELECTCOLOR "#ef506f"
#define CO_LOGO_BACKGROUND "#ef506f"
#define CO_LOGO_TOPSHPIXMAP "25_foreground"
#define CO_DROP_BACKGROUND "#7e7e7e"
#define CO_DROP_FOREGROUND "#7e7e7e"
#define CO_DROP_BACKPIXMAP "background"
/*
* macros to use when differentiating on resolution...
*/
#define HIRES (dpyinfo.width > 1200) /* SUN MED_RES = 1182 */
#define MEDRES (dpyinfo.width > 800 && dpyinfo.width <= 1200)
#define LOWRES (dpyinfo.width <= 800)
/*
* macro to determine authentication mechanism name...
*/
#define vg_IsVerifyName(n) \
((strcmp(getenv(VERIFYNAME),(n)) == 0 ) ? TRUE : FALSE)
/****************************************************************************
*
* Structure definitions
*
****************************************************************************/
typedef enum widgetType { CascadeBG, DrawingA, Frame, Form, MessageBox,
Label, LabelG, PushB, PushBG, SeparatorG,
ToggleB, ToggleBG, Text }
WidgetType;
typedef enum dialogType { error, help, copyright, hostname, expassword,
help_chooser }
DialogType;
typedef struct {
Boolean workspaceCursor;/* whether to define a root window cursor */
XmFontList labelFont; /* font for labels and buttons */
XmFontList textFont; /* font for dialog text */
XmFontList chlistFont; /* font for chooser list and heading */
int optionsDelay; /* seconds to delay before building menu */
int altDts; /* number of alternate desktops */
char *languageList; /* list of languages to display in menu */
int unitType; /* widgets' unit type */
char *languageListCmd; /* command to produce language list */
} AppInfo, *AppInfoPtr;
typedef struct displayInfo {
Display *dpy; /* initialized with XtDisplay() */
char *name; /* ASCII name of the display being used */
int screen; /* initialized with DefaultScreen() */
Window root; /* initialized with RootWindow() */
int depth; /* initialized with DefaultDepth() */
int width; /* initialized with DisplayWidth() */
int height; /* initialized with DisplayHeight() */
Pixel black_pixel; /* initialized with BlackPixel() */
Visual *visual; /* initialized with DefaultVisual() */
} DisplayInfo;
typedef struct {
char *bitmapFile; /* bitmap file (if any) */
} LogoInfo, *LogoInfoPtr;
typedef struct {
int bEcho; /* True=echoOn, False=echoOff */
Widget text[2]; /* [0] is echoOff, [1] is echoOn */
String onGreeting; /* echoOn greeting */
char *offGreetingFormat; /* printf format for echoOff greeting */
char *offGreetingUname; /* insert for echoOff greeting */
char noechobuf[MAXPATHLEN+1]; /* alternate buffer for echoOff */
} LoginText, *LoginTextPtr;
/****************************************************************************
*
* External variable declarations
*
****************************************************************************/
extern Arg argt[]; /* used for resources */
extern DisplayInfo dpyinfo; /* information about the display */
extern char *errorLogFile; /* name of error log file (if any) */
extern char *langenv; /* current value of LANG environment var. */
extern XmString xmstr; /* used for compound strings */
extern int showVerifyError;/* display a Verify() error dialog */
extern AppInfo appInfo; /* application resources */
extern Widget toplevel; /* top level shell widget */
extern Widget login_shell; /* shell for the main login widgets. */
extern Widget table; /* black background for everything */
extern Widget matte; /* main level form widget */
extern Widget matteFrame; /* main level form widget */
extern Widget matte1; /* main level form widget */
extern Widget greeting; /* Welcome message */
extern Widget dt_label; /* Desktop label set in options menu */
extern Widget logo1; /* frame around the Corporate logo */
extern Widget logo_pixmap; /* Corporate logo */
extern Widget logo_shadow; /* drop shadow under the Corporate logo */
extern Widget login_matte; /* bulletin board for login/password */
extern Widget login_form; /* form containing the login extern Widgets */
extern Widget login_label; /* label to left of login text widget */
extern Widget login_text; /* login text widget */
extern Widget passwd_form; /* form containing the password widgets */
extern Widget passwd_label; /* label to left of password text widget */
extern Widget passwd_text; /* password text widget */
extern Widget ok_button; /* accept name/password text button */
extern Widget clear_button; /* clear name/password text button */
extern Widget options_button; /* login options button */
extern Widget help_button; /* help button */
extern Widget copyright_msg; /* copyright notice widget */
extern Widget help_message; /* the help message box */
extern Widget error_message; /* the error message box */
extern Widget hostname_message; /* the invalid hostname message box */
extern Widget passwd_message; /* the password expired message box */
extern Widget options_menu; /* pop-up menu on options button */
extern Widget options_item[]; /* items on options pop_up menu */
extern Widget options_failsafe; /* failsafe pane on options pop_up menu */
extern Widget options_dtlite; /* dtlite pane on options pop_up menu */
extern Widget options_dt; /* dt pane on options pop_up menu */
extern Widget *alt_dts; /* alt_dts widgets on options pop_up menu */
extern Widget options_last_dt; /* toggle button for user's last dt */
extern Widget options_sp_dt; /* toggle for user's special dt */
extern Widget lang_menu; /* cascading menu on "Language" option */
extern LogoInfo logoInfo; /* logo resources */
/****************************************************************************
*
* Macro definitions
*
****************************************************************************/
#define vg_TRACE_EXECUTION(str) \
LogError((unsigned char *)"VG_TRACE: %s\n", str)
/****************************************************************************
*
* External procedure declarations
*
****************************************************************************/
extern void ChangeBell( char *string) ;
extern void CleanupAndExit( Widget w, int exit_code) ;
extern void ClearCB( Widget w, XtPointer client_data, XtPointer call_data) ;
extern void CloseCatalog();
extern void CopyrightCB( Widget w, XtPointer client_data, XtPointer call_data) ;
extern void EditPasswdCB( Widget w, XtPointer client, XtPointer call_data) ;
extern void FakeFocusIn( Widget focus_widget, XtPointer client_data,
XEvent *eventprm,
Boolean *continue_to_dispatch) ;
extern int FromMM( int mm ) ;
extern int FromPixel( Widget w, int orientation, int pixel) ;
extern void GetBiggest( Widget widget, Dimension *width, Dimension *height) ;
extern LoginTextPtr GetLoginTextPtr( Widget w );
extern int InitArg( WidgetType wtype) ;
extern void LangItemCB( Widget w, XtPointer client_data, XtPointer call_data) ;
extern void LayoutCB( Widget w, XtPointer client_data, XtPointer call_data) ;
extern void LogError( unsigned char *fmt, ... );
extern void MakeDialog( DialogType dtype) ;
extern void MakeLangMenu( void ) ;
extern void MakeLogo( void ) ;
extern void MakeOptionsMenu( void ) ;
extern void MenuItemCB( Widget w, XtPointer client_data, XtPointer call_data) ;
extern void OpenCatalog();
extern void OptionsUnmapCB( Widget wd, XtPointer client_data, XtPointer call_data) ;
extern void PingServerCB( XtPointer call_data, XtIntervalId *id) ;
extern void PostMenuCB( Widget w, XtPointer client_data, XtPointer call_data);
extern unsigned char * ReadCatalog( int set_num, int msg_num, char *def_str) ;
extern XmString ReadCatalogXms( int set_num, int msg_num, char *def_str) ;
extern void RefreshEH( Widget w, XtPointer client_data, XEvent *event,
Boolean *continue_to_dispatch) ;
extern void RequestCB( XtPointer client_data, int *source, XtInputId *id);
extern void RespondExitCB( Widget w, XtPointer client, XtPointer call);
extern void RespondLangCB( Widget w, XtPointer client, XtPointer call);
extern void RespondChallengeCB(Widget w, XtPointer client, XtPointer call);
extern void RespondClearCB(Widget w, XtPointer client, XtPointer call);
extern void RespondDialogCB(Widget w, XtPointer client, XtPointer call_data);
extern int SecureDisplay( void ) ;
extern void SetResourceDatabase( void ) ;
extern void ShowDialogCB( Widget w, XtPointer dialog, XtPointer call_data) ;
extern void TextFocusCB( Widget w, XtPointer client_data, XtPointer call_data) ;
extern int ToPixel( Widget w, int orientation, int pixel) ;
extern void UnsecureDisplay( void ) ;
extern void SetDtLabelAndIcon( void );
extern void SetDefaultDt( Widget w );
#ifndef _DM_H
extern int Verify( char *name, char *passwd) ;
#endif
#endif /* _VG_H */

View File

@@ -0,0 +1,346 @@
/* $XConsortium: vgapollo.c /main/4 1995/10/27 16:17:06 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/************************************<+>*************************************
****************************************************************************
**
** File: vgapollo.c
**
** Project: HP Visual User Environment (DT)
**
** Description: Dtgreet user authentication routines for Domain/OS 10.4
**
** These routines validate the user; checking name, password,
** home directory, password aging, etc.
**
**
** (c) Copyright 1987, 1988, 1989 by Hewlett-Packard Company
**
**
** Conditional compiles:
**
** __apollo Domain OS only
**
****************************************************************************
************************************<+>*************************************/
#include <stdio.h> /* placed here so file isn't empty */
#include "vgmsg.h"
#ifdef __apollo
/***************************************************************************
*
* Includes & Defines
*
***************************************************************************/
#include <pwd.h>
#include <apollo/base.h>
#include <apollo/error.h>
#include "apollo/passwd.h" /* copy of <apollo/sys/passwd.h> */
#include "apollo/login.h" /* copy of <apollo/sys/login.h> */
#include "apollo/rgy_base.h"
#include "vg.h"
#define SCMPN(a, b) strncmp(a, b, sizeof(a))
#define SCPYN(a, b) strncpy(a, b, sizeof(a))
#define eq(a,b) !strcmp(a,b)
#define NMAX strlen(name)
#define HMAX strlen(host)
#define STRING(str) (str), (short) strlen(str)
#define STRNULL(s, l) ((s)[(l)] = '\0')
#define ISTRING(str) (str), (int) strlen(str)
/***************************************************************************
*
* External declarations
*
***************************************************************************/
/***************************************************************************
*
* Procedure declarations
*
***************************************************************************/
static boolean CheckLogin( char *user, char *passwd, char *host,
status_$t *status)
static boolean CheckPassword( char *user, char *passwd) ;
static int PasswordAged( register struct passwd *pw) ;
/***************************************************************************
*
* Global variables
*
***************************************************************************/
rgy_$policy_t policy;
rgy_$acct_user_t user_part;
rgy_$acct_admin_t admin_part;
extern struct passwd * getpwnam_full();
/***************************************************************************
*
* Stub routines
*
***************************************************************************/
/***************************************************************************
*
* CheckLogin
*
* check validity of user name, password and other login parameters
*
***************************************************************************/
static boolean
CheckLogin( char *user, char *passwd, char *host, status_$t *status)
{
ios_$id_t logid;
login_$opt_set_t opts;
login_$set_host(host, strlen(host));
opts = login_$no_setsid_sm |
login_$no_setwd_sm |
login_$no_prompt_pass;
if ( !login_$chk_login(opts,
STRING(user),
STRING(passwd),
(login_$open_log_p) NULL,
STRING(""),
&logid,
status)) {
return(false);
} else
return(true);
}
/***************************************************************************
*
* CheckPassword
*
* check validity of just user name and password
***************************************************************************/
static boolean
CheckPassword( char *user, char *passwd )
{
login_$ptr lptr;
status_$t status;
login_$open((login_$mode_t) 0, &lptr, &status);
if (status.all == status_$ok)
login_$set_ppo(lptr, STRING(user), &status);
if (status.all == status_$ok)
login_$ckpass(lptr, STRING(passwd), &status);
return (status.all == status_$ok);
}
/***************************************************************************
*
* PasswordAged
*
* see if password has aged
***************************************************************************/
static int
PasswordAged( register struct passwd *pw )
{
boolean lrgy;
/* Account validity checks: If we were able to connect to the network
* registry, then we've acquired account and policy data and can perform
* account/password checking
*/
lrgy = rgy_$using_local_registry();
if ( !lrgy ) {
/* Check for password expiration or invalidity */
if (rgy_$is_passwd_expired(&user_part, &policy ) == true ||
rgy_$is_passwd_invalid(&user_part) == true) {
return TRUE;
}
}
return FALSE;
}
/***************************************************************************
*
* Verify
*
* verify the user
*
* return codes indicate authentication results.
***************************************************************************/
#define MAXATTEMPTS 5
extern Widget focusWidget; /* login or password text field */
struct passwd nouser = {"", "nope"}; /* invalid user password struct */
int
Verify( char *name, char *passwd )
{
static int login_attempts = 0; /* # failed authentications */
struct passwd *p; /* password structure */
char *host; /* host that login is coming in from */
status_$t status; /* status code returned by CheckLogin */
int n;
host = dpyinfo.name;
/*
* look up entry from registry...
*
* need getpwnam_full to get policy data for passwd expiration
* or invalidity...
*/
p = getpwnam_full(name, &user_part, &admin_part, &policy);
/* p = getpwnam(name);*/
if (!p || strlen(name) == 0 || p->pw_name == NULL )
p = &nouser;
/*
* validate user/password...
*/
if (!CheckLogin(name, passwd, host, &status)) {
/*
* if verification failed, but was just a name check, prompt for
* password...
*/
if ( focusWidget != passwd_text )
return (VF_INVALID);
/*
* if maximum number of attempts exceeded, log failure...
*/
if ((++login_attempts % MAXATTEMPTS) == 0 ) {
#ifdef peter
syslog(LOG_CRIT,
"REPEATED LOGIN FAILURES ON %s FROM %.*s, %.*s",
"??", HMAX, host, NMAX, name);
#endif
}
/*
* check status codes from verification...
*/
switch (status.all) {
case login_$logins_disabled: /* logins are disabled */
if (p->pw_uid != 0)
return(VF_NO_LOGIN);
else
if (!CheckPassword(name,passwd))
return(VF_INVALID);
break;
case login_$inv_acct: /* invalid account */
if ( PasswordAged(p) )
return(VF_PASSWD_AGED);
else
return(VF_INVALID);
break;
default: /* other failed verification */
return(VF_INVALID);
break;
}
}
/*
* verify home directory exists...
*/
if (chdir(p->pw_dir) < 0) {
if (chdir("/") < 0)
return(VF_HOME);
else
LogError(ReadCatalog(
MC_LOG_SET,MC_LOG_NO_HMDIR,MC_DEF_LOG_NO_HMDIR),
p->pw_dir, name);
}
/*
* validate uid and gid...
*/
if ((p->pw_gid < 0) ||
(setgid(p->pw_gid) == -1)) {
return(VF_BAD_GID);
}
if ((p->pw_uid < 0) ||
(seteuid(p->pw_uid) == -1)) {
return(VF_BAD_UID);
}
/*
* verify ok...
*/
return(VF_OK);
}
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,539 @@
/* $TOG: vglang.c /main/7 1998/03/04 19:28:18 mgreess $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/****************************************************************************
**
** File: ui.c
**
** Project: Common Desktop Environment
**
** Description: common ui code for login manager
**
**
****************************************************************************
************************************<+>*************************************/
/***************************************************************************
*
* Includes
*
***************************************************************************/
#include <stdio.h>
#include "vg.h"
#include "vgmsg.h"
#include <Xm/CascadeBG.h>
#include <Xm/RowColumn.h>
#include <Xm/ToggleBG.h>
/***************************************************************************
*
* GetLangName
*
* Convert an actual locale name to a meaningful language name which will
* be shown in the language menu. This function may be platform dependent.
***************************************************************************/
static char *
GetLangName( char *label )
{
/*
* Default implementation is to use langName resource. Language names can be
* set in Dtlogin file as follows. (In this case, en_US is a locale name which
* can be set to LANG environment variable.
*
* Dtlogin*en_US*languageName: English (ISO8859-1)
*/
char rmname[50];
char rmclass[50];
char *rmtype;
XrmValue rmvalue;
sprintf(rmname, "Dtlogin*%s*languageName", label);
sprintf(rmclass, "Dtlogin*%s*LanguageName", label);
if(XrmGetResource(XtDatabase(dpyinfo.dpy), rmname, rmclass, &rmtype,
&rmvalue)) {
return(rmvalue.addr);
}
else
return(NULL);
}
#if defined (ENABLE_DYNAMIC_LANGLIST)
/***************************************************************************
*
* Methods for dynamic language list
*
***************************************************************************/
/*
* _enumLangCmdStart() - start enumeration of languages and descriptions
*
* The command specified by Dtlogin*languageListCmd command returns
* the list of locales and a translated description of each.
*/
static void *
_enumLangCmdStart(void)
{
if (appInfo.languageListCmd)
{
return((void *)popen(appInfo.languageListCmd, "r"));
}
return(NULL);
}
/*
* _enumLangCmdNext() - get next language description pair
* note: *lang and *desc must be freed by free()
*
* Read the next locale and description from pipe. Default description
* comes from system, but user may override with Xresources description.
*/
static Boolean
_enumLangCmdNext(
void *state,
char **lang,
char **desc)
{
char buf[200];
Boolean rc = False;
if (fgets(buf, sizeof(buf), (FILE *)state) != NULL)
{
/*
* The buf format is "locale desc ...\n". For example:
*
* pl_PL Polish ISO8859-2
* pt_BR Portuguese (Brazil) ISO8859-1
*/
char *loclang = strtok(buf, " "); /* lang name from system */
char *locdesc = strtok(NULL, "\n"); /* description from system */
char *userdesc; /* user provided description from Xresources */
if ((userdesc = GetLangName(loclang)) != NULL)
{
locdesc = userdesc; /* use user provided description */
}
*lang = strdup(loclang);
*desc = strdup(locdesc);
rc = True;
}
return(rc);
}
/*
* _enumLangCmdEnd() - end enumeration of language names and descriptions
*
* Close pipe.
*/
static void
_enumLangCmdEnd(
void *state)
{
pclose((FILE *)state);
}
#endif /* ENABLE_DYNAMIC_LANGLIST */
/***************************************************************************
*
* Methods for language list of type 'LANGLIST'
*
***************************************************************************/
#define DELIM " \t" /* delimiters in language list */
struct _enumState
{
char *dupstr;
char *tokstr;
};
/*
* _enumLanglistStart() - start enumeration of languages and descriptions
*
* Dtlogin sets up the LANGLIST env var which contains the list
* of locale names to display in the language menus.
*/
static void *
_enumLanglistStart(void)
{
char *p;
struct _enumState *state = malloc(sizeof(struct _enumState));
if (state)
{
if ((p = (char *)getenv(LANGLIST)) == NULL )
{
free(state);
state = NULL;
}
else
{
state->dupstr = strdup(p);
state->tokstr = state->dupstr;
}
}
return((void *)state);
}
/*
* _enumLanglistNext() - get next language description pair
* note: *lang and *desc must be freed by free()
*
* Get next locale from LANGLIST and get possible description from
* Xresources.
*/
static Boolean
_enumLanglistNext(
void *state,
char **lang,
char **desc)
{
Boolean rc = False;
struct _enumState *enumstate = (struct _enumState *)state;
char *loclang, *locdesc;
loclang = strtok(enumstate->tokstr, DELIM);
if (enumstate->tokstr)
{
enumstate->tokstr = NULL;
}
if (loclang != NULL)
{
if ((locdesc = GetLangName(loclang)) == NULL)
{
locdesc = loclang;
}
*lang = strdup(loclang);
*desc = strdup(locdesc);
rc = True;
}
return(rc);
}
/*
* _enumLanglistEnd() - end enumeration of language names and descriptions
*
* Free memory.
*/
static void
_enumLanglistEnd(
void *state)
{
struct _enumState *enumstate = (struct _enumState *)state;
free(enumstate->dupstr);
free((char *)state);
}
/***************************************************************************
*
* Methods for language list
*
***************************************************************************/
struct _enumObject
{
Boolean (*methodNext)();
void (*methodEnd)();
void *enumstate;
};
/*
* _enumLangStart() - start enumeration of languages and descriptions
*
* ENABLE_DYNAMIC_LANGLIST defined
* Enumerate LANGLIST. If unsucessful, try 'LangCmd'. LANGLIST will only
* be set if user specified Dtlogin*languageList.
*
* ENABLE_DYNAMIC_LANGLIST undefined
* Enumerate LANGLIST.
*
*/
static void *
_enumLangStart(void)
{
char *p;
struct _enumObject *state = malloc(sizeof(struct _enumObject));
if (state)
{
state->enumstate = _enumLanglistStart();
if (state->enumstate != NULL)
{
state->methodNext = _enumLanglistNext;
state->methodEnd = _enumLanglistEnd;
}
#if defined (ENABLE_DYNAMIC_LANGLIST)
if (state->enumstate == NULL)
{
state->enumstate = _enumLangCmdStart();
if (state->enumstate != NULL)
{
state->methodNext = _enumLangCmdNext;
state->methodEnd = _enumLangCmdEnd;
}
}
#endif /* ENABLE_DYNAMIC_LANGLIST */
if (state->enumstate == NULL)
{
free(state);
state = NULL;
}
}
return((void *)state);
}
/*
* _enumLangNext() - get next language description pair
* note: *lang and *desc must be freed by free()
*/
static Boolean
_enumLangNext(
void *state,
char **lang,
char **desc)
{
Boolean rc;
struct _enumObject *object = (struct _enumObject *)state;
rc = (*object->methodNext)(object->enumstate, lang, desc);
return(rc);
}
/*
* _enumLangEnd() - end enumeration of language names and descriptions
*/
static void
_enumLangEnd(
void *state)
{
struct _enumObject *object = (struct _enumObject *)state;
(*object->methodEnd)(object->enumstate);
free((char *)state);
}
/***************************************************************************
*
* MakeLangMenu
*
* Widgets: lang_menu
*
* The language menu contains the list of locales available to the
* the desktop session. This may be a subset of the actual installed
* locales. The list of locales to display in the language menu can
* be provided by the sysadmin, or determined by the login manager.
*
* * Sysadmin provided language list
*
* A sysadmin can set the Dtlogin.languageList resource to set the list
* of languages. The dtlogin process provides this list to dtgreet
* in the LANGLIST environment variable. This has priority.
*
* * Login manager determined language list
*
* If the sysadm does not set Dtlogin.languageList, ie. LANGLIST unset,
* the login manager will generate the list. There are two methods for
* doing this, one of which is selected at compile time with the
* ENABLE_DYNAMIC_LANGLIST define.
*
* * dynamic list (ENABLE_DYNAMIC_LANGLIST defined)
*
* This method executes the command specified by the
* Dtlogin*languageListCmd resource. The default is
* /usr/dt/bin/dtlslocale. The languageListCmd command is expected
* to write to stdout a series of language names and descriptions:
*
* lang_name description
* lang_name description
* ...
*
* Example:
*
* En_US English (United States) - IBM-850
* Fr_BE French (Belgium) - IBM-850
*
* Also, since languageListCmd is run under dtgreet's locale, a
* localized description can be returned.
*
* * static list (ENABLE_DYNAMIC_LANGLIST undefined)
*
* This method has dtlogin querying the system and generating
* the language list to be provided to dtgreet via the LANGLIST
* environment variable. In this case dtlogin takes care to use the
* sysadmin provided list if necessary.
*
* * Language descriptions
*
* The sysadmin can set the Dtlogin*<lang>.languageName resource to
* provide a descriptive name for a particular language. If languageName
* unset, the value used depends on ENABLE_DYNAMIC_LANGLIST. If
* ENABLE_DYNAMIC_LANGLIST set, the value used is the descriptive text
* provided by languageListCmd. If ENABLE_DYNAMIC_LANGLIST unset, the value
* used is simply the locale name.
*
* * Default language
*
* The sysadmin can set the Dtlogin*language resource to specify the
* default language in the language menu.
*
***************************************************************************/
#define MAX_LANG_ITEMS 16 /* maximum number of items in one lang menu */
#define MAX_NAME_LEN 128 /* maximum length of a language name */
struct Langlist {
char *lang; /* lang name ie En_US, Ja_JP */
char *desc; /* lang description ie English */
};
/*
* compareLangDesc() - compare language descriptions in qsort()
*/
static int
compareLangDesc(
const void *first,
const void *second)
{
return(strcmp(((struct Langlist *)first)->desc,
((struct Langlist *)second)->desc));
}
void
MakeLangMenu( void )
{
register int i, k;
char cblab[MAX_NAME_LEN]; /* pushbutton label */
int nlang; /* total number of languages */
int nlangMenus; /* number of language sub-menus */
int maxitems; /* max no. of items in sub-lang menu*/
Widget item_menu;
Widget button;
char *tostr;
struct Langlist {
char *lang; /* lang name ie En_US, Ja_JP */
char *desc; /* lang description ie English */
};
struct Langlist list[500];
void *state;
/*
* Generate list of langname/description pairs.
*/
nlang = 0;
state = _enumLangStart();
if (state)
{
while (_enumLangNext(state, &list[nlang].lang, &list[nlang].desc))
{
nlang++;
}
_enumLangEnd(state);
}
if (nlang > 0) {
/*
* Sort by description
*/
qsort((char *)list, nlang, sizeof(list[0]), compareLangDesc);
/*
* determine number of language sub-menus ...
* (MAX_LANG_ITEMS per menu)
*/
nlangMenus = 0;
do {
nlangMenus++;
maxitems = nlang/nlangMenus;
} while ( maxitems > MAX_LANG_ITEMS );
if (nlang%nlangMenus != 0) maxitems++; /* allow for stragglers */
/*
* build language menu(s)...
*/
i = 0;
lang_menu = XmCreatePulldownMenu(options_menu, "lang_menu", argt, i);
item_menu = lang_menu;
for (k = 0; k < nlang; k++) {
if ( nlangMenus > 1 && k%maxitems == 0) {
i = 0;
item_menu = XmCreatePulldownMenu(lang_menu, "item_menu",
argt, i);
}
/*
* build toggle buttons...
*/
i = InitArg(ToggleBG);
XtSetArg(argt[i], XmNrecomputeSize, True ); i++;
if (langenv && (strcmp(langenv, list[k].lang) == 0)) {
XtSetArg(argt[i], XmNset, True ); i++;
}
xmstr = XmStringCreateLocalized(list[k].desc);
XtSetArg(argt[i], XmNlabelString, xmstr ); i++;
button = XmCreateToggleButtonGadget(
item_menu, list[k].lang, argt, i);
XtAddCallback (button, XmNvalueChangedCallback,
RespondLangCB, (XtPointer) list[k].lang);
XmStringFree(xmstr);
XtManageChild(button);
tostr =
(char*) ReadCatalog(MC_LABEL_SET, MC_TO_LABEL, MC_DEF_TO_LABEL);
if ( nlangMenus > 1 && k%maxitems == 0 ) {
int first = k;
int last = k+maxitems >= nlang ? nlang-1 : k+maxitems-1;
i = InitArg(CascadeBG);
sprintf(cblab, "%s %s %s",
list[first].desc, tostr, list[last].desc);
xmstr = XmStringCreateLocalized(cblab);
XtSetArg(argt[i], XmNlabelString, xmstr ); i++;
XtSetArg(argt[i], XmNsubMenuId, item_menu ); i++;
XtSetArg(argt[i], XmNrecomputeSize, True ); i++;
button = XmCreateCascadeButtonGadget(lang_menu, cblab, argt, i);
XtManageChild(button);
XmStringFree(xmstr);
}
}
/*
* Free language list
*/
for (k = 0; k < nlang; k++)
{
/* free(list[k].lang); -- used as callback data, don't free */
free(list[k].desc);
}
}
}

View File

@@ -0,0 +1,223 @@
/* $XConsortium: vglogo.c /main/4 1995/10/27 16:17:33 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/************************************<+>*************************************
****************************************************************************
**
** File: vglogo.c
**
** Project: HP Visual User Environment (DT)
**
** Description: Routines to create the Corporate logo
**
**
**
** (c) Copyright 1987, 1988, 1989 by Hewlett-Packard Company
**
**
**
****************************************************************************
************************************<+>*************************************/
/***************************************************************************
*
* Includes
*
***************************************************************************/
#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <Xm/Xm.h>
#include <Xm/DrawingA.h>
#include <Xm/Frame.h>
#include <Xm/Label.h>
#include <Dt/IconFile.h>
#include <Dt/Icon.h>
#include "vg.h"
#include "vglogo.h" /* pixmap and bitmap for default Login logo */
# include "vgmsg.h"
/***************************************************************************
*
* External declarations
*
***************************************************************************/
/***************************************************************************
*
* Procedure declarations
*
***************************************************************************/
/***************************************************************************
*
* Global variables
*
***************************************************************************/
LogoInfo logoInfo; /* logo resources */
static XtResource logoResources[] = {
{"bitmapFile", "BitmapFile",
XtRString, sizeof(char *), XtOffset(LogoInfoPtr, bitmapFile),
#ifdef __osf__
XtRString, "DECDtlogo" },
#else
XtRString, "Dtlogo" },
#endif
};
/***************************************************************************
*
* MakeLogo
*
* make DT logo
*
* Widgets: logo, logo_pixmap
***************************************************************************/
void
MakeLogo( void )
{
register int i;
char *logoFile; /* name of logo bitmap file */
Pixmap logoPixmap; /* logo pixmap */
char *logoName; /* logo name */
int logoWidth, logoHeight; /* width, height of logo */
Pixel fg, bg; /* foreground, background colors */
Pixmap dsPixmap; /* drop shadow pixmap */
int dsWidth, dsHeight; /* width, height of drop shadow */
Pixmap pixmap; /* scratch pixmap */
GC gc; /* scratch GC */
XGCValues gcval; /* GC values */
unsigned int width, height; /* width, height of bitmap */
int x_hot, y_hot; /* bitmap hot spot (if any)*/
/*
* get the user's logo preferences...
*/
XtGetSubresources(table, &logoInfo, "logo", "Logo",
logoResources, XtNumber(logoResources), NULL, 0);
/*
* create the logo frame...
*/
i = InitArg(Frame);
XtSetArg(argt[i], XmNshadowType, XmSHADOW_OUT); i++;
XtSetArg(argt[i], XmNshadowThickness, 2); i++;
XtSetArg(argt[i], XmNtopAttachment, XmATTACH_FORM); i++;
XtSetArg(argt[i], XmNtopOffset, 15); i++;
XtSetArg(argt[i], XmNbottomAttachment, XmATTACH_FORM); i++;
XtSetArg(argt[i], XmNbottomOffset, 15); i++;
XtSetArg(argt[i], XmNrightAttachment, XmATTACH_FORM); i++;
XtSetArg(argt[i], XmNrightOffset, 15); i++;
XtSetArg(argt[i], XmNleftAttachment, XmATTACH_WIDGET); i++;
XtSetArg(argt[i], XmNleftWidget, matteFrame); i++;
logo1 = XmCreateFrame(matte, "logo", argt, i);
XtManageChild(logo1);
/*
* get the colors of the frame...
*/
XtSetArg(argt[0], XmNforeground, &fg);
XtSetArg(argt[1], XmNbackground, &bg);
XtGetValues(logo1, argt, 2);
/*
* create the logo pixmap...
*/
logoFile = logoInfo.bitmapFile;
#if defined (_AIX) && defined (_POWER)
/*
* On AIX4 we have a Dtlogo.s.pm
*/
# define LOGO_TYPE (LOWRES ? DtSMALL : NULL)
#else
# define LOGO_TYPE NULL
#endif
logoName = _DtGetIconFileName(DefaultScreenOfDisplay(dpyinfo.dpy),
logoFile, NULL, NULL, LOGO_TYPE);
if (logoName == NULL)
{
LogError(
ReadCatalog(MC_LOG_SET,MC_LOG_NO_LOGOBIT,MC_DEF_LOG_NO_LOGOBIT),
logoFile);
logoFile = NULL;
}
/*
* create the logo control...
*/
i = InitArg(LabelG);
XtSetArg(argt[i], XmNmarginWidth, 0); i++;
XtSetArg(argt[i], XmNmarginHeight, 0); i++;
XtSetArg(argt[i], XmNhighlightThickness, 0); i++;
XtSetArg(argt[i], XmNbehavior, XmICON_LABEL); i++;
XtSetArg(argt[i], XmNfillMode, XmFILL_TRANSPARENT); i++;
XtSetArg(argt[i], XmNstring, NULL); i++;
if (logoName != NULL)
{
XtSetArg(argt[i], XmNpixmapForeground, fg); i++;
XtSetArg(argt[i], XmNpixmapBackground, bg); i++;
XtSetArg(argt[i], XmNimageName, logoName); i++;
}
else
{
/*
* use built-in logo if no logo was not found
*/
logoPixmap = XCreatePixmapFromBitmapData(
dpyinfo.dpy, /* display */
dpyinfo.root, /* drawable */
(char *)dt_logo_bits, /* data */
dt_logo_width, /* width */
dt_logo_height, /* height */
fg, /* foreground */
bg, /* background */
dpyinfo.depth); /* depth */
logoWidth = dt_logo_width;
logoHeight = dt_logo_height;
XtSetArg(argt[i], XmNpixmap, logoPixmap); i++;
}
logo_pixmap = _DtCreateIcon(logo1, "logo_pixmap", argt, i);
XtManageChild(logo_pixmap);
XtSetArg(argt[0], XmNheight, 245); /* keeps dialog a consistent height and width */
XtSetArg(argt[1], XmNwidth, 245);
XtSetValues(logo1, argt, 2);
}

View File

@@ -0,0 +1,274 @@
/* $XConsortium: vglogo.h /main/3 1995/10/27 16:17:41 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/************************************<+>*************************************
****************************************************************************
**
** File: vglogo.h
**
** Project: CDE
**
** Description: default Login logo bitmap
**
**
** (c) Copyright 1987, 1988, 1989 by Hewlett-Packard Company
**
**
**
****************************************************************************
************************************<+>*************************************/
#ifndef _VGLOGO_H
#define _VGLOGO_H
#define dt_logo_width 150
#define dt_logo_height 151
static unsigned char dt_logo_bits[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0xfe, 0xff,
0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x01, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,
0xf8, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0xf0, 0xff, 0xff,
0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x01, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xe0,
0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x3f,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00,
0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff,
0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff,
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xf8, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0x3f,
0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff,
0xff, 0x3f, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x3f, 0xff,
0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
0x3f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
0xff, 0xff, 0x3f, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0xff, 0xff,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xfe, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x3f,
0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0f,
0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x07, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0xf8, 0xff,
0xff, 0x3f, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfe, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x1f, 0x00, 0x00, 0x00,
0xf0, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf0, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x3f, 0xff,
0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0x00,
0x00, 0x00, 0xe0, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff,
0x3f, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,
0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x3f, 0xff, 0xff, 0x3f, 0x00,
0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x80,
0xff, 0xff, 0x3f, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff,
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0x3f, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
0x00, 0x80, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x80,
0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f,
0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff,
0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x01, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xff,
0xff, 0x3f, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x3f, 0xff, 0xff, 0xff,
0x03, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00,
0x00, 0xfe, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfe,
0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0xff,
0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00,
0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xf8, 0xff,
0x3f, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff,
0xff, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x0f,
0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00,
0xf0, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xff,
0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f, 0xff, 0xff,
0xff, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x00, 0x00, 0xe0, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x3f,
0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x3f, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x80,
0xff, 0x3f, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff,
0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x80, 0xff, 0x3f, 0xff, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
0x00, 0x00, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xff, 0x3f, 0xff,
0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
0x03, 0x00, 0x00, 0x00, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfe,
0x3f, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff,
0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xff,
0x03, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00,
0x00, 0xfc, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xfc,
0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0xff, 0xff,
0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x1f,
0x00, 0x00, 0x00, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00,
0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xf0, 0x3f,
0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff,
0xff, 0x0f, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x1f,
0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00,
0xe0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0xe0, 0xff,
0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00,
0x00, 0x00, 0xc0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00,
0xc0, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0xff,
0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x1f, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
0x00, 0x00, 0xc0, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0x00, 0x00, 0x00, 0x80, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0xff, 0xff,
0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x3e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c,
0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0xff, 0xff, 0xff, 0xff, 0xff,
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xff, 0xff, 0xff,
0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x30, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xff,
0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf8, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0x3f, 0xff, 0xff,
0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xf0, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x3f,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,
0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0x3f, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff,
0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00,
0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x7f, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00,
0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,
0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x03, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0xf8, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x3f};
#endif /* _VGLOGO_H */
/* DON'T ADD STUFF AFTER THIS #endif */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,434 @@
/* $TOG: vgmsg.h /main/5 1998/03/04 19:29:00 mgreess $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/************************************<+>*************************************
****************************************************************************
**
** File: vgmsg.h
**
** Project: HP Visual User Environment (DT)
**
** Description: Header file for Dtgreet application.
**
** _DtMessage catalog string numbers and default strings
** are specified here. The default strings should match
** the strings in the "C" message catalog.
**
**
** (c) Copyright 1987, 1988, 1989 by Hewlett-Packard Company
**
**
**
****************************************************************************
************************************<+>*************************************/
#ifndef _VGMSG_H
#define _VGMSG_H
/****************************************************************************
*
* Defines
*
****************************************************************************/
#ifndef CDE_INSTALLATION_TOP
#define CDE_INSTALLATION_TOP "/opt/dt"
#endif
#ifdef sun
#define FBCONSOLE "/usr/openwin/bin/fbconsole"
#define OWPATH_ENV "OPENWINHOME=/usr/openwin"
#endif
/*
* message catalog id numbers...
*/
#define MC_LABEL_SET 1
#define MC_LOGIN_LABEL 1
#define MC_PASSWD_LABEL 2
#define MC_OK_LABEL 3
#define MC_CLEAR_LABEL 4
#define MC_OPTIONS_LABEL 5
#define MC_HELP_LABEL 6
#define MC_RS_LABEL 7
#define MC_NW_LABEL 8
#define MC_COPY_LABEL 9
/* #define MC_FS_LABEL 10 */
#define MC_LANG_LABEL 11
#define MC_START_LABEL 12
#define MC_CANCEL_LABEL 13
#define MC_HELP_LABEL_2 14
#define MC_DTLITE_LABEL 15
#define MC_GREET_LABEL 16
#define MC_DT_LABEL 17
#define MC_SUS1_LABEL 18
#define MC_SUS2_LABEL 19
#define MC_SUS3_LABEL 20
#define MC_RES_LABEL 21
#define MC_START_LBLDPY 22
#define MC_WAIT_LABEL 23
#define MC_X_LABEL 24
#define MC_SES_LABEL 25
#define MC_PERS_GREET_LABEL 26
#define MC_FS_LABEL 27
/*
* Sun specific message catalog id numbers in MC_LABEL_SET messages.
* (Starting at a random uneven higher number to allow some room
* for some shared sample source message additions.
*/
#define MC_USER_DT_LABEL 73
#define MC_TO_LABEL 74
#define MC_ERROR_SET 2
#define MC_LOGIN 1
#define MC_HOME 2
#define MC_MAX_USERS 3
#define MC_PASSWD_EXPIRED 4
#define MC_BAD_UID 5
#define MC_BAD_GID 6
#define MC_BAD_AID 7
#define MC_BAD_AFLAG 8
#define MC_NO_LOGIN 9
#define MC_BAD_ROOT 10
#define MC_LOG_REBUILD 11
#define MC_LOG_RESCAN 12
#define MC_LOG_REREADCFG 13
#define MC_LOG_REREADSRV 14
#define MC_LOG_REREADACC 15
#define MC_NO_MEMORY 16
#define MC_HELP_SET 3
#define MC_HELP 1
#define MC_SYSTEM 2
#define MC_HELP_CHOOSER 3
#define MC_LOG_SET 4
#define MC_LOG_ACC_FILE 1
#define MC_LOG_HOST_ENT 2
#define MC_LOG_ACC_DPY 3
#define MC_LOG_ACC_CTL 4
#define MC_LOG_DOMAIN 5
#define MC_LOG_SRV_OPEN 6
#define MC_LOG_SRV_WRT 7
#define MC_LOG_SAVE_ADDR 8
#define MC_LOG_NET_CFG 9
#define MC_LOG_SET_AUTH 10
#define MC_LOG_LCK_AUTH 11
#define MC_LOG_NOT_AUTH 12
#define MC_LOG_NO_CREATE 13
#define MC_LOG_NO_LOCK 14
#define MC_LOG_NO_SRVACC 15
#define MC_LOG_NEW_DPY 16
#define MC_LOG_NO_ERRLOG 17
#define MC_LOG_MAX_LOGFILE 18
#define MC_LOG_MISS_NAME 19
#define MC_LOG_MISS_TYPE 20
#define MC_LOG_INV_HOSTNM 21
#define MC_LOG_BAD_DPYTYPE 22
#define MC_LOG_PSEUDO 23
#define MC_LOG_GET_RSC 24
#define MC_LOG_NO_SPACE 25
#define MC_LOG_NO_OPENCFG 26
#define MC_LOG_EXTRA_ARG 27
#define MC_LOG_NO_ARGS 28
#define MC_LOG_NO_EXESRV 29
#define MC_LOG_FAIL_FORK 30
#define MC_LOG_SRV_DIED 31
#define MC_LOG_HUNG_DPY 32
#define MC_LOG_FAIL_SRVOPEN 33
#define MC_LOG_FATAL_IO 34
#define MC_LOG_X_ERR 35
#define MC_LOG_FAIL_START 36
#define MC_LOG_NO_SECDPY 37
#define MC_LOG_NO_SECKEY 38
#define MC_LOG_NO_BLSACCT 39
#define MC_LOG_NO_BLSPACCT 40
#define MC_LOG_NO_VFYLVL 41
#define MC_LOG_NO_BLSUSR 42
#define MC_LOG_AFS_FAIL 43
#define MC_LOG_FAIL_SETUID 44
#define MC_LOG_NO_HMDIR 45
#define MC_LOG_SES_EXEFAIL 46
#define MC_LOG_NO_CMDARG 47
#define MC_LOG_NO_SESFORK 48
#define MC_LOG_NO_KILLCL 49
#define MC_LOG_NO_EXE 50
#define MC_LOG_NO_FORK 51
#define MC_LOG_IMPROP_AUTH 52
#define MC_LOG_NO_DTGREET 53
#define MC_LOG_NO_FORKCG 54
#define MC_LOG_FAIL_SOCK 55
#define MC_LOG_ERR_BIND 56
#define MC_LOG_MAKEENV 57
#define MC_LOG_SETENV 58
#define MC_LOG_PARSEARGS 59
#define MC_LOG_NO_SCAN 60
#define MC_LOG_MORE_GRP 61
#define MC_LOG_NOT_SUSER 62
#define MC_LOG_INV_EVENT 63
#define MC_LOG_ERR_ERRNO 64
#define MC_LOG_AFS_FAILATH 65
#define MC_LOG_ACC_EXP 66
#define MC_LOG_DEADSRV 67
#define MC_LOG_NO_LOGOBIT 68
#define MC_LOG_NO_MSGCAT 69
#define MC_LOG_NO_DPYINIT 70
#define MC_LOG_BAD_MATTE 71
#define MC_LOG_BAD_HMATTE 72
#define MC_CHOOSER_SET 5
#define MC_CHOOSER_TITLE 1
#define MC_CHOOSER_HEADING 2
#define MC_UPDATE_LABEL 3
/*
* message catalog default strings...
*/
#define MC_DEF_LOGIN_LABEL "Please enter your user name"
#define MC_DEF_PASSWD_LABEL "Please enter your password"
#define MC_DEF_OK_LABEL "OK"
#define MC_DEF_CLEAR_LABEL "Start Over"
#define MC_DEF_OPTIONS_LABEL "Options"
#define MC_DEF_HELP_LABEL "Help"
#define MC_DEF_RS_LABEL "Reset Login Screen"
#define MC_DEF_NW_LABEL "Command Line Login"
#define MC_DEF_COPY_LABEL "Version..."
#define MC_DEF_FS_LABEL "Failsafe Session"
#define MC_DEF_USER_DT_LABEL "User's Last Desktop"
#define MC_DEF_LANG_LABEL "Language"
#define MC_DEF_TO_LABEL "to"
#define MC_DEF_START_LABEL "Start DT"
#define MC_DEF_CANCEL_LABEL "Cancel"
#define MC_DEF_DTLITE_LABEL "DT Lite Session"
#define MC_DEF_GREET_LABEL "Welcome to"
#define MC_DEF_PERS_GREET_LABEL "Welcome %s"
#define MC_DEF_DT_LABEL "Regular Desktop"
#define MC_DEF_SES_LABEL "Session"
#define MC_DEF_LOGIN "Login incorrect; please try again."
#define MC_DEF_HOME "Unable to change to home directory."
#define MC_DEF_MAX_USERS "Sorry. Maximum number of users already logged in."
#define MC_DEF_BAD_UID "Login error, invalid user id."
#define MC_DEF_BAD_GID "Login error, invalid group id."
#define MC_DEF_BAD_AID "Login error, invalid audit id."
#define MC_DEF_BAD_AFLAG "Login error, invalid audit flag."
#define MC_DEF_NO_LOGIN "Logins are currently disabled."
#define MC_DEF_PASSWD_EXPIRED \
"\n\
You need to choose an initial password for your account,\n\
or your current password has expired.\n\
\n\
After you set your password, you must log in again\n\
using the new password.\
"
/*
* default help message...
*/
#define MC_DEF_HELP \
"\n\
Login Help:\n\
\n\
Use the login screen to identify yourself to the computer.\n\
\n\
To log in:\n\
1) Type your user name and press <Enter> or click [OK].\n\
(if you have not created a user, enter \"root\" as the\n\
user name)\n\
2) Type your password and press <Enter> or click [OK].\n\
\n\
[Start Over]\n\
Erases your entries so you can re-enter your user name and\n\
try again.\n\
\n\
[Options]\n\
Allows you to change session options:\n\
\n\
With the mouse pointer over the [Options] button, press and\n\
hold mouse button 1. Drag the pointer through the choices.\n\
Releasing the mouse button with the pointer on an item will\n\
select that item. You may choose:\n\
\n\
Language - to change the session language\n\
Session - to select preferred user Desktop\n\
Current - Starts your most recent session\n\
Home - Starts your home session (if you set one)\n\
<display-name> - Current - starts your most recent session for\n\
the given display\n\
<display-name> - Home - starts your home session for\n\
the given display\n\
FailSafe Session - Starts a failsafe session.\n\
Command Line Login - to switch to a command line environment\n\
Reset Login Screen - to restart the X-server\n\
\n\
Click anywhere on the background with any mouse button to\n\
refresh the screen, for example, if system messages make the\n\
screen unreadable.\n\
\n\
For more help information, log in first, then click on the Help\n\
Manager icon that is in the Information Manager slide-up menu\n\
in the Front Panel (Book with an information symbol).\n\
Then find the Login Manager help volume.\n\
"
/*
* system name set to "unknown" message...
*/
#define MC_DEF_SYSTEM \
"\n\
Your workstation does not have a unique name. It is currently\n\
set to \"unknown\". It is recommended that you name this\n\
workstation.\n\
"
#define MC_DEF_HELP_CHOOSER \
"\n\
Chooser Help:\n\
\n\
Use the chooser screen to choose which server to log into.\n\
\n\
The chooser screen contains a list that has 2 parts for each\n\
entry. The first part (Server Name) contains the network\n\
name for each available server. The second part (Server\n\
Information) will contain different information depending on\n\
what login manager is being run on each server. If a server\n\
is running the CDE Desktop, it should provide information\n\
about the number of users (or tty devices) currently in use,\n\
and load averages (average CPU usage) for the last 5, 10, and\n\
15 minutes.\n\
\n\
To choose a server to log into, just select the line in the\n\
list that contains the name of the server you wish.\n\
\n\
Once you have made your selection, press the ok button.\n\
This will bring up a login screen from the server you selected.\n\
\n\
[Update List]\n\
This will clear the list and rebuild it by querying the\n\
servers on the network to see if they will allow logins.\n\
\n\
[Options]\n\
Allows you to change session options:\n\
\n\
With the mouse pointer over the [Options] button, press and\n\
hold mouse button 1. Drag the pointer through the choices.\n\
Releasing the mouse button with the pointer on an item will\n\
select that item. You may choose:\n\
\n\
Language - to change the session language\n\
Reset Login Screen - to restart the X-server\n\
\n\
Click anywhere on the background with any mouse button to\n\
refresh the screen, for example, if system messages make the\n\
screen unreadable.\n\
\n\
"
#define MC_DEF_SUS1_LABEL "* Suspending Desktop Login...\r\n*\r\n"
#define MC_DEF_SUS2_LABEL "* Press [Enter] for a login prompt.\r\n*\r\n"
#define MC_DEF_SUS3_LABEL "* Log in. Desktop Login will resume shortly after you log out.\r\n*\r\n"
#define MC_DEF_RES_LABEL "* Resuming Desktop Login...\r\n*\r\n"
#define MC_DEF_START_LBLDPY "* Starting Desktop Login on display %1$s...\r\n*\r\n"
#define MC_DEF_WAIT_LABEL "* Wait for the Desktop Login screen before logging in.\r\n*\r\n"
#define MC_DEF_X_LABEL "* The X-server can not be started on display %1$s...\r\n*\r\n"
#define MC_DEF_BAD_ROOT "Only root wants to run %1$s\n"
#define MC_DEF_LOG_REBUILD "Rebuilding default language list from %1$s\n"
#define MC_DEF_LOG_RESCAN "Rescanning both config and servers files\n"
#define MC_DEF_LOG_REREADCFG "Rereading configuration file %1$s\n"
#define MC_DEF_LOG_REREADSRV "Rereading servers file %1$s\n"
#define MC_DEF_LOG_REREADACC "Rereading access file %1$s\n"
#define MC_DEF_NO_MEMORY "dtlogin: out of memory in routine\n"
#define MC_DEF_LOG_ACC_FILE "Access file \"%1$s\", host \"%2$s\" not found\n"
#define MC_DEF_LOG_HOST_ENT "ReadHostEntry\n"
#define MC_DEF_LOG_ACC_DPY "Access file %1$2s, display %1$2s unknown\n"
#define MC_DEF_LOG_ACC_CTL "Cannot open access control file %1$s, no XDMCP reqeusts will be granted\n"
#define MC_DEF_LOG_DOMAIN "Domain/OS authentication error: %1$s (%2$s/%3$s)"
#define MC_DEF_LOG_SRV_OPEN "Can not open server authorization file %1$s\n"
#define MC_DEF_LOG_SRV_WRT "Cannot write server authorization file %1$s\n"
#define MC_DEF_LOG_SAVE_ADDR "saveAddr"
#define MC_DEF_LOG_NET_CFG "Trouble getting network interface configuration"
#define MC_DEF_LOG_SET_AUTH "setAuthNumber"
#define MC_DEF_LOG_LCK_AUTH "Can not lock authorization file %1$s or backup %2$s\n"
#define MC_DEF_LOG_NOT_AUTH "Can not move authorization into place\n"
#define MC_DEF_LOG_NO_CREATE "Can not create/lock pid file %1$s\n"
#define MC_DEF_LOG_NO_LOCK "Can not lock pid file %1$s, another Dtlogin is running (pid %2$d)\n"
#define MC_DEF_LOG_NO_SRVACC "Can not access servers file %1$s\n"
#define MC_DEF_LOG_NEW_DPY "NewDisplay"
#define MC_DEF_LOG_NO_ERRLOG "Can not open errorLogFile %1$s\n"
#define MC_DEF_LOG_MAX_LOGFILE "TrimErrorLog(): maximum size of error log file is 200Kb.\n"
#define MC_DEF_LOG_MISS_NAME "Missing display name in servers file\n"
#define MC_DEF_LOG_MISS_TYPE "Missing display type for %1$s\n"
#define MC_DEF_LOG_INV_HOSTNM "Hostname %1$s is invalid. Setting DISPLAY to ':0'\n"
#define MC_DEF_LOG_BAD_DPYTYPE "Unacceptable display type %1$s for display %2$s\n"
#define MC_DEF_LOG_PSEUDO "Pseudo reset timed out.\n"
#define MC_DEF_LOG_GET_RSC "GetResource"
#define MC_DEF_LOG_NO_SPACE "no space for argument realloc\n"
#define MC_DEF_LOG_NO_OPENCFG "Can not open configuration file %1$s\n"
#define MC_DEF_LOG_EXTRA_ARG "Extra arguments on command line:"
#define MC_DEF_LOG_NO_ARGS "StartServer(): no arguments\n"
#define MC_DEF_LOG_NO_EXESRV "Server %1$s cannot be executed\n"
#define MC_DEF_LOG_FAIL_FORK "StartServer() fork failed, sleeping\n"
#define MC_DEF_LOG_SRV_DIED "Server unexpectedly died\n"
#define MC_DEF_LOG_HUNG_DPY "Hung in XOpenDisplay(%1$s) attempt #%2$d, aborting.\n"
#define MC_DEF_LOG_FAIL_SRVOPEN "Server open attempt #%1$d failed for %2$s, giving up\n"
#define MC_DEF_LOG_FATAL_IO "Fatal IO error %d (%1$s)\n"
#define MC_DEF_LOG_X_ERR "X error\n"
#define MC_DEF_LOG_FAIL_START "Session start failed\n"
#define MC_DEF_LOG_NO_SECDPY "WARNING: display %1$s could not be secured\n"
#define MC_DEF_LOG_NO_SECKEY "WARNING: keyboard on display %1$s could not be secured\n"
#define MC_DEF_LOG_NO_BLSACCT "BLS - Could not obtain account information.\n"
#define MC_DEF_LOG_NO_BLSPACCT "BLS - Could not obtain protected account information.\n"
#define MC_DEF_LOG_NO_VFYLVL "BLS - Could not verify sensitivity level.\n"
#define MC_DEF_LOG_NO_BLSUSR "BLS - Could not change to user: %1$s.\n"
#define MC_DEF_LOG_AFS_FAIL "AFS - setgroups() failure when starting session\n"
#define MC_DEF_LOG_FAIL_SETUID "Setuid failed for user %s, errno = %d\n"
#define MC_DEF_LOG_NO_HMDIR "No home directory %1$s for user %2$s, using /\n"
#define MC_DEF_LOG_SES_EXEFAIL "Session execution failed %1$s\n"
#define MC_DEF_LOG_NO_CMDARG "Session has no command/arguments\n"
#define MC_DEF_LOG_NO_SESFORK "Can not start session for %s, fork failed\n"
#define MC_DEF_LOG_NO_KILLCL "Dtlogin can not kill client\n"
#define MC_DEF_LOG_NO_EXE "Can not execute %1$s\n"
#define MC_DEF_LOG_NO_FORK "Can not fork to execute %1$s\n"
#define MC_DEF_LOG_IMPROP_AUTH "Improper authentication name \"%1$s\". Use AFS, Kerberos or the default.\n"
#define MC_DEF_LOG_NO_DTGREET "Can not execute Dtgreet %1$s for %2$s\n"
#define MC_DEF_LOG_NO_FORKCG "Can not fork to execute Dtgreet %1$s\n"
#define MC_DEF_LOG_FAIL_SOCK "Socket creation failed on port %1$d\n"
#define MC_DEF_LOG_ERR_BIND "error binding socket address %1$d, errno = %2$d\n"
#define MC_DEF_LOG_MAKEENV "makeEnv"
#define MC_DEF_LOG_SETENV "setEnv"
#define MC_DEF_LOG_PARSEARGS "parseArgs"
#define MC_DEF_LOG_NO_SCAN "Scan of %1$s directory exceeded %2$d seconds. Terminating scan...\n"
#define MC_DEF_LOG_MORE_GRP "%s belongs to more than %1$d groups, %2$s ignored\n"
#define MC_DEF_LOG_NOT_SUSER "audwrite() error: caller is not superuser\n"
#define MC_DEF_LOG_INV_EVENT "audwrite() error: invalid event number in audit record.\n"
#define MC_DEF_LOG_ERR_ERRNO "audwrite() error: errno = %1$d\n"
#define MC_DEF_LOG_AFS_FAILATH "AFS authentication failure: %1$s\n"
#define MC_DEF_LOG_ACC_EXP "Account for %1$s has expired. Please see your System Administrator.\n"
#define MC_DEF_LOG_DEADSRV "Server dead %1$s\n"
#define MC_DEF_LOG_NO_LOGOBIT "Can't open logo bitmap file: %1$s\n"
#define MC_DEF_LOG_NO_MSGCAT "cannot read \"%1$s\" message catalog. Using default language."
#define MC_DEF_LOG_NO_DPYINIT "display %1$s could not be initialized, server may be grabbed.\n"
#define MC_DEF_LOG_BAD_MATTE "(%1$s): Login matte width exceeds display, using default. Matte units are pixels.\n"
#define MC_DEF_LOG_BAD_HMATTE "(%1$s) Login matte height exceeds display, using default. Matte units are pixels.\n"
#define MC_DEF_CHOOSER_TITLE "Select a server to log into:"
#define MC_DEF_CHOOSER_HEADING "Server Name Server Information"
#define MC_DEF_UPDATE_LABEL " Update List "
#endif /* _VGMSG_H */

View File

@@ -0,0 +1,255 @@
/* $XConsortium: vgproto.h /main/4 1995/11/21 14:03:25 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/************************************<+>*************************************
****************************************************************************
**
** File: vgproto.h
**
** Project: HP Visual User Environment (DT)
**
** Description: Communications protocol between Dtlogin and Dtgreet.
**
**
** (c) Copyright 1987, 1988, 1989 by Hewlett-Packard Company
**
**
**
****************************************************************************
************************************<+>*************************************/
#ifndef _VGREET_H
#define _VGREET_H
#ifdef SIA
#include <siad.h>
#include <X11/Intrinsic.h>
#endif
/***********************************************************************
*
* Environment variable definitions
*
***********************************************************************/
#define ERRORLOG "ERRORLOG"
#define GRABSERVER "GRABSERVER"
#define GRABTIMEOUT "GRABTIMEOUT"
#define LANGLIST "LANGLIST"
#define LOCATION "DTXSERVERLOCATION"
#define PINGINTERVAL "PINGINTERVAL"
#define PINGTIMEOUT "PINGTIMEOUT"
#define SESSIONTYPE "SESSIONTYPE"
#define VERIFYNAME "VERIFYNAME"
#define VN_AFS "AFS"
#define VN_HPBLS "HPBLS"
#define VN_KRB "Kerberos"
#define DTLITE "DTLITE"
#define SESSION "SESSION"
#define SESSION_SET "SESSION_SET"
#define XFORCEINTERNET "XFORCE_INTERNET"
/***********************************************************************
*
* Exit codes from Greeter
*
***********************************************************************/
# define NOTIFY_OK 0
# define NOTIFY_ABORT 1
# define NOTIFY_RESTART 2
# define NOTIFY_ABORT_DISPLAY 3
# define NOTIFY_NO_WINDOWS 4
# define NOTIFY_LANG_CHANGE 5
# define NOTIFY_FAILSAFE 6
# define NOTIFY_PASSWD_EXPIRED 7
# define NOTIFY_DTLITE 8
# define NOTIFY_DT 9
# define NOTIFY_XDM 10
# define NOTIFY_BAD_SECLEVEL 11
# define NOTIFY_LAST_DT 12
# define NOTIFY_ALT_DTS 20
/***********************************************************************
*
* Request protocol definitions
*
***********************************************************************/
#define REQUEST_OP_NONE 0
#define REQUEST_OP_EXIT 2
#define REQUEST_OP_MESSAGE 3
#define REQUEST_OP_CHPASS 4
#define REQUEST_OP_CHALLENGE 5
#define REQUEST_OP_LANG 6
#define REQUEST_OP_HOSTNAME 7
#define REQUEST_OP_EXPASSWORD 8
#define REQUEST_OP_CLEAR 9
#ifdef SIA
#define REQUEST_OP_FORM 10
#endif
#define REQUEST_OP_DEBUG 255
#ifdef SIA
#define REQUEST_LIM_MAXLEN 768
#else
#define REQUEST_LIM_MAXLEN 512
#endif
/*
* Protocol structures. Offsets and lengths are from top of header.
*
* Request header.
*/
typedef struct {
unsigned char opcode; /* REQUEST_OP_* */
unsigned char reserved; /* reserved */
unsigned short length; /* total length */
/* op specific data */
} RequestHeader;
typedef struct {
RequestHeader hdr;
} RequestExit;
typedef struct {
RequestHeader hdr;
unsigned short idMC; /* MC_* message catalog id */
unsigned short offMessage;
/* variable length message string */
} RequestMessage;
typedef struct {
RequestHeader hdr;
} RequestHostname;
typedef struct {
RequestHeader hdr;
} RequestExpassword;
typedef struct {
RequestHeader hdr;
} RequestChpass;
typedef struct {
RequestHeader hdr;
int bEcho;
unsigned short idMC; /* MC_* message catalog id */
unsigned short offChallenge;
unsigned short offUserNameSeed;
/* variable length challenge string */
/* variable length user name seed */
} RequestChallenge;
#ifdef SIA
typedef struct {
RequestHeader hdr;
short num_prompts;
Boolean visible[MAX_PROMPTS]; /* MAX_PROMPTS defined in siad.h */
int rendition;
unsigned short offTitle;
unsigned short offPrompts;
/* variable length title string */
/* variable length prompt strings */
} RequestForm;
#endif
/***********************************************************************
*
* Response protocol definitions
*
***********************************************************************/
/*
* Response header.
*/
typedef struct {
unsigned char opcode; /* REQUEST_OP_* */
unsigned char reserved; /* reserved */
unsigned short length; /* total length */
/* op specific data */
} ResponseHeader;
typedef struct {
ResponseHeader hdr;
} ResponseExit;
typedef struct {
ResponseHeader hdr;
} ResponseClear;
typedef struct {
ResponseHeader hdr;
} ResponseMessage;
typedef struct {
ResponseHeader hdr;
} ResponseHostname;
typedef struct {
ResponseHeader hdr;
} ResponseExpassword;
typedef struct {
ResponseHeader hdr;
unsigned short offOldPassword;
unsigned short offNewPassword;
unsigned short offNewPasswordAgain;
/* variable length old password string */
/* variable length new password string */
/* variable length new password string */
} ResponseChpass;
typedef struct {
ResponseHeader hdr;
unsigned short offResponse;
/* variable length challenge response string */
} ResponseChallenge;
typedef struct {
ResponseHeader hdr;
unsigned short offString;
/* variable length debug string */
} ResponseDebug;
typedef struct {
ResponseHeader hdr;
unsigned short offLang;
/* variable length lang string */
} ResponseLang;
#ifdef SIA
typedef struct {
ResponseHeader hdr;
int collect_status;
short num_answers;
unsigned short offAnswers;
/* variable length answer strings */
} ResponseForm;
typedef struct {
int num_prompts;
int rendition;
int collect_status;
Boolean visible[MAX_PROMPTS];
char *title;
char *prompts[MAX_PROMPTS];
char *answers[MAX_PROMPTS];
Widget sia_form_widget;
Widget answer_widgets[MAX_PROMPTS];
} SiaFormInfo;
#endif
#endif /* _VGREET_H */
/* DON'T ADD STUFF AFTER THIS #endif */

View File

@@ -0,0 +1,513 @@
/* $XConsortium: vgsiaform.c /main/5 1996/05/07 12:22:34 drk $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* @DEC_COPYRIGHT@
*/
/*
* HISTORY
* $Log$
* Revision 1.1.2.2 1995/06/06 19:39:54 Chris_Beute
* New file added for SIA password expiration forms handling
* [1995/05/31 19:52:41 Chris_Beute]
*
* Revision 1.1.2.2 1995/05/22 18:13:32 Peter_Derr
* Add a Cancel button.
* [1995/05/15 18:06:21 Peter_Derr]
*
* Support SIAMENUONE and SIAMENUANY
* [1995/05/12 20:29:53 Peter_Derr]
*
* SIA form UI
* [1995/05/11 22:09:09 Peter_Derr]
*
* $EndLog$
*/
#include "vg.h"
#include "vgmsg.h"
#include <alloca.h>
#include <Xm/Xm.h>
#include <Xm/Form.h>
#include <Xm/Label.h>
#include <Xm/PushB.h>
#include <Xm/RowColumn.h>
#include <Xm/TextF.h>
#include <Xm/ToggleBG.h>
XmString multiline_xmstring(char *);
static void NoEchoCB( Widget, XtPointer, XtPointer);
static void RespondSiaFormCB( Widget, XtPointer, XtPointer);
static void CancelSiaFormCB( Widget, XtPointer, XtPointer);
static void SiaBackspace( Widget, XEvent *, char **, Cardinal *);
static char textEventBindings[] = {
"<Key>Return: next-tab-group()"
};
static char activateBindings[] = {
"<Key>osfActivate: activate()\n\
Ctrl <Key>Return: activate()\n\
<Key>Return: activate()"
};
static char activatePBBindings[] = {
"<Key>osfActivate: ArmAndActivate()\n\
Ctrl <Key>Return: ArmAndActivate()\n\
<Key>Return: ArmAndActivate()"
};
static char noEchoBindings[] = {
"Ctrl<Key>: my-insert()\n\
<Key>osfBackSpace: sia-bksp()\n\
<Key>osfDelete: sia-bksp()"
};
static XtActionsRec textActions[] = {
{"sia-bksp", (XtActionProc)SiaBackspace},
};
SiaFormInfo *globalSiaFormInfo;
/***************************************************************************
*
* SiaForm
*
* Widgets: sia_form, sia_title, sia_prompts
***************************************************************************/
void
SiaForm(SiaFormInfo *siaFormInfo)
{
int i;
int j;
LoginTextPtr textdata;
XtTranslations textTable;
Widget sia_form, title_label, ok_button, cancel_button, prompts_row_col;
Widget *prompt_labels;
Widget *prompt_answers;
XmString xmstr;
XtTranslations noecho_trans, text_trans, activate_trans, activatePBtrans;
globalSiaFormInfo = siaFormInfo;
siaFormInfo->collect_status = 1;
/*
* XmCreateFormDialog()
* XmCreateLabel()
* XmCreateRowColumn()
* for each prompt
* XmCreateLabel()
* XmCreateTextField()
* if not visible
* add ModifyVerify callback
* XmCreatePushButton
* PB callback will collect answers, send them down the pipe
* and destroy the sia_form.
*/
/*
* create the SIA form
*/
i = 0;
i = InitArg(Form);
XtSetArg(argt[i], XmNmarginHeight, MBOX_MARGIN_HEIGHT ); i++;
XtSetArg(argt[i], XmNmarginWidth, MBOX_MARGIN_WIDTH ); i++;
XtSetArg(argt[i], XmNshadowThickness, SHADOW_THICKNESS ); i++;
XtSetArg(argt[i], XmNnoResize, False ); i++;
XtSetArg(argt[i], XmNresizePolicy, XmRESIZE_ANY ); i++;
sia_form = XmCreateFormDialog(login_shell, "sia_form", argt, i);
siaFormInfo->sia_form_widget = sia_form;
/*
* create the title label
*/
/* i = 0; */
i = InitArg(Label);
XtSetArg(argt[i], XmNlabelString, siaFormInfo->title ); i++;
XtSetArg(argt[i], XmNtraversalOn, False ); i++;
XtSetArg(argt[i], XmNtopAttachment, XmATTACH_FORM ); i++;
XtSetArg(argt[i], XmNleftAttachment, XmATTACH_FORM ); i++;
XtSetArg(argt[i], XmNrightAttachment, XmATTACH_FORM ); i++;
XtSetArg(argt[i], XmNalignment, XmALIGNMENT_CENTER ); i++;
xmstr = multiline_xmstring(siaFormInfo->title);
XtSetArg(argt[i], XmNlabelString, xmstr ); i++;
title_label = XmCreateLabel(sia_form, "title_label", argt, i);
XtManageChild(title_label);
XmStringFree(xmstr);
/* ok button */
activate_trans = XtParseTranslationTable(activateBindings);
activatePBtrans = XtParseTranslationTable(activatePBBindings);
i = InitArg(PushB);
XtSetArg(argt[i], XmNbottomAttachment, XmATTACH_FORM ); i++;
XtSetArg(argt[i], XmNtraversalOn, True ); i++;
xmstr = ReadCatalogXms(MC_LABEL_SET, MC_OK_LABEL, MC_DEF_OK_LABEL );
XtSetArg(argt[i], XmNlabelString, xmstr ); i++;
ok_button = XmCreatePushButton(sia_form, "ok_button", argt, i);
XtOverrideTranslations(ok_button, activatePBtrans);
XmStringFree(xmstr);
XtManageChild(ok_button);
XtAddCallback(ok_button, XmNactivateCallback, RespondSiaFormCB,
siaFormInfo);
/* Cancel button */
i = InitArg(PushB);
XtSetArg(argt[i], XmNbottomAttachment, XmATTACH_FORM ); i++;
XtSetArg(argt[i], XmNtraversalOn, True ); i++;
xmstr = ReadCatalogXms(MC_LABEL_SET, MC_CANCEL_LABEL, MC_DEF_CANCEL_LABEL );
XtSetArg(argt[i], XmNlabelString, xmstr ); i++;
cancel_button = XmCreatePushButton(sia_form, "cancel_button", argt, i);
XmStringFree(xmstr);
XtManageChild(cancel_button);
XtAddCallback(cancel_button, XmNactivateCallback, CancelSiaFormCB,
siaFormInfo);
/*
* create the RowColumn widget for prompts
*/
i =0;
XtSetArg(argt[i], XmNorientation, XmHORIZONTAL ); i++;
XtSetArg(argt[i], XmNentryVerticalAlignment, XmALIGNMENT_CENTER ); i++;
XtSetArg(argt[i], XmNrowColumnType, XmWORK_AREA ); i++;
XtSetArg(argt[i], XmNnumColumns, siaFormInfo->num_prompts); i++;
XtSetArg(argt[i], XmNpacking, XmPACK_COLUMN ); i++;
XtSetArg(argt[i], XmNtopAttachment, XmATTACH_WIDGET ); i++;
XtSetArg(argt[i], XmNtopWidget, title_label ); i++;
XtSetArg(argt[i], XmNbottomAttachment, XmATTACH_WIDGET ); i++;
XtSetArg(argt[i], XmNbottomWidget, ok_button ); i++;
XtSetArg(argt[i], XmNleftAttachment, XmATTACH_FORM ); i++;
XtSetArg(argt[i], XmNrightAttachment, XmATTACH_FORM ); i++;
switch (siaFormInfo->rendition)
{
case SIAMENUONE:
XtSetArg(argt[i], XmNradioBehavior, True ); i++;
/* no break */
case SIAMENUANY:
XtSetArg(argt[i], XmNisHomogeneous, True ); i++;
XtSetArg(argt[i], XmNentryClass, xmToggleButtonGadgetClass); i++;
XtSetArg(argt[i], XmNentryAlignment, XmALIGNMENT_BEGINNING ); i++;
break;
case SIAONELINER:
/* no break */
case SIAFORM:
XtSetArg(argt[i], XmNentryAlignment, XmALIGNMENT_END ); i++;
}
prompts_row_col = XmCreateRowColumn(sia_form, "prompts_row_col", argt, i);
XtManageChild(prompts_row_col);
prompt_labels = (Widget *) alloca(sizeof(Widget *) * siaFormInfo->num_prompts);
prompt_answers = siaFormInfo->answer_widgets;
noecho_trans = XtParseTranslationTable(noEchoBindings);
text_trans = XtParseTranslationTable(textEventBindings);
for (j=0; j<siaFormInfo->num_prompts; j++)
{
/*
* create the prompt label
*/
char label_name[81];
char answer_name[81];
sprintf(label_name,"Prompt %d",j);
sprintf(answer_name,"Answer %d",j);
xmstr = multiline_xmstring(siaFormInfo->prompts[j]);
switch (siaFormInfo->rendition)
{
case SIAMENUANY:
case SIAMENUONE:
{
/* i = InitArg(ToggleBG); */
i = 0;
XtSetArg(argt[i], XmNtraversalOn, True ); i++;
XtSetArg(argt[i], XmNlabelString, xmstr ); i++;
prompt_answers[j] = XmCreateToggleButtonGadget(prompts_row_col,
answer_name, argt, i);
}
break;
case SIAONELINER:
/* no break */
case SIAFORM:
{
i = 0;
XtSetArg(argt[i], XmNtraversalOn, True ); i++;
XtSetArg(argt[i], XmNlabelString, xmstr ); i++;
prompt_labels[j] = XmCreateLabel(prompts_row_col, label_name,
argt, i);
XtManageChild(prompt_labels[j]);
/*
* create the answer text field
*/
i = InitArg(Text);
XtSetArg(argt[i], XmNselectionArrayCount, 1 ); i++;
XtSetArg(argt[i], XmNmaxLength, 80 ); i++;
XtSetArg(argt[i], XmNmappedWhenManaged, True ); i++;
XtAddActions(textActions, 1);
prompt_answers[j] = XmCreateTextField(prompts_row_col,
answer_name, argt, i);
/* Make Return advance to next field. */
XtOverrideTranslations(prompt_answers[j], text_trans);
if (!siaFormInfo->visible[j])
{
/*
* allocate the answer buffer
*/
siaFormInfo->answers[j] = XtMalloc(SIAMXPASSWORD+1);
(siaFormInfo->answers[j])[0] = '\0';
XtAddCallback(prompt_answers[j], XmNmodifyVerifyCallback,
NoEchoCB, siaFormInfo);
XtAddCallback(prompt_answers[j], XmNmotionVerifyCallback,
NoEchoCB, siaFormInfo);
/* handle Delete/Backspace in the no-echo case */
XtOverrideTranslations(prompt_answers[j], noecho_trans);
}
}
break;
} /* end switch (siaFormInfo->rendition) */
XtManageChild(prompt_answers[j]);
}
XtManageChild(sia_form);
/*
* Center the OK and Cancel buttons
*/
{
Dimension width;
i = 0;
XtSetArg(argt[i], XmNwidth, &width); i++;
XtGetValues(ok_button, argt, i);
i = 0;
XtSetArg(argt[i], XmNleftAttachment, XmATTACH_POSITION); i++;
XtSetArg(argt[i], XmNleftPosition, 33); i++;
XtSetArg(argt[i], XmNleftOffset, -(width/2)); i++;
XtSetValues(ok_button, argt, i);
i = 0;
XtSetArg(argt[i], XmNwidth, &width); i++;
XtGetValues(cancel_button, argt, i);
i = 0;
XtSetArg(argt[i], XmNleftAttachment, XmATTACH_POSITION); i++;
XtSetArg(argt[i], XmNleftPosition, 66); i++;
XtSetArg(argt[i], XmNleftOffset, -(width/2)); i++;
XtSetValues(cancel_button, argt, i);
}
if (siaFormInfo->rendition == SIAONELINER
|| siaFormInfo->rendition == SIAFORM)
{
/*
* Make the Return key Activate on the last text field.
*/
XtOverrideTranslations(prompt_answers[siaFormInfo->num_prompts - 1],
activate_trans);
XtAddCallback(prompt_answers[siaFormInfo->num_prompts - 1],
XmNactivateCallback, RespondSiaFormCB, siaFormInfo);
XSetInputFocus(XtDisplay(prompt_answers[0]),
XtWindow(prompt_answers[0]), RevertToPointerRoot, CurrentTime);
i = 0;
XtSetArg(argt[i], XmNinitialFocus, prompt_answers[0]); i++;
XtSetValues(sia_form, argt, i);
XmProcessTraversal(prompt_answers[0],XmTRAVERSE_CURRENT);
}
}
/*
*****************
* NoEchoCB
*
* Save the text entered but do not display it
*****************
*/
static void NoEchoCB( Widget w, XtPointer client_data, XtPointer call_data )
{
int i;
SiaFormInfo *siaFormInfo;
XmTextVerifyPtr call;
siaFormInfo = (SiaFormInfo *)client_data;
call = (XmTextVerifyPtr) call_data;
if(call->reason == XmCR_MOVING_INSERT_CURSOR)
{
call->doit=False;
return;
}
for (i=0; i<siaFormInfo->num_prompts; i++)
{
if (w == siaFormInfo->answer_widgets[i])
{
if (call->text->ptr)
strcat(siaFormInfo->answers[i], call->text->ptr);
call->text->ptr[0] = '\0';
return;
}
}
}
/*
************************
* RespondSiaFormCB
*
* PB callback collects answers, sends them down the pipe
* and destroys the sia_form.
************************
*/
static void RespondSiaFormCB( Widget w, XtPointer client_data,
XtPointer call_data )
{
char buf[REQUEST_LIM_MAXLEN];
ResponseForm *r;
int i;
SiaFormInfo *siaFormInfo;
char *answer_ptr;
r = (ResponseForm *)buf;
siaFormInfo = (SiaFormInfo *)client_data;
r->hdr.opcode = REQUEST_OP_FORM;
r->hdr.reserved = 0;
r->hdr.length = sizeof(ResponseForm);
r->collect_status = siaFormInfo->collect_status;
r->num_answers = siaFormInfo->num_prompts;
r->offAnswers = sizeof(ResponseForm);
answer_ptr = buf + sizeof(ResponseForm);
for (i=0; i<siaFormInfo->num_prompts; i++)
{
if (siaFormInfo->rendition == SIAMENUONE
|| siaFormInfo->rendition == SIAMENUANY)
{
if (XmToggleButtonGadgetGetState(siaFormInfo->answer_widgets[i]))
siaFormInfo->answers[i] = "X";
else
siaFormInfo->answers[i] = NULL;
}
else if (siaFormInfo->visible[i])
siaFormInfo->answers[i] =
XmTextFieldGetString(siaFormInfo->answer_widgets[i]);
if (!siaFormInfo->answers[i] || (siaFormInfo->answers[i])[0] == '\0')
{
*answer_ptr = '\0';
*answer_ptr++;
r->hdr.length++;
}
else
{
int tmp;
r->hdr.length += strlen(siaFormInfo->answers[i]) + 1;
strcpy(answer_ptr, siaFormInfo->answers[i]);
tmp = strlen(answer_ptr) + 1;
answer_ptr+= tmp;
r->hdr.length += tmp;
}
}
#ifdef DEBUG
for (i=0; i<siaFormInfo->num_prompts; i++)
printf("answer %d : %s\n", i, siaFormInfo->answers[i]);
#else
write(1, buf, r->hdr.length);
#endif
for (i=0; i<siaFormInfo->num_prompts; i++)
{
XtFree(siaFormInfo->answers[i]);
XtFree(siaFormInfo->prompts[i]);
XtFree(siaFormInfo->title);
}
XtDestroyWidget(siaFormInfo->sia_form_widget);
}
/***************************************************************************
*
* SiaBackspace
*
* Local backspace action for the no-echo case text widget.
* Deletes the last character of the string in the
* widget for each backspace key press.
***************************************************************************/
static void
SiaBackspace( Widget w, XEvent *event, char **params, Cardinal *num_params )
{
int i, len;
for (i=0; i<globalSiaFormInfo->num_prompts; i++)
{
if (globalSiaFormInfo->answer_widgets[i] == w)
{
len = strlen(globalSiaFormInfo->answers[i]);
if (len > 0)
globalSiaFormInfo->answers[i][len-1] = '\0';
return;
}
}
}
/*
************************
* CancelSiaFormCB
*
* Set collect_status to failure, call RespondSiaFormCB.
*
************************
*/
static void CancelSiaFormCB( Widget w, XtPointer client_data,
XtPointer call_data )
{
SiaFormInfo *siaFormInfo;
siaFormInfo = (SiaFormInfo *)client_data;
siaFormInfo->collect_status = 0;
RespondSiaFormCB(w, client_data, call_data);
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,56 @@
/* $XConsortium: vgversion.c /main/6 1996/08/30 15:34:13 drk $
*
* (c) Copyright 1996 Digital Equipment Corporation.
* (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
* (c) Copyright 1993,1994,1996 International Business Machines Corp.
* (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
* (c) Copyright 1993,1994,1996 Novell, Inc.
* (c) Copyright 1996 FUJITSU LIMITED.
* (c) Copyright 1996 Hitachi.
*/
/********************************************************
Copyright (c) 1988, 1990 by Hewlett-Packard Company
Copyright (c) 1988 by the Massachusetts Institute of Technology
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the names of
Hewlett-Packard or M.I.T. not be used in advertising or publicity
pertaining to distribution of the software without specific, written
prior permission.
********************************************************/
#include <include/hpversion.h>
#ifndef lint
version_tag("dtgreet: $XConsortium: vgversion.c /main/6 1996/08/30 15:34:13 drk $")
#ifdef __AFS
static char _afs_version[] = "@(#)AFS 3 Authentication";
#endif
#ifdef __KERBEROS
static char _krb_version[] = "@(#)Kerberos Authentication";
#endif
#ifdef __PASSWD_ETC
static char _rgy_version[] = "@(#)Passwd Etc. - Domain Registry Authentication";
#endif
#ifdef BLS
static char _bls_version[] = "@(#)HP BLS Authentication";
#endif
#endif /* lint */

View File

@@ -0,0 +1,340 @@
/* $XConsortium: xdm_msg.h /main/3 1995/10/27 16:18:41 rswiston $ */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
#ifndef _H_XDM_MSG
#define _H_XDM_MSG
#include <limits.h>
#include <nl_types.h>
#define MF_XDM "xdm.cat"
/* The following was generated from ../../../../../../../src/gos/2d/XTOP/aixclients/xdm/xdm.msg. */
/* definitions for set MS_XDM */
#define MS_XDM 1
#define MSG_XDM_1 1
#define MSG_XDM_2 2
#define MSG_XDM_3 3
#define MSG_XDM_4 4
#define MSG_XDM_5 5
#define MSG_XDM_6 6
#define MSG_XDM_7 7
#define MSG_XDM_8 8
/* definitions for set MS_xdmshell */
#define MS_xdmshell 2
#define M_MSG_1 1
#define M_MSG_2 2
#define M_MSG_3 3
#define M_MSG_4 4
#define M_MSG_5 5
#define M_MSG_6 6
#define M_MSG_7 7
#define M_MSG_8 8
#define M_MSG_9 9
/* definitions for set MS_access */
#define MS_access 3
#define M_MSG_10 1
#define E_MSG_11 2
#define E_MSG_12 3
#define E_MSG_13 4
/* definitions for set MS_auth */
#define MS_auth 4
#define M_MSG_14 1
#define M_MSG_15 2
#define M_MSG_16 3
#define M_MSG_17 4
#define M_MSG_19 5
#define E_MSG_20 6
#define M_MSG_21 7
#define E_MSG_22 8
#define M_MSG_23 9
#define M_MSG_24 10
#define M_MSG_25 11
#define M_MSG_26 12
#define M_MSG_27 13
#define M_MSG_28 14
#define M_MSG_29 15
#define M_MSG_30 16
#define E_MSG_31 17
#define M_MSG_32 18
#define M_MSG_33 19
#define M_MSG_34 20
#define M_MSG_35 21
#define M_MSG_36 22
#define M_MSG_37 23
#define M_MSG_38 24
#define M_MSG_39 25
#define E_MSG_40 26
#define M_MSG_41 27
#define M_MSG_42 28
#define M_MSG_43 29
#define M_MSG_44 30
#define E_MSG_45 31
#define M_MSG_46 32
#define M_MSG_47 33
/* definitions for set MS_choose */
#define MS_choose 5
#define E_MSG_48 1
#define M_MSG_49 2
#define M_MSG_50 3
#define M_MSG_51 4
#define M_MSG_52 5
#define M_MSG_53 6
#define E_MSG_54 7
#define M_MSG_55 8
#define M_MSG_56 9
#define M_MSG_57 10
#define E_MSG_58 11
#define M_MSG_59 12
#define M_MSG_60 13
#define E_MSG_61 14
/* definitions for set MS_dm */
#define MS_dm 6
#define M_MSG_62 1
#define E_MSG_63 2
#define E_MSG_64 3
#define M_MSG_65 4
#define M_MSG_66 5
#define M_MSG_67 6
#define E_MSG_68 7
#define M_MSG_69 8
#define M_MSG_70 9
#define M_MSG_71 10
#define M_MSG_72 11
#define M_MSG_73 12
#define M_MSG_74 13
#define M_MSG_75 14
#define M_MSG_76 15
#define M_MSG_77 16
#define M_MSG_78 17
#define M_MSG_79 18
#define M_MSG_80 19
#define M_MSG_81 20
#define M_MSG_82 21
#define E_MSG_83 22
#define M_MSG_84 23
#define E_MSG_85 24
#define E_MSG_86 25
#define M_MSG_87 26
#define M_MSG_88 27
#define M_MSG_89 28
#define M_MSG_90 29
#define M_MSG_91 30
#define M_MSG_92 31
#define E_MSG_93 32
#define M_MSG_94 33
#define M_MSG_95 34
#define M_MSG_96 35
#define M_MSG_98 36
#define E_MSG_99 37
#define E_MSG_100 38
#define E_MSG_101 39
/* definitions for set MS_error */
#define MS_error 7
#define E_MSG_102 1
#define M_MSG_103 2
#define M_MSG_104 3
#define E_MSG_105 4
#define M_MSG_106 5
/* definitions for set MS_file */
#define MS_file 8
#define E_MSG_107 1
#define E_MSG_108 2
#define E_MSG_109 3
#define M_MSG_110 4
#define M_MSG_111 5
/* definitions for set MS_greet */
#define MS_greet 9
#define M_MSG_112 1
#define M_MSG_113 2
#define M_MSG_114 3
#define M_MSG_115 4
/* definitions for set MS_netaddr */
#define MS_netaddr 10
#define M_MSG_116 1
#define M_MSG_117 2
#define M_MSG_118 3
/* definitions for set MS_policy */
#define MS_policy 11
#define M_MSG_119 1
#define M_MSG_120 2
/* definitions for set MS_protodpy */
#define MS_protodpy 12
#define M_MSG_121 1
#define M_MSG_122 2
#define M_MSG_123 3
#define M_MSG_124 4
/* definitions for set MS_reset */
#define MS_reset 13
#define M_MSG_125 1
#define E_MSG_126 2
#define M_MSG_127 3
#define M_MSG_128 4
#define M_MSG_129 5
/* definitions for set MS_resource */
#define MS_resource 14
#define M_MSG_130 1
#define E_MSG_131 2
#define E_MSG_132 3
#define E_MSG_133 4
/* definitions for set MS_rpcauth */
#define MS_rpcauth 15
#define M_MSG_134 1
/* definitions for set MS_server */
#define MS_server 16
#define M_MSG_135 1
#define M_MSG_136 2
#define E_MSG_137 3
#define E_MSG_138 4
#define E_MSG_139 5
#define M_MSG_140 6
#define M_MSG_141 7
#define M_MSG_142 8
#define M_MSG_143 9
#define M_MSG_144 10
#define M_MSG_145 11
#define E_MSG_146 12
#define M_MSG_147 13
#define E_MSG_148 14
#define M_MSG_149 15
#define M_MSG_150 16
#define M_MSG_151 17
#define M_MSG_152 18
#define M_MSG_153 19
#define M_MSG_154 20
#define E_MSG_155 21
#define M_MSG_156 22
#define E_MSG_157 23
#define M_MSG_158 24
#define M_MSG_160 25
/* definitions for set MS_socket */
#define MS_socket 17
#define M_MSG_161 1
#define E_MSG_162 2
#define E_MSG_163 3
#define M_MSG_164 4
#define E_MSG_165 5
/* definitions for set MS_streams */
#define MS_streams 18
#define M_MSG_166 1
#define E_MSG_167 2
#define E_MSG_168 3
#define M_MSG_169 4
#define E_MSG_170 5
/* definitions for set MS_verify */
#define MS_verify 19
#define M_MSG_171 1
#define M_MSG_172 2
#define M_MSG_173 3
#define M_MSG_174 4
#define M_MSG_175 5
#define M_MSG_176 6
#define M_MSG_177 7
#define E_MSG_178 8
/* definitions for set MS_xdmauth */
#define MS_xdmauth 20
#define M_MSG_179 1
#define M_MSG_180 2
/* definitions for set MS_xdmcp */
#define MS_xdmcp 21
#define M_MSG_181 1
#define M_MSG_182 2
#define M_MSG_183 3
#define M_MSG_184 4
#define M_MSG_185 5
#define M_MSG_186 6
#define M_MSG_187 7
#define M_MSG_188 8
#define M_MSG_189 9
#define M_MSG_190 10
#define M_MSG_191 11
#define M_MSG_192 12
#define M_MSG_193 13
#define M_MSG_194 14
#define M_MSG_195 15
#define M_MSG_196 16
#define M_MSG_197 17
#define M_MSG_198 18
#define M_MSG_199 19
#define M_MSG_200 20
#define M_MSG_201 21
#define M_MSG_202 22
#define M_MSG_203 23
#define M_MSG_204 24
#define M_MSG_205 25
#define M_MSG_206 26
#define M_MSG_207 27
#define M_MSG_208 28
#define M_MSG_209 29
#define M_MSG_210 30
#define M_MSG_211 31
#define M_MSG_212 32
#define M_MSG_213 33
#define M_MSG_214 34
/* definitions for set MS_sessreg */
#define MS_sessreg 22
#define M_MSG_215 1
#define M_MSG_216 2
#define M_MSG_217 3
/* definitions for set MS_chooser */
#define MS_chooser 23
#define M_MSG_218 1
#define M_MSG_219 2
#define M_MSG_220 3
#define M_MSG_221 4
#define M_MSG_222 5
#define M_MSG_223 6
#define M_MSG_224 7
#define M_MSG_225 8
#endif

View File

@@ -0,0 +1,341 @@
/* $TOG: xdmauth.c /main/4 1997/03/14 13:45:35 barstow $ */
/* (c) Copyright 1997 The Open Group */
/* *
* (c) Copyright 1993, 1994 Hewlett-Packard Company *
* (c) Copyright 1993, 1994 International Business Machines Corp. *
* (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
* (c) Copyright 1993, 1994 Novell, Inc. *
*/
/*
* @DEC_COPYRIGHT@
*/
/*
* HISTORY
* $Log$
* Revision 1.1.2.3 1995/06/06 20:25:50 Chris_Beute
* Code snapshot merge from March 15 and SIA changes
* [1995/05/31 20:17:31 Chris_Beute]
*
* Revision 1.1.2.2 1995/04/21 13:05:43 Peter_Derr
* dtlogin auth key fixes from deltacde
* [1995/04/12 19:21:36 Peter_Derr]
*
* xdm R6 version used to handle XDM-AUTHORIZATION-1
* [1995/04/12 18:06:02 Peter_Derr]
*
* $EndLog$
*/
/*
Copyright (c) 1988 X Consortium
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 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 X CONSORTIUM 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 X Consortium 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 X Consortium.
*/
/*
* xdm - display manager daemon
* Author: Keith Packard, MIT X Consortium
*
* xdmauth
*
* generate authorization data for XDM-AUTHORIZATION-1 as per XDMCP spec
*/
#include "dm.h"
#ifdef HASXDMAUTH
static char auth_name[256];
static int auth_name_len;
XdmPrintDataHex (s, a, l)
char *s;
char *a;
int l;
{
int i;
Debug ("%s", s);
for (i = 0; i < l; i++)
Debug (" %02x", a[i] & 0xff);
Debug ("\n");
}
#ifdef notdef /* not used */
XdmPrintKey (s, k)
char *s;
XdmAuthKeyRec *k;
{
XdmPrintDataHex (s, (char *) k->data, 8);
}
#endif
#ifdef XDMCP
XdmPrintArray8Hex (s, a)
char *s;
ARRAY8Ptr a;
{
XdmPrintDataHex (s, (char *) a->data, a->length);
}
#endif
XdmInitAuth (name_len, name)
#if NeedWidePrototypes
unsigned int name_len;
#else
unsigned short name_len;
#endif /* NeedWidePrototypes */
char *name;
{
if (name_len > 256)
name_len = 256;
auth_name_len = name_len;
memmove( auth_name, name, name_len);
}
/*
* Generate authorization for XDM-AUTHORIZATION-1
*
* When being used with XDMCP, 8 bytes are generated for the session key
* (sigma), as the random number (rho) is already shared between xdm and
* the server. Otherwise, we'll prepend a random number to pass in the file
* between xdm and the server (16 bytes total)
*/
Xauth *
XdmGetAuthHelper (namelen, name, includeRho)
unsigned short namelen;
char *name;
int includeRho;
{
Xauth *new;
new = (Xauth *) malloc (sizeof (Xauth));
if (!new)
return (Xauth *) 0;
new->family = FamilyWild;
new->address_length = 0;
new->address = 0;
new->number_length = 0;
new->number = 0;
if (includeRho)
new->data_length = 16;
else
new->data_length = 8;
new->data = (char *) malloc (new->data_length);
if (!new->data)
{
free ((char *) new);
return (Xauth *) 0;
}
new->name = (char *) malloc (namelen);
if (!new->name)
{
free ((char *) new->data);
free ((char *) new);
return (Xauth *) 0;
}
memmove( (char *)new->name, name, namelen);
new->name_length = namelen;
GenerateAuthData ((char *)new->data, new->data_length);
/*
* set the first byte of the session key to zero as it
* is a DES key and only uses 56 bits
*/
((char *)new->data)[new->data_length - 8] = '\0';
XdmPrintDataHex ("Local server auth", (char *)new->data, new->data_length);
return new;
}
Xauth *
XdmGetAuth (namelen, name)
#if NeedWidePrototypes
unsigned int namelen;
#else
unsigned short namelen;
#endif /* NeedWidePrototypes */
char *name;
{
return XdmGetAuthHelper (namelen, name, TRUE);
}
#ifdef XDMCP
XdmGetXdmcpAuth (pdpy,authorizationNameLen, authorizationName)
struct protoDisplay *pdpy;
#if NeedWidePrototypes
unsigned int authorizationNameLen;
#else
unsigned short authorizationNameLen;
#endif /* NeedWidePrototypes */
char *authorizationName;
{
Xauth *fileauth, *xdmcpauth;
if (pdpy->fileAuthorization && pdpy->xdmcpAuthorization)
return;
xdmcpauth = XdmGetAuthHelper (authorizationNameLen, authorizationName, FALSE);
if (!xdmcpauth)
return;
fileauth = (Xauth *) malloc (sizeof (Xauth));
if (!fileauth)
{
XauDisposeAuth(xdmcpauth);
return;
}
/* build the file auth from the XDMCP auth */
*fileauth = *xdmcpauth;
fileauth->name = malloc (xdmcpauth->name_length);
fileauth->data = malloc (16);
fileauth->data_length = 16;
if (!fileauth->name || !fileauth->data)
{
XauDisposeAuth (xdmcpauth);
if (fileauth->name)
free ((char *) fileauth->name);
if (fileauth->data)
free ((char *) fileauth->data);
free ((char *) fileauth);
return;
}
/*
* for the file authorization, prepend the random number (rho)
* which is simply the number we've been passing back and
* forth via XDMCP
*/
memmove( fileauth->name, xdmcpauth->name, xdmcpauth->name_length);
memmove( fileauth->data, pdpy->authenticationData.data, 8);
memmove( fileauth->data + 8, xdmcpauth->data, 8);
XdmPrintDataHex ("Accept packet auth", xdmcpauth->data, xdmcpauth->data_length);
XdmPrintDataHex ("Auth file auth", fileauth->data, fileauth->data_length);
/* encrypt the session key for its trip back to the server */
XdmcpWrap (xdmcpauth->data, &pdpy->key, xdmcpauth->data, 8);
pdpy->fileAuthorization = fileauth;
pdpy->xdmcpAuthorization = xdmcpauth;
}
#define atox(c) ('0' <= c && c <= '9' ? c - '0' : \
'a' <= c && c <= 'f' ? c - 'a' + 10 : \
'A' <= c && c <= 'F' ? c - 'A' + 10 : -1)
static
HexToBinary (key)
char *key;
{
char *out, *in;
int top, bottom;
in = key + 2;
out= key;
while (in[0] && in[1])
{
top = atox(in[0]);
if (top == -1)
return 0;
bottom = atox(in[1]);
if (bottom == -1)
return 0;
*out++ = (top << 4) | bottom;
in += 2;
}
if (in[0])
return 0;
*out++ = '\0';
return 1;
}
/*
* Search the Keys file for the entry matching this display. This
* routine accepts either plain ascii strings for keys, or hex-encoded numbers
*/
XdmGetKey (pdpy, displayID)
struct protoDisplay *pdpy;
ARRAY8Ptr displayID;
{
FILE *keys;
char line[1024], id[1024], key[1024];
int keylen;
Debug ("Lookup key for %*.*s\n", displayID->length, displayID->length, displayID->data);
keys = fopen (keyFile, "r");
if (!keys)
return FALSE;
while (fgets (line, sizeof (line) - 1, keys))
{
if (line[0] == '#' || sscanf (line, "%s %s", id, key) != 2)
continue;
bzero(line, sizeof(line));
Debug ("Key entry \"%s\" \"%s\"\n", id, key);
if (strlen (id) == displayID->length &&
!strncmp (id, (char *)displayID->data, displayID->length))
{
if (!strncmp (key, "0x", 2) || !strncmp (key, "0X", 2))
if (!HexToBinary (key))
break;
keylen = strlen (key);
while (keylen < 7)
key[keylen++] = '\0';
pdpy->key.data[0] = '\0';
memmove( pdpy->key.data + 1, key, 7);
bzero(key, sizeof(key));
fclose (keys);
return TRUE;
}
}
bzero(line, sizeof(line));
bzero(key, sizeof(key));
fclose (keys);
return FALSE;
}
/*ARGSUSED*/
XdmCheckAuthentication (pdpy, displayID, authenticationName, authenticationData)
struct protoDisplay *pdpy;
ARRAY8Ptr displayID, authenticationName, authenticationData;
{
XdmAuthKeyPtr incoming;
if (!XdmGetKey (pdpy, displayID))
return FALSE;
if (authenticationData->length != 8)
return FALSE;
XdmcpUnwrap (authenticationData->data, &pdpy->key,
authenticationData->data, 8);
XdmPrintArray8Hex ("Request packet auth", authenticationData);
if (!XdmcpCopyARRAY8(authenticationData, &pdpy->authenticationData))
return FALSE;
incoming = (XdmAuthKeyPtr) authenticationData->data;
XdmcpIncrementKey (incoming);
XdmcpWrap (authenticationData->data, &pdpy->key,
authenticationData->data, 8);
return TRUE;
}
#endif /* XDMCP */
#endif /* HASXDMAUTH (covering the entire file) */

1291
cde/programs/dtlogin/xdmcp.c Normal file

File diff suppressed because it is too large Load Diff