docs: audit core namespace endpoints

This commit is contained in:
Mario Fetka
2026-06-02 14:41:57 +00:00
parent 4cd0e8bfa6
commit 648ca88ba6
4 changed files with 178 additions and 59 deletions

View File

@@ -3021,7 +3021,16 @@ int handle_func_0x57(uint8 *p, int request_len,
"DBUG NCP 87/%d REQUEST ns=%d fn=0x57 sub=0x%02x ns_hex=0x%02x",
ufunc, namespace, ufunc, namespace));
switch (ufunc) {
case 0x01 : /* open creat file or subdir */
case 0x01 : /* SDK 87/01 Open/Create File or Subdirectory.
* Coverage: present.
* Request: SubFunction, NameSpace, OpenCreateMode,
* SearchAttributes, ReturnInfoMask, CreateAttributes,
* DesiredAccessRights, then NetWareHandlePathStruct.
* Reply: OpenCreateAction, FileHandle, and info selected
* by ReturnInfoMask. Current helper builds the MARS-NWE
* compatibility reply and uses the project's namespace path
* parser.
*/
{
/* NW PATH STRUC */
int opencreatmode = (int) *(p+1);
@@ -3038,7 +3047,13 @@ int handle_func_0x57(uint8 *p, int request_len,
break;
case 0x02 : /* Initialize Search */
case 0x02 : /* SDK 87/02 Initialize Search.
* Coverage: present.
* Request: SubFunction, srcNameSpace, dstNameSpace, then
* NetWareHandlePathStruct and path components.
* Reply: source/destination namespace search state built
* by nw_init_search().
*/
{
/* NW PATH STRUC */
NW_HPATH nwpathstruct;
@@ -3050,7 +3065,16 @@ int handle_func_0x57(uint8 *p, int request_len,
}
break;
case 0x03 : /* Search for File or DIR */
case 0x03 : /* SDK 87/03 Search for File or Subdirectory.
* Coverage: present.
* Request: SubFunction, NameSpace, DataStream/reserved,
* SearchAttributes, ReturnInfoMask, Volume, BaseHandle,
* SearchSequence, SearchPatternLen, SearchPattern.
* Reply: Volume, BaseHandle, NextSearchSequence, reserved,
* followed by one namespace information structure.
* Difference: current code treats the data stream as the
* same value as NameSpace and returns at most one entry.
*/
{
struct OUTPUT {
uint8 volume;
@@ -3087,7 +3111,13 @@ int handle_func_0x57(uint8 *p, int request_len,
}
break;
case 0x04 : /* rename File or Dir */
case 0x04 : /* SDK 87/04 Rename Or Move a File or Subdirectory.
* Coverage: present.
* Request: SubFunction, NameSpace, RenameFlag,
* SearchAttributes, source and destination
* NetWareHandlePathStruct headers, then path strings.
* Reply: no payload, normal Completion response.
*/
{
int renameflag = *(p+1);
int searchattrib = (int) GET_16(p+2); /* LOW-HI */
@@ -3103,7 +3133,13 @@ int handle_func_0x57(uint8 *p, int request_len,
}
break;
case 0x05 : /* Scan File/Dir for Trustees */
case 0x05 : /* SDK 87/05 Scan File or Subdirectory for Trustees.
* Coverage: present.
* Request: SubFunction, NameSpace, reserved,
* SearchAttributes, ScanSequence, NetWareHandlePathStruct.
* Reply: NextScanSequence, TrusteeCount, then trustee
* entries as returned by nw_get_trustee_set().
*/
{
#if 0
int reserved = (int) *(p+1);
@@ -3126,7 +3162,12 @@ int handle_func_0x57(uint8 *p, int request_len,
break;
case 0x06 : /* Obtain File or Subdir Info */
case 0x06 : /* SDK 87/06 Obtain File or Subdirectory Information.
* Coverage: present.
* Request: SubFunction, NameSpace, DestNameSpace,
* SearchAttributes, ReturnInfoMask, NWHandlePathStruct.
* Reply: information selected by ReturnInfoMask.
*/
{
#if 0
static int code = 0;
@@ -3155,7 +3196,13 @@ static int code = 0;
}
break;
case 0x07 : /* Modify File or Dir Info */
case 0x07 : /* SDK 87/07 Modify File or Subdirectory DOS Information.
* Coverage: present.
* Request: SubFunction, NameSpace, reserved,
* SearchAttributes, ModifyDOSInfoMask, DOSModifyInfo,
* NetWareHandlePathStruct.
* Reply: no payload, normal Completion response.
*/
{
NW_HPATH nwp;
DOS_MODIFY_INFO dmi;
@@ -3170,7 +3217,12 @@ static int code = 0;
}
break;
case 0x08 : /* Delete a File or Subdir */
case 0x08 : /* SDK 87/08 Delete a File or Subdirectory.
* Coverage: present.
* Request: SubFunction, NameSpace, reserved,
* SearchAttributes, NetWareHandlePathStruct.
* Reply: no payload, normal Completion response.
*/
{
int searchattrib = (int) GET_16(p+2); /* LOW-HI */
NW_HPATH *nwpathstruct = (NW_HPATH *) (p+4);
@@ -3178,7 +3230,12 @@ static int code = 0;
}
break;
case 0x09 : /* Set short Dir Handle*/
case 0x09 : /* SDK 87/09 Set Short Directory Handle.
* Coverage: present.
* Request: SubFunction, NameSpace, ShortDirectoryHandle,
* reserved, NetWareHandlePathStruct.
* Reply: no payload, normal Completion response.
*/
{ /* nw32client needs it */
int desthandle = (int)*(p+2);
NW_HPATH *nwp = (NW_HPATH *)(p+4);
@@ -3187,7 +3244,15 @@ static int code = 0;
}
break;
case 0x0a : /* Add trustee set to file or dir*/
case 0x0a : /* SDK 87/10 Add Trustee Set to File or Subdirectory.
* Coverage: present.
* Request: SubFunction, NameSpace, SearchAttributes,
* TrusteeRightsMask, ObjectIDCount, NWHandlePathStruct, then
* ObjectID/TrusteeRights entries.
* Reply: no payload, normal Completion response.
* Difference: current code expects trustee entries after a
* fixed 315-byte path structure area.
*/
{
int searchattrib = (int) GET_16(p+2); /* LO-HI */
int trustee_rights = (int) GET_16(p+4); /* LO-HI */
@@ -3204,7 +3269,14 @@ static int code = 0;
}
break;
case 0x0b : /* delete trustee set from file or dir */
case 0x0b : /* SDK 87/11 Delete Trustee Set from File or SubDirectory.
* Coverage: present.
* Request: SubFunction, NameSpace, ObjectIDCount,
* NWHandlePathStruct, then ObjectID entries.
* Reply: no payload, normal Completion response.
* Difference: current code expects object ids after a fixed
* 311-byte path structure area.
*/
{
int count = (int) GET_16(p+2);
NW_HPATH *nwp = (NW_HPATH *)(p+4);
@@ -3215,7 +3287,12 @@ static int code = 0;
}
break;
case 0x0c : /* alloc short dir Handle */
case 0x0c : /* SDK 87/12 Allocate Short Directory Handle.
* Coverage: present.
* Request: SubFunction, NameSpace, DstNameSpace/HandleMode,
* NetWareHandlePathStruct.
* Reply: DirectoryHandle, VolumeNumber, Reserved.
*/
{
int hmode = (int) GET_16(p+2); /* 0=p, 1=temp, 2=speztemp */
NW_HPATH *nwp = (NW_HPATH *)(p+4);

View File

@@ -6678,7 +6678,16 @@ static int handle_ncp_serv(void)
}
break;
case 0x57 : /* some new namespace calls */
case 0x57 : /* SDK 87 Name Space group / wire 0x57.
* Coverage: forwarded to handle_func_0x57() in namspace.c.
* Request handoff: nwconn passes requestdata starting at
* SubFunction byte; the namespace byte follows at offset 1
* for the old 87/xx calls audited so far.
* Reply handoff: handler returns a non-negative payload
* length for responsedata, or a negative completion code.
* This patch audits the core 87/01..87/12 namespace block;
* later 87/16+ salvage/metadata calls remain separate.
*/
{
int result = handle_func_0x57(requestdata, requestlen,
responsedata,