> Has anyone yet added AFS (meaning, authentication) support to the X11R6 > xdm? I know there are several versions of X11R5 xdm with AFS support > floating around, but has anyone done it for X11R6? I use ka_UserAuthenticateGeneral() for getting the AFS token (someone does it for X11R5, doesn't it?). It seems to work well with AFS 3.3 libraries and header files, sun4m, SunOS 4.1.3. Following is the patch in unified diff format. Before try this patch, please set "#define HasAFS YES" in your site.def for imake. -- Susumu Miki ([EMAIL PROTECTED]) Tsukuba Research Center, Real World Computing Partnership, JAPAN ========================================================================= --- ../../../../tree/xc/programs/xdm/Imakefile Sat Apr 2 07:49:40 1994 +++ Imakefile Mon Jan 9 07:36:37 1995 @@ -30,6 +30,16 @@ KRB5SRCS = krb5auth.c #endif +#if HasAFS +EXTRA_DEFINES = -DAFS_ENV +EXTRA_INCLUDES = -I/usr/afsws/include +AFSLIB = -L/usr/afsws/lib/afs -lkauth -lprot \ + -L/usr/afsws/lib -lubik -lauth -lrxkad -lsys \ + -lrx -llwp -lcom_err /usr/afsws/lib/afs/util.a -ldes +#else +AFS_LIB = +#endif + #if SharedLibXdmGreet GREET_DIR = greeter #if SystemV4 @@ -61,7 +71,7 @@ INCLUDES = $(KRB5_INCLUDE) DEPLIBS = $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB) $(DEPXAUTHLIB) $(DEPXDMCPLIB) -LOCAL_LIBRARIES = $(XMULIB) $(XTOOLLIB) $(XLIB) $(XAUTHLIB) $(XDMCPLIB) $(RPCLIB) $(DLLIB) +LOCAL_LIBRARIES = $(XMULIB) $(XTOOLLIB) $(XLIB) $(XAUTHLIB) $(XDMCPLIB) $(RPCLIB) +$(DLLIB) $(AFSLIB) 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 \ @@ -160,6 +170,6 @@ * Don't install; let people read the instructions about putting in the * abort-display() resource: */ -#ifdef comment +#ifdef InstallXdmshell InstallProgramWithFlags(xdmshell,$(BINDIR),NullParameter) #endif diff -ur ../../../../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 9 07:25:32 1995 @@ -53,6 +53,10 @@ char *getenv(); #endif +#ifdef AFS_ENV +# include <afs/kautils.h> +#endif /* AFS_ENV */ + static char *envvars[] = { #if defined(sony) && !defined(SYSTYPE_SYSV) && !defined(_SYSTYPE_SYSV) "bootdev", @@ -153,6 +157,12 @@ #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,6 +171,26 @@ 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");

Reply via email to