/*
- * $Id: file.c,v 1.55 2002-09-05 14:52:05 didg Exp $
+ * $Id: file.c,v 1.59 2002-09-11 03:03:27 didg Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
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;
* 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 */
return( AFPERR_PARAM );
}
}
-
- if ( (err = copyfile(p, upath, newname,
- vol_noadouble(vol))) < 0 ) {
+ upath = mtoupath(vol, newname);
+ if ( (err = copyfile(p, upath , newname, vol_noadouble(vol))) < 0 ) {
return err;
}
- setvoltime(obj, vol );
-
#ifdef DROPKLUDGE
if (vol->v_flags & AFPVOL_DROPBOX) {
- retvalue=matchfile2dirperms(newname, vol, sdid);
+ retvalue=matchfile2dirperms(upath, vol, ddid); /* FIXME sdir or ddid */
}
#endif /* DROPKLUDGE */
+ setvoltime(obj, vol );
+
#ifdef DEBUG
LOG(log_info, logtype_afpd, "end afp_copyfile:");
#endif /* DEBUG */
char filebuf[8192];
int sfd, dfd, len, err = AFP_OK;
ssize_t cc;
- char *dpath;
+ char dpath[ MAXPATHLEN + 1];
int admode;
#ifdef DEBUG
LOG(log_info, logtype_afpd, "begin copyfile:");
#endif /* DEBUG */
- dpath = ad_path( dst, ADFLAGS_HF );
+ strcpy(dpath, ad_path( dst, ADFLAGS_HF ));
admode = ad_mode( dst, 0666 );
if (newname) {
if ((sfd = open( ad_path( src, ADFLAGS_HF ), O_RDONLY, 0 )) < 0 ) {