	subroutine jtemitlog
c emit log msg about user turning off EACF. Use with jtexempt so that
c when it is used it gets logged.
	integer*4 idwrk(2)
	integer*2 i2dw(4)
	equivalence(i2dw(1),idwrk(1))
	character*8 cidwrk
	equivalence(idwrk(1),cidwrk)
        integer*4 ttyspl,imgspl
        integer*4 iosb(2),jpiitm(3,7)
        integer*2 jp2itm(6,7)
        equivalence(jpiitm(1,1),jp2itm(1,1))
	byte wknm(16)
	integer*4 wkn4(4),jtspawn
	external jtspawn
	character*16 cwknm
	character*256 cwa1
	character*256 cwrkn
	equivalence (cwrkn,cwknm)
	equivalence (cwknm,wknm(1),wkn4(1))
	character*32 ttyspb,unamb
	character*64 accpor
	include '($jpidef)'
	integer*4 accporl,iuic,iprv(2)
	common/kiuic/iuic
	character*256 imgspb
	integer*4 unaml
	common/jpijunk/ttyspb,ttyspl,imgspb,imgspl,unamb
     1  ,unaml,accpor,accporl
	integer*4 sys$getjpiw
	external sys$getjpiw
	include '($strdef)'
	integer*4 str$match_wild
	external str$match_wild
c	icapab(1) = -1
c call the license checker to alter icapab mask to disable
c stuff.
c Set up the getjpi list so we can find terminal name etc.
c for the victim process. Get the image name so we can check for a
c special exempted image.
	jp2itm(1,1)=32
        jp2itm(2,1)=JPI$_TT_PHYDEVNAM
        jpiitm(2,1)=%loc(ttyspb)
        jpiitm(3,1)=%loc(ttyspl)
        jp2itm(1,2)=256
        jp2itm(2,2)=JPI$_IMAGNAME
        jpiitm(2,2)=%loc(imgspb)
        jpiitm(3,2)=%loc(imgspl)
        jp2itm(1,3)=32
        jp2itm(2,3)=JPI$_USERNAME
        jpiitm(2,3)=%loc(unamb)
        jpiitm(3,3)=%loc(unaml)
c        jpiitm(1,4)=0
	jp2itm(1,4)=64
c	jp2itm(2,4)=JPI$TT_ACCPORNAM
	jp2itm(2,4)=813
        jpiitm(2,4)=%LOC(ACCPOR)
        jpiitm(3,4)=%LOC(ACCPORL)
c        jpiitm(1,5)=0
	jp2itm(1,5)=4
	jp2itm(2,5)=JPI$_UIC
        jpiitm(2,5)=%loc(iuic)
	jpiitm(3,5)=%loc(lluic)
        jp2itm(1,6)=8
        jp2itm(2,6)=JPI$_CURPRIV
        jpiitm(2,6)=%loc(iprv(1))
        jpiitm(3,6)=%loc(lprvs)
        jpiitm(1,7)=0
        jpiitm(2,7)=0
        jpiitm(3,7)=0
	kk=sys$getjpiw(%val(1),,,jpiitm,iosb,,)
	unaml=ivlen(unamb,16)
	ttyspl=ivlen(ttyspb,32)
	imgspl=ivlen(imgspb,256)
	accporl=ivlen(accpor,64)
833	continue
c report additional info on this guy also
	write(cwa1,113)ttyspb(:ttyspl),imgspb(:imgspl),
     1  unamb(:unaml),accpor(:accporl)
113	format('%EACF - EACF Disable by tty:',a,' image:',a,
     1  ' username:',a,' accpor:',a)
	lcwa1=ivlen(cwa1,256)
	call oprmsg(cwa1(:lcwa1))
	return
	end
	integer*4 function ivlen(arg,len)
	integer*4 len
	character*(*) arg
c return length of printable string
	do 1 n=1,len
	k=len+1-n
c go back in loop looking for a printing char.
	if(ichar(arg(k:k)).gt.32)goto 2
1	continue
	ivlen=0
	return
2	continue
	ivlen=k
	return
	end
