]> arthur.barton.de Git - netatalk.git/commit
Opening files without metadata EA may result in broken metadata EA
authorRalph Boehme <sloowfranklin@gmail.com>
Wed, 27 Mar 2013 16:18:22 +0000 (17:18 +0100)
committerRalph Boehme <sloowfranklin@gmail.com>
Thu, 28 Mar 2013 09:58:24 +0000 (10:58 +0100)
commit8a31fe1c9da97425ff8636da56dbbec914f754b3
treeba2c1995a085e0fd02e0affca156f14c5eb343c7
parent88fba6fbb4201f715f2700bd3637ec6a57861a1b
Opening files without metadata EA may result in broken metadata EA

ad_open_hf_ea() calls ad_flush() after initializing the new metadata,
but in ad_flush() ad_flush_ea() wasn't called because we didn't
yet increment the refcount.
Fix this by increasing the refcount in ad_open_hf() before calling
into ad_open_hf_ea(), decrementing it again in case of an error.

This ensure a valid metadata EA is created, but it still doesn't
set the CNID field values. Therefor in afp_openfork() we must check
whether the ad_open() created a metadata EA and then set the CNID
info.

Finally, check for malformed metadata EAs and delete them.

Fixes bug #510.
NEWS
etc/afpd/fork.c
libatalk/adouble/ad_open.c