Commit Graph

166 Commits

Author SHA1 Message Date
Mario Fetka
05f9c4d0de salvage: require bundled static yyjson
Some checks failed
Source release / source-package (push) Failing after 11m41s
2026-05-31 14:03:01 +02:00
ChatGPT
3fb45fd624 salvage: hook delete path through nwsalvage
All checks were successful
Source release / source-package (push) Successful in 55s
2026-05-31 13:35:58 +02:00
Mario Fetka
5fc5a5218f salvage: preserve trustee metadata
All checks were successful
Source release / source-package (push) Successful in 52s
2026-05-31 12:37:40 +02:00
Mario Fetka
ce34e2df65 salvage: preserve xattr backed metadata 2026-05-31 12:32:44 +02:00
Mario Fetka
2c089f5fe3 salvage: expand metadata schema for server fields
All checks were successful
Source release / source-package (push) Successful in 58s
2026-05-31 12:27:44 +02:00
Mario Fetka
054ea6c867 salvage: add yyjson metadata helpers 2026-05-31 11:49:57 +02:00
Mario Fetka
5d0c665b52 salvage: load config through ini getter 2026-05-31 11:34:50 +02:00
Mario Fetka
47709fe935 salvage: add repository path helpers 2026-05-31 11:27:49 +02:00
Mario Fetka
bedec0d2c0 salvage: add initial config helper 2026-05-31 11:27:39 +02:00
OpenAI
ac79fa9d22 nwconn: support AFP scan from directory entry IDs
All checks were successful
Source release / source-package (push) Successful in 47s
2026-05-31 09:03:43 +02:00
Mario Fetka
63ee154c89 tests: drop transient AFP SetInfo layout markers 2026-05-31 07:49:27 +02:00
Mario Fetka
6230aa1d7c nwconn: resolve AFP entry-id-relative name lookups 2026-05-31 07:38:15 +02:00
Mario Fetka
77a40f9ed2 nwconn: share AFP entry-id resolver with metadata paths 2026-05-31 06:44:56 +02:00
Mario Fetka
fa96ebb264 nwatalk: use standalone mars_nwe AFP xattr backend 2026-05-31 06:15:03 +02:00
a
1cec6a64aa nwconn: resolve AFP open fork entry ids through nwatalk metadata 2026-05-30 23:29:25 +02:00
Mario Fetka
330d20a0e1 nwconn: route AFP open fork writes through NetWare opens 2026-05-30 23:13:51 +02:00
Mario Fetka
f0864c1150 nwconn: align AFP get and scan info layouts with WebSDK 2026-05-30 22:58:06 +02:00
a
e08ce594b5 nwconn: require WebSDK AFP set file information layout
All checks were successful
Source release / source-package (push) Successful in 48s
2026-05-30 22:40:58 +02:00
Mario Fetka
211d04ea62 nwconn: accept WebSDK AFP set file information layout 2026-05-30 22:35:35 +02:00
a
bcacd6142d nwconn: search files only for AFP file rename
All checks were successful
Source release / source-package (push) Successful in 48s
2026-05-30 22:20:33 +02:00
a
02e247b133 nwconn: implement AFP rename through NetWare move paths 2026-05-30 22:10:02 +02:00
Test
4183a63689 nwconn: implement AFP delete through NetWare remove paths 2026-05-30 21:55:14 +02:00
Mario Fetka
37039a773f nwconn: implement AFP create file through NetWare file creation
All checks were successful
Source release / source-package (push) Successful in 49s
2026-05-30 21:36:03 +02:00
Mario Fetka
9032848c9a nwconn: keep AFP file entry IDs on nwatalk fallback
All checks were successful
Source release / source-package (push) Successful in 47s
2026-05-30 21:00:20 +02:00
Mario Fetka
d1a7780532 nwconn: implement AFP create directory through NetWare directory creation
All checks were successful
Source release / source-package (push) Successful in 48s
2026-05-30 20:46:29 +02:00
Mario Fetka
f9c7a795df nwconn: align AFP endpoint names with WebSDK
All checks were successful
Source release / source-package (push) Successful in 48s
2026-05-30 20:39:14 +02:00
Mario Fetka
faa44d060b nwconn: derive AFP entry ids from NetWare handles
All checks were successful
Source release / source-package (push) Successful in 45s
2026-05-30 20:15:06 +02:00
OpenAI
a18de6abd2 nwconn: derive AFP access privileges from trustees
All checks were successful
Source release / source-package (push) Successful in 47s
2026-05-30 19:50:25 +02:00
Mario Fetka
34504f1381 Fix Compile
All checks were successful
Source release / source-package (push) Successful in 46s
2026-05-30 19:33:57 +02:00
Mario Fetka
31a9234c8b nwconn: route AFP access timestamps through atime
All checks were successful
Source release / source-package (push) Successful in 48s
2026-05-30 19:27:38 +02:00
OpenAI
b442500ef9 nwconn: route AFP create timestamps through nwarchive fileinfo
All checks were successful
Source release / source-package (push) Successful in 50s
2026-05-30 19:18:35 +02:00
OpenAI
bbc37565c8 nwconn: route AFP backup timestamps through nwarchive
All checks were successful
Source release / source-package (push) Successful in 48s
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
2026-05-30 18:21:54 +02:00
OpenAI
55fdf64c8e nwconn: align AFP attribute bits with WebSDK
All checks were successful
Source release / source-package (push) Successful in 46s
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
2026-05-30 17:48:51 +02:00
OpenAI
dacfc0f7a1 nwconn: gate AFP metadata writes with Modify rights
All checks were successful
Source release / source-package (push) Successful in 54s
AFP Set File Information intentionally stores some Apple-specific metadata in mars_nwe-owned xattrs because FinderInfo and the narrow Invisible/System AFP bits do not have a complete NetWare-side representation yet.  Those xattrs are storage details, however, and should not let the AFP adapter bypass the same NetWare policy that protects ordinary metadata changes.

