I'm not an expert in C, and there is probably a better way of writing this,
but this works for me (similar to your assignment statement):
strncpy(od.ObjectName,queue,MQ_Q_NAME_LENGTH);
where od is declared previously with:
MQOD od = {MQOD_DEFAULT}; /* Object Descriptor */
and queue is previously declared with:
char queue[49]; /* Queue name */
queue[49] = '\0';
and populated with:
strncpy(queue,mparm->queue,48);
where mparm->queue was set previously from the program's invocation parm,
and MQ_Q_NAME_LENGTH was declared at the beginning with:
#include "cmqc.h"
I think (I could be way off base here) that it wants a null-terminated string...???
If I'm right (!!!) then you could also have said mqcd.MCAUserIdentifier = "mqm\0"
(maybe!! - I'm no C expert).
I use null-terminated strings because I use those variables in other string routines
that need the null character at the end.
Peter
From: Richard Killian <[EMAIL PROTECTED]> on 11/25/2002 02:22 PM
Please respond to MQSeries List <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc:
Subject: channel security exit
I have another question related to security.
I am creating my first Channel Security Exit on AIX. I don't know 'C' and
have had one of our programmers get me through this far. I have read the
channel exit chapters in MQSeries Intercommunication so many times that now
my brain goes numb as soon as I look at it.
What I am trying to do is to use the exit to modify a SVRCONN Channel's MCA
User Id based on who or what is accessing the channel. (this might or
might not be a good idea)
My understanding from the manual is that the security exit can set the MCA
User Id; however, I am not getting past the compile.
code: mqcd.MCAUserIdentifier = "mqm";
compile error: "mqsecexit.c", line 26.1: 1506-025 (S) Operand must be a
modifiable lvalue.
Any ideas??
_________________________
Regards,
Dick Killian
MQ Administrator & Adabas DBA
Rochester Gas & Electric Corp
(585) 771-6049
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive