Commit Graph

56 Commits

Author SHA1 Message Date
Mario Fetka
6d561b0866 docs: bucket endpoint audit by netware generation 2026-06-01 23:20:57 +02:00
ai
59bfdd65b2 afp: persist ProDOS info metadata
All checks were successful
Source release / source-package (push) Successful in 52s
2026-06-01 11:51:05 +02:00
ai
92b0c4a34a afp: add deleted file Macintosh info endpoint
All checks were successful
Source release / source-package (push) Successful in 55s
2026-06-01 11:07:43 +02:00
test
396dd8e66f ncp: inline salvage endpoint parsing in cases
All checks were successful
Source release / source-package (push) Successful in 1m0s
2026-05-31 21:50:16 +02:00
test
54181247b1 ncp: merge salvage endpoint wrappers 2026-05-31 21:33:25 +02:00
OpenAI
6b2c9f99f8 ncp: keep 87 salvage handlers local 2026-05-31 21:30:54 +02:00
OpenAI
4bfb1a46bd ncp: add legacy salvage endpoints 2026-05-31 21:05:29 +02:00
Test
e47a745d0b salvage: match scan entries by directory base
All checks were successful
Source release / source-package (push) Successful in 56s
2026-05-31 20:14:41 +02:00
Review Bot
cb0967c7e1 salvage: reuse scan path for recover lookup 2026-05-31 20:07:08 +02:00
OpenAI
0e9f65d821 ncp: keep 87 subfunction dispatch in namespace handler
All checks were successful
Source release / source-package (push) Successful in 54s
2026-05-31 19:50:34 +02:00
Mario Fetka
23be038087 NCP 87/17 Recover Salvageable File
All checks were successful
Source release / source-package (push) Successful in 58s
2026-05-31 19:39:29 +02:00
Test
51ae60a6f8 salvage: add initial NCP scan endpoint
All checks were successful
Source release / source-package (push) Successful in 57s
2026-05-31 18:06:51 +02:00
test
5d574078ff salvage: add recycle filters and versioning
All checks were successful
Source release / source-package (push) Successful in 53s
2026-05-31 15:54:51 +02:00
OpenAI
afa4a00f39 salvage: parse recycle behaviour flags 2026-05-31 15:31:04 +02:00
OpenAI
34c9e2a6ed salvage: reserve low ini range for recycle options 2026-05-31 15:23:37 +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
Mario Fetka
fa96ebb264 nwatalk: use standalone mars_nwe AFP xattr backend 2026-05-31 06:15:03 +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
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
Mario Fetka
eb2983bc1a nwconn: implement AFP entry id path lookup
All checks were successful
Source release / source-package (push) Successful in 48s
Wire NCP 0x23/0x0c AFP Get Entry ID From Path Name to a real path lookup when the optional Netatalk/libatalk backend is available.

The WebSDK documents NCP 0x2222/35/12 as converting a NetWare directory handle plus short-name path string into a unique 32-bit Macintosh file or directory Entry ID. The request carries the AFP subfunction, NetWare directory handle, path length, and path string; the reply carries the 4-byte AFP Entry ID. The SDK headers expose the same operation as AFPGetEntryIDFromPathName() and NWAFPGetEntryIDFromPathName(), and NWAFPSupported() uses this path-name probe to test AFP support.

Resolve the NetWare directory handle and path through the existing mars_nwe path machinery, require the optional libatalk backend before returning AFP success, and then ask libatalk for an AppleDouble/CNID-style id when available. If libatalk is present but the file has no stored id yet, return a deterministic stat-derived local entry id as a temporary fallback so the path-name probe can succeed without inventing NetWare directory base numbers.

Keep all other AFP subfunctions returning invalid namespace for now. They still need Finder Info, resource fork, AFP file information, fork open, and persistent CNID/directory-id support before they can safely report success.

Add the SDK request/reply semantics to the inline endpoint comments and keep the remaining AFP work tracked in TODO.md.

This implements only the AFP path-to-entry-id probe; it does not add general AFP file or resource-fork semantics yet.
2026-05-30 01:45:58 +02:00
Mario Fetka
771dfb0d39 Add Missing netatalk files
All checks were successful
Source release / source-package (push) Successful in 48s
2026-05-30 01:30:05 +02:00
Mario Fetka
13737d03c3 build: add optional Netatalk libatalk backend hook
Some checks failed
Source release / source-package (push) Failing after 41s
Add an opt-in CMake hook for Netatalk/libatalk and a small nwconn-side helper
layer for future AFP/Mac namespace work.

