Differences From:
File
src/file.c
part of check-in
[e63a9fd9d0]
- Fixed many uninitialized variable warnings and some potential bug found via -Wall -Werror on gcc.
by
jnc on
2007-09-25 21:21:35.
Also file
src/file.c
part of check-in
[92291035fe]
- Merged the compiler warning fixes into mainstream
by
jnc on
2007-09-25 21:28:30.
Also file
src/file.c
part of check-in
[d0305b305a]
- Merged mainline into my branch to get the newest application.
by
aku on
2007-12-05 08:07:46.
[view]
To:
File
src/file.c
part of check-in
[b3ec774ab7]
- Fail with an error if a file is outside the checkout tree.
by
drh on
2008-02-08 16:24:24.
[view]
@@ -285,10 +285,10 @@
}
/*
** Compute a pathname for a file relative to the root of the local
-** tree. Return TRUE on success and FALSE if the file is not contained
-** in the local tree.
+** tree. Return TRUE on success. On failure, print and error
+** message and quit.
**
** The root of the tree is defined by the g.zLocalRoot variable.
*/
int file_tree_name(const char *zOrigName, Blob *pOut){
@@ -298,8 +298,9 @@
file_canonical_name(zOrigName, &full);
n = strlen(g.zLocalRoot);
if( blob_size(&full)<=n || memcmp(g.zLocalRoot, blob_buffer(&full), n) ){
blob_reset(&full);
+ fossil_fatal("file outside of checkout tree: %s", zOrigName);
return 0;
}
blob_zero(pOut);
blob_append(pOut, blob_buffer(&full)+n, blob_size(&full)-n);