/*
- * $Id: directory.c,v 1.131.2.2 2010-02-01 12:59:09 franklahm Exp $
+ * $Id: directory.c,v 1.131.2.4 2010-02-01 16:13:52 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
* o setdirparams doesn't change parent mdate anymore
* o catsearch doesn't work, see FIXMEs in catsearch.c
* o curdir per volume caching is gone
+ * o directory offspring count calculation probably broken
*/
char *t;
cnid_t fileid;
- LOG(log_maxdebug, logtype_afpd, "cname_mtouname('%s', toUTF8:%u)", ret->m_name, toUTF8);
-
if (afp_version >= 30) {
if (toUTF8) {
if (dir->d_did == DIRDID_ROOT_PARENT) {
/* check for OS X mangled filename :( */
t = demangle_osx(vol, ret->m_name, dir->d_did, &fileid);
+ LOG(log_maxdebug, logtype_afpd, "cname_mtouname('%s',did:%u) {demangled:'%s', fileid:%u}",
+ ret->m_name, ntohl(dir->d_did), t, ntohl(fileid));
+
if (t != ret->m_name) {
ret->u_name = t;
/* duplicate work but we can't reuse all convert_char we did in demangle_osx
}
ret->d_dir = dir;
+#if 0
ret->st_valid = 1;
ret->st_errno = EACCES;
+#endif
+
+ LOG(log_debug, logtype_afpd, "cname(AFPERR_ACCESS:'%s') {path-from-dir: curdir:'%s', path:'%s'}",
+ cfrombstring(dir->d_fullpath),
+ cfrombstring(curdir->d_fullpath),
+ ret->u_name);
+
return ret;
case AFPERR_NOOBJ:
memcpy(ret->u_name, cfrombstring(dir->d_u_name), blength(dir->d_u_name) + 1);
}
+#if 0
ret->st_valid = 1;
ret->st_errno = ENOENT;
+#endif
ret->d_dir = NULL;
dir_remove(vol, dir);
return ret;
return err;
}
- LOG(log_debug, logtype_afpd, "afp_createdir: alive1");
-
if (of_stat(s_path) < 0) {
return AFPERR_MISC;
}
- LOG(log_debug, logtype_afpd, "afp_createdir: alive2");
+
curdir->offcnt++;
- LOG(log_debug, logtype_afpd, "afp_createdir: alive3");
+
if ((dir = dir_add(vol, curdir, s_path, strlen(s_path->u_name))) == NULL) {
return AFPERR_MISC;
}
- LOG(log_debug, logtype_afpd, "afp_createdir: alive4");
+
if ( movecwd( vol, dir ) < 0 ) {
return( AFPERR_PARAM );
}
- LOG(log_debug, logtype_afpd, "afp_createdir: alive5");
+
ad_init(&ad, vol->v_adouble, vol->v_ad_options);
if (ad_open_metadata( ".", ADFLAGS_DIR, O_CREAT, &ad ) < 0) {
if (vol_noadouble(vol))