Operating System - OpenVMS
1753328 Members
4883 Online
108792 Solutions
New Discussion юеВ

Re: Can't get agent-specific info in sys$acm

 
SOLVED
Go to solution
Valentin Likoum
Frequent Advisor

Can't get agent-specific info in sys$acm

Hello all,

I'm trying to create utility which retrieve and display some login info for user. So I call sys$acm in the following way (code simplified):

int status, Tmo = 30;
ACMESB ACM_StatusBlk;
ACMELI Acmeli;
ILE3 il1[] = {
{sizeof (Pwd), ACME$_PASSWORD_1, &Pwd, 0},
{sizeof (Acmeli), ACME$_LOGON_INFORMATION, &Acmeli, 0},
{sizeof (Tmo), ACME$_TIMEOUT_INTERVAL, &Tmo, 0},
{0, 0, 0, 0}};

status = sys$acmw (
0,
ACME$_FC_AUTHENTICATE_PRINCIPAL|ACME$M_DEFAULT_PRINCIPAL||ACME$M_TIMEOUT,
NULL, /* Service context */
&il1, /* Item list */
&ACM_StatusBlk, /* ACM status block */
0, /* AST routine */
0 /* AST parameter */
);

It works. And now I want to retrieve password change date in the same call. If I add single item ACMEVMS$_UAI_PWD_DATE to the item list, then service says me "%ACME-E-NOACMECTX, no ACME context is active". Yes, it's expected as I should point to ACME agent before specifying agent-specific item code. But all my attempts to point to ACME agent failed. If I specify ACME$_TARGET_DOI_NAME (="VMS") or ACME$_TARGET_DOI_ID (=1), then service returns "SYSTEM-F-BADITMCOD, specified item code is invalid or out-of-range". The item list in this case looks like:

char doi_name[] = "VMS";
unsigned long doi_id = 1;
ILE3 il1[] = {
{3, ACME$_TARGET_DOI_NAME, &doi_name[0], 0},
// {4, ACME$_TARGET_DOI_ID, &doi_id, 0},
... skip the repeating part ...
{sizeof (PwdDate), ACMEVMS$_UAI_PWD_DATE, &PwdDate, 0},
{0, 0, 0, 0}
};

Then I tried to specify ACME$_CONTEXT_ACME_NAME and ACME$_CONTEXT_ACME_ID
but I was unable to find the expected values for them. "VMS" and "OpenVMS" values for ACME_NAME gives "ACME-E-NOSUCHDOI, the domain of interpretation does not exist". Value 1 for ACME_ID gives authentication failure while password is correct. Value 0 for ACME_ID gives ACME server failure. So now I'm stuck. How to specify ACME context correctly?
Thank you.
3 REPLIES 3
Rupesh Shantamurty
New Member
Solution

Re: Can't get agent-specific info in sys$acm

>> So now I'm stuck. How to specify ACME context correctly?

There is a section titled "Looking Up DOI and ACME IDs" in
Programming concepts manual ( Vol 2). It specifies to use the
Query function code with a Target DOI ID of 0 (meaning the
SYS$ACM[W] system service itself) to determine what DOI_ID corresponds to
a given name.

Did you try this out ?
Success can be defined as the precision in knowing one's abilities !
Valentin Likoum
Frequent Advisor

Re: Can't get agent-specific info in sys$acm

>> There is a section titled "Looking Up DOI and ACME IDs" in
>> Programming concepts manual ( Vol 2). It specifies to use the
>> Query function code with a Target DOI ID of 0 (meaning the
>> SYS$ACM[W] system service itself) to determine what DOI_ID corresponds to
>> a given name.
>> Did you try this out ?

Oh, sorry. I tried to re-arrange items in the item list, and the attempt was successfull so I found bug in the code.
Thank you as your question woke my mind and let me resolve the problem.
Valentin Likoum
Frequent Advisor

Re: Can't get agent-specific info in sys$acm

Bug was found