/*
- * $Id: file.c,v 1.57 2002-09-06 04:23:45 didg Exp $
+ * $Id: file.c,v 1.62 2002-10-05 14:04:47 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#include "filedir.h"
#include "globals.h"
-/* check for mtab DID code */
-#ifdef DID_MTAB
-#include "parse_mtab.h"
-#endif /* DID_MTAB */
-
/* the format for the finderinfo fields (from IM: Toolbox Essentials):
* field bytes subfield bytes
*
aint = htonl(( st->st_dev << 16 ) | (st->st_ino & 0x0000ffff));
#else /* USE_LASTDID */
lstp = lstat(upath, &lst) < 0 ? st : &lst;
-#ifdef DID_MTAB
- aint = htonl( afpd_st_cnid ( lstp ) );
-#else /* DID_MTAB */
aint = htonl(CNID(lstp, 1));
-#endif /* DID_MTAB */
#endif /* USE_LASTDID */
}
u_int16_t attrbits = 0;
int rc;
#ifdef DEBUG
- LOG(log_info, logtype_default, "begin getfilparams:");
+ LOG(log_info, logtype_afpd, "begin getfilparams:");
#endif /* DEBUG */
upath = mtoupath(vol, path);
struct adouble ad, *adp;
struct vol *vol;
struct dir *dir;
- struct ofork *of;
+ struct ofork *of = NULL;
char *path, *upath;
int creatf, did, openf, retvalue = AFP_OK;
u_int16_t vid;
memcpy(&did, ibuf, sizeof( did));
ibuf += sizeof( did );
- if (( dir = dirsearch( vol, did )) == NULL ) {
+ if (( dir = dirlookup( vol, did )) == NULL ) {
return( AFPERR_NOOBJ );
}
memcpy(&did, ibuf, sizeof( did ));
ibuf += sizeof( did );
- if (( dir = dirsearch( vol, did )) == NULL ) {
+ if (( dir = dirlookup( vol, did )) == NULL ) {
return( AFPERR_NOOBJ );
}
memcpy(&sdid, ibuf, sizeof( sdid ));
ibuf += sizeof( sdid );
- if (( dir = dirsearch( vol, sdid )) == NULL ) {
+ if (( dir = dirlookup( vol, sdid )) == NULL ) {
return( AFPERR_PARAM );
}
* and locks need to stay coherent. as a result,
* we just balk if the file is opened already. */
+ newname = obj->newtmp;
+ strcpy( newname, path );
+
upath = mtoupath(vol, newname );
if (of_findname(upath, NULL))
return AFPERR_DENYCONF;
- newname = obj->newtmp;
- strcpy( newname, path );
-
p = ctoupath( vol, curdir, newname );
#ifdef FORCE_UIDGID
/* FIXME svid != dvid && dvid's user can't read svid */
if (vol->v_flags & AFPVOL_RO)
return AFPERR_VLOCK;
- if (( dir = dirsearch( vol, ddid )) == NULL ) {
+ if (( dir = dirlookup( vol, ddid )) == NULL ) {
return( AFPERR_PARAM );
}
return( AFPERR_PARAM );
}
}
-
- if ( (err = copyfile(p, mtoupath(vol, newname),
- newname, vol_noadouble(vol))) < 0 ) {
+ upath = mtoupath(vol, newname);
+ if ( (err = copyfile(p, upath , newname, vol_noadouble(vol))) < 0 ) {
return err;
}
#ifdef DROPKLUDGE
if (vol->v_flags & AFPVOL_DROPBOX) {
- retvalue=matchfile2dirperms(newname, vol, sdid);
+ retvalue=matchfile2dirperms(upath, vol, ddid); /* FIXME sdir or ddid */
}
#endif /* DROPKLUDGE */
memcpy(&did, ibuf, sizeof( did ));
ibuf += sizeof(did);
- if (( dir = dirsearch( vol, did )) == NULL ) {
+ if (( dir = dirlookup( vol, did )) == NULL ) {
return( AFPERR_PARAM );
}
ibuf += sizeof(did);
/* source file */
- if ((dir = dirsearch( vol, sid )) == NULL ) {
+ if ((dir = dirlookup( vol, sid )) == NULL ) {
return( AFPERR_PARAM );
}
slen = strlen(supath));
#endif /* CNID_DB */
- if (( dir = dirsearch( vol, did )) == NULL ) {
+ if (( dir = dirlookup( vol, did )) == NULL ) {
return( AFPERR_PARAM );
}