From: Andrew Deason Date: Mon, 16 May 2011 20:02:14 +0000 (-0500) Subject: viced: Check vnode length on Rename and Link X-Git-Tag: upstream/1.8.0_pre1^2~3746 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=6df5547a7b93af74bc49ec8d4678aafd646dda1b;p=packages%2Fo%2Fopenafs.git viced: Check vnode length on Rename and Link Commit 2578555d7e08131bf2fe4cdd0aa4b32567a76eb2 added vnode length checks when we create or remove vnodes, but not during Rename and Link operations (when vnodes are neither created nor destroyed). Add the check in Rename and Link. Change-Id: I8008380a2b9e286d2dcdabaed5ceba97909dbb37 Reviewed-on: http://gerrit.openafs.org/4668 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 05d8ae491..b2dac045f 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -4007,6 +4007,13 @@ SAFSS_Rename(struct rx_call *acall, struct AFSFid *OldDirFid, char *OldName, goto Bad_Rename; } + if (CheckLength(volptr, oldvptr, -1) || + CheckLength(volptr, newvptr, -1)) { + VTakeOffline(volptr); + errorCode = VSALVAGE; + goto Bad_Rename; + } + /* The CopyOnWrite might return ENOSPC ( disk full). Even if the second * call to CopyOnWrite returns error, it is not necessary to revert back * the effects of the first call because the contents of the volume is @@ -4697,6 +4704,12 @@ SAFSS_Link(struct rx_call *acall, struct AFSFid *DirFid, char *Name, goto Bad_Link; } + if (CheckLength(volptr, parentptr, -1)) { + VTakeOffline(volptr); + errorCode = VSALVAGE; + goto Bad_Link; + } + /* get the file vnode */ if ((errorCode = CheckVnode(ExistingFid, &volptr, &targetptr, WRITE_LOCK))) {