When copying some files from a netatalk share in the
Finder to the local disk,
the server sometimes unexpectedly disconnects (the afpd
segfaults).
I managed to track this down to the following sequence
of events. This
depends on the file in question having no .AppleDouble
entry. Try copying
the same file twice, without doing anything in between.
afp_openfork() is called on the data fork
afp_openfork() is called on the resource fork
-- the actual .AppleDouble file couldn't be opened,
but
-- the call succeeds anyway to imitate an empty
resource fork
afp_closefork() is called on the data fork returned
above
this call frees the struct adouble that's shared
by the
ofork entry. This happens because the file
descriptor for the
** data and resource forks are both now set to -1.
a subsequent call to getforkparams() on the still open
resource fork
is now referencing an invalid memory location in the
stale struct adouble.
I'm not sure what the best fix for this situation is,
but I made a temporary
fix by adding a simple reference count to struct
adouble which is maintained
by the code in afpd/ofork.c. I also ensure that the
memory allocated
for the struct adouble in of_alloc is memset() to 0 to
ensure absolutely
that ad_open initialises the structure (and the
refcount) correctly.
Logged In: NO
oh well -- attach file isn't working.
patch posted to netatalk-devel list (I don't think long
lines will fit in here)
Logged In: YES
user_id=55096
Has this bug been fixed yet or not? I can't figure out from
the cvs logs...
Logged In: YES
user_id=653
where is the patch ?
Logged In: YES
user_id=55096
Too old. Repost patch if bug is still present.