X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=etc%2Fafpd%2Ffile.c;h=6cac22b27f0852593f5ca2b46df4a9f737501710;hb=8a2f0d02022991ade37c8580c25bd8c166a3534e;hp=050450a2b10a765082b979b9da56086c4df962cd;hpb=eb4bb6e4f19ff76132e1d3a8b6886911e23f9286;p=netatalk.git diff --git a/etc/afpd/file.c b/etc/afpd/file.c index 050450a2..6cac22b2 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -1,5 +1,5 @@ /* - * $Id: file.c,v 1.123 2009-11-26 15:02:58 franklahm Exp $ + * $Id: file.c,v 1.124 2009-11-27 12:37:24 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -531,7 +531,7 @@ int getfilparams(struct vol *vol, adp = of_ad(vol, path, &ad); upath = path->u_name; - if ( ad_metadata( upath, flags, adp) < 0 ) { + if ( ad_metadata( upath, vol_noadouble(vol) | flags, adp) < 0 ) { switch (errno) { case EACCES: LOG(log_error, logtype_afpd, "getfilparams(%s): %s: check resource fork permission?", @@ -1498,7 +1498,11 @@ int deletefile(const struct vol *vol, char *file, int checkAttrib) if (checkAttrib) { /* was EACCESS error try to get only metadata */ ad_init(&ad, vol->v_adouble, vol->v_ad_options); - if ( ad_metadata( file , ADFLAGS_OPENFORKS, &ad) == 0 ) { + /* we never want to create a resource fork here, we are going to delete it + * moreover sometimes deletefile is called with a no existent file and + * ad_open would create a 0 byte resource fork + */ + if ( ad_metadata( file , ADFLAGS_NOADOUBLE | ADFLAGS_OPENFORKS, &ad) == 0 ) { ad_close( &ad, adflags ); if ((err = check_attrib(&ad))) { return err;