Fossil

Check-in [c6f32a26]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make sure it is not possible to add files that are outside of the current checkout.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:c6f32a262d590d318ab508f6b77a5fbad54ad900
User & Date: drh 2014-01-09 13:18:33
Context
2014-01-09
15:39
Delay activation of ticket hook until after the ticket tables have been rebuilt. check-in: dff7d2c1 user: jan.nijtmans tags: delay-ticket-hook
14:27
Add the --integrate option to the "commit" command. check-in: 82f69aa9 user: drh tags: trunk
13:18
Make sure it is not possible to add files that are outside of the current checkout. check-in: c6f32a26 user: drh tags: trunk
13:17
Add comments to better explain what it happening for the out-of-tree check in the "add" command. Closed-Leaf check-in: d83fc58d user: drh tags: pending-review
13:14
Missing "unhide" option in link to timeline. check-in: 32bb2a31 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/add.c.

268
269
270
271
272
273
274





275
276
277
278
279
280
281
  nRoot = strlen(g.zLocalRoot);
  
  /* Load the names of all files that are to be added into sfile temp table */
  for(i=2; i<g.argc; i++){
    char *zName;
    int isDir;
    Blob fullName;






    file_canonical_name(g.argv[i], &fullName, 0);
    zName = blob_str(&fullName);
    isDir = file_wd_isdir(zName);
    if( isDir==1 ){
      vfile_scan(&fullName, nRoot-1, scanFlags, pClean, pIgnore);
    }else if( isDir==0 ){







>
>
>
>
>







268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
  nRoot = strlen(g.zLocalRoot);
  
  /* Load the names of all files that are to be added into sfile temp table */
  for(i=2; i<g.argc; i++){
    char *zName;
    int isDir;
    Blob fullName;

    /* file_tree_name() throws a fatal error if g.argv[i] is outside of the
    ** checkout. */
    file_tree_name(g.argv[i], &fullName, 1);
    blob_reset(&fullName);

    file_canonical_name(g.argv[i], &fullName, 0);
    zName = blob_str(&fullName);
    isDir = file_wd_isdir(zName);
    if( isDir==1 ){
      vfile_scan(&fullName, nRoot-1, scanFlags, pClean, pIgnore);
    }else if( isDir==0 ){