Fossil SCM
Add '--no-dir-symlinks' command line option, which prevents traversing into symlinked directories. Make the '--verily' option to 'clean' imply '--no-dir-symlinks'.
Commit
8e659df6965e8176a985b8c5b9b133f2837c07d4
Parent
b1026f20ccc7f96…
11 files changed
+4
+12
-6
+12
-6
+8
-1
+5
-4
+1
+1
+2
+2
+1
+3
+4
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -276,10 +276,11 @@ | ||
| 276 | 276 | ** -f|--force Add files without prompting |
| 277 | 277 | ** --ignore <CSG> Ignore files matching patterns from the |
| 278 | 278 | ** comma separated list of glob patterns. |
| 279 | 279 | ** --clean <CSG> Also ignore files matching patterns from |
| 280 | 280 | ** the comma separated list of glob patterns. |
| 281 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 281 | 282 | ** |
| 282 | 283 | ** See also: addremove, rm |
| 283 | 284 | */ |
| 284 | 285 | void add_cmd(void){ |
| 285 | 286 | int i; /* Loop counter */ |
| @@ -441,10 +442,11 @@ | ||
| 441 | 442 | ** --soft Skip removing files from the checkout. |
| 442 | 443 | ** This supersedes the --hard option. |
| 443 | 444 | ** --hard Remove files from the checkout. |
| 444 | 445 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| 445 | 446 | ** -n|--dry-run If given, display instead of run actions. |
| 447 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 446 | 448 | ** |
| 447 | 449 | ** See also: addremove, add |
| 448 | 450 | */ |
| 449 | 451 | void delete_cmd(void){ |
| 450 | 452 | int i; |
| @@ -622,10 +624,11 @@ | ||
| 622 | 624 | ** --ignore <CSG> Ignore files matching patterns from the |
| 623 | 625 | ** comma separated list of glob patterns. |
| 624 | 626 | ** --clean <CSG> Also ignore files matching patterns from |
| 625 | 627 | ** the comma separated list of glob patterns. |
| 626 | 628 | ** -n|--dry-run If given, display instead of run actions. |
| 629 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 627 | 630 | ** |
| 628 | 631 | ** See also: add, rm |
| 629 | 632 | */ |
| 630 | 633 | void addremove_cmd(void){ |
| 631 | 634 | Blob path; |
| @@ -849,10 +852,11 @@ | ||
| 849 | 852 | ** --soft Skip moving files within the checkout. |
| 850 | 853 | ** This supersedes the --hard option. |
| 851 | 854 | ** --hard Move files within the checkout. |
| 852 | 855 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| 853 | 856 | ** -n|--dry-run If given, display instead of run actions. |
| 857 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 854 | 858 | ** |
| 855 | 859 | ** See also: changes, status |
| 856 | 860 | */ |
| 857 | 861 | void mv_cmd(void){ |
| 858 | 862 | int i; |
| 859 | 863 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -276,10 +276,11 @@ | |
| 276 | ** -f|--force Add files without prompting |
| 277 | ** --ignore <CSG> Ignore files matching patterns from the |
| 278 | ** comma separated list of glob patterns. |
| 279 | ** --clean <CSG> Also ignore files matching patterns from |
| 280 | ** the comma separated list of glob patterns. |
| 281 | ** |
| 282 | ** See also: addremove, rm |
| 283 | */ |
| 284 | void add_cmd(void){ |
| 285 | int i; /* Loop counter */ |
| @@ -441,10 +442,11 @@ | |
| 441 | ** --soft Skip removing files from the checkout. |
| 442 | ** This supersedes the --hard option. |
| 443 | ** --hard Remove files from the checkout. |
| 444 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| 445 | ** -n|--dry-run If given, display instead of run actions. |
| 446 | ** |
| 447 | ** See also: addremove, add |
| 448 | */ |
| 449 | void delete_cmd(void){ |
| 450 | int i; |
| @@ -622,10 +624,11 @@ | |
| 622 | ** --ignore <CSG> Ignore files matching patterns from the |
| 623 | ** comma separated list of glob patterns. |
| 624 | ** --clean <CSG> Also ignore files matching patterns from |
| 625 | ** the comma separated list of glob patterns. |
| 626 | ** -n|--dry-run If given, display instead of run actions. |
| 627 | ** |
| 628 | ** See also: add, rm |
| 629 | */ |
| 630 | void addremove_cmd(void){ |
| 631 | Blob path; |
| @@ -849,10 +852,11 @@ | |
| 849 | ** --soft Skip moving files within the checkout. |
| 850 | ** This supersedes the --hard option. |
| 851 | ** --hard Move files within the checkout. |
| 852 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| 853 | ** -n|--dry-run If given, display instead of run actions. |
| 854 | ** |
| 855 | ** See also: changes, status |
| 856 | */ |
| 857 | void mv_cmd(void){ |
| 858 | int i; |
| 859 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -276,10 +276,11 @@ | |
| 276 | ** -f|--force Add files without prompting |
| 277 | ** --ignore <CSG> Ignore files matching patterns from the |
| 278 | ** comma separated list of glob patterns. |
| 279 | ** --clean <CSG> Also ignore files matching patterns from |
| 280 | ** the comma separated list of glob patterns. |
| 281 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 282 | ** |
| 283 | ** See also: addremove, rm |
| 284 | */ |
| 285 | void add_cmd(void){ |
| 286 | int i; /* Loop counter */ |
| @@ -441,10 +442,11 @@ | |
| 442 | ** --soft Skip removing files from the checkout. |
| 443 | ** This supersedes the --hard option. |
| 444 | ** --hard Remove files from the checkout. |
| 445 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| 446 | ** -n|--dry-run If given, display instead of run actions. |
| 447 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 448 | ** |
| 449 | ** See also: addremove, add |
| 450 | */ |
| 451 | void delete_cmd(void){ |
| 452 | int i; |
| @@ -622,10 +624,11 @@ | |
| 624 | ** --ignore <CSG> Ignore files matching patterns from the |
| 625 | ** comma separated list of glob patterns. |
| 626 | ** --clean <CSG> Also ignore files matching patterns from |
| 627 | ** the comma separated list of glob patterns. |
| 628 | ** -n|--dry-run If given, display instead of run actions. |
| 629 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 630 | ** |
| 631 | ** See also: add, rm |
| 632 | */ |
| 633 | void addremove_cmd(void){ |
| 634 | Blob path; |
| @@ -849,10 +852,11 @@ | |
| 852 | ** --soft Skip moving files within the checkout. |
| 853 | ** This supersedes the --hard option. |
| 854 | ** --hard Move files within the checkout. |
| 855 | ** --case-sensitive <BOOL> Override the case-sensitive setting. |
| 856 | ** -n|--dry-run If given, display instead of run actions. |
| 857 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 858 | ** |
| 859 | ** See also: changes, status |
| 860 | */ |
| 861 | void mv_cmd(void){ |
| 862 | int i; |
| 863 |
+12
-6
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -417,10 +417,11 @@ | ||
| 417 | 417 | ** --sha1sum Verify file status using SHA1 hashing rather than |
| 418 | 418 | ** relying on file mtimes. |
| 419 | 419 | ** --case-sensitive <BOOL> Override case-sensitive setting. |
| 420 | 420 | ** --dotfiles Include unmanaged files beginning with a dot. |
| 421 | 421 | ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns. |
| 422 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 422 | 423 | ** |
| 423 | 424 | ** Options specific to the changes command: |
| 424 | 425 | ** --header Identify the repository if report is non-empty. |
| 425 | 426 | ** -v|--verbose Say "(none)" if the change report is empty. |
| 426 | 427 | ** --classify Start each line with the file's change type. |
| @@ -824,10 +825,11 @@ | ||
| 824 | 825 | ** --abs-paths Display absolute pathnames. |
| 825 | 826 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 826 | 827 | ** --dotfiles include files beginning with a dot (".") |
| 827 | 828 | ** --header Identify the repository if there are extras |
| 828 | 829 | ** --ignore <CSG> ignore files matching patterns from the argument |
| 830 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 829 | 831 | ** --rel-paths Display pathnames relative to the current working |
| 830 | 832 | ** directory. |
| 831 | 833 | ** |
| 832 | 834 | ** See also: changes, clean, status |
| 833 | 835 | */ |
| @@ -853,13 +855,14 @@ | ||
| 853 | 855 | |
| 854 | 856 | if( zIgnoreFlag==0 ){ |
| 855 | 857 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 856 | 858 | } |
| 857 | 859 | pIgnore = glob_create(zIgnoreFlag); |
| 860 | + /* Always consider symlinks. */ | |
| 861 | + g.allowSymlinks = db_allow_symlinks_by_default(); | |
| 858 | 862 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 859 | 863 | glob_free(pIgnore); |
| 860 | - g.allowSymlinks = 1; /* Report on symbolic links */ | |
| 861 | 864 | |
| 862 | 865 | blob_zero(&report); |
| 863 | 866 | status_report(&report, flags); |
| 864 | 867 | if( blob_size(&report) ){ |
| 865 | 868 | if( showHdr ){ |
| @@ -931,14 +934,14 @@ | ||
| 931 | 934 | ** -i|--prompt Prompt before removing each file. This option |
| 932 | 935 | ** implies the --disable-undo option. |
| 933 | 936 | ** -x|--verily WARNING: Removes everything that is not a managed |
| 934 | 937 | ** file or the repository itself. This option |
| 935 | 938 | ** implies the --force, --emptydirs, --dotfiles, and |
| 936 | -** --disable-undo options. Furthermore, it completely | |
| 937 | -** disregards the keep-glob and ignore-glob settings. | |
| 938 | -** However, it does honor the --ignore and --keep | |
| 939 | -** options. | |
| 939 | +** --disable-undo, and --no-dir-symlinks options. | |
| 940 | +** Furthermore, it completely disregards the keep-glob | |
| 941 | +** and ignore-glob settings. However, it does honor | |
| 942 | +** the --ignore and --keep options. | |
| 940 | 943 | ** --clean <CSG> WARNING: Never prompt to delete any files matching |
| 941 | 944 | ** this comma separated list of glob patterns. Also, |
| 942 | 945 | ** deletions of any files matching this pattern list |
| 943 | 946 | ** cannot be undone. |
| 944 | 947 | ** --ignore <CSG> Ignore files matching patterns from the |
| @@ -947,10 +950,11 @@ | ||
| 947 | 950 | ** list of glob patterns. |
| 948 | 951 | ** -n|--dry-run Delete nothing, but display what would have been |
| 949 | 952 | ** deleted. |
| 950 | 953 | ** --no-prompt This option disables prompting the user for input |
| 951 | 954 | ** and assumes an answer of 'No' for every question. |
| 955 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 952 | 956 | ** --temp Remove only Fossil-generated temporary files. |
| 953 | 957 | ** -v|--verbose Show all files as they are removed. |
| 954 | 958 | ** |
| 955 | 959 | ** See also: addremove, extras, status |
| 956 | 960 | */ |
| @@ -995,10 +999,11 @@ | ||
| 995 | 999 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 996 | 1000 | emptyDirsFlag = 1; |
| 997 | 1001 | disableUndo = 1; |
| 998 | 1002 | scanFlags |= SCAN_ALL; |
| 999 | 1003 | zCleanFlag = 0; |
| 1004 | + g.fNoDirSymlinks = 1; | |
| 1000 | 1005 | } |
| 1001 | 1006 | if( zIgnoreFlag==0 && !verilyFlag ){ |
| 1002 | 1007 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 1003 | 1008 | } |
| 1004 | 1009 | if( zKeepFlag==0 && !verilyFlag ){ |
| @@ -1011,11 +1016,12 @@ | ||
| 1011 | 1016 | verify_all_options(); |
| 1012 | 1017 | pIgnore = glob_create(zIgnoreFlag); |
| 1013 | 1018 | pKeep = glob_create(zKeepFlag); |
| 1014 | 1019 | pClean = glob_create(zCleanFlag); |
| 1015 | 1020 | nRoot = (int)strlen(g.zLocalRoot); |
| 1016 | - g.allowSymlinks = 1; /* Find symlinks too */ | |
| 1021 | + /* Always consider symlinks. */ | |
| 1022 | + g.allowSymlinks = db_allow_symlinks_by_default(); | |
| 1017 | 1023 | if( !dirsOnlyFlag ){ |
| 1018 | 1024 | Stmt q; |
| 1019 | 1025 | Blob repo; |
| 1020 | 1026 | if( !dryRunFlag && !disableUndo ) undo_begin(); |
| 1021 | 1027 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 1022 | 1028 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -417,10 +417,11 @@ | |
| 417 | ** --sha1sum Verify file status using SHA1 hashing rather than |
| 418 | ** relying on file mtimes. |
| 419 | ** --case-sensitive <BOOL> Override case-sensitive setting. |
| 420 | ** --dotfiles Include unmanaged files beginning with a dot. |
| 421 | ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns. |
| 422 | ** |
| 423 | ** Options specific to the changes command: |
| 424 | ** --header Identify the repository if report is non-empty. |
| 425 | ** -v|--verbose Say "(none)" if the change report is empty. |
| 426 | ** --classify Start each line with the file's change type. |
| @@ -824,10 +825,11 @@ | |
| 824 | ** --abs-paths Display absolute pathnames. |
| 825 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 826 | ** --dotfiles include files beginning with a dot (".") |
| 827 | ** --header Identify the repository if there are extras |
| 828 | ** --ignore <CSG> ignore files matching patterns from the argument |
| 829 | ** --rel-paths Display pathnames relative to the current working |
| 830 | ** directory. |
| 831 | ** |
| 832 | ** See also: changes, clean, status |
| 833 | */ |
| @@ -853,13 +855,14 @@ | |
| 853 | |
| 854 | if( zIgnoreFlag==0 ){ |
| 855 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 856 | } |
| 857 | pIgnore = glob_create(zIgnoreFlag); |
| 858 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 859 | glob_free(pIgnore); |
| 860 | g.allowSymlinks = 1; /* Report on symbolic links */ |
| 861 | |
| 862 | blob_zero(&report); |
| 863 | status_report(&report, flags); |
| 864 | if( blob_size(&report) ){ |
| 865 | if( showHdr ){ |
| @@ -931,14 +934,14 @@ | |
| 931 | ** -i|--prompt Prompt before removing each file. This option |
| 932 | ** implies the --disable-undo option. |
| 933 | ** -x|--verily WARNING: Removes everything that is not a managed |
| 934 | ** file or the repository itself. This option |
| 935 | ** implies the --force, --emptydirs, --dotfiles, and |
| 936 | ** --disable-undo options. Furthermore, it completely |
| 937 | ** disregards the keep-glob and ignore-glob settings. |
| 938 | ** However, it does honor the --ignore and --keep |
| 939 | ** options. |
| 940 | ** --clean <CSG> WARNING: Never prompt to delete any files matching |
| 941 | ** this comma separated list of glob patterns. Also, |
| 942 | ** deletions of any files matching this pattern list |
| 943 | ** cannot be undone. |
| 944 | ** --ignore <CSG> Ignore files matching patterns from the |
| @@ -947,10 +950,11 @@ | |
| 947 | ** list of glob patterns. |
| 948 | ** -n|--dry-run Delete nothing, but display what would have been |
| 949 | ** deleted. |
| 950 | ** --no-prompt This option disables prompting the user for input |
| 951 | ** and assumes an answer of 'No' for every question. |
| 952 | ** --temp Remove only Fossil-generated temporary files. |
| 953 | ** -v|--verbose Show all files as they are removed. |
| 954 | ** |
| 955 | ** See also: addremove, extras, status |
| 956 | */ |
| @@ -995,10 +999,11 @@ | |
| 995 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 996 | emptyDirsFlag = 1; |
| 997 | disableUndo = 1; |
| 998 | scanFlags |= SCAN_ALL; |
| 999 | zCleanFlag = 0; |
| 1000 | } |
| 1001 | if( zIgnoreFlag==0 && !verilyFlag ){ |
| 1002 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 1003 | } |
| 1004 | if( zKeepFlag==0 && !verilyFlag ){ |
| @@ -1011,11 +1016,12 @@ | |
| 1011 | verify_all_options(); |
| 1012 | pIgnore = glob_create(zIgnoreFlag); |
| 1013 | pKeep = glob_create(zKeepFlag); |
| 1014 | pClean = glob_create(zCleanFlag); |
| 1015 | nRoot = (int)strlen(g.zLocalRoot); |
| 1016 | g.allowSymlinks = 1; /* Find symlinks too */ |
| 1017 | if( !dirsOnlyFlag ){ |
| 1018 | Stmt q; |
| 1019 | Blob repo; |
| 1020 | if( !dryRunFlag && !disableUndo ) undo_begin(); |
| 1021 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 1022 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -417,10 +417,11 @@ | |
| 417 | ** --sha1sum Verify file status using SHA1 hashing rather than |
| 418 | ** relying on file mtimes. |
| 419 | ** --case-sensitive <BOOL> Override case-sensitive setting. |
| 420 | ** --dotfiles Include unmanaged files beginning with a dot. |
| 421 | ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns. |
| 422 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 423 | ** |
| 424 | ** Options specific to the changes command: |
| 425 | ** --header Identify the repository if report is non-empty. |
| 426 | ** -v|--verbose Say "(none)" if the change report is empty. |
| 427 | ** --classify Start each line with the file's change type. |
| @@ -824,10 +825,11 @@ | |
| 825 | ** --abs-paths Display absolute pathnames. |
| 826 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 827 | ** --dotfiles include files beginning with a dot (".") |
| 828 | ** --header Identify the repository if there are extras |
| 829 | ** --ignore <CSG> ignore files matching patterns from the argument |
| 830 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 831 | ** --rel-paths Display pathnames relative to the current working |
| 832 | ** directory. |
| 833 | ** |
| 834 | ** See also: changes, clean, status |
| 835 | */ |
| @@ -853,13 +855,14 @@ | |
| 855 | |
| 856 | if( zIgnoreFlag==0 ){ |
| 857 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 858 | } |
| 859 | pIgnore = glob_create(zIgnoreFlag); |
| 860 | /* Always consider symlinks. */ |
| 861 | g.allowSymlinks = db_allow_symlinks_by_default(); |
| 862 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 863 | glob_free(pIgnore); |
| 864 | |
| 865 | blob_zero(&report); |
| 866 | status_report(&report, flags); |
| 867 | if( blob_size(&report) ){ |
| 868 | if( showHdr ){ |
| @@ -931,14 +934,14 @@ | |
| 934 | ** -i|--prompt Prompt before removing each file. This option |
| 935 | ** implies the --disable-undo option. |
| 936 | ** -x|--verily WARNING: Removes everything that is not a managed |
| 937 | ** file or the repository itself. This option |
| 938 | ** implies the --force, --emptydirs, --dotfiles, and |
| 939 | ** --disable-undo, and --no-dir-symlinks options. |
| 940 | ** Furthermore, it completely disregards the keep-glob |
| 941 | ** and ignore-glob settings. However, it does honor |
| 942 | ** the --ignore and --keep options. |
| 943 | ** --clean <CSG> WARNING: Never prompt to delete any files matching |
| 944 | ** this comma separated list of glob patterns. Also, |
| 945 | ** deletions of any files matching this pattern list |
| 946 | ** cannot be undone. |
| 947 | ** --ignore <CSG> Ignore files matching patterns from the |
| @@ -947,10 +950,11 @@ | |
| 950 | ** list of glob patterns. |
| 951 | ** -n|--dry-run Delete nothing, but display what would have been |
| 952 | ** deleted. |
| 953 | ** --no-prompt This option disables prompting the user for input |
| 954 | ** and assumes an answer of 'No' for every question. |
| 955 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 956 | ** --temp Remove only Fossil-generated temporary files. |
| 957 | ** -v|--verbose Show all files as they are removed. |
| 958 | ** |
| 959 | ** See also: addremove, extras, status |
| 960 | */ |
| @@ -995,10 +999,11 @@ | |
| 999 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 1000 | emptyDirsFlag = 1; |
| 1001 | disableUndo = 1; |
| 1002 | scanFlags |= SCAN_ALL; |
| 1003 | zCleanFlag = 0; |
| 1004 | g.fNoDirSymlinks = 1; |
| 1005 | } |
| 1006 | if( zIgnoreFlag==0 && !verilyFlag ){ |
| 1007 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 1008 | } |
| 1009 | if( zKeepFlag==0 && !verilyFlag ){ |
| @@ -1011,11 +1016,12 @@ | |
| 1016 | verify_all_options(); |
| 1017 | pIgnore = glob_create(zIgnoreFlag); |
| 1018 | pKeep = glob_create(zKeepFlag); |
| 1019 | pClean = glob_create(zCleanFlag); |
| 1020 | nRoot = (int)strlen(g.zLocalRoot); |
| 1021 | /* Always consider symlinks. */ |
| 1022 | g.allowSymlinks = db_allow_symlinks_by_default(); |
| 1023 | if( !dirsOnlyFlag ){ |
| 1024 | Stmt q; |
| 1025 | Blob repo; |
| 1026 | if( !dryRunFlag && !disableUndo ) undo_begin(); |
| 1027 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 1028 |
+12
-6
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -417,10 +417,11 @@ | ||
| 417 | 417 | ** --sha1sum Verify file status using SHA1 hashing rather than |
| 418 | 418 | ** relying on file mtimes. |
| 419 | 419 | ** --case-sensitive <BOOL> Override case-sensitive setting. |
| 420 | 420 | ** --dotfiles Include unmanaged files beginning with a dot. |
| 421 | 421 | ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns. |
| 422 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 422 | 423 | ** |
| 423 | 424 | ** Options specific to the changes command: |
| 424 | 425 | ** --header Identify the repository if report is non-empty. |
| 425 | 426 | ** -v|--verbose Say "(none)" if the change report is empty. |
| 426 | 427 | ** --classify Start each line with the file's change type. |
| @@ -824,10 +825,11 @@ | ||
| 824 | 825 | ** --abs-paths Display absolute pathnames. |
| 825 | 826 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 826 | 827 | ** --dotfiles include files beginning with a dot (".") |
| 827 | 828 | ** --header Identify the repository if there are extras |
| 828 | 829 | ** --ignore <CSG> ignore files matching patterns from the argument |
| 830 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 829 | 831 | ** --rel-paths Display pathnames relative to the current working |
| 830 | 832 | ** directory. |
| 831 | 833 | ** |
| 832 | 834 | ** See also: changes, clean, status |
| 833 | 835 | */ |
| @@ -853,13 +855,14 @@ | ||
| 853 | 855 | |
| 854 | 856 | if( zIgnoreFlag==0 ){ |
| 855 | 857 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 856 | 858 | } |
| 857 | 859 | pIgnore = glob_create(zIgnoreFlag); |
| 860 | + /* Always consider symlinks. */ | |
| 861 | + g.allowSymlinks = db_allow_symlinks_by_default(); | |
| 858 | 862 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 859 | 863 | glob_free(pIgnore); |
| 860 | - g.allowSymlinks = 1; /* Report on symbolic links */ | |
| 861 | 864 | |
| 862 | 865 | blob_zero(&report); |
| 863 | 866 | status_report(&report, flags); |
| 864 | 867 | if( blob_size(&report) ){ |
| 865 | 868 | if( showHdr ){ |
| @@ -931,14 +934,14 @@ | ||
| 931 | 934 | ** -i|--prompt Prompt before removing each file. This option |
| 932 | 935 | ** implies the --disable-undo option. |
| 933 | 936 | ** -x|--verily WARNING: Removes everything that is not a managed |
| 934 | 937 | ** file or the repository itself. This option |
| 935 | 938 | ** implies the --force, --emptydirs, --dotfiles, and |
| 936 | -** --disable-undo options. Furthermore, it completely | |
| 937 | -** disregards the keep-glob and ignore-glob settings. | |
| 938 | -** However, it does honor the --ignore and --keep | |
| 939 | -** options. | |
| 939 | +** --disable-undo, and --no-dir-symlinks options. | |
| 940 | +** Furthermore, it completely disregards the keep-glob | |
| 941 | +** and ignore-glob settings. However, it does honor | |
| 942 | +** the --ignore and --keep options. | |
| 940 | 943 | ** --clean <CSG> WARNING: Never prompt to delete any files matching |
| 941 | 944 | ** this comma separated list of glob patterns. Also, |
| 942 | 945 | ** deletions of any files matching this pattern list |
| 943 | 946 | ** cannot be undone. |
| 944 | 947 | ** --ignore <CSG> Ignore files matching patterns from the |
| @@ -947,10 +950,11 @@ | ||
| 947 | 950 | ** list of glob patterns. |
| 948 | 951 | ** -n|--dry-run Delete nothing, but display what would have been |
| 949 | 952 | ** deleted. |
| 950 | 953 | ** --no-prompt This option disables prompting the user for input |
| 951 | 954 | ** and assumes an answer of 'No' for every question. |
| 955 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 952 | 956 | ** --temp Remove only Fossil-generated temporary files. |
| 953 | 957 | ** -v|--verbose Show all files as they are removed. |
| 954 | 958 | ** |
| 955 | 959 | ** See also: addremove, extras, status |
| 956 | 960 | */ |
| @@ -995,10 +999,11 @@ | ||
| 995 | 999 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 996 | 1000 | emptyDirsFlag = 1; |
| 997 | 1001 | disableUndo = 1; |
| 998 | 1002 | scanFlags |= SCAN_ALL; |
| 999 | 1003 | zCleanFlag = 0; |
| 1004 | + g.fNoDirSymlinks = 1; | |
| 1000 | 1005 | } |
| 1001 | 1006 | if( zIgnoreFlag==0 && !verilyFlag ){ |
| 1002 | 1007 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 1003 | 1008 | } |
| 1004 | 1009 | if( zKeepFlag==0 && !verilyFlag ){ |
| @@ -1011,11 +1016,12 @@ | ||
| 1011 | 1016 | verify_all_options(); |
| 1012 | 1017 | pIgnore = glob_create(zIgnoreFlag); |
| 1013 | 1018 | pKeep = glob_create(zKeepFlag); |
| 1014 | 1019 | pClean = glob_create(zCleanFlag); |
| 1015 | 1020 | nRoot = (int)strlen(g.zLocalRoot); |
| 1016 | - g.allowSymlinks = 1; /* Find symlinks too */ | |
| 1021 | + /* Always consider symlinks. */ | |
| 1022 | + g.allowSymlinks = db_allow_symlinks_by_default(); | |
| 1017 | 1023 | if( !dirsOnlyFlag ){ |
| 1018 | 1024 | Stmt q; |
| 1019 | 1025 | Blob repo; |
| 1020 | 1026 | if( !dryRunFlag && !disableUndo ) undo_begin(); |
| 1021 | 1027 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 1022 | 1028 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -417,10 +417,11 @@ | |
| 417 | ** --sha1sum Verify file status using SHA1 hashing rather than |
| 418 | ** relying on file mtimes. |
| 419 | ** --case-sensitive <BOOL> Override case-sensitive setting. |
| 420 | ** --dotfiles Include unmanaged files beginning with a dot. |
| 421 | ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns. |
| 422 | ** |
| 423 | ** Options specific to the changes command: |
| 424 | ** --header Identify the repository if report is non-empty. |
| 425 | ** -v|--verbose Say "(none)" if the change report is empty. |
| 426 | ** --classify Start each line with the file's change type. |
| @@ -824,10 +825,11 @@ | |
| 824 | ** --abs-paths Display absolute pathnames. |
| 825 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 826 | ** --dotfiles include files beginning with a dot (".") |
| 827 | ** --header Identify the repository if there are extras |
| 828 | ** --ignore <CSG> ignore files matching patterns from the argument |
| 829 | ** --rel-paths Display pathnames relative to the current working |
| 830 | ** directory. |
| 831 | ** |
| 832 | ** See also: changes, clean, status |
| 833 | */ |
| @@ -853,13 +855,14 @@ | |
| 853 | |
| 854 | if( zIgnoreFlag==0 ){ |
| 855 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 856 | } |
| 857 | pIgnore = glob_create(zIgnoreFlag); |
| 858 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 859 | glob_free(pIgnore); |
| 860 | g.allowSymlinks = 1; /* Report on symbolic links */ |
| 861 | |
| 862 | blob_zero(&report); |
| 863 | status_report(&report, flags); |
| 864 | if( blob_size(&report) ){ |
| 865 | if( showHdr ){ |
| @@ -931,14 +934,14 @@ | |
| 931 | ** -i|--prompt Prompt before removing each file. This option |
| 932 | ** implies the --disable-undo option. |
| 933 | ** -x|--verily WARNING: Removes everything that is not a managed |
| 934 | ** file or the repository itself. This option |
| 935 | ** implies the --force, --emptydirs, --dotfiles, and |
| 936 | ** --disable-undo options. Furthermore, it completely |
| 937 | ** disregards the keep-glob and ignore-glob settings. |
| 938 | ** However, it does honor the --ignore and --keep |
| 939 | ** options. |
| 940 | ** --clean <CSG> WARNING: Never prompt to delete any files matching |
| 941 | ** this comma separated list of glob patterns. Also, |
| 942 | ** deletions of any files matching this pattern list |
| 943 | ** cannot be undone. |
| 944 | ** --ignore <CSG> Ignore files matching patterns from the |
| @@ -947,10 +950,11 @@ | |
| 947 | ** list of glob patterns. |
| 948 | ** -n|--dry-run Delete nothing, but display what would have been |
| 949 | ** deleted. |
| 950 | ** --no-prompt This option disables prompting the user for input |
| 951 | ** and assumes an answer of 'No' for every question. |
| 952 | ** --temp Remove only Fossil-generated temporary files. |
| 953 | ** -v|--verbose Show all files as they are removed. |
| 954 | ** |
| 955 | ** See also: addremove, extras, status |
| 956 | */ |
| @@ -995,10 +999,11 @@ | |
| 995 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 996 | emptyDirsFlag = 1; |
| 997 | disableUndo = 1; |
| 998 | scanFlags |= SCAN_ALL; |
| 999 | zCleanFlag = 0; |
| 1000 | } |
| 1001 | if( zIgnoreFlag==0 && !verilyFlag ){ |
| 1002 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 1003 | } |
| 1004 | if( zKeepFlag==0 && !verilyFlag ){ |
| @@ -1011,11 +1016,12 @@ | |
| 1011 | verify_all_options(); |
| 1012 | pIgnore = glob_create(zIgnoreFlag); |
| 1013 | pKeep = glob_create(zKeepFlag); |
| 1014 | pClean = glob_create(zCleanFlag); |
| 1015 | nRoot = (int)strlen(g.zLocalRoot); |
| 1016 | g.allowSymlinks = 1; /* Find symlinks too */ |
| 1017 | if( !dirsOnlyFlag ){ |
| 1018 | Stmt q; |
| 1019 | Blob repo; |
| 1020 | if( !dryRunFlag && !disableUndo ) undo_begin(); |
| 1021 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 1022 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -417,10 +417,11 @@ | |
| 417 | ** --sha1sum Verify file status using SHA1 hashing rather than |
| 418 | ** relying on file mtimes. |
| 419 | ** --case-sensitive <BOOL> Override case-sensitive setting. |
| 420 | ** --dotfiles Include unmanaged files beginning with a dot. |
| 421 | ** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns. |
| 422 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 423 | ** |
| 424 | ** Options specific to the changes command: |
| 425 | ** --header Identify the repository if report is non-empty. |
| 426 | ** -v|--verbose Say "(none)" if the change report is empty. |
| 427 | ** --classify Start each line with the file's change type. |
| @@ -824,10 +825,11 @@ | |
| 825 | ** --abs-paths Display absolute pathnames. |
| 826 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 827 | ** --dotfiles include files beginning with a dot (".") |
| 828 | ** --header Identify the repository if there are extras |
| 829 | ** --ignore <CSG> ignore files matching patterns from the argument |
| 830 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 831 | ** --rel-paths Display pathnames relative to the current working |
| 832 | ** directory. |
| 833 | ** |
| 834 | ** See also: changes, clean, status |
| 835 | */ |
| @@ -853,13 +855,14 @@ | |
| 855 | |
| 856 | if( zIgnoreFlag==0 ){ |
| 857 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 858 | } |
| 859 | pIgnore = glob_create(zIgnoreFlag); |
| 860 | /* Always consider symlinks. */ |
| 861 | g.allowSymlinks = db_allow_symlinks_by_default(); |
| 862 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 863 | glob_free(pIgnore); |
| 864 | |
| 865 | blob_zero(&report); |
| 866 | status_report(&report, flags); |
| 867 | if( blob_size(&report) ){ |
| 868 | if( showHdr ){ |
| @@ -931,14 +934,14 @@ | |
| 934 | ** -i|--prompt Prompt before removing each file. This option |
| 935 | ** implies the --disable-undo option. |
| 936 | ** -x|--verily WARNING: Removes everything that is not a managed |
| 937 | ** file or the repository itself. This option |
| 938 | ** implies the --force, --emptydirs, --dotfiles, and |
| 939 | ** --disable-undo, and --no-dir-symlinks options. |
| 940 | ** Furthermore, it completely disregards the keep-glob |
| 941 | ** and ignore-glob settings. However, it does honor |
| 942 | ** the --ignore and --keep options. |
| 943 | ** --clean <CSG> WARNING: Never prompt to delete any files matching |
| 944 | ** this comma separated list of glob patterns. Also, |
| 945 | ** deletions of any files matching this pattern list |
| 946 | ** cannot be undone. |
| 947 | ** --ignore <CSG> Ignore files matching patterns from the |
| @@ -947,10 +950,11 @@ | |
| 950 | ** list of glob patterns. |
| 951 | ** -n|--dry-run Delete nothing, but display what would have been |
| 952 | ** deleted. |
| 953 | ** --no-prompt This option disables prompting the user for input |
| 954 | ** and assumes an answer of 'No' for every question. |
| 955 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 956 | ** --temp Remove only Fossil-generated temporary files. |
| 957 | ** -v|--verbose Show all files as they are removed. |
| 958 | ** |
| 959 | ** See also: addremove, extras, status |
| 960 | */ |
| @@ -995,10 +999,11 @@ | |
| 999 | verilyFlag = allFileFlag = allDirFlag = 1; |
| 1000 | emptyDirsFlag = 1; |
| 1001 | disableUndo = 1; |
| 1002 | scanFlags |= SCAN_ALL; |
| 1003 | zCleanFlag = 0; |
| 1004 | g.fNoDirSymlinks = 1; |
| 1005 | } |
| 1006 | if( zIgnoreFlag==0 && !verilyFlag ){ |
| 1007 | zIgnoreFlag = db_get("ignore-glob", 0); |
| 1008 | } |
| 1009 | if( zKeepFlag==0 && !verilyFlag ){ |
| @@ -1011,11 +1016,12 @@ | |
| 1016 | verify_all_options(); |
| 1017 | pIgnore = glob_create(zIgnoreFlag); |
| 1018 | pKeep = glob_create(zKeepFlag); |
| 1019 | pClean = glob_create(zCleanFlag); |
| 1020 | nRoot = (int)strlen(g.zLocalRoot); |
| 1021 | /* Always consider symlinks. */ |
| 1022 | g.allowSymlinks = db_allow_symlinks_by_default(); |
| 1023 | if( !dirsOnlyFlag ){ |
| 1024 | Stmt q; |
| 1025 | Blob repo; |
| 1026 | if( !dryRunFlag && !disableUndo ) undo_begin(); |
| 1027 | locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore); |
| 1028 |
M
src/db.c
+8
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1423,19 +1423,26 @@ | ||
| 1423 | 1423 | return zRepo; |
| 1424 | 1424 | } |
| 1425 | 1425 | |
| 1426 | 1426 | /* |
| 1427 | 1427 | ** Returns non-zero if the default value for the "allow-symlinks" setting |
| 1428 | -** is "on". | |
| 1428 | +** is "on". When on Windows, this always returns false. | |
| 1429 | 1429 | */ |
| 1430 | 1430 | int db_allow_symlinks_by_default(void){ |
| 1431 | 1431 | #if defined(_WIN32) |
| 1432 | 1432 | return 0; |
| 1433 | 1433 | #else |
| 1434 | 1434 | return 1; |
| 1435 | 1435 | #endif |
| 1436 | 1436 | } |
| 1437 | + | |
| 1438 | +/* | |
| 1439 | +** Returns non-zero if support for symlinks is currently enabled. | |
| 1440 | +*/ | |
| 1441 | +int db_allow_symlinks(void){ | |
| 1442 | + return g.allowSymlinks; | |
| 1443 | +} | |
| 1437 | 1444 | |
| 1438 | 1445 | /* |
| 1439 | 1446 | ** Open the repository database given by zDbName. If zDbName==NULL then |
| 1440 | 1447 | ** get the name from the already open local database. |
| 1441 | 1448 | */ |
| 1442 | 1449 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1423,19 +1423,26 @@ | |
| 1423 | return zRepo; |
| 1424 | } |
| 1425 | |
| 1426 | /* |
| 1427 | ** Returns non-zero if the default value for the "allow-symlinks" setting |
| 1428 | ** is "on". |
| 1429 | */ |
| 1430 | int db_allow_symlinks_by_default(void){ |
| 1431 | #if defined(_WIN32) |
| 1432 | return 0; |
| 1433 | #else |
| 1434 | return 1; |
| 1435 | #endif |
| 1436 | } |
| 1437 | |
| 1438 | /* |
| 1439 | ** Open the repository database given by zDbName. If zDbName==NULL then |
| 1440 | ** get the name from the already open local database. |
| 1441 | */ |
| 1442 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1423,19 +1423,26 @@ | |
| 1423 | return zRepo; |
| 1424 | } |
| 1425 | |
| 1426 | /* |
| 1427 | ** Returns non-zero if the default value for the "allow-symlinks" setting |
| 1428 | ** is "on". When on Windows, this always returns false. |
| 1429 | */ |
| 1430 | int db_allow_symlinks_by_default(void){ |
| 1431 | #if defined(_WIN32) |
| 1432 | return 0; |
| 1433 | #else |
| 1434 | return 1; |
| 1435 | #endif |
| 1436 | } |
| 1437 | |
| 1438 | /* |
| 1439 | ** Returns non-zero if support for symlinks is currently enabled. |
| 1440 | */ |
| 1441 | int db_allow_symlinks(void){ |
| 1442 | return g.allowSymlinks; |
| 1443 | } |
| 1444 | |
| 1445 | /* |
| 1446 | ** Open the repository database given by zDbName. If zDbName==NULL then |
| 1447 | ** get the name from the already open local database. |
| 1448 | */ |
| 1449 |
+5
-4
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -89,11 +89,11 @@ | ||
| 89 | 89 | */ |
| 90 | 90 | static int fossil_stat(const char *zFilename, struct fossilStat *buf, int isWd){ |
| 91 | 91 | int rc; |
| 92 | 92 | void *zMbcs = fossil_utf8_to_path(zFilename, 0); |
| 93 | 93 | #if !defined(_WIN32) |
| 94 | - if( isWd && g.allowSymlinks ){ | |
| 94 | + if( isWd && db_allow_symlinks() ){ | |
| 95 | 95 | rc = lstat(zMbcs, buf); |
| 96 | 96 | }else{ |
| 97 | 97 | rc = stat(zMbcs, buf); |
| 98 | 98 | } |
| 99 | 99 | #else |
| @@ -191,11 +191,11 @@ | ||
| 191 | 191 | ** |
| 192 | 192 | ** Arguments: target file (symlink will point to it), link file |
| 193 | 193 | **/ |
| 194 | 194 | void symlink_create(const char *zTargetFile, const char *zLinkFile){ |
| 195 | 195 | #if !defined(_WIN32) |
| 196 | - if( g.allowSymlinks ){ | |
| 196 | + if( db_allow_symlinks() ){ | |
| 197 | 197 | int i, nName; |
| 198 | 198 | char *zName, zBuf[1000]; |
| 199 | 199 | |
| 200 | 200 | nName = strlen(zLinkFile); |
| 201 | 201 | if( nName>=sizeof(zBuf) ){ |
| @@ -248,11 +248,11 @@ | ||
| 248 | 248 | int file_wd_perm(const char *zFilename){ |
| 249 | 249 | #if !defined(_WIN32) |
| 250 | 250 | if( !getStat(zFilename, 1) ){ |
| 251 | 251 | if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 ) |
| 252 | 252 | return PERM_EXE; |
| 253 | - else if( g.allowSymlinks && S_ISLNK(fileStat.st_mode) ) | |
| 253 | + else if( db_allow_symlinks() && S_ISLNK(fileStat.st_mode) ) | |
| 254 | 254 | return PERM_LNK; |
| 255 | 255 | } |
| 256 | 256 | #endif |
| 257 | 257 | return PERM_REG; |
| 258 | 258 | } |
| @@ -309,11 +309,11 @@ | ||
| 309 | 309 | rc = getStat(zFN, 1); |
| 310 | 310 | if( rc ){ |
| 311 | 311 | rc = 0; /* It does not exist at all. */ |
| 312 | 312 | }else if( S_ISDIR(fileStat.st_mode) ){ |
| 313 | 313 | rc = 1; /* It exists and is a real directory. */ |
| 314 | - }else if( S_ISLNK(fileStat.st_mode) ){ | |
| 314 | + }else if( !g.fNoDirSymlinks && S_ISLNK(fileStat.st_mode) ){ | |
| 315 | 315 | Blob content; |
| 316 | 316 | blob_read_link(&content, zFN); /* It exists and is a link. */ |
| 317 | 317 | rc = file_wd_isdir(blob_str(&content)); /* Points to directory? */ |
| 318 | 318 | blob_reset(&content); |
| 319 | 319 | }else{ |
| @@ -1194,10 +1194,11 @@ | ||
| 1194 | 1194 | ** |
| 1195 | 1195 | ** Options: |
| 1196 | 1196 | ** --absolute Return an absolute path instead of a relative one. |
| 1197 | 1197 | ** --case-sensitive B Enable or disable case-sensitive filenames. B is |
| 1198 | 1198 | ** a boolean: "yes", "no", "true", "false", etc. |
| 1199 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 1199 | 1200 | */ |
| 1200 | 1201 | void cmd_test_tree_name(void){ |
| 1201 | 1202 | int i; |
| 1202 | 1203 | Blob x; |
| 1203 | 1204 | int absoluteFlag = find_option("absolute",0,0)!=0; |
| 1204 | 1205 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -89,11 +89,11 @@ | |
| 89 | */ |
| 90 | static int fossil_stat(const char *zFilename, struct fossilStat *buf, int isWd){ |
| 91 | int rc; |
| 92 | void *zMbcs = fossil_utf8_to_path(zFilename, 0); |
| 93 | #if !defined(_WIN32) |
| 94 | if( isWd && g.allowSymlinks ){ |
| 95 | rc = lstat(zMbcs, buf); |
| 96 | }else{ |
| 97 | rc = stat(zMbcs, buf); |
| 98 | } |
| 99 | #else |
| @@ -191,11 +191,11 @@ | |
| 191 | ** |
| 192 | ** Arguments: target file (symlink will point to it), link file |
| 193 | **/ |
| 194 | void symlink_create(const char *zTargetFile, const char *zLinkFile){ |
| 195 | #if !defined(_WIN32) |
| 196 | if( g.allowSymlinks ){ |
| 197 | int i, nName; |
| 198 | char *zName, zBuf[1000]; |
| 199 | |
| 200 | nName = strlen(zLinkFile); |
| 201 | if( nName>=sizeof(zBuf) ){ |
| @@ -248,11 +248,11 @@ | |
| 248 | int file_wd_perm(const char *zFilename){ |
| 249 | #if !defined(_WIN32) |
| 250 | if( !getStat(zFilename, 1) ){ |
| 251 | if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 ) |
| 252 | return PERM_EXE; |
| 253 | else if( g.allowSymlinks && S_ISLNK(fileStat.st_mode) ) |
| 254 | return PERM_LNK; |
| 255 | } |
| 256 | #endif |
| 257 | return PERM_REG; |
| 258 | } |
| @@ -309,11 +309,11 @@ | |
| 309 | rc = getStat(zFN, 1); |
| 310 | if( rc ){ |
| 311 | rc = 0; /* It does not exist at all. */ |
| 312 | }else if( S_ISDIR(fileStat.st_mode) ){ |
| 313 | rc = 1; /* It exists and is a real directory. */ |
| 314 | }else if( S_ISLNK(fileStat.st_mode) ){ |
| 315 | Blob content; |
| 316 | blob_read_link(&content, zFN); /* It exists and is a link. */ |
| 317 | rc = file_wd_isdir(blob_str(&content)); /* Points to directory? */ |
| 318 | blob_reset(&content); |
| 319 | }else{ |
| @@ -1194,10 +1194,11 @@ | |
| 1194 | ** |
| 1195 | ** Options: |
| 1196 | ** --absolute Return an absolute path instead of a relative one. |
| 1197 | ** --case-sensitive B Enable or disable case-sensitive filenames. B is |
| 1198 | ** a boolean: "yes", "no", "true", "false", etc. |
| 1199 | */ |
| 1200 | void cmd_test_tree_name(void){ |
| 1201 | int i; |
| 1202 | Blob x; |
| 1203 | int absoluteFlag = find_option("absolute",0,0)!=0; |
| 1204 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -89,11 +89,11 @@ | |
| 89 | */ |
| 90 | static int fossil_stat(const char *zFilename, struct fossilStat *buf, int isWd){ |
| 91 | int rc; |
| 92 | void *zMbcs = fossil_utf8_to_path(zFilename, 0); |
| 93 | #if !defined(_WIN32) |
| 94 | if( isWd && db_allow_symlinks() ){ |
| 95 | rc = lstat(zMbcs, buf); |
| 96 | }else{ |
| 97 | rc = stat(zMbcs, buf); |
| 98 | } |
| 99 | #else |
| @@ -191,11 +191,11 @@ | |
| 191 | ** |
| 192 | ** Arguments: target file (symlink will point to it), link file |
| 193 | **/ |
| 194 | void symlink_create(const char *zTargetFile, const char *zLinkFile){ |
| 195 | #if !defined(_WIN32) |
| 196 | if( db_allow_symlinks() ){ |
| 197 | int i, nName; |
| 198 | char *zName, zBuf[1000]; |
| 199 | |
| 200 | nName = strlen(zLinkFile); |
| 201 | if( nName>=sizeof(zBuf) ){ |
| @@ -248,11 +248,11 @@ | |
| 248 | int file_wd_perm(const char *zFilename){ |
| 249 | #if !defined(_WIN32) |
| 250 | if( !getStat(zFilename, 1) ){ |
| 251 | if( S_ISREG(fileStat.st_mode) && ((S_IXUSR)&fileStat.st_mode)!=0 ) |
| 252 | return PERM_EXE; |
| 253 | else if( db_allow_symlinks() && S_ISLNK(fileStat.st_mode) ) |
| 254 | return PERM_LNK; |
| 255 | } |
| 256 | #endif |
| 257 | return PERM_REG; |
| 258 | } |
| @@ -309,11 +309,11 @@ | |
| 309 | rc = getStat(zFN, 1); |
| 310 | if( rc ){ |
| 311 | rc = 0; /* It does not exist at all. */ |
| 312 | }else if( S_ISDIR(fileStat.st_mode) ){ |
| 313 | rc = 1; /* It exists and is a real directory. */ |
| 314 | }else if( !g.fNoDirSymlinks && S_ISLNK(fileStat.st_mode) ){ |
| 315 | Blob content; |
| 316 | blob_read_link(&content, zFN); /* It exists and is a link. */ |
| 317 | rc = file_wd_isdir(blob_str(&content)); /* Points to directory? */ |
| 318 | blob_reset(&content); |
| 319 | }else{ |
| @@ -1194,10 +1194,11 @@ | |
| 1194 | ** |
| 1195 | ** Options: |
| 1196 | ** --absolute Return an absolute path instead of a relative one. |
| 1197 | ** --case-sensitive B Enable or disable case-sensitive filenames. B is |
| 1198 | ** a boolean: "yes", "no", "true", "false", etc. |
| 1199 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 1200 | */ |
| 1201 | void cmd_test_tree_name(void){ |
| 1202 | int i; |
| 1203 | Blob x; |
| 1204 | int absoluteFlag = find_option("absolute",0,0)!=0; |
| 1205 |
+1
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -45,10 +45,11 @@ | ||
| 45 | 45 | ** --case-sensitive B Enable or disable case-sensitive filenames. B is a |
| 46 | 46 | ** boolean: "yes", "no", "true", "false", etc. |
| 47 | 47 | ** -l|--log select log mode (the default) |
| 48 | 48 | ** -n|--limit N Display the first N changes (default unlimited). |
| 49 | 49 | ** N<=0 means no limit. |
| 50 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 50 | 51 | ** --offset P skip P changes |
| 51 | 52 | ** -p|--print select print mode |
| 52 | 53 | ** -r|--revision R print the given revision (or ckout, if none is given) |
| 53 | 54 | ** to stdout (only in print mode) |
| 54 | 55 | ** -s|--status select status mode (print a status indicator for FILE) |
| 55 | 56 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -45,10 +45,11 @@ | |
| 45 | ** --case-sensitive B Enable or disable case-sensitive filenames. B is a |
| 46 | ** boolean: "yes", "no", "true", "false", etc. |
| 47 | ** -l|--log select log mode (the default) |
| 48 | ** -n|--limit N Display the first N changes (default unlimited). |
| 49 | ** N<=0 means no limit. |
| 50 | ** --offset P skip P changes |
| 51 | ** -p|--print select print mode |
| 52 | ** -r|--revision R print the given revision (or ckout, if none is given) |
| 53 | ** to stdout (only in print mode) |
| 54 | ** -s|--status select status mode (print a status indicator for FILE) |
| 55 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -45,10 +45,11 @@ | |
| 45 | ** --case-sensitive B Enable or disable case-sensitive filenames. B is a |
| 46 | ** boolean: "yes", "no", "true", "false", etc. |
| 47 | ** -l|--log select log mode (the default) |
| 48 | ** -n|--limit N Display the first N changes (default unlimited). |
| 49 | ** N<=0 means no limit. |
| 50 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 51 | ** --offset P skip P changes |
| 52 | ** -p|--print select print mode |
| 53 | ** -r|--revision R print the given revision (or ckout, if none is given) |
| 54 | ** to stdout (only in print mode) |
| 55 | ** -s|--status select status mode (print a status indicator for FILE) |
| 56 |
+1
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -1263,10 +1263,11 @@ | ||
| 1263 | 1263 | INT(g, isConst); |
| 1264 | 1264 | CSTR(g, zConfigDbName); |
| 1265 | 1265 | INT(g, repositoryOpen); |
| 1266 | 1266 | INT(g, localOpen); |
| 1267 | 1267 | INT(g, minPrefix); |
| 1268 | + INT(g, fNoDirSymlinks); | |
| 1268 | 1269 | INT(g, fSqlTrace); |
| 1269 | 1270 | INT(g, fSqlStats); |
| 1270 | 1271 | INT(g, fSqlPrint); |
| 1271 | 1272 | INT(g, fQuiet); |
| 1272 | 1273 | INT(g, fHttpTrace); |
| 1273 | 1274 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -1263,10 +1263,11 @@ | |
| 1263 | INT(g, isConst); |
| 1264 | CSTR(g, zConfigDbName); |
| 1265 | INT(g, repositoryOpen); |
| 1266 | INT(g, localOpen); |
| 1267 | INT(g, minPrefix); |
| 1268 | INT(g, fSqlTrace); |
| 1269 | INT(g, fSqlStats); |
| 1270 | INT(g, fSqlPrint); |
| 1271 | INT(g, fQuiet); |
| 1272 | INT(g, fHttpTrace); |
| 1273 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -1263,10 +1263,11 @@ | |
| 1263 | INT(g, isConst); |
| 1264 | CSTR(g, zConfigDbName); |
| 1265 | INT(g, repositoryOpen); |
| 1266 | INT(g, localOpen); |
| 1267 | INT(g, minPrefix); |
| 1268 | INT(g, fNoDirSymlinks); |
| 1269 | INT(g, fSqlTrace); |
| 1270 | INT(g, fSqlStats); |
| 1271 | INT(g, fSqlPrint); |
| 1272 | INT(g, fQuiet); |
| 1273 | INT(g, fHttpTrace); |
| 1274 |
+2
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -135,10 +135,11 @@ | ||
| 135 | 135 | char *zLocalDbName; /* Name of the local database file */ |
| 136 | 136 | char *zOpenRevision; /* Check-in version to use during database open */ |
| 137 | 137 | int localOpen; /* True if the local database is open */ |
| 138 | 138 | char *zLocalRoot; /* The directory holding the local database */ |
| 139 | 139 | int minPrefix; /* Number of digits needed for a distinct UUID */ |
| 140 | + int fNoDirSymlinks; /* True if --no-dir-symlinks flag is present */ | |
| 140 | 141 | int fSqlTrace; /* True if --sqltrace flag is present */ |
| 141 | 142 | int fSqlStats; /* True if --sqltrace or --sqlstats are present */ |
| 142 | 143 | int fSqlPrint; /* True if -sqlprint flag is present */ |
| 143 | 144 | int fQuiet; /* True if -quiet flag is present */ |
| 144 | 145 | int fJail; /* True if running with a chroot jail */ |
| @@ -613,10 +614,11 @@ | ||
| 613 | 614 | fossil_exit(1); |
| 614 | 615 | }else{ |
| 615 | 616 | const char *zChdir = find_option("chdir",0,1); |
| 616 | 617 | g.isHTTP = 0; |
| 617 | 618 | g.rcvid = 0; |
| 619 | + g.fNoDirSymlinks = find_option("no-dir-symlinks", 0, 0)!=0; | |
| 618 | 620 | g.fQuiet = find_option("quiet", 0, 0)!=0; |
| 619 | 621 | g.fSqlTrace = find_option("sqltrace", 0, 0)!=0; |
| 620 | 622 | g.fSqlStats = find_option("sqlstats", 0, 0)!=0; |
| 621 | 623 | g.fSystemTrace = find_option("systemtrace", 0, 0)!=0; |
| 622 | 624 | g.fSshTrace = find_option("sshtrace", 0, 0)!=0; |
| 623 | 625 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -135,10 +135,11 @@ | |
| 135 | char *zLocalDbName; /* Name of the local database file */ |
| 136 | char *zOpenRevision; /* Check-in version to use during database open */ |
| 137 | int localOpen; /* True if the local database is open */ |
| 138 | char *zLocalRoot; /* The directory holding the local database */ |
| 139 | int minPrefix; /* Number of digits needed for a distinct UUID */ |
| 140 | int fSqlTrace; /* True if --sqltrace flag is present */ |
| 141 | int fSqlStats; /* True if --sqltrace or --sqlstats are present */ |
| 142 | int fSqlPrint; /* True if -sqlprint flag is present */ |
| 143 | int fQuiet; /* True if -quiet flag is present */ |
| 144 | int fJail; /* True if running with a chroot jail */ |
| @@ -613,10 +614,11 @@ | |
| 613 | fossil_exit(1); |
| 614 | }else{ |
| 615 | const char *zChdir = find_option("chdir",0,1); |
| 616 | g.isHTTP = 0; |
| 617 | g.rcvid = 0; |
| 618 | g.fQuiet = find_option("quiet", 0, 0)!=0; |
| 619 | g.fSqlTrace = find_option("sqltrace", 0, 0)!=0; |
| 620 | g.fSqlStats = find_option("sqlstats", 0, 0)!=0; |
| 621 | g.fSystemTrace = find_option("systemtrace", 0, 0)!=0; |
| 622 | g.fSshTrace = find_option("sshtrace", 0, 0)!=0; |
| 623 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -135,10 +135,11 @@ | |
| 135 | char *zLocalDbName; /* Name of the local database file */ |
| 136 | char *zOpenRevision; /* Check-in version to use during database open */ |
| 137 | int localOpen; /* True if the local database is open */ |
| 138 | char *zLocalRoot; /* The directory holding the local database */ |
| 139 | int minPrefix; /* Number of digits needed for a distinct UUID */ |
| 140 | int fNoDirSymlinks; /* True if --no-dir-symlinks flag is present */ |
| 141 | int fSqlTrace; /* True if --sqltrace flag is present */ |
| 142 | int fSqlStats; /* True if --sqltrace or --sqlstats are present */ |
| 143 | int fSqlPrint; /* True if -sqlprint flag is present */ |
| 144 | int fQuiet; /* True if -quiet flag is present */ |
| 145 | int fJail; /* True if running with a chroot jail */ |
| @@ -613,10 +614,11 @@ | |
| 614 | fossil_exit(1); |
| 615 | }else{ |
| 616 | const char *zChdir = find_option("chdir",0,1); |
| 617 | g.isHTTP = 0; |
| 618 | g.rcvid = 0; |
| 619 | g.fNoDirSymlinks = find_option("no-dir-symlinks", 0, 0)!=0; |
| 620 | g.fQuiet = find_option("quiet", 0, 0)!=0; |
| 621 | g.fSqlTrace = find_option("sqltrace", 0, 0)!=0; |
| 622 | g.fSqlStats = find_option("sqlstats", 0, 0)!=0; |
| 623 | g.fSystemTrace = find_option("systemtrace", 0, 0)!=0; |
| 624 | g.fSshTrace = find_option("sshtrace", 0, 0)!=0; |
| 625 |
+2
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -205,10 +205,12 @@ | ||
| 205 | 205 | ** -f|--force Force the merge even if it would be a no-op. |
| 206 | 206 | ** |
| 207 | 207 | ** --force-missing Force the merge even if there is missing content. |
| 208 | 208 | ** |
| 209 | 209 | ** --integrate Merged branch will be closed when committing. |
| 210 | +** | |
| 211 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 210 | 212 | ** |
| 211 | 213 | ** -n|--dry-run If given, display instead of run actions |
| 212 | 214 | ** |
| 213 | 215 | ** -v|--verbose Show additional details of the merge |
| 214 | 216 | */ |
| 215 | 217 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -205,10 +205,12 @@ | |
| 205 | ** -f|--force Force the merge even if it would be a no-op. |
| 206 | ** |
| 207 | ** --force-missing Force the merge even if there is missing content. |
| 208 | ** |
| 209 | ** --integrate Merged branch will be closed when committing. |
| 210 | ** |
| 211 | ** -n|--dry-run If given, display instead of run actions |
| 212 | ** |
| 213 | ** -v|--verbose Show additional details of the merge |
| 214 | */ |
| 215 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -205,10 +205,12 @@ | |
| 205 | ** -f|--force Force the merge even if it would be a no-op. |
| 206 | ** |
| 207 | ** --force-missing Force the merge even if there is missing content. |
| 208 | ** |
| 209 | ** --integrate Merged branch will be closed when committing. |
| 210 | ** |
| 211 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 212 | ** |
| 213 | ** -n|--dry-run If given, display instead of run actions |
| 214 | ** |
| 215 | ** -v|--verbose Show additional details of the merge |
| 216 | */ |
| 217 |
+1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -95,10 +95,11 @@ | ||
| 95 | 95 | ** Options: |
| 96 | 96 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 97 | 97 | ** --debug print debug information on stdout |
| 98 | 98 | ** --latest acceptable in place of VERSION, update to latest version |
| 99 | 99 | ** --force-missing force update if missing content after sync |
| 100 | +** --no-dir-symlinks Disables support for directory symlinks. | |
| 100 | 101 | ** -n|--dry-run If given, display instead of run actions |
| 101 | 102 | ** -v|--verbose print status information about all files |
| 102 | 103 | ** -W|--width <num> Width of lines (default is to auto-detect). Must be >20 |
| 103 | 104 | ** or 0 (= no limit, resulting in a single line per entry). |
| 104 | 105 | ** |
| 105 | 106 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -95,10 +95,11 @@ | |
| 95 | ** Options: |
| 96 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 97 | ** --debug print debug information on stdout |
| 98 | ** --latest acceptable in place of VERSION, update to latest version |
| 99 | ** --force-missing force update if missing content after sync |
| 100 | ** -n|--dry-run If given, display instead of run actions |
| 101 | ** -v|--verbose print status information about all files |
| 102 | ** -W|--width <num> Width of lines (default is to auto-detect). Must be >20 |
| 103 | ** or 0 (= no limit, resulting in a single line per entry). |
| 104 | ** |
| 105 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -95,10 +95,11 @@ | |
| 95 | ** Options: |
| 96 | ** --case-sensitive <BOOL> override case-sensitive setting |
| 97 | ** --debug print debug information on stdout |
| 98 | ** --latest acceptable in place of VERSION, update to latest version |
| 99 | ** --force-missing force update if missing content after sync |
| 100 | ** --no-dir-symlinks Disables support for directory symlinks. |
| 101 | ** -n|--dry-run If given, display instead of run actions |
| 102 | ** -v|--verbose print status information about all files |
| 103 | ** -W|--width <num> Width of lines (default is to auto-detect). Must be >20 |
| 104 | ** or 0 (= no limit, resulting in a single line per entry). |
| 105 | ** |
| 106 |
+3
| --- www/env-opts.md | ||
| +++ www/env-opts.md | ||
| @@ -72,10 +72,13 @@ | ||
| 72 | 72 | `--localtime`: Override the `timeline-utc` option to explicitly use |
| 73 | 73 | local time. |
| 74 | 74 | |
| 75 | 75 | `--nocgi`: Prevent fossil from acting as a CGI by default even if the |
| 76 | 76 | `GATEWAY_INTERFACE` environment variable is set. |
| 77 | + | |
| 78 | +`--no-dir-symlinks`: Disables support for directory symlinks, thus | |
| 79 | +preventing them from being traversed into. | |
| 77 | 80 | |
| 78 | 81 | `--no-th-hook`: (Sets `g.fNoThHook`.) Override the `th1-hooks` setting |
| 79 | 82 | and prevent any TH1 hooks from being executed. |
| 80 | 83 | |
| 81 | 84 | `--quiet`: (Sets `g.fQuiet`.) Cause fossil to suppress various messages and progress |
| 82 | 85 |
| --- www/env-opts.md | |
| +++ www/env-opts.md | |
| @@ -72,10 +72,13 @@ | |
| 72 | `--localtime`: Override the `timeline-utc` option to explicitly use |
| 73 | local time. |
| 74 | |
| 75 | `--nocgi`: Prevent fossil from acting as a CGI by default even if the |
| 76 | `GATEWAY_INTERFACE` environment variable is set. |
| 77 | |
| 78 | `--no-th-hook`: (Sets `g.fNoThHook`.) Override the `th1-hooks` setting |
| 79 | and prevent any TH1 hooks from being executed. |
| 80 | |
| 81 | `--quiet`: (Sets `g.fQuiet`.) Cause fossil to suppress various messages and progress |
| 82 |
| --- www/env-opts.md | |
| +++ www/env-opts.md | |
| @@ -72,10 +72,13 @@ | |
| 72 | `--localtime`: Override the `timeline-utc` option to explicitly use |
| 73 | local time. |
| 74 | |
| 75 | `--nocgi`: Prevent fossil from acting as a CGI by default even if the |
| 76 | `GATEWAY_INTERFACE` environment variable is set. |
| 77 | |
| 78 | `--no-dir-symlinks`: Disables support for directory symlinks, thus |
| 79 | preventing them from being traversed into. |
| 80 | |
| 81 | `--no-th-hook`: (Sets `g.fNoThHook`.) Override the `th1-hooks` setting |
| 82 | and prevent any TH1 hooks from being executed. |
| 83 | |
| 84 | `--quiet`: (Sets `g.fQuiet`.) Cause fossil to suppress various messages and progress |
| 85 |