From 3675b30d435fdb4d275432db4dd44bfa1851529c Mon Sep 17 00:00:00 2001 From: OpenAI Date: Sat, 30 May 2026 13:35:42 +0000 Subject: [PATCH] nwconn: fix AFP archive attribute set mask scope Repair the AFP Set File Information attribute write path introduced by the NetWare archive mapping patch. The validation pass already derives requested_bits from the AFP attribute word while checking the WebSDK/NWAFP Set Attributes semantics, but that variable is scoped to the validation block. The later write pass accidentally reused the same name after it had gone out of scope, causing builds to fail with an undeclared identifier. Derive the same mask again in the write pass as requested_set_bits and use it to decide whether the Archive bit should be routed through the existing NetWare FILE_ATTR_A path and whether the AFP-only xattr bits should be persisted through nwatalk. This keeps Archive mapped to the existing NetWare attribute store while leaving Invisible/System in org.mars-nwe.afp.attributes. Tests: git diff --check. Build failure reported by Gentoo/Portage compile of src/nwconn.c. --- src/nwconn.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nwconn.c b/src/nwconn.c index 544f25b..3a81844 100644 --- a/src/nwconn.c +++ b/src/nwconn.c @@ -1255,14 +1255,15 @@ static int afp_set_file_information(uint8 *afp_req, int afp_len, if (data_off & 1) data_off++; if (request_mask & AFP_FILE_BITMAP_ATTRIBUTES) { uint16 requested_attrs = GET_BE16(afp_req + data_off); + uint16 requested_set_bits = requested_attrs & ~AFP_ATTR_SETCLR; log_attrs = requested_attrs; - if (requested_bits & AFP_ATTR_ARCHIVE) { + if (requested_set_bits & AFP_ATTR_ARCHIVE) { result = afp_set_netware_archive_attribute(path_volume, unixname, &stbuff, requested_attrs); if (result < 0) return(result); } - if (requested_bits & AFP_ATTR_XATTR_MASK) { + if (requested_set_bits & AFP_ATTR_XATTR_MASK) { uint16 xattr_attrs = requested_attrs & (AFP_ATTR_SETCLR | AFP_ATTR_XATTR_MASK); result = nwatalk_set_afp_attributes(unixname, xattr_attrs); if (result < 0)