With appledouble = v2 in afp.conf there is an fd leak in certain
circumstances while using the Finder, from Daniel Hazelbaker.
Signed-off-by: Ralph Boehme <rb@sernet.de>
* NEW: afpd: support for using $u username variable in AFP volume
definitions. FR#90.
* FIX: getvolbypath returns incorrect volume, bug #563
+* FIX: fd leak when using appledouble = v2, bug #554
Changes in 3.1.1
================
}
if (adflags & ADFLAGS_RF) {
+ /* HF is automatically opened when opening an RF, close it. */
+ if ((ad->ad_vers == AD_VERSION2) && (ad_meta_fileno(ad) != -1)) {
+ if (ad->ad_meta_refcount)
+ ad->ad_meta_refcount--;
+ if (!(--ad->ad_mdp->adf_refcount)) {
+ if (close( ad_meta_fileno(ad)) < 0)
+ err = -1;
+ ad_meta_fileno(ad) = -1;
+ }
+ }
+
if (ad->ad_reso_refcount)
if (--ad->ad_reso_refcount == 0)
adf_lock_free(ad->ad_rfp);