Add a small Modify-rights gate for AFP-specific metadata writes after the path-backed request has been resolved to a mars_nwe volume and Unix node.  The check uses the existing trustee/effective-rights helper with TRUSTEE_M before writing FinderInfo or AFP-only attribute xattrs.  Archive remains routed through the NetWare FILE_ATTR_A attribute helper, and Modify timestamp remains routed through nw_utime_node(), so their existing mars_nwe policy paths are unchanged.

This keeps the WebSDK/NWAFP Set File Information handler as an Apple-facing adapter over existing mars_nwe access control rather than a parallel metadata writer.  It also documents the convergence rule in TODO.md so later Create, Rename, and Delete work can continue to prefer existing NetWare helpers or thin wrappers over duplicated AFP-local file server logic.

Tests: git diff --check

TODO: add non-SUPERVISOR negative smoke coverage for missing Modify rights once a stable low-privilege test user and trustee setup are available.
2026-05-30 16:59:47 +02:00
OpenAI
b768c921c8 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
2026-05-30 16:43:16 +02:00
OpenAI
7241a28393 nwconn: implement AFP DOS name reverse lookup
All checks were successful
Source release / source-package (push) Successful in 50s
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.
2026-05-30 16:08:30 +02:00
OpenAI
3675b30d43 nwconn: fix AFP archive attribute set mask scope
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.
2026-05-30 15:36:54 +02:00
OpenAI
51c04f148f nwconn: map AFP archive to NetWare attributes
All checks were successful
Source release / source-package (push) Successful in 57s
Route the AFP Set File Information Archive attribute through the existing NetWare attribute store instead of treating it as another mars_nwe AFP metadata xattr bit. The previous rename from Backup to Archive fixed the WebSDK naming, but the implementation still stored Archive together with Finder Invisible/System under org.mars-nwe.afp.attributes. That would duplicate NetWare's existing FILE_ATTR_A state and bypass the attribute path that already owns trustee Modify checks and volume attribute semantics.

