X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fenumerate.c;h=80141e801850fa54f047c28dfd57fcadc108289a;hb=acb180395693ed05a4e6a1edb6796c8e6f644a72;hp=021862e76a87e974ef54d399eff5f14527886c4a;hpb=8fed5c3721b742930a3789f58c104d2a7a234dcf;p=netatalk.git diff --git a/etc/afpd/enumerate.c b/etc/afpd/enumerate.c index 021862e7..80141e80 100644 --- a/etc/afpd/enumerate.c +++ b/etc/afpd/enumerate.c @@ -284,7 +284,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 && lstat( ".", &o_path->st ) < 0 ) || + if (( !o_path->st_valid && ostat(".", &o_path->st, vol_syml_opt(vol)) < 0 ) || (ret = for_each_dirent(vol, ".", enumerate_loop, (void *)&sd)) < 0) { LOG(log_error, logtype_afpd, "enumerate: loop error: %s (%d)", strerror(errno), errno); @@ -353,10 +353,9 @@ static int enumerate(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, s_path.u_name = sd.sd_last; if (ad_convert(sd.sd_last, &s_path.st, vol, &convname) == 0 && convname) { s_path.u_name = (char *)convname; - s_path.unconverted_name = sd.sd_last; /* Needed for CNID fixup */ } - if (of_stat( &s_path) < 0 ) { + if (of_stat(vol, &s_path) < 0 ) { /* so the next time it won't try to stat it again * another solution would be to invalidate the cache with * sd.sd_did = 0 but if it's not ENOENT error it will start again @@ -371,7 +370,7 @@ static int enumerate(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, if (convname) { s_path.id = cnid_lookup(vol->v_cdb, &s_path.st, curdir->d_did, sd.sd_last, strlen(sd.sd_last)); if (s_path.id != CNID_INVALID) { - if (cnid_update(vol->v_cdb, s_path.id, &s_path.st, curdir->d_did, convname, strlen(convname)) != 0) + if (cnid_update(vol->v_cdb, s_path.id, &s_path.st, curdir->d_did, (char *)convname, strlen(convname)) != 0) LOG(log_error, logtype_afpd, "enumerate: error updating CNID of \"%s\"", fullpathname(convname)); } } @@ -405,7 +404,7 @@ static int enumerate(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, } /* files are added to the dircache in getfilparams() -> getmetadata() */ if (AFP_OK != ( ret = getfilparams(obj, vol, fbitmap, &s_path, curdir, - data + header , &esz )) ) { + data + header, &esz, 1)) ) { return( ret ); } }