From d58d73b37fec21aaf80dfbd4fb22e158d41e98b4 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sat, 30 May 2026 00:59:50 +0000 Subject: [PATCH] tests: encode AFP smoke handle paths through libncp 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. --- tests/linux/afp_entry_id_smoke.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/linux/afp_entry_id_smoke.c b/tests/linux/afp_entry_id_smoke.c index 9553738..70e8685 100644 --- a/tests/linux/afp_entry_id_smoke.c +++ b/tests/linux/afp_entry_id_smoke.c @@ -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);