/*
- * $Id: appl.c,v 1.18.4.1 2010-02-01 10:56:08 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#include <atalk/afp.h>
#include <atalk/bstrlib.h>
#include <atalk/bstradd.h>
+#include <atalk/globals.h>
+#include <atalk/netatalk_conf.h>
#include "volume.h"
-#include "globals.h"
#include "directory.h"
#include "file.h"
#include "desktop.h"
{
int cc;
char *p;
- u_int16_t len;
- u_char appltag[ 4 ];
+ uint16_t len;
+ unsigned char appltag[ 4 ];
char buf[ MAXPATHLEN ];
while (( cc = read( sfd, buf, sizeof(appltag) + sizeof( u_short ))) > 0 ) {
}
/* next part */
- if ((uname = cnid_resolve(vol->v_cdb, &cnid, buffer, buflen)) == NULL ) {
+ AFP_CNID_START("cnid_resolve");
+ uname = cnid_resolve(vol->v_cdb, &cnid, buffer, buflen);
+ AFP_CNID_DONE();
+
+ if (uname == NULL) {
afp_errno = AFPERR_NOOBJ;
ret = NULL;
goto exit;
struct vol *vol;
struct dir *dir;
int tfd, cc;
- u_int32_t did;
- u_int16_t vid, mplen;
+ uint32_t did;
+ uint16_t vid, mplen;
struct path *path;
char *dtf, *p, *mp;
- u_char creator[ 4 ];
- u_char appltag[ 4 ];
+ unsigned char creator[ 4 ];
+ unsigned char appltag[ 4 ];
char *mpath, *tempfile;
*rbuflen = 0;
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;
memcpy(p, appltag, sizeof( appltag ));
cc = mpath + AFPOBJ_TMPSIZ - p;
if ( write( tfd, p, cc ) != cc ) {
+ close(tfd);
unlink( tempfile );
return( AFPERR_PARAM );
}
struct vol *vol;
struct dir *dir;
int tfd, cc;
- u_int32_t did;
- u_int16_t vid, mplen;
+ uint32_t did;
+ uint16_t vid, mplen;
struct path *path;
char *dtf, *mp;
- u_char creator[ 4 ];
+ unsigned char creator[ 4 ];
char *tempfile, *mpath;
*rbuflen = 0;
mpath = obj->newtmp;
mp = makemacpath( vol, mpath, AFPOBJ_TMPSIZ, curdir, path->m_name );
if (!mp) {
+ close(tfd);
return AFPERR_PARAM ;
}
char *p, *q;
int cc;
size_t buflen;
- u_int16_t vid, aindex, bitmap, len;
- u_char creator[ 4 ];
- u_char appltag[ 4 ];
+ uint16_t vid, aindex, bitmap, len;
+ unsigned char creator[ 4 ];
+ unsigned char appltag[ 4 ];
char *buf, *cbuf;
struct path *path;
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 );
}