nwconn: return DOS namespace names for AFP entry ids
All checks were successful
Source release / source-package (push) Successful in 49s

Route AFP Get DOS Name From Entry ID through the existing mars_nwe DOS namespace alias helper instead of returning raw Unix directory entry names from the reverse lookup walk.

WebSDK semantics require this subfunction to return a DOSPathString. The current AFP entry ids are mars_nwe/libatalk metadata ids rather than namspace.c base handles, so the lookup still has to walk the volume tree, but each path component is now formatted with namedos.c build_dos_83_alias(). This keeps the Apple-facing adapter aligned with the existing DOS namespace rules used by normal NetWare clients.

Update the Linux smoke helper's default expectation for raw VOL:PATH smoke inputs to compare against the DOS 8.3 uppercase form. Explicit --expect remains available for callers that want to validate a specific alias.

Tests: git diff --check; gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_dos_name_smoke.c
This commit is contained in:
OpenAI
2026-05-30 14:39:57 +00:00
committed by Mario Fetka
parent 2a345b298c
commit b768c921c8
2 changed files with 47 additions and 4 deletions

View File

@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <ncp/nwcalls.h>
#include <ncp/ncplib.h>
@@ -77,6 +78,18 @@ static const char *path_without_volume(const char *path)
return path;
}
static void default_dos_expectation(const char *path, char *out, size_t out_len)
{
const char *src = path_without_volume(path);
size_t i;
if (!out || !out_len)
return;
for (i = 0; i + 1 < out_len && src[i]; i++)
out[i] = (char)toupper((unsigned char)src[i]);
out[i] = '\0';
}
static NWCCODE get_entry_id_for_path(NWCONN_HANDLE conn, const char *path,
uint32_t *entry_id)
{
@@ -118,6 +131,7 @@ int main(int argc, char **argv)
long init_err = 0;
const char *path = NULL;
const char *expect = NULL;
char default_expect[256];
int allow_invalid_namespace = 0;
int allow_invalid_path = 0;
uint32_t volume_number = 0;
@@ -243,8 +257,10 @@ int main(int argc, char **argv)
memcpy(dos_path, reply_buf + 1, reply_buf[0]);
dos_path[reply_buf[0]] = '\0';
if (!expect && path)
expect = path_without_volume(path);
if (!expect && path) {
default_dos_expectation(path, default_expect, sizeof(default_expect));
expect = default_expect;
}
if (expect && strcmp(expect, dos_path)) {
fprintf(stderr,
"AFP Get DOS Name From Entry ID verify mismatch: volume=%u entry_id=0x%08x got=%s expected=%s\n",