Fossil

Check-in [13cfef3383]
Login

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

Overview
Comment:Add the "fossil test-nondir-path" command for testing parts of the new symlink logic.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | sec2020
Files: files | file ages | folders
SHA3-256: 13cfef3383968d3aff5ad94050472416f00c9e25eace59d826adb3d83e93206b
User & Date: drh 2020-08-19 15:21:38.460
Context
2020-08-19
15:26
Remove the --symlinks option from the "fossil open" command. It is not needed. Users who want to enable symlinks can use the "fossil settings" command first. check-in: ff811934e0 user: drh tags: sec2020
15:21
Add the "fossil test-nondir-path" command for testing parts of the new symlink logic. check-in: 13cfef3383 user: drh tags: sec2020
12:26
Fix harmless compiler warnings. check-in: feef827504 user: drh tags: sec2020
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/file.c.
368
369
370
371
372
373
374






















375
376
377
378
379
380
381
    }
    z[j] = '/';
    i = j;
  }
  fossil_free(z);
  return 0;
}























/*
** The file named zFile is suppose to be an in-tree file.  Check to
** ensure that it will be safe to write to this file by verifying that
** there are no symlinks or other non-directory objects in between the
** root of the checkout and zFile.
**







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
    }
    z[j] = '/';
    i = j;
  }
  fossil_free(z);
  return 0;
}

/*
** COMMAND: test-nondir-path
** Usage: %fossil test-nondir-path ROOT FILE
**
** If there are any objects on the path from ROOT to FILE (exluding
** ROOT and FILE themselves) that are not directories, then print
** the name of the first object found.
*/
void test_nondir_path_cmd(void){
  int n;
  if( g.argc!=4 ){
    usage("ROOT FILE");
  }
  if( fossil_strnicmp(g.argv[2],g.argv[3],(int)strlen(g.argv[2]))!=0 ){
    fossil_fatal("%s should be a prefix of %s", g.argv[2], g.argv[3]);
  }
  n = file_nondir_objects_on_path(g.argv[2],g.argv[3]);
  if( n ){
    fossil_print("%.*s\n", n, g.argv[3]);
  }
}

/*
** The file named zFile is suppose to be an in-tree file.  Check to
** ensure that it will be safe to write to this file by verifying that
** there are no symlinks or other non-directory objects in between the
** root of the checkout and zFile.
**