Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1298583
  • 博文数量: 287
  • 博客积分: 11000
  • 博客等级: 上将
  • 技术积分: 3833
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-16 08:43
文章分类
文章存档

2013年(15)

2012年(17)

2011年(17)

2010年(135)

2009年(85)

2008年(18)

分类: 系统运维

2010-06-05 09:03:16

Move Program Messages & Resend Escape Message
To disallow *PUBLIC to see messages in a message queue but still be able to send messages to it, set *PUBLIC authority to *CHANGE and remove read data authority. - And check that the user profile relating to the message queue has *ALL authority to avoid problems on that account. Here's a small CL program that will do it for a single user profile message queue: /*-- Compile instructions: ------------------------------------------*/ /*-- USRPRF(*OWNER) and transfer ownership to QSECOFR */ /*-- Parameters: ---------------------------------------------------*/ Pgm &UsrPrf Dcl &UsrPrf *Char 10 /*-- Global variables: ---------------------------------------------*/ Dcl &MsgQ *Char 10 Dcl &MsgQlib *Char 10 Dcl &UsrPrf *Char 10 Dcl &MsgKey *Char 4 ' ' Dcl &ToCalStkE *Char 38 /*-- Global monitor: -----------------------------------------------*/ MonMsg CPF0000 *None GoTo Error /*-- Message API parameter inz: ------------------------------------*/ ChgVar %Bin( &ToCalStkE 1 4 ) 1 ChgVar %Sst( &ToCalStkE 5 20 ) '*NONE *NONE ' ChgVar %Bin( &ToCalStkE 25 4 ) 10 ChgVar %Sst( &ToCalStkE 29 10 ) '*PGMBDY ' /*-- Set user message queue authority: -----------------------------*/ If ( &UsrPrf = ' ' ) Do ChgVar &UsrPrf '*CURRENT' EndDo Else Do ChkObj &UsrPrf *USRPRF EndDo RtvUsrPrf &UsrPrf MsgQ( &MsgQ ) MsgQlib( &MsgQlib ) + RtnUsrPrf( &UsrPrf ) AlcObj (( &MsgQlib/&MsgQ *MSGQ *EXCL )) Wait( 0 ) RvkObjAut &MsgQlib/&MsgQ *MSGQ + User( *ALL ) Aut( *ALL ) GrtObjAut &MsgQlib/&MsgQ *MSGQ + User( *PUBLIC ) Aut( *OBJOPR *ADD *UPD *DLT *EXECUTE ) GrtObjAut &MsgQlib/&MsgQ *MSGQ + User( &UsrPrf ) Aut( *ALL ) DlcObj (( &MsgQlib/&MsgQ *MSGQ *EXCL )) /*-- Return: -------------------------------------------------------*/ Return: Call QMHMOVPM ( &MsgKey + '*COMP' + x'00000001' + '*PGMBDY ' + x'00000001' + x'0000000000000008' + ) Return /*-- Error routines: -----------------------------------------------*/ Error: Call QMHMOVPM ( &MsgKey + '*DIAG' + x'00000001' + '*PGMBDY ' + x'00000001' + x'0000000000000008' + ) Call QMHRSNEM ( &MsgKey + x'0000000000000008' + &ToCalStkE + x'00000026' + 'RSNM0100' + '* ' + x'00000000' + ) EndPgm: EndPgm Thanks to Carsten Flensburg
阅读(918) | 评论(0) | 转发(0) |
0

上一篇:QSYGETPH - Get Profile Handle

下一篇:QMHRMQAT

给主人留下些什么吧!~~