nwatalk: use standalone mars_nwe AFP xattr backend
This commit is contained in:
@@ -74,7 +74,6 @@ option(ENABLE_INTERNAL_RIP_SAP "Should we build Mars Nwe with Internal Router?"
|
||||
option(ENABLE_SHADOW_PWD "Should we build Mars Nwe with Shadow Password Support?" ON)
|
||||
option(ENABLE_QUOTA_SUPPORT "Should we build Mars Nwe with Quota Support?" ON)
|
||||
option(ENABLE_XATTR "Should we build Mars Nwe with extended attribute support?" ON)
|
||||
option(ENABLE_NETATALK_LIBATALK "Enable optional Netatalk/libatalk AFP metadata backend" OFF)
|
||||
option(MARS_NWE_INSTALL_DOSUTILS "Install DOS client utilities" ON)
|
||||
option(MARS_NWE_INSTALL_NEW_DOSUTILS "Install the new/experimental DOS client utilities instead of legacy netold.exe" OFF)
|
||||
option(MARS_NWE_BUILD_DOSUTILS "Build DOS client utilities with Open Watcom" OFF)
|
||||
@@ -152,13 +151,6 @@ ELSE (ENABLE_XATTR AND XATTR_FOUND)
|
||||
SET (MARS_NWE_XATTR_SUPPORT "0")
|
||||
ENDIF (ENABLE_XATTR AND XATTR_FOUND)
|
||||
|
||||
find_package(Netatalk QUIET)
|
||||
IF (ENABLE_NETATALK_LIBATALK AND NETATALK_FOUND)
|
||||
SET (MARS_NWE_NETATALK_SUPPORT "1")
|
||||
ELSE (ENABLE_NETATALK_LIBATALK AND NETATALK_FOUND)
|
||||
SET (MARS_NWE_NETATALK_SUPPORT "0")
|
||||
ENDIF (ENABLE_NETATALK_LIBATALK AND NETATALK_FOUND)
|
||||
|
||||
IF (NOT MAX_CONNECTIONS)
|
||||
SET (MAX_CONNECTIONS "50")
|
||||
ENDIF (NOT MAX_CONNECTIONS)
|
||||
@@ -194,15 +186,7 @@ else()
|
||||
message(STATUS "XAttr support: disabled")
|
||||
endif()
|
||||
|
||||
if(MARS_NWE_NETATALK_SUPPORT)
|
||||
message(STATUS "Netatalk/libatalk AFP metadata backend: enabled")
|
||||
else()
|
||||
if(ENABLE_NETATALK_LIBATALK)
|
||||
message(STATUS "Netatalk/libatalk AFP metadata backend: disabled (headers/library not found)")
|
||||
else()
|
||||
message(STATUS "Netatalk/libatalk AFP metadata backend: disabled")
|
||||
endif()
|
||||
endif()
|
||||
message(STATUS "AFP metadata backend: mars_nwe xattrs")
|
||||
|
||||
# we want to use systemd, if possible
|
||||
set(SYSTEMD_SERVICES_INSTALL_DIR "" CACHE PATH "Directory for systemd service files")
|
||||
|
||||
17
TODO.md
17
TODO.md
@@ -215,7 +215,7 @@ Current status:
|
||||
|
||||
- `NCP 0x23` still returns invalid namespace for AFP calls that are not implemented yet.
|
||||
- `AFP Get Entry ID From Path Name` is implemented when the optional
|
||||
Netatalk/libatalk backend is available. Entry IDs are now derived first from
|
||||
mars_nwe AFP xattr metadata backend is available. Entry IDs are now derived first from
|
||||
existing mars_nwe NetWare namespace/basehandle state rather than from a
|
||||
parallel AFP/stat fallback generator. Linux smoke coverage exists in
|
||||
`tests/linux/afp_entry_id_smoke`; the latest full-suite run against
|
||||
@@ -229,7 +229,7 @@ Current status:
|
||||
been verified against `SYS:`, `SYS:PUBLIC`, `SYS:SYSTEM`, and `SYS:BURST`.
|
||||
The same test verifies the AFP 2.0 Get File Information subfunction via
|
||||
`--afp20` against the same paths, using the same path-backed read-only reply
|
||||
for now. The current reply fills stat/libatalk-derived fields and leaves
|
||||
for now. The current reply fills stat/mars_nwe AFP xattr-derived fields and leaves
|
||||
persistent CNID Parent ID / fuller Mac namespace metadata as future work.
|
||||
- `AFP Scan File Information` (`0x0a`) and `AFP 2.0 Scan File Information`
|
||||
(`0x11`) are implemented for path-backed read-only directory scans. Linux
|
||||
@@ -297,7 +297,7 @@ Current status:
|
||||
- The AFP dispatcher now decodes the WebSDK/NWAFP subfunction number in
|
||||
diagnostics so real client probes can be mapped to the corresponding AFP
|
||||
call before implementation work starts.
|
||||
- Optional build-time detection/linking for Netatalk/libatalk exists as a first
|
||||
- Optional build-time detection/linking for mars_nwe AFP xattr exists as a first
|
||||
local metadata backend hook. It is deliberately not an AFP protocol
|
||||
implementation yet.
|
||||
- Existing mars_nwe private xattr payloads use the `org.mars-nwe.<domain>.*`
|
||||
@@ -306,7 +306,7 @@ Current status:
|
||||
fallback because the old names never shipped outside local test systems.
|
||||
On Linux, mars_nwe's local xattr helper maps source-level `org.mars-nwe.<domain>.*`
|
||||
names to the portable `user.org.mars-nwe.<domain>.*` storage namespace, mirroring
|
||||
Netatalk's `org.netatalk.*` EA abstraction.
|
||||
the xattr abstraction used for Apple metadata.
|
||||
- NetWare AFP calls are NCP entry points for Mac namespace semantics on a
|
||||
NetWare volume, not transport-level AFP proxy calls to `afpd`.
|
||||
- AFP Get DOS Name From Entry ID (0x12) is implemented as a conservative
|
||||
@@ -319,11 +319,11 @@ Current status:
|
||||
|
||||
Follow-up:
|
||||
|
||||
- Implement the NetWare AFP NCP calls locally, using libatalk helpers rather
|
||||
- Implement the NetWare AFP NCP calls locally, using mars_nwe AFP xattr helpers rather
|
||||
than proxying requests to `afpd`. Create Directory, Create File, AFP
|
||||
Delete, and AFP Rename are now implemented through existing mars_nwe create/remove/rename helpers
|
||||
and covered by Linux smoke tests.
|
||||
- Candidate libatalk pieces include the new AppleDouble/Finder Info/resource
|
||||
- Candidate mars_nwe AFP xattr pieces include the new AppleDouble/Finder Info/resource
|
||||
fork helper wrappers, plus future CNID/directory-id helpers, attribute
|
||||
mapping, and filename conversion.
|
||||
- Keep returning invalid namespace for AFP calls that still lack a real per-volume Mac
|
||||
@@ -331,7 +331,7 @@ Follow-up:
|
||||
data/resource fork and Finder Info semantics.
|
||||
- AFP Entry IDs now prefer the existing mars_nwe NetWare namespace/basehandle
|
||||
mapping before consulting cached AFP metadata or the old fallback path. A
|
||||
future libatalk/CNID backend may still provide Apple-native identity, but AFP
|
||||
future mars_nwe AFP xattr/CNID backend may still provide Apple-native identity, but AFP
|
||||
must not grow a second mars_nwe object-id resolver in parallel to the existing
|
||||
namespace machinery.
|
||||
- The full smoke suite verifies path-backed file identity end to end:
|
||||
@@ -352,8 +352,7 @@ Follow-up:
|
||||
allocation and broader AFP metadata writes still need a deliberate write-safe
|
||||
design.
|
||||
- Put additional future mars_nwe-owned AFP metadata under `org.mars-nwe.afp.*`
|
||||
(or a compact `org.mars-nwe.afp.metadata` record) and keep Netatalk-owned
|
||||
metadata under Netatalk's own `org.netatalk.*` keys.
|
||||
(or a compact `org.mars-nwe.afp.metadata` record) and keep externally owned Apple metadata under its own keys.
|
||||
- Extend the Linux AFP smoke tests once additional AFP subfunctions are
|
||||
implemented, especially Finder Info updates, fork open/read/write paths,
|
||||
resource-fork handling, and broader directory-scan edge cases.
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# Find Netatalk's libatalk.
|
||||
#
|
||||
# Result variables:
|
||||
# NETATALK_FOUND
|
||||
# NETATALK_INCLUDE_DIRS
|
||||
# NETATALK_LIBRARIES
|
||||
#
|
||||
# Optional cache hints:
|
||||
# NETATALK_ROOT
|
||||
# NETATALK_INCLUDE_DIR
|
||||
# NETATALK_LIBRARY
|
||||
|
||||
find_path(NETATALK_INCLUDE_DIR
|
||||
NAMES atalk/adouble.h
|
||||
HINTS ${NETATALK_ROOT}
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
|
||||
find_library(NETATALK_LIBRARY
|
||||
NAMES atalk libatalk
|
||||
HINTS ${NETATALK_ROOT}
|
||||
PATH_SUFFIXES lib lib64
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Netatalk
|
||||
REQUIRED_VARS NETATALK_INCLUDE_DIR NETATALK_LIBRARY
|
||||
)
|
||||
|
||||
if(NETATALK_FOUND)
|
||||
set(NETATALK_INCLUDE_DIRS ${NETATALK_INCLUDE_DIR})
|
||||
set(NETATALK_LIBRARIES ${NETATALK_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(NETATALK_INCLUDE_DIR NETATALK_LIBRARY)
|
||||
@@ -97,8 +97,6 @@
|
||||
/* change to '1' for quota support */
|
||||
#define XATTR_SUPPORT @MARS_NWE_XATTR_SUPPORT@
|
||||
/* change to '1' for Linux xattr support */
|
||||
#define NETATALK_SUPPORT @MARS_NWE_NETATALK_SUPPORT@
|
||||
/* change to '1' for Netatalk/libatalk AFP metadata backend */
|
||||
|
||||
/* for sending 'Request being serviced' replys, /lenz */
|
||||
#define CALL_NWCONN_OVER_SOCKET 0
|
||||
|
||||
@@ -77,10 +77,6 @@ add_executable(ftrustee ftrustee.c tools.c nwfname.c unxfile.c nwvolume.c nwattr
|
||||
|
||||
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} )
|
||||
|
||||
119
src/nwatalk.c
119
src/nwatalk.c
@@ -1,4 +1,4 @@
|
||||
/* Optional Netatalk/libatalk AFP metadata backend helpers. */
|
||||
/* mars_nwe AFP xattr metadata backend helpers. */
|
||||
#include "net.h"
|
||||
#include "config.h"
|
||||
#include "nwatalk.h"
|
||||
@@ -11,11 +11,6 @@
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#if NETATALK_SUPPORT
|
||||
#include <sys/stat.h>
|
||||
#include <atalk/adouble.h>
|
||||
#endif
|
||||
|
||||
#define MARS_NWE_AFP_ENTRY_ID_XATTR "org.mars-nwe.afp.entry-id"
|
||||
#define MARS_NWE_AFP_FINDER_INFO_XATTR "org.mars-nwe.afp.finder-info"
|
||||
#define MARS_NWE_AFP_ATTRIBUTES_XATTR "org.mars-nwe.afp.attributes"
|
||||
@@ -40,6 +35,14 @@ typedef struct {
|
||||
uint8 attributes[2];
|
||||
} MARS_NWE_AFP_ATTRIBUTES_XATTR_DATA;
|
||||
|
||||
int nwatalk_backend_available(void)
|
||||
{
|
||||
#if XATTR_SUPPORT
|
||||
return(1);
|
||||
#else
|
||||
return(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if XATTR_SUPPORT
|
||||
static int nwatalk_get_mars_entry_id_xattr(const char *path, uint32 *entry_id)
|
||||
@@ -73,46 +76,12 @@ static int nwatalk_get_mars_entry_id_xattr(const char *path, uint32 *entry_id)
|
||||
}
|
||||
#endif
|
||||
|
||||
int nwatalk_backend_available(void)
|
||||
{
|
||||
#if NETATALK_SUPPORT
|
||||
return(1);
|
||||
#else
|
||||
return(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if NETATALK_SUPPORT
|
||||
static int nwatalk_open_adouble(const char *path, struct adouble *ad)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (!path || !*path) return(-0x9c); /* invalid path */
|
||||
|
||||
ad_init_old(ad, AD_VERSION, 0);
|
||||
|
||||
result = ad_open(ad, path,
|
||||
ADFLAGS_HF | ADFLAGS_RF | ADFLAGS_RDONLY |
|
||||
ADFLAGS_NOHF | ADFLAGS_NORF);
|
||||
if (result < 0) {
|
||||
return(-0x9c);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
int nwatalk_get_finder_info(const char *path, uint8 *finder_info,
|
||||
int finder_info_len)
|
||||
{
|
||||
#if XATTR_SUPPORT
|
||||
ssize_t len;
|
||||
#endif
|
||||
#if NETATALK_SUPPORT
|
||||
struct adouble ad;
|
||||
void *entry;
|
||||
int result;
|
||||
#endif
|
||||
|
||||
if (!finder_info || finder_info_len < NWATALK_FINDER_INFO_LEN) {
|
||||
return(-0x9c);
|
||||
@@ -128,23 +97,12 @@ int nwatalk_get_finder_info(const char *path, uint8 *finder_info,
|
||||
return(0);
|
||||
memset(finder_info, 0, finder_info_len);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if NETATALK_SUPPORT
|
||||
result = nwatalk_open_adouble(path, &ad);
|
||||
if (result < 0) return(result);
|
||||
|
||||
entry = ad_entry(&ad, ADEID_FINDERI);
|
||||
if (entry && ad_getentrylen(&ad, ADEID_FINDERI) >= NWATALK_FINDER_INFO_LEN) {
|
||||
memcpy(finder_info, entry, NWATALK_FINDER_INFO_LEN);
|
||||
}
|
||||
|
||||
ad_close(&ad, 0);
|
||||
return(0);
|
||||
#else
|
||||
(void)path;
|
||||
return(-0xbf); /* invalid namespace / backend unavailable */
|
||||
#endif
|
||||
|
||||
/* Missing FinderInfo is a valid AFP state; absent metadata reads as zeroes. */
|
||||
return(0);
|
||||
}
|
||||
|
||||
int nwatalk_set_finder_info(const char *path, const uint8 *finder_info,
|
||||
@@ -170,8 +128,6 @@ int nwatalk_set_finder_info(const char *path, const uint8 *finder_info,
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
int nwatalk_get_afp_attributes(const char *path, uint16 *attributes)
|
||||
{
|
||||
#if XATTR_SUPPORT
|
||||
@@ -269,64 +225,17 @@ int nwatalk_set_entry_id(const char *path, uint32 entry_id)
|
||||
|
||||
int nwatalk_get_resource_fork_size(const char *path, uint32 *resource_size)
|
||||
{
|
||||
#if NETATALK_SUPPORT
|
||||
struct adouble ad;
|
||||
off_t size;
|
||||
int result;
|
||||
|
||||
(void)path;
|
||||
if (!resource_size) return(-0x9c);
|
||||
*resource_size = 0;
|
||||
|
||||
result = nwatalk_open_adouble(path, &ad);
|
||||
if (result < 0) return(result);
|
||||
|
||||
size = ad_size(&ad, ADEID_RFORK);
|
||||
if (size > 0) {
|
||||
if (size > 0xffffffffUL) size = 0xffffffffUL;
|
||||
*resource_size = (uint32)size;
|
||||
}
|
||||
|
||||
ad_close(&ad, 0);
|
||||
return(0);
|
||||
#else
|
||||
(void)path;
|
||||
(void)resource_size;
|
||||
return(-0xbf); /* invalid namespace / backend unavailable */
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
int nwatalk_get_entry_id(const char *path, uint32 *entry_id)
|
||||
{
|
||||
int result;
|
||||
|
||||
if (!entry_id) return(-0x9c);
|
||||
*entry_id = 0;
|
||||
if (!path || !*path) return(-0x9c);
|
||||
|
||||
result = nwatalk_get_mars_entry_id_xattr(path, entry_id);
|
||||
if (!result && *entry_id)
|
||||
return(0);
|
||||
|
||||
#if NETATALK_SUPPORT
|
||||
{
|
||||
struct adouble ad;
|
||||
struct stat stbuff;
|
||||
uint32_t id;
|
||||
|
||||
if (stat(path, &stbuff)) return(-0x9c);
|
||||
|
||||
result = nwatalk_open_adouble(path, &ad);
|
||||
if (result < 0) return(result);
|
||||
|
||||
id = ad_getid(&ad, stbuff.st_dev, stbuff.st_ino, 0, NULL);
|
||||
if (id) *entry_id = (uint32)id;
|
||||
|
||||
ad_close(&ad, 0);
|
||||
return(id ? 0 : -0x9c);
|
||||
}
|
||||
#else
|
||||
(void)result;
|
||||
return(-0xbf); /* invalid namespace / backend unavailable */
|
||||
#endif
|
||||
return(nwatalk_get_mars_entry_id_xattr(path, entry_id));
|
||||
}
|
||||
|
||||
34
src/nwconn.c
34
src/nwconn.c
@@ -578,7 +578,7 @@ static uint32 afp_namespace_entry_id(int volume, const struct stat *stb)
|
||||
static uint32 afp_fallback_entry_id(int volume, const struct stat *stb)
|
||||
/*
|
||||
* Build a stable local AFP entry id from Unix identity data when the NetWare
|
||||
* namespace handle cannot represent the object and libatalk has no stored
|
||||
* namespace handle cannot represent the object and mars_nwe AFP xattr has no stored
|
||||
* CNID/AppleDouble id yet. This is only a legacy compatibility fallback.
|
||||
*/
|
||||
{
|
||||
@@ -609,7 +609,7 @@ static uint32 afp_get_or_create_entry_id(const char *unixname, int volume,
|
||||
int *fallback_out)
|
||||
/*
|
||||
* Return the mars_nwe namespace basehandle as AFP entry id whenever it can be
|
||||
* represented. nwatalk/libatalk metadata remains a cache/legacy fallback for
|
||||
* represented. mars_nwe AFP xattr metadata remains a cache/legacy fallback for
|
||||
* entries that cannot be mapped by the NetWare namespace table.
|
||||
*/
|
||||
{
|
||||
@@ -663,7 +663,7 @@ static int afp_get_entry_id_from_name(uint8 *afp_req, int afp_len,
|
||||
}
|
||||
|
||||
if (!nwatalk_backend_available()) {
|
||||
XDPRINTF((3,0, "AFP Get Entry ID From Name rejected: libatalk backend unavailable"));
|
||||
XDPRINTF((3,0, "AFP Get Entry ID From Name rejected: AFP xattr metadata backend unavailable"));
|
||||
return(-0xbf); /* invalid namespace */
|
||||
}
|
||||
|
||||
@@ -725,7 +725,7 @@ static int afp_get_entry_id_from_netware_handle(uint8 *afp_req, int afp_len,
|
||||
}
|
||||
|
||||
if (!nwatalk_backend_available()) {
|
||||
XDPRINTF((3,0, "AFP Get Entry ID From NetWare Handle rejected: libatalk backend unavailable"));
|
||||
XDPRINTF((3,0, "AFP Get Entry ID From NetWare Handle rejected: AFP xattr metadata backend unavailable"));
|
||||
return(-0xbf); /* invalid namespace */
|
||||
}
|
||||
|
||||
@@ -790,7 +790,7 @@ static int afp_open_file_fork(uint8 *afp_req, int afp_len,
|
||||
}
|
||||
|
||||
if (!nwatalk_backend_available()) {
|
||||
XDPRINTF((3,0, "AFP Open File Fork rejected: libatalk backend unavailable"));
|
||||
XDPRINTF((3,0, "AFP Open File Fork rejected: AFP xattr metadata backend unavailable"));
|
||||
return(-0xbf); /* invalid namespace */
|
||||
}
|
||||
|
||||
@@ -938,7 +938,7 @@ static int afp_alloc_temporary_dir_handle(uint8 *afp_req, int afp_len,
|
||||
}
|
||||
|
||||
if (!nwatalk_backend_available()) {
|
||||
XDPRINTF((3,0, "AFP Alloc Temporary Dir Handle rejected: libatalk backend unavailable"));
|
||||
XDPRINTF((3,0, "AFP Alloc Temporary Dir Handle rejected: AFP xattr metadata backend unavailable"));
|
||||
return(-0xbf); /* invalid namespace */
|
||||
}
|
||||
|
||||
@@ -1030,7 +1030,7 @@ static int afp_create_file(uint8 *afp_req, int afp_len,
|
||||
}
|
||||
|
||||
if (!nwatalk_backend_available()) {
|
||||
XDPRINTF((3,0, "%s rejected: libatalk backend unavailable", call_name));
|
||||
XDPRINTF((3,0, "%s rejected: AFP xattr metadata backend unavailable", call_name));
|
||||
return(-0xbf);
|
||||
}
|
||||
if (!path_len) {
|
||||
@@ -1152,7 +1152,7 @@ static int afp_create_directory(uint8 *afp_req, int afp_len,
|
||||
}
|
||||
|
||||
if (!nwatalk_backend_available()) {
|
||||
XDPRINTF((3,0, "%s rejected: libatalk backend unavailable", call_name));
|
||||
XDPRINTF((3,0, "%s rejected: AFP xattr metadata backend unavailable", call_name));
|
||||
return(-0xbf);
|
||||
}
|
||||
if (!path_len) {
|
||||
@@ -1422,7 +1422,7 @@ static int afp_get_entry_id_from_path_name(uint8 *afp_req, int afp_len,
|
||||
}
|
||||
|
||||
if (!nwatalk_backend_available()) {
|
||||
XDPRINTF((3,0, "AFP Get Entry ID From Path Name rejected: libatalk backend unavailable"));
|
||||
XDPRINTF((3,0, "AFP Get Entry ID From Path Name rejected: AFP xattr metadata backend unavailable"));
|
||||
return(-0xbf); /* invalid namespace */
|
||||
}
|
||||
|
||||
@@ -1478,7 +1478,7 @@ static int afp_dos_path_join(int volume, char *dst, int dst_len,
|
||||
*
|
||||
* AFP 0x12 returns a DOSPathString, not the real Unix directory entry name.
|
||||
* The reverse lookup still walks the Unix volume tree because current AFP entry
|
||||
* IDs are mars_nwe/libatalk metadata IDs, but the path returned to the client
|
||||
* IDs are mars_nwe AFP xattr metadata IDs, but the path returned to the client
|
||||
* must be the DOS namespace alias that mars_nwe already uses elsewhere.
|
||||
*/
|
||||
{
|
||||
@@ -1504,7 +1504,7 @@ static int afp_find_dos_name_from_entry_id_rec(int volume,
|
||||
*
|
||||
* NetWare's documented AFP 0x12 call is an entry-id-only lookup. mars_nwe's
|
||||
* current AFP ids are not the namespace base handles used by namspace.c; they
|
||||
* are mars_nwe/libatalk AFP metadata ids. Reuse the existing volume table for
|
||||
* are mars_nwe AFP xattr metadata ids. Reuse the existing volume table for
|
||||
* the search root and the nwatalk entry-id helper for the per-entry identity,
|
||||
* but do not create fallback ids while scanning. The first conservative smoke
|
||||
* target is therefore an entry that was already cached by Get Entry ID/Get File
|
||||
@@ -1644,7 +1644,7 @@ static int afp_get_dos_name_from_entry_id(uint8 *afp_req, int afp_len,
|
||||
entry_id = GET_BE32(afp_req + 2);
|
||||
|
||||
if (!nwatalk_backend_available()) {
|
||||
XDPRINTF((3,0, "AFP Get DOS Name From Entry ID rejected: libatalk backend unavailable"));
|
||||
XDPRINTF((3,0, "AFP Get DOS Name From Entry ID rejected: AFP xattr metadata backend unavailable"));
|
||||
return(-0xbf); /* Invalid Namespace */
|
||||
}
|
||||
|
||||
@@ -1944,7 +1944,7 @@ static int afp_get_file_information(uint8 *afp_req, int afp_len,
|
||||
}
|
||||
|
||||
if (!nwatalk_backend_available()) {
|
||||
XDPRINTF((3,0, "%s rejected: libatalk backend unavailable", call_name));
|
||||
XDPRINTF((3,0, "%s rejected: AFP xattr metadata backend unavailable", call_name));
|
||||
return(-0xbf); /* invalid namespace */
|
||||
}
|
||||
|
||||
@@ -2123,7 +2123,7 @@ static int afp_set_file_information(uint8 *afp_req, int afp_len,
|
||||
path_data = afp_req + path_off;
|
||||
|
||||
if (!nwatalk_backend_available()) {
|
||||
XDPRINTF((3,0, "%s rejected: libatalk backend unavailable", call_name));
|
||||
XDPRINTF((3,0, "%s rejected: AFP xattr metadata backend unavailable", call_name));
|
||||
return(-0xbf); /* invalid namespace */
|
||||
}
|
||||
|
||||
@@ -2337,7 +2337,7 @@ static int afp_scan_file_information(uint8 *afp_req, int afp_len,
|
||||
}
|
||||
|
||||
if (!nwatalk_backend_available()) {
|
||||
XDPRINTF((3,0, "%s rejected: libatalk backend unavailable", call_name));
|
||||
XDPRINTF((3,0, "%s rejected: AFP xattr metadata backend unavailable", call_name));
|
||||
return(-0xbf); /* invalid namespace */
|
||||
}
|
||||
|
||||
@@ -4397,7 +4397,7 @@ static int handle_ncp_serv(void)
|
||||
* path-backed subset, so route it through the same helper
|
||||
* until persistent entry-id lookup and richer AFP 2.0
|
||||
* metadata are implemented. These calls still require
|
||||
* the optional libatalk backend to be present; without a Mac
|
||||
* the optional AFP xattr metadata backend to be present; without a Mac
|
||||
* namespace backend, keep returning invalid namespace.
|
||||
*/
|
||||
if (ufunc == 0x01 || ufunc == 0x0d) {
|
||||
@@ -4470,7 +4470,7 @@ static int handle_ncp_serv(void)
|
||||
if (result > -1) data_len = result;
|
||||
else completition = (uint8)-result;
|
||||
} else {
|
||||
XDPRINTF((3,0, "AFP call rejected: ufunc=0x%02x (%s), Mac namespace unavailable, libatalk backend=%s",
|
||||
XDPRINTF((3,0, "AFP call rejected: ufunc=0x%02x (%s), Mac namespace unavailable, AFP xattr metadata backend=%s",
|
||||
ufunc, afp_call_name(ufunc),
|
||||
nwatalk_backend_available() ? "enabled" : "disabled"));
|
||||
completition=0xbf; /* we say invalid namespace here */
|
||||
|
||||
@@ -15,11 +15,10 @@ namespace path instead of creating a parallel AFP resolver. The first AFP write
|
||||
smoke path is deliberately limited to the FinderInfo bitmap of
|
||||
AFP 2.0 Set File Information; CNID allocation, DOS attribute mapping, resource
|
||||
fork writes, and data-fork writes remain separate write-safety work. mars_nwe
|
||||
source uses Netatalk-style `org.mars-nwe.<domain>.*` xattr names; AFP
|
||||
source uses mars_nwe `org.mars-nwe.<domain>.*` xattr names; AFP
|
||||
metadata stays under `org.mars-nwe.afp.*` while NetWare-core metadata uses
|
||||
`org.mars-nwe.netware.*`. On Linux the local xattr helper stores those through
|
||||
the portable `user.` namespace, matching Netatalk's `org.netatalk.*` EA
|
||||
abstraction style.
|
||||
the portable `user.` namespace with mars_nwe-owned Apple/AFP metadata keys.
|
||||
|
||||
Build with:
|
||||
|
||||
@@ -355,7 +354,7 @@ A successful reply prints the request path, directory handle, and returned
|
||||
existing NetWare namespace/basehandle mapping. A full-suite run after that
|
||||
change returned `entry_id=0x00000004` for `SYS:PUBLIC/pmdflts.ini`.
|
||||
|
||||
If the server was built without the optional Netatalk/libatalk backend, the
|
||||
If the server was built without the optional mars_nwe AFP xattr metadata backend, the
|
||||
endpoint is expected to return invalid namespace. To treat that as a successful
|
||||
negative smoke test, use:
|
||||
|
||||
@@ -427,7 +426,7 @@ AFP Entry ID From NetWare Handle path=SYS:PUBLIC/pmdflts.ini volume=0 entry_id=0
|
||||
AFP Get Entry ID From NetWare Handle: handle=1 volume=0 unix='/var/mars_nwe/SYS/public/pmdflts.ini' entry=0x00000004
|
||||
```
|
||||
|
||||
Persistent Apple CNID/AppleDouble/libatalk-backed identity, parent Entry ID
|
||||
Persistent Apple CNID/AppleDouble/mars_nwe AFP xattr-backed identity, parent Entry ID
|
||||
derivation, and AFP resource-fork handle semantics remain future Mac-namespace
|
||||
work; the current smoke coverage verifies the conservative read-only data-fork
|
||||
mapping through the existing NetWare namespace identity path.
|
||||
@@ -487,7 +486,7 @@ helper, so the client prints `0xff`. The server diagnostic logs the internal
|
||||
NetWare effective-rights mask before that AFP reply narrowing, so a fully
|
||||
privileged directory can appear as `0x1ff` in `mars_nwe.log`.
|
||||
|
||||
If the server was built without the optional Netatalk/libatalk backend, use
|
||||
If the server was built without the optional mars_nwe AFP xattr metadata backend, use
|
||||
`--allow-invalid-namespace` for the expected negative test. Use
|
||||
`--allow-invalid-path` for path-resolution negative tests.
|
||||
|
||||
@@ -572,7 +571,7 @@ A rejected resource-fork probe should print:
|
||||
AFP Open File Fork returned expected completion 0x9c: path=SYS:PUBLIC/pmdflts.ini fork=1 access=0x01
|
||||
```
|
||||
|
||||
If the server was built without the optional Netatalk/libatalk backend, use
|
||||
If the server was built without the optional mars_nwe AFP xattr metadata backend, use
|
||||
`--allow-invalid-namespace` for the expected negative test. Use
|
||||
`--allow-invalid-path` for path-resolution or Entry-ID-only negative tests.
|
||||
|
||||
@@ -653,11 +652,11 @@ currently exercises the same path-backed read-only reply as the older call.
|
||||
The current implementation fills fields from the existing mars_nwe sources of
|
||||
truth where possible: NetWare attributes, namespace/basehandle Entry IDs,
|
||||
trustee-derived AccessPrivileges, Unix file sizes and timestamps, and optional
|
||||
AFP/libatalk metadata such as FinderInfo. Parent ID, persistent Apple
|
||||
AFP/mars_nwe AFP xattr metadata such as FinderInfo. Parent ID, persistent Apple
|
||||
CNID/AppleDouble IDs, and fuller resource-fork semantics remain future
|
||||
Mac-namespace work.
|
||||
|
||||
If the server was built without the optional Netatalk/libatalk backend, use
|
||||
If the server was built without the optional mars_nwe AFP xattr metadata backend, use
|
||||
`--allow-invalid-namespace` for the expected negative test. Use
|
||||
`--allow-invalid-path` for path-resolution negative tests.
|
||||
|
||||
@@ -716,7 +715,7 @@ shares the same conservative scan implementation so older AFP callers can probe
|
||||
the same read-only directory listing semantics before fuller multi-response and
|
||||
CNID-backed scans are implemented.
|
||||
|
||||
If the server was built without the optional Netatalk/libatalk backend, use
|
||||
If the server was built without the optional mars_nwe AFP xattr metadata backend, use
|
||||
`--allow-invalid-namespace` for the expected negative test. Use
|
||||
`--allow-invalid-path` for path-resolution negative tests, and `--allow-empty`
|
||||
when a scan continuation is expected to reach the end of the directory.
|
||||
@@ -785,7 +784,7 @@ mars_nwe NetWare metadata helpers, routes Access through the normal file
|
||||
timestamp helper, and immediately verifies the updates through AFP 2.0 Get File
|
||||
Information. On Linux the source-level `org.mars-nwe.afp.*` name is stored via
|
||||
the portable `user.` xattr namespace by mars_nwe's local xattr wrapper, the same
|
||||
pattern Netatalk uses for its `org.netatalk.*` metadata names.
|
||||
same extended-attribute naming pattern used by Apple metadata backends.
|
||||
|
||||
Example:
|
||||
|
||||
@@ -947,7 +946,7 @@ flags, are intentionally rejected for now. That keeps create/access/backup
|
||||
timestamps, DOS/NetWare mode-bit mapping, enforcement, resource-fork, and
|
||||
Entry-ID-only write semantics out of this conservative smoke path.
|
||||
|
||||
If the server was built without the optional Netatalk/libatalk backend, use
|
||||
If the server was built without the optional mars_nwe AFP xattr metadata backend, use
|
||||
`--allow-invalid-namespace` for the expected negative test. Use
|
||||
`--allow-invalid-path` for path-resolution negative tests.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user