]> arthur.barton.de Git - netatalk.git/commitdiff
Add afpd.conf option -searchtype with arg db
authorFrank Lahm <franklahm@googlemail.com>
Mon, 6 Dec 2010 16:18:47 +0000 (17:18 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 6 Dec 2010 16:18:47 +0000 (17:18 +0100)
etc/afpd/afp_options.c
etc/afpd/catsearch.c
etc/afpd/globals.h

index 95c31c851c16a11dbbcbbb2bdb9036358c5ee4c5..0cc0dc98cdb71b8963579e3fe8fac15f213c2936 100644 (file)
@@ -232,6 +232,10 @@ int afp_options_parseline(char *buf, struct afp_options *options)
         options->flags |= OPTION_ANNOUNCESSH;
     if (strstr(buf, " -noacl2maccess"))
         options->flags &= ~OPTION_ACL2MACCESS;
+    if ((c = getoption(buf, "-searchtype"))) {
+        if (strcmp(c, "db") == 0)
+            options->flags |= OPTION_CATSEARCH_DB;
+    }
 
     /* passwd bits */
     if (strstr(buf, " -nosavepassword"))
index aee1b8f1f510fbba190f33e2983d458d92f6756f..8b3e9c991bb3e49595ac92e74761cc68eec84291 100644 (file)
@@ -1013,7 +1013,9 @@ static int catsearch_afp(AFPObj *obj _U_, char *ibuf, size_t ibuflen,
     
     /* Call search */
     *rbuflen = 24;
-    if ((c1.rbitmap & (1 << FILPBIT_PDINFO)) && (strcmp(vol->v_cnidscheme, "dbd") == 0))
+    if ((c1.rbitmap & (1 << FILPBIT_PDINFO))
+        && (strcmp(vol->v_cnidscheme, "dbd") == 0)
+        && (obj->options.flags & OPTION_CATSEARCH_DB))
         /* we've got a name and it's a dbd volume, so search CNID database */
         ret = catsearch_db(vol, vol->v_root, uname, rmatches, &catpos[0], rbuf+24, &nrecs, &rsize, ext);
     else
index e37ebf64644d7546e8a35f7dc8dc5cd9926af090..90a9247012b705df432858c4b10289c5bd2e3680 100644 (file)
@@ -37,6 +37,7 @@
 #define OPTION_UUID          (1 << 7)
 #define OPTION_ACL2MACCESS   (1 << 8)
 #define OPTION_NOZEROCONF    (1 << 9)
+#define OPTION_CATSEARCH_DB  (1 << 10)
 
 #ifdef FORCE_UIDGID
 /* set up a structure for this */