Keep Finder Invisible and System as the narrow AFP metadata-only xattr bits for now, but strip Archive from nwatalk's xattr mask. AFP Get/Scan File Information now merges the AFP Archive bit from get_nw_attrib_dword(FILE_ATTR_A), while AFP Set File Information uses set_nw_attrib_word() for Archive set/clear. This reuses the existing nwattrib.c path, including TRUSTEE_M checks, instead of adding a new nwarchive.c flag. The org.mars-nwe.netware.archive xattr remains reserved for archive date/time/archiver metadata.

Tests: gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_set_file_info_smoke.c; bash -n tests/linux/afp_smoke_suite.sh; git diff --check

TODO: verify the updated archive mapping with afp_smoke_suite.sh and confirm that Archive set/clear is reflected by AFP Get File Information while user.org.mars-nwe.afp.attributes remains limited to Invisible/System.
2026-05-30 15:31:56 +02:00
OpenAI
068afd5d8a nwconn: rename AFP backup attribute to archive
All checks were successful
Source release / source-package (push) Successful in 51s
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
2026-05-30 14:47:32 +02:00
OpenAI
63f5fa699a nwconn: route AFP set file timestamps via NetWare helper
All checks were successful
Source release / source-package (push) Successful in 51s
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
2026-05-30 14:29:24 +02:00
OpenAI
73d4a61a11 nwconn: route legacy AFP set file information
All checks were successful
Source release / source-package (push) Successful in 47s
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
2026-05-30 13:14:22 +02:00
ChatGPT
cfd036e54c nwconn: persist additional AFP metadata attributes
All checks were successful
Source release / source-package (push) Successful in 49s
Extend the conservative AFP 2.0 Set File Information smoke path to accept the metadata-only System and Backup file attribute bits alongside the already-supported Finder Invisible bit.

The WebSDK/NWAFP Set File Information request uses the file Attributes bitmap to pass a set/clear attribute word. Netatalk stores several AFP file attributes in AppleDouble metadata while computing open-fork state dynamically and leaving enforcement-sensitive bits to the file/fork paths. Mirror only the low-risk mars_nwe subset here: persist Invisible, System, and Backup in the private org.mars-nwe.afp.attributes xattr, and keep NoWrite, NoRename, NoDelete, NoCopy, data-fork-open, resource-fork-open, timestamps, resource forks, and Entry-ID-only write semantics rejected until they have deliberate enforcement and backend design.

The xattr payload remains versioned and unchanged. Reads now expose the three supported metadata bits through Get/Scan File Information, and writes preserve the existing set/clear semantics over the supported mask.

Update the Linux Set File Information smoke helper with --system/--clear-system and --backup/--clear-backup options, while keeping the smoke-suite default unchanged. Document the expected Linux xattr forms 0x01000004 and 0x01000040 for those optional probes.

Tests: git diff --check; gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_set_file_info_smoke.c.
2026-05-30 12:55:25 +02:00
OpenAI
c51fde95fe nwconn: persist AFP invisible file attributes
All checks were successful
Source release / source-package (push) Successful in 47s
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
OpenAI
4637f3ee57 nwatalk: cache AFP fallback entry ids in xattrs
All checks were successful
Source release / source-package (push) Successful in 48s
The AFP smoke endpoints can now read mars_nwe-owned entry ids from the versioned org.mars-nwe.afp.entry-id xattr, but a newly discovered file still had to fall back to the temporary stat-derived id on every request until a real CNID allocator exists.

Preserve the existing WebSDK/NWAFP response semantics while making that fallback sticky: when Get Entry ID, Get File Information, or Scan File Information has no mars_nwe xattr and no Netatalk/libatalk AppleDouble/CNID id, derive the existing compatibility id and cache it through nwatalk_set_entry_id().  The first request still logs fallback so diagnostics remain honest about the id origin; subsequent requests should read the xattr directly and avoid re-entering the stat fallback path.

