/*
- * $Id: volume.c,v 1.99 2009-11-06 04:28:25 didg Exp $
+ * $Id: volume.c,v 1.102 2009-11-13 00:27:36 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
else
volume->v_adouble = AD_VERSION;
+ /* Mac to Unix conversion flags*/
+ volume->v_mtou_flags = 0;
+ if (!(volume->v_flags & AFPVOL_NOHEX))
+ volume->v_mtou_flags |= CONV_ESCAPEHEX;
+ if (!(volume->v_flags & AFPVOL_USEDOTS))
+ volume->v_mtou_flags |= CONV_ESCAPEDOTS;
+ if ((volume->v_flags & AFPVOL_EILSEQ))
+ volume->v_mtou_flags |= CONV__EILSEQ;
+
+ if ((volume->v_casefold & AFPVOL_MTOUUPPER))
+ volume->v_mtou_flags |= CONV_TOUPPER;
+ else if ((volume->v_casefold & AFPVOL_MTOULOWER))
+ volume->v_mtou_flags |= CONV_TOLOWER;
+
+ /* Unix to Mac conversion flags*/
+ volume->v_utom_flags = CONV_IGNORE | CONV_UNESCAPEHEX;
+ if ((volume->v_casefold & AFPVOL_UTOMUPPER))
+ volume->v_utom_flags |= CONV_TOUPPER;
+ else if ((volume->v_casefold & AFPVOL_UTOMLOWER))
+ volume->v_utom_flags |= CONV_TOLOWER;
+
+ if ((volume->v_flags & AFPVOL_EILSEQ))
+ volume->v_utom_flags |= CONV__EILSEQ;
+
initvol_vfs(volume);
+
#ifdef FORCE_UIDGID
if (options[VOLOPT_FORCEUID].c_value) {
volume->v_forceuid = strdup(options[VOLOPT_FORCEUID].c_value);
char *vol_uname;
char *vol_mname;
char *volname_tmp;
-
+ struct charset_functions *charset;
+
ibuf += 2;
memcpy(&bitmap, ibuf, sizeof( bitmap ));
bitmap = ntohs( bitmap );
dir->d_color = DIRTREE_COLOR_BLACK; /* root node is black */
dir->d_m_name_ucs2 = strdup_w(volume->v_name);
volume->v_dir = volume->v_root = dir;
+ volume->v_curdir = NULL;
volume->v_hash = dirhash();
curdir = volume->v_dir;
goto openvol_err;
}
- if ( NULL == ( volume->v_vol = find_charset_functions(volume->v_volcodepage)) || volume->v_vol->flags & CHARSET_ICONV ) {
+ if ( NULL == (charset = find_charset_functions(volume->v_volcodepage)) || charset->flags & CHARSET_ICONV ) {
LOG (log_warning, logtype_afpd, "WARNING: volume encoding %s is *not* supported by netatalk, expect problems !!!!", volume->v_volcodepage);
}
goto openvol_err;
}
- if ( NULL == ( volume->v_mac = find_charset_functions(volume->v_maccodepage)) || ! (volume->v_mac->flags & CHARSET_CLIENT) ) {
+ if ( NULL == ( charset = find_charset_functions(volume->v_maccodepage)) || ! (charset->flags & CHARSET_CLIENT) ) {
LOG (log_error, logtype_afpd, "Fatal error: mac charset %s not supported", volume->v_maccodepage);
ret = AFPERR_MISC;
goto openvol_err;
- }
+ }
+ volume->v_kTextEncoding = htonl(charset->kTextEncoding);
ret = stat_vol(bitmap, volume, rbuf, rbuflen);
if (ret == AFP_OK) {