Implement the WebSDK AFP Set File Information Backup Date/Time request bitmap as a narrow metadata write that reuses mars_nwe's existing archive metadata helper instead of adding a new AFP-specific storage path.
The AFP Attributes word already maps Archive through the NetWare FILE_ATTR_A path; Backup Date/Time is a separate SetInfo field and belongs in the existing nwarchive.c archive date/time metadata. Include nwarchive.h in nwconn, fill the AFP information record's Backup Date/Time fields from mars_nwe_get_archive_info(), and accept the SetInfo 0x2000 bitmap by calling mars_nwe_set_archive_info() after the normal AFP path resolution and Modify-rights gate.
Extend the Linux Set File Information smoke helper with --backup-time-epoch/--backup-time-only, verify the returned 120-byte file information record at offsets 28/30, and have afp_smoke_suite.sh dump user.org.mars-nwe.netware.archive so reports prove that the WebSDK field is stored through the NetWare archive metadata path.
Tests: git diff --check; bash -n tests/linux/afp_smoke_suite.sh; gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_set_file_info_smoke.c
After aligning AFP Set File Information with the WebSDK attribute word,
Hidden, System, and Archive are represented by the existing NetWare
attribute store instead of org.mars-nwe.afp.attributes. The default smoke
path can therefore legitimately have no AFP-only attribute xattr once those
bits are cleared or mapped away.
Update afp_smoke_suite.sh to treat the AFP-only attributes xattr dump as
optional while still reporting the getfattr output. FinderInfo and Entry
ID xattrs remain mandatory because they are still AFP-specific metadata
stores.
Tests: bash -n tests/linux/afp_smoke_suite.sh
The WebSDK/NCP AFP File Information records use a distinct SetInfo request bitmap and attribute word. The previous smoke-oriented implementation reused the low response-bit positions for Set Attributes, Modify Date/Time, FinderInfo, Hidden/Invisible, System, and Archive. That made the current tests pass, but it was not faithful to the documented header semantics and risked keeping AFP metadata parallel to existing NetWare attributes.
Switch Set File Information to the documented request bitmap values: 0x0100 for Attributes, 0x1000 for Modify Date/Time, and 0x4000 for FinderInfo. Switch the AFP attribute word to the documented NetWare-style bits: Hidden 0x0200, System 0x0400, Subdirectory 0x1000, and Archive 0x2000.
Map Hidden, System, and Archive through the existing NetWare attribute store via FILE_ATTR_H, FILE_ATTR_S, and FILE_ATTR_A. This keeps AFP Set/Get/Scan aligned with mars_nwe's existing attribute helper instead of maintaining duplicate AFP-only xattr state. FinderInfo remains AFP metadata and still uses the Modify-rights gate added earlier.
Update the Linux smoke helper and suite to use --hidden / --clear-hidden while keeping --invisible / --clear-invisible as compatibility aliases. Document the corrected WebSDK bit values and the convergence rule that NetWare attributes must use mars_nwe NetWare helpers.
Tests: git diff --check; bash -n tests/linux/afp_smoke_suite.sh; gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_set_file_info_smoke.c
Extend the AFP Set File Information smoke helper with an explicit expected-completion mode so negative WebSDK/NWAFP probes can assert the server completion byte instead of treating any non-zero completion as a helper failure.
Use that support from afp_smoke_suite.sh to add optional Modify-rights negative coverage for AFP metadata writes. When a readonly test user such as NOPASSUSER is supplied, the suite now verifies that FinderInfo and AFP-only Invisible/System xattr writes are rejected with completion 0x8c, matching the mars_nwe trustee/effective-rights Modify policy gate added to afp_set_file_information().
The optional --prepare-readonly-rights mode deliberately reuses the standard ncpfs trustee utilities rather than adding ad-hoc test NCPs: nwrevoke removes an explicit assignment for the readonly user on the smoke target, nwgrant grants only read/file-scan rights, and nwrevoke restores the object to inherited rights after the negative probes. A cleanup trap also revokes the temporary assignment if the suite exits early.
This keeps the AFP smoke harness aligned with the convergence plan: AFP remains an Apple-facing adapter over existing mars_nwe NetWare trustee semantics, while test setup uses existing NetWare administration utilities.
Tests: bash -n tests/linux/afp_smoke_suite.sh; gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_set_file_info_smoke.c; git diff --check
Implement the WebSDK/NWAFP Get DOS Name From Entry ID subfunction (NCP 0x2222/35/18) as a conservative, read-only reverse lookup over mars_nwe's existing volume and AFP metadata infrastructure.
The documented request carries a volume number and 32-bit Macintosh directory entry ID, and the reply returns a length-prefixed DOS path string. mars_nwe's current AFP entry IDs are not the namespace base handles maintained by namspace.c; they are mars_nwe/libatalk AFP metadata IDs cached through nwatalk. Reuse the existing volume table as the search root and nwatalk_get_entry_id() as the identity probe instead of inventing a parallel namespace handle mapping.
The reverse lookup deliberately does not create fallback IDs while walking the volume. It only matches entries that already have mars_nwe or Netatalk AFP metadata, which is the normal smoke-test sequence after Get Entry ID, Get File Information, or Scan File Information has cached the target ID. This keeps the lookup read-only and avoids populating entry-id xattrs across an entire volume as a side effect.
Add a Linux afp_dos_name_smoke helper and wire it into the AFP smoke suite. The helper can resolve the supplied VOL:PATH to an entry ID first, then sends the 0x12 request and verifies the returned path without the volume prefix. The suite continues to exercise the existing path-backed AFP compatibility flow before future create/rename/remove work.
Tests:\n- git diff --check\n- bash -n tests/linux/afp_smoke_suite.sh\n- gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_dos_name_smoke.c\n\nTODO:\n- Replace the volume walk with a real CNID/base-ID index when persistent AFP identity storage grows one.\n- Return true DOS 8.3 aliases once the AFP reverse lookup is wired to the namespace alias helpers rather than preserving the cached path component spelling.
Document and exercise the conservative AFP Open File Fork boundary before adding more destructive AFP write endpoints.
The current NCP 0x2222/35/08 implementation intentionally supports only path-backed data-fork read opens. Resource-fork access still requires AppleDouble/resource-fork semantics, and write-open access must wait for an AFP write-fork path that preserves the existing NetWare share, lock, trustee, and file-handle behavior.
Extend the Linux smoke helper with a generic expected-completion option so unsupported paths can be asserted as successful negative coverage rather than treated as ad-hoc failures. The smoke suite now checks that write-open requests return 0x84 and resource-fork opens return 0x9c while the positive data-fork read-open path remains unchanged.
This keeps the currently incomplete Open File Fork semantics explicit before moving on to Create/Rename/Remove. It also gives Gitea reviewers a small incremental diff: helper option parsing, two suite probes, and README/TODO status updates only.
Tests:
- git diff --check
- bash -n tests/linux/afp_smoke_suite.sh
- gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_open_file_fork_smoke.c
TODO:
- Implement AFP write-open semantics only after the server can route them through the existing NetWare handle/share/lock code paths.
- Implement resource-fork opens only after AppleDouble/libatalk resource-fork storage semantics are available.
The NWAFP Set File Information attribute word uses a metadata bit that our earlier smoke code called Backup. That name is too easy to confuse with the distinct AFP backup date/time fields in the Set/Get File Information records. Treat the bit consistently as the Archive attribute in the server constants, Netatalk/xattr helper mask, Linux smoke helper, smoke suite, and documentation.
Keep --backup and --clear-backup as compatibility aliases in afp_set_file_info_smoke so existing local invocations continue to work, but make the generated suite use --archive and --clear-archive. The source-level xattr payload remains unchanged: org.mars-nwe.afp.attributes still stores the same versioned attribute word and bit value 0x0040.
Tests: git diff --check; bash -n tests/linux/afp_smoke_suite.sh; gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_set_file_info_smoke.c
Extend the conservative AFP Set File Information implementation to accept the file modification timestamp bitmap for path-backed file requests. The WebSDK/NWAFP Set File Information payload carries the timestamp in the same bitmap-ordered parameter stream as file attributes and FinderInfo, so the parser now admits the documented modification timestamp field while continuing to reject every other Set File Information bitmap bit.
Do not implement a new AFP-specific timestamp backend. After resolving the raw VOL:-style smoke path to the effective mars_nwe volume and Unix path, convert the AFP/NW DOS date+time fields to time_t and route the update through the existing nw_utime_node() helper. That keeps trustee Modify-right checks and the established utime(2) fallback behavior shared with classic NetWare/NCP timestamp updates.
Keep the implementation deliberately file-only and path-backed. Directory timestamps, create/access/backup timestamp fields, Entry-ID-only Set File Information, resource-fork semantics, DOS attribute mapping, Delete, Rename, Create, and Remove stay TODO so later patches can wire them to the existing NetWare helpers with focused smoke coverage.
Update afp_set_file_info_smoke with --mtime-epoch and --timestamp-only, verify the written AFP date/time via the follow-up Get File Information record, and extend afp_smoke_suite.sh to run the timestamp probe and record the backing Linux stat output. The suite helper is already copied as a build target, so the new test is propagated into the build tree by the normal tests build.
Tests:
- git diff --check
- bash -n tests/linux/afp_smoke_suite.sh
- gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_set_file_info_smoke.c
Extend the Linux AFP smoke-suite helper so the legacy AFP Set File Information subfunction 0x09 is covered for the narrow metadata attribute write path as well as FinderInfo.
The server now routes both WebSDK/NWAFP Set File Information entry points, 0x09 and AFP 2.0 0x10, through the same conservative path-backed implementation. The helper already supports selecting 0x09, but the suite only executed the legacy FinderInfo probe. Add legacy Invisible set/clear probes so the suite verifies that 0x09 also preserves the SETCLR bit semantics used by the AFP attribute xattr store.
Keep the coverage deliberately small: FinderInfo plus Invisible/System/Backup remain metadata-only xattr writes, while enforcement-sensitive attributes, timestamps, resource forks, create/delete/rename, and entry-id-only write lookup stay unsupported.
Tests: bash -n tests/linux/afp_smoke_suite.sh
Tests: git diff --check
Wire the older WebSDK/NWAFP Set File Information subfunction (0x09) through the same deliberately narrow metadata-write implementation as AFP 2.0 Set File Information (0x10). Both subfunctions now accept the path-backed VOL:-style smoke subset and persist only FinderInfo plus the metadata-only Invisible/System/Backup AFP attribute bits through mars_nwe's org.mars-nwe.afp.* xattrs.
This keeps the implementation conservative: 0x09 does not add timestamp writes, DOS/NetWare mode-bit mapping, create/delete/rename behavior, fork-write semantics, or entry-id-only lookup. It simply exposes the same already-tested FinderInfo/attribute payload semantics to clients that issue the legacy AFP Set File Information opcode.
Update the Linux smoke helper with --afp09/--afp20 selection and include the legacy FinderInfo probe in afp_smoke_suite.sh so future reports cover both write opcodes automatically.
Tests:
- bash -n tests/linux/afp_smoke_suite.sh
- gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_set_file_info_smoke.c
- git diff --check
The AFP Set File Information smoke coverage now includes the additional metadata-only file attribute bits implemented after the original FinderInfo and Invisible checks. Extend the collectable Linux smoke-suite helper so a single report covers FinderInfo, Invisible set/clear, System set/clear, and Backup set/clear before dumping the mars_nwe AFP xattrs.
This keeps the helper aligned with the WebSDK/NWAFP attribute bitmap semantics exercised by afp_set_file_info_smoke: the Attributes request bitmap remains 0x0001, while the request attribute word uses SETCLR when setting System or Backup and the plain bit when clearing. The suite clears each tested bit again so repeated runs normally leave org.mars-nwe.afp.attributes in the clean versioned zero state.
Document the runtime probes reported from SYS:PUBLIC/pmdflts.ini, including the AFP-visible attrs values and the server diagnostics that show the encoded SETCLR forms. Also update TODO so the current smoke status states that the report helper now follows the supported FinderInfo plus Invisible/System/Backup metadata subset.
Tests:\n- bash -n tests/linux/afp_smoke_suite.sh\n- git diff --check\n\nTODO:\n- Keep rejecting the rest of AFP Set File Information until timestamp, enforcement, DOS/NetWare mapping, resource-fork, and entry-id-only write semantics are designed.
Add an optional Linux-side AFP smoke-suite shell helper that runs the
currently verified AFP NCP 0x2222/35 probes as a single collectable report.
The helper is intended for the same ncpfs/libncp smoke workflow as the
individual C helpers, but it groups the read-only probes, the narrow Set File
Information metadata writes, Linux xattr verification, and a filtered AFP
server-log excerpt so runtime results can be pasted back into follow-up
test-status patches.
Keep the command lines safe to share by masking the password in the printed
report while still passing the real value to the helpers. Parameterize the
server, user, password, NetWare path, Unix path, mars_nwe log file,
FinderInfo type/creator, and output file so the script can be used against
SYS:PUBLIC as well as other exported volumes.
Copy the script into the CMake binary tests/linux directory when
MARS_NWE_BUILD_LINUX_TESTS is enabled, preserving executable permissions. The
script does not add new AFP semantics; it only automates the existing helpers
and documents the Linux xattr names used by the mars_nwe AFP metadata wrapper.
Tests:
- bash -n tests/linux/afp_smoke_suite.sh
- ./tests/linux/afp_smoke_suite.sh --help
- git diff --check