Keep the write narrowly scoped to mars_nwe's private AFP metadata namespace.  The payload is versioned, big-endian, and stored through the nwxattr helper, so Linux persists it as user.org.mars-nwe.afp.entry-id while source-level code continues to use the Netatalk-style org.mars-nwe.afp.entry-id name.  This does not implement CNID allocation, parent-id lookup, entry-id-only resolution, FinderInfo mutation beyond the existing smoke path, or resource-fork semantics.

Tests:

- git diff --check

- cmake --build build-xattr-off --target nwconn with ENABLE_NETATALK_LIBATALK=OFF

- cmake --build build-xattr-on --target nwconn with ENABLE_NETATALK_LIBATALK=ON against Netatalk 4.4.3 headers plus local link stubs
2026-05-30 11:56:43 +02:00
OpenAI
b8016f99a3 nwarchive: scope private xattrs under NetWare namespace
All checks were successful
Source release / source-package (push) Successful in 48s
Move the mars_nwe NetWare-core archive/fileinfo xattr names from the flat org.mars-nwe namespace into an explicit org.mars-nwe.netware subnamespace.

The earlier xattr namespace cleanup intentionally removed the unreleased user.mars_nwe names and introduced Netatalk-style org.mars-nwe source-level keys.  Keeping archive and fileinfo at org.mars-nwe.archive and org.mars-nwe.fileinfo would make those NetWare server metadata records peers of AFP metadata instead of identifying their ownership.  The archive date/time/archiver and file create/creator/modifier records are NetWare-core file metadata, so place them under org.mars-nwe.netware.* while leaving AFP metadata under org.mars-nwe.afp.*.

No legacy fallback is added because the old names only existed in local test systems and have not been released.  The existing nwxattr wrapper still maps source-level org.mars-nwe.<domain>.* names to user.org.mars-nwe.<domain>.* on Linux, mirroring Netatalk's org.netatalk.* EA abstraction.

Tests: git diff --check

TODO: keep future nwbind/nwserv/AFP metadata in explicit org.mars-nwe.<domain>.* subnamespaces instead of adding new flat org.mars-nwe.* keys.
2026-05-30 11:41:43 +02:00
OpenAI
995a1e6cd7 nwconn: add AFP FinderInfo set smoke path
All checks were successful
Source release / source-package (push) Successful in 49s
Implement a deliberately narrow write-safe slice of the WebSDK/NWAFP Set File Information semantics for the NCP 0x2222/35/16 AFP 2.0 Set File Information call.

The only accepted request bitmap is the FinderInfo bit (0x0020). The handler uses the same path-backed raw VOL:-style compatibility subset as the existing AFP get, scan, open-fork, and temporary-directory-handle smoke endpoints, resolves the effective NetWare volume from the path prefix, rejects entry-id-only lookup until persistent CNID/base-ID mapping exists, and rejects directory or non-FinderInfo writes rather than pretending to implement DOS attribute, timestamp, delete-protect, resource-fork, or broader Mac namespace write semantics.

Store the 32-byte FinderInfo block in mars_nwe-owned metadata under the source-level xattr name org.mars-nwe.afp.finder-info and teach the existing AFP file-info response builder to read that value before falling back to Netatalk/libatalk AppleDouble FinderInfo. This makes the write immediately verifiable through AFP 2.0 Get File Information without changing data-fork or resource-fork contents.

Add a small local xattr abstraction for mars_nwe-private metadata names. Netatalk exposes names such as org.netatalk.Metadata at the libatalk layer, but prefixes them with user. on Linux inside its EA wrapper. Mirror that behavior for mars_nwe so source code and documentation use org.mars-nwe.* consistently while Linux stores user.org.mars-nwe.* where the kernel requires a namespace prefix. Convert the existing archive/fileinfo xattr calls to the same wrapper so the previous org.mars-nwe.* namespace rename remains functional on Linux.

Add tests/linux/afp_set_file_info_smoke, which sends AFP 0x10 with a FinderInfo bitmap, then verifies the result through AFP 0x0f Get File Information. Document the smoke command, expected output, server-log shape, and the remaining unsupported Set File Information write semantics.

