]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/volume.c
keep in each volume structure the last struct dir used, they are often reused
[netatalk.git] / etc / afpd / volume.c
index 687698d51b871b592aa49529b326a4367555187c..81981e01c6604a3d219459f88cad896491f94f62 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.100 2009-11-08 23:17:40 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.
@@ -770,7 +770,32 @@ static int creatvol(AFPObj *obj, struct passwd *pwd,
        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);
@@ -1925,6 +1950,7 @@ int afp_openvol(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t
     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;