From 6b359ecc4653e503ea294f0dd148592d17b002a4 Mon Sep 17 00:00:00 2001 From: jmarcus Date: Fri, 8 Mar 2002 05:47:25 +0000 Subject: [PATCH] MFH: 1.40 Delete the specified file and not the parent directory. --- etc/afpd/file.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/etc/afpd/file.c b/etc/afpd/file.c index a55cc004..986f1cbe 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -1,5 +1,5 @@ /* - * $Id: file.c,v 1.29.2.6 2002-03-05 02:08:12 jmarcus Exp $ + * $Id: file.c,v 1.29.2.7 2002-03-08 05:47:25 jmarcus Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -1474,6 +1474,7 @@ int ibuflen, *rbuflen; char *upath; int err; cnid_t id; + cnid_t fileid; u_short vid; #ifdef DEBUG @@ -1495,7 +1496,8 @@ int ibuflen, *rbuflen; memcpy(&id, ibuf, sizeof( id )); ibuf += sizeof(id); - + fileid = id; + if ((upath = cnid_resolve(vol->v_db, &id)) == NULL) { return AFPERR_NOID; } @@ -1523,7 +1525,7 @@ int ibuflen, *rbuflen; if (S_ISDIR(st.st_mode)) return AFPERR_BADTYPE; - if (cnid_delete(vol->v_db, id)) { + if (cnid_delete(vol->v_db, fileid)) { switch (errno) { case EROFS: return AFPERR_VLOCK; -- 2.39.2