[1092] in testers

home help back first fref pref prev next nref lref last post

xlogin

daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Fri Nov 9 22:57:05 1990

To: testers@ATHENA.MIT.EDU
Date: Fri, 09 Nov 90 22:56:37 EST
From: John Carr <jfc@ATHENA.MIT.EDU>


First impressions on reading the source (verify.c):

	Default path should have /bin near the start.

	Don't call chown() on the ticket file.  The kerberos library will
	use the real userid to set the correct permissions, regardless of
	the storage method used to hold tickets (in particular, chown() does
	not do the right thing when shared memory is used for tickets).

	Does it really make sense to do a check for "secure" in /etc/ttys?

	The exit() in the switch(fork()) body should be _exit().

Here is a set of patches to xlogin (I tried compiling it with function
prototypes).

*** /afs/athena.mit.edu/astaff/project/xdm/src/xlogin/verify.c	Thu Nov  8 15:32:15 1990
--- verify.c	Fri Nov  9 09:19:10 1990
***************
*** 37,43 ****
--- 37,45 ----
  #define NOATTACH "/etc/noattach"
  #define NOWLOCAL "/etc/nowarnlocal"
  #define ATTACH "/bin/athena/attach"
+ #define	ATTACHAV0 "attach"
  #define DETACH "/bin/athena/attach"
+ #define	DETACHAV0 "detach"
  #define MOTD "/etc/motd"
  #define UTMP "/etc/utmp"
  #define WTMP "/usr/adm/wtmp"
***************
*** 48,53 ****
--- 50,57 ----
  #define file_exists(f) (access((f), F_OK) == 0)
  
  
+ extern char *crypt();
+ 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;
***************
*** 390,396 ****
  			"Could not execute dettach command as user %s,\n",
  			pwd->pw_name);
  	    }
! 	    execl(DETACH, DETACH, "-quiet", pwd->pw_name, NULL);
  	    exit(-1);
  	default:
  	    while (attach_state == -1)
--- 394,400 ----
  			"Could not execute dettach command as user %s,\n",
  			pwd->pw_name);
  	    }
! 	    execl(DETACH, DETACHAV0, "-quiet", pwd->pw_name, NULL);
  	    exit(-1);
  	default:
  	    while (attach_state == -1)
***************
*** 476,482 ****
      len = strlen(p->pw_name);
  
      while (fgets(buf, sizeof(buf) - 1, old)) {
! 	if (strncmp(p->pw_name, len - 1, buf) || buf[len] != ':')
  	  fputs(buf, new);
      }
  
--- 480,486 ----
      len = strlen(p->pw_name);
  
      while (fgets(buf, sizeof(buf) - 1, old)) {
! 	if (strncmp(p->pw_name, buf, len - 1) || buf[len] != ':')
  	  fputs(buf, new);
      }
  
***************
*** 532,538 ****
  	    fprintf(stderr, "Filesystem mappings may be incorrect.\n");
  	}
  	/* don't do zephyr here since user doesn't have zwgc started anyway */
! 	execl(ATTACH, ATTACH, "-quiet", "-nozephyr", pwd->pw_name, NULL);
  	exit(-1);
      default:
  	break;
--- 536,542 ----
  	    fprintf(stderr, "Filesystem mappings may be incorrect.\n");
  	}
  	/* don't do zephyr here since user doesn't have zwgc started anyway */
! 	execl(ATTACH, ATTACHAV0, "-quiet", "-nozephyr", pwd->pw_name, NULL);
  	exit(-1);
      default:
  	break;
*** /afs/athena.mit.edu/astaff/project/xdm/src/xlogin/xlogin.c	Thu Nov  8 18:31:54 1990
--- xlogin.c	Fri Nov  9 09:12:13 1990
***************
*** 115,121 ****
  /*
   * Globals.
   */
! XtIntervalId curr_timerid = NULL, blink_timerid = NULL, react_timerid = NULL;
  Widget appShell;
  Widget saver, ins;
  XLoginResources resources;
--- 115,121 ----
  /*
   * Globals.
   */
! XtIntervalId curr_timerid = 0, blink_timerid = 0, react_timerid = 0;
  Widget appShell;
  Widget saver, ins;
  XLoginResources resources;
***************
*** 397,405 ****
        first_time = FALSE;
      }
  
!   if (blink_timerid != NULL)	/* don't blink while screensaved... */
      XtRemoveTimeOut(blink_timerid);
!   blink_timerid = NULL;
  
    /* don't let the real screensaver kick in */
    XSetScreenSaver(dpy, 0, -1, DefaultBlanking, DefaultExposures);
--- 397,405 ----
        first_time = FALSE;
      }
  
!   if (blink_timerid != 0)	/* don't blink while screensaved... */
      XtRemoveTimeOut(blink_timerid);
!   blink_timerid = 0;
  
    /* don't let the real screensaver kick in */
    XSetScreenSaver(dpy, 0, -1, DefaultBlanking, DefaultExposures);
***************
*** 440,452 ****
    XSetScreenSaver(dpy, -1, -1, DefaultBlanking, DefaultExposures);
    resetCB(w, NULL, NULL);
  
!   if (curr_timerid != NULL)
      XtRemoveTimeOut(curr_timerid);
    curr_timerid = XtAddTimeOut(resources.save_timeout * 1000,
  			      screensave, NULL);
    blink_timerid = XtAddTimeOut(random() % (10 * 1000),
  			       blinkOwl, NULL);
!   if (react_timerid != NULL)
      XtRemoveTimeOut(react_timerid);
    if (activation_state == REACTIVATING)
      react_timerid = XtAddTimeOut(resources.activate_timeout * 1000,
--- 440,452 ----
    XSetScreenSaver(dpy, -1, -1, DefaultBlanking, DefaultExposures);
    resetCB(w, NULL, NULL);
  
!   if (curr_timerid != 0)
      XtRemoveTimeOut(curr_timerid);
    curr_timerid = XtAddTimeOut(resources.save_timeout * 1000,
  			      screensave, NULL);
    blink_timerid = XtAddTimeOut(random() % (10 * 1000),
  			       blinkOwl, NULL);
!   if (react_timerid != 0)
      XtRemoveTimeOut(react_timerid);
    if (activation_state == REACTIVATING)
      react_timerid = XtAddTimeOut(resources.activate_timeout * 1000,
***************
*** 764,770 ****
    if (owl != NULL)
      {
        owlWindow = XtWindow(owl);
!       if (owlWindow != NULL)
  	{
  	  XtSetArg(args[n], XtNlabel, &filenames); n++;
  	  XtSetArg(args[n], XtNforeground, &values.foreground); n++;
--- 764,770 ----
    if (owl != NULL)
      {
        owlWindow = XtWindow(owl);
!       if (owlWindow != None)
  	{
  	  XtSetArg(args[n], XtNlabel, &filenames); n++;
  	  XtSetArg(args[n], XtNforeground, &values.foreground); n++;


home help back first fref pref prev next nref lref last post