Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Rdb > Re: Rdb's impac...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 7 Topic 95 of 191
Post > Topic >>

Re: Rdb's impact on $persona_delete ss$_personadelpend

by "Richard Maher" <maher_rj@[EMAIL PROTECTED] > Mar 5, 2005 at 08:04 AM

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&section.
file-control.

&&&&&&&&select&&uaf&assign&sysuaf.

data&division.
file&section.

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&section.
*
01&&child_exit_ast&&&&&&&&&&&&&&&&&&&&&&pointer&value&&&external&child_exit_
ast.
01&&iss$m_create_authpriv&&&pic&9(9)&&&&comp&&&&value&&&external&iss$m_creat
e_authpriv.
01&&cli$m_nowait&&&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&cli$m_nowai
t.
01&&io$_readvblk&&&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&io$_readvbl
k.
01&&io$_writevblk&&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&io$_writevb
lk.
01&&io$_writeof&&&&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&io$_writeof
..
01&&rms$_rnf&&&&&&&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&rms$_rnf.
01&&ss$_nomoreproc&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&ss$_nomorep
roc.
01&&ss$_userdisabled&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&ss$_userdis
abled.
01&&ss$_endoffile&&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&ss$_endoffi
le.
01&&ss$_normal&&&&&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&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&&&&&&&&&&&&&&&value&&&"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&&&&&&&&&&&&&&&value&&&"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&&&&value&&&external&iss$_userna
me.
&&&&&&&&05&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pointer&value&&&reference&new_name.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
*
procedure&division.
declaratives.
uaf_problems&section.
&&&&use&after&standard&error&procedure&on&uaf.
00.
&&&&call&"lib$stop"&using&by&value&rms-sts&of&uaf.
*
end&declaratives.
kick_off&section.
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$_writeof
&&&&&&&&&&&&&&&&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&sys_status.
&&&&if&sys_status&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..
*
fini.
&&&&stop&run.
*
parent_init&section.
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&conversion.
&&&&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&not&=&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_status
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&child_exit_ast
&&&&&&&&&&&&&&&&by&reference&&&&child_params
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..

&&&&call&"sys$qiow"
&&&&&&&&using&&&by&value&&&&&&&&0,&mbx_chan,&io$_readvblk
&&&&&&&&&&&&&&&&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&sys_status.
&&&&if&sys_status&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..
*
fini.
*
load_personae&section.
00.
&&&&call&"str$trim"
&&&&&&&&using&&&by&descriptor&&&uaf_username,&uaf_username
&&&&&&&&&&&&&&&&by&reference&&&&username_len
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..

&&&&call&"sys$persona_create"
&&&&&&&&using&&&by&reference&&&&scratch_lw&
&&&&&&&&&&&&&&&&by&descriptor&&&uaf_username(1:username_len)
&&&&&&&&&&&&&&&&by&value&&&&&&&&iss$m_create_authpriv,&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal
&&&&&&&&add&1&to&user_cnt
&&&&else
&&&&&&&&if&sys_status&=&ss$_userdisabled&or&rms$_rnf
&&&&&&&&&&&&display&"User&",&uaf_username(1:username_len),&"&disabled."
&&&&&&&&else
&&&&&&&&&&&&display&"User&",&uaf_username(1:username_len),&"&failed."
&&&&&&&&&&&&call&"lib$stop"&using&by&value&sys_status.
*
fini.
&&&&read&uaf&at&end&move&"Y"&to&eof_uaf.
*
the_work&section.
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&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..

&&&&call&"sys$persona_find"&using&work_persona,&find_list&giving&sys_status.
&&&&if&sys_status&=&ss$_nomoreproc
&&&&&&&&display&"No&such&persona"
&&&&&&&&go&to&fini.

&&&&if&sys_status&not&=&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&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..

&&&&call&"sys$qiow"
&&&&&&&&using&&&by&value&&&&&&&&0,&mbx_chan,&io$_writevblk
&&&&&&&&&&&&&&&&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&sys_status.
&&&&if&sys_status&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..

