subroutine validate c c NU PRIME TIME FACILITY V 2.0 c Northeastern University Academic Computer Services c 360 Huntington Avenue c Boston, Mass 02115 c c David Bernardo, Author c c This routine sets the table of commands to reflect the rights c and privileges of the user. Certain commands should not be c executed except by the allmighty. c common /valid/valid_commands,group common /user/username byte valid_commands(14) integer*4 jpi_buf(10),jpi$_grp,jpi$_mem,grp_l,mem_l,flag, 1 group,member,sys$waitfr,lib$get_ef,jpi$_username,username_l, 2 lib$free_ef,return_code,sys$getjpi integer*2 def_slice,def_wait,def_threshold,sysgrp, 1 sys_priv_grp,lim_priv_grp,num_logins,cluster_logins character username*12 parameter (jpi$_grp='3080004'x,jpi$_mem='3070004'x, 1 jpi$_username='202000c'x) c jpi_buf(1)=jpi$_grp jpi_buf(2)=%loc(group) jpi_buf(3)=%loc(grp_l) jpi_buf(4)=jpi$_mem jpi_buf(5)=%loc(member) jpi_buf(6)=%loc(mem_l) jpi_buf(7)=jpi$_username jpi_buf(8)=%loc(username) jpi_buf(9)=%loc(username_l) jpi_buf(10)=0 do i=1,14 valid_commands(i)=1 enddo def_slice=0 def_wait=0 def_threshold=0 sysgrp=1 sys_priv_grp=1 lim_priv_grp=1 num_logins=0 cluster_logins=0 c c Get default values. c call open_file_read(4,*10) read(4,err=5,end=5)def_slice,def_wait,def_threshold,sysgrp, 1 sys_priv_grp,lim_priv_grp,num_logins,cluster_logins 5 close(unit=4) c c Get info about runner of this program. c 10 return_code=lib$get_ef(flag) return_code=sys$getjpi(%val(flag),,,%ref(jpi_buf),,,) return_code=sys$waitfr(%val(flag)) return_code=lib$free_ef(flag) if(group.gt.lim_priv_grp.and.group.gt.sys_priv_grp)then print*,'PTC-VALIDATE No privilege for attempted operation.' call exit endif c c Set allowed commands appropriatly. c if(group.gt.sys_priv_grp.and.group.le.lim_priv_grp)then valid_commands(1)=0 valid_commands(3)=0 valid_commands(8)=0 valid_commands(9)=0 valid_commands(10)=0 valid_commands(11)=0 endif return end