X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=etc%2Fafpd%2Fdirectory.c;fp=etc%2Fafpd%2Fdirectory.c;h=b7dc0701f18eafbf006aba524be3bd9988e64e8c;hp=d58023e2ac6e9b40408f1b869363206738dcbcbd;hb=cb339ecf8189245733548775d0c8a8ea11136b7b;hpb=7ac82e9c42281afb2889535b3d6c6e7868f2aebf diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index d58023e2..b7dc0701 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -301,7 +301,7 @@ static int set_dir_errors(struct path *path, const char *where, int err) * * @note If the passed ret->m_name is mangled, we'll demangle it */ -static int cname_mtouname(const struct vol *vol, const struct dir *dir, struct path *ret, int toUTF8) +static int cname_mtouname(const struct vol *vol, struct dir *dir, struct path *ret, int toUTF8) { static char temp[ MAXPATHLEN + 1]; char *t; @@ -331,6 +331,12 @@ static int cname_mtouname(const struct vol *vol, const struct dir *dir, struct p /* check for OS X mangled filename :( */ t = demangle_osx(vol, ret->m_name, dir->d_did, &fileid); + + if (curdir == NULL) { + /* demangle_osx() calls dirlookup() which might have clobbered curdir */ + movecwd(vol, dir); + } + LOG(log_maxdebug, logtype_afpd, "cname_mtouname('%s',did:%u) {demangled:'%s', fileid:%u}", ret->m_name, ntohl(dir->d_did), t, ntohl(fileid)); @@ -1508,10 +1514,6 @@ int getdirparams(const AFPObj *obj, memcpy( data, ad_entry( &ad, ADEID_FINDERI ), 32 ); } else { /* no appledouble */ memset( data, 0, 32 ); - /* set default view -- this also gets done in ad_open() */ - ashort = htons(FINDERINFO_CLOSEDVIEW); - memcpy(data + FINDERINFO_FRVIEWOFF, &ashort, sizeof(ashort)); - /* dot files are by default visible */ if (invisible_dots(vol, cfrombstr(dir->d_u_name))) { ashort = htons(FINDERINFO_INVISIBLE);