]> arthur.barton.de Git - netatalk.git/commitdiff
use volume real path for chdir
authordidg <didg>
Fri, 19 Feb 2010 01:26:03 +0000 (01:26 +0000)
committerdidg <didg>
Fri, 19 Feb 2010 01:26:03 +0000 (01:26 +0000)
etc/afpd/catsearch.c
etc/afpd/directory.c
etc/afpd/filedir.c
etc/afpd/volume.c
include/atalk/volume.h

index 58aab8e18360bf74e40f0bb7969b2c44cc9d0b51..662a876613a87db5419c50473e082fb1123040de 100644 (file)
@@ -497,7 +497,7 @@ static int catsearch(struct vol *vol, struct dir *dir,
        int result = AFP_OK;
        int ccr;
     struct path path;
-       char *vpath = vol->v_path;
+       char *vpath = vol->v_realpath;
        char *rrbuf = rbuf;
     time_t start_time;
     int num_rounds = NUM_ROUNDS;
index f330d3ca910fa77c9260eb7898dfd0bc2d2019e0..7c7eae72cd9920a3d1876c016500f25fcf8a2bfb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.132 2010-02-10 14:05:37 franklahm Exp $
+ * $Id: directory.c,v 1.133 2010-02-19 01:26:03 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1642,14 +1642,14 @@ int movecwd(struct vol *vol, struct dir *dir)
         memcpy( p, u, n );
     }
     if ( d != curdir ) {
-        n = strlen( vol->v_path );
+        n = strlen( vol->v_realpath );
         if (p -n -1 < path) {
             afp_errno = AFPERR_PARAM;
             return -1;
         }
         *--p = '/';
         p -= n;
-        memcpy( p, vol->v_path, n );
+        memcpy( p, vol->v_realpath, n );
     }
     if ( (ret = lchdir( p )) != 0 ) {
         LOG(log_debug, logtype_afpd, "movecwd('%s'): ret:%d, %u/%s", p, ret, errno, strerror(errno));
index 4451ae804c29ec0a2717ae488e93db7f4ad5d0a6..407e48a102f95b2a91024b31ca1bec8d3cb940a3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: filedir.c,v 1.70 2010-02-10 14:05:37 franklahm Exp $
+ * $Id: filedir.c,v 1.71 2010-02-19 01:26:03 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -588,13 +588,13 @@ char *absupath(const struct vol *vol, struct dir *dir, char *u)
         p -= len;
         memcpy( p, u, len );
     }
-    len = strlen( vol->v_path );
+    len = strlen( vol->v_realpath );
     if (p -len -1 < path) {
         return NULL;
     }
     *--p = '/';
     p -= len;
-    memcpy( p, vol->v_path, len );
+    memcpy( p, vol->v_realpath, len );
 
     return( p );
 }
index fd174e1737c609a36d7fb306a2d4bd71eb8b58f8..5dfb3b6640de5c1e6ed88434573917e643c28639 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.117 2010-02-08 10:29:22 franklahm Exp $
+ * $Id: volume.c,v 1.118 2010-02-19 01:26:03 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1252,6 +1252,7 @@ static void volume_free(struct vol *vol)
     free(vol->v_macname);
     vol->v_macname = NULL;
     free(vol->v_path);
+    free(vol->v_realpath);
     free(vol->v_password);
     free(vol->v_veto);
     free(vol->v_volcodepage);
@@ -1992,6 +1993,7 @@ int afp_openvol(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t
         LOG(log_error, logtype_afpd, "afp_openvol(%s): volume pathlen too long", volume->v_path);
         return AFPERR_MISC;
     }
+    volume->v_realpath = strdup(path);
 
     if (volume_codepage(obj, volume) < 0) {
         ret = AFPERR_MISC;
index da8f173bececd0c0ef5972759ff86b6972665862..3c47bf06b52e89276574517b7cd41e3e9d7b30da 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.h,v 1.13 2010-02-08 10:29:22 franklahm Exp $
+ * $Id: volume.h,v 1.14 2010-02-19 01:26:03 didg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -25,6 +25,7 @@ struct vol {
     u_int16_t       v_vid;
     int             v_flags;
     char            *v_path;
+    char            *v_realpath; /* canonical path */
     struct dir      *v_dir, *v_root;
     struct dir      *v_curdir;  /* cache */
     hash_t          *v_hash;