- if ((num_matches = cnid_find(vol->v_cdb,
- uname,
- strlen(uname),
- resbuf,
- sizeof(resbuf))) == -1) {
+ 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_afpd, "catsearch_db: conversion error");
+ result = AFPERR_MISC;
+ goto catsearch_end;
+ }
+
+ LOG(log_debug, logtype_afpd, "catsearch_db: %s", buffer);
+
+ AFP_CNID_START("cnid_find");
+ num_matches = cnid_find(vol->v_cdb,
+ buffer,
+ strlen(uname),
+ resbuf,
+ sizeof(resbuf));
+ AFP_CNID_DONE();
+ if (num_matches == -1) {