Skip to content

Commit

Permalink
Merge branch 'andymatuschak/master'
Browse files Browse the repository at this point in the history
* andymatuschak/master: (170 commits)
  Adding Thai localizations to the project.
  Add Thai localization
  Update to the Brazilian Portuguese localization from Victor Figueriedo
  Removed Japanese localization of password prompt from the Xcode project
  Allow the user to try reentering his password if authentication fails.
  Removing Japanese localization of the password prompt, since I changed the design
  Delegated password prompting to the update driver.
  Use NSFileManager interface for DMG unarchive only for 10.7+. On 10.6,  [NSFileManager copyItemAtPath:toPath:error:] can fail with "Argument list too long" if the app bundle contains too many files. The switch to NSFileManager was only required for 10.7 anyway, 10.6 always worked fine.
  Removed changes to the project.pbxproj that were unrelated to the password prompt
  Redesigned password prompt UI
  Removed methods from SUPasswordPrompt.h that didn't need to be exposed there
  Fixes sparkle-project#44: maximumSystemVersion key
  remove the ASW tags since we're submitting this as a pull request to andy
  Updating Danish localization courtesy Daniel Østergaard Nielsen
  support for encrypted disk images
  Fixes sparkle-project#175: Bug: update alert text collides with automatic download checkbox
  Fixes sparkle-project#174: Bug: sparkle:shortVersionString ignored for non-enclosure items
  Fixes sparkle-project#170: An environment variable set by Sparkle
  Fixing some new Clang warnings from Xcode 4.4
  Fixes sparkle-project#169: Security Issue in Parsing XML using NSXMLDocument
  ...

Conflicts:
	SUUIBasedUpdateDriver.m
  • Loading branch information
iloveitaly committed Aug 5, 2012
2 parents 4486edf + c1510a5 commit ee6fece
Show file tree
Hide file tree
Showing 375 changed files with 78,162 additions and 10,099 deletions.
1 change: 0 additions & 1 deletion Configurations/ConfigBinaryDelta.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

PRODUCT_NAME = BinaryDelta
GCC_PREFIX_HEADER =
SDKROOT = macosx10.5
MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.5
MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5
MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.5
Expand Down
2 changes: 1 addition & 1 deletion Configurations/ConfigBinaryDeltaDebug.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#include "ConfigCommonDebug.xcconfig"
#include "ConfigBinaryDelta.xcconfig"

OTHER_CFLAGS = -fsingle-precision-constant -DDEBUG
OTHER_CFLAGS = -DDEBUG
4 changes: 2 additions & 2 deletions Configurations/ConfigCommon.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PREBINDING = NO
ZERO_LINK = NO
CURRENT_PROJECT_VERSION = 1.5
SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk
SDKROOT = macosx10.7
MACOSX_DEPLOYMENT_TARGET[arch=ppc] = 10.4
MACOSX_DEPLOYMENT_TARGET[arch=ppc64] = 10.5
MACOSX_DEPLOYMENT_TARGET[arch=i386] = 10.4
Expand Down Expand Up @@ -47,4 +47,4 @@ GCC_WARN_UNUSED_VALUE = YES
GCC_WARN_UNUSED_PARAMETER = YES
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
GCC_WARN_UNDECLARED_SELECTOR = YES
WARNING_CFLAGS = -Wall -Wno-unused-parameter -Werror -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-format-attribute -Wpacked -Wredundant-decls -Winline -Wdisabled-optimization -Wformat=2 -Winvalid-pch
WARNING_CFLAGS = -Wall -Wno-unused-parameter -Werror -Wundef -Wendif-labels -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-format-attribute -Wpacked -Wredundant-decls -Winline -Wdisabled-optimization -Winvalid-pch
1 change: 0 additions & 1 deletion Configurations/ConfigFramework.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ DYLIB_COMPATIBILITY_VERSION = 1.5
DYLIB_CURRENT_VERSION = 1.5
PRODUCT_NAME = Sparkle
WRAPPER_EXTENSION = framework
OTHER_LDFLAGS = -lcrypto
FRAMEWORK_VERSION = A
INFOPLIST_FILE = Info.plist
GCC_PREFIX_HEADER = Sparkle.pch
2 changes: 1 addition & 1 deletion Configurations/ConfigFrameworkDebug.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#include "ConfigCommonDebug.xcconfig"
#include "ConfigFramework.xcconfig"

