From 322a8c4719e54e637533593faaa9a82cd92a6f40 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 5 Nov 2007 23:41:41 +0000 Subject: Use lstat() instead of stat() to check whether a file exists. Thanks to Hans-Joachim Baader for reporting this problem. (http://lists.warhead.org.uk/pipermail/boxbackup/2007-November/003958.html) Add a test that symlinks are not followed during restore. --- lib/common/Utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/common/Utils.cpp b/lib/common/Utils.cpp index de392ef4..83a12ccf 100644 --- a/lib/common/Utils.cpp +++ b/lib/common/Utils.cpp @@ -98,7 +98,7 @@ void DumpStackBacktrace() bool FileExists(const char *Filename, int64_t *pFileSize, bool TreatLinksAsNotExisting) { struct stat st; - if(::stat(Filename, &st) != 0) + if(::lstat(Filename, &st) != 0) { if(errno == ENOENT) { -- cgit v1.2.3