* FIX: Opening files without metadata EA may result in an invalid
metadata EA. Check for malformed metadata EAs and delete them.
Fixes bug #510.
+* FIX: Fix an issue with filenames containing non-ASCII characters that
+ lead to a failure setting the size of a files ressource fork.
+ This affected application like Adobe Photoshop where saving
+ files may fail. Fixes bug #511.
Changes in 3.0.3
================
goto afp_setfork_err;
}
- err = ad_rtruncate(ofork->of_ad, size);
+ err = ad_rtruncate(ofork->of_ad, mtoupath(ofork->of_vol, of_name(ofork), ofork->of_did, utf8_encoding(obj)), size);
if (st_size > size)
ad_tmplock(ofork->of_ad, eid, ADLOCK_CLR, size, st_size -size, ofork->of_refnum);
if (err < 0)
extern ssize_t adf_pread(struct ad_fd *, void *, size_t, off_t);
extern ssize_t adf_pwrite(struct ad_fd *, const void *, size_t, off_t);
extern int ad_dtruncate(struct adouble *, off_t);
-extern int ad_rtruncate(struct adouble *, off_t);
+extern int ad_rtruncate(struct adouble *, const char *, off_t);
extern int copy_fork(int eid, struct adouble *add, struct adouble *ads);
/* ad_size.c */
}
/* ------------------------ */
-int ad_rtruncate( struct adouble *ad, const off_t size)
+int ad_rtruncate(struct adouble *ad, const char *uname, const off_t size)
{
EC_INIT;
#ifndef HAVE_EAFD
if (ad->ad_vers == AD_VERSION_EA && size == 0)
- EC_NEG1( unlink(ad->ad_ops->ad_path(ad->ad_name, 0)) );
+ EC_NEG1( unlink(ad->ad_ops->ad_path(uname, 0)) );
else
#endif
EC_NEG1( sys_ftruncate(ad_reso_fileno(ad), size + ad->ad_eid[ ADEID_RFORK ].ade_off) );
ad->ad_rlen = size;
else
LOG(log_error, logtype_ad, "ad_rtruncate(\"%s\"): %s",
- fullpathname(ad->ad_name), strerror(errno));
+ fullpathname(uname), strerror(errno));
EC_EXIT;
}