Here's the test code : -
$!Author:&Richard&Maher&-&TIER3&Software&Ltd
$!
$on&warning&then&exit
$if&.not.&f$privilege("cmkrnl,impersonate,tmpmbx") &then&goto&no_priv
$if&f$getsyi("arch_name")&.nes.&"Alpha"&then&goto& no_vax
$!
$create&t.mar
&&&&&&&&.TITLE&External&symbol&definitions
&&&&&&&&$ISSDEF&&&&&&&&&&&&&&&&&GLOBAL
&&&&&&&&.END
$macrox/lis&t
$!
$create&t1.cob
identification&division.
program-id.&&&&iss_disp&with&ident&"v2.1".
author.&&&&&&&&Tier3&Software&Ltd.
environment&division.
input-output§ion.
file-control.
&&&&&&&&select&&uaf&assign&sysuaf.
data&division.
file§ion.
fd&&uaf
&&&&record&varying&depending&on&uaf_rec_len.
01&&uaf_rec&&&&&&&&&&&&&&&&&pic&x(32765).
01&&username_rec.
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&x(4).
&&&&03&&uaf_username&&&&&&&&pic&x(12).
working-storage§ion.
*
01&&child_exit_ast&&&&&&&&&&&&&&&&&&&&&&pointer&va lue&&&external&child_exit_
ast.
01&&iss$m_create_authpriv&&&pic&9(9)&&&&comp&&&&va lue&&&external&iss$m_creat
e_authpriv.
01&&cli$m_nowait&&&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&cli$m_nowai
t.
01&&io$_readvblk&&&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&io$_readvbl
k.
01&&io$_writevblk&&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&io$_writevb
lk.
01&&io$_writeof&&&&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&io$_writeof
..
01&&rms$_rnf&&&&&&&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&rms$_rnf.
01&&ss$_nomoreproc&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&ss$_nomorep
roc.
01&&ss$_userdisabled&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&ss$_userdis
abled.
01&&ss$_endoffile&&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&ss$_endoffi
le.
01&&ss$_normal&&&&&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&ss$_normal.
01&&sys_status&&&&&&&&&&&&&&pic&9(9)&&&&comp.
*
01&&child_params.
&&&&03&&child_status&&&&&&&&pic&9(9)&&&&comp.
&&&&03&&user_exit&&&&&&&&&&&pic&x&&&&&&&&&&&&&&&va lue&&&"N".
01&&child_pid&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
01&&mbx_chan&&&&&&&&&&&&&&&&pic&9(4)&&&&comp.
*
01&&letter_sent.
&&&&03&&new_name&&&&&&&&&&&&pic&x(12).
&&&&03&&new_password&&&&&&&&pic&x(31).
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&x(469).
01&&letter_recv.
&&&&03&&reserved_persona&&&&pic&9(9)&&&&comp.
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&x(508).
*
01&&iosb.
&&&&03&&cond_val&&&&&&&&&&&&pic&9(4)&&&&comp.
&&&&03&&byte_count&&&&&&&&&&pic&9(4)&&&&comp.
&&&&03&&chan_info&&&&&&&&&&&pic&9(9)&&&&comp.
*
01&&uaf_rec_len&&&&&&&&&&&&&pic&9(9)&&&&comp.
01&&eof_uaf&&&&&&&&&&&&&&&&&pic&x&&&&&&&&&&&&&&&va lue&&&"N".
01&&user_cnt&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
*
01&&scratch_lw&&&&&&&&&&&&&&pic&9(9)&&&&comp.
01&&username_len&&&&&&&&&&&&pic&9(4)&&&&comp.
01&&work_persona&&&&&&&&&&&&pic&9(9)&&&&comp.
01&&find_list.
&&&&03&&item_username.
&&&&&&&&05&&new_name_len&&&&pic&9(4)&&&&comp.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(4)&&&&comp&&&&va lue&&&external&iss$_userna
me.
&&&&&&&&05&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pointer&va lue&&&reference&new_name.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
*
procedure&division.
declaratives.
uaf_problems§ion.
&&&&use&after&standard&error&procedure&on&uaf.
00.
&&&&call&"lib$stop"&using&by&value&rms-sts&of&uaf.
*
end&declaratives.
kick_off§ion.
00.
&&&&perform&parent_init.
&&&&display&"Enter&new&username&&:&"&no&advancing.
&&&&accept&&&&&&new_name
&&&&&&&&&&&&&&&&protected
&&&&&&&&&&&&&&&&reversed
&&&&at&end&&&&&&move&"Y"&to&user_exit.
&&&&perform&the_work&until&user_exit&=&"Y".
&&&&call&"sys$qiow"
&&&&&&&&using&&&by&value&&&&&&&&0,&mbx_chan,&io$_w riteof
&&&&&&&&&&&&&&&&by&reference&&&&iosb
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,0,0,0,0,0,0,0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal&move&cond_val&to&sy s_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
*
fini.
&&&&stop&run.
*
parent_init§ion.
00.
&&&&display&"-Processing&UAF&"&erase&screen.
&&&&open&input&uaf&allowing&all.
&&&&read&uaf&at&end&move&"Y"&to&eof_uaf.
&&&&perform&load_personae&until&eof_uaf&=&"Y".
&&&&display&"User&count&=&",&user_cnt&with&convers ion.
&&&&close&uaf.
&&&&call&"sys$crembx"
&&&&&&&&using&&&by&value&&&&&&&&0
&&&&&&&&&&&&&&&&by&reference&&&&mbx_chan
&&&&&&&&&&&&&&&&by&value&&&&&&&&512,&512,&0,&0
&&&&&&&&&&&&&&&&by&descriptor&&&"MY_MBX"
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&call&"lib$spawn"
&&&&&&&&using&&&by&descriptor&&&"$run&t2"
&&&&&&&&&&&&&&&&by&value&&&&&&&&0
&&&&&&&&&&&&&&&&by&descriptor&&&"t2.log"
&&&&&&&&&&&&&&&&by&reference&&&&cli$m_nowait
&&&&&&&&&&&&&&&&by&value&&&&&&&&0
&&&&&&&&&&&&&&&&by&reference&&&&child_pid,&child_s tatus
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&child_exit_a st
&&&&&&&&&&&&&&&&by&reference&&&&child_params
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&call&"sys$qiow"
&&&&&&&&using&&&by&value&&&&&&&&0,&mbx_chan,&io$_r eadvblk
&&&&&&&&&&&&&&&&by&reference&&&&iosb
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,0
&&&&&&&&&&&&&&&&by&reference&&&&letter_recv
&&&&&&&&&&&&&&&&by&value&&&&&&&&512,0,0,0,0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal&move&cond_val&to&sy s_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
*
fini.
*
load_personae§ion.
00.
&&&&call&"str$trim"
&&&&&&&&using&&&by&descriptor&&&uaf_username,&uaf_ username
&&&&&&&&&&&&&&&&by&reference&&&&username_len
&&&&&&&&giving&&sys_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&call&"sys$persona_create"
&&&&&&&&using&&&by&reference&&&&scratch_lw&
&&&&&&&&&&&&&&&&by&descriptor&&&uaf_username(1:use rname_len)
&&&&&&&&&&&&&&&&by&value&&&&&&&&iss$m_create_authp riv,&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal
&&&&&&&&add&1&to&user_cnt
&&&&else
&&&&&&&&if&sys_status&=&ss$_userdisabled&or&rms$_r nf
&&&&&&&&&&&&display&"User&",&uaf_username(1:userna me_len),&"&disabled."
&&&&&&&&else
&&&&&&&&&&&&display&"User&",&uaf_username(1:userna me_len),&"&failed."
&&&&&&&&&&&&call&"lib$stop"&using&by&value&sys_sta tus.
*
fini.
&&&&read&uaf&at&end&move&"Y"&to&eof_uaf.
*
the_work§ion.
00.
&&&&move&function&upper-case&(new_name)&to&new_name.
&&&&call&"str$trim"
&&&&&&&&using&&&by&descriptor&&&new_name,&new_name
&&&&&&&&&&&&&&&&by&reference&&&&new_name_len
&&&&&&&&giving&&sys_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&call&"sys$persona_find"&using&work_persona,&fi nd_list&giving&sys_status.
&&&&if&sys_status&=&ss$_nomoreproc
&&&&&&&&display&"No&such&persona"
&&&&&&&&go&to&fini.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&display&"Enter&new&password&&:&"&no&advancing.
&&&&accept&&&&&&new_password
&&&&&&&&&&&&&&&&protected
&&&&&&&&&&&&&&&&no&echo
&&&&at&end&&&&&&go&to&fini.
&&&&move&function&upper-case&(new_password)&to&new_password.
&&&&call&"sys$persona_delegate"&
&&&&&&&&using&&&child_pid,&
&&&&&&&&&&&&&&&&reserved_persona,&
&&&&&&&&&&&&&&&&work_persona
&&&&&&&&giving&&sys_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&call&"sys$qiow"
&&&&&&&&using&&&by&value&&&&&&&&0,&mbx_chan,&io$_w ritevblk
&&&&&&&&&&&&&&&&by&reference&&&&iosb
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,0
&&&&&&&&&&&&&&&&by&reference&&&&letter_sent
&&&&&&&&&&&&&&&&by&value&&&&&&&&512,0,0,0,0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal&move&cond_val&to&sy s_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&call&"sys$qiow"
&&&&&&&&using&&&by&value&&&&&&&&0,&mbx_chan,&io$_r eadvblk
&&&&&&&&&&&&&&&&by&reference&&&&iosb
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,0
&&&&&&&&&&&&&&&&by&reference&&&&letter_recv
&&&&&&&&&&&&&&&&by&value&&&&&&&&512,0,0,0,0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal&move&cond_val&to&sy s_status.
&&&&if&sys_status¬&=&ss$_normal&and&ss$_endoffi le&
&&&&&&&&call&"lib$stop"&using&by&value&sys_status.
*
fini.
*
&&&&display&"Enter&new&username&&:&"&no&advancing.
&&&&accept&&&&&&new_name
&&&&&&&&&&&&&&&&protected
&&&&&&&&&&&&&&&&reversed
&&&&at&end&&&&&&move&"Y"&to&user_exit.
*
end&program&iss_disp.
identification&division.
program-id.&&&&child_exit_ast.
*
data&division.
linkage§ion.
01&&child_params.
&&&&03&&child_status&&&&&&&&pic&9(9)&&&&comp.
&&&&03&&user_exit&&&&&&&&&&&pic&x.
procedure&division&using&child_params.
00.
&&&&if&user_exit&=&"N"
&&&&&&&&display&"Unexpected&child&exit"
&&&&&&&&call&"lib$stop"&using&by&value&child_statu s.
*
fini.
&&&&exit&program.
*
end&program&child_exit_ast.
$!
$cobolx/lis&t1
$linkx/notrace&t1,t
$inst_file&=&f$parse("t1.exe")&-&";"
$if&f$file_attributes(inst_file,"KNOWN")
$then
$&&&&&&&installx&replace&'inst_file'
$else
$&&&&&&&installx&add&'inst_file'&/share/priv=(sysprv)
$endif
$!
$create&t2.cob
identification&division.
program-id.&&&&iss_exec&with&ident&"v2.1".
author.&&&&&&&&Tier3&Software&Ltd.
data&division.
working-storage§ion.
*
01&&io$_writevblk&&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&io$_writevb
lk.
01&&io$_readvblk&&&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&io$_readvbl
k.
01&&iss$c_id_natural&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&iss$c_id_na
tural.
01&&ss$_abort&&&&&&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&ss$_abort.
01&&ss$_personadelpend&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&ss$_persona
delpend.
01&&ss$_nomoreproc&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&ss$_nomorep
roc.
01&&ss$_endoffile&&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&ss$_endoffi
le.
01&&ss$_normal&&&&&&&&&&&&&&pic&9(9)&&&&comp&&&&va lue&&&external&ss$_normal.
01&&sys_status&&&&&&&&&&&&&&pic&9(9)&&&&comp.
*
01&&iosb.
&&&&03&&cond_val&&&&&&&&&&&&pic&9(4)&&&&comp.
&&&&03&&byte_count&&&&&&&&&&pic&9(4)&&&&comp.
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
*
01&&parent_list.
&&&&03&&item_master_pid.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(4)&&&&comp&&&&va lue&&&4.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(4)&&&&comp&&&&va lue&&&external&jpi$_owner.
&&&&&&&&05&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pointer&va lue&&&reference&parent_pid
..
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
*
01&&user_list.
&&&&03&&item_username.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(4)&&&&comp&&&&va lue&&&12.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(4)&&&&comp&&&&va lue&&&external&jpi$_userna
me.
&&&&&&&&05&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pointer&va lue&&&reference&curr_usern
ame.
&&&&&&&&05&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pointer&va lue&&&reference&curr_usern
ame_len.
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
*
01&&jpi_iosb.
&&&&03&&jpi_sts&&&&&&&&&&&&&pic&9(4)&&&&comp.
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&x(6).
*
01&&parent_pid&&&&&&&&&&&&&&pic&9(9)&&&&comp.
01&&curr_username&&&&&&&&&&&pic&x(12).
01&&curr_username_len&&&&&&&pic&9(4)&&&&comp.
01&&scratch_persona&&&&&&&&&pic&9(9)&&&&comp.
01&&mbx_chan&&&&&&&&&&&&&&&&pic&9(4)&&&&comp.
01&&cmd_eof&&&&&&&&&&&&&&&&&pic&x&&&&&&&&&&&&&&&va lue&&&"N".
01&&letter_sent.
&&&&03&&new_name&&&&&&&&&&&&pic&x(12).
&&&&03&&new_password&&&&&&&&pic&x(31).
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&x(469).
01&&password_len&&&&&&&&&&&&pic&9(4)&&&&comp.
01&&db_spec&&&&&&&&&&&&&&&&&pic&x(50)&&&&&&&&&&&va lue&"alias&pers&filename&m
f_personnel".
01&rdb$message_vector&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&external.
&&&&03&rdb$lu_num_arguments&pic&9(9)&&&&comp.
&&&&03&rdb$lu_status&&&&&&&&pic&9(9)&&&&comp.
&&&&03&rdb$alu_arguments&&&&&&&&&&&&&&&&&&&&&&&&oc curs&18×.
&&&&&&&&05&rdb$lu_arguments&pic&9(9)&&&&comp.
01&&sqlcode&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
01&&system_user&&&&&&&&&&&&&pic&x(31).
01&&session_user&&&&&&&&&&&&pic&x(31).
01&¤t_user&&&&&&&&&&&&pic&x(31).
01&&auth_string&&&&&&&&&&&&&pic&x(60).
*
01&&find_list.
&&&&03&&item_username.
&&&&&&&&05&&new_name_len&&&&pic&9(4)&&&&comp.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(4)&&&&comp&&&&va lue&&&external&iss$_userna
me.
&&&&&&&&05&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pointer&va lue&&&reference&new_name.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
*
procedure&division.
kick_off§ion.
00.
&&&&call&"sys$getjpiw"
&&&&&&&&using&&&by&value&&&&&&&&0,&0,&0
&&&&&&&&&&&&&&&&by&reference&&&&parent_list,&jpi_i osb
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal&move&jpi_sts&to&sys _status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&call&"sys$assign"
&&&&&&&&using&&&by&descriptor&&&"MY_MBX"
&&&&&&&&&&&&&&&&by&reference&&&&mbx_chan
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&call&"declare_connection_name"&using&sqlcode,& db_spec.
&&&&if&rdb$lu_status¬&=&ss$_normal
&&&&&&&&&call&"sys$putmsg"&using&rdb$message_vecto r
&&&&&&&&&call&"lib$stop"&using&by&value&ss$_abort. &&&&&
&&&&perform&get_cmd.
&&&&perform&the_work&until&cmd_eof&=&"Y".
&&&&stop&run.
*
the_work§ion.
00.
&&&&call&"sys$getjpiw"
&&&&&&&&using&&&by&value&&&&&&&&0,&0,&0
&&&&&&&&&&&&&&&&by&reference&&&&user_list,&jpi_ios b
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal&move&jpi_sts&to&sys _status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&display&"Before&username&",&curr_username(1:cu rr_username_len).
&&&&call&"str$trim"&
&&&&&&&&using&&&by&descriptor&&&new_name,&new_name
&&&&&&&&&&&&&&&&by&reference&&&&new_name_len
&&&&&&&&giving&&sys_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&call&"sys$persona_assume"
&&&&&&&&using&&&by&reference&&&&scratch_persona
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
*+
*&This&is&where&I&would&like&to&call:-
*
*&&&&&&&SQL>&SET&SESSION&AUTHORIZATION;
*
&&&&call&"str$trim"&
&&&&&&&&using&&&by&descriptor&&&new_password,&new_ password
&&&&&&&&&&&&&&&&by&reference&&&&password_len
&&&&&&&&giving&&sys_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&move&spaces&to&auth_string.
&&&&string&&&&&&"user&'",&new_name,&"'&using&'" ,&
&&&&&&&&&&&&&&&&new_password&(1

assword_len),&"'"
&&&&&&&&&&&&&&&&delimited&by&size
&&&&&&&&into&&&&auth_string.
*+
*&User&must&have&SELECT&priv&to&database&to&do&thi s.
*-
&&&&call&"set_auth"&using&sqlcode,&auth_string.
&&&&if&rdb$lu_status¬&=&ss$_normal
&&&&&&&&&call&"sys$putmsg"&using&rdb$message_vecto r
&&&&&&&&&call&"lib$stop"&using&by&value&ss$_abort. &&&&&&
&&&&call&"set_trans_rw"&using&sqlcode.
&&&&if&rdb$lu_status¬&=&ss$_normal
&&&&&&&&&call&"sys$putmsg"&using&rdb$message_vecto r
&&&&&&&&&call&"lib$stop"&using&by&value&ss$_abort. &&&&&&
&&&&call&"get_user"&
&&&&&&&&using&&&sqlcode,
&&&&&&&&&&&&&&&&system_user,
&&&&&&&&&&&&&&&&session_user,
&&&&&&&&&&&&&&&¤t_user.
&&&&if&rdb$lu_status¬&=&ss$_normal
&&&&&&&&&call&"sys$putmsg"&using&rdb$message_vecto r
&&&&&&&&&call&"lib$stop"&using&by&value&ss$_abort. &&&&&&
&&&&display&"System&&User&=&",&system_user.
&&&&display&"Session&User&=&",&session_user.
&&&&display&"Current&User&=&",¤t_user.
&&&&call&"commit_trans"&using&sqlcode.
&&&&if&rdb$lu_status¬&=&ss$_normal
&&&&&&&&&call&"sys$putmsg"&using&rdb$message_vecto r
&&&&&&&&&call&"lib$stop"&using&by&value&ss$_abort. &&&&&&
*
&&&&call&"sys$getjpiw"
&&&&&&&&using&&&by&value&&&&&&&&0,&0,&0
&&&&&&&&&&&&&&&&by&reference&&&&user_list,&jpi_ios b
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal&move&jpi_sts&to&sys _status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&display&"After&username&",&curr_username(1:cur r_username_len).
fini.
&&&&call&"sys$persona_assume"
&&&&&&&&using&&&by&reference&&&&iss$c_id_natura l
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
*+
*&Unfortunately&personas&appear&to&be&write-once&structures&so,&instead&
*&of&being&able&to&delegate&a&different&persona&to &the&same&"reserved"
*&persona&area,&we&have&to&delete&the&old&one&and& re-reserve&a&new&one.
*-
&&&&call&"sys$persona_delete"&using&scratch_person a&giving&sys_status.
&&&&if&sys_status¬&=&ss$_normal&and&ss$_persona delpend
&&&&&&&&call&"lib$stop"&using&by&value&sys_status.
&&&&if&sys_status&=&ss$_personadelpend&display&"De lete&pending".
&&&&call&"sys$persona_find"&using&scratch_persona, &find_list&giving&sys_stat
us.
&&&&evaluate&&&&sys_status
&&&&&&&&when&&&&ss$_nomoreproc&&display&"This&is&w hat&I&expected&-&Deleted&O
k"
&&&&&&&&when&&&&ss$_normal&&&&&&display&"It&took&a &lickin'&but&it's&kept&on&
tickin'"
&&&&&&&&when&&&&other&&&&&&&&&&&call&"lib$stop"&us ing&by&value&sys_status
&&&&end-evaluate.
&&&&perform&get_cmd.
*
get_cmd§ion.
00.
&&&&call&"sys$persona_reserve"&using&parent_pid,&s cratch_persona&giving&sys_
status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&call&"sys$qiow"
&&&&&&&&using&&&by&value&&&&&&&&0,&mbx_chan,&io$_w ritevblk
&&&&&&&&&&&&&&&&by&reference&&&&iosb
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,0
&&&&&&&&&&&&&&&&by&reference&&&&scratch_persona
&&&&&&&&&&&&&&&&by&value&&&&&&&&4,0,0,0,0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal&move&cond_val&to&sy s_status.
&&&&if&sys_status¬&=&ss$_normal&call&"lib$stop" &using&by&value&sys_status
..
&&&&call&"sys$qiow"
&&&&&&&&using&&&by&value&&&&&&&&0,&mbx_chan,&io$_r eadvblk
&&&&&&&&&&&&&&&&by&reference&&&&iosb
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,0
&&&&&&&&&&&&&&&&by&reference&&&&letter_sent
&&&&&&&&&&&&&&&&by&value&&&&&&&&512,0,0,0,0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal&move&cond_val&to&sy s_status.
&&&&if&sys_status&=&ss$_endoffile
&&&&&&&&move&"Y"&to&cmd_eof
&&&&else
&&&&&&&&if&sys_status¬&=&ss$_normal
&&&&&&&&&&&&call&"lib$stop"&using&by&value&sys_sta tus.
*
end&program&iss_exec.
$!
$cobolx/lis&t2
$create&t2_sql.sqlmod
module&&&&t2_sql
language&&cobol
parameter&colons
declare&pers&alias&filename&mf_personnel
procedure&declare_connection_name
&&&&&&&&sqlcode,
&&&&&&&&:db_spec&&&&&&&&char(50);
&&&&&&&&attach&:db_spec;
procedure&set_trans_rw
&&&&&&&&sqlcode;
&&&&&&&&set&transaction&read&only;
procedure&commit_trans
&&&&&&&&sqlcode;
&&&&&&&&commit;
procedure&set_auth
&&&&&&&&sqlcode,
&&&&&&&&:auth_string&&&&char(60);
&&&&&&&&set&session&authorization&:auth_string;
procedure&get_user
&&&&&&&&sqlcode
&&&&&&&&:sys_user&&&&&&&char(31),
&&&&&&&&:ses_user&&&&&&&char(31),
&&&&&&&&:cur_user&&&&&&&char(31);
&&&&&&&&select
&&&&&&&&&&&&&&&&system_user,
&&&&&&&&&&&&&&&¤t_user,
&&&&&&&&&&&&&&&&session_user
&&&&&&&&into
&&&&&&&&&&&&&&&&:sys_user,
&&&&&&&&&&&&&&&&:cur_user,
&&&&&&&&&&&&&&&&:ses_user
&&&&&&&&from
&&&&&&&&&&&&&&&&pers.employees
&&&&&&&&limit&to&1&row;
procedure&disconnect_db
&&&&&&&&sqlcode;
&&&&&&&&disconnect&default;
$!
$sqlmod:==$sql$mod
$sqlmod&t2_sql/lis/session
$linkx&t2,t,t2_sql,sql$user/lib
$!
$set&process/priv=(noall,tmpmbx,impersonate)
$!
$exit
$!
$no_priv:
$&&&&&&&write&sys$output&"Insufficient&privilege.& You&need&(CMKRNL,IMPERSONA
TE,TMPMBX)"
$&&&&&&&exit&44
$!
$no_vax:
$&&&&&&&write&sys$output&"This&code&only&works&on& alpha"
$&&&&&&&exit&44
$!