Open rdmark opened 1 month ago
@NJRoadfan This is close to working now, FYI.
Two outstanding issues:
The directory that houses the sqlite cnid databases (e.g. /var/lib/netatalk/CNID
needs to have 777 permissions since the database client is embedded in afpd
which runs as a normal user (obviously) when a user authenticates and attempts to initialize the volume. We may need a helper daemon akin to cnid_dbd
to run the database client as root.
But more importantly, there's a crash in dircache_add()
when it tries to enumerate the volume, so something isn't lining up quite yet.
Nonetheless, the backend builds and starts up now, and can generate a little cnid sqlite database file that you can query, which is neat.
Here is what comes up when trying to rebuild an existing volume with dbd -f
:
Nov 14 18:53:18.614566 dbd[5231] {cnid_sqlite.c:100} (error:Default): sqlite3_bind_text(db->cnid_add_stmt, 1, stmt_param_name, strlen(stmt_param_name), SQLITE_STATIC) failed: No such file or directory
Here is a dump of the database, it doesn't get very far:
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE volumes ( VolUUID CHAR(32) PRIMARY KEY,VolPath TEXT(4096),Stamp BINARY(8),Depleted INT);
INSERT INTO volumes VALUES('830A28BBB084683384019DD280C51FA8','/srv/A2SERVER/A2FILES','n�6g',0);
CREATE TABLE `830A28BBB084683384019DD280C51FA8`(Id INTEGER PRIMARY KEY AUTOINCREMENT,Name VARCHAR(255) NOT NULL,Did INTEGER NOT NULL,DevNo INTEGER NOT NULL,InodeNo INTEGER NOT NULL,UNIQUE (Did, Name), UNIQUE (DevNo, InodeNo));
DELETE FROM sqlite_sequence;
INSERT INTO sqlite_sequence VALUES('`830A28BBB084683384019DD280C51FA8`',16);
CREATE INDEX idx_volpath ON volumes(VolPath);
COMMIT;
Port the sqlite CNID backend from netatalk-classic (netatalk 2.x based) to netatalk 4.x.