summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/bbackupctl/bbackupctl.cpp7
-rw-r--r--bin/bbackupd/BackupClientContext.cpp14
-rw-r--r--bin/bbackupd/BackupClientContext.h5
-rw-r--r--bin/bbackupd/BackupClientDirectoryRecord.cpp5
-rw-r--r--bin/bbackupd/BackupDaemon.cpp216
-rw-r--r--bin/bbackupd/BackupDaemon.h5
-rw-r--r--bin/bbackupd/Win32ServiceFunctions.cpp69
-rw-r--r--bin/bbackupd/bbackupd.cpp12
-rw-r--r--bin/bbackupquery/BackupQueries.cpp322
-rw-r--r--bin/bbackupquery/bbackupquery.cpp56
-rw-r--r--common.vcproj638
-rw-r--r--configure.ac16
-rw-r--r--distribution/boxbackup/DISTRIBUTION-MANIFEST.txt5
-rw-r--r--docs/backup/win32_build_on_cygwin_using_mingw.txt17
-rwxr-xr-xinfrastructure/makeparcels.pl18
-rw-r--r--infrastructure/msvc/2003/bbackupctl.vcproj (renamed from bbackupctl.vcproj)18
-rw-r--r--infrastructure/msvc/2003/bbackupd.vcproj (renamed from bbackupd.vcproj)48
-rw-r--r--infrastructure/msvc/2003/boxbackup.sln (renamed from boxbackup.sln)0
-rw-r--r--infrastructure/msvc/2003/boxbackup.suo (renamed from boxbackup.suo)bin22528 -> 22528 bytes
-rw-r--r--infrastructure/msvc/2003/boxquery.vcproj (renamed from boxquery.vcproj)26
-rw-r--r--infrastructure/msvc/2003/common.vcproj638
-rw-r--r--infrastructure/msvc/2003/win32test.vcproj (renamed from win32test.vcproj)22
-rw-r--r--infrastructure/msvc/2005/bbackupctl.vcproj217
-rw-r--r--infrastructure/msvc/2005/bbackupd.vcproj286
-rw-r--r--infrastructure/msvc/2005/boxbackup.sln55
-rw-r--r--infrastructure/msvc/2005/boxbackup.suobin0 -> 58880 bytes
-rw-r--r--infrastructure/msvc/2005/boxquery.vcproj242
-rw-r--r--infrastructure/msvc/2005/common.vcproj850
-rw-r--r--infrastructure/msvc/2005/win32test.vcproj217
-rw-r--r--lib/backupclient/BackupClientFileAttributes.cpp14
-rw-r--r--lib/backupclient/BackupClientRestore.cpp5
-rw-r--r--lib/backupclient/BackupStoreFile.cpp7
-rw-r--r--lib/backupclient/BackupStoreFileDiff.cpp53
-rw-r--r--lib/backupclient/BackupStoreFilenameClear.cpp4
-rw-r--r--lib/backupclient/BackupStoreObjectDump.cpp8
-rw-r--r--lib/common/BoxPlatform.h10
-rw-r--r--lib/common/DebugMemLeakFinder.cpp17
-rw-r--r--lib/common/EventWatchFilesystemObject.cpp5
-rw-r--r--lib/common/ExcludeList.cpp10
-rw-r--r--lib/common/FdGetLine.cpp19
-rw-r--r--lib/common/FileStream.h5
-rw-r--r--lib/common/Guards.h5
-rw-r--r--lib/common/NamedLock.cpp6
-rw-r--r--lib/common/Test.h5
-rw-r--r--lib/common/UnixUser.cpp8
-rw-r--r--lib/common/WaitForEvent.cpp5
-rw-r--r--lib/server/Daemon.cpp77
-rw-r--r--lib/server/LocalProcessStream.cpp9
-rw-r--r--lib/server/Socket.cpp5
-rw-r--r--lib/server/SocketListen.h5
-rw-r--r--lib/server/SocketStream.cpp5
-rw-r--r--lib/win32/WinNamedPipeStream.cpp43
-rw-r--r--lib/win32/config.h.win32396
-rw-r--r--lib/win32/emu.cpp913
-rw-r--r--lib/win32/emu.h196
-rw-r--r--parcels.txt1
-rw-r--r--test/win32/Makefile5
-rw-r--r--test/win32/testlibwin32.cpp2
-rw-r--r--test/win32/timezone.cpp87
-rw-r--r--win32.bat35
60 files changed, 4577 insertions, 1412 deletions
diff --git a/bin/bbackupctl/bbackupctl.cpp b/bin/bbackupctl/bbackupctl.cpp
index d39092e8..dfadc37d 100644
--- a/bin/bbackupctl/bbackupctl.cpp
+++ b/bin/bbackupctl/bbackupctl.cpp
@@ -10,7 +10,10 @@
#include "Box.h"
#include <stdio.h>
-#include <unistd.h>
+
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
#include "MainHelper.h"
#include "BoxPortsAndFiles.h"
@@ -212,7 +215,7 @@ int main(int argc, const char *argv[])
// No? Just send the command given plus a quit command.
std::string cmd(argv[0]);
cmd += "\nquit\n";
- connection.Write(cmd.c_str(), cmd.size());
+ connection.Write(cmd.c_str(), cmd.size());
}
// Read the response
diff --git a/bin/bbackupd/BackupClientContext.cpp b/bin/bbackupd/BackupClientContext.cpp
index ae4e1cad..25852b19 100644
--- a/bin/bbackupd/BackupClientContext.cpp
+++ b/bin/bbackupd/BackupClientContext.cpp
@@ -57,9 +57,7 @@ BackupClientContext::BackupClientContext(BackupDaemon &rDaemon, TLSContext &rTLS
mpExcludeFiles(0),
mpExcludeDirs(0),
mbIsManaged(false),
- mTimeMgmtEpoch(0),
- mMaximumDiffTime(600),
- mKeepAliveTime(0)
+ mTimeMgmtEpoch(0)
{
}
@@ -511,6 +509,9 @@ void BackupClientContext::ManageDiffProcess()
#ifdef PLATFORM_CYGWIN
::signal(SIGALRM, TimerSigHandler);
+#elif defined WIN32
+ // no support for SIGVTALRM
+ SetTimerHandler(TimerSigHandler);
#else
::signal(SIGVTALRM, TimerSigHandler);
#endif // PLATFORM_CYGWIN
@@ -599,7 +600,10 @@ void BackupClientContext::UnManageDiffProcess()
void BackupClientContext::DoKeepAlive()
{
if (!mpConnection)
+ {
+ ::syslog(LOG_ERR, "DoKeepAlive() called with no connection!");
return;
+ }
mpConnection->QueryGetIsAlive();
}
@@ -620,10 +624,10 @@ time_t BackupClientContext::GetTimeMgmtEpoch()
int BackupClientContext::GetMaximumDiffingTime()
{
- return mMaximumDiffTime;
+ return sMaximumDiffTime;
}
int BackupClientContext::GetKeepaliveTime()
{
- return mKeepAliveTime;
+ return sKeepAliveTime;
}
diff --git a/bin/bbackupd/BackupClientContext.h b/bin/bbackupd/BackupClientContext.h
index 234868db..a0cf6e1f 100644
--- a/bin/bbackupd/BackupClientContext.h
+++ b/bin/bbackupd/BackupClientContext.h
@@ -208,11 +208,6 @@ private:
bool mbIsManaged;
// unix time when diff was started
time_t mTimeMgmtEpoch;
- // maximum time to spend diffing, in seconds
- int mMaximumDiffTime;
- // maximum time of SSL inactivity (keep-alive interval), in seconds
- int mKeepAliveTime;
-
};
diff --git a/bin/bbackupd/BackupClientDirectoryRecord.cpp b/bin/bbackupd/BackupClientDirectoryRecord.cpp
index 49193ccf..5a566d84 100644
--- a/bin/bbackupd/BackupClientDirectoryRecord.cpp
+++ b/bin/bbackupd/BackupClientDirectoryRecord.cpp
@@ -9,7 +9,10 @@
#include "Box.h"
-#include <dirent.h>
+#ifdef HAVE_DIRENT_H
+ #include <dirent.h>
+#endif
+
#include <errno.h>
#include <string.h>
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index a6d25f0f..01e5bf36 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -11,8 +11,10 @@
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
@@ -35,6 +37,9 @@
#include <cstdio>
#include <sys/mnttab.h>
#endif
+#ifdef HAVE_PROCESS_H
+ #include <process.h>
+#endif
#include "Configuration.h"
#include "IOStream.h"
@@ -78,6 +83,25 @@ static const time_t MAX_SLEEP_TIME = 1024;
// This prevents repetative cycles of load on the server
#define SYNC_PERIOD_RANDOM_EXTRA_TIME_SHIFT_BY 6
+#ifdef WIN32
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: HelperThread()
+// Purpose: Background thread function, called by Windows,
+// calls the BackupDaemon's RunHelperThread method
+// to listen for and act on control communications
+// Created: 18/2/04
+//
+// --------------------------------------------------------------------------
+unsigned int WINAPI HelperThread(LPVOID lpParam)
+{
+ ((BackupDaemon *)lpParam)->RunHelperThread();
+
+ return 0;
+}
+#endif
+
// --------------------------------------------------------------------------
//
// Function
@@ -99,6 +123,20 @@ BackupDaemon::BackupDaemon()
{
mNotificationsSent[l] = false;
}
+
+#ifdef WIN32
+ // Create a thread to handle the named pipe
+ HANDLE hThread;
+ unsigned int dwThreadId;
+
+ hThread = (HANDLE) _beginthreadex(
+ NULL, // default security attributes
+ 0, // use default stack size
+ HelperThread, // thread function
+ this, // argument to thread function
+ 0, // use default creation flags
+ &dwThreadId); // returns the thread identifier
+#endif
}
// --------------------------------------------------------------------------
@@ -185,11 +223,12 @@ void BackupDaemon::SetupInInitialProcess()
if(GetConfiguration().KeyExists("CommandSocket"))
{
printf(
- "============================================================================================\n" \
- "SECURITY WARNING: This platform cannot check the credentials of connections to the\n" \
- "command socket. This is a potential DoS security problem.\n" \
- "Remove the CommandSocket directive from the bbackupd.conf file if bbackupctl is not used.\n" \
- "============================================================================================\n"
+ "==============================================================================\n"
+ "SECURITY WARNING: This platform cannot check the credentials of connections to\n"
+ "the command socket. This is a potential DoS security problem.\n"
+ "Remove the CommandSocket directive from the bbackupd.conf file if bbackupctl\n"
+ "is not used.\n"
+ "==============================================================================\n"
);
}
}
@@ -221,30 +260,13 @@ void BackupDaemon::DeleteAllLocations()
}
#ifdef WIN32
-// --------------------------------------------------------------------------
-//
-// Function
-// Name: HelperThread()
-// Purpose: Background thread function, called by Windows,
-// calls the BackupDaemon's RunHelperThread method
-// to listen for and act on control communications
-// Created: 18/2/04
-//
-// --------------------------------------------------------------------------
-unsigned int WINAPI HelperThread( LPVOID lpParam )
-{
- printf( "Parameter = %lu.\n", *(DWORD*)lpParam );
- ((BackupDaemon *)lpParam)->RunHelperThread();
-
- return 0;
-}
-
void BackupDaemon::RunHelperThread(void)
{
mpCommandSocketInfo = new CommandSocketInfo;
this->mReceivedCommandConn = false;
- while ( !IsTerminateWanted() )
+ // loop until the parent process exits
+ while (TRUE)
{
try
{
@@ -359,24 +381,21 @@ void BackupDaemon::RunHelperThread(void)
void BackupDaemon::Run()
{
#ifdef WIN32
-
- // Create a thread to handle the named pipe
- HANDLE hThread;
- unsigned int dwThreadId;
-
- hThread = (HANDLE) _beginthreadex(
- NULL, // default security attributes
- 0, // use default stack size
- HelperThread, // thread function
- this, // argument to thread function
- 0, // use default creation flags
- &dwThreadId); // returns the thread identifier
-
// init our own timer for file diff timeouts
InitTimer();
-#else // ! WIN32
+ try
+ {
+ Run2();
+ }
+ catch(...)
+ {
+ FiniTimer();
+ throw;
+ }
+ FiniTimer();
+#else // ! WIN32
// Ignore SIGPIPE (so that if a command connection is broken, the daemon doesn't terminate)
::signal(SIGPIPE, SIG_IGN);
@@ -390,8 +409,6 @@ void BackupDaemon::Run()
::unlink(socketName);
mpCommandSocketInfo->mListeningSocket.Listen(Socket::TypeUNIX, socketName);
}
-
-#endif // WIN32
// Handle things nicely on exceptions
try
@@ -402,23 +419,28 @@ void BackupDaemon::Run()
{
if(mpCommandSocketInfo != 0)
{
- delete mpCommandSocketInfo;
+ try
+ {
+ delete mpCommandSocketInfo;
+ }
+ catch(...)
+ {
+ ::syslog(LOG_WARNING,
+ "Error closing command socket "
+ "after exception, ignored.");
+ }
mpCommandSocketInfo = 0;
}
throw;
}
-
+
// Clean up
if(mpCommandSocketInfo != 0)
{
delete mpCommandSocketInfo;
mpCommandSocketInfo = 0;
}
-
-#ifdef WIN32
- // clean up windows specific stuff.
- FiniTimer();
#endif
}
@@ -482,8 +504,8 @@ void BackupDaemon::Run2()
BackupClientContext::ClientStoreMarker_NotKnown;
// haven't contacted the store yet
- DeserializeStoreObjectInfo(clientStoreMarker, lastSyncTime,
- nextSyncTime);
+ bool deserialised = DeserializeStoreObjectInfo(clientStoreMarker,
+ lastSyncTime, nextSyncTime);
// --------------------------------------------------------------------------------------------
@@ -585,6 +607,17 @@ void BackupDaemon::Run2()
// but this should be OK, because the changes only upload should upload no data.
syncPeriodEndExtended += SecondsToBoxTime((time_t)(356*24*3600));
}
+
+ // Delete the serialised store object file,
+ // so that we don't try to reload it after a
+ // partially completed backup
+ if(deserialised && !DeleteStoreObjectInfo())
+ {
+ ::syslog(LOG_ERR, "Failed to delete the "
+ "StoreObjectInfoFile, backup cannot "
+ "continue safely.");
+ continue;
+ }
// Do sync
bool errorOccurred = false;
@@ -751,7 +784,12 @@ void BackupDaemon::Run2()
"to retry...",
errorString, errorCode,
errorSubCode);
- ::sleep(100);
+ ::sleep(10);
+ nextSyncTime = currentSyncStartTime +
+ SecondsToBoxTime(90) +
+ Random::RandomInt(
+ updateStoreInterval >>
+ SYNC_PERIOD_RANDOM_EXTRA_TIME_SHIFT_BY);
}
}
@@ -863,7 +901,7 @@ void BackupDaemon::WaitOnCommandSocket(box_time_t RequiredDelay, bool &DoSyncFla
#ifdef WIN32
// Really could use some interprocess protection, mutex etc
// any side effect should be too bad???? :)
- DWORD timeout = BoxTimeToMilliSeconds(RequiredDelay);
+ DWORD timeout = (DWORD)BoxTimeToMilliSeconds(RequiredDelay);
while ( this->mReceivedCommandConn == false )
{
@@ -1065,25 +1103,23 @@ void BackupDaemon::WaitOnCommandSocket(box_time_t RequiredDelay, bool &DoSyncFla
// --------------------------------------------------------------------------
void BackupDaemon::CloseCommandConnection()
{
+#ifndef WIN32
try
{
TRACE0("Closing command connection\n");
-#ifdef WIN32
- mpCommandSocketInfo->mListeningSocket.Close();
-#else
if(mpCommandSocketInfo->mpGetLine)
{
delete mpCommandSocketInfo->mpGetLine;
mpCommandSocketInfo->mpGetLine = 0;
}
mpCommandSocketInfo->mpConnectedSocket.reset();
-#endif
}
catch(...)
{
// Ignore any errors
}
+#endif
}
@@ -1100,7 +1136,11 @@ void BackupDaemon::SendSyncStartOrFinish(bool SendStart)
{
// The bbackupctl program can't rely on a state change, because it may never
// change if the server doesn't need to be contacted.
-
+
+#ifdef __MINGW32__
+#warning race condition: what happens if socket is closed?
+#endif
+
if (mpCommandSocketInfo != NULL &&
#ifdef WIN32
mpCommandSocketInfo->mListeningSocket.IsConnected()
@@ -1114,7 +1154,7 @@ void BackupDaemon::SendSyncStartOrFinish(bool SendStart)
{
#ifdef WIN32
mpCommandSocketInfo->mListeningSocket.Write(message,
- strlen(message));
+ (int)strlen(message));
#else
mpCommandSocketInfo->mpConnectedSocket->Write(message,
strlen(message));
@@ -1711,7 +1751,10 @@ void BackupDaemon::SetState(int State)
char newStateSize = sprintf(newState, "state %d\n", State);
#ifdef WIN32
- #warning FIX ME: race condition
+ #ifndef _MSC_VER
+ #warning FIX ME: race condition
+ #endif
+
// what happens if the socket is closed by the other thread before
// we can write to it? Null pointer deref at best.
if (mpCommandSocketInfo &&
@@ -2196,7 +2239,7 @@ void BackupDaemon::SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time
// Created: 2005/04/11
//
// --------------------------------------------------------------------------
-void BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_time_t & theLastSyncTime, box_time_t & theNextSyncTime)
+bool BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_time_t & theLastSyncTime, box_time_t & theNextSyncTime)
{
//
//
@@ -2208,7 +2251,7 @@ void BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_
//
if(!GetConfiguration().KeyExists("StoreObjectInfoFile"))
{
- return;
+ return false;
}
std::string StoreObjectInfoFile =
@@ -2216,7 +2259,7 @@ void BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_
if (StoreObjectInfoFile.size() <= 0)
{
- return;
+ return false;
}
try
@@ -2236,7 +2279,7 @@ void BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_
"is not a valid or compatible serialised "
"archive. Will re-cache from store.",
StoreObjectInfoFile.c_str());
- return;
+ return false;
}
//
@@ -2251,7 +2294,7 @@ void BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_
"is not a valid or compatible serialised "
"archive. Will re-cache from store.",
StoreObjectInfoFile.c_str());
- return;
+ return false;
}
//
@@ -2264,11 +2307,11 @@ void BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_
if (iVersion != STOREOBJECTINFO_VERSION)
{
::syslog(LOG_WARNING, "Store object info file '%s' "
- "version [%d] unsupported. "
+ "version %d unsupported. "
"Will re-cache from store.",
StoreObjectInfoFile.c_str(),
iVersion);
- return;
+ return false;
}
//
@@ -2283,7 +2326,7 @@ void BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_
::syslog(LOG_WARNING, "Store object info file '%s' "
"out of date. Will re-cache from store",
StoreObjectInfoFile.c_str());
- return;
+ return false;
}
//
@@ -2331,12 +2374,7 @@ void BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_
"version [%d]", StoreObjectInfoFile.c_str(),
iVersion);
- if (::unlink(StoreObjectInfoFile.c_str()) != 0)
- {
- ::syslog(LOG_ERR, "Failed to delete the old "
- "store object info file '%s': %s",
- StoreObjectInfoFile.c_str(), strerror(errno));
- }
+ return true;
}
catch (...)
{
@@ -2352,4 +2390,38 @@ void BackupDaemon::DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_
"Will re-cache from store.",
StoreObjectInfoFile.c_str());
}
+
+ return false;
+}
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: BackupDaemon::DeleteStoreObjectInfo()
+// Purpose: Deletes the serialised state file, to prevent us
+// from using it again if a backup is interrupted.
+//
+// Created: 2006/02/12
+//
+// --------------------------------------------------------------------------
+
+bool BackupDaemon::DeleteStoreObjectInfo() const
+{
+ if(!GetConfiguration().KeyExists("StoreObjectInfoFile"))
+ {
+ return false;
+ }
+
+ std::string StoreObjectInfoFile =
+ GetConfiguration().GetKeyValue("StoreObjectInfoFile");
+
+ if (::unlink(StoreObjectInfoFile.c_str()) != 0)
+ {
+ ::syslog(LOG_ERR, "Failed to delete the old "
+ "store object info file '%s': %s",
+ StoreObjectInfoFile.c_str(), strerror(errno));
+ return false;
+ }
+
+ return true;
}
diff --git a/bin/bbackupd/BackupDaemon.h b/bin/bbackupd/BackupDaemon.h
index 8693fe9e..3bd15fad 100644
--- a/bin/bbackupd/BackupDaemon.h
+++ b/bin/bbackupd/BackupDaemon.h
@@ -45,10 +45,11 @@ public:
BackupDaemon();
~BackupDaemon();
+private:
// methods below do partial (specialized) serialization of client state only
void SerializeStoreObjectInfo(int64_t aClientStoreMarker, box_time_t theLastSyncTime, box_time_t theNextSyncTime) const;
- void DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_time_t & theLastSyncTime, box_time_t & theNextSyncTime);
-private:
+ bool DeserializeStoreObjectInfo(int64_t & aClientStoreMarker, box_time_t & theLastSyncTime, box_time_t & theNextSyncTime);
+ bool DeleteStoreObjectInfo() const;
BackupDaemon(const BackupDaemon &);
public:
diff --git a/bin/bbackupd/Win32ServiceFunctions.cpp b/bin/bbackupd/Win32ServiceFunctions.cpp
index 89f02f62..b74c7e09 100644
--- a/bin/bbackupd/Win32ServiceFunctions.cpp
+++ b/bin/bbackupd/Win32ServiceFunctions.cpp
@@ -14,10 +14,12 @@
#include "Box.h"
-//#include <stdio.h>
-//#include <stdlib.h>
-#include <unistd.h>
-//#include <windows.h>
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+#ifdef HAVE_PROCESS_H
+ #include <process.h>
+#endif
extern void TerminateService(void);
extern unsigned int WINAPI RunService(LPVOID lpParameter);
@@ -31,18 +33,23 @@ HANDLE gStopServiceEvent = 0;
#define SERVICE_NAME "boxbackup"
+void ShowMessage(char *s)
+{
+ MessageBox(0, s, "Box Backup Message",
+ MB_OK | MB_SETFOREGROUND | MB_DEFAULT_DESKTOP_ONLY);
+}
+
void ErrorHandler(char *s, DWORD err)
{
char buf[256];
memset(buf, 0, sizeof(buf));
- snprintf(buf, sizeof(buf)-1, "%s (%d)", s, err);
+ _snprintf(buf, sizeof(buf)-1, "%s (%d)", s, err);
::syslog(LOG_ERR, "%s", buf);
MessageBox(0, buf, "Error",
MB_OK | MB_SETFOREGROUND | MB_DEFAULT_DESKTOP_ONLY);
ExitProcess(err);
}
-
void WINAPI ServiceControlHandler( DWORD controlCode )
{
switch ( controlCode )
@@ -88,7 +95,7 @@ void WINAPI ServiceControlHandler( DWORD controlCode )
VOID ServiceMain(DWORD argc, LPTSTR *argv)
{
- // initialise service status
+ // initialise service status
gServiceStatus.dwServiceType = SERVICE_WIN32;
gServiceStatus.dwCurrentState = SERVICE_STOPPED;
gServiceStatus.dwControlsAccepted = 0;
@@ -178,14 +185,19 @@ void InstallService(void)
scm = OpenSCManager(0,0,SC_MANAGER_CREATE_SERVICE);
- if (!scm) return;
+ if (!scm)
+ {
+ syslog(LOG_ERR, "Failed to open service control manager: "
+ "error %d", GetLastError());
+ return;
+ }
char cmd[MAX_PATH];
GetModuleFileName(NULL, cmd, sizeof(cmd)-1);
cmd[sizeof(cmd)-1] = 0;
char cmd_args[MAX_PATH];
- snprintf(cmd_args, sizeof(cmd_args)-1, "%s --service", cmd);
+ _snprintf(cmd_args, sizeof(cmd_args)-1, "%s --service", cmd);
cmd_args[sizeof(cmd_args)-1] = 0;
newService = CreateService(
@@ -194,12 +206,31 @@ void InstallService(void)
"Box Backup",
SERVICE_ALL_ACCESS,
SERVICE_WIN32_OWN_PROCESS,
- SERVICE_DEMAND_START,
+ SERVICE_AUTO_START,
SERVICE_ERROR_NORMAL,
cmd_args,
0,0,0,0,0);
- if (newService) CloseServiceHandle(newService);
+ if (!newService)
+ {
+ ::syslog(LOG_ERR, "Failed to create Box Backup service: "
+ "error %d", GetLastError());
+ return;
+ }
+
+ ::syslog(LOG_INFO, "Created Box Backup service");
+
+ SERVICE_DESCRIPTION desc;
+ desc.lpDescription = "Backs up your data files over the Internet";
+
+ if (!ChangeServiceConfig2(newService, SERVICE_CONFIG_DESCRIPTION,
+ &desc))
+ {
+ ::syslog(LOG_WARNING, "Failed to set description for "
+ "Box Backup service: error %d", GetLastError());
+ }
+
+ CloseServiceHandle(newService);
CloseServiceHandle(scm);
}
@@ -210,23 +241,31 @@ void RemoveService(void)
scm = OpenSCManager(0,0,SC_MANAGER_CREATE_SERVICE);
- if (!scm) return;
+ if (!scm)
+ {
+ syslog(LOG_ERR, "Failed to open service control manager: "
+ "error %d", GetLastError());
+ return;
+ }
service = OpenService(scm, SERVICE_NAME, SERVICE_ALL_ACCESS|DELETE);
ControlService(service, SERVICE_CONTROL_STOP, &status);
if (!service)
{
- printf("Failed to open service manager");
+ syslog(LOG_ERR, "Failed to open Box Backup service: "
+ "error %d", GetLastError());
return;
}
+
if (DeleteService(service))
{
- printf("Service removed");
+ syslog(LOG_INFO, "Box Backup service deleted");
}
else
{
- printf("Failed to remove service");
+ syslog(LOG_ERR, "Failed to remove Box Backup service: "
+ "error %d", GetLastError());
}
CloseServiceHandle(service);
diff --git a/bin/bbackupd/bbackupd.cpp b/bin/bbackupd/bbackupd.cpp
index 1c870317..089b2d09 100644
--- a/bin/bbackupd/bbackupd.cpp
+++ b/bin/bbackupd/bbackupd.cpp
@@ -48,13 +48,19 @@ int main(int argc, const char *argv[])
InstallService();
return 0;
}
-
+
+ bool runAsWin32Service = false;
+ if (argc == 2 && ::strcmp(argv[1], "--service") == 0)
+ {
+ runAsWin32Service = true;
+ }
+
// Under win32 we must initialise the Winsock library
// before using sockets
WSADATA info;
- if (WSAStartup(MAKELONG(1, 1), &info) == SOCKET_ERROR)
+ if (WSAStartup(0x0101, &info) == SOCKET_ERROR)
{
// box backup will not run without sockets
::syslog(LOG_ERR, "Failed to initialise Windows Sockets");
@@ -65,7 +71,7 @@ int main(int argc, const char *argv[])
int ExitCode = 0;
- if (argc == 2 && ::strcmp(argv[1], "--service") == 0)
+ if (runAsWin32Service)
{
syslog(LOG_INFO,"Starting Box Backup Service");
OurService();
diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp
index 473daaf6..916228c3 100644
--- a/bin/bbackupquery/BackupQueries.cpp
+++ b/bin/bbackupquery/BackupQueries.cpp
@@ -9,15 +9,21 @@
#include "Box.h"
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#include <string.h>
#include <stdio.h>
-#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <dirent.h>
+
+#ifdef HAVE_DIRENT_H
+ #include <dirent.h>
+#endif
#include <set>
@@ -246,8 +252,9 @@ void BackupQueries::DoCommand(const char *Command)
case COMMAND_pwd:
{
// Simple implementation, so do it here
- std::string dir(GetCurrentDirectoryName());
- printf("%s (%08llx)\n", dir.c_str(), GetCurrentDirectoryID());
+ printf("%s (%08llx)\n",
+ GetCurrentDirectoryName().c_str(),
+ (long long)GetCurrentDirectoryID());
}
break;
@@ -325,11 +332,23 @@ void BackupQueries::CommandList(const std::vector<std::string> &args, const bool
// Got a directory in the arguments?
if(args.size() > 0)
{
+#ifdef WIN32
+ std::string storeDirEncoded;
+ if(!ConvertConsoleToUtf8(args[0].c_str(), storeDirEncoded))
+ return;
+#else
+ const std::string& storeDirEncoded(args[0]);
+#endif
+
// Attempt to find the directory
- rootDir = FindDirectoryObjectID(args[0], opts[LIST_OPTION_ALLOWOLD], opts[LIST_OPTION_ALLOWDELETED]);
+ rootDir = FindDirectoryObjectID(storeDirEncoded,
+ opts[LIST_OPTION_ALLOWOLD],
+ opts[LIST_OPTION_ALLOWDELETED]);
+
if(rootDir == 0)
{
- printf("Directory %s not found on store\n", args[0].c_str());
+ printf("Directory '%s' not found on store\n",
+ args[0].c_str());
return;
}
}
@@ -373,19 +392,16 @@ void BackupQueries::List(int64_t DirID, const std::string &rListRoot, const bool
{
// Display this entry
BackupStoreFilenameClear clear(en->GetName());
- std::string line;
// Object ID?
if(!opts[LIST_OPTION_NOOBJECTID])
{
// add object ID to line
- char oid[32];
-#ifdef WIN32
- sprintf(oid, "%08I64x ", en->GetObjectID());
+#ifdef _MSC_VER
+ printf("%08I64x ", (int64_t)en->GetObjectID());
#else
- sprintf(oid, "%08llx ", en->GetObjectID());
+ printf("%08llx ", (long long)en->GetObjectID());
#endif
- line += oid;
}
// Flags?
@@ -412,57 +428,71 @@ void BackupQueries::List(int64_t DirID, const std::string &rListRoot, const bool
// terminate
*(f++) = ' ';
*(f++) = '\0';
- line += displayflags;
+ printf(displayflags);
+
if(en_flags != 0)
{
- line += "[ERROR: Entry has additional flags set] ";
+ printf("[ERROR: Entry has additional flags set] ");
}
}
if(opts[LIST_OPTION_TIMES])
{
// Show times...
- line += BoxTimeToISO8601String(en->GetModificationTime());
- line += ' ';
+ std::string time = BoxTimeToISO8601String(
+ en->GetModificationTime());
+ printf("%s ", time.c_str());
}
if(opts[LIST_OPTION_DISPLAY_HASH])
{
- char hash[64];
-#ifdef WIN32
- ::sprintf(hash, "%016I64x ", en->GetAttributesHash());
+#ifdef _MSC_VER
+ printf("%016I64x ", (int64_t)en->GetAttributesHash());
#else
- ::sprintf(hash, "%016llx ", en->GetAttributesHash());
+ printf("%016llx ", (long long)en->GetAttributesHash());
#endif
- line += hash;
}
if(opts[LIST_OPTION_SIZEINBLOCKS])
{
- char num[32];
-#ifdef WIN32
- sprintf(num, "%05I64d ", en->GetSizeInBlocks());
+#ifdef _MSC_VER
+ printf("%05I64d ", (int64_t)en->GetSizeInBlocks());
#else
- sprintf(num, "%05lld ", en->GetSizeInBlocks());
+ printf("%05lld ", (long long)en->GetSizeInBlocks());
#endif
- line += num;
}
// add name
if(!FirstLevel)
{
- line += rListRoot;
- line += '/';
+#ifdef WIN32
+ std::string listRootDecoded;
+ if(!ConvertUtf8ToConsole(rListRoot.c_str(),
+ listRootDecoded)) return;
+ printf("%s/", listRootDecoded.c_str());
+#else
+ printf("%s/", rListRoot.c_str());
+#endif
}
- line += clear.GetClearFilename().c_str();
- if(!en->GetName().IsEncrypted())
+#ifdef WIN32
{
- line += "[FILENAME NOT ENCRYPTED]";
+ std::string fileName;
+ if(!ConvertUtf8ToConsole(
+ clear.GetClearFilename().c_str(), fileName))
+ return;
+ printf("%s", fileName.c_str());
}
+#else
+ printf("%s", clear.GetClearFilename().c_str());
+#endif
- // print line
- printf("%s\n", line.c_str());
+ if(!en->GetName().IsEncrypted())
+ {
+ printf("[FILENAME NOT ENCRYPTED]");
+ }
+
+ printf("\n");
// Directory?
if((en->GetFlags() & BackupStoreDirectory::Entry::Flags_Dir) != 0)
@@ -495,7 +525,7 @@ int64_t BackupQueries::FindDirectoryObjectID(const std::string &rDirName, bool A
{
// Split up string into elements
std::vector<std::string> dirElements;
- SplitString(rDirName, DIRECTORY_SEPARATOR_ASCHAR, dirElements);
+ SplitString(rDirName, '/', dirElements);
// Start from current stack, or root, whichever is required
std::vector<std::pair<std::string, int64_t> > stack;
@@ -629,7 +659,14 @@ std::string BackupQueries::GetCurrentDirectoryName()
for(unsigned int l = 0; l < mDirStack.size(); ++l)
{
r += "/";
+#ifdef WIN32
+ std::string dirName;
+ if(!ConvertUtf8ToConsole(mDirStack[l].first.c_str(), dirName))
+ return "error";
+ r += dirName;
+#else
r += mDirStack[l].first;
+#endif
}
return r;
@@ -651,9 +688,17 @@ void BackupQueries::CommandChangeDir(const std::vector<std::string> &args, const
printf("Incorrect usage.\ncd [-o] [-d] <directory>\n");
return;
}
+
+#ifdef WIN32
+ std::string dirName;
+ if(!ConvertConsoleToUtf8(args[0].c_str(), dirName)) return;
+#else
+ const std::string& dirName(args[0]);
+#endif
std::vector<std::pair<std::string, int64_t> > newStack;
- int64_t id = FindDirectoryObjectID(args[0], opts['o'], opts['d'], &newStack);
+ int64_t id = FindDirectoryObjectID(dirName, opts['o'], opts['d'],
+ &newStack);
if(id == 0)
{
@@ -683,7 +728,14 @@ void BackupQueries::CommandChangeLocalDir(const std::vector<std::string> &args)
}
// Try changing directory
- if(::chdir(args[0].c_str()) != 0)
+#ifdef WIN32
+ std::string dirName;
+ if(!ConvertConsoleToUtf8(args[0].c_str(), dirName)) return;
+ int result = ::chdir(dirName.c_str());
+#else
+ int result = ::chdir(args[0].c_str());
+#endif
+ if(result != 0)
{
printf((errno == ENOENT || errno == ENOTDIR)?"Directory '%s' does not exist\n":"Error changing dir to '%s'\n",
args[0].c_str());
@@ -697,8 +749,13 @@ void BackupQueries::CommandChangeLocalDir(const std::vector<std::string> &args)
printf("Error getting current directory\n");
return;
}
-
+
+#ifdef WIN32
+ if(!ConvertUtf8ToConsole(wd, dirName)) return;
+ printf("Local current directory is now '%s'\n", dirName.c_str());
+#else
printf("Local current directory is now '%s'\n", wd);
+#endif
}
@@ -826,7 +883,14 @@ void BackupQueries::CommandGet(const std::vector<std::string> &args, const bool
{
// Specified by name, find the object in the directory to get the ID
BackupStoreDirectory::Iterator i(dir);
+#ifdef WIN32
+ std::string fileName;
+ if(!ConvertConsoleToUtf8(args[0].c_str(), fileName))
+ return;
+ BackupStoreFilenameClear fn(fileName);
+#else
BackupStoreFilenameClear fn(args[0]);
+#endif
BackupStoreDirectory::Entry *en = i.FindMatchingClearName(fn);
if(en == 0)
@@ -868,7 +932,7 @@ void BackupQueries::CommandGet(const std::vector<std::string> &args, const bool
}
catch(...)
{
- ::unlink(args[1].c_str());
+ ::unlink(localName.c_str());
printf("Error occured fetching file.\n");
}
}
@@ -962,7 +1026,7 @@ void BackupQueries::CommandCompare(const std::vector<std::string> &args, const b
}
else
{
- printf("Warning: couldn't determine the time of the last syncronisation -- checks not performed.\n");
+ printf("Warning: couldn't determine the time of the last synchronisation -- checks not performed.\n");
}
}
@@ -1049,7 +1113,7 @@ void BackupQueries::CompareLocation(const std::string &rLocation, BackupQueries:
}
// Then get it compared
- Compare(std::string(DIRECTORY_SEPARATOR) + rLocation,
+ Compare(std::string("/") + rLocation,
loc.GetKeyValue("Path"), rParams);
}
catch(...)
@@ -1074,32 +1138,62 @@ void BackupQueries::CompareLocation(const std::string &rLocation, BackupQueries:
// --------------------------------------------------------------------------
void BackupQueries::Compare(const std::string &rStoreDir, const std::string &rLocalDir, BackupQueries::CompareParams &rParams)
{
+#ifdef WIN32
+ std::string storeDirEncoded;
+ if(!ConvertConsoleToUtf8(rStoreDir.c_str(), storeDirEncoded)) return;
+#else
+ const std::string& storeDirEncoded(rStoreDir);
+#endif
+
// Get the directory ID of the directory -- only use current data
- int64_t dirID = FindDirectoryObjectID(rStoreDir);
+ int64_t dirID = FindDirectoryObjectID(storeDirEncoded);
// Found?
if(dirID == 0)
{
- printf("Local directory '%s' exists, but server directory '%s' does not exist\n", rLocalDir.c_str(), rStoreDir.c_str());
+ printf("Local directory '%s' exists, but "
+ "server directory '%s' does not exist\n",
+ rLocalDir.c_str(), rStoreDir.c_str());
rParams.mDifferences ++;
return;
}
+
+#ifdef WIN32
+ std::string localDirEncoded;
+ if(!ConvertConsoleToUtf8(rLocalDir.c_str(), localDirEncoded)) return;
+#else
+ std::string localDirEncoded(rLocalDir);
+#endif
// Go!
- Compare(dirID, rStoreDir, rLocalDir, rParams);
+ Compare(dirID, storeDirEncoded, localDirEncoded, rParams);
}
// --------------------------------------------------------------------------
//
// Function
-// Name: BackupQueries::Compare(int64_t, const std::string &, BackupQueries::CompareParams &)
+// Name: BackupQueries::Compare(int64_t, const std::string &,
+// const std::string &, BackupQueries::CompareParams &)
// Purpose: Compare a store directory against a local directory
// Created: 2003/10/13
//
// --------------------------------------------------------------------------
void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const std::string &rLocalDir, BackupQueries::CompareParams &rParams)
{
+#ifdef WIN32
+ // By this point, rStoreDir and rLocalDir should be in UTF-8 encoding
+
+ std::string localName;
+ std::string storeName;
+
+ if(!ConvertUtf8ToConsole(rLocalDir.c_str(), localName)) return;
+ if(!ConvertUtf8ToConsole(rStoreDir.c_str(), storeName)) return;
+#else
+ const std::string& localName(rLocalDir);
+ const std::string& storeName(rStoreDir);
+#endif
+
// Get info on the local directory
struct stat st;
if(::lstat(rLocalDir.c_str(), &st) != 0)
@@ -1107,16 +1201,21 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
// What kind of error?
if(errno == ENOTDIR)
{
- printf("Local object '%s' is a file, server object '%s' is a directory\n", rLocalDir.c_str(), rStoreDir.c_str());
+ printf("Local object '%s' is a file, "
+ "server object '%s' is a directory\n",
+ localName.c_str(), storeName.c_str());
rParams.mDifferences ++;
}
else if(errno == ENOENT)
{
- printf("Local directory '%s' does not exist (compared to server directory '%s')\n", rLocalDir.c_str(), rStoreDir.c_str());
+ printf("Local directory '%s' does not exist "
+ "(compared to server directory '%s')\n",
+ localName.c_str(), storeName.c_str());
}
else
{
- printf("ERROR: stat on local dir '%s'\n", rLocalDir.c_str());
+ printf("ERROR: stat on local dir '%s'\n",
+ localName.c_str());
}
return;
}
@@ -1136,7 +1235,8 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
// Test out the attributes
if(!dir.HasAttributes())
{
- printf("Store directory '%s' doesn't have attributes.\n", rStoreDir.c_str());
+ printf("Store directory '%s' doesn't have attributes.\n",
+ storeName.c_str());
}
else
{
@@ -1146,12 +1246,14 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
// Get attributes of local directory
BackupClientFileAttributes localAttr;
- localAttr.ReadAttributes(rLocalDir.c_str(), true /* directories have zero mod times */);
+ localAttr.ReadAttributes(rLocalDir.c_str(),
+ true /* directories have zero mod times */);
if(!(attr.Compare(localAttr, true, true /* ignore modification times */)))
{
- printf("Local directory '%s' has different attributes to store directory '%s'.\n",
- rLocalDir.c_str(), rStoreDir.c_str());
+ printf("Local directory '%s' has different attributes "
+ "to store directory '%s'.\n",
+ localName.c_str(), storeName.c_str());
rParams.mDifferences ++;
}
}
@@ -1160,7 +1262,7 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
DIR *dirhandle = ::opendir(rLocalDir.c_str());
if(dirhandle == 0)
{
- printf("ERROR: opendir on local dir '%s'\n", rLocalDir.c_str());
+ printf("ERROR: opendir on local dir '%s'\n", localName.c_str());
return;
}
try
@@ -1217,7 +1319,8 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
// Close directory
if(::closedir(dirhandle) != 0)
{
- printf("ERROR: closedir on local dir '%s'\n", rLocalDir.c_str());
+ printf("ERROR: closedir on local dir '%s'\n",
+ localName.c_str());
}
dirhandle = 0;
@@ -1244,17 +1347,26 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
storeDirs.insert(std::pair<std::string, BackupStoreDirectory::Entry *>(name.GetClearFilename(), storeDirEn));
}
}
+
+#ifdef _MSC_VER
+ typedef std::set<std::string>::iterator string_set_iter_t;
+#else
+ typedef std::set<std::string>::const_iterator string_set_iter_t;
+#endif
// Now compare files.
for(std::set<std::pair<std::string, BackupStoreDirectory::Entry *> >::const_iterator i = storeFiles.begin(); i != storeFiles.end(); ++i)
{
// Does the file exist locally?
- std::set<std::string>::const_iterator local(localFiles.find(i->first));
+ string_set_iter_t local(localFiles.find(i->first));
if(local == localFiles.end())
{
// Not found -- report
- printf("Local file '%s/%s' does not exist, but store file '%s/%s' does.\n",
- rLocalDir.c_str(), i->first.c_str(), rStoreDir.c_str(), i->first.c_str());
+ printf("Local file '%s" DIRECTORY_SEPARATOR
+ "%s' does not exist, "
+ "but store file '%s/%s' does.\n",
+ localName.c_str(), i->first.c_str(),
+ storeName.c_str(), i->first.c_str());
rParams.mDifferences ++;
}
else
@@ -1320,8 +1432,11 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
true /* ignore attr mod time */,
fileOnServerStream->IsSymLink() /* ignore modification time if it's a symlink */))
{
- printf("Local file '%s/%s' has different attributes to store file '%s/%s'.\n",
- rLocalDir.c_str(), i->first.c_str(), rStoreDir.c_str(), i->first.c_str());
+ printf("Local file '%s"
+ DIRECTORY_SEPARATOR
+ "%s' has different attributes "
+ "to store file '%s/%s'.\n",
+ localName.c_str(), i->first.c_str(), storeName.c_str(), i->first.c_str());
rParams.mDifferences ++;
if(modifiedAfterLastSync)
{
@@ -1385,8 +1500,11 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
// Report if not equal.
if(!equal)
{
- printf("Local file '%s/%s' has different contents to store file '%s/%s'.\n",
- rLocalDir.c_str(), i->first.c_str(), rStoreDir.c_str(), i->first.c_str());
+ printf("Local file '%s"
+ DIRECTORY_SEPARATOR
+ "%s' has different contents "
+ "to store file '%s/%s'.\n",
+ localName.c_str(), i->first.c_str(), storeName.c_str(), i->first.c_str());
rParams.mDifferences ++;
if(modifiedAfterLastSync)
{
@@ -1404,11 +1522,12 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
printf("ERROR: (%d/%d) during file fetch and comparsion for '%s/%s'\n",
e.GetType(),
e.GetSubType(),
- rStoreDir.c_str(), i->first.c_str());
+ storeName.c_str(),
+ i->first.c_str());
}
catch(...)
{
- printf("ERROR: (unknown) during file fetch and comparsion for '%s/%s'\n", rStoreDir.c_str(), i->first.c_str());
+ printf("ERROR: (unknown) during file fetch and comparsion for '%s/%s'\n", storeName.c_str(), i->first.c_str());
}
// Remove from set so that we know it's been compared
@@ -1417,20 +1536,25 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
}
// Report any files which exist on the locally, but not on the store
- for(std::set<std::string>::const_iterator i = localFiles.begin(); i != localFiles.end(); ++i)
+ for(string_set_iter_t i = localFiles.begin(); i != localFiles.end(); ++i)
{
- std::string localName(rLocalDir + DIRECTORY_SEPARATOR + *i);
+ std::string localFileName(rLocalDir +
+ DIRECTORY_SEPARATOR + *i);
// Should this be ignored (ie is excluded)?
- if(rParams.mpExcludeFiles == 0 || !(rParams.mpExcludeFiles->IsExcluded(localName)))
+ if(rParams.mpExcludeFiles == 0 ||
+ !(rParams.mpExcludeFiles->IsExcluded(localFileName)))
{
- printf("Local file '%s/%s' exists, but store file '%s/%s' does not exist.\n",
- rLocalDir.c_str(), (*i).c_str(), rStoreDir.c_str(), (*i).c_str());
+ printf("Local file '%s" DIRECTORY_SEPARATOR
+ "%s' exists, but store file '%s/%s' "
+ "does not exist.\n",
+ localName.c_str(), (*i).c_str(),
+ storeName.c_str(), (*i).c_str());
rParams.mDifferences ++;
// Check the file modification time
{
struct stat st;
- if(::stat(localName.c_str(), &st) == 0)
+ if(::stat(localFileName.c_str(), &st) == 0)
{
if(FileModificationTime(st) > rParams.mLatestFileUploadTime)
{
@@ -1454,12 +1578,16 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
for(std::set<std::pair<std::string, BackupStoreDirectory::Entry *> >::const_iterator i = storeDirs.begin(); i != storeDirs.end(); ++i)
{
// Does the directory exist locally?
- std::set<std::string>::const_iterator local(localDirs.find(i->first));
+ string_set_iter_t local(localDirs.find(i->first));
if(local == localDirs.end())
{
// Not found -- report
- printf("Local directory '%s/%s' does not exist, but store directory '%s/%s' does.\n",
- rLocalDir.c_str(), i->first.c_str(), rStoreDir.c_str(), i->first.c_str());
+ printf("Local directory '%s"
+ DIRECTORY_SEPARATOR "%s' "
+ "does not exist, but store directory "
+ "'%s/%s' does.\n",
+ localName.c_str(), i->first.c_str(),
+ storeName.c_str(), i->first.c_str());
rParams.mDifferences ++;
}
else
@@ -1479,8 +1607,10 @@ void BackupQueries::Compare(int64_t DirID, const std::string &rStoreDir, const s
// Should this be ignored (ie is excluded)?
if(rParams.mpExcludeDirs == 0 || !(rParams.mpExcludeDirs->IsExcluded(localName)))
{
- printf("Local directory '%s/%s' exists, but store directory '%s/%s' does not exist.\n",
- rLocalDir.c_str(), (*i).c_str(), rStoreDir.c_str(), (*i).c_str());
+ printf("Local directory '%s/%s' exists, but "
+ "store directory '%s/%s' does not exist.\n",
+ localName.c_str(), (*i).c_str(),
+ storeName.c_str(), (*i).c_str());
rParams.mDifferences ++;
}
else
@@ -1534,14 +1664,24 @@ void BackupQueries::CommandRestore(const std::vector<std::string> &args, const b
}
else
{
+#ifdef WIN32
+ std::string storeDirEncoded;
+ if(!ConvertConsoleToUtf8(args[0].c_str(), storeDirEncoded))
+ return;
+#else
+ const std::string& storeDirEncoded(args[0]);
+#endif
+
// Look up directory ID
- dirID = FindDirectoryObjectID(args[0], false /* no old versions */, restoreDeleted /* find deleted dirs */);
+ dirID = FindDirectoryObjectID(storeDirEncoded,
+ false /* no old versions */,
+ restoreDeleted /* find deleted dirs */);
}
// Allowable?
if(dirID == 0)
{
- printf("Directory %s not found on server\n", args[0].c_str());
+ printf("Directory '%s' not found on server\n", args[0].c_str());
return;
}
if(dirID == BackupProtocolClientListDirectory::RootDirectory)
@@ -1550,9 +1690,18 @@ void BackupQueries::CommandRestore(const std::vector<std::string> &args, const b
return;
}
+#ifdef WIN32
+ std::string localName;
+ if(!ConvertConsoleToUtf8(args[1].c_str(), localName)) return;
+#else
+ std::string localName(args[1]);
+#endif
+
// Go and restore...
- switch(BackupClientRestore(mrConnection, dirID, args[1].c_str(), true /* print progress dots */, restoreDeleted,
- false /* don't undelete after restore! */, opts['r'] /* resume? */))
+ switch(BackupClientRestore(mrConnection, dirID, localName.c_str(),
+ true /* print progress dots */, restoreDeleted,
+ false /* don't undelete after restore! */,
+ opts['r'] /* resume? */))
{
case Restore_Complete:
printf("Restore complete\n");
@@ -1691,26 +1840,29 @@ void BackupQueries::CommandUndelete(const std::vector<std::string> &args, const
return;
}
+#ifdef WIN32
+ std::string storeDirEncoded;
+ if(!ConvertConsoleToUtf8(args[0].c_str(), storeDirEncoded)) return;
+#else
+ const std::string& storeDirEncoded(args[0]);
+#endif
+
// Get directory ID
- int64_t dirID = FindDirectoryObjectID(args[0], false /* no old versions */, true /* find deleted dirs */);
+ int64_t dirID = FindDirectoryObjectID(storeDirEncoded,
+ false /* no old versions */, true /* find deleted dirs */);
// Allowable?
if(dirID == 0)
{
- printf("Directory %s not found on server\n", args[0].c_str());
+ printf("Directory '%s' not found on server\n", args[0].c_str());
return;
}
if(dirID == BackupProtocolClientListDirectory::RootDirectory)
{
- printf("Cannot restore the root directory -- restore locations individually.\n");
+ printf("Cannot undelete the root directory.\n");
return;
}
// Undelete
mrConnection.QueryUndeleteDirectory(dirID);
}
-
-
-
-
-
diff --git a/bin/bbackupquery/bbackupquery.cpp b/bin/bbackupquery/bbackupquery.cpp
index 629f0eeb..abd0177b 100644
--- a/bin/bbackupquery/bbackupquery.cpp
+++ b/bin/bbackupquery/bbackupquery.cpp
@@ -9,7 +9,9 @@
#include "Box.h"
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
#include <stdio.h>
#include <sys/types.h>
#ifdef HAVE_LIBREADLINE
@@ -48,8 +50,13 @@
void PrintUsageAndExit()
{
- printf("Usage: bbackupquery [-q] [-c config_file] [-l log_file] [commands]\nAs many commands as you require.\n" \
- "If commands are multiple words, remember to enclose the command in quotes.\n" \
+ printf("Usage: bbackupquery [-q] [-w] "
+#ifdef WIN32
+ "[-u] "
+#endif
+ "\n\t[-c config_file] [-l log_file] [commands]\n"
+ "As many commands as you require.\n"
+ "If commands are multiple words, remember to enclose the command in quotes.\n"
"Remember to use quit command if you don't want to drop into interactive mode.\n");
exit(1);
}
@@ -64,7 +71,7 @@ int main(int argc, const char *argv[])
// Under Win32 we must initialise the Winsock library
// before using it.
- if (WSAStartup(MAKELONG(1, 1), &info) == SOCKET_ERROR)
+ if (WSAStartup(0x0101, &info) == SOCKET_ERROR)
{
// throw error? perhaps give it its own id in the furture
THROW_EXCEPTION(BackupStoreException, Internal)
@@ -88,10 +95,17 @@ int main(int argc, const char *argv[])
// Flags
bool quiet = false;
bool readWrite = false;
-
+
+#ifdef WIN32
+ const char* validOpts = "qwuc:l:";
+ bool unicodeConsole = false;
+#else
+ const char* validOpts = "qwc:l:";
+#endif
+
// See if there's another entry on the command line
int c;
- while((c = getopt(argc, (char * const *)argv, "qwc:l:")) != -1)
+ while((c = getopt(argc, (char * const *)argv, validOpts)) != -1)
{
switch(c)
{
@@ -118,6 +132,12 @@ int main(int argc, const char *argv[])
printf("Can't open log file '%s'\n", optarg);
}
break;
+
+#ifdef WIN32
+ case 'u':
+ unicodeConsole = true;
+ break;
+#endif
case '?':
default:
@@ -135,6 +155,30 @@ int main(int argc, const char *argv[])
printf(banner);
}
+#ifdef WIN32
+ if (unicodeConsole)
+ {
+ if (!SetConsoleCP(CP_UTF8))
+ {
+ fprintf(stderr, "Failed to set input codepage: "
+ "error %d\n", GetLastError());
+ }
+
+ if (!SetConsoleOutputCP(CP_UTF8))
+ {
+ fprintf(stderr, "Failed to set output codepage: "
+ "error %d\n", GetLastError());
+ }
+
+ // enable input of Unicode characters
+ if (_setmode(_fileno(stdin), _O_TEXT) == -1)
+ {
+ perror("Failed to set the console input to "
+ "binary mode");
+ }
+ }
+#endif // WIN32
+
// Read in the configuration file
if(!quiet) printf("Using configuration file %s\n", configFilename);
std::string errs;
diff --git a/common.vcproj b/common.vcproj
deleted file mode 100644
index 50e0e5a3..00000000
--- a/common.vcproj
+++ /dev/null
@@ -1,638 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.10"
- Name="common"
- ProjectGUID="{A089CEE6-EBF0-4232-A0C0-74850A8127A6}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
- ConfigurationType="4"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)lib\backupclient&quot;;&quot;$(ProjectDir)lib\server&quot;;&quot;$(ProjectDir)lib\crypto&quot;;&quot;$(ProjectDir)..\openssl\include&quot;;&quot;$(ProjectDir)lib\compress&quot;;&quot;$(ProjectDir)..\zlib\include&quot;;&quot;$(ProjectDir)lib\win32&quot;;&quot;$(ProjectDir)lib\common\&quot;;&quot;$(SolutionDir)..\boost_1_31_0\&quot;"
- PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;_DEBUG;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/common.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
- ConfigurationType="4"
- CharacterSet="2"
- WholeProgramOptimization="TRUE">
- <Tool
- Name="VCCLCompilerTool"
- EnableFiberSafeOptimizations="TRUE"
- OptimizeForProcessor="1"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)lib\backupclient&quot;;&quot;$(ProjectDir)lib\server&quot;;&quot;$(ProjectDir)lib\crypto&quot;;&quot;$(ProjectDir)..\openssl\include&quot;;&quot;$(ProjectDir)lib\compress&quot;;&quot;$(ProjectDir)..\zlib\include&quot;;&quot;$(ProjectDir)lib\win32&quot;;&quot;$(ProjectDir)lib\common\&quot;;&quot;$(SolutionDir)..\boost_1_31_0\&quot;"
- PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;NDEBUG;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING"
- RuntimeLibrary="0"
- BufferSecurityCheck="FALSE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(OutDir)/common.lib"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCXMLDataGeneratorTool"/>
- <Tool
- Name="VCManagedWrapperGeneratorTool"/>
- <Tool
- Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
- <Filter
- Name="lib"
- Filter="">
- <Filter
- Name="compress"
- Filter="">
- <File
- RelativePath=".\lib\compress\autogen_CompressException.cpp">
- </File>
- <File
- RelativePath=".\lib\compress\CompressStream.cpp">
- </File>
- </Filter>
- <Filter
- Name="common"
- Filter="">
- <File
- RelativePath=".\lib\common\autogen_CommonException.cpp">
- </File>
- <File
- RelativePath=".\lib\common\autogen_ConversionException.cpp">
- </File>
- <File
- RelativePath=".\lib\common\BoxException.cpp">
- </File>
- <File
- RelativePath=".\lib\common\BoxTime.cpp">
- </File>
- <File
- RelativePath=".\lib\common\BoxTimeToText.cpp">
- </File>
- <File
- RelativePath=".\lib\common\CollectInBufferStream.cpp">
- </File>
- <File
- RelativePath=".\lib\common\Configuration.cpp">
- </File>
- <File
- RelativePath=".\lib\common\ConversionString.cpp">
- </File>
- <File
- RelativePath=".\lib\common\DebugAssertFailed.cpp">
- </File>
- <File
- RelativePath=".\lib\common\DebugMemLeakFinder.cpp">
- </File>
- <File
- RelativePath=".\lib\common\DebugPrintf.cpp">
- </File>
- <File
- RelativePath=".\lib\common\EventWatchFilesystemObject.cpp">
- </File>
- <File
- RelativePath=".\lib\common\ExcludeList.cpp">
- </File>
- <File
- RelativePath=".\lib\common\FdGetLine.cpp">
- </File>
- <File
- RelativePath=".\lib\common\FileStream.cpp">
- </File>
- <File
- RelativePath=".\lib\common\IOStream.cpp">
- </File>
- <File
- RelativePath=".\lib\common\IOStreamGetLine.cpp">
- </File>
- <File
- RelativePath=".\lib\common\LinuxWorkaround.cpp">
- </File>
- <File
- RelativePath=".\lib\common\MemBlockStream.cpp">
- </File>
- <File
- RelativePath=".\lib\common\PartialReadStream.cpp">
- </File>
- <File
- RelativePath=".\lib\common\ReadGatherStream.cpp">
- </File>
- <File
- RelativePath=".\lib\common\StreamableMemBlock.cpp">
- </File>
- <File
- RelativePath=".\lib\common\UnixUser.cpp">
- </File>
- <File
- RelativePath=".\lib\common\Utils.cpp">
- </File>
- <File
- RelativePath=".\lib\common\WaitForEvent.cpp">
- </File>
- </Filter>
- <Filter
- Name="backupclient"
- Filter="">
- <File
- RelativePath=".\lib\backupclient\autogen_BackupProtocolClient.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\autogen_BackupStoreException.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupClientCryptoKeys.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupClientFileAttributes.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupClientMakeExcludeList.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupClientRestore.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupDaemonConfigVerify.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreDirectory.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFile.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFileCmbDiff.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFileCmbIdx.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFileCombine.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFileCryptVar.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFileDiff.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFileEncodeStream.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFilename.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFilenameClear.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFileRevDiff.cpp">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreObjectDump.cpp">
- </File>
- </Filter>
- <Filter
- Name="crypto"
- Filter="">
- <File
- RelativePath=".\lib\crypto\autogen_CipherException.cpp">
- </File>
- <File
- RelativePath=".\lib\crypto\CipherAES.cpp">
- </File>
- <File
- RelativePath=".\lib\crypto\CipherBlowfish.cpp">
- </File>
- <File
- RelativePath=".\lib\crypto\CipherContext.cpp">
- </File>
- <File
- RelativePath=".\lib\crypto\CipherDescription.cpp">
- </File>
- <File
- RelativePath=".\lib\crypto\MD5Digest.cpp">
- </File>
- <File
- RelativePath=".\lib\crypto\Random.cpp">
- </File>
- <File
- RelativePath=".\lib\crypto\RollingChecksum.cpp">
- </File>
- </Filter>
- <Filter
- Name="win32"
- Filter="">
- <File
- RelativePath=".\lib\win32\emu.cpp">
- </File>
- </Filter>
- <Filter
- Name="server"
- Filter="">
- <File
- RelativePath=".\lib\server\autogen_ConnectionException.cpp">
- </File>
- <File
- RelativePath=".\lib\server\autogen_ServerException.cpp">
- </File>
- <File
- RelativePath=".\lib\server\Daemon.cpp">
- </File>
- <File
- RelativePath=".\lib\server\LocalProcessStream.cpp">
- </File>
- <File
- RelativePath=".\lib\server\Protocol.cpp">
- </File>
- <File
- RelativePath=".\lib\server\ProtocolObject.cpp">
- </File>
- <File
- RelativePath=".\lib\server\ProtocolUncertainStream.cpp">
- </File>
- <File
- RelativePath=".\lib\server\Socket.cpp">
- </File>
- <File
- RelativePath=".\lib\server\SocketStream.cpp">
- </File>
- <File
- RelativePath=".\lib\server\SocketStreamTLS.cpp">
- </File>
- <File
- RelativePath=".\lib\server\SSLLib.cpp">
- </File>
- <File
- RelativePath=".\lib\server\TLSContext.cpp">
- </File>
- </Filter>
- </Filter>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
- <Filter
- Name="lib"
- Filter="">
- <Filter
- Name="compress"
- Filter="">
- <File
- RelativePath=".\lib\compress\autogen_CompressException.h">
- </File>
- <File
- RelativePath=".\lib\compress\Compress.h">
- </File>
- <File
- RelativePath=".\lib\compress\CompressException.h">
- </File>
- <File
- RelativePath=".\lib\compress\CompressStream.h">
- </File>
- </Filter>
- <Filter
- Name="common"
- Filter="">
- <File
- RelativePath=".\lib\common\autogen_CommonException.h">
- </File>
- <File
- RelativePath=".\lib\common\autogen_ConversionException.h">
- </File>
- <File
- RelativePath=".\lib\common\BannerText.h">
- </File>
- <File
- RelativePath=".\lib\common\BeginStructPackForWire.h">
- </File>
- <File
- RelativePath=".\lib\common\Box.h">
- </File>
- <File
- RelativePath=".\lib\common\BoxException.h">
- </File>
- <File
- RelativePath=".\lib\common\BoxPlatform.h">
- </File>
- <File
- RelativePath=".\lib\common\BoxPortsAndFiles.h">
- </File>
- <File
- RelativePath=".\lib\common\BoxTime.h">
- </File>
- <File
- RelativePath=".\lib\common\BoxTimeToText.h">
- </File>
- <File
- RelativePath=".\lib\common\BoxTimeToUnix.h">
- </File>
- <File
- RelativePath=".\lib\common\CollectInBufferStream.h">
- </File>
- <File
- RelativePath=".\lib\common\CommonException.h">
- </File>
- <File
- RelativePath=".\lib\common\Configuration.h">
- </File>
- <File
- RelativePath=".\lib\common\Conversion.h">
- </File>
- <File
- RelativePath=".\lib\common\EndStructPackForWire.h">
- </File>
- <File
- RelativePath=".\lib\common\EventWatchFilesystemObject.h">
- </File>
- <File
- RelativePath=".\lib\common\ExcludeList.h">
- </File>
- <File
- RelativePath=".\lib\common\FdGetLine.h">
- </File>
- <File
- RelativePath=".\lib\common\FileModificationTime.h">
- </File>
- <File
- RelativePath=".\lib\common\FileStream.h">
- </File>
- <File
- RelativePath=".\lib\common\Guards.h">
- </File>
- <File
- RelativePath=".\lib\common\IOStream.h">
- </File>
- <File
- RelativePath=".\lib\common\IOStreamGetLine.h">
- </File>
- <File
- RelativePath=".\lib\common\LinuxWorkaround.h">
- </File>
- <File
- RelativePath=".\lib\server\LocalProcessStream.h">
- </File>
- <File
- RelativePath=".\lib\common\MainHelper.h">
- </File>
- <File
- RelativePath=".\lib\common\MemBlockStream.h">
- </File>
- <File
- RelativePath=".\lib\common\MemLeakFinder.h">
- </File>
- <File
- RelativePath=".\lib\common\MemLeakFindOff.h">
- </File>
- <File
- RelativePath=".\lib\common\MemLeakFindOn.h">
- </File>
- <File
- RelativePath=".\lib\common\NamedLock.h">
- </File>
- <File
- RelativePath=".\lib\common\PartialReadStream.h">
- </File>
- <File
- RelativePath=".\lib\common\ReadGatherStream.h">
- </File>
- <File
- RelativePath=".\lib\common\StreamableMemBlock.h">
- </File>
- <File
- RelativePath=".\lib\common\TemporaryDirectory.h">
- </File>
- <File
- RelativePath=".\lib\common\Test.h">
- </File>
- <File
- RelativePath=".\lib\common\UnixUser.h">
- </File>
- <File
- RelativePath=".\lib\common\Utils.h">
- </File>
- <File
- RelativePath=".\lib\common\WaitForEvent.h">
- </File>
- </Filter>
- <Filter
- Name="backupclient"
- Filter="">
- <File
- RelativePath=".\lib\backupclient\autogen_BackupProtocolClient.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\autogen_BackupStoreException.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupClientCryptoKeys.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupClientFileAttributes.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupClientMakeExcludeList.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupClientRestore.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupDaemonConfigVerify.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreConstants.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreDirectory.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreException.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFile.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFileCryptVar.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFileEncodeStream.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFilename.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFilenameClear.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreFileWire.h">
- </File>
- <File
- RelativePath=".\lib\backupclient\BackupStoreObjectMagic.h">
- </File>
- </Filter>
- <Filter
- Name="crypto"
- Filter="">
- <File
- RelativePath=".\lib\crypto\autogen_CipherException.h">
- </File>
- <File
- RelativePath=".\lib\crypto\CipherAES.h">
- </File>
- <File
- RelativePath=".\lib\crypto\CipherBlowfish.h">
- </File>
- <File
- RelativePath=".\lib\crypto\CipherContext.h">
- </File>
- <File
- RelativePath=".\lib\crypto\CipherDescription.h">
- </File>
- <File
- RelativePath=".\lib\crypto\CipherException.h">
- </File>
- <File
- RelativePath=".\lib\crypto\MD5Digest.h">
- </File>
- <File
- RelativePath=".\lib\crypto\Random.h">
- </File>
- <File
- RelativePath=".\lib\crypto\RollingChecksum.h">
- </File>
- </Filter>
- <Filter
- Name="win32"
- Filter="">
- <File
- RelativePath=".\lib\win32\emu.h">
- </File>
- </Filter>
- <Filter
- Name="server"
- Filter="">
- <File
- RelativePath=".\lib\server\autogen_ConnectionException.h">
- </File>
- <File
- RelativePath=".\lib\server\autogen_ServerException.h">
- </File>
- <File
- RelativePath=".\lib\server\Daemon.h">
- </File>
- <File
- RelativePath=".\lib\server\Protocol.h">
- </File>
- <File
- RelativePath=".\lib\server\ProtocolObject.h">
- </File>
- <File
- RelativePath=".\lib\server\ProtocolUncertainStream.h">
- </File>
- <File
- RelativePath=".\lib\server\ProtocolWire.h">
- </File>
- <File
- RelativePath=".\lib\server\ServerException.h">
- </File>
- <File
- RelativePath=".\lib\server\ServerStream.h">
- </File>
- <File
- RelativePath=".\lib\server\ServerTLS.h">
- </File>
- <File
- RelativePath=".\lib\server\Socket.h">
- </File>
- <File
- RelativePath=".\lib\server\SocketListen.h">
- </File>
- <File
- RelativePath=".\lib\server\SocketStream.h">
- </File>
- <File
- RelativePath=".\lib\server\SocketStreamTLS.h">
- </File>
- <File
- RelativePath=".\lib\server\SSLLib.h">
- </File>
- <File
- RelativePath=".\lib\server\TLSContext.h">
- </File>
- </Filter>
- </Filter>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/configure.ac b/configure.ac
index 4239b821..e18a5942 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,13 +73,21 @@ Upgrade or read the documentation for alternatives]])
### Checks for header files.
-AC_HEADER_DIRENT
+if test "$target_os" != "mingw32"; then
+ AC_HEADER_DIRENT
+fi
+
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([execinfo.h regex.h signal.h syslog.h time.h])
+AC_CHECK_HEADERS([execinfo.h process.h pwd.h regex.h signal.h])
+AC_CHECK_HEADERS([syslog.h time.h])
AC_CHECK_HEADERS([netinet/in.h])
-AC_CHECK_HEADERS([sys/param.h sys/types.h sys/wait.h sys/xattr.h sys/time.h])
+AC_CHECK_HEADERS([sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h])
+AC_CHECK_HEADERS([sys/xattr.h])
+if test "$ac_cv_header_regex_h" = "yes"; then
+ AC_SEARCH_LIBS([regcomp], [pcreposix])
+fi
### Checks for typedefs, structures, and compiler characteristics.
@@ -128,7 +136,7 @@ AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
AC_TYPE_SIGNAL
AC_FUNC_STAT
-AC_CHECK_FUNCS([getpeereid kqueue lchown setproctitle])
+AC_CHECK_FUNCS([getpeereid kqueue lchown setproctitle getpid])
AX_FUNC_SYSCALL
AX_CHECK_SYSCALL_LSEEK
AC_CHECK_FUNCS([listxattr llistxattr getxattr lgetxattr setxattr lsetxattr])
diff --git a/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt b/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt
index 94466d9c..96908264 100644
--- a/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt
+++ b/distribution/boxbackup/DISTRIBUTION-MANIFEST.txt
@@ -33,3 +33,8 @@ NO-LICENSE-IN-DIR contrib/suse
distribution/boxbackup/contrib/suse contrib/suse
NO-LICENSE-IN-DIR contrib/cygwin
distribution/boxbackup/contrib/cygwin contrib/cygwin
+infrastructure/msvc
+NO-LICENSE-IN-DIR infrastructure/msvc/2003
+infrastructure/msvc/2003
+NO-LICENSE-IN-DIR infrastructure/msvc/2005
+infrastructure/msvc/2005 \ No newline at end of file
diff --git a/docs/backup/win32_build_on_cygwin_using_mingw.txt b/docs/backup/win32_build_on_cygwin_using_mingw.txt
index d787baae..c35764bb 100644
--- a/docs/backup/win32_build_on_cygwin_using_mingw.txt
+++ b/docs/backup/win32_build_on_cygwin_using_mingw.txt
@@ -22,6 +22,23 @@ Configure OpenSSL for MinGW compilation, and build and install it:
make
make install
+Download PCRE from
+[http://prdownloads.sourceforge.net/pcre/pcre-6.3.tar.bz2?download]
+
+Open a Cygwin shell, and unpack PCRE:
+
+ tar xjvf pcre-6.3.tar.bz2
+
+Configure PCRE for MinGW compilation, and build and install it:
+
+ cd pcre-6.3
+ export CFLAGS="-mno-cygwin"
+ ./configure
+ make winshared
+ cp .libs/pcreposix.dll /bin
+ cp .libs/pcreposix.dll.a /usr/i686-pc-mingw32/lib
+ cp pcreposix.h /usr/i686-pc-mingw32/include/regex.h
+
Now unpack the Box Backup sources, enter the source directory,
and configure like this:
diff --git a/infrastructure/makeparcels.pl b/infrastructure/makeparcels.pl
index 57e9cc96..deea24af 100755
--- a/infrastructure/makeparcels.pl
+++ b/infrastructure/makeparcels.pl
@@ -40,9 +40,10 @@ open PARCELS,"parcels.txt" or die "Can't open parcels file";
{
last if m'\AEND-ONLY';
}
- next;
}
+ next;
}
+ next if (m'\AEND-ONLY');
# new parcel, or a new parcel definition?
if(m/\A\s+(.+)\Z/)
@@ -105,6 +106,12 @@ for my $parcel (@parcels)
for(@{$parcel_contents{$parcel}})
{
my ($type,$name) = split /\s+/;
+ my $optional = '';
+
+ if ($type eq 'optional')
+ {
+ ($optional,$type,$name) = split /\s+/;
+ }
if($type eq 'bin')
{
@@ -114,7 +121,14 @@ for my $parcel (@parcels)
}
elsif ($type eq 'script')
{
- print MAKE "\tcp $name $dir\n";
+ if ($optional)
+ {
+ print MAKE "\ttest -r $name && cp $name $dir\n";
+ }
+ else
+ {
+ print MAKE "\tcp $name $dir\n";
+ }
# remove path from script name
$name =~ m~/([^/]+)\Z~;
$name = $1;
diff --git a/bbackupctl.vcproj b/infrastructure/msvc/2003/bbackupctl.vcproj
index f5cf53d8..cc5936ac 100644
--- a/bbackupctl.vcproj
+++ b/infrastructure/msvc/2003/bbackupctl.vcproj
@@ -12,14 +12,14 @@
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
+ OutputDirectory="..\..\..\Debug"
+ IntermediateDirectory="..\..\..\Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)..\db-4.2.52.NC\build_win32&quot;;&quot;$(ProjectDir)lib\backupclient&quot;;&quot;$(ProjectDir)lib\server&quot;;&quot;$(ProjectDir)lib\crypto&quot;;&quot;$(ProjectDir)..\openssl\include&quot;;&quot;$(ProjectDir)lib\compress&quot;;&quot;$(ProjectDir)..\zlib\include&quot;;&quot;$(ProjectDir)lib\win32&quot;;&quot;$(ProjectDir)lib\common\&quot;"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\..\db-4.2.52.NC\build_win32&quot;;&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
@@ -32,7 +32,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\zlib\lib\zdll.lib $(ProjectDir)..\openssl\lib\libeay32.lib $(ProjectDir)..\openssl\lib\ssleay32.lib $(ProjectDir)Debug\common.lib $(ProjectDir)..\db-4.2.52.NC\build_win32\Debug\libdb42d.lib"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\lib\libeay32.lib $(ProjectDir)..\..\..\..\openssl\lib\ssleay32.lib $(ProjectDir)..\..\..\Debug\common.lib $(ProjectDir)..\..\..\..\db-4.2.52.NC\build_win32\Debug\libdb42d.lib"
OutputFile="$(OutDir)/bbackupctl.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
@@ -62,8 +62,8 @@
</Configuration>
<Configuration
Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
+ OutputDirectory="..\..\..\Release"
+ IntermediateDirectory="..\..\..\Release"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="TRUE">
@@ -71,7 +71,7 @@
Name="VCCLCompilerTool"
EnableFiberSafeOptimizations="TRUE"
OptimizeForProcessor="1"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)lib\backupclient&quot;;&quot;$(ProjectDir)lib\server&quot;;&quot;$(ProjectDir)lib\crypto&quot;;&quot;$(ProjectDir)..\openssl\include&quot;;&quot;$(ProjectDir)lib\compress&quot;;&quot;$(ProjectDir)..\zlib\include&quot;;&quot;$(ProjectDir)lib\win32&quot;;&quot;$(ProjectDir)lib\common\&quot;"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING"
RuntimeLibrary="0"
BufferSecurityCheck="FALSE"
@@ -83,7 +83,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\zlib\lib\zdll.lib $(ProjectDir)..\openssl\lib\libeay32.lib $(ProjectDir)..\openssl\lib\ssleay32.lib $(ProjectDir)Release\common.lib"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\lib\libeay32.lib $(ProjectDir)..\..\..\..\openssl\lib\ssleay32.lib $(ProjectDir)..\..\..\Release\common.lib"
OutputFile="$(OutDir)/bbackupctl.exe"
LinkIncremental="1"
IgnoreDefaultLibraryNames=""
@@ -129,7 +129,7 @@
Name="bbackupctl"
Filter="">
<File
- RelativePath=".\bin\bbackupctl\bbackupctl.cpp">
+ RelativePath="..\..\..\bin\bbackupctl\bbackupctl.cpp">
</File>
</Filter>
</Filter>
diff --git a/bbackupd.vcproj b/infrastructure/msvc/2003/bbackupd.vcproj
index 1b2267f1..5e04ed7d 100644
--- a/bbackupd.vcproj
+++ b/infrastructure/msvc/2003/bbackupd.vcproj
@@ -12,14 +12,14 @@
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
+ OutputDirectory="..\..\..\Debug"
+ IntermediateDirectory="..\..\..\Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="&quot;$(SolutionDir)..\db-4.2.52.NC\build_win32&quot;;&quot;$(SolutionDir)..\boost_1_31_0&quot;;&quot;$(SolutionDir)..\openssl\include&quot;;&quot;$(SolutionDir)..\zlib\include&quot;;&quot;$(SolutionDir)lib\backupclient&quot;;&quot;$(SolutionDir)lib\server&quot;;&quot;$(SolutionDir)lib\crypto&quot;;&quot;$(SolutionDir)lib\compress&quot;;&quot;$(SolutionDir)lib\win32&quot;;&quot;$(SolutionDir)lib\common\&quot;"
+ AdditionalIncludeDirectories="&quot;$(SolutionDir)..\..\..\..\db-4.2.52.NC\build_win32&quot;;&quot;$(SolutionDir)..\..\..\..\boost_1_31_0&quot;;&quot;$(SolutionDir)..\..\..\..\openssl\include&quot;;&quot;$(SolutionDir)..\..\..\..\zlib\include&quot;;&quot;$(SolutionDir)..\..\..\lib\backupclient&quot;;&quot;$(SolutionDir)..\..\..\lib\server&quot;;&quot;$(SolutionDir)..\..\..\lib\crypto&quot;;&quot;$(SolutionDir)..\..\..\lib\compress&quot;;&quot;$(SolutionDir)..\..\..\lib\win32&quot;;&quot;$(SolutionDir)..\..\..\lib\common\&quot;"
PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
@@ -32,7 +32,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\zlib\lib\zdll.lib $(ProjectDir)..\openssl\lib\libeay32.lib $(ProjectDir)..\openssl\lib\ssleay32.lib $(ProjectDir)Debug\common.lib $(ProjectDir)lib\win32\Debug\boost_regex.lib $(ProjectDir)..\db-4.2.52.NC\build_win32\Debug\libdb42d.lib"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\lib\libeay32.lib $(ProjectDir)..\..\..\..\openssl\lib\ssleay32.lib $(ProjectDir)..\..\..\Debug\common.lib $(ProjectDir)..\..\..\lib\win32\Debug\boost_regex.lib $(ProjectDir)..\..\..\..\db-4.2.52.NC\build_win32\Debug\libdb42d.lib"
OutputFile="$(OutDir)/bbackupd.exe"
LinkIncremental="2"
IgnoreAllDefaultLibraries="FALSE"
@@ -63,8 +63,8 @@
</Configuration>
<Configuration
Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
+ OutputDirectory="..\..\..\Release"
+ IntermediateDirectory="..\..\..\Release"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="TRUE">
@@ -72,7 +72,7 @@
Name="VCCLCompilerTool"
EnableFiberSafeOptimizations="TRUE"
OptimizeForProcessor="1"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)lib\backupclient&quot;;&quot;$(ProjectDir)lib\server&quot;;&quot;$(ProjectDir)lib\crypto&quot;;&quot;$(ProjectDir)..\openssl\include&quot;;&quot;$(ProjectDir)lib\compress&quot;;&quot;$(ProjectDir)..\zlib\include&quot;;&quot;$(ProjectDir)lib\win32&quot;;&quot;$(ProjectDir)lib\common\&quot;;&quot;$(SolutionDir)..\boost_1_31_0&quot;"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;;&quot;$(SolutionDir)..\..\..\..\boost_1_31_0&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;BOOST_REGEX_NO_LIB"
RuntimeLibrary="0"
BufferSecurityCheck="FALSE"
@@ -84,7 +84,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\zlib\lib\zdll.lib $(ProjectDir)..\openssl\lib\libeay32.lib $(ProjectDir)..\openssl\lib\ssleay32.lib $(ProjectDir)Release\common.lib $(ProjectDir)lib\win32\Release\boost_regex.lib"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\lib\libeay32.lib $(ProjectDir)..\..\..\..\openssl\lib\ssleay32.lib $(ProjectDir)..\..\..\Release\common.lib $(ProjectDir)..\..\..\lib\win32\Release\boost_regex.lib"
OutputFile="$(OutDir)/bbackupd.exe"
LinkIncremental="1"
IgnoreDefaultLibraryNames=""
@@ -130,28 +130,28 @@
Name="bbackupd"
Filter="">
<File
- RelativePath=".\bin\bbackupd\BackupClientContext.cpp">
+ RelativePath="..\..\..\bin\bbackupd\BackupClientContext.cpp">
</File>
<File
- RelativePath=".\bin\bbackupd\BackupClientDeleteList.cpp">
+ RelativePath="..\..\..\bin\bbackupd\BackupClientDeleteList.cpp">
</File>
<File
- RelativePath=".\bin\bbackupd\BackupClientDirectoryRecord.cpp">
+ RelativePath="..\..\..\bin\bbackupd\BackupClientDirectoryRecord.cpp">
</File>
<File
- RelativePath=".\bin\bbackupd\BackupClientInodeToIDMap.cpp">
+ RelativePath="..\..\..\bin\bbackupd\BackupClientInodeToIDMap.cpp">
</File>
<File
- RelativePath=".\bin\bbackupd\BackupDaemon.cpp">
+ RelativePath="..\..\..\bin\bbackupd\BackupDaemon.cpp">
</File>
<File
- RelativePath=".\bin\bbackupd\bbackupd.cpp">
+ RelativePath="..\..\..\bin\bbackupd\bbackupd.cpp">
</File>
<File
- RelativePath=".\bin\bbackupd\bbwinservice.cpp">
+ RelativePath="..\..\..\bin\bbackupd\bbwinservice.cpp">
</File>
<File
- RelativePath=".\bin\bbackupd\ServiceBackupDaemon.cpp">
+ RelativePath="..\..\..\bin\bbackupd\ServiceBackupDaemon.cpp">
</File>
</Filter>
</Filter>
@@ -167,25 +167,25 @@
Name="bbackupd"
Filter="">
<File
- RelativePath=".\bin\bbackupd\BackupClientContext.h">
+ RelativePath="..\..\..\bin\bbackupd\BackupClientContext.h">
</File>
<File
- RelativePath=".\bin\bbackupd\BackupClientDeleteList.h">
+ RelativePath="..\..\..\bin\bbackupd\BackupClientDeleteList.h">
</File>
<File
- RelativePath=".\bin\bbackupd\BackupClientDirectoryRecord.h">
+ RelativePath="..\..\..\bin\bbackupd\BackupClientDirectoryRecord.h">
</File>
<File
- RelativePath=".\bin\bbackupd\BackupClientInodeToIDMap.h">
+ RelativePath="..\..\..\bin\bbackupd\BackupClientInodeToIDMap.h">
</File>
<File
- RelativePath=".\bin\bbackupd\BackupDaemon.h">
+ RelativePath="..\..\..\bin\bbackupd\BackupDaemon.h">
</File>
<File
- RelativePath=".\bin\bbackupd\bbwinservice.h">
+ RelativePath="..\..\..\bin\bbackupd\bbwinservice.h">
</File>
<File
- RelativePath=".\bin\bbackupd\ServiceBackupDaemon.h">
+ RelativePath="..\..\..\bin\bbackupd\ServiceBackupDaemon.h">
</File>
</Filter>
</Filter>
@@ -196,7 +196,7 @@
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
<File
- RelativePath=".\ReadMe.txt">
+ RelativePath="..\..\..\ReadMe.txt">
</File>
</Files>
<Globals>
diff --git a/boxbackup.sln b/infrastructure/msvc/2003/boxbackup.sln
index ede6faa1..ede6faa1 100644
--- a/boxbackup.sln
+++ b/infrastructure/msvc/2003/boxbackup.sln
diff --git a/boxbackup.suo b/infrastructure/msvc/2003/boxbackup.suo
index bd804d83..bd804d83 100644
--- a/boxbackup.suo
+++ b/infrastructure/msvc/2003/boxbackup.suo
Binary files differ
diff --git a/boxquery.vcproj b/infrastructure/msvc/2003/boxquery.vcproj
index ed080a9a..6a5a9cf9 100644
--- a/boxquery.vcproj
+++ b/infrastructure/msvc/2003/boxquery.vcproj
@@ -13,14 +13,14 @@
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
+ OutputDirectory="..\..\..\Debug"
+ IntermediateDirectory="..\..\..\Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)lib\backupclient&quot;;&quot;$(ProjectDir)lib\server&quot;;&quot;$(ProjectDir)lib\crypto&quot;;&quot;$(ProjectDir)..\openssl\include&quot;;&quot;$(ProjectDir)lib\compress&quot;;&quot;$(ProjectDir)..\zlib\include&quot;;&quot;$(ProjectDir)lib\win32&quot;;&quot;$(ProjectDir)lib\common\&quot;;&quot;$(SolutionDir)..\boost_1_31_0&quot;"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;;&quot;$(SolutionDir)..\..\..\..\boost_1_31_0&quot;"
PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
@@ -33,7 +33,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\zlib\lib\zdll.lib $(ProjectDir)..\openssl\lib\libeay32.lib $(ProjectDir)..\openssl\lib\ssleay32.lib $(ProjectDir)Debug\common.lib $(ProjectDir)lib\win32\Debug\boost_regex.lib"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\lib\libeay32.lib $(ProjectDir)..\..\..\..\openssl\lib\ssleay32.lib $(ProjectDir)..\..\..\Debug\common.lib $(ProjectDir)..\..\..\lib\win32\Debug\boost_regex.lib"
OutputFile="$(OutDir)/bbackupquery.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
@@ -63,8 +63,8 @@
</Configuration>
<Configuration
Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
+ OutputDirectory="..\..\..\Release"
+ IntermediateDirectory="..\..\..\Release"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="TRUE">
@@ -72,7 +72,7 @@
Name="VCCLCompilerTool"
EnableFiberSafeOptimizations="TRUE"
OptimizeForProcessor="1"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)lib\backupclient&quot;;&quot;$(ProjectDir)lib\server&quot;;&quot;$(ProjectDir)lib\crypto&quot;;&quot;$(ProjectDir)..\openssl\include&quot;;&quot;$(ProjectDir)lib\compress&quot;;&quot;$(ProjectDir)..\zlib\include&quot;;&quot;$(ProjectDir)lib\win32&quot;;&quot;$(ProjectDir)lib\common\&quot;;&quot;$(SolutionDir)..\boost_1_31_0&quot;"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;;&quot;$(SolutionDir)..\..\..\..\boost_1_31_0&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;BOOST_REGEX_NO_LIB"
RuntimeLibrary="0"
BufferSecurityCheck="FALSE"
@@ -84,7 +84,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\zlib\lib\zdll.lib $(ProjectDir)Release\common.lib $(ProjectDir)..\openssl\lib\libeay32.lib $(ProjectDir)..\openssl\lib\ssleay32.lib $(ProjectDir)lib\win32\Release\boost_regex.lib"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\Release\common.lib $(ProjectDir)..\..\..\..\openssl\lib\libeay32.lib $(ProjectDir)..\..\..\..\openssl\lib\ssleay32.lib $(ProjectDir)..\..\..\lib\win32\Release\boost_regex.lib"
OutputFile="$(OutDir)/bbackupquery.exe"
LinkIncremental="1"
IgnoreDefaultLibraryNames=""
@@ -130,13 +130,13 @@
Name="backupquery"
Filter="">
<File
- RelativePath=".\bin\bbackupquery\autogen_Documentation.cpp">
+ RelativePath="..\..\..\bin\bbackupquery\autogen_Documentation.cpp">
</File>
<File
- RelativePath=".\bin\bbackupquery\BackupQueries.cpp">
+ RelativePath="..\..\..\bin\bbackupquery\BackupQueries.cpp">
</File>
<File
- RelativePath=".\bin\bbackupquery\bbackupquery.cpp">
+ RelativePath="..\..\..\bin\bbackupquery\bbackupquery.cpp">
</File>
</Filter>
</Filter>
@@ -152,7 +152,7 @@
Name="backupquery"
Filter="">
<File
- RelativePath=".\bin\bbackupquery\BackupQueries.h">
+ RelativePath="..\..\..\bin\bbackupquery\BackupQueries.h">
</File>
</Filter>
</Filter>
@@ -163,7 +163,7 @@
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
<File
- RelativePath=".\ReadMe.txt">
+ RelativePath="..\..\..\ReadMe.txt">
</File>
</Files>
<Globals>
diff --git a/infrastructure/msvc/2003/common.vcproj b/infrastructure/msvc/2003/common.vcproj
new file mode 100644
index 00000000..0ef2ea42
--- /dev/null
+++ b/infrastructure/msvc/2003/common.vcproj
@@ -0,0 +1,638 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="common"
+ ProjectGUID="{A089CEE6-EBF0-4232-A0C0-74850A8127A6}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="..\..\..\Debug"
+ IntermediateDirectory="..\..\..\Debug"
+ ConfigurationType="4"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;;&quot;$(SolutionDir)..\..\..\..\boost_1_31_0\&quot;"
+ PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;_DEBUG;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)/common.lib"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="..\..\..\Release"
+ IntermediateDirectory="..\..\..\Release"
+ ConfigurationType="4"
+ CharacterSet="2"
+ WholeProgramOptimization="TRUE">
+ <Tool
+ Name="VCCLCompilerTool"
+ EnableFiberSafeOptimizations="TRUE"
+ OptimizeForProcessor="1"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;;&quot;$(SolutionDir)..\..\..\..\boost_1_31_0\&quot;"
+ PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;NDEBUG;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)/common.lib"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <Filter
+ Name="lib"
+ Filter="">
+ <Filter
+ Name="compress"
+ Filter="">
+ <File
+ RelativePath="..\..\..\lib\compress\autogen_CompressException.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\compress\CompressStream.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="common"
+ Filter="">
+ <File
+ RelativePath="..\..\..\lib\common\autogen_CommonException.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\autogen_ConversionException.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxException.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxTime.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxTimeToText.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\CollectInBufferStream.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Configuration.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\ConversionString.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\DebugAssertFailed.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\DebugMemLeakFinder.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\DebugPrintf.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\EventWatchFilesystemObject.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\ExcludeList.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\FdGetLine.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\FileStream.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\IOStream.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\IOStreamGetLine.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\LinuxWorkaround.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\MemBlockStream.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\PartialReadStream.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\ReadGatherStream.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\StreamableMemBlock.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\UnixUser.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Utils.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\WaitForEvent.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="backupclient"
+ Filter="">
+ <File
+ RelativePath="..\..\..\lib\backupclient\autogen_BackupProtocolClient.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\autogen_BackupStoreException.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientCryptoKeys.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientFileAttributes.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientMakeExcludeList.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientRestore.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupDaemonConfigVerify.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreDirectory.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFile.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileCmbDiff.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileCmbIdx.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileCombine.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileCryptVar.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileDiff.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileEncodeStream.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFilename.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFilenameClear.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileRevDiff.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreObjectDump.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="crypto"
+ Filter="">
+ <File
+ RelativePath="..\..\..\lib\crypto\autogen_CipherException.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherAES.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherBlowfish.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherContext.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherDescription.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\MD5Digest.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\Random.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\RollingChecksum.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="win32"
+ Filter="">
+ <File
+ RelativePath="..\..\..\lib\win32\emu.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="server"
+ Filter="">
+ <File
+ RelativePath="..\..\..\lib\server\autogen_ConnectionException.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\autogen_ServerException.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\Daemon.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\LocalProcessStream.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\Protocol.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ProtocolObject.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ProtocolUncertainStream.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\Socket.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SocketStream.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SocketStreamTLS.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SSLLib.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\TLSContext.cpp">
+ </File>
+ </Filter>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ <Filter
+ Name="lib"
+ Filter="">
+ <Filter
+ Name="compress"
+ Filter="">
+ <File
+ RelativePath="..\..\..\lib\compress\autogen_CompressException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\compress\Compress.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\compress\CompressException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\compress\CompressStream.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="common"
+ Filter="">
+ <File
+ RelativePath="..\..\..\lib\common\autogen_CommonException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\autogen_ConversionException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BannerText.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BeginStructPackForWire.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Box.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxPlatform.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxPortsAndFiles.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxTime.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxTimeToText.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxTimeToUnix.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\CollectInBufferStream.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\CommonException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Configuration.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Conversion.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\EndStructPackForWire.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\EventWatchFilesystemObject.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\ExcludeList.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\FdGetLine.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\FileModificationTime.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\FileStream.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Guards.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\IOStream.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\IOStreamGetLine.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\LinuxWorkaround.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\LocalProcessStream.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\MainHelper.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\MemBlockStream.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\MemLeakFinder.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\MemLeakFindOff.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\MemLeakFindOn.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\NamedLock.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\PartialReadStream.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\ReadGatherStream.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\StreamableMemBlock.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\TemporaryDirectory.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Test.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\UnixUser.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Utils.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\WaitForEvent.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="backupclient"
+ Filter="">
+ <File
+ RelativePath="..\..\..\lib\backupclient\autogen_BackupProtocolClient.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\autogen_BackupStoreException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientCryptoKeys.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientFileAttributes.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientMakeExcludeList.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientRestore.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupDaemonConfigVerify.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreConstants.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreDirectory.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFile.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileCryptVar.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileEncodeStream.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFilename.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFilenameClear.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileWire.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreObjectMagic.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="crypto"
+ Filter="">
+ <File
+ RelativePath="..\..\..\lib\crypto\autogen_CipherException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherAES.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherBlowfish.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherContext.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherDescription.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\MD5Digest.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\Random.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\RollingChecksum.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="win32"
+ Filter="">
+ <File
+ RelativePath="..\..\..\lib\win32\emu.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="server"
+ Filter="">
+ <File
+ RelativePath="..\..\..\lib\server\autogen_ConnectionException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\autogen_ServerException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\Daemon.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\Protocol.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ProtocolObject.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ProtocolUncertainStream.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ProtocolWire.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ServerException.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ServerStream.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ServerTLS.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\Socket.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SocketListen.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SocketStream.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SocketStreamTLS.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SSLLib.h">
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\TLSContext.h">
+ </File>
+ </Filter>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/win32test.vcproj b/infrastructure/msvc/2003/win32test.vcproj
index 5f88be95..9893526b 100644
--- a/win32test.vcproj
+++ b/infrastructure/msvc/2003/win32test.vcproj
@@ -12,14 +12,14 @@
<Configurations>
<Configuration
Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
+ OutputDirectory="..\..\..\Debug"
+ IntermediateDirectory="..\..\..\Debug"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)bin\bbackupd&quot;;&quot;$(ProjectDir)..\db-4.2.52.NC\build_win32&quot;;&quot;$(ProjectDir)lib\backupclient&quot;;&quot;$(ProjectDir)lib\server&quot;;&quot;$(ProjectDir)lib\crypto&quot;;&quot;$(ProjectDir)..\openssl\include&quot;;&quot;$(ProjectDir)lib\compress&quot;;&quot;$(ProjectDir)..\zlib\include&quot;;&quot;$(ProjectDir)lib\win32&quot;;&quot;$(ProjectDir)lib\common\&quot;"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\bin\bbackupd&quot;;&quot;$(ProjectDir)..\..\..\..\db-4.2.52.NC\build_win32&quot;;&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
@@ -32,7 +32,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\zlib\lib\zdll.lib $(ProjectDir)..\openssl\lib\libeay32.lib $(ProjectDir)..\openssl\lib\ssleay32.lib $(ProjectDir)Debug\common.lib $(ProjectDir)..\db-4.2.52.NC\build_win32\Debug\libdb42d.lib"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\lib\libeay32.lib $(ProjectDir)..\..\..\..\openssl\lib\ssleay32.lib $(ProjectDir)..\..\..\Debug\common.lib $(ProjectDir)..\..\..\..\db-4.2.52.NC\build_win32\Debug\libdb42d.lib"
OutputFile="$(OutDir)/win32test.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
@@ -62,8 +62,8 @@
</Configuration>
<Configuration
Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
+ OutputDirectory="..\..\..\Release"
+ IntermediateDirectory="..\..\..\Release"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="TRUE">
@@ -71,7 +71,7 @@
Name="VCCLCompilerTool"
EnableFiberSafeOptimizations="TRUE"
OptimizeForProcessor="1"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)bin\bbackupd&quot;;&quot;$(ProjectDir)lib\backupclient&quot;;&quot;$(ProjectDir)lib\server&quot;;&quot;$(ProjectDir)lib\crypto&quot;;&quot;$(ProjectDir)..\openssl\include&quot;;&quot;$(ProjectDir)lib\compress&quot;;&quot;$(ProjectDir)..\zlib\include&quot;;&quot;$(ProjectDir)lib\win32&quot;;&quot;$(ProjectDir)lib\common\&quot;"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\bin\bbackupd&quot;;&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING"
RuntimeLibrary="0"
BufferSecurityCheck="FALSE"
@@ -83,7 +83,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\zlib\lib\zdll.lib $(ProjectDir)..\openssl\lib\libeay32.lib $(ProjectDir)..\openssl\lib\ssleay32.lib $(ProjectDir)Release\common.lib"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\lib\libeay32.lib $(ProjectDir)..\..\..\..\openssl\lib\ssleay32.lib $(ProjectDir)..\..\..\Release\common.lib"
OutputFile="$(OutDir)/win32test.exe"
LinkIncremental="1"
IgnoreDefaultLibraryNames=""
@@ -123,10 +123,10 @@
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
- RelativePath=".\lib\win32\emu.cpp">
+ RelativePath="..\..\..\lib\win32\emu.cpp">
</File>
<File
- RelativePath=".\lib\win32\win32test.cpp">
+ RelativePath="..\..\..\lib\win32\win32test.cpp">
</File>
</Filter>
<Filter
@@ -140,7 +140,7 @@
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
<File
- RelativePath=".\ReadMe.txt">
+ RelativePath="..\..\..\ReadMe.txt">
</File>
</Files>
<Globals>
diff --git a/infrastructure/msvc/2005/bbackupctl.vcproj b/infrastructure/msvc/2005/bbackupctl.vcproj
new file mode 100644
index 00000000..3da10702
--- /dev/null
+++ b/infrastructure/msvc/2005/bbackupctl.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="bbackupctl"
+ ProjectGUID="{9FD51412-E945-4457-A17A-CA3C505CF431}"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="..\..\..\Debug"
+ IntermediateDirectory="..\..\..\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\common&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\inc32&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;NDEBUG"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\out32dll\libeay32.lib $(ProjectDir)..\..\..\..\openssl\out32dll\ssleay32.lib $(ProjectDir)..\..\..\Debug\common.lib"
+ OutputFile="$(OutDir)/bbackupctl.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/bbackupctl.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="..\..\..\Release"
+ IntermediateDirectory="..\..\..\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ EnableFiberSafeOptimizations="true"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\lib\libeay32.lib $(ProjectDir)..\..\..\..\openssl\lib\ssleay32.lib $(ProjectDir)..\..\..\Release\common.lib"
+ OutputFile="$(OutDir)/bbackupctl.exe"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <Filter
+ Name="bin"
+ >
+ <Filter
+ Name="bbackupctl"
+ >
+ <File
+ RelativePath="..\..\..\bin\bbackupctl\bbackupctl.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/infrastructure/msvc/2005/bbackupd.vcproj b/infrastructure/msvc/2005/bbackupd.vcproj
new file mode 100644
index 00000000..dbcf89d3
--- /dev/null
+++ b/infrastructure/msvc/2005/bbackupd.vcproj
@@ -0,0 +1,286 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="bbackupd"
+ ProjectGUID="{22D325FB-9131-4BD6-B390-968F0491D687}"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="..\..\..\Debug"
+ IntermediateDirectory="..\..\..\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;$(SolutionDir)..\..\..\lib\backupclient&quot;;&quot;$(SolutionDir)..\..\..\lib\common&quot;;&quot;$(SolutionDir)..\..\..\lib\compress&quot;;&quot;$(SolutionDir)..\..\..\lib\crypto&quot;;&quot;$(SolutionDir)..\..\..\lib\server&quot;;&quot;$(SolutionDir)..\..\..\lib\win32&quot;;&quot;$(SolutionDir)..\..\..\..\openssl\inc32&quot;;&quot;$(SolutionDir)..\..\..\..\zlib\include&quot;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;NDEBUG"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\out32dll\libeay32.lib $(ProjectDir)..\..\..\..\openssl\out32dll\ssleay32.lib $(ProjectDir)..\..\..\Debug\common.lib"
+ OutputFile="$(OutDir)/bbackupd.exe"
+ LinkIncremental="2"
+ IgnoreAllDefaultLibraries="false"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/bbackupd.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="..\..\..\Release"
+ IntermediateDirectory="..\..\..\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ EnableFiberSafeOptimizations="true"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;;&quot;$(SolutionDir)..\..\..\..\boost_1_31_0&quot;"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;BOOST_REGEX_NO_LIB"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\lib\libeay32.lib $(ProjectDir)..\..\..\..\openssl\lib\ssleay32.lib $(ProjectDir)..\..\..\Release\common.lib $(ProjectDir)..\..\..\lib\win32\Release\boost_regex.lib"
+ OutputFile="$(OutDir)/bbackupd.exe"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <Filter
+ Name="bin"
+ >
+ <Filter
+ Name="bbackupd"
+ >
+ <File
+ RelativePath="..\..\..\bin\bbackupd\BackupClientContext.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\BackupClientDeleteList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\BackupClientDirectoryRecord.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\BackupClientInodeToIDMap.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\BackupDaemon.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\bbackupd.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\Win32BackupService.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\Win32ServiceFunctions.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <Filter
+ Name="bin"
+ >
+ <Filter
+ Name="bbackupd"
+ >
+ <File
+ RelativePath="..\..\..\bin\bbackupd\BackupClientContext.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\BackupClientDeleteList.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\BackupClientDirectoryRecord.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\BackupClientInodeToIDMap.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\BackupDaemon.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\Win32BackupService.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupd\Win32ServiceFunctions.h"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/infrastructure/msvc/2005/boxbackup.sln b/infrastructure/msvc/2005/boxbackup.sln
new file mode 100644
index 00000000..833066e9
--- /dev/null
+++ b/infrastructure/msvc/2005/boxbackup.sln
@@ -0,0 +1,55 @@
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boxquery", "boxquery.vcproj", "{FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}"
+ ProjectSection(ProjectDependencies) = postProject
+ {A089CEE6-EBF0-4232-A0C0-74850A8127A6} = {A089CEE6-EBF0-4232-A0C0-74850A8127A6}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "common.vcproj", "{A089CEE6-EBF0-4232-A0C0-74850A8127A6}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbackupd", "bbackupd.vcproj", "{22D325FB-9131-4BD6-B390-968F0491D687}"
+ ProjectSection(ProjectDependencies) = postProject
+ {A089CEE6-EBF0-4232-A0C0-74850A8127A6} = {A089CEE6-EBF0-4232-A0C0-74850A8127A6}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win32test", "win32test.vcproj", "{28C29E72-76A2-4D0C-B35B-12D446733D2E}"
+ ProjectSection(ProjectDependencies) = postProject
+ {A089CEE6-EBF0-4232-A0C0-74850A8127A6} = {A089CEE6-EBF0-4232-A0C0-74850A8127A6}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bbackupctl", "bbackupctl.vcproj", "{9FD51412-E945-4457-A17A-CA3C505CF431}"
+ ProjectSection(ProjectDependencies) = postProject
+ {A089CEE6-EBF0-4232-A0C0-74850A8127A6} = {A089CEE6-EBF0-4232-A0C0-74850A8127A6}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}.Debug|Win32.Build.0 = Debug|Win32
+ {FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}.Release|Win32.ActiveCfg = Release|Win32
+ {FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}.Release|Win32.Build.0 = Release|Win32
+ {A089CEE6-EBF0-4232-A0C0-74850A8127A6}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A089CEE6-EBF0-4232-A0C0-74850A8127A6}.Debug|Win32.Build.0 = Debug|Win32
+ {A089CEE6-EBF0-4232-A0C0-74850A8127A6}.Release|Win32.ActiveCfg = Release|Win32
+ {A089CEE6-EBF0-4232-A0C0-74850A8127A6}.Release|Win32.Build.0 = Release|Win32
+ {22D325FB-9131-4BD6-B390-968F0491D687}.Debug|Win32.ActiveCfg = Debug|Win32
+ {22D325FB-9131-4BD6-B390-968F0491D687}.Debug|Win32.Build.0 = Debug|Win32
+ {22D325FB-9131-4BD6-B390-968F0491D687}.Release|Win32.ActiveCfg = Release|Win32
+ {22D325FB-9131-4BD6-B390-968F0491D687}.Release|Win32.Build.0 = Release|Win32
+ {28C29E72-76A2-4D0C-B35B-12D446733D2E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {28C29E72-76A2-4D0C-B35B-12D446733D2E}.Debug|Win32.Build.0 = Debug|Win32
+ {28C29E72-76A2-4D0C-B35B-12D446733D2E}.Release|Win32.ActiveCfg = Release|Win32
+ {28C29E72-76A2-4D0C-B35B-12D446733D2E}.Release|Win32.Build.0 = Release|Win32
+ {9FD51412-E945-4457-A17A-CA3C505CF431}.Debug|Win32.ActiveCfg = Debug|Win32
+ {9FD51412-E945-4457-A17A-CA3C505CF431}.Debug|Win32.Build.0 = Debug|Win32
+ {9FD51412-E945-4457-A17A-CA3C505CF431}.Release|Win32.ActiveCfg = Release|Win32
+ {9FD51412-E945-4457-A17A-CA3C505CF431}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/infrastructure/msvc/2005/boxbackup.suo b/infrastructure/msvc/2005/boxbackup.suo
new file mode 100644
index 00000000..534f337c
--- /dev/null
+++ b/infrastructure/msvc/2005/boxbackup.suo
Binary files differ
diff --git a/infrastructure/msvc/2005/boxquery.vcproj b/infrastructure/msvc/2005/boxquery.vcproj
new file mode 100644
index 00000000..414399cd
--- /dev/null
+++ b/infrastructure/msvc/2005/boxquery.vcproj
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="boxquery"
+ ProjectGUID="{FE9EC666-4B3A-4370-B3D4-DEBD4A21F36E}"
+ RootNamespace="boxquery"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="..\..\..\Debug"
+ IntermediateDirectory="..\..\..\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\common&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\inc32&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;NDEBUG"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\out32dll\libeay32.lib $(ProjectDir)..\..\..\..\openssl\out32dll\ssleay32.lib $(ProjectDir)..\..\..\Debug\common.lib"
+ OutputFile="$(OutDir)/bbackupquery.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/boxquery.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="..\..\..\Release"
+ IntermediateDirectory="..\..\..\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ EnableFiberSafeOptimizations="true"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;;&quot;$(SolutionDir)..\..\..\..\boost_1_31_0&quot;"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;BOOST_REGEX_NO_LIB"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\Release\common.lib $(ProjectDir)..\..\..\..\openssl\lib\libeay32.lib $(ProjectDir)..\..\..\..\openssl\lib\ssleay32.lib $(ProjectDir)..\..\..\lib\win32\Release\boost_regex.lib"
+ OutputFile="$(OutDir)/bbackupquery.exe"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="false"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <Filter
+ Name="bin"
+ >
+ <Filter
+ Name="backupquery"
+ >
+ <File
+ RelativePath="..\..\..\bin\bbackupquery\autogen_Documentation.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupquery\BackupQueries.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\bin\bbackupquery\bbackupquery.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <Filter
+ Name="bin"
+ >
+ <Filter
+ Name="backupquery"
+ >
+ <File
+ RelativePath="..\..\..\bin\bbackupquery\BackupQueries.h"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/infrastructure/msvc/2005/common.vcproj b/infrastructure/msvc/2005/common.vcproj
new file mode 100644
index 00000000..127d2617
--- /dev/null
+++ b/infrastructure/msvc/2005/common.vcproj
@@ -0,0 +1,850 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="common"
+ ProjectGUID="{A089CEE6-EBF0-4232-A0C0-74850A8127A6}"
+ RootNamespace="common"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="..\..\..\Debug"
+ IntermediateDirectory="..\..\..\Debug"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\common&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\inc32&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;$(NOINHERIT)"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;NDEBUG"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ WarnAsError="false"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)/common.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="..\..\..\Release"
+ IntermediateDirectory="..\..\..\Release"
+ ConfigurationType="4"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ EnableFiberSafeOptimizations="true"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;;&quot;$(SolutionDir)..\..\..\..\boost_1_31_0\&quot;"
+ PreprocessorDefinitions="BOOST_REGEX_NO_LIB;WIN32;NDEBUG;_LIB;PLATFORM_DISABLE_MEM_LEAK_TESTING"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)/common.lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <Filter
+ Name="lib"
+ >
+ <Filter
+ Name="compress"
+ >
+ <File
+ RelativePath="..\..\..\lib\compress\autogen_CompressException.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\compress\CompressStream.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="common"
+ >
+ <File
+ RelativePath="..\..\..\lib\common\autogen_CommonException.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\autogen_ConversionException.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxException.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxTime.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxTimeToText.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\CollectInBufferStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Configuration.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\ConversionString.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\DebugAssertFailed.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\DebugMemLeakFinder.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\DebugPrintf.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\EventWatchFilesystemObject.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\ExcludeList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\FdGetLine.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\FileStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\IOStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\IOStreamGetLine.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\MemBlockStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\PartialReadStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\ReadGatherStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\StreamableMemBlock.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\UnixUser.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Utils.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\WaitForEvent.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="backupclient"
+ >
+ <File
+ RelativePath="..\..\..\lib\backupclient\autogen_BackupProtocolClient.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\autogen_BackupStoreException.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientCryptoKeys.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientFileAttributes.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientMakeExcludeList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientRestore.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupDaemonConfigVerify.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreDirectory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFile.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileCmbDiff.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileCmbIdx.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileCombine.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileCryptVar.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileDiff.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileEncodeStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFilename.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFilenameClear.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileRevDiff.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreObjectDump.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="crypto"
+ >
+ <File
+ RelativePath="..\..\..\lib\crypto\autogen_CipherException.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherAES.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherBlowfish.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherContext.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherDescription.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\MD5Digest.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\Random.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\RollingChecksum.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="win32"
+ >
+ <File
+ RelativePath="..\..\..\lib\win32\emu.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\win32\WinNamedPipeStream.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="server"
+ >
+ <File
+ RelativePath="..\..\..\lib\server\autogen_ConnectionException.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\autogen_ServerException.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\Daemon.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\LocalProcessStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\Protocol.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ProtocolObject.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ProtocolUncertainStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\Socket.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SocketStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SocketStreamTLS.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SSLLib.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\TLSContext.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <Filter
+ Name="lib"
+ >
+ <Filter
+ Name="compress"
+ >
+ <File
+ RelativePath="..\..\..\lib\compress\autogen_CompressException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\compress\Compress.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\compress\CompressException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\compress\CompressStream.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="common"
+ >
+ <File
+ RelativePath="..\..\..\lib\common\autogen_CommonException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\autogen_ConversionException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BannerText.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BeginStructPackForWire.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Box.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxConfig.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxPlatform.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxPortsAndFiles.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxTime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxTimeToText.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\BoxTimeToUnix.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\CollectInBufferStream.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\CommonException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Configuration.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Conversion.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\EndStructPackForWire.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\EventWatchFilesystemObject.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\ExcludeList.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\FdGetLine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\FileModificationTime.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\FileStream.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Guards.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\IOStream.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\IOStreamGetLine.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\LocalProcessStream.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\MainHelper.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\MemBlockStream.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\MemLeakFinder.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\MemLeakFindOff.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\MemLeakFindOn.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\NamedLock.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\PartialReadStream.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\ReadGatherStream.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\StreamableMemBlock.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\TemporaryDirectory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Test.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\UnixUser.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\Utils.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\common\WaitForEvent.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="backupclient"
+ >
+ <File
+ RelativePath="..\..\..\lib\backupclient\autogen_BackupProtocolClient.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\autogen_BackupStoreException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientCryptoKeys.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientFileAttributes.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientMakeExcludeList.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupClientRestore.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupDaemonConfigVerify.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreConstants.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreDirectory.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFile.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileCryptVar.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileEncodeStream.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFilename.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFilenameClear.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreFileWire.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\backupclient\BackupStoreObjectMagic.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="crypto"
+ >
+ <File
+ RelativePath="..\..\..\lib\crypto\autogen_CipherException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherAES.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherBlowfish.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherContext.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherDescription.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\CipherException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\MD5Digest.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\Random.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\crypto\RollingChecksum.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="win32"
+ >
+ <File
+ RelativePath="..\..\..\lib\win32\emu.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\win32\WinNamedPipeStream.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="server"
+ >
+ <File
+ RelativePath="..\..\..\lib\server\autogen_ConnectionException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\autogen_ServerException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\Daemon.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\Protocol.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ProtocolObject.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ProtocolUncertainStream.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ProtocolWire.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ServerException.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ServerStream.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\ServerTLS.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\Socket.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SocketListen.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SocketStream.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SocketStreamTLS.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\SSLLib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\lib\server\TLSContext.h"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/infrastructure/msvc/2005/win32test.vcproj b/infrastructure/msvc/2005/win32test.vcproj
new file mode 100644
index 00000000..91a7918e
--- /dev/null
+++ b/infrastructure/msvc/2005/win32test.vcproj
@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="win32test"
+ ProjectGUID="{28C29E72-76A2-4D0C-B35B-12D446733D2E}"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="..\..\..\Debug"
+ IntermediateDirectory="..\..\..\Debug"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\bin\bbackupd&quot;;&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\common&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\inc32&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING;_CRT_SECURE_NO_DEPRECATE;NDEBUG"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\out32dll\libeay32.lib $(ProjectDir)..\..\..\..\openssl\out32dll\ssleay32.lib $(ProjectDir)..\..\..\Debug\common.lib"
+ OutputFile="$(OutDir)/win32test.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/win32test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="..\..\..\Release"
+ IntermediateDirectory="..\..\..\Release"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ EnableFiberSafeOptimizations="true"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\bin\bbackupd&quot;;&quot;$(ProjectDir)..\..\..\lib\backupclient&quot;;&quot;$(ProjectDir)..\..\..\lib\server&quot;;&quot;$(ProjectDir)..\..\..\lib\crypto&quot;;&quot;$(ProjectDir)..\..\..\..\openssl\include&quot;;&quot;$(ProjectDir)..\..\..\lib\compress&quot;;&quot;$(ProjectDir)..\..\..\..\zlib\include&quot;;&quot;$(ProjectDir)..\..\..\lib\win32&quot;;&quot;$(ProjectDir)..\..\..\lib\common\&quot;"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;PLATFORM_DISABLE_MEM_LEAK_TESTING"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Ws2_32.lib $(ProjectDir)..\..\..\..\zlib\lib\zdll.lib $(ProjectDir)..\..\..\..\openssl\lib\libeay32.lib $(ProjectDir)..\..\..\..\openssl\lib\ssleay32.lib $(ProjectDir)..\..\..\Release\common.lib"
+ OutputFile="$(OutDir)/win32test.exe"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames=""
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ OptimizeForWindows98="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\lib\win32\emu.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\test\win32\testlibwin32.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath="..\..\..\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/lib/backupclient/BackupClientFileAttributes.cpp b/lib/backupclient/BackupClientFileAttributes.cpp
index 3e59a265..3bb7dfeb 100644
--- a/lib/backupclient/BackupClientFileAttributes.cpp
+++ b/lib/backupclient/BackupClientFileAttributes.cpp
@@ -9,10 +9,13 @@
#include "Box.h"
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
-#include <unistd.h>
#include <limits.h>
#include <algorithm>
#include <new>
@@ -334,7 +337,12 @@ void BackupClientFileAttributes::ReadAttributes(const char *Filename, bool ZeroM
box_time_t modSecs = BoxTimeToSeconds(modTime);
__time64_t winTime = modSecs;
- if (_gmtime64(&winTime) == 0 )
+ // _MAX__TIME64_T doesn't seem to be defined, but the code below
+ // will throw an assertion failure if we exceed it :-)
+ // Microsoft says dates up to the year 3000 are valid, which
+ // is a bit more than 15 * 2^32. Even that doesn't seem
+ // to be true (still aborts), but it can at least hold 2^32.
+ if (winTime >= 0x100000000LL || _gmtime64(&winTime) == 0)
{
::syslog(LOG_ERR, "Invalid Modification Time "
"caught for file: %s", Filename);
@@ -345,7 +353,7 @@ void BackupClientFileAttributes::ReadAttributes(const char *Filename, bool ZeroM
modSecs = BoxTimeToSeconds(modTime);
winTime = modSecs;
- if (_gmtime64(&winTime) == 0 )
+ if (winTime > 0x100000000LL || _gmtime64(&winTime) == 0)
{
::syslog(LOG_ERR, "Invalid Attribute Modification "
"Time caught for file: %s", Filename);
diff --git a/lib/backupclient/BackupClientRestore.cpp b/lib/backupclient/BackupClientRestore.cpp
index ebe1d365..fbb4ee47 100644
--- a/lib/backupclient/BackupClientRestore.cpp
+++ b/lib/backupclient/BackupClientRestore.cpp
@@ -9,11 +9,14 @@
#include "Box.h"
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
#include <string>
#include <set>
-#include <unistd.h>
#include <limits.h>
#include <stdio.h>
diff --git a/lib/backupclient/BackupStoreFile.cpp b/lib/backupclient/BackupStoreFile.cpp
index fd1a8918..f5a55207 100644
--- a/lib/backupclient/BackupStoreFile.cpp
+++ b/lib/backupclient/BackupStoreFile.cpp
@@ -9,7 +9,10 @@
#include "Box.h"
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#include <sys/stat.h>
#include <string.h>
#include <new>
@@ -1480,7 +1483,9 @@ void BackupStoreFile::EncodingBuffer::Allocate(int Size)
// --------------------------------------------------------------------------
void BackupStoreFile::EncodingBuffer::Reallocate(int NewSize)
{
+#ifndef WIN32
TRACE2("Reallocating EncodingBuffer from %d to %d\n", mBufferSize, NewSize);
+#endif
ASSERT(mpBuffer != 0);
uint8_t *buffer = (uint8_t*)BackupStoreFile::CodingChunkAlloc(NewSize);
if(buffer == 0)
diff --git a/lib/backupclient/BackupStoreFileDiff.cpp b/lib/backupclient/BackupStoreFileDiff.cpp
index 78890008..ee09f1c8 100644
--- a/lib/backupclient/BackupStoreFileDiff.cpp
+++ b/lib/backupclient/BackupStoreFileDiff.cpp
@@ -577,6 +577,31 @@ static void SearchForMatchingBlocks(IOStream &rFile, std::map<int64_t, int64_t>
int rollOverInitialBytes = 0;
while(true)
{
+ if(sDiffTimerExpired)
+ {
+ ASSERT(TimeMgmtEpoch > 0);
+ ASSERT(pDiffTimer != NULL);
+
+ time_t tTotalRunIntvl = time(NULL) - TimeMgmtEpoch;
+
+ if(MaximumDiffingTime > 0 &&
+ tTotalRunIntvl >= MaximumDiffingTime)
+ {
+ TRACE0("MaximumDiffingTime reached - "
+ "suspending file diff\n");
+ abortSearch = true;
+ break;
+ }
+ else if(KeepAliveTime > 0)
+ {
+ TRACE0("KeepAliveTime reached - "
+ "initiating keep-alive\n");
+ pDiffTimer->DoKeepAlive();
+ }
+
+ sDiffTimerExpired = false;
+ }
+
// Load in another block of data, and record how big it is
int bytesInEndings = rFile.Read(endings, Sizes[s]);
int tmp;
@@ -661,38 +686,12 @@ static void SearchForMatchingBlocks(IOStream &rFile, std::map<int64_t, int64_t>
break;
}
- bool DiffTimedOut = false;
-
- if(sDiffTimerExpired)
- {
- ASSERT(TimeMgmtEpoch > 0);
- ASSERT(pDiffTimer != NULL);
-
- time_t tTotalRunIntvl = time(NULL) - TimeMgmtEpoch;
-
- if(MaximumDiffingTime > 0 &&
- tTotalRunIntvl >= MaximumDiffingTime)
- {
- TRACE0("MaximumDiffingTime reached - "
- "suspending file diff\n");
- DiffTimedOut = true;
- }
- else if(KeepAliveTime > 0)
- {
- TRACE0("KeepAliveTime reached - "
- "initiating keep-alive\n");
- pDiffTimer->DoKeepAlive();
- }
-
- sDiffTimerExpired = false;
- }
-
int64_t NumBlocksFound = static_cast<int64_t>(
rFoundBlocks.size());
int64_t MaxBlocksFound = NumBlocks *
BACKUP_FILE_DIFF_MAX_BLOCK_FIND_MULTIPLE;
- if(NumBlocksFound > MaxBlocksFound || DiffTimedOut)
+ if(NumBlocksFound > MaxBlocksFound)
{
abortSearch = true;
break;
diff --git a/lib/backupclient/BackupStoreFilenameClear.cpp b/lib/backupclient/BackupStoreFilenameClear.cpp
index 7c36d5b3..c415b9bb 100644
--- a/lib/backupclient/BackupStoreFilenameClear.cpp
+++ b/lib/backupclient/BackupStoreFilenameClear.cpp
@@ -191,7 +191,9 @@ static void EnsureEncDecBufferSize(int BufSize)
{
if(spEncDecBuffer == 0)
{
+#ifndef WIN32
TRACE1("Allocating filename encoding/decoding buffer with size %d\n", BufSize);
+#endif
spEncDecBuffer = new MemoryBlockGuard<uint8_t *>(BufSize);
MEMLEAKFINDER_NOT_A_LEAK(spEncDecBuffer);
MEMLEAKFINDER_NOT_A_LEAK(*spEncDecBuffer);
@@ -201,7 +203,9 @@ static void EnsureEncDecBufferSize(int BufSize)
{
if(sEncDecBufferSize < BufSize)
{
+#ifndef WIN32
TRACE2("Reallocating filename encoding/decoding buffer from %d to %d\n", sEncDecBufferSize, BufSize);
+#endif
spEncDecBuffer->Resize(BufSize);
sEncDecBufferSize = BufSize;
MEMLEAKFINDER_NOT_A_LEAK(*spEncDecBuffer);
diff --git a/lib/backupclient/BackupStoreObjectDump.cpp b/lib/backupclient/BackupStoreObjectDump.cpp
index 8e6331c4..b4ccc731 100644
--- a/lib/backupclient/BackupStoreObjectDump.cpp
+++ b/lib/backupclient/BackupStoreObjectDump.cpp
@@ -96,18 +96,18 @@ void BackupStoreDirectory::Dump(void *clibFileHandle, bool ToTrace)
int depends_l = 0;
if((*i)->GetDependsNewer() != 0)
{
-#ifdef WIN32
+#ifdef _MSC_VER
depends_l += ::sprintf(depends + depends_l, " depNew(%I64x)", (*i)->GetDependsNewer());
#else
- depends_l += ::sprintf(depends + depends_l, " depNew(%llx)", (*i)->GetDependsNewer());
+ depends_l += ::sprintf(depends + depends_l, " depNew(%llx)", (long long)((*i)->GetDependsNewer()));
#endif
}
if((*i)->GetDependsOlder() != 0)
{
-#ifdef WIN32
+#ifdef _MSC_VER
depends_l += ::sprintf(depends + depends_l, " depOld(%I64x)", (*i)->GetDependsOlder());
#else
- depends_l += ::sprintf(depends + depends_l, " depOld(%llx)", (*i)->GetDependsOlder());
+ depends_l += ::sprintf(depends + depends_l, " depOld(%llx)", (long long)((*i)->GetDependsOlder()));
#endif
}
diff --git a/lib/common/BoxPlatform.h b/lib/common/BoxPlatform.h
index 58a5fdae..b7a72da9 100644
--- a/lib/common/BoxPlatform.h
+++ b/lib/common/BoxPlatform.h
@@ -87,13 +87,11 @@
typedef unsigned __int32 u_int32_t;
typedef unsigned __int64 u_int64_t;
- #define HAVE_UINT8_T
- #define HAVE_UINT16_T
- #define HAVE_UINT32_T
- #define HAVE_UINT64_T
+ #define HAVE_U_INT8_T
+ #define HAVE_U_INT16_T
+ #define HAVE_U_INT32_T
+ #define HAVE_U_INT64_T
- typedef unsigned int uid_t;
- typedef unsigned int gid_t;
typedef int pid_t;
#endif // WIN32 && !__MINGW32__
diff --git a/lib/common/DebugMemLeakFinder.cpp b/lib/common/DebugMemLeakFinder.cpp
index 6c7fd3eb..17a20a6d 100644
--- a/lib/common/DebugMemLeakFinder.cpp
+++ b/lib/common/DebugMemLeakFinder.cpp
@@ -16,8 +16,11 @@
#undef realloc
#undef free
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#include <map>
-#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <set>
@@ -220,12 +223,12 @@ void memleakfinder_traceblocksinsection()
}
else
{
- TRACE4("Block 0x%08lx size %d allocated at %s:%d\n", (long)i->first, i->second.size, i->second.file, i->second.line);
+ TRACE4("Block 0x%08p size %d allocated at %s:%d\n", i->first, i->second.size, i->second.file, i->second.line);
}
}
for(std::map<void *, ObjectInfo>::const_iterator i(sSectionObjectBlocks.begin()); i != sSectionObjectBlocks.end(); ++i)
{
- TRACE5("Object%s 0x%08lx size %d allocated at %s:%d\n", i->second.array?" []":"", (long)i->first, i->second.size, i->second.file, i->second.line);
+ TRACE5("Object%s 0x%08p size %d allocated at %s:%d\n", i->second.array?" []":"", i->first, i->second.size, i->second.file, i->second.line);
}
}
@@ -250,11 +253,11 @@ void memleakfinder_reportleaks_file(FILE *file)
{
for(std::map<void *, MallocBlockInfo>::const_iterator i(sMallocBlocks.begin()); i != sMallocBlocks.end(); ++i)
{
- if(is_leak(i->first)) ::fprintf(file, "Block 0x%08lx size %d allocated at %s:%d\n", (long)i->first, i->second.size, i->second.file, i->second.line);
+ if(is_leak(i->first)) ::fprintf(file, "Block 0x%08p size %d allocated at %s:%d\n", i->first, i->second.size, i->second.file, i->second.line);
}
for(std::map<void *, ObjectInfo>::const_iterator i(sObjectBlocks.begin()); i != sObjectBlocks.end(); ++i)
{
- if(is_leak(i->first)) ::fprintf(file, "Object%s 0x%08lx size %d allocated at %s:%d\n", i->second.array?" []":"", (long)i->first, i->second.size, i->second.file, i->second.line);
+ if(is_leak(i->first)) ::fprintf(file, "Object%s 0x%08p size %d allocated at %s:%d\n", i->second.array?" []":"", i->first, i->second.size, i->second.file, i->second.line);
}
}
@@ -271,7 +274,11 @@ void memleakfinder_reportleaks_appendfile(const char *filename, const char *mark
{
if(memleakfinder_numleaks() > 0)
{
+#ifdef HAVE_GETPID
fprintf(file, "MEMORY LEAKS FROM PROCESS %d (%s)\n", getpid(), markertext);
+#else
+ fprintf(file, "MEMORY LEAKS (%s)\n", markertext);
+#endif
memleakfinder_reportleaks_file(file);
}
diff --git a/lib/common/EventWatchFilesystemObject.cpp b/lib/common/EventWatchFilesystemObject.cpp
index c3fe11f8..a9508c22 100644
--- a/lib/common/EventWatchFilesystemObject.cpp
+++ b/lib/common/EventWatchFilesystemObject.cpp
@@ -10,7 +10,10 @@
#include "Box.h"
#include <fcntl.h>
-#include <unistd.h>
+
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
#include "EventWatchFilesystemObject.h"
#include "autogen_CommonException.h"
diff --git a/lib/common/ExcludeList.cpp b/lib/common/ExcludeList.cpp
index 9b2e3acb..43991594 100644
--- a/lib/common/ExcludeList.cpp
+++ b/lib/common/ExcludeList.cpp
@@ -232,7 +232,7 @@ void ExcludeList::Deserialize(Archive & rArchive)
//
mDefinite.clear();
-#ifndef PLATFORM_REGEX_NOT_SUPPORTED
+#ifdef HAVE_REGEX_H
// free regex memory
while(mRegex.size() > 0)
{
@@ -273,7 +273,7 @@ void ExcludeList::Deserialize(Archive & rArchive)
//
//
//
-#ifndef PLATFORM_REGEX_NOT_SUPPORTED
+#ifdef HAVE_REGEX_H
rArchive.Read(iCount);
if (iCount > 0)
@@ -310,7 +310,7 @@ void ExcludeList::Deserialize(Archive & rArchive)
}
}
}
-#endif // PLATFORM_REGEX_NOT_SUPPORTED
+#endif // HAVE_REGEX_H
//
//
@@ -365,7 +365,7 @@ void ExcludeList::Serialize(Archive & rArchive) const
//
//
//
-#ifndef PLATFORM_REGEX_NOT_SUPPORTED
+#ifdef HAVE_REGEX_H
// don't even try to save compiled regular expressions,
// use string copies instead.
ASSERT(mRegex.size() == mRegexStr.size());
@@ -378,7 +378,7 @@ void ExcludeList::Serialize(Archive & rArchive) const
{
rArchive.Write(*i);
}
-#endif // PLATFORM_REGEX_NOT_SUPPORTED
+#endif // HAVE_REGEX_H
//
//
diff --git a/lib/common/FdGetLine.cpp b/lib/common/FdGetLine.cpp
index dee02604..9b53288b 100644
--- a/lib/common/FdGetLine.cpp
+++ b/lib/common/FdGetLine.cpp
@@ -10,7 +10,10 @@
#include "Box.h"
#include <sys/types.h>
-#include <unistd.h>
+
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
#include "FdGetLine.h"
#include "CommonException.h"
@@ -117,7 +120,21 @@ std::string FdGetLine::GetLine(bool Preprocess)
// Read more in?
if(!foundLineEnd && mBufferBegin >= mBytesInBuffer && !mPendingEOF)
{
+#ifdef WIN32
+ int bytes;
+
+ if (mFileHandle == _fileno(stdin))
+ {
+ bytes = console_read(mBuffer, sizeof(mBuffer));
+ }
+ else
+ {
+ bytes = ::read(mFileHandle, mBuffer,
+ sizeof(mBuffer));
+ }
+#else // !WIN32
int bytes = ::read(mFileHandle, mBuffer, sizeof(mBuffer));
+#endif // WIN32
// Error?
if(bytes == -1)
diff --git a/lib/common/FileStream.h b/lib/common/FileStream.h
index 7d677636..7a4a29f3 100644
--- a/lib/common/FileStream.h
+++ b/lib/common/FileStream.h
@@ -15,7 +15,10 @@
#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
-#include <unistd.h>
+
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
#ifdef WIN32
#define INVALID_FILE NULL
diff --git a/lib/common/Guards.h b/lib/common/Guards.h
index 6efc5614..17d73b3f 100644
--- a/lib/common/Guards.h
+++ b/lib/common/Guards.h
@@ -11,10 +11,13 @@
#ifndef GUARDS__H
#define GUARDS__H
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#include <fcntl.h>
#include <stdlib.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <new>
#include "CommonException.h"
diff --git a/lib/common/NamedLock.cpp b/lib/common/NamedLock.cpp
index fc7b8309..2418c60c 100644
--- a/lib/common/NamedLock.cpp
+++ b/lib/common/NamedLock.cpp
@@ -11,7 +11,11 @@
#include <fcntl.h>
#include <errno.h>
-#include <unistd.h>
+
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#ifdef HAVE_FLOCK
#include <sys/file.h>
#endif
diff --git a/lib/common/Test.h b/lib/common/Test.h
index 472f6342..8bac6036 100644
--- a/lib/common/Test.h
+++ b/lib/common/Test.h
@@ -14,7 +14,10 @@
#include <sys/stat.h>
#include <stdlib.h>
#include <signal.h>
-#include <unistd.h>
+
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
#include <stdio.h>
diff --git a/lib/common/UnixUser.cpp b/lib/common/UnixUser.cpp
index 8b85c3e1..df2d0ddd 100644
--- a/lib/common/UnixUser.cpp
+++ b/lib/common/UnixUser.cpp
@@ -9,11 +9,13 @@
#include "Box.h"
-#ifndef WIN32
-#include <pwd.h>
+#ifdef HAVE_PWD_H
+ #include <pwd.h>
#endif
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
#include "UnixUser.h"
#include "CommonException.h"
diff --git a/lib/common/WaitForEvent.cpp b/lib/common/WaitForEvent.cpp
index c552bb12..5646bfbf 100644
--- a/lib/common/WaitForEvent.cpp
+++ b/lib/common/WaitForEvent.cpp
@@ -9,7 +9,10 @@
#include "Box.h"
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#include <errno.h>
#include <string.h>
diff --git a/lib/server/Daemon.cpp b/lib/server/Daemon.cpp
index 9c820b22..2f902473 100644
--- a/lib/server/Daemon.cpp
+++ b/lib/server/Daemon.cpp
@@ -9,9 +9,12 @@
#include "Box.h"
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#include <errno.h>
#include <stdio.h>
-#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <stdarg.h>
@@ -124,10 +127,34 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[])
// Load the configuration file.
std::string errors;
- std::auto_ptr<Configuration> pconfig =
- Configuration::LoadAndVerify(
+ std::auto_ptr<Configuration> pconfig;
+
+ try
+ {
+ pconfig = Configuration::LoadAndVerify(
mConfigFileName.c_str(),
GetConfigVerify(), errors);
+ }
+ catch(BoxException &e)
+ {
+ if(e.GetType() == CommonException::ExceptionType &&
+ e.GetSubType() == CommonException::OSFileOpenError)
+ {
+ fprintf(stderr, "%s: failed to start: "
+ "failed to open configuration file: "
+ "%s", DaemonName(),
+ mConfigFileName.c_str());
+#ifdef WIN32
+ ::syslog(LOG_ERR, "%s: failed to start: "
+ "failed to open configuration file: "
+ "%s", DaemonName(),
+ mConfigFileName.c_str());
+#endif
+ return 1;
+ }
+
+ throw;
+ }
// Got errors?
if(pconfig.get() == 0 || !errors.empty())
@@ -136,6 +163,11 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[])
fprintf(stderr, "%s: Errors in config file %s:\n%s",
DaemonName(), mConfigFileName.c_str(),
errors.c_str());
+#ifdef WIN32
+ ::syslog(LOG_ERR, "%s: Errors in config file %s:\n%s",
+ DaemonName(), mConfigFileName.c_str(),
+ errors.c_str());
+#endif
// And give up
return 1;
}
@@ -144,9 +176,6 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[])
mpConfiguration = pconfig.release();
mLoadedConfigModifiedTime = GetConfigFileModifiedTime();
- // Server configuration
- const Configuration &serverConfig(mpConfiguration->GetSubConfiguration("Server"));
-
// Let the derived class have a go at setting up stuff in the initial process
SetupInInitialProcess();
@@ -161,6 +190,10 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[])
THROW_EXCEPTION(ServerException, DaemoniseFailed)
}
+ // Server configuration
+ const Configuration &serverConfig(
+ mpConfiguration->GetSubConfiguration("Server"));
+
// Open PID file for writing
pidFileName = serverConfig.GetKeyValue("PidFile");
FileHandleGuard<(O_WRONLY | O_CREAT | O_TRUNC), (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)> pidFile(pidFileName.c_str());
@@ -290,17 +323,33 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[])
}
catch(BoxException &e)
{
- fprintf(stderr, "%s: exception %s (%d/%d)\n", DaemonName(), e.what(), e.GetType(), e.GetSubType());
+ fprintf(stderr, "%s: failed to start: exception %s (%d/%d)\n",
+ DaemonName(), e.what(), e.GetType(), e.GetSubType());
+#ifdef WIN32
+ ::syslog(LOG_ERR, "%s: failed to start: "
+ "exception %s (%d/%d)\n", DaemonName(),
+ e.what(), e.GetType(), e.GetSubType());
+#endif
return 1;
}
catch(std::exception &e)
{
- fprintf(stderr, "%s: exception %s\n", DaemonName(), e.what());
+ fprintf(stderr, "%s: failed to start: exception %s\n",
+ DaemonName(), e.what());
+#ifdef WIN32
+ ::syslog(LOG_ERR, "%s: failed to start: exception %s\n",
+ DaemonName(), e.what());
+#endif
return 1;
}
catch(...)
{
- fprintf(stderr, "%s: unknown exception\n", DaemonName());
+ fprintf(stderr, "%s: failed to start: unknown exception\n",
+ DaemonName());
+#ifdef WIN32
+ ::syslog(LOG_ERR, "%s: failed to start: unknown exception\n",
+ DaemonName());
+#endif
return 1;
}
@@ -357,17 +406,21 @@ int Daemon::Main(const char *DefaultConfigFile, int argc, const char *argv[])
}
catch(BoxException &e)
{
- ::syslog(LOG_ERR, "exception %s (%d/%d) -- terminating", e.what(), e.GetType(), e.GetSubType());
+ ::syslog(LOG_ERR, "%s: terminating due to exception %s "
+ "(%d/%d)", DaemonName(), e.what(), e.GetType(),
+ e.GetSubType());
return 1;
}
catch(std::exception &e)
{
- ::syslog(LOG_ERR, "exception %s -- terminating", e.what());
+ ::syslog(LOG_ERR, "%s: terminating due to exception %s",
+ DaemonName(), e.what());
return 1;
}
catch(...)
{
- ::syslog(LOG_ERR, "unknown exception -- terminating");
+ ::syslog(LOG_ERR, "%s: terminating due to unknown exception",
+ DaemonName());
return 1;
}
diff --git a/lib/server/LocalProcessStream.cpp b/lib/server/LocalProcessStream.cpp
index 0de7bef4..f1b6b2b8 100644
--- a/lib/server/LocalProcessStream.cpp
+++ b/lib/server/LocalProcessStream.cpp
@@ -9,10 +9,13 @@
#include "Box.h"
-#ifndef WIN32
-#include <sys/socket.h>
+#ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
#endif
-#include <unistd.h>
#include "LocalProcessStream.h"
#include "SocketStream.h"
diff --git a/lib/server/Socket.cpp b/lib/server/Socket.cpp
index 0343b8bf..afed4888 100644
--- a/lib/server/Socket.cpp
+++ b/lib/server/Socket.cpp
@@ -9,7 +9,10 @@
#include "Box.h"
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#include <sys/types.h>
#ifndef WIN32
#include <sys/socket.h>
diff --git a/lib/server/SocketListen.h b/lib/server/SocketListen.h
index d954339a..ff08fb8f 100644
--- a/lib/server/SocketListen.h
+++ b/lib/server/SocketListen.h
@@ -11,7 +11,10 @@
#define SOCKETLISTEN__H
#include <errno.h>
-#include <unistd.h>
+
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
#ifdef HAVE_KQUEUE
#include <sys/event.h>
diff --git a/lib/server/SocketStream.cpp b/lib/server/SocketStream.cpp
index 6719fcde..2c704b8b 100644
--- a/lib/server/SocketStream.cpp
+++ b/lib/server/SocketStream.cpp
@@ -9,7 +9,10 @@
#include "Box.h"
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#include <sys/types.h>
#include <errno.h>
diff --git a/lib/win32/WinNamedPipeStream.cpp b/lib/win32/WinNamedPipeStream.cpp
index 17a2227b..c5b7eaa5 100644
--- a/lib/win32/WinNamedPipeStream.cpp
+++ b/lib/win32/WinNamedPipeStream.cpp
@@ -11,7 +11,10 @@
#ifdef WIN32
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+
#include <sys/types.h>
#include <errno.h>
#include <windows.h>
@@ -97,15 +100,14 @@ void WinNamedPipeStream::Accept(const wchar_t* pName)
{
::syslog(LOG_ERR, "ConnectNamedPipe failed: %d",
GetLastError());
- CloseHandle(mSocketHandle);
- mSocketHandle = NULL;
+ Close();
THROW_EXCEPTION(ServerException, SocketOpenError)
}
- mReadClosed = FALSE;
- mWriteClosed = FALSE;
- mIsServer = TRUE; // must flush and disconnect before closing
- mIsConnected = TRUE;
+ mReadClosed = false;
+ mWriteClosed = false;
+ mIsServer = true; // must flush and disconnect before closing
+ mIsConnected = true;
}
// --------------------------------------------------------------------------
@@ -140,10 +142,10 @@ void WinNamedPipeStream::Connect(const wchar_t* pName)
THROW_EXCEPTION(ServerException, SocketOpenError)
}
- mReadClosed = FALSE;
- mWriteClosed = FALSE;
- mIsServer = FALSE; // just close the socket
- mIsConnected = TRUE;
+ mReadClosed = false;
+ mWriteClosed = false;
+ mIsServer = false; // just close the socket
+ mIsConnected = true;
}
// --------------------------------------------------------------------------
@@ -240,7 +242,14 @@ void WinNamedPipeStream::Write(const void *pBuffer, int NBytes)
// --------------------------------------------------------------------------
void WinNamedPipeStream::Close()
{
- if (mSocketHandle == NULL || !mIsConnected)
+ if (mSocketHandle == NULL && mIsConnected)
+ {
+ fprintf(stderr, "Inconsistent connected state\n");
+ ::syslog(LOG_ERR, "Inconsistent connected state");
+ mIsConnected = false;
+ }
+
+ if (mSocketHandle == NULL)
{
THROW_EXCEPTION(ServerException, BadSocketHandle)
}
@@ -262,14 +271,16 @@ void WinNamedPipeStream::Close()
mIsServer = false;
}
- if (!CloseHandle(mSocketHandle))
+ bool result = CloseHandle(mSocketHandle);
+
+ mSocketHandle = NULL;
+ mIsConnected = false;
+
+ if (!result)
{
::syslog(LOG_ERR, "CloseHandle failed: %d", GetLastError());
THROW_EXCEPTION(ServerException, SocketCloseError)
}
-
- mSocketHandle = NULL;
- mIsConnected = FALSE;
}
// --------------------------------------------------------------------------
diff --git a/lib/win32/config.h.win32 b/lib/win32/config.h.win32
new file mode 100644
index 00000000..42298545
--- /dev/null
+++ b/lib/win32/config.h.win32
@@ -0,0 +1,396 @@
+/* lib/common/BoxConfig.h. Generated by configure. */
+/* lib/common/BoxConfig.h.in. Generated from configure.ac by autoheader. */
+/* Hacked by hand to work for MSVC by Chris Wilson */
+
+/* Define to major version for BDB_VERSION */
+/* #undef BDB_VERSION_MAJOR */
+
+/* Define to minor version for BDB_VERSION */
+/* #undef BDB_VERSION_MINOR */
+
+/* Define to point version for BDB_VERSION */
+/* #undef BDB_VERSION_POINT */
+
+/* Name of the 64 bit endian swapping function */
+/* #undef BSWAP64 */
+
+/* Define to 1 if the `closedir' function returns void instead of `int'. */
+#define CLOSEDIR_VOID 1
+
+/* Define to 1 if non-aligned int16 access will fail */
+/* #undef HAVE_ALIGNED_ONLY_INT16 */
+
+/* Define to 1 if non-aligned int32 access will fail */
+/* #undef HAVE_ALIGNED_ONLY_INT32 */
+
+/* Define to 1 if non-aligned int64 access will fail */
+/* #undef HAVE_ALIGNED_ONLY_INT64 */
+
+/* Define to 1 if you have the <asm/byteorder.h> header file. */
+/* #undef HAVE_ASM_BYTEORDER_H */
+
+/* Define to 1 if BSWAP64 is defined to the name of a valid 64 bit endian
+ swapping function */
+/* #undef HAVE_BSWAP64 */
+
+/* Define to 1 if you have the <db.h> header file. */
+/* #undef HAVE_DB_H */
+
+/* Define to 1 if you have the declaration of `F_SETLK', and to 0 if you
+ don't. */
+#define HAVE_DECL_F_SETLK 0
+
+/* Define to 1 if you have the declaration of `INFTIM', and to 0 if you don't.
+ */
+#define HAVE_DECL_INFTIM 0
+
+/* Define to 1 if you have the declaration of `O_EXLOCK', and to 0 if you
+ don't. */
+#define HAVE_DECL_O_EXLOCK 0
+
+/* Define to 1 if you have the declaration of `SO_PEERCRED', and to 0 if you
+ don't. */
+#define HAVE_DECL_SO_PEERCRED 0
+
+/* Define to 1 if you have the declaration of `XATTR_NOFOLLOW', and to 0 if
+ you don't. */
+#define HAVE_DECL_XATTR_NOFOLLOW 0
+
+/* Define to 1 if #define of pragmas works */
+/* #undef HAVE_DEFINE_PRAGMA */
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_DIRENT_H */
+
+/* Define to 1 if you have the <editline/readline.h> header file. */
+/* #undef HAVE_EDITLINE_READLINE_H */
+
+/* define if the compiler supports exceptions */
+#define HAVE_EXCEPTIONS
+
+/* Define to 1 if you have the <execinfo.h> header file. */
+/* #undef HAVE_EXECINFO_H */
+
+/* Define to 1 if you have the `flock' function. */
+/* #undef HAVE_FLOCK */
+
+/* Define to 1 if you have the `getmntent' function. */
+/* #undef HAVE_GETMNTENT */
+
+/* Define to 1 if you have the `getpeereid' function. */
+/* #undef HAVE_GETPEEREID */
+
+/* Define to 1 if you have the `getpid' function. */
+#define HAVE_GETPID 1
+
+/* Define to 1 if you have the `getxattr' function. */
+/* #undef HAVE_GETXATTR */
+
+/* Define to 1 if you have the <history.h> header file. */
+/* #undef HAVE_HISTORY_H */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+// #define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `kqueue' function. */
+/* #undef HAVE_KQUEUE */
+
+/* Define to 1 if you have the `lchown' function. */
+/* #undef HAVE_LCHOWN */
+
+/* Define to 1 if you have the `lgetxattr' function. */
+/* #undef HAVE_LGETXATTR */
+
+/* Define to 1 if you have the `crypto' library (-lcrypto). */
+#define HAVE_LIBCRYPTO 1
+
+/* Define if you have a readline compatible library */
+/* #undef HAVE_LIBREADLINE */
+
+/* Define to 1 if you have the `ssl' library (-lssl). */
+#define HAVE_LIBSSL 1
+
+/* Define to 1 if you have the `z' library (-lz). */
+#define HAVE_LIBZ 1
+
+/* Define to 1 if you have the `listxattr' function. */
+/* #undef HAVE_LISTXATTR */
+
+/* Define to 1 if you have the `llistxattr' function. */
+/* #undef HAVE_LLISTXATTR */
+
+/* Define to 1 if syscall lseek requires a dummy middle parameter */
+/* #undef HAVE_LSEEK_DUMMY_PARAM */
+
+/* Define to 1 if you have the `lsetxattr' function. */
+/* #undef HAVE_LSETXATTR */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <mntent.h> header file. */
+/* #undef HAVE_MNTENT_H */
+
+/* Define to 1 if this platform supports mounts */
+/* #undef HAVE_MOUNTS */
+
+/* define if the compiler implements namespaces */
+#define HAVE_NAMESPACES
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+/* #undef HAVE_NDIR_H */
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+/* #undef HAVE_NETINET_IN_H */
+
+/* Define to 1 if SSL is pre-0.9.7 */
+/* #undef HAVE_OLD_SSL */
+
+/* Define to 1 if you have the <openssl/ssl.h> header file. */
+#define HAVE_OPENSSL_SSL_H 1
+
+/* Define to 1 if you have the <process.h> header file. */
+#define HAVE_PROCESS_H 1
+
+/* Define to 1 if you have the <pwd.h> header file. */
+/* #undef HAVE_PWD_H */
+
+/* Define to 1 (and set RANDOM_DEVICE) if a random device is available */
+/* #undef HAVE_RANDOM_DEVICE */
+
+/* Define to 1 if you have the <readline.h> header file. */
+/* #undef HAVE_READLINE_H */
+
+/* Define if your readline library has add_history */
+/* #undef HAVE_READLINE_HISTORY */
+
+/* Define to 1 if you have the <readline/history.h> header file. */
+/* #undef HAVE_READLINE_HISTORY_H */
+
+/* Define to 1 if you have the <readline/readline.h> header file. */
+/* #undef HAVE_READLINE_READLINE_H */
+
+/* Define to 1 if you have the <regex.h> header file. */
+// #define HAVE_REGEX_H 1
+
+/* Define to 1 if you have the `setproctitle' function. */
+/* #undef HAVE_SETPROCTITLE */
+
+/* Define to 1 if you have the `setxattr' function. */
+/* #undef HAVE_SETXATTR */
+
+/* Define to 1 if you have the <signal.h> header file. */
+#define HAVE_SIGNAL_H 1
+
+/* Define to 1 if SSL is available */
+#define HAVE_SSL 1
+
+/* Define to 1 if you have the `statfs' function. */
+/* #undef HAVE_STATFS */
+
+/* Define to 1 if `stat' has the bug that it succeeds when given the
+ zero-length file name argument. */
+/* #undef HAVE_STAT_EMPTY_STRING_BUG */
+
+/* Define to 1 if stdbool.h conforms to C99. */
+#define HAVE_STDBOOL_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+// #define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if `d_type' is member of `struct dirent'. */
+/* #undef HAVE_STRUCT_DIRENT_D_TYPE */
+
+/* Define to 1 if `mnt_dir' is member of `struct mntent'. */
+/* #undef HAVE_STRUCT_MNTENT_MNT_DIR */
+
+/* Define to 1 if `mnt_mountp' is member of `struct mnttab'. */
+/* #undef HAVE_STRUCT_MNTTAB_MNT_MOUNTP */
+
+/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */
+/* #undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
+
+/* Define to 1 if `f_mntonname' is member of `struct statfs'. */
+/* #undef HAVE_STRUCT_STATFS_F_MNTONNAME */
+
+/* Define to 1 if `st_flags' is member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_FLAGS */
+
+/* Define to 1 if `st_mtimespec' is member of `struct stat'. */
+/* #undef HAVE_STRUCT_STAT_ST_MTIMESPEC */
+
+/* Define to 1 if you have the `syscall' function. */
+/* #undef HAVE_SYSCALL */
+
+/* Define to 1 if you have the <syslog.h> header file. */
+/* #undef HAVE_SYSLOG_H */
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_DIR_H */
+
+/* Define to 1 if you have the <sys/endian.h> header file. */
+/* #undef HAVE_SYS_ENDIAN_H */
+
+/* Define to 1 if you have the <sys/mnttab.h> header file. */
+/* #undef HAVE_SYS_MNTTAB_H */
+
+/* Define to 1 if you have the <sys/mount.h> header file. */
+/* #undef HAVE_SYS_MOUNT_H */
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+/* #undef HAVE_SYS_NDIR_H */
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+// #define HAVE_SYS_PARAM_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+/* #undef HAVE_SYS_SOCKET_H */
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/syscall.h> header file. */
+/* #undef HAVE_SYS_SYSCALL_H */
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+// #define HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <sys/wait.h> header file. */
+/* #undef HAVE_SYS_WAIT_H */
+
+/* Define to 1 if you have the <sys/xattr.h> header file. */
+/* #undef HAVE_SYS_XATTR_H */
+
+/* Define to 1 if you have the <time.h> header file. */
+#define HAVE_TIME_H 1
+
+/* Define to 1 if the system has the type `uint16_t'. */
+#define HAVE_UINT16_T 1
+
+/* Define to 1 if the system has the type `uint32_t'. */
+#define HAVE_UINT32_T 1
+
+/* Define to 1 if the system has the type `uint64_t'. */
+#define HAVE_UINT64_T 1
+
+/* Define to 1 if the system has the type `uint8_t'. */
+#define HAVE_UINT8_T 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+// #define HAVE_UNISTD_H 1
+
+/* Define to 1 if the system has the type `u_int16_t'. */
+/* #undef HAVE_U_INT16_T */
+
+/* Define to 1 if the system has the type `u_int32_t'. */
+/* #undef HAVE_U_INT32_T */
+
+/* Define to 1 if the system has the type `u_int64_t'. */
+/* #undef HAVE_U_INT64_T */
+
+/* Define to 1 if the system has the type `u_int8_t'. */
+/* #undef HAVE_U_INT8_T */
+
+/* Define to 1 if struct dirent.d_type is valid */
+/* #undef HAVE_VALID_DIRENT_D_TYPE */
+
+/* Define to 1 if the system has the type `_Bool'. */
+/* #undef HAVE__BOOL */
+
+/* Define to 1 if you have the `__syscall' function. */
+/* #undef HAVE___SYSCALL */
+
+/* Define to 1 if __syscall is available but needs a definition */
+/* #undef HAVE___SYSCALL_NEED_DEFN */
+
+/* max value of long long calculated by configure */
+/* #undef LLONG_MAX */
+
+/* min value of long long calculated by configure */
+/* #undef LLONG_MIN */
+
+/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
+ slash. */
+/* #undef LSTAT_FOLLOWS_SLASHED_SYMLINK */
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "box@fluffy.co.uk"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "Box Backup"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "Box Backup 0.09"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "box-backup"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "0.09"
+
+/* Define to the filename of the random device (and set HAVE_RANDOM_DEVICE) */
+/* #undef RANDOM_DEVICE */
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* TMP directory name */
+#define TEMP_DIRECTORY_NAME "/tmp"
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+/* #undef TM_IN_SYS_TIME */
+
+/* Define to 1 if your processor stores words with the most significant byte
+ first (like Motorola and SPARC, unlike Intel and VAX). */
+/* #undef WORDS_BIGENDIAN */
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to 1 if __USE_MALLOC is required work around STL memory leaks */
+/* #undef __USE_MALLOC */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#define gid_t int
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef mode_t */
+
+/* Define to `long' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to `int' if <sys/types.h> does not define. */
+/* #undef pid_t */
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+/* #undef size_t */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#define uid_t int
diff --git a/lib/win32/emu.cpp b/lib/win32/emu.cpp
index 17ac698f..00d43122 100644
--- a/lib/win32/emu.cpp
+++ b/lib/win32/emu.cpp
@@ -12,14 +12,20 @@
#include <windows.h>
#include <fcntl.h>
// #include <atlenc.h>
-#include <unistd.h>
+
+#ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+#endif
+#ifdef HAVE_PROCESS_H
+ #include <process.h>
+#endif
#include <string>
#include <list>
-//our implimentation for a timer
-//based on a simple thread which sleeps for a
-//period of time
+// our implementation for a timer, based on a
+// simple thread which sleeps for a period of time
+
static bool gFinishTimer;
static CRITICAL_SECTION gLock;
@@ -28,14 +34,14 @@ typedef struct
int countDown;
int interval;
}
-tTimer;
+Timer_t;
-std::list<tTimer> gTimerList;
+std::list<Timer_t> gTimerList;
static void (__cdecl *gTimerFunc) (int) = NULL;
-int setitimer(int type , struct itimerval *timeout, int)
+int setitimer(int type, struct itimerval *timeout, void *arg)
{
- if ( SIGVTALRM == type || ITIMER_VIRTUAL == type )
+ if (ITIMER_VIRTUAL == type)
{
EnterCriticalSection(&gLock);
// we only need seconds for the mo!
@@ -46,7 +52,7 @@ int setitimer(int type , struct itimerval *timeout, int)
}
else
{
- tTimer ourTimer;
+ Timer_t ourTimer;
ourTimer.countDown = timeout->it_value.tv_sec;
ourTimer.interval = timeout->it_interval.tv_sec;
gTimerList.push_back(ourTimer);
@@ -64,12 +70,12 @@ static unsigned int WINAPI RunTimer(LPVOID lpParameter)
while (!gFinishTimer)
{
- std::list<tTimer>::iterator it;
+ std::list<Timer_t>::iterator it;
EnterCriticalSection(&gLock);
for (it = gTimerList.begin(); it != gTimerList.end(); it++)
{
- tTimer& rTimer(*it);
+ Timer_t& rTimer(*it);
rTimer.countDown --;
if (rTimer.countDown == 0)
@@ -92,13 +98,18 @@ static unsigned int WINAPI RunTimer(LPVOID lpParameter)
for (it = gTimerList.begin(); it != gTimerList.end(); it++)
{
- tTimer& rTimer(*it);
+ Timer_t& rTimer(*it);
if (rTimer.countDown == -1)
{
gTimerList.erase(it);
- //if we don't do this the search is on a corrupt list
+
+ // the iterator is now invalid, so restart search
it = gTimerList.begin();
+
+ // if the list is now empty, don't try to increment
+ // the iterator again
+ if (it == gTimerList.end()) break;
}
}
@@ -148,7 +159,8 @@ bool EnableBackupRights( void )
TOKEN_ADJUST_PRIVILEGES,
&hToken ))
{
- printf( "Cannot open process token - err = %d\n", GetLastError( ) );
+ printf( "Cannot open process token: error %d\n",
+ (int)GetLastError() );
return false;
}
@@ -159,7 +171,8 @@ bool EnableBackupRights( void )
SE_BACKUP_NAME, //the name of the privilege
&( token_priv.Privileges[0].Luid )) ) //result
{
- printf( "Cannot lookup backup privilege - err = %d\n", GetLastError( ) );
+ printf( "Cannot lookup backup privilege: error %d\n",
+ (int)GetLastError( ) );
return false;
}
@@ -179,7 +192,8 @@ bool EnableBackupRights( void )
//this function is a little tricky - if we were adjusting
//more than one privilege, it could return success but not
//adjust them all - in the general case, you need to trap this
- printf( "Could not enable backup privileges - err = %d\n", GetLastError( ) );
+ printf( "Could not enable backup privileges: error %d\n",
+ (int)GetLastError( ) );
return false;
}
@@ -192,115 +206,342 @@ bool EnableBackupRights( void )
// --------------------------------------------------------------------------
//
// Function
-// Name: openfile
-// Purpose: replacement for any open calls - handles unicode filenames - supplied in utf8
-// Created: 25th October 2004
+// Name: ConvertToWideString
+// Purpose: Converts a string from specified codepage to
+// a wide string (WCHAR*). Returns a buffer which
+// MUST be freed by the caller with delete[].
+// In case of fire, logs the error and returns NULL.
+// Created: 4th February 2006
//
// --------------------------------------------------------------------------
-HANDLE openfile(const char *filename, int flags, int mode)
+WCHAR* ConvertToWideString(const char* pString, unsigned int codepage)
{
- try{
+ int len = MultiByteToWideChar
+ (
+ codepage, // source code page
+ 0, // character-type options
+ pString, // string to map
+ -1, // number of bytes in string - auto detect
+ NULL, // wide-character buffer
+ 0 // size of buffer - work out
+ // how much space we need
+ );
+
+ if (len == 0)
+ {
+ ::syslog(LOG_WARNING,
+ "Failed to convert string to wide string: "
+ "error %d", GetLastError());
+ errno = EINVAL;
+ return NULL;
+ }
- wchar_t *buffer;
- std::string fileN(filename);
+ WCHAR* buffer = new WCHAR[len];
- std::string tmpStr("\\\\?\\");
- //is the path relative or otherwise
- if ( fileN[1] != ':' )
- {
- //we need to get the current directory
- char wd[PATH_MAX];
- if(::getcwd(wd, PATH_MAX) == 0)
- {
- return NULL;
- }
- tmpStr += wd;
- if (tmpStr[tmpStr.length()] != '\\')
- {
- tmpStr += '\\';
- }
- }
- tmpStr += filename;
-
- int strlen = MultiByteToWideChar(
- CP_UTF8, // code page
- 0, // character-type options
- tmpStr.c_str(), // string to map
- (int)tmpStr.length(), // number of bytes in string
- NULL, // wide-character buffer
- 0 // size of buffer - work out how much space we need
- );
-
- buffer = new wchar_t[strlen+1];
- if ( buffer == NULL )
- {
- return NULL;
- }
+ if (buffer == NULL)
+ {
+ ::syslog(LOG_WARNING,
+ "Failed to convert string to wide string: "
+ "out of memory");
+ errno = ENOMEM;
+ return NULL;
+ }
- strlen = MultiByteToWideChar(
- CP_UTF8, // code page
- 0, // character-type options
- tmpStr.c_str(), // string to map
- (int)tmpStr.length(), // number of bytes in string
- buffer, // wide-character buffer
- strlen // size of buffer
- );
+ len = MultiByteToWideChar
+ (
+ codepage, // source code page
+ 0, // character-type options
+ pString, // string to map
+ -1, // number of bytes in string - auto detect
+ buffer, // wide-character buffer
+ len // size of buffer
+ );
+
+ if (len == 0)
+ {
+ ::syslog(LOG_WARNING,
+ "Failed to convert string to wide string: "
+ "error %i", GetLastError());
+ errno = EACCES;
+ delete [] buffer;
+ return NULL;
+ }
- if ( strlen == 0 )
- {
- delete [] buffer;
- return NULL;
- }
+ return buffer;
+}
- buffer[strlen] = L'\0';
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: ConvertUtf8ToWideString
+// Purpose: Converts a string from UTF-8 to a wide string.
+// Returns a buffer which MUST be freed by the caller
+// with delete[].
+// In case of fire, logs the error and returns NULL.
+// Created: 4th February 2006
+//
+// --------------------------------------------------------------------------
+WCHAR* ConvertUtf8ToWideString(const char* pString)
+{
+ return ConvertToWideString(pString, CP_UTF8);
+}
- //flags could be O_WRONLY | O_CREAT | O_RDONLY
- DWORD createDisposition = OPEN_EXISTING;
- DWORD shareMode = FILE_SHARE_READ;
- DWORD accessRights = FILE_READ_ATTRIBUTES | FILE_LIST_DIRECTORY | FILE_READ_EA;
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: ConvertFromWideString
+// Purpose: Converts a wide string to a narrow string in the
+// specified code page. Returns a buffer which MUST
+// be freed by the caller with delete[].
+// In case of fire, logs the error and returns NULL.
+// Created: 4th February 2006
+//
+// --------------------------------------------------------------------------
+char* ConvertFromWideString(const WCHAR* pString, unsigned int codepage)
+{
+ int len = WideCharToMultiByte
+ (
+ codepage, // destination code page
+ 0, // character-type options
+ pString, // string to map
+ -1, // number of bytes in string - auto detect
+ NULL, // output buffer
+ 0, // size of buffer - work out
+ // how much space we need
+ NULL, // replace unknown chars with system default
+ NULL // don't tell us when that happened
+ );
+
+ if (len == 0)
+ {
+ ::syslog(LOG_WARNING,
+ "Failed to convert wide string to narrow: "
+ "error %d", GetLastError());
+ errno = EINVAL;
+ return NULL;
+ }
- if ( flags & O_WRONLY )
- {
- createDisposition = OPEN_EXISTING;
- shareMode |= FILE_SHARE_READ ;//| FILE_SHARE_WRITE;
- }
- if ( flags & O_CREAT )
+ char* buffer = new char[len];
+
+ if (buffer == NULL)
+ {
+ ::syslog(LOG_WARNING,
+ "Failed to convert wide string to narrow: "
+ "out of memory");
+ errno = ENOMEM;
+ return NULL;
+ }
+
+ len = WideCharToMultiByte
+ (
+ codepage, // source code page
+ 0, // character-type options
+ pString, // string to map
+ -1, // number of bytes in string - auto detect
+ buffer, // output buffer
+ len, // size of buffer
+ NULL, // replace unknown chars with system default
+ NULL // don't tell us when that happened
+ );
+
+ if (len == 0)
+ {
+ ::syslog(LOG_WARNING,
+ "Failed to convert wide string to narrow: "
+ "error %i", GetLastError());
+ errno = EACCES;
+ delete [] buffer;
+ return NULL;
+ }
+
+ return buffer;
+}
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: ConvertUtf8ToConsole
+// Purpose: Converts a string from UTF-8 to the console
+// code page. On success, replaces contents of rDest
+// and returns true. In case of fire, logs the error
+// and returns false.
+// Created: 4th February 2006
+//
+// --------------------------------------------------------------------------
+bool ConvertUtf8ToConsole(const char* pString, std::string& rDest)
+{
+ WCHAR* pWide = ConvertToWideString(pString, CP_UTF8);
+ if (pWide == NULL)
+ {
+ return false;
+ }
+
+ char* pConsole = ConvertFromWideString(pWide, GetConsoleOutputCP());
+ delete [] pWide;
+
+ if (!pConsole)
+ {
+ return false;
+ }
+
+ rDest = pConsole;
+ delete [] pConsole;
+
+ return true;
+}
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: ConvertConsoleToUtf8
+// Purpose: Converts a string from the console code page
+// to UTF-8. On success, replaces contents of rDest
+// and returns true. In case of fire, logs the error
+// and returns false.
+// Created: 4th February 2006
+//
+// --------------------------------------------------------------------------
+bool ConvertConsoleToUtf8(const char* pString, std::string& rDest)
+{
+ WCHAR* pWide = ConvertToWideString(pString, GetConsoleCP());
+ if (pWide == NULL)
+ {
+ return false;
+ }
+
+ char* pConsole = ConvertFromWideString(pWide, CP_UTF8);
+ delete [] pWide;
+
+ if (!pConsole)
+ {
+ return false;
+ }
+
+ rDest = pConsole;
+ delete [] pConsole;
+
+ return true;
+}
+
+
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: ConvertPathToAbsoluteUnicode
+// Purpose: Converts relative paths to absolute (with unicode marker)
+// Created: 4th February 2006
+//
+// --------------------------------------------------------------------------
+std::string ConvertPathToAbsoluteUnicode(const char *pFileName)
+{
+ std::string tmpStr("\\\\?\\");
+
+ // Is the path relative or absolute?
+ // Absolute paths on Windows are always a drive letter
+ // followed by ':'
+
+ if (pFileName[1] != ':')
+ {
+ // Must be relative. We need to get the
+ // current directory to make it absolute.
+
+ char wd[PATH_MAX];
+ if (::getcwd(wd, PATH_MAX) == 0)
{
- createDisposition = OPEN_ALWAYS;
- shareMode |= FILE_SHARE_READ ;//| FILE_SHARE_WRITE;
- accessRights |= FILE_WRITE_ATTRIBUTES | FILE_WRITE_DATA | FILE_WRITE_EA | FILE_ALL_ACCESS;
+ ::syslog(LOG_WARNING,
+ "Failed to open '%s': path too long",
+ pFileName);
+ errno = ENAMETOOLONG;
+ tmpStr = "";
+ return tmpStr;
}
- if ( flags & O_TRUNC )
+
+ tmpStr += wd;
+ if (tmpStr[tmpStr.length()] != '\\')
{
- createDisposition = OPEN_ALWAYS;
+ tmpStr += '\\';
}
+ }
+
+ tmpStr += pFileName;
+ return tmpStr;
+}
- HANDLE hdir = CreateFileW(buffer,
- accessRights,
- shareMode,
- NULL,
- createDisposition,
- FILE_FLAG_BACKUP_SEMANTICS,
- NULL);
-
- if ( hdir == INVALID_HANDLE_VALUE )
- {
- // DWORD err = GetLastError();
- // syslog(EVENTLOG_WARNING_TYPE, "Couldn't open file %s, err %i\n", filename, err);
- delete [] buffer;
- return NULL;
- }
+// --------------------------------------------------------------------------
+//
+// Function
+// Name: openfile
+// Purpose: replacement for any open calls - handles unicode filenames - supplied in utf8
+// Created: 25th October 2004
+//
+// --------------------------------------------------------------------------
+HANDLE openfile(const char *pFileName, int flags, int mode)
+{
+ std::string AbsPathWithUnicode = ConvertPathToAbsoluteUnicode(pFileName);
+
+ if (AbsPathWithUnicode.size() == 0)
+ {
+ // error already logged by ConvertPathToAbsoluteUnicode()
+ return NULL;
+ }
+
+ WCHAR* pBuffer = ConvertUtf8ToWideString(AbsPathWithUnicode.c_str());
+ // We are responsible for freeing pBuffer
+
+ if (pBuffer == NULL)
+ {
+ // error already logged by ConvertUtf8ToWideString()
+ return NULL;
+ }
- delete [] buffer;
- return hdir;
+ // flags could be O_WRONLY | O_CREAT | O_RDONLY
+ DWORD createDisposition = OPEN_EXISTING;
+ DWORD shareMode = FILE_SHARE_READ;
+ DWORD accessRights = FILE_READ_ATTRIBUTES | FILE_LIST_DIRECTORY | FILE_READ_EA;
+ if (flags & O_WRONLY)
+ {
+ shareMode = FILE_SHARE_WRITE;
}
- catch(...)
+ if (flags & O_RDWR)
{
- printf("Caught openfile:%s\r\n", filename);
+ shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
+ }
+ if (flags & O_CREAT)
+ {
+ createDisposition = OPEN_ALWAYS;
+ shareMode |= FILE_SHARE_WRITE;
+ accessRights |= FILE_WRITE_ATTRIBUTES
+ | FILE_WRITE_DATA | FILE_WRITE_EA
+ | FILE_ALL_ACCESS;
+ }
+ if (flags & O_TRUNC)
+ {
+ createDisposition = CREATE_ALWAYS;
+ }
+ if (flags & O_EXCL)
+ {
+ shareMode = 0;
+ }
+
+ HANDLE hdir = CreateFileW(pBuffer,
+ accessRights,
+ shareMode,
+ NULL,
+ createDisposition,
+ FILE_FLAG_BACKUP_SEMANTICS,
+ NULL);
+
+ delete [] pBuffer;
+
+ if (hdir == INVALID_HANDLE_VALUE)
+ {
+ ::syslog(LOG_WARNING, "Failed to open file %s: "
+ "error %i", pFileName, GetLastError());
+ return NULL;
}
- return NULL;
+ return hdir;
}
// MinGW provides a getopt implementation
@@ -315,18 +556,18 @@ char nextchar = -1;
// --------------------------------------------------------------------------
//
// Function
-// Name: ourfstat
+// Name: emu_fstat
// Purpose: replacement for fstat supply a windows handle
// Created: 25th October 2004
//
// --------------------------------------------------------------------------
-int ourfstat(HANDLE hdir, struct stat * st)
+int emu_fstat(HANDLE hdir, struct stat * st)
{
ULARGE_INTEGER conv;
if (hdir == INVALID_HANDLE_VALUE)
{
- ::syslog(LOG_ERR, "Error: invalid file handle in ourfstat()");
+ ::syslog(LOG_ERR, "Error: invalid file handle in emu_fstat()");
errno = EBADF;
return -1;
}
@@ -343,7 +584,7 @@ int ourfstat(HANDLE hdir, struct stat * st)
// This next example is how we get our INODE (equivalent) information
conv.HighPart = fi.nFileIndexHigh;
conv.LowPart = fi.nFileIndexLow;
- st->st_ino = conv.QuadPart;
+ st->st_ino = (_ino_t)conv.QuadPart;
// get the time information
st->st_ctime = ConvertFileTimeToTime_t(&fi.ftCreationTime);
@@ -362,7 +603,7 @@ int ourfstat(HANDLE hdir, struct stat * st)
conv.HighPart = st_size.HighPart;
conv.LowPart = st_size.LowPart;
- st->st_size = conv.QuadPart;
+ st->st_size = (_off_t)conv.QuadPart;
//the mode of the file
st->st_mode = 0;
@@ -400,76 +641,26 @@ int ourfstat(HANDLE hdir, struct stat * st)
// Created: 10th December 2004
//
// --------------------------------------------------------------------------
-HANDLE OpenFileByNameUtf8(const char* pName)
+HANDLE OpenFileByNameUtf8(const char* pFileName)
{
- //some string thing - required by ms to indicate long/unicode filename
- std::string tmpStr("\\\\?\\");
-
- // is the path relative or otherwise
- std::string fileN(pName);
- if (fileN[1] != ':')
- {
- // we need to get the current directory
- char wd[PATH_MAX];
- if(::getcwd(wd, PATH_MAX) == 0)
- {
- ::syslog(LOG_WARNING,
- "Failed to open '%s': path too long", pName);
- errno = ENAMETOOLONG;
- return NULL;
- }
-
- tmpStr += wd;
- if (tmpStr[tmpStr.length()] != '\\')
- {
- tmpStr += '\\';
- }
- }
-
- tmpStr += fileN;
-
- int strlen = MultiByteToWideChar(
- CP_UTF8, // code page
- 0, // character-type options
- tmpStr.c_str(), // string to map
- (int)tmpStr.length(), // number of bytes in string
- NULL, // wide-character buffer
- 0 // size of buffer - work out
- // how much space we need
- );
-
- wchar_t* buffer = new wchar_t[strlen+1];
-
- if (buffer == NULL)
+ std::string AbsPathWithUnicode = ConvertPathToAbsoluteUnicode(pFileName);
+
+ if (AbsPathWithUnicode.size() == 0)
{
- ::syslog(LOG_WARNING,
- "Failed to open '%s': out of memory", pName);
- errno = ENOMEM;
+ // error already logged by ConvertPathToAbsoluteUnicode()
return NULL;
}
-
- strlen = MultiByteToWideChar(
- CP_UTF8, // code page
- 0, // character-type options
- tmpStr.c_str(), // string to map
- (int)tmpStr.length(), // number of bytes in string
- buffer, // wide-character buffer
- strlen // size of buffer
- );
-
- if (strlen == 0)
+
+ WCHAR* pBuffer = ConvertUtf8ToWideString(AbsPathWithUnicode.c_str());
+ // We are responsible for freeing pBuffer
+
+ if (pBuffer == NULL)
{
- ::syslog(LOG_WARNING,
- "Failed to open '%s': could not convert "
- "file name to Unicode", pName);
- errno = EACCES;
- delete [] buffer;
+ // error already logged by ConvertUtf8ToWideString()
return NULL;
}
- buffer[strlen] = L'\0';
-
- HANDLE handle = CreateFileW(buffer,
+ HANDLE handle = CreateFileW(pBuffer,
FILE_READ_ATTRIBUTES | FILE_LIST_DIRECTORY | FILE_READ_EA,
FILE_SHARE_READ | FILE_SHARE_DELETE | FILE_SHARE_WRITE,
NULL,
@@ -483,7 +674,7 @@ HANDLE OpenFileByNameUtf8(const char* pName)
// open in this mode - to get the inode information
// at least one process must have the file open -
// in this case someone else does.
- handle = CreateFileW(buffer,
+ handle = CreateFileW(pBuffer,
0,
FILE_SHARE_READ,
NULL,
@@ -492,7 +683,7 @@ HANDLE OpenFileByNameUtf8(const char* pName)
NULL);
}
- delete [] buffer;
+ delete [] pBuffer;
if (handle == INVALID_HANDLE_VALUE)
{
@@ -505,7 +696,7 @@ HANDLE OpenFileByNameUtf8(const char* pName)
else
{
::syslog(LOG_WARNING,
- "Failed to open '%s': error %d", pName);
+ "Failed to open '%s': error %d", pFileName, err);
errno = EACCES;
}
@@ -518,13 +709,13 @@ HANDLE OpenFileByNameUtf8(const char* pName)
// --------------------------------------------------------------------------
//
// Function
-// Name: ourstat
+// Name: emu_stat
// Purpose: replacement for the lstat and stat functions,
// works with unicode filenames supplied in utf8 format
// Created: 25th October 2004
//
// --------------------------------------------------------------------------
-int ourstat(const char * pName, struct stat * st)
+int emu_stat(const char * pName, struct stat * st)
{
// at the mo
st->st_uid = 0;
@@ -539,7 +730,7 @@ int ourstat(const char * pName, struct stat * st)
return -1;
}
- int retVal = ourfstat(handle, st);
+ int retVal = emu_fstat(handle, st);
if (retVal != 0)
{
// error logged, but without filename
@@ -593,14 +784,6 @@ int statfs(const char * pName, struct statfs * s)
return 0;
}
-
-
-
-
-// MinGW provides opendir(), etc. via <dirent.h>
-// MSVC does not provide these, so emulation is needed
-
-#ifndef __MINGW32__
// --------------------------------------------------------------------------
//
// Function
@@ -611,110 +794,56 @@ int statfs(const char * pName, struct statfs * s)
// --------------------------------------------------------------------------
DIR *opendir(const char *name)
{
- try
+ if (!name || !name[0])
{
- DIR *dir = 0;
- std::string dirName(name);
-
- //append a '\' win32 findfirst is sensitive to this
- if ( dirName[dirName.size()] != '\\' || dirName[dirName.size()] != '/' )
- {
- dirName += '\\';
- }
-
- //what is the search string? - everything
- dirName += '*';
-
- if(name && name[0])
- {
- if ( ( dir = new DIR ) != 0 )
- {
- //mbstowcs(dir->name, dirName.c_str(),100);
- //wcscpy((wchar_t*)dir->name, (const wchar_t*)dirName.c_str());
- //mbstowcs(dir->name, dirName.c_str(), dirName.size()+1);
- //wchar_t *buffer;
-
- int strlen = MultiByteToWideChar(
- CP_UTF8, // code page
- 0, // character-type options
- dirName.c_str(), // string to map
- (int)dirName.length(), // number of bytes in string
- NULL, // wide-character buffer
- 0 // size of buffer - work out how much space we need
- );
-
- dir->name = new wchar_t[strlen+1];
-
- if (dir->name == NULL)
- {
- delete dir;
- dir = 0;
- errno = ENOMEM;
- return NULL;
- }
-
- strlen = MultiByteToWideChar(
- CP_UTF8, // code page
- 0, // character-type options
- dirName.c_str(), // string to map
- (int)dirName.length(), // number of bytes in string
- dir->name, // wide-character buffer
- strlen // size of buffer
- );
+ errno = EINVAL;
+ return NULL;
+ }
+
+ std::string dirName(name);
- if (strlen == 0)
- {
- delete dir->name;
- delete dir;
- dir = 0;
- errno = ENOMEM;
- return NULL;
- }
+ //append a '\' win32 findfirst is sensitive to this
+ if ( dirName[dirName.size()] != '\\' || dirName[dirName.size()] != '/' )
+ {
+ dirName += '\\';
+ }
- dir->name[strlen] = L'\0';
+ // what is the search string? - everything
+ dirName += '*';
-
- dir->fd = _wfindfirst(
- (const wchar_t*)dir->name,
- &dir->info);
+ DIR *pDir = new DIR;
+ if (pDir == NULL)
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
- if (dir->fd != -1)
- {
- dir->result.d_name = 0;
- }
- else // go back
- {
- delete [] dir->name;
- delete dir;
- dir = 0;
- }
- }
- else // backwards again
- {
- delete dir;
- dir = 0;
- errno = ENOMEM;
- }
- }
- else
- {
- errno = EINVAL;
- }
+ pDir->name = ConvertUtf8ToWideString(dirName.c_str());
+ // We are responsible for freeing dir->name
+
+ if (pDir->name == NULL)
+ {
+ delete pDir;
+ return NULL;
+ }
- return dir;
+ pDir->fd = _wfindfirst((const wchar_t*)pDir->name, &(pDir->info));
- }
- catch(...)
+ if (pDir->fd == -1)
{
- printf("Caught opendir");
+ delete [] pDir->name;
+ delete pDir;
+ return NULL;
}
-
- return NULL;
+
+ pDir->result.d_name = 0;
+ return pDir;
}
-//this kinda makes it not thread friendly!
-//but I don't think it needs to be.
+// this kinda makes it not thread friendly!
+// but I don't think it needs to be.
char tempbuff[MAX_PATH];
+
// --------------------------------------------------------------------------
//
// Function
@@ -794,7 +923,6 @@ int closedir(DIR *dp)
}
return -1;
}
-#endif // !__MINGW32__
// --------------------------------------------------------------------------
//
@@ -873,11 +1001,12 @@ int poll (struct pollfd *ufds, unsigned long nfds, int timeout)
}
HANDLE gSyslogH = 0;
+static bool sHaveWarnedEventLogFull = false;
void syslog(int loglevel, const char *frmt, ...)
{
- DWORD errinfo;
- char* buffer;
+ WORD errinfo;
+ char buffer[1024];
std::string sixfour(frmt);
switch (loglevel)
@@ -896,81 +1025,203 @@ void syslog(int loglevel, const char *frmt, ...)
break;
}
-
- //taken from MSDN
- try
+ // taken from MSDN
+ int sixfourpos;
+ while ( (sixfourpos = (int)sixfour.find("%ll")) != -1 )
{
+ // maintain portability - change the 64 bit formater...
+ std::string temp = sixfour.substr(0,sixfourpos);
+ temp += "%I64";
+ temp += sixfour.substr(sixfourpos+3, sixfour.length());
+ sixfour = temp;
+ }
+
+ // printf("parsed string is:%s\r\n", sixfour.c_str());
+
+ va_list args;
+ va_start(args, frmt);
+
+ int len = vsnprintf(buffer, sizeof(buffer)-1, sixfour.c_str(), args);
+ ASSERT(len < sizeof(buffer))
+ buffer[sizeof(buffer)-1] = 0;
+
+ va_end(args);
+
+ LPCSTR strings[] = { buffer, NULL };
+ if (!ReportEvent(gSyslogH, // event log handle
+ errinfo, // event type
+ 0, // category zero
+ MSG_ERR_EXIST, // event identifier -
+ // we will call them all the same
+ NULL, // no user security identifier
+ 1, // one substitution string
+ 0, // no data
+ strings, // pointer to string array
+ NULL)) // pointer to data
- int sixfourpos;
- while ( ( sixfourpos = sixfour.find("%ll")) != -1 )
+ {
+ DWORD err = GetLastError();
+ if (err == ERROR_LOG_FILE_FULL)
+ {
+ if (!sHaveWarnedEventLogFull)
+ {
+ printf("Unable to send message to Event Log "
+ "(Event Log is full):\r\n");
+ sHaveWarnedEventLogFull = TRUE;
+ }
+ }
+ else
{
- //maintain portability - change the 64 bit formater...
- std::string temp = sixfour.substr(0,sixfourpos);
- temp += "%I64";
- temp += sixfour.substr(sixfourpos+3, sixfour.length());
- sixfour = temp;
+ printf("Unable to send message to Event Log: "
+ "error %i:\r\n", (int)err);
}
+ }
+ else
+ {
+ sHaveWarnedEventLogFull = false;
+ }
- //printf("parsed string is:%s\r\n", sixfour.c_str());
+ printf("%s\r\n", buffer);
+}
- va_list args;
- va_start(args, frmt);
+int emu_chdir(const char* pDirName)
+{
+ WCHAR* pBuffer = ConvertUtf8ToWideString(pDirName);
+ if (!pBuffer) return -1;
+ int result = SetCurrentDirectoryW(pBuffer);
+ delete [] pBuffer;
+ if (result != 0) return 0;
+ errno = EACCES;
+ return -1;
+}
-#ifdef __MINGW32__
- // no _vscprintf, use a fixed size buffer
- buffer = new char[1024];
- int len = 1023;
-#else
- int len = _vscprintf( sixfour.c_str(), args );
- ASSERT(len > 0)
+char* emu_getcwd(char* pBuffer, int BufSize)
+{
+ DWORD len = GetCurrentDirectoryW(0, NULL);
+ if (len == 0)
+ {
+ errno = EINVAL;
+ return NULL;
+ }
- len = len + 1;
- char* buffer = new char[len];
-#endif
+ if (len > BufSize)
+ {
+ errno = ENAMETOOLONG;
+ return NULL;
+ }
- ASSERT(buffer)
- memset(buffer, 0, len);
+ WCHAR* pWide = new WCHAR [len];
+ if (!pWide)
+ {
+ errno = ENOMEM;
+ return NULL;
+ }
- int len2 = vsnprintf(buffer, len, sixfour.c_str(), args);
- ASSERT(len2 <= len);
+ DWORD result = GetCurrentDirectoryW(len, pWide);
+ if (result <= 0 || result >= len)
+ {
+ errno = EACCES;
+ return NULL;
+ }
+
+ char* pUtf8 = ConvertFromWideString(pWide, CP_UTF8);
+ delete [] pWide;
- va_end(args);
+ if (!pUtf8)
+ {
+ return NULL;
}
- catch (...)
+
+ strncpy(pBuffer, pUtf8, BufSize - 1);
+ pBuffer[BufSize - 1] = 0;
+ delete [] pUtf8;
+
+ return pBuffer;
+}
+
+int emu_mkdir(const char* pPathName)
+{
+ WCHAR* pBuffer = ConvertToWideString(pPathName, CP_UTF8);
+ if (!pBuffer)
{
- printf("Caught syslog: %s", sixfour.c_str());
- return;
+ return -1;
}
- try
+ BOOL result = CreateDirectoryW(pBuffer, NULL);
+ delete [] pBuffer;
+
+ if (!result)
{
+ errno = EACCES;
+ return -1;
+ }
- if (!ReportEvent(gSyslogH, // event log handle
- errinfo, // event type
- 0, // category zero
- MSG_ERR_EXIST, // event identifier -
- // we will call them all the same
- NULL, // no user security identifier
- 1, // one substitution string
- 0, // no data
- (LPCSTR*)&buffer, // pointer to string array
- NULL)) // pointer to data
+ return 0;
+}
- {
- DWORD err = GetLastError();
- printf("Unable to send message to Event Log "
- "(error %i):\r\n", err);
- }
+int emu_unlink(const char* pFileName)
+{
+ WCHAR* pBuffer = ConvertToWideString(pFileName, CP_UTF8);
+ if (!pBuffer)
+ {
+ return -1;
+ }
- printf("%s\r\n", buffer);
+ BOOL result = DeleteFileW(pBuffer);
+ delete [] pBuffer;
- if (buffer) delete [] buffer;
+ if (!result)
+ {
+ errno = EACCES;
+ return -1;
}
- catch (...)
+
+ return 0;
+}
+
+int console_read(char* pBuffer, size_t BufferSize)
+{
+ HANDLE hConsole = GetStdHandle(STD_INPUT_HANDLE);
+
+ if (hConsole == INVALID_HANDLE_VALUE)
{
- printf("Caught syslog ReportEvent");
+ ::fprintf(stderr, "Failed to get a handle on standard input: "
+ "error %d\n", GetLastError());
+ return -1;
}
+
+ int WideSize = BufferSize / 5;
+ WCHAR* pWideBuffer = new WCHAR [WideSize];
+
+ if (!pWideBuffer)
+ {
+ ::perror("Failed to allocate wide character buffer");
+ return -1;
+ }
+
+ DWORD numCharsRead = 0;
+
+ if (!ReadConsoleW(
+ hConsole,
+ pWideBuffer,
+ WideSize - 1,
+ &numCharsRead,
+ NULL // reserved
+ ))
+ {
+ ::fprintf(stderr, "Failed to read from console: error %d\n",
+ GetLastError());
+ return -1;
+ }
+
+ pWideBuffer[numCharsRead] = 0;
+
+ char* pUtf8 = ConvertFromWideString(pWideBuffer, GetConsoleCP());
+ strncpy(pBuffer, pUtf8, BufferSize);
+ delete [] pUtf8;
+
+ return strlen(pBuffer);
}
#endif // WIN32
diff --git a/lib/win32/emu.h b/lib/win32/emu.h
index 5b506206..ce0c884f 100644
--- a/lib/win32/emu.h
+++ b/lib/win32/emu.h
@@ -3,7 +3,6 @@
#if ! defined EMU_INCLUDE && defined WIN32
#define EMU_INCLUDE
-#define _STAT_DEFINED
#define _INO_T_DEFINED
#include <winsock2.h>
@@ -17,9 +16,6 @@
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
-//#include <winsock.h>
-//#include <sys/types.h>
-//#include <sys/stat.h>
#include <string>
@@ -27,13 +23,21 @@
( *(_result) = *gmtime( (_clock) ), \
(_result) )
-
-//signal in unix SIGVTALRM does not exist in win32 - but looking at the
-#define SIGVTALRM 254
-#define SIGALRM SIGVTALRM
#define ITIMER_VIRTUAL 0
-int setitimer(int type , struct itimerval *timeout, int);
+#ifdef _MSC_VER
+// Microsoft decided to deprecate the standard POSIX functions. Great!
+#define open(file,flags,mode) _open(file,flags,mode)
+#define close(fd) _close(fd)
+#define dup(fd) _dup(fd)
+#define read(fd,buf,count) _read(fd,buf,count)
+#define write(fd,buf,count) _write(fd,buf,count)
+#define lseek(fd,off,whence) _lseek(fd,off,whence)
+#define fileno(struct_file) _fileno(struct_file)
+#endif
+
+int SetTimerHandler(void (__cdecl *func ) (int));
+int setitimer(int type, struct itimerval *timeout, void *arg);
void InitTimer(void);
void FiniTimer(void);
@@ -109,11 +113,43 @@ inline int chown(const char * Filename, u_int32_t uid, u_int32_t gid)
return 0;
}
-inline int chmod(const char * Filename, int uid)
-{
- //indicate sucsess
- return 0;
-}
+int emu_chdir (const char* pDirName);
+int emu_unlink(const char* pFileName);
+char* emu_getcwd(char* pBuffer, int BufSize);
+
+#ifdef _MSC_VER
+ inline int emu_chmod(const char * Filename, int mode)
+ {
+ // indicate success
+ return 0;
+ }
+
+ #define chmod(file, mode) emu_chmod(file, mode)
+ #define chdir(directory) emu_chdir(directory)
+ #define unlink(file) emu_unlink(file)
+ #define getcwd(buffer, size) emu_getcwd(buffer, size)
+#else
+ inline int chmod(const char * Filename, int mode)
+ {
+ // indicate success
+ return 0;
+ }
+
+ inline int chdir(const char* pDirName)
+ {
+ return emu_chdir(pDirName);
+ }
+
+ inline char* getcwd(char* pBuffer, int BufSize)
+ {
+ return emu_getcwd(pBuffer, BufSize);
+ }
+
+ inline int unlink(const char* pFileName)
+ {
+ return emu_unlink(pFileName);
+ }
+#endif
//I do not perceive a need to change the user or group on a backup client
//at any rate the owner of a service can be set in the service settings
@@ -149,55 +185,56 @@ inline int getuid(void)
// MinGW provides a getopt implementation
#ifndef __MINGW32__
-//this will need to be implimented if we see fit that command line
-//options are going to be used! (probably then:)
-//where the calling function looks for the parsed parameter
+// this will need to be implemented if we see fit that command line
+// options are going to be used! (probably then:)
+// where the calling function looks for the parsed parameter
extern char *optarg;
-//optind looks like an index into the string - how far we have moved along
+
+// optind looks like an index into the string - how far we have moved along
extern int optind;
extern char nextchar;
-inline int getopt(int count, char * const * args, char * tolookfor)
+inline int getopt(int count, char * const * args, const char * tolookfor)
{
- if ( optind >= count ) return -1;
+ if (optind >= count) return -1;
std::string str((const char *)args[optind]);
std::string interestin(tolookfor);
int opttolookfor = 0;
int index = -1;
- //just initialize the string - just in case it is used.
- //optarg[0] = 0;
+ // just initialize the string - just in case it is used.
+ // optarg[0] = 0;
std::string opt;
- if ( count == 0 ) return -1;
+ if (count == 0) return -1;
do
{
- if ( index != -1 )
+ if (index != -1)
{
str = str.substr(index+1, str.size());
}
- index = str.find('-');
+ index = (int)str.find('-');
- if ( index == -1 ) return -1;
+ if (index == -1) return -1;
opt = str[1];
optind ++;
str = args[optind];
}
- while ( ( opttolookfor = interestin.find(opt)) == -1 );
+ while ((opttolookfor = (int)interestin.find(opt)) == -1);
- if ( interestin[opttolookfor+1] == ':' )
+ if (interestin[opttolookfor+1] == ':')
{
- //strcpy(optarg, str.c_str());
+ // strcpy(optarg, str.c_str());
optarg = args[optind];
optind ++;
}
- //indicate we have finished
+ // indicate we have finished
return opt[0];
}
#endif // !__MINGW32__
@@ -244,49 +281,44 @@ struct itimerval
#define S_ISLNK(x) ( false )
-// nasty implementation to get working - TODO get the win32 equiv
-#ifdef _DEBUG
-#define getpid() 1
-#endif
-
#define vsnprintf _vsnprintf
#ifndef __MINGW32__
typedef unsigned int mode_t;
#endif
-inline int mkdir(const char *pathname, mode_t mode)
+int emu_mkdir(const char* pPathName);
+
+inline int mkdir(const char *pPathName, mode_t mode)
{
- return mkdir(pathname);
+ return emu_mkdir(pPathName);
}
-#ifdef __MINGW32__
- #include <dirent.h>
-#else
- inline int strcasecmp(const char *s1, const char *s2)
- {
- return _stricmp(s1,s2);
- }
+#ifndef __MINGW32__
+inline int strcasecmp(const char *s1, const char *s2)
+{
+ return _stricmp(s1,s2);
+}
+#endif
- struct dirent
- {
- char *d_name;
- };
+struct dirent
+{
+ char *d_name;
+};
- struct DIR
- {
- intptr_t fd; // filedescriptor
- // struct _finddata_t info;
- struct _wfinddata_t info;
- // struct _finddata_t info;
- struct dirent result; // d_name (first time null)
- wchar_t *name; // null-terminated byte string
- };
-
- DIR *opendir(const char *name);
- struct dirent *readdir(DIR *dp);
- int closedir(DIR *dp);
-#endif
+struct DIR
+{
+ intptr_t fd; // filedescriptor
+ // struct _finddata_t info;
+ struct _wfinddata_t info;
+ // struct _finddata_t info;
+ struct dirent result; // d_name (first time null)
+ wchar_t *name; // null-terminated byte string
+};
+
+DIR *opendir(const char *name);
+struct dirent *readdir(DIR *dp);
+int closedir(DIR *dp);
HANDLE openfile(const char *filename, int flags, int mode);
@@ -358,6 +390,7 @@ struct statfs
TCHAR f_mntonname[MAX_PATH];
};
+#if 0
// I think this should get us going
// Although there is a warning about
// mount points in win32 can now exists - which means inode number can be
@@ -381,9 +414,10 @@ struct stat {
#ifndef __MINGW32__
typedef u_int64_t _ino_t;
#endif
+#endif
-int ourstat(const char * name, struct stat * st);
-int ourfstat(HANDLE file, struct stat * st);
+int emu_stat(const char * name, struct stat * st);
+int emu_fstat(HANDLE file, struct stat * st);
int statfs(const char * name, struct statfs * s);
//need this for converstions
@@ -395,7 +429,8 @@ inline time_t ConvertFileTimeToTime_t(FILETIME *fileTime)
// Convert the last-write time to local time.
FileTimeToSystemTime(fileTime, &stUTC);
// SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal);
-
+
+ memset(&timeinfo, 0, sizeof(timeinfo));
timeinfo.tm_sec = stUTC.wSecond;
timeinfo.tm_min = stUTC.wMinute;
timeinfo.tm_hour = stUTC.wHour;
@@ -405,17 +440,35 @@ inline time_t ConvertFileTimeToTime_t(FILETIME *fileTime)
// timeinfo.tm_yday = ...;
timeinfo.tm_year = stUTC.wYear - 1900;
- time_t retVal = mktime(&timeinfo);
+ time_t retVal = mktime(&timeinfo) - _timezone;
return retVal;
}
-#define stat(x,y) ourstat(x,y)
-#define fstat(x,y) ourfstat(x,y)
-#define lstat(x,y) ourstat(x,y)
+#ifdef _MSC_VER
+ #define stat(filename, struct) emu_stat (filename, struct)
+ #define lstat(filename, struct) emu_stat (filename, struct)
+ #define fstat(handle, struct) emu_fstat(handle, struct)
+#else
+ inline int stat(const char* filename, struct stat* stat)
+ {
+ return emu_stat(filename, stat);
+ }
+ inline int lstat(const char* filename, struct stat* stat)
+ {
+ return emu_stat(filename, stat);
+ }
+ inline int fstat(HANDLE handle, struct stat* stat)
+ {
+ return emu_fstat(handle, stat);
+ }
+#endif
-int poll (struct pollfd *ufds, unsigned long nfds, int timeout);
+int poll(struct pollfd *ufds, unsigned long nfds, int timeout);
bool EnableBackupRights( void );
+bool ConvertUtf8ToConsole(const char* pString, std::string& rDest);
+bool ConvertConsoleToUtf8(const char* pString, std::string& rDest);
+
//
// MessageId: MSG_ERR_EXIST
// MessageText:
@@ -423,4 +476,7 @@ bool EnableBackupRights( void );
//
#define MSG_ERR_EXIST ((DWORD)0xC0000004L)
+// replacement for _cgetws which requires a relatively recent C runtime lib
+int console_read(char* pBuffer, size_t BufferSize);
+
#endif // !EMU_INCLUDE && WIN32
diff --git a/parcels.txt b/parcels.txt
index 689c3b9c..13328e55 100644
--- a/parcels.txt
+++ b/parcels.txt
@@ -15,6 +15,7 @@ ONLY:mingw32
script bin/bbackupd/win32/bbackupd.conf
script /bin/mgwz.dll
script /bin/mingwm10.dll
+ optional script /bin/pcreposix.dll
END-ONLY
OMIT:mingw32
diff --git a/test/win32/Makefile b/test/win32/Makefile
new file mode 100644
index 00000000..1212bc6f
--- /dev/null
+++ b/test/win32/Makefile
@@ -0,0 +1,5 @@
+timezone.exe: timezone.cpp Makefile
+ g++ -g -O0 -mno-cygwin -I../../lib/win32 -o timezone.exe timezone.cpp
+
+clean:
+ rm timezone.exe
diff --git a/test/win32/testlibwin32.cpp b/test/win32/testlibwin32.cpp
index 495d9d6e..ca2989d8 100644
--- a/test/win32/testlibwin32.cpp
+++ b/test/win32/testlibwin32.cpp
@@ -8,7 +8,7 @@
#include "../../bin/bbackupd/BackupDaemon.h"
#include "BoxPortsAndFiles.h"
-
+#include "emu.h"
int main(int argc, char* argv[])
{
diff --git a/test/win32/timezone.cpp b/test/win32/timezone.cpp
new file mode 100644
index 00000000..1d81bcb3
--- /dev/null
+++ b/test/win32/timezone.cpp
@@ -0,0 +1,87 @@
+#include <time.h>
+#include <windows.h>
+
+typedef int uid_t;
+typedef int gid_t;
+typedef int u_int32_t;
+
+#include "emu.h"
+
+int main(int argc, char** argv)
+{
+ time_t time_now = time(NULL);
+ char* time_str = strdup(asctime(gmtime(&time_now)));
+ time_str[24] = 0;
+
+ printf("Time now is %d (%s)\n", time_now, time_str);
+
+ char testfile[80];
+ snprintf(testfile, sizeof(testfile), "test.%d", time_now);
+ printf("Test file is: %s\n", testfile);
+
+ _unlink(testfile);
+
+ /*
+ int fd = open(testfile, O_RDWR | O_CREAT | O_EXCL);
+ if (fd < 0)
+ {
+ perror("open");
+ exit(1);
+ }
+ close(fd);
+ */
+
+ HANDLE fh = CreateFileA(testfile, FILE_READ_ATTRIBUTES,
+ FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, NULL);
+
+ if (!fh)
+ {
+ fprintf(stderr, "Failed to open file '%s': error %d\n",
+ testfile, GetLastError());
+ exit(1);
+ }
+
+ BY_HANDLE_FILE_INFORMATION fi;
+
+ if (!GetFileInformationByHandle(fh, &fi))
+ {
+ fprintf(stderr, "Failed to get file information for '%s': "
+ "error %d\n", testfile, GetLastError());
+ exit(1);
+ }
+
+ if (!CloseHandle(fh))
+ {
+ fprintf(stderr, "Failed to close file: error %d\n",
+ GetLastError());
+ exit(1);
+ }
+
+ time_t created_time = ConvertFileTimeToTime_t(&fi.ftCreationTime);
+ time_str = strdup(asctime(gmtime(&created_time)));
+ time_str[24] = 0;
+
+ printf("File created time: %d (%s)\n", created_time, time_str);
+
+ printf("Difference is: %d\n", created_time - time_now);
+
+ if (abs(created_time - time_now) > 30)
+ {
+ fprintf(stderr, "Error: time difference too big: "
+ "bug in emu.h?\n");
+ exit(1);
+ }
+
+ /*
+ sleep(1);
+
+ if (_unlink(testfile) != 0)
+ {
+ perror("Failed to delete test file");
+ exit(1);
+ }
+ */
+
+ exit(0);
+}
diff --git a/win32.bat b/win32.bat
index f37bb777..56829dde 100644
--- a/win32.bat
+++ b/win32.bat
@@ -1,27 +1,28 @@
+@echo off
-pwd = /usr/src/boxbackup0.08/
+echo quick and dirty to get up and running by generating the required files
+echo using Cygwin and Perl
-# quick and dirty to get up and running by generating the required files
-# using Cygwin and Perl
+cd .\bin\bbackupquery\ & perl ./../../bin/bbackupquery/makedocumentation.pl
+cd ..\..\
-cd ./bin/bbackupquery/ & perl ./../../bin/bbackupquery/makedocumentation.pl
-cd ../../
-
-cd ./lib/backupclient & perl ./../../lib/common/makeexception.pl BackupStoreException.txt
+cd .\lib\backupclient & perl ./../../lib/common/makeexception.pl BackupStoreException.txt
perl ./../../lib/server/makeprotocol.pl Client ./../../bin/bbstored/backupprotocol.txt
-cd ../../
+cd ..\..\
+
+cd .\lib\compress & perl ./../../lib/common/makeexception.pl CompressException.txt
+cd ..\..\
-cd ./lib/compress & perl ./../../lib/common/makeexception.pl CompressException.txt
-cd ../../
+cd .\lib\common & perl ./../../lib/common/makeexception.pl CommonException.txt & perl ./../../lib/common/makeexception.pl ConversionException.txt
-cd ./lib/common & perl ./../../lib/common/makeexception.pl CommonException.txt & perl ./../../lib/common/makeexception.pl ConversionException.txt
+cd ..\..\
-cd ../../
+cd .\lib\crypto & perl ./../../lib/common/makeexception.pl CipherException.txt
+cd ..\..\
-cd ./lib/crypto & perl ./../../lib/common/makeexception.pl CipherException.txt
-cd ../../
+echo server parts - which appears as though some of the clients rely on
-# server parts - which appears as though some of the clients rely on
+cd .\lib\server & perl ./../../lib/common/makeexception.pl ServerException.txt & perl ./../../lib/common/makeexception.pl ConnectionException.txt
+cd ..\..\
-cd ./lib/server & perl ./../../lib/common/makeexception.pl ServerException.txt & perl ./../../lib/common/makeexception.pl ConnectionException.txt
-cd ../../
+copy lib\win32\config.h.win32 lib\common\BoxConfig.h