&&&&call&"sys$qiow"
&&&&&&&&using&&&by&value&&&&&&&&0,&mbx_chan,&io$_readvblk
&&&&&&&&&&&&&&&&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&sys_status.
&&&&if&sys_status&not&=&ss$_normal&and&ss$_endoffile&
&&&&&&&&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&section.
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_status.
*
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&section.
*
01&&io$_writevblk&&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&io$_writevb
lk.
01&&io$_readvblk&&&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&io$_readvbl
k.
01&&iss$c_id_natural&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&iss$c_id_na
tural.
01&&ss$_abort&&&&&&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&ss$_abort.
01&&ss$_personadelpend&&&&&&pic&9(9)&&&&comp&&&&value&&&external&ss$_persona
delpend.
01&&ss$_nomoreproc&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&ss$_nomorep
roc.
01&&ss$_endoffile&&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&external&ss$_endoffi
le.
01&&ss$_normal&&&&&&&&&&&&&&pic&9(9)&&&&comp&&&&value&&&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&&&&value&&&4.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(4)&&&&comp&&&&value&&&external&jpi$_owner.
&&&&&&&&05&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pointer&value&&&reference&parent_pid
..
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
*
01&&user_list.
&&&&03&&item_username.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(4)&&&&comp&&&&value&&&12.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(4)&&&&comp&&&&value&&&external&jpi$_userna
me.
&&&&&&&&05&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pointer&value&&&reference&curr_usern
ame.
&&&&&&&&05&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pointer&value&&&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&&&&&&&&&&&&&&&value&&&"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)&&&&&&&&&&&value&"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&&&&&&&&&&&&&&&&&&&&&&&&occurs&18&times.
&&&&&&&&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&&current_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&&&&value&&&external&iss$_userna
me.
&&&&&&&&05&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&pointer&value&&&reference&new_name.
&&&&&&&&05&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
&&&&03&&&&&&&&&&&&&&&&&&&&&&pic&9(9)&&&&comp.
*
procedure&division.
kick_off&section.
00.
&&&&call&"sys$getjpiw"
&&&&&&&&using&&&by&value&&&&&&&&0,&0,&0
&&&&&&&&&&&&&&&&by&reference&&&&parent_list,&jpi_iosb
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal&move&jpi_sts&to&sys_status.
&&&&if&sys_status&not&=&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&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..

&&&&call&"declare_connection_name"&using&sqlcode,&db_spec.
&&&&if&rdb$lu_status&not&=&ss$_normal
&&&&&&&&&call&"sys$putmsg"&using&rdb$message_vector
&&&&&&&&&call&"lib$stop"&using&by&value&ss$_abort.&&&&&

&&&&perform&get_cmd.

&&&&perform&the_work&until&cmd_eof&=&"Y".

&&&&stop&run.
*
the_work&section.
00.
&&&&call&"sys$getjpiw"
&&&&&&&&using&&&by&value&&&&&&&&0,&0,&0
&&&&&&&&&&&&&&&&by&reference&&&&user_list,&jpi_iosb
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal&move&jpi_sts&to&sys_status.
&&&&if&sys_status&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..

&&&&display&"Before&username&",&curr_username(1:curr_username_len).
&&&&call&"str$trim"&
&&&&&&&&using&&&by&descriptor&&&new_name,&new_name
&&&&&&&&&&&&&&&&by&reference&&&&new_name_len
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&not&=&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&not&=&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&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..

&&&&move&spaces&to&auth_string.
&&&&string&&&&&&"user&'",&new_name,&"'&using&'",&
&&&&&&&&&&&&&&&&new_password&(1:password_len),&"'"
&&&&&&&&&&&&&&&&delimited&by&size
&&&&&&&&into&&&&auth_string.
*+
*&User&must&have&SELECT&priv&to&database&to&do&this.
*-
&&&&call&"set_auth"&using&sqlcode,&auth_string.
&&&&if&rdb$lu_status&not&=&ss$_normal
&&&&&&&&&call&"sys$putmsg"&using&rdb$message_vector
&&&&&&&&&call&"lib$stop"&using&by&value&ss$_abort.&&&&&&

&&&&call&"set_trans_rw"&using&sqlcode.
&&&&if&rdb$lu_status&not&=&ss$_normal
&&&&&&&&&call&"sys$putmsg"&using&rdb$message_vector
&&&&&&&&&call&"lib$stop"&using&by&value&ss$_abort.&&&&&&

