[2775] in Release_Engineering
xdm
daemon@ATHENA.MIT.EDU (Mark Rosenstein)
Fri Apr 17 19:28:12 1992
Date: Fri, 17 Apr 92 19:27:44 -0400
From: Mark Rosenstein <mar@MIT.EDU>
To: rel-eng@MIT.EDU
Cc: mar@MIT.EDU
OK, it's done. /mit/xdm/src/xdm contains the sources. You want
*.{c,h}
Imakefile
Xaccess
Xresources
Xservers
xdm-config
xdm.man
BUT NOT athena-verify.c.
Put these files in /source/athena/athena.etc/xdm/xdm, and edit the
Imakefile in /source/athena/athena.etc/xdm to build there. FYI, this
source is the X11R5 sources with changes to compile on X11R4, then
changes to session.c and verify.c for the Athenization.
You also need to apply the diffs and the end of this message to
/source/athena/athena.etc/xdm/verify.c (or pickup
/mit/xdm/src/xdm/athena-verify.c.new to put there). These diffs allow
it to compile on POSIX platforms without BSD compatibility, and have a
few #ifdef XDM sections so that we can share this code.
Text for the release notes:
XDM: An Athenized version of the X Consortium's X Display Manager is
included in this release. It can be used to have a private Athena
workstation host an X terminal, letting an Athena user login to the
private workstation on the X terminal. While this will work for one
or two X terminals per workstation, it is not recommended on a large
scale. We have not attempted to address scaling and management issues
for large deployments of X terminals.
This is based on the X11R5 version of xdm, changed to compile under
X11R4 for our release and with Athena changes for login. To use it,
you will need to copy /usr/athena/etc/xdm and the directory
/etc/athena/xdm to the local disk. Then edit /etc/athena/xdm/Xservers
as indicated in the comments in that file, and finally start
/usr/athena/etc/xdm -config /etc/athena/xdm/xdm-config
There is one known bug with this: a user logged in to an X terminal
who runs "show_console", "hide_console", or "config_console" will
affect the console window on workstation's display head, NOT the one
on their own screen.
-Mark
*** /source/athena/athena.etc/xdm/xlogin/verify.c Sun Apr 5 16:42:05 1992
--- athena-verify.c.new Fri Apr 17 19:24:19 1992
***************
*** 17,22 ****
--- 17,25 ----
#include <hesiod.h>
#include <errno.h>
#include <syslog.h>
+ #ifdef XDM
+ #include "dm.h"
+ #endif
#ifdef _IBMR2
#include <userpw.h>
***************
*** 65,71 ****
extern char *crypt(), *lose(), *getenv();
extern char *krb_get_phost(); /* should be in <krb.h> */
! char *get_tickets(), *attachhomedir(), *malloc(), *strsave(), *add_to_group();
int abort_verify();
extern int attach_state, attach_pid, attachhelp_state, attachhelp_pid;
extern int errno, quota_pid;
--- 68,77 ----
extern char *crypt(), *lose(), *getenv();
extern char *krb_get_phost(); /* should be in <krb.h> */
! char *get_tickets(), *attachhomedir(), *strsave(), *add_to_group();
! #ifndef POSIX
! char *malloc();
! #endif
int abort_verify();
extern int attach_state, attach_pid, attachhelp_state, attachhelp_pid;
extern int errno, quota_pid;
***************
*** 74,80 ****
--- 80,91 ----
int added_to_passwd = FALSE;
+ #ifdef XDM
+ char *dologin(user, passwd, option, script, tty, session, display, verify)
+ struct verify_info *verify;
+ #else /* XDM */
char *dologin(user, passwd, option, script, tty, session, display)
+ #endif /* XDM */
char *user;
char *passwd;
int option;
***************
*** 301,307 ****
return("Out of memory while trying to initialize user environment variables.");
i = 0;
! #if defined(_AIX) && defined(_IBMR2)
environment[i++] = "USRENVIRON:";
#endif
sprintf(errbuf, "HOME=%s", pwd->pw_dir);
--- 312,318 ----
return("Out of memory while trying to initialize user environment variables.");
i = 0;
! #if defined(_AIX) && defined(_IBMR2) && !defined(XDM)
environment[i++] = "USRENVIRON:";
#endif
sprintf(errbuf, "HOME=%s", pwd->pw_dir);
***************
*** 338,344 ****
--- 349,357 ----
environment[i++] = strsave(errbuf);
}
#if defined(_AIX) && defined(_IBMR2)
+ #ifndef XDM
environment[i++] = "SYSENVIRON:";
+ #endif
sprintf(errbuf,"LOGIN=%s",pwd->pw_name);
environment[i++] = strsave(errbuf);
sprintf(errbuf,"LOGNAME=%s",pwd->pw_name);
***************
*** 364,369 ****
--- 377,399 ----
times[1].tv_usec = times[0].tv_usec;
utimes(errbuf, times);
+ #ifdef XDM
+ {
+ static char *newargv[4];
+
+ verify->uid = pwd->pw_uid;
+ getGroups(pwd->pw_name, verify, pwd->pw_gid);
+ verify->userEnviron = environment;
+ newargv[0] = script;
+ sprintf(errbuf, "%d", option);
+ newargv[1] = errbuf;
+ newargv[2] = session;
+ newargv[3] = NULL;
+ verify->argv = newargv;
+ return(0);
+ }
+ #endif /* XDM */
+
#if defined(_AIX) && defined(_IBMR2)
i = setgidx(ID_SAVED|ID_REAL|ID_EFFECTIVE, pwd->pw_gid);
#else
***************
*** 392,398 ****
newargv[1] = errbuf;
newargv[2] = script;
newargv[3] = NULL;
! setpenv(pwd->pw_name,PENV_KLEEN|PENV_INIT|PENV_ARGV,environment,newargv);
#else
execle(session, "sh", errbuf, script, NULL, environment);
#endif
--- 422,429 ----
newargv[1] = errbuf;
newargv[2] = script;
newargv[3] = NULL;
! setpenv(pwd->pw_name,PENV_KLEEN|PENV_INIT|PENV_ARGV,
! environment,(char *)newargv);
#else
execle(session, "sh", errbuf, script, NULL, environment);
#endif
***************
*** 542,559 ****
/* /etc/security/{environ, limits, user} files so that they pick up */
/* the default values */
putuserattr(p->pw_name,(char *)NULL,((void *) 0),SEC_NEW);
! putuserattr(p->pw_name,S_ID,p->pw_uid,SEC_INT);
! putuserattr(p->pw_name,S_PWD,"!",SEC_CHAR);
! putuserattr(p->pw_name,S_PGRP,"mit",SEC_CHAR);
! putuserattr(p->pw_name,S_HOME,p->pw_dir,SEC_CHAR);
! putuserattr(p->pw_name,S_SHELL,p->pw_shell,SEC_CHAR);
! putuserattr(p->pw_name,S_GECOS,p->pw_gecos,SEC_CHAR);
! putuserattr(p->pw_name,S_LOGINCHK,1,SEC_BOOL);
! putuserattr(p->pw_name,S_SUCHK,1,SEC_BOOL);
! putuserattr(p->pw_name,S_RLOGINCHK,1,SEC_BOOL);
! putuserattr(p->pw_name,S_ADMIN,0,SEC_BOOL);
! putuserattr(p->pw_name,"athena_temp",1,SEC_INT);
putuserattr(p->pw_name,(char *)NULL,((void *) 0),SEC_COMMIT);
enduserdb();
/* Now, lock the shadow password file */
--- 573,591 ----
/* /etc/security/{environ, limits, user} files so that they pick up */
/* the default values */
putuserattr(p->pw_name,(char *)NULL,((void *) 0),SEC_NEW);
! putuserattr(p->pw_name,S_ID,(void *)(p->pw_uid),SEC_INT);
! putuserattr(p->pw_name,S_PWD,(void *)"!",SEC_CHAR);
! putuserattr(p->pw_name,S_PGRP,(void *)"mit",SEC_CHAR);
! putuserattr(p->pw_name,S_HOME,(void *)(p->pw_dir),SEC_CHAR);
! putuserattr(p->pw_name,S_SHELL,(void *)(p->pw_shell),SEC_CHAR);
! putuserattr(p->pw_name,S_GECOS,(void *)(p->pw_gecos),SEC_CHAR);
! putuserattr(p->pw_name,S_LOGINCHK,(void *)1,SEC_BOOL);
! putuserattr(p->pw_name,S_SUCHK,(void *)1,SEC_BOOL);
! putuserattr(p->pw_name,S_RLOGINCHK,(void *)1,SEC_BOOL);
! putuserattr(p->pw_name,S_ADMIN,(void *)0,SEC_BOOL);
putuserattr(p->pw_name,(char *)NULL,((void *) 0),SEC_COMMIT);
+ putuserattr(p->pw_name,"athena_temp",(void *)1,SEC_INT);
+ putuserattr(p->pw_name,(char *)NULL,((void *) 0),SEC_COMMIT);
enduserdb();
/* Now, lock the shadow password file */
***************
*** 611,617 ****
--- 643,651 ----
/* This tells the display manager to cleanup the password file for
* us after we exit
*/
+ #ifndef XDM
kill(getppid(), SIGUSR2);
+ #endif
added_to_passwd = TRUE;
return(0);
}
***************
*** 1014,1022 ****
fprintf(stderr,"Error creating group %s (%d)\n",gname,gid);
continue;
}
! putgroupattr(gname,S_ID,gid,SEC_INT);
! putgroupattr(gname,S_ADMIN,0,SEC_BOOL);
! putgroupattr(gname,"athena_temp",1,SEC_BOOL);
putgroupattr(gname,(char *)NULL,((void *) 0),SEC_COMMIT);
}
}
--- 1048,1056 ----
fprintf(stderr,"Error creating group %s (%d)\n",gname,gid);
continue;
}
! putgroupattr(gname,S_ID,(void *)gid,SEC_INT);
! putgroupattr(gname,S_ADMIN,(void *)0,SEC_BOOL);
! putgroupattr(gname,"athena_temp",(void *)1,SEC_BOOL);
putgroupattr(gname,(char *)NULL,((void *) 0),SEC_COMMIT);
}
}