From: Derrick Brashear Date: Wed, 9 Nov 2011 15:34:10 +0000 (-0500) Subject: viced: avoid bogus handle in rename X-Git-Tag: upstream/1.8.0_pre1^2~3069 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a1669f3e37299c11bf29a458212e03d1bdb22334;p=packages%2Fo%2Fopenafs.git viced: avoid bogus handle in rename because fileptr's handle can be reset during CopyOnWrite we need to SetDirHandle after that call FIXES 130215 Change-Id: I8578d30da42bdd9be2c552cdac4d2c526c22ee45 Reviewed-on: http://gerrit.openafs.org/5818 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear --- diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index 8bfb4c6b5..5848f89c5 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -3767,6 +3767,9 @@ SAFSS_Rename(struct rx_call *acall, struct AFSFid *OldDirFid, char *OldName, ViceLog(25, ("Rename : calling CopyOnWrite on target dir\n")); if ((errorCode = CopyOnWrite(fileptr, volptr, 0, MAXFSIZE))) goto Bad_Rename; + /* since copyonwrite would mean fileptr has a new handle, do it here */ + FidZap(&filedir); + SetDirHandle(&filedir, fileptr); } /* If the new name exists already, delete it and the file it points to */