NetWare AFP NCP 0x23 calls still have to be decoded and answered by MARS-NWE;
libatalk is not used as an afpd proxy. Instead, expose local helper wrappers
that can read AppleDouble/Finder Info metadata and resource-fork sizes from a
backing Unix path when libatalk is available.

The WebSDK documents the AFP calls as NetWare server entry points for Mac
namespace semantics, and the SDK headers expose probes such as NWAFPSupported()
plus AFP entry-id and file-information calls. Those calls require AFP entry
IDs, Finder Info, resource forks, and per-volume Mac namespace state before
MARS-NWE can return success.

Keep NCP 0x23 returning invalid namespace for now, but record whether the
libatalk metadata backend was compiled in when rejecting AFP calls. Update
TODO.md to track the remaining NetWare AFP implementation work on top of the
new backend hook.

This adds build-time integration and local metadata helpers only; it does not
change AFP protocol behavior.
2026-05-30 01:25:55 +02:00
Mario Fetka
c80861b92b nwconn: implement extracted base handle restore
All checks were successful
Source release / source-package (push) Successful in 54s
Wire NCP 0x16/0x17 Extract a Base Handle and NCP 0x16/0x18 Restore an
Extracted Base Handle to connection-local directory-handle state.

The WebSDK documents NCP 0x2222/22/23 as taking a DirectoryHandle and
returning a 14-byte save buffer composed of a 10-byte ServerNetworkAddress
plus a 4-byte HandleID. The same documentation describes NCP 0x2222/22/24 as
taking that saved ServerNetworkAddress/HandleID pair and returning a
NewDirectoryHandle plus AccessRightsMask.

The SDK headers expose these calls as NWSaveDirectoryHandle() and
NWRestoreDirectoryHandle(), with the save buffer explicitly documented as 14
bytes. The Rust nwserver and lwared references do not implement this older
save/restore pair, and newer clients typically use the normal allocate/set
directory-handle calls instead, so keep the MARS-NWE HandleID opaque and
connection-local rather than guessing a global NetWare directory-base number.

Store extracted base-handle IDs in a small per-connection table that records
the saved volume/path tuple. Extract requires a live permanent directory
handle, and Restore validates the saved server address against this server
before allocating a new permanent directory handle for the saved path.

Add the SDK request/reply semantics to the inline endpoint comments and remove
the corresponding TODO entry.

This enables the documented endpoint path while keeping the saved HandleID
conservative and private to MARS-NWE.
2026-05-30 00:12:31 +02:00
Mario Fetka
0994605aa8 nwshare: track physical-record set entries
Add physical-record entries to the shared synchronization set table.

The Novell SDK documents the physical-record set calls as operating on the
caller's logged data byte range table: Log Physical Record adds byte ranges,
Lock Physical Record Set locks all logged ranges, Release Physical Record Set
unlocks them while keeping them logged, and Clear Physical Record Set unlocks
and removes them.

MARS-NWE already used the shared set handler for file and logical-record sets.
Extend the same table with type 4 entries for physical records, storing the
NetWare file handle, start offset, record length, timeout, lock directive, and
current locked state.

Add a type 4 handler that reuses nw_log_physical_record() for set lock and
release operations, and export share_set_physrec_add_rm() so nwconn can
maintain the set table when individual physical-record calls log or clear
ranges.

This prepares the documented Physical Record Set endpoints to use the existing
byte-range lock implementation.
2026-05-29 23:21:19 +02:00
Mario Fetka
44a309de40 nwserv: escape SAP names in debug logs
All checks were successful
Source release / source-package (push) Successful in 45s
SAP service names are fixed-size 48-byte fields and are not guaranteed to be
safe C strings in diagnostics.  Some NetWare 6.5 SAP service types advertise
non-printable or high-bit bytes in the name field, which made the debug log
hard to read and could run past the intended protocol field if logged with a
plain %s.

Add bounded formatting for SAP names used in debug output.  Stop at NUL within
the fixed field, keep printable ASCII unchanged, and escape other bytes as
\\xNN.

This is logging-only and does not change SAP/RIP protocol behavior.
2026-05-29 21:51:57 +02:00
Mario Fetka
dd91d45beb cmake: add ENABLE_BURSTMODE option
All checks were successful
Source release / source-package (push) Successful in 48s
Expose the existing experimental Packet Burst code through a CMake option.

Generate ENABLE_BURSTMODE in config.h from -DENABLE_BURSTMODE instead of
keeping it hard-coded to 0, and print the selected state during configuration.

Also fix the existing nwconn burst dispatch conditional so the source compiles
when ENABLE_BURSTMODE is enabled.

