ok -
I'm attaching the patch to fix this problem. It is based off of 1.11.1p1.
Let me know if there is anything that you would like done/changed.
Thanks!
donald
On Wed, May 23, 2001 at 01:23:56PM -0400, Larry Jones wrote:
> Donald Sharp writes:
> >
> > I am at a quandary as to how I can write test cases for it.
>
> We recognized long ago that some things were just too awkward to test as
> part of the test suite. I think this probably falls into that category.
>
> -Larry Jones
>
> You're just trying to get RID of me, aren't you? -- Calvin
Index: ChangeLog
===================================================================
RCS file: /home2/cvsroot/ccvs/src/ChangeLog,v
retrieving revision 1.2117
diff -c -r1.2117 ChangeLog
*** ChangeLog 27 Apr 2001 20:45:17 -0000 1.2117
--- ChangeLog 23 May 2001 18:23:54 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2001-05-23 Donald Sharp <[EMAIL PROTECTED]>
+
+ * checkout.c: Fixed problem where it was possible to checkout code
+ inside of a repository due to automounter and nfs issues.
+
2001-04-27 Derek Price <[EMAIL PROTECTED]>
* version.c: Regenerated.
Index: checkout.c
===================================================================
RCS file: /home2/cvsroot/ccvs/src/checkout.c,v
retrieving revision 1.98
diff -c -r1.98 checkout.c
*** checkout.c 16 Apr 2001 17:53:10 -0000 1.98
--- checkout.c 23 May 2001 18:23:54 -0000
***************
*** 422,428 ****
retval = 1;
}
else
! retval = 1;
free (current);
return retval;
}
--- 422,461 ----
retval = 1;
}
else
! {
! char *root_hardpath;
! size_t root_hardpath_len;
! if( chdir( hardpath ) == -1 )
! {
! retval = 0;
! }
!
! root_hardpath = xgetwd();
! if( root_hardpath == NULL )
! error( 1, errno, "could not get working directory" );
! root_hardpath_len = strlen( root_hardpath );
! if( strlen( current ) >= root_hardpath_len
! && strncmp( current, root_hardpath, root_hardpath_len ) == 0 )
! {
! if( /* Current is a subdirectory of hardpath. */
! current[root_hardpath_len] == '/'
!
! /* Current is hardpath itself. */
! || current[root_hardpath_len] == '\0')
! retval = 0;
! else
! /* It isn't a problem. For example, current is
! "/foo/cvsroot-bar" and hardpath is "/foo/cvsroot". */
! retval = 1;
! }
! else
! retval = 1;
!
! if( chdir( current ) == -1 )
! {
! retval = 0;
! }
! }
free (current);
return retval;
}