&&&&call&"get_user"&
&&&&&&&&using&&&sqlcode,
&&&&&&&&&&&&&&&&system_user,
&&&&&&&&&&&&&&&&session_user,
&&&&&&&&&&&&&&&&current_user.
&&&&if&rdb$lu_status&not&=&ss$_normal
&&&&&&&&&call&"sys$putmsg"&using&rdb$message_vector
&&&&&&&&&call&"lib$stop"&using&by&value&ss$_abort.&&&&&&

&&&&display&"System&&User&=&",&system_user.
&&&&display&"Session&User&=&",&session_user.
&&&&display&"Current&User&=&",&current_user.

&&&&call&"commit_trans"&using&sqlcode.
&&&&if&rdb$lu_status&not&=&ss$_normal
&&&&&&&&&call&"sys$putmsg"&using&rdb$message_vector
&&&&&&&&&call&"lib$stop"&using&by&value&ss$_abort.&&&&&&
*
&&&&call&"sys$getjpiw"
&&&&&&&&using&&&by&value&&&&&&&&0,&0,&0
&&&&&&&&&&&&&&&&by&reference&&&&user_list,&jpi_iosb
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&=&ss$_normal&move&jpi_sts&to&sys_status.
&&&&if&sys_status&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..

&&&&display&"After&username&",&curr_username(1:curr_username_len).

fini.
&&&&call&"sys$persona_assume"
&&&&&&&&using&&&by&reference&&&&iss$c_id_natural
&&&&&&&&&&&&&&&&by&value&&&&&&&&0,&0,&0
&&&&&&&&giving&&sys_status.
&&&&if&sys_status&not&=&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_persona&giving&sys_status.
&&&&if&sys_status&not&=&ss$_normal&and&ss$_personadelpend
&&&&&&&&call&"lib$stop"&using&by&value&sys_status.

&&&&if&sys_status&=&ss$_personadelpend&display&"Delete&pending".

&&&&call&"sys$persona_find"&using&scratch_persona,&find_list&giving&sys_stat
us.
&&&&evaluate&&&&sys_status
&&&&&&&&when&&&&ss$_nomoreproc&&display&"This&is&what&I&expected&-&Deleted&O
k"
&&&&&&&&when&&&&ss$_normal&&&&&&display&"It&took&a&lickin'&but&it's&kept&on&
tickin'"
&&&&&&&&when&&&&other&&&&&&&&&&&call&"lib$stop"&using&by&value&sys_status
&&&&end-evaluate.

&&&&perform&get_cmd.
*
get_cmd&section.
00.
&&&&call&"sys$persona_reserve"&using&parent_pid,&scratch_persona&giving&sys_
status.
&&&&if&sys_status&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..

&&&&call&"sys$qiow"
&&&&&&&&using&&&by&value&&&&&&&&0,&mbx_chan,&io$_writevblk
&&&&&&&&&&&&&&&&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&sys_status.
&&&&if&sys_status&not&=&ss$_normal&call&"lib$stop"&using&by&value&sys_status
..

&&&&call&"sys$qiow"
&&&&&&&&using&&&by&value&&&&&&&&0,&mbx_chan,&io$_readvblk
&&&&&&&&&&&&&&&&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&sys_status.
&&&&if&sys_status&=&ss$_endoffile
&&&&&&&&move&"Y"&to&cmd_eof
&&&&else
&&&&&&&&if&sys_status&not&=&ss$_normal
&&&&&&&&&&&&call&"lib$stop"&using&by&value&sys_status.
*
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,
&&&&&&&&&&&&&&&&current_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
$!
 




 7 Posts in Topic:
Rdb's impact on $persona_delete ss$_personadelpend
"Richard Maher"  2005-03-05 07:55:01 
Re: Rdb's impact on $persona_delete ss$_personadelpend
"Richard Maher"  2005-03-05 08:04:08 
Re: Rdb's impact on $persona_delete ss$_personadelpend
"Richard Maher"  2005-03-05 08:06:20 
Re: Rdb's impact on $persona_delete ss$_personadelpend
Kilgallen@[EMAIL PROTECTE  2005-03-05 07:35:17 
Re: Rdb's impact on $persona_delete ss$_personadelpend
"Richard Maher"  2005-03-06 07:41:59 
Re: Rdb's impact on $persona_delete ss$_personadelpend
Norman Lastovica <norm  2005-03-06 15:46:35 
Re: Rdb's impact on $persona_delete ss$_personadelpend
"Richard Maher"  2005-03-08 20:14:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 8:52:34 CST 2008.