X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fenumerate.c;fp=etc%2Fafpd%2Fenumerate.c;h=1a44aa7f6afb210d11aa98a957920f9b17cf8d63;hb=da7769828f3f6048e81ecac1e837852ce02a5158;hp=4867640d8d63d9884cb148c2c7360722f80f2a6a;hpb=38e94665946a785acecab92ae88f15585ecd546e;p=netatalk.git diff --git a/etc/afpd/enumerate.c b/etc/afpd/enumerate.c index 4867640d..1a44aa7f 100644 --- a/etc/afpd/enumerate.c +++ b/etc/afpd/enumerate.c @@ -365,6 +365,10 @@ static int enumerate(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, sd.sd_last += len + 1; s_path.m_name = NULL; + + /* Convert adouble:v2 to adouble:ea on the fly */ + (void)ad_convert(s_path.u_name, &s_path.st, vol); + /* * If a fil/dir is not a dir, it's a file. This is slightly * inaccurate, since that means /dev/null is a file, /dev/printer @@ -440,6 +444,15 @@ static int enumerate(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, if ( actcnt == 0 ) { sd.sd_did = 0; /* invalidate sd struct to force re-read */ + /* + * in case were converting adouble stuff: + * after enumerating the whole dir we should have converted everything + * thus the .AppleDouble dir shouls be empty thus we can no try to + * delete it + */ + if (vol->v_adouble == AD_VERSION_EA && ! (vol->v_flags & AFPVOL_NOV2TOEACONV)) + (void)rmdir(".AppleDouble"); + return( AFPERR_NOOBJ ); } sd.sd_sindex = sindex + actcnt;