]> arthur.barton.de Git - netatalk.git/commitdiff
afpd/file: fix check in deletefile
authorRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Wed, 13 Feb 2013 21:18:41 +0000 (22:18 +0100)
committerRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Wed, 13 Feb 2013 21:18:41 +0000 (22:18 +0100)
AD_RSRC_OPEN(ad) is defined as:

(((ad)->ad_reso_refcount) && (ad_reso_fileno(ad) >= 0))

So there's no way it can returns -1

Reported by coverity as CID #762087.

etc/afpd/file.c

index e48afe213896e67c0595bad9027b2d647b688c6e..e7859659bd05ba996b91bd5c052ed6153cddef58 100644 (file)
@@ -1580,7 +1580,7 @@ int deletefile(const struct vol *vol, int dirfd, char *file, int checkAttrib)
         adp = &ad;
     }
 
-    if ( adp && AD_RSRC_OPEN(adp) != -1 ) { /* there's a resource fork */
+    if ( adp && AD_RSRC_OPEN(adp) ) { /* there's a resource fork */
         adflags |= ADFLAGS_RF;
         /* FIXME we have a pb here because we want to know if a file is open 
          * there's a 'priority inversion' if you can't open the ressource fork RW