nwconn: fix AFP archive attribute set mask scope
All checks were successful
Source release / source-package (push) Successful in 47s
All checks were successful
Source release / source-package (push) Successful in 47s
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user