|
From: Chris B. <buc...@us...> - 2012-03-14 19:28:25
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SFCB - Small Footprint CIM Broker".
The branch, master has been updated
via 009d00c6c1ae709f87ad946f8a92acb986a4e4d1 (commit)
via 2dc07d40a8df30aaebe682144a52dac12124696d (commit)
from e6677b03ffce1d4745422d158a2a18dc348a8520 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 009d00c6c1ae709f87ad946f8a92acb986a4e4d1
Author: buccella <buc...@li...>
Date: Wed Mar 14 15:28:00 2012 -0400
init role to NULL in httpAdapter
commit 2dc07d40a8df30aaebe682144a52dac12124696d
Author: buccella <buc...@li...>
Date: Wed Mar 14 15:26:19 2012 -0400
[ 3367363 ] Add CMPIRole Support
-----------------------------------------------------------------------
Summary of changes:
diff --git a/ChangeLog b/ChangeLog
index e72c481..dbbd7d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-14 Chris Buccella <buc...@li...>
+
+ * brokerUpc.c, cimRequest.c, cimRequest.h, cimXmlOps.y,
+ cimcClientSfcbLocal.c, httpAdapter.c, providerDrv.c,
+ providerMgr.c, providerMgr.h, sfcBasicPAMAuthentication.c
+ [ 3367363 ] Add CMPIRole Support
+
2012-03-12 Chris Buccella <buc...@li...>
* httpAdapter.c, sfcBasicPAMAuthentication.c:
diff --git a/NEWS b/NEWS
index 7ef94e2..3508bac 100644
--- a/NEWS
+++ b/NEWS
@@ -98,6 +98,7 @@ New Features:
- 3367333 New entry point for authentication library
- 3367332 RHOST Support for PAM
- 3367361 Allow for releasing auth handle after CIM request completes
+- 3367363 Add CMPIRole Support
Bugs Fixed:
diff --git a/brokerUpc.c b/brokerUpc.c
index e823e80..0ec70a8 100644
--- a/brokerUpc.c
+++ b/brokerUpc.c
@@ -666,7 +666,7 @@ createInstance(const CMPIBroker * broker,
{
BinRequestContext binCtx;
BinResponseHdr *resp;
- CreateInstanceReq sreq = BINREQ(OPS_CreateInstance, 3);
+ CreateInstanceReq sreq = BINREQ(OPS_CreateInstance, CI_REQ_REG_SEGMENTS);
OperationHdr oHdr = { OPS_CreateInstance, 2 };
CMPIStatus st = { CMPI_RC_OK, NULL };
CMPIObjectPath *op = NULL,
@@ -688,6 +688,7 @@ createInstance(const CMPIBroker * broker,
(char *) oHdr.className.data));
sreq.instance = setInstanceMsgSegment(inst);
+ sreq.userRole = setCharsMsgSegment(NULL);
checkReroute(broker, context, &oHdr);
@@ -778,6 +779,7 @@ modifyInstance(const CMPIBroker * broker,
sreq = (ModifyInstanceReq *) calloc(1, sreqSize);
sreq->hdr.count = ps + 3;
sreq->hdr.operation = OPS_ModifyInstance;
+ sreq->userRole = setCharsMsgSegment(NULL);
setContext(&binCtx, &oHdr, &sreq->hdr, sreqSize, context, cop, NULL, NULL);
_SFCB_TRACE(1,
@@ -842,7 +844,7 @@ deleteInstance(const CMPIBroker * broker,
{
BinRequestContext binCtx;
BinResponseHdr *resp;
- DeleteInstanceReq sreq = BINREQ(OPS_DeleteInstance, 2);
+ DeleteInstanceReq sreq = BINREQ(OPS_DeleteInstance, DI_REQ_REG_SEGMENTS);
OperationHdr oHdr = { OPS_DeleteInstance, 2 };
CMPIStatus st = { CMPI_RC_OK, NULL };
int initrc = 0;
@@ -860,6 +862,7 @@ deleteInstance(const CMPIBroker * broker,
_SFCB_TRACE(1,
("--- for %s %s", (char *) oHdr.nameSpace.data,
(char *) oHdr.className.data));
+ sreq.userRole = setCharsMsgSegment(NULL);
checkReroute(broker, context, &oHdr);
@@ -910,7 +913,7 @@ execQuery(const CMPIBroker * broker,
const char *lang, CMPIStatus *rc)
{
BinRequestContext binCtx;
- ExecQueryReq sreq = BINREQ(OPS_ExecQuery, 4);
+ ExecQueryReq sreq = BINREQ(OPS_ExecQuery, EQ_REQ_REG_SEGMENTS);
OperationHdr oHdr = { OPS_ExecQuery, 2 };
CMPIStatus st = { CMPI_RC_OK, NULL }, rci = {
CMPI_RC_OK, NULL};
@@ -935,6 +938,7 @@ execQuery(const CMPIBroker * broker,
sreq.query = setCharsMsgSegment(query);
sreq.queryLang = setCharsMsgSegment(lang);
+ sreq.userRole = setCharsMsgSegment(NULL);
irc = getProviderContext(&binCtx);
@@ -1011,8 +1015,9 @@ enumInstances(const CMPIBroker * broker,
const CMPIObjectPath * cop,
const char **props, CMPIStatus *rc)
{
- EnumInstancesReq sreq = BINREQ(OPS_EnumerateInstances, 2);
+ EnumInstancesReq sreq = BINREQ(OPS_EnumerateInstances, EI_REQ_REG_SEGMENTS);
OperationHdr oHdr = { OPS_EnumerateInstances, 2 };
+ sreq.userRole = setCharsMsgSegment(NULL);
return genericEnumRequest(broker, context, cop, props, NULL, NULL, NULL,
NULL, OPS_EnumerateInstances, &sreq.hdr, &oHdr,
@@ -1024,8 +1029,9 @@ enumInstanceNames(const CMPIBroker * broker,
const CMPIContext *context,
const CMPIObjectPath * cop, CMPIStatus *rc)
{
- EnumInstanceNamesReq sreq = BINREQ(OPS_EnumerateInstanceNames, 2);
+ EnumInstanceNamesReq sreq = BINREQ(OPS_EnumerateInstanceNames, EIN_REQ_REG_SEGMENTS);
OperationHdr oHdr = { OPS_EnumerateInstanceNames, 2 };
+ sreq.userRole = setCharsMsgSegment(NULL);
return genericEnumRequest(broker, context, cop, NULL, NULL, NULL, NULL,
NULL, OPS_EnumerateInstanceNames, &sreq.hdr,
@@ -1047,13 +1053,14 @@ associators(const CMPIBroker * broker,
const char *role,
const char *resultrole, const char **props, CMPIStatus *rc)
{
- AssociatorsReq sreq = BINREQ(OPS_Associators, 6);
+ AssociatorsReq sreq = BINREQ(OPS_Associators, AI_REQ_REG_SEGMENTS);
OperationHdr oHdr = { OPS_Associators, 6 };
sreq.resultClass = setCharsMsgSegment(resultclass);
sreq.role = setCharsMsgSegment(role);
sreq.assocClass = setCharsMsgSegment(assocclass);
sreq.resultRole = setCharsMsgSegment(resultrole);
+ sreq.userRole = setCharsMsgSegment(NULL);
return genericEnumRequest(broker, context, cop, props, assocclass,
resultclass, role, resultrole, OPS_Associators,
@@ -1070,13 +1077,14 @@ associatorNames(const CMPIBroker * broker,
const char *resultclass,
const char *role, const char *resultrole, CMPIStatus *rc)
{
- AssociatorNamesReq sreq = BINREQ(OPS_AssociatorNames, 6);
+ AssociatorNamesReq sreq = BINREQ(OPS_AssociatorNames, AIN_REQ_REG_SEGMENTS);
OperationHdr oHdr = { OPS_AssociatorNames, 6 };
sreq.resultClass = setCharsMsgSegment(resultclass);
sreq.role = setCharsMsgSegment(role);
sreq.assocClass = setCharsMsgSegment(assocclass);
sreq.resultRole = setCharsMsgSegment(resultrole);
+ sreq.userRole = setCharsMsgSegment(NULL);
return genericEnumRequest(broker, context, cop, NULL, assocclass,
resultclass, role, resultrole,
@@ -1091,11 +1099,12 @@ references(const CMPIBroker * broker,
const char *resultclass,
const char *role, const char **props, CMPIStatus *rc)
{
- ReferencesReq sreq = BINREQ(OPS_References, 4);
+ ReferencesReq sreq = BINREQ(OPS_References, RI_REQ_REG_SEGMENTS);
OperationHdr oHdr = { OPS_References, 4 };
sreq.role = setCharsMsgSegment(role);
sreq.resultClass = setCharsMsgSegment(resultclass);
+ sreq.userRole = setCharsMsgSegment(NULL);
return genericEnumRequest(broker, context, cop, props, NULL,
resultclass, role, NULL, OPS_References,
@@ -1109,11 +1118,12 @@ referenceNames(const CMPIBroker * broker,
const CMPIObjectPath * cop,
const char *resultclass, const char *role, CMPIStatus *rc)
{
- ReferenceNamesReq sreq = BINREQ(OPS_ReferenceNames, 4);
+ ReferenceNamesReq sreq = BINREQ(OPS_ReferenceNames, RIN_REQ_REG_SEGMENTS);
OperationHdr oHdr = { OPS_ReferenceNames, 4 };
sreq.role = setCharsMsgSegment(role);
sreq.resultClass = setCharsMsgSegment(resultclass);
+ sreq.userRole = setCharsMsgSegment(NULL);
return genericEnumRequest(broker, context, cop, NULL, NULL, resultclass,
role, NULL, OPS_ReferenceNames, &sreq.hdr,
@@ -1165,7 +1175,7 @@ invokeMethod(const CMPIBroker * broker, const CMPIContext *context,
size = sizeof(InvokeMethodReq) + (x * sizeof(MsgSegment));
sreq = (InvokeMethodReq *) calloc(1, size);
- sreq->hdr.count = 5 + x;
+ sreq->hdr.count=IM_REQ_REG_SEGMENTS+x;
sreq->hdr.operation = OPS_InvokeMethod;
lockUpCall(broker);
@@ -1175,9 +1185,10 @@ invokeMethod(const CMPIBroker * broker, const CMPIContext *context,
sreq->in = setArgsMsgSegment(in);
sreq->out = setArgsMsgSegment(NULL);
sreq->method = setCharsMsgSegment(method);
+ sreq->userRole = setCharsMsgSegment(NULL);
- if (x)
- for (n = 5, i = 0, s = CMGetArgCount(in, NULL); i < s; i++) {
+ if (x)
+ for (n=IM_REQ_REG_SEGMENTS,i=0,s=CMGetArgCount(in,NULL); i<s; i++) {
CMPIData d = CMGetArgAt(in, i, NULL, NULL);
BinRequestHdr *req = (BinRequestHdr *) sreq;
if (d.type == CMPI_instance) {
diff --git a/cimRequest.c b/cimRequest.c
index 0b63bb1..9f0e0b7 100644
--- a/cimRequest.c
+++ b/cimRequest.c
@@ -1808,6 +1808,7 @@ handleCimRequest(CimRequestContext * ctx, int flags)
at once. This should be changed after all ops
are handled in the parser. */
hdr = scanners[i].scan(ctx, ctx->cimDoc, &parserc);
+ hdr.role=ctx->role;
if (parserc == 0) {
/* The scanner recognizes the request so we don't
* need to give it to anymore scanners. */
diff --git a/cimRequest.h b/cimRequest.h
index a7416cd..e1512cc 100644
--- a/cimRequest.h
+++ b/cimRequest.h
@@ -56,6 +56,7 @@ typedef struct cimRequestContext {
char *contentType;
int teTrailers;
unsigned int sessionId;
+ const char *role;
unsigned long cimDocLength;
struct commHndl *commHndl;
struct chunkFunctions *chunkFncs;
@@ -78,6 +79,7 @@ typedef struct requestHdr {
unsigned long cimRequestLength;
char *errMsg;
char *className;
+ const char *role;
BinRequestContext *binCtx;
/* These don't really belong here, but it's *
* an easy way to get them to the parser. */
diff --git a/cimXmlOps.y b/cimXmlOps.y
index fbc3d31..1891cbd 100644
--- a/cimXmlOps.y
+++ b/cimXmlOps.y
@@ -127,7 +127,7 @@ buildAssociatorNamesRequest(void *parm)
}
sreq = calloc(1, sizeof(*sreq));
sreq->hdr.operation = OPS_AssociatorNames;
- sreq->hdr.count = 6;
+ sreq->hdr.count = AIN_REQ_REG_SEGMENTS;
sreq->objectPath = setObjectPathMsgSegment(path);
@@ -136,6 +136,7 @@ buildAssociatorNamesRequest(void *parm)
sreq->assocClass = req->op.assocClass;
sreq->resultRole = req->op.resultRole;
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.sessionId = hdr->sessionId;
req->op.className = req->op.assocClass;
@@ -193,7 +194,7 @@ buildAssociatorsRequest(void *parm)
sreqSize += req->properties * sizeof(MsgSegment);
sreq = calloc(1, sreqSize);
sreq->hdr.operation = OPS_Associators;
- sreq->hdr.count = req->properties + 6;
+ sreq->hdr.count = req->properties + AI_REQ_REG_SEGMENTS;
for (i = 0, m = req->objectName.bindings.next; i < m; i++) {
valp = getKeyValueTypePtr(req->objectName.bindings.keyBindings[i].type,
@@ -213,6 +214,7 @@ buildAssociatorsRequest(void *parm)
sreq->resultRole = req->op.resultRole;
sreq->hdr.flags = req->flags;
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.sessionId = hdr->sessionId;
for (i = 0; i < req->properties; i++)
@@ -255,9 +257,10 @@ buildEnumInstanceRequest(void *parm)
sreqSize += req->properties * sizeof(MsgSegment);
sreq = calloc(1, sreqSize);
sreq->hdr.operation = OPS_EnumerateInstances;
- sreq->hdr.count = req->properties + 2;
+ sreq->hdr.count = req->properties + EI_REQ_REG_SEGMENTS;
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->objectPath = setObjectPathMsgSegment(path);
sreq->hdr.sessionId = hdr->sessionId;
@@ -302,7 +305,7 @@ buildCreateInstanceRequest(void *parm)
sreq = calloc(1, sizeof(CreateInstanceReq));
sreq->hdr.operation = OPS_CreateInstance;
- sreq->hdr.count = 3;
+ sreq->hdr.count = CI_REQ_REG_SEGMENTS;
for (p = req->instance.properties.first; p; p = p->next) {
@@ -316,6 +319,7 @@ buildCreateInstanceRequest(void *parm)
sreq->instance = setInstanceMsgSegment(inst);
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.sessionId = hdr->sessionId;
path = inst->ft->getObjectPath(inst, &st);
@@ -408,13 +412,14 @@ buildGetClassRequest(void *parm)
sreqSize += req->properties * sizeof(MsgSegment);
sreq = calloc(1, sreqSize);
sreq->hdr.operation = OPS_GetClass;
- sreq->hdr.count = req->properties + 2;
+ sreq->hdr.count=req->properties+GC_REQ_REG_SEGMENTS;
path =
TrackedCMPIObjectPath(req->op.nameSpace.data, req->op.className.data,
NULL);
sreq->objectPath = setObjectPathMsgSegment(path);
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.sessionId = hdr->sessionId;
for (i = 0; i < req->properties; i++)
@@ -444,13 +449,14 @@ buildDeleteClassRequest(void *parm)
sreq = calloc(1, sizeof(DeleteClassReq));
sreq->hdr.operation = OPS_DeleteClass;
- sreq->hdr.count = 2;
+ sreq->hdr.count = DC_REQ_REG_SEGMENTS;
path =
TrackedCMPIObjectPath(req->op.nameSpace.data, req->op.className.data,
NULL);
sreq->objectPath = setObjectPathMsgSegment(path);
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.sessionId = hdr->sessionId;
binCtx->oHdr = (OperationHdr *) req;
@@ -481,7 +487,7 @@ buildDeleteInstanceRequest(void *parm)
sreq = calloc(1, sreqSize);
sreq->hdr.operation = OPS_DeleteInstance;
- sreq->hdr.count = 2;
+ sreq->hdr.count = DI_REQ_REG_SEGMENTS;
path =
TrackedCMPIObjectPath(req->op.nameSpace.data, req->op.className.data,
@@ -497,6 +503,7 @@ buildDeleteInstanceRequest(void *parm)
}
sreq->objectPath = setObjectPathMsgSegment(path);
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.sessionId = hdr->sessionId;
binCtx->oHdr = (OperationHdr *) req;
@@ -648,8 +655,9 @@ buildCreateClassRequest(void *parm)
int sreqSize = sizeof(*sreq) + (3 * sizeof(MsgSegment));
sreq = calloc(1, sreqSize);
sreq->hdr.operation = OPS_CreateClass;
- sreq->hdr.count = 3;
+ sreq->hdr.count = CC_REQ_REG_SEGMENTS;
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->path = setObjectPathMsgSegment(path);
sreq->cls = setConstClassMsgSegment(cls);
sreq->hdr.sessionId = hdr->sessionId;
@@ -690,7 +698,7 @@ buildModifyInstanceRequest(void *parm)
sreqSize += req->properties * sizeof(MsgSegment);
sreq = calloc(1, sreqSize);
sreq->hdr.operation = OPS_ModifyInstance;
- sreq->hdr.count = req->properties + 3;
+ sreq->hdr.count = req->properties + MI_REQ_REG_SEGMENTS;
for (i = 0; i < req->properties; i++) {
sreq->properties[i] =
@@ -729,6 +737,7 @@ buildModifyInstanceRequest(void *parm)
sreq->instance = setInstanceMsgSegment(inst);
sreq->path = setObjectPathMsgSegment(path);
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.sessionId = hdr->sessionId;
binCtx->oHdr = (OperationHdr *) req;
@@ -761,9 +770,10 @@ buildEnumClassesRequest(void *parm)
sreqSize = sizeof(*sreq);// + 2 * sizeof(MsgSegment);
sreq = calloc(1, sreqSize);
sreq->hdr.operation = OPS_EnumerateClasses;
- sreq->hdr.count = 2;
+ sreq->hdr.count = EC_REQ_REG_SEGMENTS;
sreq->objectPath = setObjectPathMsgSegment(path);
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.flags = req->flags;
sreq->hdr.sessionId = hdr->sessionId;
@@ -797,8 +807,9 @@ buildEnumClassNamesRequest(void *parm)
sreq = calloc(1, sizeof(*sreq));
sreq->objectPath = setObjectPathMsgSegment(path);
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.operation = OPS_EnumerateClassNames;
- sreq->hdr.count = 2;
+ sreq->hdr.count = ECN_REQ_REG_SEGMENTS;
sreq->hdr.flags = req->flags;
sreq->hdr.sessionId = hdr->sessionId;
@@ -833,8 +844,9 @@ buildEnumInstanceNamesRequest(void *parm)
sreq = calloc(1, sizeof(*sreq));
sreq->objectPath = setObjectPathMsgSegment(path);
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.operation = OPS_EnumerateInstanceNames;
- sreq->hdr.count = 2;
+ sreq->hdr.count = EIN_REQ_REG_SEGMENTS;
sreq->hdr.sessionId = hdr->sessionId;
binCtx->oHdr = (OperationHdr *) req;
@@ -883,9 +895,10 @@ buildExecQueryRequest(void *parm)
sreq = calloc(1, sizeof(*sreq));
sreq->hdr.operation = OPS_ExecQuery;
- sreq->hdr.count = 4;
+ sreq->hdr.count = EQ_REQ_REG_SEGMENTS;
sreq->objectPath = setObjectPathMsgSegment(path);
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->query = setCharsMsgSegment((char *) req->op.query.data);
sreq->queryLang = setCharsMsgSegment((char *) req->op.queryLang.data);
sreq->hdr.sessionId = hdr->sessionId;
@@ -923,7 +936,7 @@ buildReferencesRequest(void *parm)
sreqSize += req->properties * sizeof(MsgSegment);
sreq = calloc(1, sreqSize);
sreq->hdr.operation = OPS_References;
- sreq->hdr.count = req->properties + 4;
+ sreq->hdr.count = req->properties + RI_REQ_REG_SEGMENTS;
path =
TrackedCMPIObjectPath(req->op.nameSpace.data, req->op.className.data,
@@ -957,6 +970,7 @@ buildReferencesRequest(void *parm)
sreq->role = req->op.role;
sreq->hdr.flags = req->flags;
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.sessionId = hdr->sessionId;
for (i = 0; i < req->properties; i++)
@@ -1019,12 +1033,13 @@ buildReferenceNamesRequest(void *parm)
sreq = calloc(1, sizeof(*sreq));
sreq->hdr.operation = OPS_ReferenceNames;
- sreq->hdr.count = 4;
+ sreq->hdr.count = RIN_REQ_REG_SEGMENTS;
sreq->objectPath = setObjectPathMsgSegment(path);
sreq->resultClass = req->op.resultClass;
sreq->role = req->op.role;
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.sessionId = hdr->sessionId;
req->op.className = req->op.resultClass;
@@ -1374,9 +1389,10 @@ buildInvokeMethodRequest(void *parm)
}
sreq = calloc(1, sizeof(*sreq));
sreq->hdr.operation = OPS_InvokeMethod;
- sreq->hdr.count = 5;
+ sreq->hdr.count = IM_REQ_REG_SEGMENTS;
sreq->objectPath = setObjectPathMsgSegment(path);
sreq->principal = setCharsMsgSegment(hdr->principal);
+ sreq->userRole = setCharsMsgSegment(hdr->role);
sreq->hdr.sessionId = hdr->sessionId;
if (getControlBool("validateMethodParamTypes", &vmpt))
@@ -2108,7 +2124,7 @@ iMethodCall
methodCall
: localClassPath
{
- $$.op.count = 2;
+ $$.op.count = IM_REQ_REG_SEGMENTS;
$$.op.type = OPS_InvokeMethod;
$$.op.nameSpace=setCharsMsgSegment($1.path);
$$.op.className=setCharsMsgSegment($1.className);
@@ -2121,7 +2137,7 @@ methodCall
}
| localClassPath paramValues
{
- $$.op.count = 2;
+ $$.op.count = IM_REQ_REG_SEGMENTS;
$$.op.type = OPS_InvokeMethod;
$$.op.nameSpace=setCharsMsgSegment($1.path);
$$.op.className=setCharsMsgSegment($1.className);
@@ -2133,7 +2149,7 @@ methodCall
}
| localInstancePath
{
- $$.op.count = 2;
+ $$.op.count = IM_REQ_REG_SEGMENTS;
$$.op.type = OPS_InvokeMethod;
$$.op.nameSpace=setCharsMsgSegment($1.path);
$$.op.className=setCharsMsgSegment($1.instanceName.className);
@@ -2147,7 +2163,7 @@ methodCall
}
| localInstancePath paramValues
{
- $$.op.count = 2;
+ $$.op.count = IM_REQ_REG_SEGMENTS;
$$.op.type = OPS_InvokeMethod;
$$.op.nameSpace=setCharsMsgSegment($1.path);
$$.op.className=setCharsMsgSegment($1.instanceName.className);
@@ -2438,7 +2454,7 @@ setQualifierParm
getClass
: localNameSpacePath
{
- $$.op.count = 2;
+ $$.op.count = GC_REQ_REG_SEGMENTS;
$$.op.type = OPS_GetClass;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -2452,7 +2468,7 @@ getClass
}
| localNameSpacePath getClassParmsList
{
- $$.op.count = 2;
+ $$.op.count = GC_REQ_REG_SEGMENTS;
$$.op.type = OPS_GetClass;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.className);
@@ -2554,7 +2570,7 @@ getClassParms
enumClassNames
: localNameSpacePath
{
- $$.op.count = 2;
+ $$.op.count = ECN_REQ_REG_SEGMENTS;
$$.op.type = OPS_EnumerateClassNames;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -2565,7 +2581,7 @@ enumClassNames
}
| localNameSpacePath enumClassNamesParmsList
{
- $$.op.count = 2;
+ $$.op.count = ECN_REQ_REG_SEGMENTS;
$$.op.type = OPS_EnumerateClassNames;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.className);
@@ -2620,7 +2636,7 @@ enumClassNamesParms
enumClasses
: localNameSpacePath
{
- $$.op.count = 2;
+ $$.op.count = EC_REQ_REG_SEGMENTS;
$$.op.type = OPS_EnumerateClasses;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -2631,7 +2647,7 @@ enumClasses
}
| localNameSpacePath enumClassesParmsList
{
- $$.op.count = 2;
+ $$.op.count = EC_REQ_REG_SEGMENTS;
$$.op.type = OPS_EnumerateClasses;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.className);
@@ -2716,7 +2732,7 @@ enumClassesParms
getInstance
: localNameSpacePath
{
- $$.op.count = 2;
+ $$.op.count = GI_REQ_REG_SEGMENTS;
$$.op.type = OPS_GetInstance;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -2724,13 +2740,14 @@ getInstance
$$.propertyList.values = NULL;
$$.properties=0;
$$.instNameSet = 0;
+ //$$.userRole=setCharsMsgSegment($$.op.role);
setRequest(parm,&$$,sizeof(XtokGetInstance),OPS_GetInstance);
buildGetInstanceRequest(parm);
}
| localNameSpacePath getInstanceParmsList
{
- $$.op.count = 2;
+ $$.op.count = GI_REQ_REG_SEGMENTS;
$$.op.type = OPS_GetInstance;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.instanceName.className);
@@ -2834,7 +2851,7 @@ getInstanceParms
createClass
: localNameSpacePath
{
- $$.op.count = 3;
+ $$.op.count = CC_REQ_REG_SEGMENTS;
$$.op.type = OPS_CreateClass;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -2845,7 +2862,7 @@ createClass
}
| localNameSpacePath createClassParm
{
- $$.op.count = 3;
+ $$.op.count = CC_REQ_REG_SEGMENTS;
$$.op.type = OPS_CreateClass;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.cls.className);
@@ -2873,7 +2890,7 @@ createClassParm
createInstance
: localNameSpacePath
{
- $$.op.count = 2;
+ $$.op.count = CI_REQ_REG_SEGMENTS;
$$.op.type = OPS_CreateInstance;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -2883,7 +2900,7 @@ createInstance
}
| localNameSpacePath createInstanceParm
{
- $$.op.count = 2;
+ $$.op.count = CI_REQ_REG_SEGMENTS;
$$.op.type = OPS_CreateInstance;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.instance.className);
@@ -2910,7 +2927,7 @@ createInstanceParm
modifyInstance
: localNameSpacePath
{
- $$.op.count = 2;
+ $$.op.count = MI_REQ_REG_SEGMENTS;
$$.op.type = OPS_ModifyInstance;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -2923,7 +2940,7 @@ modifyInstance
}
| localNameSpacePath modifyInstanceParmsList
{
- $$.op.count = 2;
+ $$.op.count = MI_REQ_REG_SEGMENTS;
$$.op.type = OPS_ModifyInstance;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.namedInstance.path.className);
@@ -3004,7 +3021,7 @@ modifyInstanceParms
deleteClass
: localNameSpacePath
{
- $$.op.count = 2;
+ $$.op.count = DC_REQ_REG_SEGMENTS;
$$.op.type = OPS_DeleteClass;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -3014,7 +3031,7 @@ deleteClass
}
| localNameSpacePath deleteClassParm
{
- $$.op.count = 2;
+ $$.op.count = DC_REQ_REG_SEGMENTS;
$$.op.type = OPS_DeleteClass;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.className);
@@ -3041,7 +3058,7 @@ deleteClassParm
deleteInstance
: localNameSpacePath
{
- $$.op.count = 2;
+ $$.op.count = DI_REQ_REG_SEGMENTS;
$$.op.type = OPS_DeleteInstance;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -3051,7 +3068,7 @@ deleteInstance
}
| localNameSpacePath deleteInstanceParm
{
- $$.op.count = 2;
+ $$.op.count = DI_REQ_REG_SEGMENTS;
$$.op.type = OPS_DeleteInstance;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.instanceName.className);
@@ -3079,7 +3096,7 @@ deleteInstanceParm
enumInstanceNames
: localNameSpacePath XTOK_IP_CLASSNAME className ZTOK_IPARAMVALUE
{
- $$.op.count = 2;
+ $$.op.count = EIN_REQ_REG_SEGMENTS;
$$.op.type = OPS_EnumerateInstanceNames;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($3);
@@ -3098,7 +3115,7 @@ enumInstanceNames
enumInstances
: localNameSpacePath
{
- $$.op.count = 2;
+ $$.op.count = EI_REQ_REG_SEGMENTS;
$$.op.type = OPS_EnumerateInstances;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -3111,7 +3128,7 @@ enumInstances
}
| localNameSpacePath enumInstancesParmsList
{
- $$.op.count = 2;
+ $$.op.count = EI_REQ_REG_SEGMENTS;
$$.op.type = OPS_EnumerateInstances;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.className);
@@ -3228,7 +3245,7 @@ execQuery
XTOK_IP_QUERY value ZTOK_IPARAMVALUE
XTOK_IP_QUERYLANG value ZTOK_IPARAMVALUE
{
- $$.op.count = 3;
+ $$.op.count = EQ_REQ_REG_SEGMENTS;
$$.op.type = OPS_ExecQuery;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.query=setCharsMsgSegment($3.value);
@@ -3241,7 +3258,7 @@ execQuery
XTOK_IP_QUERYLANG value ZTOK_IPARAMVALUE
XTOK_IP_QUERY value ZTOK_IPARAMVALUE
{
- $$.op.count = 3;
+ $$.op.count = EQ_REQ_REG_SEGMENTS;
$$.op.type = OPS_ExecQuery;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.query=setCharsMsgSegment($6.value);
@@ -3261,7 +3278,7 @@ execQuery
associators
: localNameSpacePath
{
- $$.op.count = 6;
+ $$.op.count = AI_REQ_REG_SEGMENTS;
$$.op.type = OPS_Associators;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -3279,7 +3296,7 @@ associators
}
| localNameSpacePath associatorsParmsList
{
- $$.op.count = 6;
+ $$.op.count = AI_REQ_REG_SEGMENTS;
$$.op.type = OPS_Associators;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.objectName.className);
@@ -3443,7 +3460,7 @@ associatorsParms
references
: localNameSpacePath
{
- $$.op.count = 4;
+ $$.op.count = RI_REQ_REG_SEGMENTS;
$$.op.type = OPS_References;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -3459,7 +3476,7 @@ references
}
| localNameSpacePath referencesParmsList
{
- $$.op.count = 4;
+ $$.op.count = RI_REQ_REG_SEGMENTS;
$$.op.type = OPS_References;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.objectName.className);
@@ -3591,7 +3608,7 @@ referencesParms
associatorNames
: localNameSpacePath
{
- $$.op.count = 6;
+ $$.op.count = AIN_REQ_REG_SEGMENTS;
$$.op.type = OPS_AssociatorNames;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -3606,7 +3623,7 @@ associatorNames
}
| localNameSpacePath associatorNamesParmsList
{
- $$.op.count = 6;
+ $$.op.count = AIN_REQ_REG_SEGMENTS;
$$.op.type = OPS_AssociatorNames;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.objectName.className);
@@ -3705,7 +3722,7 @@ associatorNamesParms
referenceNames
: localNameSpacePath
{
- $$.op.count = 4;
+ $$.op.count = RIN_REQ_REG_SEGMENTS;
$$.op.type = OPS_ReferenceNames;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment(NULL);
@@ -3718,7 +3735,7 @@ referenceNames
}
| localNameSpacePath referenceNamesParmsList
{
- $$.op.count = 4;
+ $$.op.count = RIN_REQ_REG_SEGMENTS;
$$.op.type = OPS_ReferenceNames;
$$.op.nameSpace=setCharsMsgSegment($1);
$$.op.className=setCharsMsgSegment($2.objectName.className);
diff --git a/cimcClientSfcbLocal.c b/cimcClientSfcbLocal.c
index b2081bc..7c8bfbc 100644
--- a/cimcClientSfcbLocal.c
+++ b/cimcClientSfcbLocal.c
@@ -313,7 +313,7 @@ static CMPIEnumeration *
enumInstanceNames(Client * mb, CMPIObjectPath * cop, CMPIStatus *rc)
{
_SFCB_ENTER(TRACE_CIMXMLPROC, "enumInstanceNames");
- EnumInstanceNamesReq sreq = BINREQ(OPS_EnumerateInstanceNames, 2);
+ EnumInstanceNamesReq sreq = BINREQ(OPS_EnumerateInstanceNames, EIN_REQ_REG_SEGMENTS);
int irc,
l = 0,
err = 0;
@@ -335,6 +335,7 @@ enumInstanceNames(Client * mb, CMPIObjectPath * cop, CMPIStatus *rc)
sreq.objectPath = setObjectPathMsgSegment(cop);
sreq.principal = setCharsMsgSegment(((ClientEnc *) mb)->data.user);
+ sreq.userRole = setCharsMsgSegment(NULL);
binCtx.oHdr = (OperationHdr *) & oHdr;
binCtx.bHdr = &sreq.hdr;
@@ -414,10 +415,11 @@ enumInstances(Client * mb,
sreqSize += pCount * sizeof(MsgSegment);
sreq = calloc(1, sreqSize);
sreq->hdr.operation = OPS_EnumerateInstances;
- sreq->hdr.count = pCount + 2;
+ sreq->hdr.count = pCount + EI_REQ_REG_SEGMENTS;
sreq->objectPath = setObjectPathMsgSegment(cop);
sreq->principal = setCharsMsgSegment(((ClientEnc *) mb)->data.user);
+ sreq->userRole = setCharsMsgSegment(NULL);
binCtx.oHdr = (OperationHdr *) & oHdr;
binCtx.bHdr = &sreq->hdr;
@@ -504,10 +506,11 @@ getInstance(Client * mb,
sreqSize += pCount * sizeof(MsgSegment);
sreq = calloc(1, sreqSize);
sreq->hdr.operation = OPS_GetInstance;
- sreq->hdr.count = pCount + 2;
+ sreq->hdr.count = pCount + GI_REQ_REG_SEGMENTS;
sreq->objectPath = setObjectPathMsgSegment(cop);
sreq->principal = setCharsMsgSegment(((ClientEnc *) mb)->data.user);
+ sreq->userRole = setCharsMsgSegment(NULL);
for (i = 0; i < pCount; i++)
sreq->properties[i] = setCharsMsgSegment(properties[i]);
@@ -565,7 +568,7 @@ createInstance(Client * mb,
int irc;
BinRequestContext binCtx;
BinResponseHdr *resp;
- CreateInstanceReq sreq = BINREQ(OPS_CreateInstance, 3);
+ CreateInstanceReq sreq = BINREQ(OPS_CreateInstance, CI_REQ_REG_SEGMENTS);
CMPIObjectPath *path;
OperationHdr oHdr = { OPS_CreateInstance, 0, 3 };
@@ -583,6 +586,7 @@ createInstance(Client * mb,
memset(&binCtx, 0, sizeof(BinRequestContext));
sreq.principal = setCharsMsgSegment(((ClientEnc *) mb)->data.user);
+ sreq.userRole = setCharsMsgSegment(NULL);
sreq.path = setObjectPathMsgSegment(cop);
sreq.instance = setInstanceMsgSegment(inst);
@@ -666,11 +670,12 @@ modifyInstance(Client * mb,
sreq->properties[i] = setCharsMsgSegment(properties[i]);
sreq->hdr.operation = OPS_ModifyInstance;
- sreq->hdr.count = pCount + 3;
+ sreq->hdr.count = pCount + MI_REQ_REG_SEGMENTS;
sreq->instance = setInstanceMsgSegment(inst);
sreq->path = setObjectPathMsgSegment(cop);
sreq->principal = setCharsMsgSegment(((ClientEnc *) mb)->data.user);
+ sreq->userRole = setCharsMsgSegment(NULL);
binCtx.oHdr = (OperationHdr *) & oHdr;
binCtx.bHdr = &sreq->hdr;
@@ -716,7 +721,7 @@ deleteInstance(Client * mb, CMPIObjectPath * cop)
int irc;
BinRequestContext binCtx;
BinResponseHdr *resp;
- DeleteInstanceReq sreq = BINREQ(OPS_DeleteInstance, 2);
+ DeleteInstanceReq sreq = BINREQ(OPS_DeleteInstance, DI_REQ_REG_SEGMENTS);
OperationHdr oHdr = { OPS_DeleteInstance, 0, 2 };
CMPIStatus rc = { 0, NULL };
@@ -732,6 +737,7 @@ deleteInstance(Client * mb, CMPIObjectPath * cop)
sreq.objectPath = setObjectPathMsgSegment(cop);
sreq.principal = setCharsMsgSegment(((ClientEnc *) mb)->data.user);
+ sreq.userRole = setCharsMsgSegment(NULL);
binCtx.oHdr = (OperationHdr *) & oHdr;
binCtx.bHdr = &sreq.hdr;
@@ -773,7 +779,7 @@ execQuery(Client * mb,
CMPIObjectPath * cop,
const char *query, const char *lang, CMPIStatus *rc)
{
- ExecQueryReq sreq = BINREQ(OPS_ExecQuery, 4);
+ ExecQueryReq sreq = BINREQ(OPS_ExecQuery, EQ_REQ_REG_SEGMENTS);
int irc,
l = 0,
err = 0;
@@ -816,6 +822,7 @@ execQuery(Client * mb,
sreq.objectPath = setObjectPathMsgSegment(path);
sreq.principal = setCharsMsgSegment(((ClientEnc *) mb)->data.user);
+ sreq.userRole = setCharsMsgSegment(NULL);
sreq.query = setCharsMsgSegment(query);
sreq.queryLang = setCharsMsgSegment(lang);
@@ -903,7 +910,7 @@ associators(Client * mb,
sreqSize += pCount * sizeof(MsgSegment);
sreq = calloc(1, sreqSize);
sreq->hdr.operation = OPS_Associators;
- sreq->hdr.count = pCount + 6;
+ sreq->hdr.count = pCount + AI_REQ_REG_SEGMENTS;
sreq->objectPath = setObjectPathMsgSegment(cop);
sreq->resultClass = setCharsMsgSegment(resultClass);
@@ -912,6 +919,7 @@ associators(Client * mb,
sreq->resultRole = setCharsMsgSegment(resultRole);
sreq->hdr.flags = flags;
sreq->principal = setCharsMsgSegment(((ClientEnc *) mb)->data.user);
+ sreq->userRole = setCharsMsgSegment(NULL);
for (i = 0; i < pCount; i++)
sreq->properties[i] = setCharsMsgSegment(properties[i]);
@@ -1002,13 +1010,14 @@ references(Client * mb,
sreqSize += pCount * sizeof(MsgSegment);
sreq = calloc(1, sreqSize);
sreq->hdr.operation = OPS_References;
- sreq->hdr.count = pCount + 4;
+ sreq->hdr.count = pCount + RI_REQ_REG_SEGMENTS;
sreq->objectPath = setObjectPathMsgSegment(cop);
sreq->resultClass = setCharsMsgSegment(resultClass);
sreq->role = setCharsMsgSegment(role);
sreq->hdr.flags = flags;
sreq->principal = setCharsMsgSegment(((ClientEnc *) mb)->data.user);
+ sreq->userRole = setCharsMsgSegment(NULL);
for (i = 0; i < pCount; i++)
sreq->properties[i] = setCharsMsgSegment(properties[i]);
@@ -1065,7 +1074,7 @@ associatorNames(Client * mb,
const char *resultClass,
const char *role, const char *resultRole, CMPIStatus *rc)
{
- AssociatorNamesReq sreq = BINREQ(OPS_AssociatorNames, 6);
+ AssociatorNamesReq sreq = BINREQ(OPS_AssociatorNames, AIN_REQ_REG_SEGMENTS);
int irc,
l = 0,
err = 0;
@@ -1090,6 +1099,7 @@ associatorNames(Client * mb,
sreq.assocClass = setCharsMsgSegment(assocClass);
sreq.resultRole = setCharsMsgSegment(resultRole);
sreq.principal = setCharsMsgSegment(((ClientEnc *) mb)->data.user);
+ sreq.userRole = setCharsMsgSegment(NULL);
oHdr.nameSpace = setCharsMsgSegment((char *) ns->hdl);
oHdr.className = sreq.assocClass;
@@ -1137,7 +1147,7 @@ referenceNames(Client * mb,
CMPIObjectPath * cop,
const char *resultClass, const char *role, CMPIStatus *rc)
{
- ReferenceNamesReq sreq = BINREQ(OPS_ReferenceNames, 4);
+ ReferenceNamesReq sreq = BINREQ(OPS_ReferenceNames, RIN_REQ_REG_SEGMENTS);
int irc,
l = 0,
err = 0;
@@ -1159,6 +1169,7 @@ referenceNames(Client * mb,
sreq.resultClass = setCharsMsgSegment(resultClass);
sreq.role = setCharsMsgSegment(role);
sreq.principal = setCharsMsgSegment(((ClientEnc *) mb)->data.user);
+ sreq.userRole = setCharsMsgSegment(NULL);
oHdr.className = sreq.resultClass;
oHdr.nameSpace = setCharsMsgSegment((char *) ns->hdl);
diff --git a/httpAdapter.c b/httpAdapter.c
index 5a4a6c5..9bb60bb 100644
--- a/httpAdapter.c
+++ b/httpAdapter.c
@@ -1062,7 +1062,7 @@ doHttpRequest(CommHndl conn_fd)
}
#endif
- AuthExtras extras = {NULL, NULL, NULL};
+ AuthExtras extras = {NULL, NULL, NULL, NULL};
if (!authorized && !discardInput && doBa) {
if (inBuf.authorization) {
@@ -1149,6 +1149,7 @@ doHttpRequest(CommHndl conn_fd)
ctx.cimDoc = inBuf.content;
ctx.principal = inBuf.principal;
+ ctx.role = extras.role;
ctx.host = inBuf.host;
/* override based on sfcb.cfg value */
ctx.teTrailers = (chunkMode == CHUNK_FORCE) ? 1 : inBuf.trailers;
diff --git a/providerDrv.c b/providerDrv.c
index f7f1e2e..a198e81 100644
--- a/providerDrv.c
+++ b/providerDrv.c
@@ -1336,6 +1336,8 @@ deleteClass(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -1390,9 +1392,11 @@ getClass(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
- if (req->hdr.count > 2)
- props = makePropertyList(req->hdr.count - 2, req->properties);
+ if (req->hdr.count>GC_REQ_REG_SEGMENTS)
+ props=makePropertyList(req->hdr.count - GC_REQ_REG_SEGMENTS,req->properties);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -1441,6 +1445,8 @@ createClass(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -1485,6 +1491,8 @@ enumClassNames(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
@@ -1541,6 +1549,8 @@ enumClasses(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
@@ -1887,18 +1897,21 @@ invokeMethod(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
+
if (info->parms)
ctx->ft->addEntry(ctx, "sfcbProviderParameters",
(CMPIValue *) info->parms, CMPI_chars);
- if (req->hdr.count > 5) {
+ if (req->hdr.count > IM_REQ_REG_SEGMENTS) {
int i,
s,
n;
CMPIString *name;
in = CMNewArgs(Broker, NULL);
BinRequestHdr *r = (BinRequestHdr *) req;
- for (n = 5, i = 0, s = CMGetArgCount(tIn, NULL); i < s; i++) {
+ for (n = IM_REQ_REG_SEGMENTS, i = 0, s = CMGetArgCount(tIn, NULL); i < s; i++) {
CMPIData d = CMGetArgAt(tIn, i, &name, NULL);
if (d.type == CMPI_instance) {
d.value.inst = relocateSerializedInstance(r->object[n++].data);
@@ -1967,9 +1980,11 @@ getInstance(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
- if (req->hdr.count > 2)
- props = makePropertyList(req->hdr.count - 2, req->properties);
+ if (req->hdr.count > GI_REQ_REG_SEGMENTS)
+ props = makePropertyList(req->hdr.count - GI_REQ_REG_SEGMENTS, req->properties);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -2027,6 +2042,8 @@ deleteInstance(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -2070,6 +2087,8 @@ createInstance(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -2121,9 +2140,11 @@ modifyInstance(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
- if (req->hdr.count > 3)
- props = makePropertyList(req->hdr.count - 3, req->properties);
+ if (req->hdr.count > MI_REQ_REG_SEGMENTS)
+ props = makePropertyList(req->hdr.count - MI_REQ_REG_SEGMENTS, req->properties);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -2185,9 +2206,11 @@ enumInstances(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
- if (req->hdr.count > 2)
- props = makePropertyList(req->hdr.count - 2, req->properties);
+ if (req->hdr.count > EI_REQ_REG_SEGMENTS)
+ props = makePropertyList(req->hdr.count - EI_REQ_REG_SEGMENTS, req->properties);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -2234,6 +2257,8 @@ enumInstanceNames(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -2344,6 +2369,8 @@ execQuery(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -2450,9 +2477,11 @@ associators(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
- if (req->hdr.count > 6)
- props = makePropertyList(req->hdr.count - 6, req->properties);
+ if (req->hdr.count > AI_REQ_REG_SEGMENTS)
+ props = makePropertyList(req->hdr.count - AI_REQ_REG_SEGMENTS, req->properties);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -2505,9 +2534,11 @@ references(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
- if (req->hdr.count > 4)
- props = makePropertyList(req->hdr.count - 4, req->properties);
+ if (req->hdr.count > RI_REQ_REG_SEGMENTS)
+ props = makePropertyList(req->hdr.count - RI_REQ_REG_SEGMENTS, req->properties);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -2552,6 +2583,8 @@ associatorNames(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
@@ -2598,6 +2631,8 @@ referenceNames(BinRequestHdr * hdr, ProviderInfo * info, int requestor)
CMPI_chars);
ctx->ft->addEntry(ctx, "CMPISessionId", (CMPIValue *) & hdr->sessionId,
CMPI_uint32);
+ ctx->ft->addEntry(ctx, CMPIRole, (CMPIValue *) req->userRole.data,
+ CMPI_chars);
_SFCB_TRACE(1, ("--- Calling provider %s", info->providerName));
TIMING_START(hdr, info)
diff --git a/providerMgr.c b/providerMgr.c
index a075af2..57b3b06 100644
--- a/providerMgr.c
+++ b/providerMgr.c
@@ -1515,7 +1515,7 @@ getConstClass(const char *ns, const char *cn)
CMPIObjectPath *path;
CMPIConstClass *ccl;
CMPIStatus rc;
- GetClassReq sreq = BINREQ(OPS_GetClass, 2);
+ GetClassReq sreq = BINREQ(OPS_GetClass, GC_REQ_REG_SEGMENTS);
BinResponseHdr *resp = NULL;
BinRequestContext binCtx;
OperationHdr req = { OPS_GetClass, 2 };
@@ -1527,6 +1527,7 @@ getConstClass(const char *ns, const char *cn)
path = TrackedCMPIObjectPath(ns, cn, &rc);
sreq.principal = setCharsMsgSegment("$$");
sreq.objectPath = setObjectPathMsgSegment(path);
+ sreq.userRole = setCharsMsgSegment(NULL);
req.nameSpace = setCharsMsgSegment((char *) ns);
req.className = setCharsMsgSegment((char *) cn);
@@ -1576,7 +1577,7 @@ _getConstClass(const char *ns, const char *cn, CMPIStatus *st)
CMPIObjectPath *path;
CMPIConstClass *ccl = NULL;
- GetClassReq sreq = BINREQ(OPS_GetClass, 2);
+ GetClassReq sreq = BINREQ(OPS_GetClass, GC_REQ_REG_SEGMENTS);
BinResponseHdr *resp;
BinRequestContext binCtx;
OperationHdr req = { OPS_GetClass, 2 };
@@ -1585,6 +1586,7 @@ _getConstClass(const char *ns, const char *cn, CMPIStatus *st)
path = NewCMPIObjectPath(ns, cn, st);
sreq.objectPath = setObjectPathMsgSegment(path);
sreq.principal = setCharsMsgSegment("$$");
+ sreq.userRole = setCharsMsgSegment(NULL);
req.nameSpace = setCharsMsgSegment((char *) ns);
req.className = setCharsMsgSegment((char *) cn);
@@ -1634,7 +1636,7 @@ localInvokeMethod(BinRequestContext * binCtx,
{
_SFCB_ENTER(TRACE_PROVIDERMGR, "localInvokeMethod");
- InvokeMethodReq sreq = BINREQ(OPS_InvokeMethod, 5);
+ InvokeMethodReq sreq = BINREQ(OPS_InvokeMethod, IM_REQ_REG_SEGMENTS);
OperationHdr req = { OPS_InvokeMethod, 1 };
CMPIData data = { 0, CMPI_nullValue, {0} };
if (out)
@@ -1647,6 +1649,7 @@ localInvokeMethod(BinRequestContext * binCtx,
sreq.objectPath = setObjectPathMsgSegment(path);
sreq.method = setCharsMsgSegment(method);
sreq.principal = setCharsMsgSegment("$$");
+ sreq.userRole = setCharsMsgSegment(NULL);
binCtx->oHdr = &req;
binCtx->bHdr = &sreq.hdr;
diff --git a/providerMgr.h b/providerMgr.h
index 24192b3..e5e5004 100644
--- a/providerMgr.h
+++ b/providerMgr.h
@@ -105,7 +105,7 @@ typedef struct binResponseHdr {
chunkedMode,
moreChunks;
unsigned long count; // number of MsgSegments in response
- MsgSegment object[1];
+ MsgSegment object[1]; /* WARNING: brokerUpc references segments positionally! */
} BinResponseHdr;
struct chunkFunctions;
@@ -159,33 +159,43 @@ typedef struct getClassReq {
BinRequestHdr hdr;
MsgSegment principal;
MsgSegment objectPath;
+ MsgSegment userRole;
MsgSegment properties[1];
} GetClassReq;
+#define GC_REQ_REG_SEGMENTS 3
typedef struct enumClassNamesReq {
BinRequestHdr hdr;
MsgSegment principal;
MsgSegment objectPath;
+ MsgSegment userRole;
} EnumClassNamesReq;
+#define ECN_REQ_REG_SEGMENTS 3
typedef struct enumClassesReq {
BinRequestHdr hdr;
MsgSegment principal;
MsgSegment objectPath;
+ MsgSegment userRole;
} EnumClassesReq;
+#define EC_REQ_REG_SEGMENTS 3
typedef struct enumInstanceNamesReq {
BinRequestHdr hdr;
MsgSegment principal;
MsgSegment objectPath;
+ MsgSegment userRole;
} EnumInstanceNamesReq;
+#define EIN_REQ_REG_SEGMENTS 3
typedef struct enumInstancesReq {
BinRequestHdr hdr;
MsgSegment principal;
MsgSegment objectPath;
+ MsgSegment userRole;
MsgSegment properties[1];
} EnumInstancesReq;
+#define EI_REQ_REG_SEGMENTS 3
typedef struct execQueryReq {
BinRequestHdr hdr;
@@ -193,7 +203,9 @@ typedef struct execQueryReq {
MsgSegment objectPath;
MsgSegment query;
MsgSegment queryLang;
+ MsgSegment userRole;
} ExecQueryReq;
+#define EQ_REQ_REG_SEGMENTS 5
typedef struct associatorsReq {
BinRequestHdr hdr;
@@ -203,8 +215,10 @@ typedef struct associatorsReq {
MsgSegment role;
MsgSegment assocClass;
MsgSegment resultRole;
+ MsgSegment userRole;
MsgSegment properties[1];
} AssociatorsReq;
+#define AI_REQ_REG_SEGMENTS 7
typedef struct referencesReq {
BinRequestHdr hdr;
@@ -212,8 +226,10 @@ typedef struct referencesReq {
MsgSegment objectPath;
MsgSegment resultClass;
MsgSegment role;
+ MsgSegment userRole;
MsgSegment properties[1];
} ReferencesReq;
+#define RI_REQ_REG_SEGMENTS 5
typedef struct associatorNamesReq {
BinRequestHdr hdr;
@@ -223,7 +239,9 @@ typedef struct associatorNamesReq {
MsgSegment role;
MsgSegment assocClass;
MsgSegment resultRole;
+ MsgSegment userRole;
} AssociatorNamesReq;
+#define AIN_REQ_REG_SEGMENTS 7
typedef struct referenceNamesReq {
BinRequestHdr hdr;
@@ -231,48 +249,62 @@ typedef struct referenceNamesReq {
MsgSegment objectPath;
MsgSegment resultClass;
MsgSegment role;
+ MsgSegment userRole;
} ReferenceNamesReq;
+#define RIN_REQ_REG_SEGMENTS 5
typedef struct getInstanceReq {
BinRequestHdr hdr;
MsgSegment principal;
MsgSegment objectPath;
+ MsgSegment userRole;
MsgSegment properties[1];
} GetInstanceReq;
+#define GI_REQ_REG_SEGMENTS 3
typedef struct createClassReq {
BinRequestHdr hdr;
MsgSegment principal;
MsgSegment path;
MsgSegment cls;
+ MsgSegment userRole;
} CreateClassReq;
+#define CC_REQ_REG_SEGMENTS 4
typedef struct createInstanceReq {
BinRequestHdr hdr;
MsgSegment principal;
MsgSegment path;
MsgSegment instance;
+ MsgSegment userRole;
} CreateInstanceReq;
+#define CI_REQ_REG_SEGMENTS 4
typedef struct modifyInstanceReq {
BinRequestHdr hdr;
MsgSegment principal;
MsgSegment path;
MsgSegment instance;
+ MsgSegment userRole;
MsgSegment properties[1];
} ModifyInstanceReq;
+#define MI_REQ_REG_SEGMENTS 4
typedef struct deleteInstanceReq {
BinRequestHdr hdr;
MsgSegment principal;
MsgSegment objectPath;
+ MsgSegment userRole;
} DeleteInstanceReq;
+#define DI_REQ_REG_SEGMENTS 3
typedef struct deleteClassReq {
BinRequestHdr hdr;
MsgSegment principal;
MsgSegment objectPath;
+ MsgSegment userRole;
} DeleteClassReq;
+#define DC_REQ_REG_SEGMENTS 3
typedef struct invokeMethodReq {
BinRequestHdr hdr;
@@ -281,7 +313,9 @@ typedef struct invokeMethodReq {
MsgSegment method;
MsgSegment in;
MsgSegment out;
+ MsgSegment userRole;
} InvokeMethodReq;
+#define IM_REQ_REG_SEGMENTS 6
typedef struct loadProviderReq {
BinRequestHdr hdr;
diff --git a/sfcBasicPAMAuthentication.c b/sfcBasicPAMAuthentication.c
index 5904b66..6329637 100644
--- a/sfcBasicPAMAuthentication.c
+++ b/sfcBasicPAMAuthentication.c
@@ -99,10 +99,14 @@ _sfcBasicAuthenticateRemote(char *user, char *pw, AuthExtras *extras)
retval = 0;
}
+ /* for testing */
+ // pam_putenv(pamh, "CMPIRole=54321");
+
/* if we keep the handle around, it means we'll call pam_end() later */
if (extras) {
extras->authHandle = pamh;
extras->release = closePam;
+ extras->role = pam_getenv(pamh, "CMPIRole");
}
else
pam_end(pamh, rc);
hooks/post-receive
--
SFCB - Small Footprint CIM Broker
|