Fossil SCM

The file_wd_isdir() function must honor the symlinks options.

mistachkin 2017-02-01 02:42 UTC noSymlinks
Commit de053c778cb822713e06be897adabab13cf75dd5
1 file changed +1 -1
+1 -1
--- 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( S_ISLNK(fileStat.st_mode) ){
314
+ }else if( db_allow_symlinks() && 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{
320320
--- 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( 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{
320
--- 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{
320

Keyboard Shortcuts

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