Fossil SCM

Rename and repurpose '--no-symlinks' into '--no-dir-symlinks', to prevent traversing into symlinked directories. Make the '--verily' option to 'clean' imply '--no-dir-symlinks'.

mistachkin 2017-02-01 04:40 UTC noSymlinks
Commit 66406ae9420bc0b378a87c8a0aea5b6618a46faa
+4 -8
--- src/add.c
+++ src/add.c
@@ -276,12 +276,11 @@
276276
** -f|--force Add files without prompting
277277
** --ignore <CSG> Ignore files matching patterns from the
278278
** comma separated list of glob patterns.
279279
** --clean <CSG> Also ignore files matching patterns from
280280
** the comma separated list of glob patterns.
281
-** --no-symlinks Disables support for symlinks, overriding
282
-** the "allow-symlinks" option.
281
+** --no-dir-symlinks Disables support for directory symlinks.
283282
**
284283
** See also: addremove, rm
285284
*/
286285
void add_cmd(void){
287286
int i; /* Loop counter */
@@ -443,12 +442,11 @@
443442
** --soft Skip removing files from the checkout.
444443
** This supersedes the --hard option.
445444
** --hard Remove files from the checkout.
446445
** --case-sensitive <BOOL> Override the case-sensitive setting.
447446
** -n|--dry-run If given, display instead of run actions.
448
-** --no-symlinks Disables support for symlinks, overriding
449
-** the "allow-symlinks" option.
447
+** --no-dir-symlinks Disables support for directory symlinks.
450448
**
451449
** See also: addremove, add
452450
*/
453451
void delete_cmd(void){
454452
int i;
@@ -626,12 +624,11 @@
626624
** --ignore <CSG> Ignore files matching patterns from the
627625
** comma separated list of glob patterns.
628626
** --clean <CSG> Also ignore files matching patterns from
629627
** the comma separated list of glob patterns.
630628
** -n|--dry-run If given, display instead of run actions.
631
-** --no-symlinks Disables support for symlinks, overriding
632
-** the "allow-symlinks" option.
629
+** --no-dir-symlinks Disables support for directory symlinks.
633630
**
634631
** See also: add, rm
635632
*/
636633
void addremove_cmd(void){
637634
Blob path;
@@ -855,12 +852,11 @@
855852
** --soft Skip moving files within the checkout.
856853
** This supersedes the --hard option.
857854
** --hard Move files within the checkout.
858855
** --case-sensitive <BOOL> Override the case-sensitive setting.
859856
** -n|--dry-run If given, display instead of run actions.
860
-** --no-symlinks Disables support for symlinks, overriding
861
-** the "allow-symlinks" option.
857
+** --no-dir-symlinks Disables support for directory symlinks.
862858
**
863859
** See also: changes, status
864860
*/
865861
void mv_cmd(void){
866862
int i;
867863
--- src/add.c
+++ src/add.c
@@ -276,12 +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-symlinks Disables support for symlinks, overriding
282 ** the "allow-symlinks" option.
283 **
284 ** See also: addremove, rm
285 */
286 void add_cmd(void){
287 int i; /* Loop counter */
@@ -443,12 +442,11 @@
443 ** --soft Skip removing files from the checkout.
444 ** This supersedes the --hard option.
445 ** --hard Remove files from the checkout.
446 ** --case-sensitive <BOOL> Override the case-sensitive setting.
447 ** -n|--dry-run If given, display instead of run actions.
448 ** --no-symlinks Disables support for symlinks, overriding
449 ** the "allow-symlinks" option.
450 **
451 ** See also: addremove, add
452 */
453 void delete_cmd(void){
454 int i;
@@ -626,12 +624,11 @@
626 ** --ignore <CSG> Ignore files matching patterns from the
627 ** comma separated list of glob patterns.
628 ** --clean <CSG> Also ignore files matching patterns from
629 ** the comma separated list of glob patterns.
630 ** -n|--dry-run If given, display instead of run actions.
631 ** --no-symlinks Disables support for symlinks, overriding
632 ** the "allow-symlinks" option.
633 **
634 ** See also: add, rm
635 */
636 void addremove_cmd(void){
637 Blob path;
@@ -855,12 +852,11 @@
855 ** --soft Skip moving files within the checkout.
856 ** This supersedes the --hard option.
857 ** --hard Move files within the checkout.
858 ** --case-sensitive <BOOL> Override the case-sensitive setting.
859 ** -n|--dry-run If given, display instead of run actions.
860 ** --no-symlinks Disables support for symlinks, overriding
861 ** the "allow-symlinks" option.
862 **
863 ** See also: changes, status
864 */
865 void mv_cmd(void){
866 int i;
867
--- src/add.c
+++ src/add.c
@@ -276,12 +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 */
@@ -443,12 +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;
@@ -626,12 +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;
@@ -855,12 +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
+10 -22
--- src/checkin.c
+++ src/checkin.c
@@ -417,12 +417,11 @@
417417
** --sha1sum Verify file status using SHA1 hashing rather than
418418
** relying on file mtimes.
419419
** --case-sensitive <BOOL> Override case-sensitive setting.
420420
** --dotfiles Include unmanaged files beginning with a dot.
421421
** --ignore <CSG> Ignore unmanaged files matching CSG glob patterns.
422
-** --no-symlinks Disables support for symlinks, overriding
423
-** the "allow-symlinks" option.
422
+** --no-dir-symlinks Disables support for directory symlinks.
424423
**
425424
** Options specific to the changes command:
426425
** --header Identify the repository if report is non-empty.
427426
** -v|--verbose Say "(none)" if the change report is empty.
428427
** --classify Start each line with the file's change type.
@@ -826,12 +825,11 @@
826825
** --abs-paths Display absolute pathnames.
827826
** --case-sensitive <BOOL> override case-sensitive setting
828827
** --dotfiles include files beginning with a dot (".")
829828
** --header Identify the repository if there are extras
830829
** --ignore <CSG> ignore files matching patterns from the argument
831
-** --no-symlinks Disables support for symlinks, overriding
832
-** the "allow-symlinks" option.
830
+** --no-dir-symlinks Disables support for directory symlinks.
833831
** --rel-paths Display pathnames relative to the current working
834832
** directory.
835833
**
836834
** See also: changes, clean, status
837835
*/
@@ -857,17 +855,12 @@
857855
858856
if( zIgnoreFlag==0 ){
859857
zIgnoreFlag = db_get("ignore-glob", 0);
860858
}
861859
pIgnore = glob_create(zIgnoreFlag);
862
-
863
- /*
864
- ** Always consider symlinks, unless we are explicitly forbidden from
865
- ** doing so (i.e. via the command line).
866
- */
860
+ /* Always consider symlinks. */
867861
g.allowSymlinks = db_allow_symlinks_by_default();
868
-
869862
locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
870863
glob_free(pIgnore);
871864
872865
blob_zero(&report);
873866
status_report(&report, flags);
@@ -941,14 +934,14 @@
941934
** -i|--prompt Prompt before removing each file. This option
942935
** implies the --disable-undo option.
943936
** -x|--verily WARNING: Removes everything that is not a managed
944937
** file or the repository itself. This option
945938
** implies the --force, --emptydirs, --dotfiles, and
946
-** --disable-undo options. Furthermore, it completely
947
-** disregards the keep-glob and ignore-glob settings.
948
-** However, it does honor the --ignore and --keep
949
-** 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.
950943
** --clean <CSG> WARNING: Never prompt to delete any files matching
951944
** this comma separated list of glob patterns. Also,
952945
** deletions of any files matching this pattern list
953946
** cannot be undone.
954947
** --ignore <CSG> Ignore files matching patterns from the
@@ -957,12 +950,11 @@
957950
** list of glob patterns.
958951
** -n|--dry-run Delete nothing, but display what would have been
959952
** deleted.
960953
** --no-prompt This option disables prompting the user for input
961954
** and assumes an answer of 'No' for every question.
962
-** --no-symlinks Disables support for symlinks, overriding
963
-** the "allow-symlinks" option.
955
+** --no-dir-symlinks Disables support for directory symlinks.
964956
** --temp Remove only Fossil-generated temporary files.
965957
** -v|--verbose Show all files as they are removed.
966958
**
967959
** See also: addremove, extras, status
968960
*/
@@ -1007,10 +999,11 @@
1007999
verilyFlag = allFileFlag = allDirFlag = 1;
10081000
emptyDirsFlag = 1;
10091001
disableUndo = 1;
10101002
scanFlags |= SCAN_ALL;
10111003
zCleanFlag = 0;
1004
+ g.fNoDirSymlinks = 1;
10121005
}
10131006
if( zIgnoreFlag==0 && !verilyFlag ){
10141007
zIgnoreFlag = db_get("ignore-glob", 0);
10151008
}
10161009
if( zKeepFlag==0 && !verilyFlag ){
@@ -1023,17 +1016,12 @@
10231016
verify_all_options();
10241017
pIgnore = glob_create(zIgnoreFlag);
10251018
pKeep = glob_create(zKeepFlag);
10261019
pClean = glob_create(zCleanFlag);
10271020
nRoot = (int)strlen(g.zLocalRoot);
1028
-
1029
- /*
1030
- ** Always consider symlinks, unless we are explicitly forbidden from
1031
- ** doing so (i.e. via the command line).
1032
- */
1021
+ /* Always consider symlinks. */
10331022
g.allowSymlinks = db_allow_symlinks_by_default();
1034
-
10351023
if( !dirsOnlyFlag ){
10361024
Stmt q;
10371025
Blob repo;
10381026
if( !dryRunFlag && !disableUndo ) undo_begin();
10391027
locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
10401028
--- src/checkin.c
+++ src/checkin.c
@@ -417,12 +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-symlinks Disables support for symlinks, overriding
423 ** the "allow-symlinks" option.
424 **
425 ** Options specific to the changes command:
426 ** --header Identify the repository if report is non-empty.
427 ** -v|--verbose Say "(none)" if the change report is empty.
428 ** --classify Start each line with the file's change type.
@@ -826,12 +825,11 @@
826 ** --abs-paths Display absolute pathnames.
827 ** --case-sensitive <BOOL> override case-sensitive setting
828 ** --dotfiles include files beginning with a dot (".")
829 ** --header Identify the repository if there are extras
830 ** --ignore <CSG> ignore files matching patterns from the argument
831 ** --no-symlinks Disables support for symlinks, overriding
832 ** the "allow-symlinks" option.
833 ** --rel-paths Display pathnames relative to the current working
834 ** directory.
835 **
836 ** See also: changes, clean, status
837 */
@@ -857,17 +855,12 @@
857
858 if( zIgnoreFlag==0 ){
859 zIgnoreFlag = db_get("ignore-glob", 0);
860 }
861 pIgnore = glob_create(zIgnoreFlag);
862
863 /*
864 ** Always consider symlinks, unless we are explicitly forbidden from
865 ** doing so (i.e. via the command line).
866 */
867 g.allowSymlinks = db_allow_symlinks_by_default();
868
869 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
870 glob_free(pIgnore);
871
872 blob_zero(&report);
873 status_report(&report, flags);
@@ -941,14 +934,14 @@
941 ** -i|--prompt Prompt before removing each file. This option
942 ** implies the --disable-undo option.
943 ** -x|--verily WARNING: Removes everything that is not a managed
944 ** file or the repository itself. This option
945 ** implies the --force, --emptydirs, --dotfiles, and
946 ** --disable-undo options. Furthermore, it completely
947 ** disregards the keep-glob and ignore-glob settings.
948 ** However, it does honor the --ignore and --keep
949 ** options.
950 ** --clean <CSG> WARNING: Never prompt to delete any files matching
951 ** this comma separated list of glob patterns. Also,
952 ** deletions of any files matching this pattern list
953 ** cannot be undone.
954 ** --ignore <CSG> Ignore files matching patterns from the
@@ -957,12 +950,11 @@
957 ** list of glob patterns.
958 ** -n|--dry-run Delete nothing, but display what would have been
959 ** deleted.
960 ** --no-prompt This option disables prompting the user for input
961 ** and assumes an answer of 'No' for every question.
962 ** --no-symlinks Disables support for symlinks, overriding
963 ** the "allow-symlinks" option.
964 ** --temp Remove only Fossil-generated temporary files.
965 ** -v|--verbose Show all files as they are removed.
966 **
967 ** See also: addremove, extras, status
968 */
@@ -1007,10 +999,11 @@
1007 verilyFlag = allFileFlag = allDirFlag = 1;
1008 emptyDirsFlag = 1;
1009 disableUndo = 1;
1010 scanFlags |= SCAN_ALL;
1011 zCleanFlag = 0;
 
1012 }
1013 if( zIgnoreFlag==0 && !verilyFlag ){
1014 zIgnoreFlag = db_get("ignore-glob", 0);
1015 }
1016 if( zKeepFlag==0 && !verilyFlag ){
@@ -1023,17 +1016,12 @@
1023 verify_all_options();
1024 pIgnore = glob_create(zIgnoreFlag);
1025 pKeep = glob_create(zKeepFlag);
1026 pClean = glob_create(zCleanFlag);
1027 nRoot = (int)strlen(g.zLocalRoot);
1028
1029 /*
1030 ** Always consider symlinks, unless we are explicitly forbidden from
1031 ** doing so (i.e. via the command line).
1032 */
1033 g.allowSymlinks = db_allow_symlinks_by_default();
1034
1035 if( !dirsOnlyFlag ){
1036 Stmt q;
1037 Blob repo;
1038 if( !dryRunFlag && !disableUndo ) undo_begin();
1039 locate_unmanaged_files(g.argc-2, g.argv+2, scanFlags, pIgnore);
1040
--- src/checkin.c
+++ src/checkin.c
@@ -417,12 +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.
@@ -826,12 +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 */
@@ -857,17 +855,12 @@
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);
@@ -941,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
@@ -957,12 +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 */
@@ -1007,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 ){
@@ -1023,17 +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
+2 -4
--- src/db.c
+++ src/db.c
@@ -1423,26 +1423,24 @@
14231423
return zRepo;
14241424
}
14251425
14261426
/*
14271427
** Returns non-zero if the default value for the "allow-symlinks" setting
1428
-** is "on". When on Windows, this always returns false. Otherwise, this
1429
-** value will be impacted by the "--no-symlinks" global command line option.
1428
+** is "on". When on Windows, this always returns false.
14301429
*/
14311430
int db_allow_symlinks_by_default(void){
14321431
#if defined(_WIN32)
14331432
return 0;
14341433
#else
1435
- return !g.fNoSymlinks;
1434
+ return 1;
14361435
#endif
14371436
}
14381437
14391438
/*
14401439
** Returns non-zero if support for symlinks is currently enabled.
14411440
*/
14421441
int db_allow_symlinks(void){
1443
- if( g.fNoSymlinks ) return 0;
14441442
return g.allowSymlinks;
14451443
}
14461444
14471445
/*
14481446
** Open the repository database given by zDbName. If zDbName==NULL then
14491447
--- src/db.c
+++ src/db.c
@@ -1423,26 +1423,24 @@
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. Otherwise, this
1429 ** value will be impacted by the "--no-symlinks" global command line option.
1430 */
1431 int db_allow_symlinks_by_default(void){
1432 #if defined(_WIN32)
1433 return 0;
1434 #else
1435 return !g.fNoSymlinks;
1436 #endif
1437 }
1438
1439 /*
1440 ** Returns non-zero if support for symlinks is currently enabled.
1441 */
1442 int db_allow_symlinks(void){
1443 if( g.fNoSymlinks ) return 0;
1444 return g.allowSymlinks;
1445 }
1446
1447 /*
1448 ** Open the repository database given by zDbName. If zDbName==NULL then
1449
--- src/db.c
+++ src/db.c
@@ -1423,26 +1423,24 @@
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
+2 -3
--- src/file.c
+++ src/file.c
@@ -309,11 +309,11 @@
309309
rc = getStat(zFN, 1);
310310
if( rc ){
311311
rc = 0; /* It does not exist at all. */
312312
}else if( S_ISDIR(fileStat.st_mode) ){
313313
rc = 1; /* It exists and is a real directory. */
314
- }else if( db_allow_symlinks() && S_ISLNK(fileStat.st_mode) ){
314
+ }else if( !g.fNoDirSymlinks && S_ISLNK(fileStat.st_mode) ){
315315
Blob content;
316316
blob_read_link(&content, zFN); /* It exists and is a link. */
317317
rc = file_wd_isdir(blob_str(&content)); /* Points to directory? */
318318
blob_reset(&content);
319319
}else{
@@ -1194,12 +1194,11 @@
11941194
**
11951195
** Options:
11961196
** --absolute Return an absolute path instead of a relative one.
11971197
** --case-sensitive B Enable or disable case-sensitive filenames. B is
11981198
** a boolean: "yes", "no", "true", "false", etc.
1199
-** --no-symlinks Disables support for symlinks, overriding
1200
-** the "allow-symlinks" option.
1199
+** --no-dir-symlinks Disables support for directory symlinks.
12011200
*/
12021201
void cmd_test_tree_name(void){
12031202
int i;
12041203
Blob x;
12051204
int absoluteFlag = find_option("absolute",0,0)!=0;
12061205
--- src/file.c
+++ src/file.c
@@ -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( db_allow_symlinks() && 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,12 +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-symlinks Disables support for symlinks, overriding
1200 ** the "allow-symlinks" option.
1201 */
1202 void cmd_test_tree_name(void){
1203 int i;
1204 Blob x;
1205 int absoluteFlag = find_option("absolute",0,0)!=0;
1206
--- src/file.c
+++ src/file.c
@@ -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,12 +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 -2
--- src/finfo.c
+++ src/finfo.c
@@ -45,12 +45,11 @@
4545
** --case-sensitive B Enable or disable case-sensitive filenames. B is a
4646
** boolean: "yes", "no", "true", "false", etc.
4747
** -l|--log select log mode (the default)
4848
** -n|--limit N Display the first N changes (default unlimited).
4949
** N<=0 means no limit.
50
-** --no-symlinks Disables support for symlinks, overriding
51
-** the "allow-symlinks" option.
50
+** --no-dir-symlinks Disables support for directory symlinks.
5251
** --offset P skip P changes
5352
** -p|--print select print mode
5453
** -r|--revision R print the given revision (or ckout, if none is given)
5554
** to stdout (only in print mode)
5655
** -s|--status select status mode (print a status indicator for FILE)
5756
--- src/finfo.c
+++ src/finfo.c
@@ -45,12 +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-symlinks Disables support for symlinks, overriding
51 ** the "allow-symlinks" option.
52 ** --offset P skip P changes
53 ** -p|--print select print mode
54 ** -r|--revision R print the given revision (or ckout, if none is given)
55 ** to stdout (only in print mode)
56 ** -s|--status select status mode (print a status indicator for FILE)
57
--- src/finfo.c
+++ src/finfo.c
@@ -45,12 +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 -1
--- src/json.c
+++ src/json.c
@@ -1263,10 +1263,11 @@
12631263
INT(g, isConst);
12641264
CSTR(g, zConfigDbName);
12651265
INT(g, repositoryOpen);
12661266
INT(g, localOpen);
12671267
INT(g, minPrefix);
1268
+ INT(g, fNoDirSymlinks);
12681269
INT(g, fSqlTrace);
12691270
INT(g, fSqlStats);
12701271
INT(g, fSqlPrint);
12711272
INT(g, fQuiet);
12721273
INT(g, fHttpTrace);
@@ -1294,11 +1295,10 @@
12941295
INT(g, okCsrf);
12951296
INT(g, thTrace);
12961297
INT(g, isHome);
12971298
INT(g, nAux);
12981299
INT(g, allowSymlinks);
1299
- INT(g, fNoSymlinks);
13001300
13011301
CSTR(g, zOpenRevision);
13021302
CSTR(g, zLocalRoot);
13031303
CSTR(g, zPath);
13041304
CSTR(g, zExtra);
13051305
--- 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);
@@ -1294,11 +1295,10 @@
1294 INT(g, okCsrf);
1295 INT(g, thTrace);
1296 INT(g, isHome);
1297 INT(g, nAux);
1298 INT(g, allowSymlinks);
1299 INT(g, fNoSymlinks);
1300
1301 CSTR(g, zOpenRevision);
1302 CSTR(g, zLocalRoot);
1303 CSTR(g, zPath);
1304 CSTR(g, zExtra);
1305
--- 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);
@@ -1294,11 +1295,10 @@
1295 INT(g, okCsrf);
1296 INT(g, thTrace);
1297 INT(g, isHome);
1298 INT(g, nAux);
1299 INT(g, allowSymlinks);
 
1300
1301 CSTR(g, zOpenRevision);
1302 CSTR(g, zLocalRoot);
1303 CSTR(g, zPath);
1304 CSTR(g, zExtra);
1305
+2 -2
--- src/main.c
+++ src/main.c
@@ -135,10 +135,11 @@
135135
char *zLocalDbName; /* Name of the local database file */
136136
char *zOpenRevision; /* Check-in version to use during database open */
137137
int localOpen; /* True if the local database is open */
138138
char *zLocalRoot; /* The directory holding the local database */
139139
int minPrefix; /* Number of digits needed for a distinct UUID */
140
+ int fNoDirSymlinks; /* True if --no-dir-symlinks flag is present */
140141
int fSqlTrace; /* True if --sqltrace flag is present */
141142
int fSqlStats; /* True if --sqltrace or --sqlstats are present */
142143
int fSqlPrint; /* True if -sqlprint flag is present */
143144
int fQuiet; /* True if -quiet flag is present */
144145
int fJail; /* True if running with a chroot jail */
@@ -227,11 +228,10 @@
227228
const char *azAuxVal[MX_AUX]; /* Value of each aux() or option() value */
228229
const char **azAuxOpt[MX_AUX]; /* Options of each option() value */
229230
int anAuxCols[MX_AUX]; /* Number of columns for option() values */
230231
231232
int allowSymlinks; /* Cached "allow-symlinks" option */
232
- int fNoSymlinks; /* True if --no-symlinks flag is present */
233233
234234
int mainTimerId; /* Set to fossil_timer_start() */
235235
#ifdef FOSSIL_ENABLE_JSON
236236
struct FossilJsonBits {
237237
int isJsonMode; /* True if running in JSON mode, else
@@ -614,11 +614,11 @@
614614
fossil_exit(1);
615615
}else{
616616
const char *zChdir = find_option("chdir",0,1);
617617
g.isHTTP = 0;
618618
g.rcvid = 0;
619
- g.fNoSymlinks = find_option("no-symlinks", 0, 0)!=0;
619
+ g.fNoDirSymlinks = find_option("no-dir-symlinks", 0, 0)!=0;
620620
g.fQuiet = find_option("quiet", 0, 0)!=0;
621621
g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
622622
g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
623623
g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
624624
g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
625625
--- 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 */
@@ -227,11 +228,10 @@
227 const char *azAuxVal[MX_AUX]; /* Value of each aux() or option() value */
228 const char **azAuxOpt[MX_AUX]; /* Options of each option() value */
229 int anAuxCols[MX_AUX]; /* Number of columns for option() values */
230
231 int allowSymlinks; /* Cached "allow-symlinks" option */
232 int fNoSymlinks; /* True if --no-symlinks flag is present */
233
234 int mainTimerId; /* Set to fossil_timer_start() */
235 #ifdef FOSSIL_ENABLE_JSON
236 struct FossilJsonBits {
237 int isJsonMode; /* True if running in JSON mode, else
@@ -614,11 +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.fNoSymlinks = find_option("no-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
--- 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 */
@@ -227,11 +228,10 @@
228 const char *azAuxVal[MX_AUX]; /* Value of each aux() or option() value */
229 const char **azAuxOpt[MX_AUX]; /* Options of each option() value */
230 int anAuxCols[MX_AUX]; /* Number of columns for option() values */
231
232 int allowSymlinks; /* Cached "allow-symlinks" option */
 
233
234 int mainTimerId; /* Set to fossil_timer_start() */
235 #ifdef FOSSIL_ENABLE_JSON
236 struct FossilJsonBits {
237 int isJsonMode; /* True if running in JSON mode, else
@@ -614,11 +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
+1 -2
--- src/merge.c
+++ src/merge.c
@@ -206,12 +206,11 @@
206206
**
207207
** --force-missing Force the merge even if there is missing content.
208208
**
209209
** --integrate Merged branch will be closed when committing.
210210
**
211
-** --no-symlinks Disables support for symlinks, overriding
212
-** the "allow-symlinks" option.
211
+** --no-dir-symlinks Disables support for directory symlinks.
213212
**
214213
** -n|--dry-run If given, display instead of run actions
215214
**
216215
** -v|--verbose Show additional details of the merge
217216
*/
218217
--- src/merge.c
+++ src/merge.c
@@ -206,12 +206,11 @@
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-symlinks Disables support for symlinks, overriding
212 ** the "allow-symlinks" option.
213 **
214 ** -n|--dry-run If given, display instead of run actions
215 **
216 ** -v|--verbose Show additional details of the merge
217 */
218
--- src/merge.c
+++ src/merge.c
@@ -206,12 +206,11 @@
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
+9 -10
--- src/update.c
+++ src/update.c
@@ -91,20 +91,19 @@
9191
**
9292
** The -v or --verbose option prints status information about
9393
** unchanged files in addition to those file that actually do change.
9494
**
9595
** 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-symlinks Disables support for symlinks, overriding
101
-** the "allow-symlinks" option.
102
-** -n|--dry-run If given, display instead of run actions
103
-** -v|--verbose print status information about all files
104
-** -W|--width <num> Width of lines (default is to auto-detect). Must be >20
105
-** or 0 (= no limit, resulting in a single line per entry).
96
+** --case-sensitive <BOOL> Override the 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).
106105
**
107106
** See also: revert
108107
*/
109108
void update_cmd(void){
110109
int vid; /* Current version */
111110
--- src/update.c
+++ src/update.c
@@ -91,20 +91,19 @@
91 **
92 ** The -v or --verbose option prints status information about
93 ** unchanged files in addition to those file that actually do change.
94 **
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-symlinks Disables support for symlinks, overriding
101 ** the "allow-symlinks" option.
102 ** -n|--dry-run If given, display instead of run actions
103 ** -v|--verbose print status information about all files
104 ** -W|--width <num> Width of lines (default is to auto-detect). Must be >20
105 ** or 0 (= no limit, resulting in a single line per entry).
106 **
107 ** See also: revert
108 */
109 void update_cmd(void){
110 int vid; /* Current version */
111
--- src/update.c
+++ src/update.c
@@ -91,20 +91,19 @@
91 **
92 ** The -v or --verbose option prints status information about
93 ** unchanged files in addition to those file that actually do change.
94 **
95 ** Options:
96 ** --case-sensitive <BOOL> Override the 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 ** See also: revert
107 */
108 void update_cmd(void){
109 int vid; /* Current version */
110
+2 -3
--- www/env-opts.md
+++ www/env-opts.md
@@ -73,13 +73,12 @@
7373
local time.
7474
7575
`--nocgi`: Prevent fossil from acting as a CGI by default even if the
7676
`GATEWAY_INTERFACE` environment variable is set.
7777
78
-`--no-symlinks`: Override the `allow-symlinks` option, which normally
79
-controls support for symlinks on Unix. When present, all support for
80
-symlinks will be disabled.
78
+`--no-dir-symlinks`: Disables support for directory symlinks, thus
79
+preventing them from being traversed into.
8180
8281
`--no-th-hook`: (Sets `g.fNoThHook`.) Override the `th1-hooks` setting
8382
and prevent any TH1 hooks from being executed.
8483
8584
`--quiet`: (Sets `g.fQuiet`.) Cause fossil to suppress various messages and progress
8685
--- www/env-opts.md
+++ www/env-opts.md
@@ -73,13 +73,12 @@
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-symlinks`: Override the `allow-symlinks` option, which normally
79 controls support for symlinks on Unix. When present, all support for
80 symlinks will be disabled.
81
82 `--no-th-hook`: (Sets `g.fNoThHook`.) Override the `th1-hooks` setting
83 and prevent any TH1 hooks from being executed.
84
85 `--quiet`: (Sets `g.fQuiet`.) Cause fossil to suppress various messages and progress
86
--- www/env-opts.md
+++ www/env-opts.md
@@ -73,13 +73,12 @@
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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button