[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
PATCH: support local application data paths by default via configure option --enable-local-appdata
- To: or-dev@xxxxxxxxxxxxx
- Subject: PATCH: support local application data paths by default via configure option --enable-local-appdata
- From: coderman <coderman@xxxxxxxxx>
- Date: Thu, 15 Jan 2009 14:56:35 -0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: or-dev-outgoing@xxxxxxxx
- Delivered-to: or-dev@xxxxxxxx
- Delivery-date: Thu, 15 Jan 2009 17:56:41 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=g9cn8mn2ZiqbgNcPE6os2YViWkOanT/R2SCA5cIVs98=; b=LuKfwJlnhuBtdnGO79O4XD8O+qPJFe/xq9ZbXLZoGiF4vzet9hqRPF6uy8R50U3CDs offGAy8s4mgrbcRw03uvzDgHUnuR9RHaTtJoDOONXOPj7TWxPtMr6070vWMYULgMpjQz pzLek2BrzchojLU2jHiiv9E3FUXLJhglEkww4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=IuUwJO3IDZI1QdDZmC29mh8CF22nNunbxOtCe26nzDwkZkWUpdLNZbd3CqU/BG7g4o Of0Cuz3wgn6EK0fZRa5RJyuwa25ywURQGiAEO6rjkL/YT4xbzRilA4Ku3NNr7+XwCRj4 vEhxrps0Fypa8o1aDhsTO1tmp22C8mUwZiU7g=
- Reply-to: or-dev@xxxxxxxxxxxxx
- Sender: owner-or-dev@xxxxxxxxxxxxx
This patch changes the default location where config and data files
are stored when the --enable-local-appdata option is configured. This
changes the Windows path from %APPDATA% to a host local
%USERPROFILE%\Local Settings\Application Data\ path (aka,
LOCAL_APPDATA).
diff -Naur orig-tor/configure.in mod-tor/configure.in
--- orig-tor/configure.in 2009-01-07 21:05:02.433428000 +0000
+++ mod-tor/configure.in 2009-01-15 22:32:40.208956064 +0000
@@ -96,6 +96,13 @@
AC_ARG_ENABLE(gcc-warnings,
AS_HELP_STRING(--enable-gcc-warnings, enable verbose warnings))
+AC_ARG_ENABLE(local-appdata,
+ AS_HELP_STRING(--enable-local-appdata, default to host local application data paths on Windows))
+if test "$enable_local_appdata" = "yes"; then
+ AC_DEFINE(ENABLE_LOCAL_APPDATA, 1,
+ [Defined if we default to host local appdata paths on Windows])
+fi
+
AC_PROG_CC
AC_PROG_CPP
AC_PROG_MAKE_SET
diff -Naur orig-tor/src/or/config.c mod-tor/src/or/config.c
--- orig-tor/src/or/config.c 2009-01-07 21:13:02.443406000 +0000
+++ mod-tor/src/or/config.c 2009-01-15 22:35:36.250193728 +0000
@@ -3735,8 +3735,11 @@
/* Find X:\documents and settings\username\application data\ .
* We would use SHGetSpecialFolder path, but that wasn't added until IE4.
*/
- if (!SUCCEEDED(SHGetSpecialFolderLocation(NULL, CSIDL_APPDATA,
- &idl))) {
+#ifdef ENABLE_LOCAL_APPDATA
+ if (!SUCCEEDED(SHGetSpecialFolderLocation(NULL, CSIDL_LOCAL_APPDATA, &idl))) {
+#else
+ if (!SUCCEEDED(SHGetSpecialFolderLocation(NULL, CSIDL_APPDATA, &idl))) {
+#endif
GetCurrentDirectory(MAX_PATH, path);
is_set = 1;
log_warn(LD_CONFIG,