From bd6c2f418ce4e1d369c46840ccf89bf8b03e83bb Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 13 Jan 2007 01:02:57 +0000 Subject: Ignore symlink permissions on Darwin, where they can't be set properly after symlink creation (refs #3) --- bin/bbackupquery/BackupQueries.cpp | 5 ++++- lib/common/BoxPlatform.h | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp index 1781282a..9c6168d8 100644 --- a/bin/bbackupquery/BackupQueries.cpp +++ b/bin/bbackupquery/BackupQueries.cpp @@ -1536,7 +1536,7 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s // Decode it std::auto_ptr fileOnServerStream; - // Got additional attibutes? + // Got additional attributes? if(i->second->HasAttributes()) { // Use these attributes @@ -1570,6 +1570,9 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s #endif if(!rParams.mIgnoreAttributes && + #ifdef PLATFORM_DISABLE_SYMLINK_ATTRIB_COMPARE + !fileOnServerStream->IsSymLink() && + #endif !localAttr.Compare(fileOnServerStream->GetAttributes(), ignoreAttrModTime, fileOnServerStream->IsSymLink() /* ignore modification time if it's a symlink */)) diff --git a/lib/common/BoxPlatform.h b/lib/common/BoxPlatform.h index 3ae929ef..4b58d31d 100644 --- a/lib/common/BoxPlatform.h +++ b/lib/common/BoxPlatform.h @@ -57,6 +57,14 @@ #define PLATFORM_DISABLE_MEM_LEAK_TESTING #endif +// Darwin also has a weird idea of permissions and dates on symlinks: +// perms are fixed at creation time by your umask, and dates can't be +// changed. This breaks unit tests if we try to compare these things. +// See: http://lists.apple.com/archives/darwin-kernel/2006/Dec/msg00057.html +#ifdef __APPLE__ + #define PLATFORM_DISABLE_SYMLINK_ATTRIB_COMPARE +#endif + // Find out if credentials on UNIX sockets can be obtained #ifndef HAVE_GETPEEREID #if !HAVE_DECL_SO_PEERCRED -- cgit v1.2.3