Fossil SCM
Make sure it is not possible to add files that are outside of the current checkout.
Commit
c6f32a262d590d318ab508f6b77a5fbad54ad900
Parent
32bb2a31f4ea05f…
1 file changed
+5
+5
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -270,10 +270,15 @@ | ||
| 270 | 270 | /* Load the names of all files that are to be added into sfile temp table */ |
| 271 | 271 | for(i=2; i<g.argc; i++){ |
| 272 | 272 | char *zName; |
| 273 | 273 | int isDir; |
| 274 | 274 | Blob fullName; |
| 275 | + | |
| 276 | + /* file_tree_name() throws a fatal error if g.argv[i] is outside of the | |
| 277 | + ** checkout. */ | |
| 278 | + file_tree_name(g.argv[i], &fullName, 1); | |
| 279 | + blob_reset(&fullName); | |
| 275 | 280 | |
| 276 | 281 | file_canonical_name(g.argv[i], &fullName, 0); |
| 277 | 282 | zName = blob_str(&fullName); |
| 278 | 283 | isDir = file_wd_isdir(zName); |
| 279 | 284 | if( isDir==1 ){ |
| 280 | 285 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -270,10 +270,15 @@ | |
| 270 | /* Load the names of all files that are to be added into sfile temp table */ |
| 271 | for(i=2; i<g.argc; i++){ |
| 272 | char *zName; |
| 273 | int isDir; |
| 274 | Blob fullName; |
| 275 | |
| 276 | file_canonical_name(g.argv[i], &fullName, 0); |
| 277 | zName = blob_str(&fullName); |
| 278 | isDir = file_wd_isdir(zName); |
| 279 | if( isDir==1 ){ |
| 280 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -270,10 +270,15 @@ | |
| 270 | /* Load the names of all files that are to be added into sfile temp table */ |
| 271 | for(i=2; i<g.argc; i++){ |
| 272 | char *zName; |
| 273 | int isDir; |
| 274 | Blob fullName; |
| 275 | |
| 276 | /* file_tree_name() throws a fatal error if g.argv[i] is outside of the |
| 277 | ** checkout. */ |
| 278 | file_tree_name(g.argv[i], &fullName, 1); |
| 279 | blob_reset(&fullName); |
| 280 | |
| 281 | file_canonical_name(g.argv[i], &fullName, 0); |
| 282 | zName = blob_str(&fullName); |
| 283 | isDir = file_wd_isdir(zName); |
| 284 | if( isDir==1 ){ |
| 285 |