]> arthur.barton.de Git - netatalk.git/commitdiff
Option "vol dbnest"
authorRalph Boehme <sloowfranklin@gmail.com>
Fri, 13 Sep 2013 10:19:56 +0000 (12:19 +0200)
committerRalph Boehme <sloowfranklin@gmail.com>
Tue, 17 Sep 2013 11:14:22 +0000 (13:14 +0200)
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
doc/manpages/man5/afp.conf.5.xml
libatalk/util/netatalk_conf.c
man/man5/afp.conf.5.in

diff --git a/NEWS b/NEWS
index b932367d9bf190362ac0fa071279e4896b4a895b..f04e333ddd806cb429d9d2a85cab388d7707081e 100644 (file)
--- 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
 ================
index e17dcc474f1641e5bf4eeb44e4c322dfef7c0c92..b4fb3baf7329977254063929fee5bb2799b01ac5 100644 (file)
           </listitem>
         </varlistentry>
 
+        <varlistentry>
+          <term>vol dbnest = <replaceable>BOOLEAN</replaceable> (default:
+          <emphasis>no</emphasis>) <type>(G)</type></term>
+
+          <listitem>
+            <para>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.</para>
+          </listitem>
+        </varlistentry>
+
         <varlistentry>
           <term>volnamelen = <replaceable>number</replaceable>
           <type>(G)</type></term>
index 4860cd8240d7dbeada16c7dcf9dac45f92cd32cb..503a423cf99ce573f9d5d69e74e0199150cb02a4 100644 (file)
@@ -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) );
index 9389328676df6d91d353f2a30d065bad8f7b98d7..160639735656be258d5e696376f056fc24d4e546 100644 (file)
@@ -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\&.