Tests: git diff --check; gcc -Iinclude -I/mnt/data/stubs -fsyntax-only tests/linux/afp_set_file_info_smoke.c; cmake --build build-off --target nwconn with ENABLE_NETATALK_LIBATALK=OFF; cmake --build build-on --target nwconn with ENABLE_NETATALK_LIBATALK=ON against Netatalk-4.4.3 headers and local link stubs.
2026-05-30 11:29:33 +02:00
ChatGPT
ca610c1100 nwatalk: probe mars_nwe AFP entry ids from xattrs
All checks were successful
Source release / source-package (push) Successful in 48s
Add the first mars_nwe-owned AFP metadata xattr reader before expanding the AFP write surface.  The new versioned org.mars-nwe.afp.entry-id payload gives the compatibility layer a stable, project-owned namespace for persistent AFP entry ids without reusing the unreleased user.mars_nwe.* test names or pretending that Netatalk-owned org.netatalk.* keys are ours to mutate.

The lookup order remains conservative: an existing mars_nwe entry-id xattr wins, then the optional Netatalk/libatalk AppleDouble/CNID helper is consulted, and the AFP handlers continue to fall back to their stat-derived temporary id when no persistent metadata exists.  No Set File Information, CNID allocation, Finder Info write, or resource-fork write path is introduced here.

This keeps the WebSDK/NWAFP read-only endpoint semantics intact while preparing the metadata storage boundary needed by later AFP Set File Information and CNID work.  ENABLE_NETATALK_LIBATALK=OFF still rejects AFP calls at the handler guard, and the xattr reader has an XATTR_SUPPORT-disabled stub so non-xattr builds keep compiling.

Tests:

- git diff --check

- cmake --build build-xattr-off --target nwconn

- cmake -S . -B build-afp-on -DENABLE_NETATALK_LIBATALK=ON -DCMAKE_PREFIX_PATH=/mnt/data/afp_build_prefix

- cmake --build build-afp-on --target nwconn

TODO:

- Add a deliberate write-safe AFP metadata writer/allocator before enabling AFP 2.0 Set File Information.

- Decide whether future mars_nwe AFP metadata stays split across org.mars-nwe.afp.* keys or moves into a compact org.mars-nwe.afp.metadata record.
2026-05-30 11:11:15 +02:00
ChatGPT
a586e52b25 nwarchive: move private xattrs to org namespace
All checks were successful
Source release / source-package (push) Successful in 49s
Rename the unreleased mars_nwe private archive and file-info extended-attribute keys from the Linux user.mars_nwe.* spelling to the Netatalk-style org.mars-nwe.* namespace.

This keeps the mars_nwe metadata namespace aligned with the AFP/libatalk backend direction, where Netatalk owns org.netatalk.* keys and mars_nwe-owned metadata should live under org.mars-nwe.* instead of looking like ordinary user application attributes.

No legacy read fallback is added because the user.mars_nwe.* names have only existed in local test builds and have not shipped in a release. New writes therefore use only org.mars-nwe.archive and org.mars-nwe.fileinfo, avoiding migration complexity before AFP metadata persistence is introduced.

Document the namespace decision in TODO.md so future AFP xattr work can build on org.mars-nwe.afp.* or a compact org.mars-nwe.afp.metadata record rather than adding new user.mars_nwe.* keys.

Tests: cmake --build build-xattr-off --target nwserv; cmake --build build-xattr-off --target all reaches the existing missing gdbm.h dependency while nwconn has already been built in this tree.
2026-05-30 11:04:03 +02:00
Mario Fetka
8e739a1ac2 nwconn: route AFP scan file information
All checks were successful
Source release / source-package (push) Successful in 49s
Add the older WebSDK/NWAFP AFP Scan File Information subfunction 0x0a to the AFP dispatcher and route it through the existing conservative directory-scan implementation used by AFP 2.0 Scan File Information 0x11.