This only makes the existing Packet Burst code build-selectable; it does not
change the default behavior, which remains disabled.
2026-05-29 19:12:55 +02:00
Mario Fetka
55be945c02 nwqueue: implement change queue job entry
All checks were successful
Source release / source-package (push) Successful in 47s
Implement the Queue Change Job Entry endpoint for both the old NCP 17/6d
and newer NCP 17/7b variants.

Parse the queue job structure, look up the selected job by its job number,
and update the mutable job metadata fields while preserving server-managed
state such as client identity, entry time, job number, queue position, file
name/handle and servicing information.

Allow the job creator to update the standard user-changeable fields and allow
SUPERVISOR or Q_OPERATORS members to update the operator hold flag as well.
Return the documented queue/job/right/servicing completion codes for missing
queues, missing jobs, insufficient rights and jobs already being serviced.

This only updates NetWare queue metadata. It does not change the existing
Q_UNIX_PRINT/lp backend behavior and adds no CUPS dependency.
2026-05-29 17:13:47 +02:00
Mario Fetka
9f4f8fcbfe nwbind: implement NCP 17/4c list object relations
All checks were successful
Source release / source-package (push) Successful in 44s
Implement the Bindery "List Relations of an Object" endpoint.

Parse the NCP 17 subfunction 0x4c request, look up the requested bindery
object and set property, and return up to 32 related object IDs from the set
property value segments. Support the Novell last-seen cursor convention where
0xffffffff starts a new scan and subsequent calls continue after the last
returned object ID.

Add a small nwdbm helper for listing set-property members while preserving the
existing bindery property read-right checks. Reject wildcard object names with
the documented illegal-wildcard completion code.
2026-05-29 15:49:54 +02:00
Mario Fetka
e0fcd4809e nwbind: implement additional broadcast message calls
All checks were successful
Source release / source-package (push) Successful in 50s
Add the missing NCP 21 message service endpoints for disabling/enabling
broadcast reception and for the newer send/get broadcast message calls.

Track a per-connection broadcast_disabled flag and use a shared helper for
storing pending broadcast messages and notifying the target nwconn process.
The old NCP 21/00 send path now uses the same helper as the newer NCP 21/10
path.

Also improve UNKNOWN FUNCTION logging in nwconn.c by including the NCP type,
function and, where available, subfunction. This makes future missing-endpoint
logs easier to map back to SDK/NCP documentation.

Based on the existing MARS-NWE message handling, the old lwared broadcast
implementation, and the Novell WebSDK message service layouts.
2026-05-29 14:35:33 +02:00
Mario Fetka
3bf16d1e42 NCP22/25 modifierID
All checks were successful
Source release / source-package (push) Successful in 36s
2026-05-25 22:46:37 +02:00
Mario Fetka
cc144f60d0 NCP22/25 Create-Date/Create-Time/Creator-ID über xattr speichern
All checks were successful
Source release / source-package (push) Successful in 35s
2026-05-25 22:13:48 +02:00
Mario Fetka
b031402933 Archive-xattr-Patch
All checks were successful
Source release / source-package (push) Successful in 41s
2026-05-25 21:07:46 +02:00
Mario Fetka
cb63088676 Directory Rename/Move über NCP22/2E
All checks were successful
Source release / source-package (push) Successful in 37s
2026-05-25 18:13:31 +02:00
Mario Fetka
d9f7d226b9 fist implementation NCP23/F4 / F3
All checks were successful
Source release / source-package (push) Successful in 38s
2026-05-25 15:48:45 +02:00
Mario Fetka
0bc4a4b9c5 grant/revoke Request-Layout
All checks were successful
Source release / source-package (push) Successful in 46s
2026-05-25 14:11:06 +02:00
Mario Fetka
2c21eb77fd NCP22/4 Modify Maximum/Inherit Rights Mask
All checks were successful
Source release / source-package (push) Successful in 44s
2026-05-25 13:12:19 +02:00
Mario Fetka
e817405919 feat: add DOS long-name alias support 2026-05-24 00:50:32 +02:00
Mario Fetka
279231550b Add missing ipx header and fix xsockrt and ftrustee build issues 2026-04-20 23:39:42 +02:00
Mario Fetka
33d1da469a Tighten string helper prototypes and quiet pointer-sign warnings 2026-04-20 23:39:42 +02:00
Mario Fetka
f0bfd5a641 Clean up emutli warnings and libc feature macros 2026-04-20 23:39:42 +02:00
Mario Fetka
368b36eb95 Fix 64-bit filesystem and type handling 2026-04-20 23:39:42 +02:00
Mario Fetka
37171bcc17 update release fix cmake 2023-05-31 20:55:37 +02:00