]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/enumerate.c
Merge from 2-1
[netatalk.git] / etc / afpd / enumerate.c
index 61ae747e677b2ea4d17ffa7dd442702e921806e0..daa83a693a2557e82c106839f5d2dcc278046f2e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: enumerate.c,v 1.48.2.1 2010-02-01 10:56:08 franklahm Exp $
+ * $Id: enumerate.c,v 1.49 2010/02/10 14:05:37 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -286,7 +286,7 @@ static int enumerate(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_,
     if ( sindex == 1 || curdir->d_did != sd.sd_did || vid != sd.sd_vid ) {
         sd.sd_last = sd.sd_buf;
         /* if dir was in the cache we don't have the inode */
-        if (( !o_path->st_valid && stat( ".", &o_path->st ) < 0 ) ||
+        if (( !o_path->st_valid && lstat( ".", &o_path->st ) < 0 ) ||
               (ret = for_each_dirent(vol, ".", enumerate_loop, (void *)&sd)) < 0) 
         {
             switch (errno) {
@@ -377,7 +377,7 @@ static int enumerate(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_,
                 continue;
             }
             int len = strlen(s_path.u_name);
-            if ((dir = dircache_search_by_name(vol, curdir->d_did, s_path.u_name, len)) == NULL) {
+            if ((dir = dircache_search_by_name(vol, curdir, s_path.u_name, len)) == NULL) {
                 if ((dir = dir_add(vol, curdir, &s_path, len)) == NULL) {
                     LOG(log_error, logtype_afpd, "enumerate(vid:%u, did:%u, name:'%s'): error adding dir: '%s'",
                         ntohs(vid), ntohl(did), o_path->u_name, s_path.u_name);