From 096ce757b25553bfdfc994d0c973d01d9e8a2b15 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Mon, 1 Jun 2026 22:15:22 +0000 Subject: [PATCH] docs: place redirected ncp22 quota docs at handlers --- src/nwbind.c | 18 +++++++++++++----- src/nwconn.c | 44 +++++++++++++++++++++++--------------------- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/src/nwbind.c b/src/nwbind.c index 8cd7035..faec892 100644 --- a/src/nwbind.c +++ b/src/nwbind.c @@ -760,19 +760,27 @@ static void handle_fxx(int gelen, int func) case 0x22 : /* Remove User Disk Space Restrictions, 0x2222/22/34 */ case 0x29 : { /* Get Object Disk Usage And Restrictions, 0x2222/22/41 */ /* - * Forwarded from src/nwconn.c NCP 0x2222/22. The shared quota - * prehandler sees only the subfunction payload as rdata: + * Redirected NCP 0x2222/22 quota prehandler. nwconn.c dispatches + * these calls with func == 0x16 and ufunc as the wire subfunction; + * nwbind sees only the subfunction payload as rdata. * + * Documented endpoints handled here: + * SDK 22/33 / wire 0x21 Add User Disk Space Restriction + * SDK 22/34 / wire 0x22 Remove User Disk Space Restrictions + * SDK 22/41 / wire 0x29 Get Object Disk Usage And Restrictions + * + * WebSDK / headers request payloads after SubFunctionCode: * rdata[0] VolumeNumber * rdata[1..4] ObjectID (Hi-Lo) - * rdata[5..8] DiskSpaceLimit (Lo-Hi, only for 22/33) + * rdata[5..8] DiskSpaceLimit (Lo-Hi, only for SDK 22/33) * * Parser comparison: ObjectID is read from the documented position - * for all three subfunctions. DiskSpaceLimit for 22/33 is not + * for all three subfunctions. DiskSpaceLimit for SDK 22/33 is not * consumed by this prehandler; handle_after_bind() receives only the * uid/gid/permission tuple produced below. * - * Returns 3 integers, uid, gid, 0=OK/1=Permission denied. + * Internal reply to nwconn.c: 3 integers, uid, gid, + * 0=OK/1=Permission denied. */ uint32 id = GET_BE32(rdata+1); internal_act=1; diff --git a/src/nwconn.c b/src/nwconn.c index 35a7c39..588cf78 100644 --- a/src/nwconn.c +++ b/src/nwconn.c @@ -4590,28 +4590,30 @@ static int handle_ncp_serv(void) } break; - /* - * NCP 0x2222/22/41 Get Object Disk Usage And Restrictions. - * - * WebSDK / headers: - * Request: Volume Number, Object ID (high-low) - * Reply: Restriction and In Use, both 32-bit values in 4K - * blocks. - * - * A restriction value of 0x40000000 means that the object has no - * disk restriction. NetWare also treats unknown/invalid object - * IDs as a successful unrestricted/no-use result. - * - * With QUOTA_SUPPORT enabled this call needs bindery prehandling: - * nwbind maps the Object ID to a Unix uid before - * handle_after_bind() calls nw_get_vol_restrictions(). Without - * quota support, keep the SDK-compatible fallback local so builds - * on hosts without quota support do not need the quota backend. - * - * Parser comparison: request payload is VolumeNumber followed by - * ObjectID (Hi-Lo), matching the documented layout. - */ case 0x29 : { /* Get Object Disk Usage And Restrictions */ + /* + * NCP 0x2222/22/41 (SDK decimal) / wire 0x29 + * Get Object Disk Usage And Restrictions. + * + * WebSDK / headers: + * Request: Volume Number, Object ID (high-low) + * Reply: Restriction and In Use, both 32-bit values in 4K + * blocks. + * + * A restriction value of 0x40000000 means that the object has no + * disk restriction. NetWare also treats unknown/invalid object + * IDs as a successful unrestricted/no-use result. + * + * With QUOTA_SUPPORT enabled this endpoint is forwarded to + * nwbind for bindery ObjectID-to-uid mapping; the redirected + * prehandler layout is documented at src/nwbind.c case 0x29. + * Without quota support, keep the SDK-compatible fallback + * local so builds on hosts without quota support do not need + * the quota backend. + * + * Parser comparison: request payload is VolumeNumber followed by + * ObjectID (Hi-Lo), matching the documented layout. + */ #if QUOTA_SUPPORT XDPRINTF((5, 0, "Read vol restrictions")); return(-2); /* nwbind must do prehandling */