nwatalk: use standalone mars_nwe AFP xattr backend

This commit is contained in:
Mario Fetka
2026-05-31 04:13:31 +00:00
parent 8e95b56ca6
commit fa96ebb264
8 changed files with 51 additions and 201 deletions

View File

@@ -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 */