Files
mars-nwe/include/nwatalk.h
OpenAI c51fde95fe
All checks were successful
Source release / source-package (push) Successful in 47s
nwconn: persist AFP invisible file attributes
Extend the conservative NCP 0x2222/35/16 AFP 2.0 Set File Information smoke path beyond FinderInfo-only writes by accepting the file Attributes bitmap for one deliberately narrow bit: Finder Invisible.

WebSDK and Netatalk FPSetFileParams semantics carry file attributes as bitmap bit 0, with ATTRBIT_SETCLR selecting set-vs-clear behavior. Mirror that model only for ATTRBIT_INVISIBLE and reject all other AFP attribute bits so DOS/NetWare mode bits, timestamp writes, resource forks, and broader file protection semantics are not implied accidentally.

Persist the mars_nwe-owned AFP attribute word in org.mars-nwe.afp.attributes via the local xattr abstraction. On Linux this maps to user.org.mars-nwe.afp.attributes, matching the org.mars-nwe.* source-level namespace while remaining portable on Linux xattr backends. Get File Information and Scan File Information now merge that stored Invisible bit into the existing 120-byte AFP file-info record.

Update the Linux Set File Information smoke helper with --invisible, --clear-invisible, --attributes-only, and --finder-info-only so FinderInfo and the narrow AFP attribute path can be tested independently or together.

Tests: git diff --check

Tests: gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_set_file_info_smoke.c

TODO: keep all other AFP Set File Information bits rejected until their write-safe mapping to NetWare/DOS attributes, timestamps, CNID, and resource-fork metadata is designed.
2026-05-30 12:23:03 +02:00

20 lines
717 B
C

#ifndef _NWATALK_H_
#define _NWATALK_H_
#include "net.h"
#define NWATALK_FINDER_INFO_LEN 32
int nwatalk_backend_available(void);
int nwatalk_get_finder_info(const char *path, uint8 *finder_info,
int finder_info_len);
int nwatalk_set_finder_info(const char *path, const uint8 *finder_info,
int finder_info_len);
int nwatalk_get_afp_attributes(const char *path, uint16 *attributes);
int nwatalk_set_afp_attributes(const char *path, uint16 attributes);
int nwatalk_get_resource_fork_size(const char *path, uint32 *resource_size);
int nwatalk_get_entry_id(const char *path, uint32 *entry_id);
int nwatalk_set_entry_id(const char *path, uint32 entry_id);
#endif