nwbind: implement NCP 17/4c list object relations
All checks were successful
Source release / source-package (push) Successful in 44s
All checks were successful
Source release / source-package (push) Successful in 44s
Implement the Bindery "List Relations of an Object" endpoint. Parse the NCP 17 subfunction 0x4c request, look up the requested bindery object and set property, and return up to 32 related object IDs from the set property value segments. Support the Novell last-seen cursor convention where 0xffffffff starts a new scan and subsequent calls continue after the last returned object ID. Add a small nwdbm helper for listing set-property members while preserving the existing bindery property read-right checks. Reject wildcard object names with the documented illegal-wildcard completion code.
This commit is contained in:
29
src/nwbind.c
29
src/nwbind.c
@@ -1466,8 +1466,33 @@ static void handle_fxx(int gelen, int func)
|
||||
break;
|
||||
|
||||
case 0x4c : { /* List Relations of an Object */
|
||||
XDPRINTF((1, 0, "TODO:List Relations of an Object"));
|
||||
completition=0xfb;
|
||||
struct XDATA {
|
||||
uint8 count[2];
|
||||
uint8 relations[32*4];
|
||||
} *xdata = (struct XDATA*) responsedata;
|
||||
uint8 *p = rdata;
|
||||
uint32 last_seen = GET_BE32(p);
|
||||
int object_type = GET_BE16(p+4);
|
||||
int object_namlen = (int)*(p+6);
|
||||
uint8 *object_name = p+7;
|
||||
int prop_namlen = (int)*(p+7+object_namlen);
|
||||
uint8 *prop_name = p+8+object_namlen;
|
||||
uint32 relations[32];
|
||||
int result = nw_list_obj_relations(object_type,
|
||||
object_name, object_namlen,
|
||||
prop_name, prop_namlen,
|
||||
last_seen, relations, 32);
|
||||
if (result > -1) {
|
||||
int k;
|
||||
uint8 *rp = xdata->relations;
|
||||
U16_TO_BE16((uint16)result, xdata->count);
|
||||
for (k=0; k < result; k++) {
|
||||
U32_TO_BE32(relations[k], rp);
|
||||
rp += 4;
|
||||
}
|
||||
data_len = 2 + (result * 4);
|
||||
XDPRINTF((2, 0, "List Relations of an Object count=%d", result));
|
||||
} else completition = (uint8)-result;
|
||||
} break;
|
||||
|
||||
case 0x64 : { /* Create Queue, prehandled by nwconn */
|
||||
|
||||
Reference in New Issue
Block a user