OTHER_CFLAGS = -fsingle-precision-constant -DDEBUG
OTHER_CFLAGS = -DDEBUG
3 changes: 2 additions & 1 deletion Configurations/ConfigRelaunch.xcconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Relaunch Tool only

PRODUCT_NAME = relaunch
PRODUCT_NAME = finish_installation
SKIP_INSTALL = YES
2 changes: 1 addition & 1 deletion Configurations/ConfigRelaunchDebug.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#include "ConfigCommonDebug.xcconfig"
#include "ConfigRelaunch.xcconfig"

OTHER_CFLAGS = -fsingle-precision-constant -DDEBUG
OTHER_CFLAGS = -DDEBUG
2 changes: 1 addition & 1 deletion Configurations/ConfigTestAppDebug.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#include "ConfigCommonDebug.xcconfig"
#include "ConfigTestApp.xcconfig"

OTHER_CFLAGS = -fsingle-precision-constant -DDEBUG
OTHER_CFLAGS = -DDEBUG
2 changes: 2 additions & 0 deletions Configurations/ConfigUnitTest.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ WRAPPER_EXTENSION = octest
FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_LIBRARY_DIR)/Frameworks
GCC_PREFIX_HEADER = $(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h
GCC_PRECOMPILE_PREFIX_HEADER = YES
SDKROOT = macosx10.6
MACOSX_DEPLOYMENT_TARGET = 10.6
115 changes: 0 additions & 115 deletions License.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,121 +10,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
EXTERNAL LICENSES
=================

This project uses software developed by the OpenSSL Project for use in the OpenSSL
Toolkit (http://www.openssl.org). This toolkit is licensed as follows:
/* ====================================================================
* Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modi�cation, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* �This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)�
*
* 4. The names �OpenSSL Toolkit� and �OpenSSL Project� must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* [email protected].
*
* 5. Products derived from this software may not be called �OpenSSL�
* nor may �OpenSSL� appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following

* acknowledgment:
* �This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)�
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS�� AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* ([email protected]). This product includes software written by Tim
* Hudson ([email protected]).
*
*/

Original SSLeay License
/* Copyright (C) 1995-1998 Eric Young ([email protected])
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young ([email protected]).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson ([email protected]).
*
* Copyright remains Eric Young�s, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modi�cation, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* �This product includes cryptographic software written by
* Eric Young ([email protected])�
* The word �cryptographic� can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows speci�c code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* �This product includes software written by Tim Hudson ([email protected])�
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS�� AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/

License for bspatch.c and bsdiff.c, from bsdiff 4.3 (<http://www.daemonology.net/bsdiff/>:
/*-
* Copyright 2003-2005 Colin Percival
Expand Down
8 changes: 7 additions & 1 deletion NTSynchronousTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@

// pass nil for directory if not needed
// returns the result
+ (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
+(int) task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input output: (NSData**)outData;

+(NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;

- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
- (int)result;
- (NSData *)output;

@end

Expand Down
45 changes: 42 additions & 3 deletions NTSynchronousTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
// Copyright 2005 Steve Gehrman. All rights reserved.
//

#import "Sparkle.h"
#import "SUUpdater.h"

#import "SUAppcast.h"
#import "SUAppcastItem.h"
#import "SUVersionComparisonProtocol.h"
#import "NTSynchronousTask.h"

@implementation NTSynchronousTask
Expand Down Expand Up @@ -124,6 +128,7 @@ - (id)init;

[[self task] setStandardInput:[self inputPipe]];
[[self task] setStandardOutput:[self outputPipe]];
[[self task] setStandardError:[self outputPipe]];
}

return self;
Expand All @@ -144,7 +149,7 @@ - (void)dealloc
[super dealloc];
}

- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
- (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input
{
BOOL success = NO;

Expand Down Expand Up @@ -199,7 +204,7 @@ - (void)run:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(
}
}

+ (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input;
+ (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input
{
// we need this wacky pool here, otherwise we run out of pipes, the pipes are internally autoreleased
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
Expand All @@ -226,4 +231,38 @@ + (NSData*)task:(NSString*)toolPath directory:(NSString*)currentDirectory withAr
return result;
}


+(int) task:(NSString*)toolPath directory:(NSString*)currentDirectory withArgs:(NSArray*)args input:(NSData*)input output: (NSData**)outData
{
// we need this wacky pool here, otherwise we run out of pipes, the pipes are internally autoreleased
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int taskResult = 0;
if( outData )
*outData = nil;

NS_DURING
{
NTSynchronousTask* task = [[NTSynchronousTask alloc] init];

[task run:toolPath directory:currentDirectory withArgs:args input:input];

taskResult = [task result];
if( outData )
*outData = [[task output] retain];

[task release];
}
NS_HANDLER;
taskResult = errCppGeneral;
NS_ENDHANDLER;

[pool drain];

// retained above
if( outData )
[*outData autorelease];

return taskResult;
}

@end
28 changes: 24 additions & 4 deletions SUAppcast.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
// Copyright 2006 Andy Matuschak. All rights reserved.
//

#import "Sparkle.h"
#import "SUUpdater.h"

#import "SUAppcast.h"
#import "SUAppcastItem.h"
#import "SUVersionComparisonProtocol.h"
#import "SUAppcast.h"
#import "SUConstants.h"
#import "SULog.h"

@interface NSXMLElement (SUAppcastExtensions)
- (NSDictionary *)attributesAsDictionary;
Expand All @@ -26,7 +32,7 @@ - (NSDictionary *)attributesAsDictionary
}
@end

@interface SUAppcast (Private)
@interface SUAppcast () <NSURLDownloadDelegate>
- (void)reportError:(NSError *)error;
- (NSXMLNode *)bestNodeInNodes:(NSArray *)nodes;
@end
Expand All @@ -36,8 +42,14 @@ @implementation SUAppcast
- (void)dealloc
{
[items release];
items = nil;
[userAgentString release];
userAgentString = nil;
[downloadFilename release];
downloadFilename = nil;
[download release];
download = nil;

[super dealloc];
}

Expand Down Expand Up @@ -82,7 +94,15 @@ - (void)downloadDidFinish:(NSURLDownload *)aDownload

if (downloadFilename)
{
document = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options:0 error:&error] autorelease];
NSUInteger options = 0;
if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7) {
// In order to avoid including external entities when parsing the appcast (a potential security vulnerability; see https://github.com/andymatuschak/Sparkle/issues/169), we ask NSXMLDocument to "tidy" the XML first. This happens to remove these external entities; it wouldn't be a future-proof approach, but it worked in these historical versions of OS X, and we have a more rigorous approach for 10.7+.
options = NSXMLDocumentTidyXML;
} else {
// In 10.7 and later, there's a real option for the behavior we desire.
options = NSXMLNodeLoadExternalEntitiesSameOriginOnly;
}
document = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL fileURLWithPath:downloadFilename] options:options error:&error] autorelease];

#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
[[NSFileManager defaultManager] removeFileAtPath:downloadFilename handler:nil];
Expand Down Expand Up @@ -186,7 +206,7 @@ - (void)downloadDidFinish:(NSURLDownload *)aDownload
}
else
{
NSLog(@"Sparkle Updater: Failed to parse appcast item: %@.\nAppcast dictionary was: %@", errString, dict);
SULog(@"Sparkle Updater: Failed to parse appcast item: %@.\nAppcast dictionary was: %@", errString, dict);
}
[nodesDict removeAllObjects];
[dict removeAllObjects];
Expand Down
6 changes: 6 additions & 0 deletions SUAppcastItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

NSString *DSASignature;
NSString *minimumSystemVersion;
NSString *maximumSystemVersion;

NSURL *fileURL;
NSString *versionString;
Expand All @@ -28,6 +29,8 @@
NSDictionary *deltaUpdates;

NSDictionary *propertiesDictionary;

NSURL *infoURL; // UK 2007-08-31
}

// Initializes with data from a dictionary provided by the RSS class.
Expand All @@ -43,12 +46,15 @@
- (NSURL *)fileURL;
- (NSString *)DSASignature;
- (NSString *)minimumSystemVersion;
- (NSString *)maximumSystemVersion;
- (NSDictionary *)deltaUpdates;
- (BOOL)isDeltaUpdate;

// Returns the dictionary provided in initWithDictionary; this might be useful later for extensions.
- (NSDictionary *)propertiesDictionary;

- (NSURL *)infoURL; // UK 2007-08-31

@end

#endif
Loading

0 comments on commit ee6fece

Please sign in to comment.