tests: encode AFP smoke handle paths through libncp
All checks were successful
Source release / source-package (push) Successful in 46s

Pass NCP_PATH_STD to ncp_ns_alloc_short_dir_handle() when the AFP Entry ID
smoke test allocates a temporary directory handle for a VOL: path.

The test already uses libncp to allocate the handle, but it passed the raw
"SYS:" bytes together with an explicit byte length. ncpfs helpers expect
NCP_PATH_STD when the caller wants libncp to encode a normal NetWare path into
the component-counted wire format. Sending the raw VOL: string made the server
reject the handle allocation with completion 0x98 before the AFP endpoint was
reached.

Keep the libncp handle allocation path, but let libncp encode the root volume
path the same way the ncpfs tools do. This changes only the Linux smoke test;
server AFP protocol behavior is unchanged.
This commit is contained in:
Mario Fetka
2026-05-30 00:59:50 +00:00
parent cc98d22144
commit d58d73b37f

View File

@@ -108,6 +108,11 @@ static NWCCODE allocate_temp_dir_handle(NWCONN_HANDLE conn, const char *volume,
* Allocate Temporary Directory Handle request. This matches the way the
* ncpfs tools allocate short directory handles and lets libncp choose the
* correct request encoding for the connected server.
*
* Pass NCP_PATH_STD so libncp converts the VOL: path to NetWare's
* component-counted path format. Passing the raw "SYS:" bytes makes the
* server interpret the request payload incorrectly and returns 0x98 before
* the AFP endpoint is reached.
*/
err = ncp_ns_alloc_short_dir_handle(conn,
NW_NS_DOS,
@@ -115,7 +120,7 @@ static NWCCODE allocate_temp_dir_handle(NWCONN_HANDLE conn, const char *volume,
0,
0,
(const unsigned char *)root_path,
volume_len + 1,
NCP_PATH_STD,
NCP_ALLOC_TEMPORARY,
&handle,
NULL);