#include <atalk/cnid_dbd_private.h>
#include <atalk/util.h>
#include <atalk/bstradd.h>
+#include <atalk/unicode.h>
#include "desktop.h"
#include "directory.h"
int result = AFP_OK;
struct path path;
char *rrbuf = rbuf;
+ char buffer[MAXPATHLEN +2];
+ uint16_t flags = CONV_TOLOWER;
LOG(log_debug, logtype_afpd, "catsearch_db(req pos: %u): {pos: %u, name: %s}",
*pos, cur_pos, uname);
}
if (cur_pos == 0 || *pos == 0) {
+ if (convert_charset(vol->v_volcharset,
+ vol->v_volcharset,
+ vol->v_maccharset,
+ uname,
+ strlen(uname),
+ buffer,
+ MAXPATHLEN,
+ &flags) == (size_t)-1) {
+ LOG(log_error, logtype_cnid, "catsearch_db: conversion error");
+ result = AFPERR_MISC;
+ goto catsearch_end;
+ }
+
+ LOG(log_debug, logtype_afpd, "catsearch_db: %s", buffer);
+
if ((num_matches = cnid_find(vol->v_cdb,
- uname,
+ buffer,
strlen(uname),
resbuf,
sizeof(resbuf))) == -1) {
/* 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)
+ && (vol->v_flags & AFPVOL_SEARCHDB))
/* 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