From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 22-JAN-1991 16:16:17.80
To:	MRGATE::"ARISIA::EVERHART"
CC:	
Subj:	Re: Photo For Users?

Received:  by crdgw1.ge.com (5.57/GE 1.80)
	 id AA01721; Tue, 22 Jan 91 16:03:47 EST
Received: From INDYVAX.IUPUI.EDU by CRVAX.SRI.COM with TCP; Tue, 22 JAN 91 10:36:29 PST
Date: Tue, 22 Jan 1991 13:37 EST
From: "James A. Harvey" <IJAH400@INDYVAX.IUPUI.EDU>
Subject: Re: Photo For Users?
To: INFO-VAX@SRI.COM
Cc: ISIS08@ECOSTAT.AAU.DK
Message-Id: <76B117B5400026D7@INDYVAX.IUPUI.EDU>
X-Organization: Indiana University-Purdue University at Indianapolis
X-Vms-To: IN%"INFO-VAX@SRI.COM"
X-Vms-Cc: IN%"ISIS08@ECOSTAT.AAU.DK"

In article <CE7DC78C323F00B4DE@vms2.uni-c.dk>, ISIS08@ECOSTAT.AAU.DK (Arne Vajhxj) writes:
  >  [In an unattributed article someone else asked:]
  >  >       I have recently gotten a file on Info-Vax which told of a New Terminal
  >  > session logger. This Program has only one flaw for regular users like me....
  >  > I Cannot install it because of Privs!  My question is this:
  >  >       Has anybody Written a program for *Users* who would like to log their own
  >  > Session, which does not require the massive ammount of Privelages that Photo and
  >  > the like require??
  >
  >You can use PHOTO without any privilges !
  >
  >The drivers is installed, if you have DECwindows installed (on pre VMS 5.4
  >systems). And even if they are not installed, I think you can get your
  >system-manager to install them (most system-managers prefer a executable
  >file from DIGITAL for public domain source-code).
  >
  >Then PHOTO would like to have PHY_IO privilige, but actual it will
  >run without. It prints a warning, but you can out-comment that warning
  >in the source-code.

In the version that sets the TW terminal characteristics with a IO$_SETCHAR
(which requires PHY_IO), if you simple ignore the warning your terminal
characteristics will not be propagated to the TW terminal.  This is what
the warning is all about.  If your site's default characteristics are
quite different from what you usually run the resulting behavior may be
very disappointing.

However, the good news is that there is a very simple patch you can make to
PHOTO to remove the requirement for PHY_IO.  Then there is no need to install
it with PHY_IO (or indeed to install it at all).  The patch just changes
the IO$_SETCHAR to an IO$_SETMODE (requires no privilege but only "sticks"
as long as a channel is open) and then hangs on to the channel just long
enough to make the characteristics stick (until the subprocess opens the
TW terminal).  Here is a description of the patch:

In the function fix_a_tw(), find the declaration of the variable tw_chn and
change it to a global variable (i.e., move it's declaration outside of
fix_a_tw()).  Next, in fix_a_tw(), find the line:

    st = SYS$QIOW(0,tw_chn,IO$_SETCHAR,0,0,0,&tw_chr,ttchrlen,0,0,0,0);

and change it to:

    st = SYS$QIOW(0,tw_chn,IO$_SETMODE,0,0,0,&tw_chr,ttchrlen,0,0,0,0);

Next, in fix_a_tw(), find the line:

    check(SYS$DASSGN(tw_chn));     /* We don't need it. only the mailbox */
                                   /* in fact keeping it kills us. */
and comment it out.

Finally, in the function low_lib_spawn(pty_io,pid), at the very end, right
before the "return st;" (the last line in the function) add the line:

    check(SYS$DASSGN(tw_chn));		/* Deassign tw_chn here now */

  >[rest of message omitted]

We've been running this patch here for a couple of years with no problems.
The patch may already be in one of the newer versions of PHOTO, I'm sure
I mentioned it to someone else once.

James Harvey, IUPUI Computing Services   IJAH400@IUPUI.EDU | HARVEY@INDIANA.EDU
799 West Michigan Street, ET Room 1023          UUCP: {...}!iuvax!iugate!harvey
Indianapolis, IN  46202-5160  (317)274-0747            BITNET:  IJAH400@INDYVAX
"Ruth made a big mistake when he gave up pitching." -- Tris Speaker, 1921