The Micro Focus NCP documentation describes both scan variants as read-only directory/file information scans with a Mac base Entry ID, Mac last-seen ID, DesiredResponseCount, SearchBitMap, RequestBitMap, and path modifier.  The mars_nwe compatibility subset still requires a raw path-backed VOL:-style request because persistent CNID/base-ID lookup is not available yet, but accepting 0x0a lets older AFP callers probe the same read-only semantics instead of receiving Invalid Namespace for an otherwise implemented scan shape.

Teach the scan parser to accept the documented DesiredResponseCount word while keeping compatibility with the earlier compact smoke-test layout that omitted it.  For now DesiredResponseCount is logged and constrained by the smoke helper, while the server still returns one conservative file-info record plus the next-last-seen entry id per request.  This avoids pretending to implement full multi-response AFP directory scans before CNID-backed ordering, response-count batching, and AppleDouble metadata are available.

Extend afp_scan_info_smoke with --afp10/--afp20 selection and a documented --desired-count argument.  The helper now sends the WebSDK-style request layout by default, uses 0x11 unless --afp10 is requested, and keeps the existing next_last_seen output used for iterative Linux smoke tests.

Tests:

- git diff --check

- gcc -fsyntax-only tests/linux/afp_scan_info_smoke.c with local ncpfs header stubs

- cmake --build build-off --target nwconn with ENABLE_NETATALK_LIBATALK=OFF

- cmake --build build-on --target nwconn with ENABLE_NETATALK_LIBATALK=ON against Netatalk 4.4.3 headers and local link stubs

TODO:

- Implement persistent CNID/base-ID lookup so entry-id-only scans can work without a raw path.

- Replace the one-record smoke response with true DesiredResponseCount batching once stable CNID ordering and full AFP scan filtering are available.

- Fill richer AppleDouble/Finder/ProDOS/resource-fork metadata when the libatalk backend grows write-safe metadata support.
2026-05-30 10:39:02 +02:00
OpenAI
00060e0e93 nwconn: resolve AFP smoke path volumes
All checks were successful
Source release / source-package (push) Successful in 47s
Resolve the effective NetWare volume for path-backed AFP compatibility requests from the raw VOL: path prefix before opening data forks or allocating temporary directory handles.

The WebSDK/nwafp.h request layouts for AFP 0x08 Open File Fork and AFP 0x0b Alloc Temporary Directory Handle both carry a volume byte plus base AFP Entry ID.  The current mars_nwe smoke subset deliberately keeps Entry-ID-relative lookup disabled, but it accepts raw NetWare-style paths such as SYS:PUBLIC and HOME:LOGIN.  In that path-backed mode, treating dir_handle 0 as volume 0 in diagnostics is too narrow: build_path() already extracts the real volume from the VOL: prefix, and the lower NetWare open/dir-handle helpers use that same resolver internally.

Add a small AFP path-volume resolver wrapper around conn_get_kpl_unxname() and use it in the 0x08 and 0x0b handlers before delegating to nw_creat_open_file() or nw_alloc_dir_handle().  Successful diagnostics now report the resolved effective volume and keep the incoming request volume separately as request_vol, which preserves the header-level request shape without implying that non-SYS paths are opened on volume 0.

This does not add CNID/base-ID lookup, resource-fork handling, or write semantics.  Entry-ID-only requests remain Invalid Path until persistent AFP identity mapping is implemented.  The optional Netatalk/libatalk backend guard remains unchanged; ENABLE_NETATALK_LIBATALK=OFF still rejects these AFP calls with Invalid Namespace before any path-backed work is attempted.

Tests:

- git diff --check

- cmake --build build-off --target nwconn with ENABLE_NETATALK_LIBATALK=OFF

- cmake --build build-on --target nwconn with ENABLE_NETATALK_LIBATALK=ON requested; local tree reports backend disabled because libatalk headers/library are not installed

TODO:

- Runtime-smoke a non-SYS volume such as HOME: to confirm the diagnostic shows the resolved non-zero volume id.

- Replace path-backed smoke lookup with persistent CNID/base-ID lookup when the AFP metadata backend grows that support.
2026-05-30 10:19:18 +02:00