Trailing-Edge
-
PDP-10 Archives
-
SRI_NIC_PERM_SRC_3_19910112
-
utilities/wlno.fai
There are no other files named wlno.fai in the archive.
;ACCT:<ADMIN.PROGRAMS>WLNO.FAI.4, 7-Sep-81 21:20:20, Edit by B.BOMBADIL
;Never dewheel OPERATOR - assume we're bright enough to change the password
;ACCT:<ADMIN.PROGRAMS>WLNO.FAI.3, 7-Sep-81 21:18:30, Edit by B.BOMBADIL
;ACCT:<ADMIN.PROGRAMS>WLNO.FAI.2, 4-Jun-81 11:59:53, Edit by B.BOMBADIL
;change reference to wheel to special privileges
;<J.JQJOHNSON>WLNO.FAI.18, 12-Feb-80 08:42:37, Edit by J.JQJOHNSON
;some cleanup
;PS:<J.JQJOHNSON>WLNO.FAI.14, 17-Sep-79 10:17:20, Edit by J.JQJOHNSON
;convert to using MM for mailing.
title wlno Wheel purge.
comment $
Reads one file (normally <OPERATOR>WHEELS.LIST) for the list of
current wheels, and another (normally DSK:WHEEL.NOTE) for the message to
send to each of the wheels. Clears their privileges, then fires up MM
in SEND mode, initialized with the list of wheels and the message.
$
search monsym,macsym
.require sys:macrel
extern .jbsa
p=17
namptr==14 ;pointer into OUTBUF for user names
dirblk: block 40
namblk: block 40
pdlen==20
pdl: block pdlen
jfn: 0 ; jfn of WHEELS.LIST
acblk: block 20 ; acs for lower fork
msgjfn: 0 ; jfn of message to be sent
usrno: 0 ; current user number
gjtab: block 20
inbuf: block 30
outbuf: block 100 ; for user names.
start: reset
move p,[iowd pdlen,pdl]
hrroi 1,[asciz/File name for wheel list input: /]
call infile
hrrzm 1,jfn
start0: hrroi 1,[asciz/File name for file containing message: /]
call jfnget
jrst start0 ;oops
hrrzm 1,msgjfn
call setmai ;set up for mailing.
tmsg<
>
;loop over all users in the file
sloop: call gtusr ;get a user name from file. Number in 1
jrst done ;eof
movem 2,usrno ; save user number for mailing
hrli 2,540000 ;convert to PS:
hrroi 1,namblk
dirst ;translate to string for crdir
erjmp [jserr
jrst sloop ;just ignore him
]
hrroi 1,namblk
psout
tmsg < -- >
move 1,2 ;get number back for gtdir
camn 1,[540000,,5] ;OPERATOR?
jrst sloop ;yes, ignore for safety's sake
movei 2,dirblk
setz 3, ;no password
gtdir
ercal jserr0
setzm dirblk+.cdprv ;clear all privledges
hrroi 1,namblk
move 2,[cd%prv+dirblk]
setz 3, ;no password needed
crdir
ercal jserr0 ;warn and return
tmsg <crdir OK
>
call domail ;send the mail
jrst sloop ;back for more
done: move 1,jfn ;close input file for neatness
closf
jfcl ;don't care
jrst sndmai ;finish up mail
;chains to MM, so we never get back to here.
;get a user number from file.
;call:
;return: +1 on eof
; +2 normally, user number in 2
gtusr: move 1,jfn
hrroi 2,namblk
movei 3,100
movei 4,.chtab ;break on TAB
sin
erjmp eoftst ;check for eof
setz 3,
dpb 3,2 ;end with a null byte
hrrz 1,jfn
hrroi 2,inbuf
movei 3,30*5
movei 4,12 ;break on LF
sin
ercal eoftst
movx 1,rc%emo ;match exactly
hrroi 2,namblk
setz 3,
rcdir
erjmp [movx 1,rc%emo
hrroi 2,namblk
setz 3,
rcusr
jrst .+1 ]
move 2,3 ;return number in 2
retskp
; sin failed. check for EOF.
eoftst: hrrz 1,jfn
gtsts ;eof?
tlne 2,(gs%eof)
ret ;yes. return + 1
jshlt
subttl infile
; open a file for input getting file name from terminal
;enter: 1/ string for prompt
;ret: + 1, with jfn in 1
infile: call jfnget
jrst infile
push p,1 ; save jfn
hrrz 1,1
move 2,[070000,,of%rd]
openf
erjmp [hrroi 1,[asciz/Can't OPENF the file. Try again.
/]
psout
pop p,1
rljfn
jserr
jrst infile ]
pop p,1
ret
;get a jfn on a file from the tty
;call: 1/ string for prompt
;ret: +1 failure
; +2 success. JFN in ac1
jfnget: push p,1
psout ;print the prompt
move 1,[gjtab,,gjtab+1]
setzm gjtab
blt 1,gjtab+1+.gjbfp
pop p,gjtab+.gjbfpp
movsi 1,(gj%old!gj%xtn!gj%ifg!gj%cfm!gj%cfm)
movem 1,gjtab+.gjgen
move 1,[.priin,,.priou]
movem 1,gjtab+.gjsrc
movei 1,4
movem 1,gjtab+.gjf2
movei 1,gjtab
setz 2,
gtjfn
erjmp [hrroi 1,[asciz/Can't get jfn. Try again.
/]
psout
move 1,gjtab+.gjrty
ret ]
retskp
subttl mail stuff
;initialization
setmai: move 1,[point 7,outbuf]
hrroi 2,[asciz/MAIL /]
call cpystr
movem 1,namptr
ret ;doesn't need much setup
;do mail to one user
;call: USRNO set up with user number.
;ret: +1 always
domail: move 1,namptr
move 2,usrno
hrli 2,500000
dirst ;translate to string for MM.
erjmp [jserr
ret
]
movei 3,","
idpb 3,1
movem 1,namptr
ret
;finish up. Do actual mailing by chaining to MM.
;does not return
sndmai: move 1,namptr
movei 3,15
dpb 3,1 ;clobber last comma with CRLF
movei 3,12
idpb 3,1
hrroi 2,[asciz/You no longer have special privileges....
/]
call cpystr ;put file name after ^B to insert
move 2,msgjfn
setzb 4,3
jfns
hrroi 2,[asciz/
display
/]
call cpystr ;indicate we want to confirm before mailing
movei 1,.priin
cfibf
hrroi 1,outbuf
rscan ;make it a command for MM.
erjmp [jshlt
]
movx 1,gj%sht+gj%old ;and now chain to MM.
hrroi 2,[asciz/SYS:MM.EXE/]
gtjfn
erjmp [hrroi 1,[asciz/Can't find MM!/]
esout
haltf
]
hrli 1,.fhslf
move 4,1 ; 400000,,jfn of program
move 2,[strtcd,,5]
blt 2,5+lcd-1 ; get ready to run in the ACs
seto 1,
move 2,[.fhslf,,1] ; process handle,,first page
move 3,[pm%cnt+777] ; page count
jrst 5 ; go do it in ACs
;does not return
strtcd:
phase 5
pmap ; 5
move 1,4 ; 6 .fhslf,,jfn
get ; 7 load this fork
movei 1,.fhslf ; 10 this fork
gevec ; 11
hrrz 1,.jbsa ; 12 assume 10/50 format
tlnn 2,777000 ; 13
hrrz 1,2 ; 14 Tenex format
jrst (1) ; 15 go!
dephase
lcd==.-strtcd
;CPYSTR -- copy a string. Terminates on 0 byte
;call: t1/ destination byte-pointer, or -1,,addr, or jfn
; t2/ source byte-pointer, or -1,,addr
;ret: +1 always, with updated string pointers in t1 and t2, and break char
; (0) in t3
cpystr: tlnn 1,-1 ;is left half zero?
jrst cpyst2 ;yes, must be a jfn. Do SOUT
tlc 1,-1 ;convert to real byte ptr if necessary
tlcn 1,-1
hrli 1,(<point 7,0>)
tlc 2,-1 ;convert to real byte ptr if necessary
tlcn 2,-1
hrli 2,(<point 7,0>)
cpyst0: ildb 3,2
jumpe 3,r
idpb 3,1
jrst cpyst0
ret
cpyst2: setz 3,
sout
ret
end start