Message-Id: <[EMAIL PROTECTED]>
Date: Wed, 3 Jul 1996 13:46:23 -0400 (EDT)
From: James Crawford Ralston <[EMAIL PROTECTED]>
> I've been able to hook ka_UserAuthenticateGeneral() from the AFS
> libraries into our Solaris 1.1.1b X11R6 xdm, but I've encountered
> difficult getting the same thing to work on Solaris 2.4. I can link and
> run the binary, but the authentication step fails. When I use the xdm
> command-line switch for debugging, it seg faults.
> Has anyone gotten this to work?
I have succeeded with following modification for X11R6 xdm on Solaris 2.4.
--
Susumu Miki ([EMAIL PROTECTED])
Tsukuba Research Center, Real World Computing Partnership, JAPAN
==
diff -rc ../../../../../tree/xc/programs/xdm/Imakefile Imakefile
*** ../../../../../tree/xc/programs/xdm/Imakefile Tue Jan 31 08:42:09 1995
--- Imakefile Mon Jan 29 23:19:05 1996
***************
*** 30,39 ****
--- 30,56 ----
KRB5SRCS = krb5auth.c
#endif
+ #if HasAFS
+ EXTRA_DEFINES = -DAFS_ENV
+ EXTRA_INCLUDES = -I/usr/afsws/include
+ AFSLIB = -L/usr/afsws/lib/afs -lkauth \
+ -L/usr/afsws/lib -lubik \
+ -L/usr/afsws/lib/afs -lprot \
+ -L/usr/afsws/lib -lrxkad -lrx -llwp \
+ -L/usr/afsws/lib/afs -lauth -lsys \
+ -L/usr/afsws/lib -lrxkad -ldes \
+ -L/usr/afsws/lib/afs -lcmd -lcom_err /usr/afsws/lib/afs/util.a -laudit \
+ /usr/ucblib/libucb.a
+ #else
+ AFS_LIB =
+ #endif
+
#if SharedLibXdmGreet
GREET_DIR = greeter
#if SystemV4
DLLIB = -ldl
+ GREETLIB= -L$(XDMDIR) -lXdmGreet
+ DEPGREETLIB= $(GREET_DIR)/libXdmGreet.so
#endif
#else
GREET_DEFINES = -DGREET_USER_STATIC
***************
*** 79,86 ****
SUBDIRS = $(GREET_DIR) $(XDMCONFIGDIR)
INCLUDES = $(KRB5_INCLUDE)
DEPLIBS = $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) $(DEPXAUTHLIB) $(DEPXDMCPLIB)
! LOCAL_LIBRARIES = $(XMULIB) $(XTOOLLIB) $(XLIB) $(XAUTHLIB) $(XDMCPLIB) $(RPCLIB)
$(DLLIB)
SRCS1 = auth.c daemon.c server.c dpylist.c dm.c error.c file.c \
netaddr.c reset.c resource.c protodpy.c policy.c \
--- 96,108 ----
SUBDIRS = $(GREET_DIR) $(XDMCONFIGDIR)
INCLUDES = $(KRB5_INCLUDE)
+ #if SharedLibXdmGreet
+ DEPLIBS = $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) $(DEPXAUTHLIB) $(DEPXDMCPLIB)
+$(DEPGREETLIB)
+ LOCAL_LIBRARIES = $(XMULIB) $(XTOOLLIB) $(XLIB) $(XAUTHLIB) $(XDMCPLIB) $(GREETLIB)
+$(RPCLIB) $(DLLIB) $(AFSLIB)
+ #else
DEPLIBS = $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) $(DEPXAUTHLIB) $(DEPXDMCPLIB)
! LOCAL_LIBRARIES = $(XMULIB) $(XTOOLLIB) $(XLIB) $(XAUTHLIB) $(XDMCPLIB) $(RPCLIB)
$(DLLIB) $(AFSLIB)
! #endif
SRCS1 = auth.c daemon.c server.c dpylist.c dm.c error.c file.c \
netaddr.c reset.c resource.c protodpy.c policy.c \
***************
*** 102,108 ****
DEPLIBS3 = XawClientDepLibs $(DEPXDMCPLIB)
LIBS3 = XawClientLibs $(XDMCPLIB)
#endif
!
SRCS4 = sessreg.c
OBJS4 = sessreg.o
#if BuildChooser
--- 124,130 ----
DEPLIBS3 = XawClientDepLibs $(DEPXDMCPLIB)
LIBS3 = XawClientLibs $(XDMCPLIB)
#endif
!
SRCS4 = sessreg.c
OBJS4 = sessreg.o
#if BuildChooser
***************
*** 181,186 ****
* Don't install; let people read the instructions about putting in the
* abort-display() resource:
*/
! #ifdef comment
InstallProgramWithFlags(xdmshell,$(BINDIR),NullParameter)
#endif
--- 203,208 ----
* Don't install; let people read the instructions about putting in the
* abort-display() resource:
*/
! #ifdef InstallXdmshell
InstallProgramWithFlags(xdmshell,$(BINDIR),NullParameter)
#endif
diff -rc ../../../../../tree/xc/programs/xdm/greeter/verify.c greeter/verify.c
*** ../../../../../tree/xc/programs/xdm/greeter/verify.c Mon Apr 18 09:03:55
1994
--- greeter/verify.c Mon Jan 29 23:06:45 1996
***************
*** 53,58 ****
--- 53,63 ----
char *getenv();
#endif
+ #ifdef AFS_ENV
+ # include <afs/param.h>
+ # include <afs/kautils.h>
+ #endif /* AFS_ENV */
+
static char *envvars[] = {
#if defined(sony) && !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV)
"bootdev",
***************
*** 153,158 ****
--- 158,169 ----
#ifdef USESHADOW
struct spwd *sp;
#endif
+
+ #ifdef AFS_ENV
+ int afs_code;
+ char *afs_reason;
+ #endif /* AFS_ENV */
+
#if !defined(SVR4) || !defined(GREET_LIB) /* shared lib decls handle this */
char *crypt ();
char **systemEnv (), **parseArgs ();
***************
*** 161,166 ****
--- 172,197 ----
char **argv;
Debug ("Verify %s ...\n", greet->name);
+ #ifdef AFS_ENV
+ /*
+ * AFS and UNIX authentication.
+ * 1. Send user's password to AFS Authentication Server.
+ * If password is correct user will get token, otherwise
+ * cannot get token.
+ * 2. Anyway, continues local UNIX login process.
+ */
+ afs_code = ka_UserAuthenticateGeneral(
+ KA_USERAUTH_VERSION+KA_USERAUTH_DOSETPAG,
+ greet->name,
+ (char *)0, /* instance */
+ (char *)0, /* realm */
+ greet->password,/* real password */
+ 0, /* lifetime, default */
+ 0, 0, /* spares */
+ &afs_reason );
+ Debug ("afs_code = %d, afs_reason = \"%s\"\n",
+ afs_code, afs_reason);
+ #endif /* AFS_ENV */
p = getpwnam (greet->name);
if (!p || strlen (greet->name) == 0) {
Debug ("getpwnam() failed.\n");