Files
mars-nwe/src/CMakeLists.txt
OpenAI 995a1e6cd7
All checks were successful
Source release / source-package (push) Successful in 49s
nwconn: add AFP FinderInfo set smoke path
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

108 lines
3.4 KiB
CMake

#################################
# Project
##############
#project(mars-nwe)
#################################
# Dependencies
##############
if (CMAKE_SYSTEM_NAME MATCHES Linux)
add_definitions(
-pipe -DLINUX -D_GNU_SOURCE
)
endif (CMAKE_SYSTEM_NAME MATCHES Linux)
add_definitions(
-D_VERS_H_=${VERSION_MAJOR}
-D_VERS_L_=${VERSION_MINOR}
-D_VERS_P_=${VERSION_PATCH}
-DMARS_NWE_BUILD_DATE=\"${MARS_NWE_BUILD_DATE}\"
)
IF(MARS_NWE_QUOTA_SUPPORT)
IF(QUOTA_USE_SYS_QUOTA_H)
add_definitions(
-DQTAINSYS
)
ENDIF(QUOTA_USE_SYS_QUOTA_H)
ENDIF(MARS_NWE_QUOTA_SUPPORT)
IF(GDBM_FOUND)
add_definitions(
-DUSE_GDBM
)
ENDIF(GDBM_FOUND)
#################################
# Compiler Switches
##############
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/include
)
#################################
# Source Files
##############
IF(ENABLE_INTERNAL_RIP_SAP)
SET(EMUTLI emutli.c)
SET(EMUTLI1 emutli1.c)
SET(NWROUTE_0 nwroute.c)
ELSE(ENABLE_INTERNAL_RIP_SAP)
SET(EMUTLI emutli.c)
SET(EMUTLI1 empty.c)
SET(NWROUTE_0 nwroute1.c)
ENDIF(ENABLE_INTERNAL_RIP_SAP)
add_executable(nwserv nwserv.c net1.c tools.c ${EMUTLI} ${EMUTLI1} ${NWROUTE_0} )
add_executable(nwconn nwconn.c net1.c tools.c connect.c namspace.c nwvolume.c nwfile.c unxfile.c nwqconn.c nameos2.c namedos.c nwfname.c nwshare.c extpipe.c nwattrib.c trustee.c nwarchive.c nwatalk.c nwxattr.c ${EMUTLI} )
add_executable(ncpserv ncpserv.c net1.c tools.c ${EMUTLI} )
add_executable(nwclient nwclient.c net1.c tools.c ${EMUTLI} )
add_executable(nwbind nwbind.c net1.c tools.c nwdbm.c nwcrypt.c unxlog.c sema.c nwqueue.c unxfile.c ${EMUTLI} )
IF(ENABLE_INTERNAL_RIP_SAP)
add_executable(nwrouted nwrouted.c net1.c tools.c ${EMUTLI} ${EMUTLI1} )
ENDIF(ENABLE_INTERNAL_RIP_SAP)
add_executable(dbmtool dbmtool.c net1.c tools.c nwdbm.c nwcrypt.c unxlog.c sema.c nwqueue.c unxfile.c ${EMUTLI} )
add_executable(ftrustee ftrustee.c tools.c nwfname.c unxfile.c nwvolume.c nwattrib.c trustee.c )
#################################
# Linking
##############
target_link_libraries(nwserv ${CRYPT_LIBRARIES} )
target_link_libraries(nwconn ${CRYPT_LIBRARIES} ${XATTR_LIBRARIES} )
IF(MARS_NWE_NETATALK_SUPPORT)
target_include_directories(nwconn PRIVATE ${NETATALK_INCLUDE_DIRS})
target_link_libraries(nwconn ${NETATALK_LIBRARIES})
ENDIF(MARS_NWE_NETATALK_SUPPORT)
target_link_libraries(ncpserv ${CRYPT_LIBRARIES} )
target_link_libraries(nwclient ${CRYPT_LIBRARIES} )
target_link_libraries(nwbind ${CRYPT_LIBRARIES} ${GDBM_LIBRARIES} )
IF(ENABLE_INTERNAL_RIP_SAP)
target_link_libraries(nwrouted ${CRYPT_LIBRARIES} )
ENDIF(ENABLE_INTERNAL_RIP_SAP)
target_link_libraries(dbmtool ${CRYPT_LIBRARIES} ${GDBM_LIBRARIES} )
target_link_libraries(ftrustee ${CRYPT_LIBRARIES} )
#################################
# Install Files
##############
install(TARGETS nwserv DESTINATION ${CMAKE_INSTALL_SBINDIR})
install(TARGETS nwconn DESTINATION ${CMAKE_INSTALL_SBINDIR})
install(TARGETS ncpserv DESTINATION ${CMAKE_INSTALL_SBINDIR})
install(TARGETS nwclient DESTINATION ${CMAKE_INSTALL_SBINDIR})
install(TARGETS nwbind DESTINATION ${CMAKE_INSTALL_SBINDIR})
IF(ENABLE_INTERNAL_RIP_SAP)
install(TARGETS nwrouted DESTINATION ${CMAKE_INSTALL_SBINDIR})
ENDIF(ENABLE_INTERNAL_RIP_SAP)
install(TARGETS dbmtool DESTINATION ${CMAKE_INSTALL_SBINDIR})
install(TARGETS ftrustee DESTINATION ${CMAKE_INSTALL_SBINDIR})