]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/appl.c
Merge remote branch 'sf/product-2-2' into develop
[netatalk.git] / etc / afpd / appl.c
index 2f3079f47b6f35fc91af185609c24523789ac615..3cba16e0c2ae7eab2fe07c28a4cbc6b11498ad85 100644 (file)
@@ -23,6 +23,7 @@
 #include <atalk/bstrlib.h>
 #include <atalk/bstradd.h>
 #include <atalk/globals.h>
+#include <atalk/netatalk_conf.h>
 
 #include "volume.h"
 #include "directory.h"
@@ -250,6 +251,7 @@ int afp_addappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, siz
     mpath = obj->newtmp;
     mp = makemacpath( vol, mpath, AFPOBJ_TMPSIZ, curdir, path->m_name );
     if (!mp) {
+        close(tfd);
         return AFPERR_PARAM;
     }
     mplen =  mpath + AFPOBJ_TMPSIZ - mp;
@@ -263,6 +265,7 @@ int afp_addappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, siz
     memcpy(p, appltag, sizeof( appltag ));
     cc = mpath + AFPOBJ_TMPSIZ - p;
     if ( write( tfd, p, cc ) != cc ) {
+        close(tfd);
         unlink( tempfile );
         return( AFPERR_PARAM );
     }
@@ -333,6 +336,7 @@ int afp_rmvappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, siz
     mpath = obj->newtmp;
     mp = makemacpath( vol, mpath, AFPOBJ_TMPSIZ, curdir, path->m_name );
     if (!mp) {
+        close(tfd);
         return AFPERR_PARAM ;
     }
 
@@ -479,8 +483,8 @@ int afp_getappl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t
         return( AFPERR_NOITEM );
     }
     buflen = *rbuflen - sizeof( bitmap ) - sizeof( appltag );
-    if ( getfilparams(vol, bitmap, path, curdir, rbuf + sizeof( bitmap ) +
-                      sizeof( appltag ), &buflen ) != AFP_OK ) {
+    if ( getfilparams(obj, vol, bitmap, path, curdir, rbuf + sizeof( bitmap ) +
+                      sizeof( appltag ), &buflen, 0) != AFP_OK ) {
         *rbuflen = 0;
         return( AFPERR_BITMAP );
     }