From 6fe0a78fb26b727f445d1d42cef3b886c79b493d Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 13 Sep 2013 12:19:56 +0200 Subject: [PATCH] Option "vol dbnest" When set to true, the CNID database for a volume is stored in the volume root of a share in a directory .AppleDB like in Netatalk 2. Defaults to false. From FR#84. --- NEWS | 3 +++ doc/manpages/man5/afp.conf.5.xml | 11 +++++++++++ libatalk/util/netatalk_conf.c | 15 ++++++++++----- man/man5/afp.conf.5.in | 5 +++++ 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index b932367d..f04e333d 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,9 @@ Changes in 3.0.6 * NEW: Add support for ZFS ACLs on FreeBSD with libsunacl. From FR#83. * FIX: Active Directory LDAP queries for ACL support with new options "ldap user filter" and "ldap group filter". Bug #526. +* NEW: Option "vol dbnest", when set to true, the CNID database for + a volume is stored in the volume root of a share in a directory + .AppleDB like in Netatalk 2. Defaults to false. From FR#84. Changes in 3.0.5 ================ diff --git a/doc/manpages/man5/afp.conf.5.xml b/doc/manpages/man5/afp.conf.5.xml index e17dcc47..b4fb3baf 100644 --- a/doc/manpages/man5/afp.conf.5.xml +++ b/doc/manpages/man5/afp.conf.5.xml @@ -947,6 +947,17 @@ + + vol dbnest = BOOLEAN (default: + no) (G) + + + Setting this option to true brings back Netatalk 2 + behaviour of storing the CNID database in a folder called + .AppleDB inside the volume root of each share. + + + volnamelen = number (G) diff --git a/libatalk/util/netatalk_conf.c b/libatalk/util/netatalk_conf.c index 4860cd82..503a423c 100644 --- a/libatalk/util/netatalk_conf.c +++ b/libatalk/util/netatalk_conf.c @@ -667,11 +667,16 @@ static struct vol *creatvol(AFPObj *obj, for(i = 0; i < vlen; i++) if(tmpname[i] == '/') tmpname[i] = ':'; - bstring dbpath; - EC_NULL( val = atalk_iniparser_getstring(obj->iniconfig, INISEC_GLOBAL, "vol dbpath", _PATH_STATEDIR "CNID/") ); - EC_NULL( dbpath = bformat("%s/%s/", val, tmpname) ); - EC_NULL( volume->v_dbpath = strdup(cfrombstr(dbpath)) ); - bdestroy(dbpath); + + if (!atalk_iniparser_getboolean(obj->iniconfig, INISEC_GLOBAL, "vol dbnest", 0)) { + bstring dbpath; + EC_NULL( val = atalk_iniparser_getstring(obj->iniconfig, INISEC_GLOBAL, "vol dbpath", _PATH_STATEDIR "CNID/") ); + EC_NULL( dbpath = bformat("%s/%s/", val, tmpname) ); + EC_NULL( volume->v_dbpath = strdup(cfrombstr(dbpath)) ); + bdestroy(dbpath); + } else { + EC_NULL( volume->v_dbpath = strdup(path) ); + } if ((val = getoption(obj->iniconfig, section, "cnid scheme", preset, NULL))) EC_NULL( volume->v_cnidscheme = strdup(val) ); diff --git a/man/man5/afp.conf.5.in b/man/man5/afp.conf.5.in index 93893286..16063973 100644 --- a/man/man5/afp.conf.5.in +++ b/man/man5/afp.conf.5.in @@ -608,6 +608,11 @@ Sets the database information to be stored in path\&. You have to specify a writ @localstatedir@/netatalk/CNID/\&. .RE .PP +vol dbnest = \fIBOOLEAN\fR (default: \fIno\fR) \fB(G)\fR +.RS 4 +Setting this option to true brings back Netatalk 2 behaviour of storing the CNID database in a folder called \&.AppleDB inside the volume root of each share\&. +.RE +.PP volnamelen = \fInumber\fR \fB(G)\fR .RS 4 Max length of UTF8\-MAC volume name for Mac OS X\&. Note that Hangul is especially sensitive to this\&. -- 2.39.2