Commit graph

695 commits

Author SHA1 Message Date
David Chisnall
2bdcae390d Checkpoint new string ABI work.
ASCII and UTF-16 strings in the new representation now work, but some of
the string optimisations are disabled.
2018-04-07 20:06:16 +01:00
David Chisnall
970c8cbd05 Revert "Fix memory corruption in NSException."
Accidentally included unrelated changes.

This reverts commit 3b1e94ec5d.
2018-04-07 20:03:33 +01:00
David Chisnall
3b1e94ec5d Fix memory corruption in NSException.
If compiling without backtrace or BFD support, we initialise the
location to store return addresses incorrectly, leaving a dangling
pointer which we then right over.

Most consumers never read this, so it seemed to work most of the time by
just overwriting a random bit of memory.

This probably has security implications, because throwing an exception
can clobber random bits of memory, though not with attacker-controlled
data.
2018-04-07 11:02:04 +01:00
Richard Frith-Macdonald
cc7a146796 More changes to make lock tracking more robust 2018-04-04 14:42:20 +01:00
Richard Frith-Macdonald
d6612ef880 Fixes in experimental code 2018-03-27 09:55:29 +01:00
Richard Frith-Macdonald
76014b0983 add missing declaration 2018-03-26 20:12:50 +01:00
Richard Frith-Macdonald
05439fe15d Experimental deadlock detection code 2018-03-26 15:20:48 +01:00
Richard Frith-Macdonald
81102fae85 improve logging of http comms and of deadlocks 2018-03-16 15:11:02 +00:00
Richard Frith-Macdonald
7c1b9b4d15 fix style errors 2018-03-15 14:09:14 +00:00
Richard Frith-Macdonald
1937b36b86 Update assertion macros to support multiple arguments 2018-02-06 09:35:34 +00:00
Richard Frith-Macdonald
d8e7607582 Tweaks to let comp[iler know that methods to raise an exception don't return. 2018-01-25 10:05:52 +00:00
fredkiefer
97f9a02308 Add new symbolic link method to NSFileManager. 2017-12-03 21:55:33 +01:00
Daniel Ferreira
0888a7761f NSURLDownload: export NSURLDownloadDelegate protocol
As of macOS 10.7, NSURLDownloadDelegate is exposed formally as a
protocol. This adds the declaration to make this true for GNUstep.
2017-08-24 05:14:13 +10:00
Daniel Ferreira
6762a35539 NSTextCheckingResult: define missing constants
Define missing constants in the NSTextCheckingResult header.
2017-08-24 05:14:13 +10:00
Daniel Ferreira
49a8940156 NSObjCRuntime: add availability macro definitions
Add empty definitions for OSX Availability macros for compatibility
purposes.
2017-08-05 04:15:36 +10:00
Daniel Ferreira
270c1bcea9 NSFileManager: implement -attributesOfFileSystemForPath:withError:
Implement a method for getting attribytes of a file system path. Reuse
the implementation of -fileSystemAttributesAtPath: for this purpose but
export the last system errors to the caller. Make
-fileSystemAttributesAtPath: use the new implementation, without
exposing error info to the caller.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
7636967f30 api: generate stubs for new classes
Generate class stubs (without any method definition) for
NSFileCoordinator, NSFilePresenter, NSFileVersion and NSURLSession.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
e2831f34c1 NSURLConnection: expose NSURLConnectionDelegate as a protocol
Currently, NSURLConnectionDelegate methods were defined as a category of
an NSObject. The same definitions were copied over to a new
NSURLConnectionDelegate protocol, introduced in OSX 10.7.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
8bd630f004 NSURLCredential: add stub for keychain-stored credential
Declare the NSURLCredentialPersistenceSynchronizable enumeration case to
NSURLCredential persistence options. Since GNUstep does not support
iCloud synchronization for credentials, this case will default to
NSURLCredentialPersistencePermanent.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
814c19ecce NSURLProtectionSpace: improve authentication method handling
Improve handling of NSURL authentication methods. Make "HTMLForm"
authentication a no-op as it should be instead of making it fall back to
Basic authentication.

Add stubs for NTLM and Negotiate IIS methods. They should be easily
implementable given the current framework for authentication methods.

Add stubs for ClientCertificate and ServerTrust authentication methods.
A blocker for supporting them is the lack of a Security.framework
implementation (since they rely on SecTrustRef). They would also require
additions to the current SSL handling code for GNUstep https requests.
Also stub the -distinguishedNames property of NSURLProtectionSpace,
which also deals with certificate-related authentication methods.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
aa70ff5300 NSURLRequest: add new values for NSURLCachePolicy
Add new values for the NSURLCachePolicy enum. Although
NSURLRequestReloadIgnoringLocalAndRemoteCacheData and
NSURLRequestReloadRevalidatingCacheData have been left unimplemented,
the same applies for the reference platform, so not supporting it does
not break API compatibility.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
8df9e6d73d NSZone: implement NSMakeCollectable()
Implement NSMakeCollectable(), an interface which makes CoreFoundation
objects eligible for garbage collection.

Since garbage collection is a totally deprecated API, its implementation
is a no-op, which may cause objects that rely on it to leak. However, it
doesn't look like supporting actual garbage collection at this point
will bring a gain to the project -- and having this function available
will avoid breaking builds that rely on it.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
d49db3ab29 NSProcessInfo: add stubs for new APIs
Add stubs for sudden termination APIs and for application activity
management methods.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
cbfa4d8cc9 NSProcessInfo: implement getting system uptime
Introduce the systemUptime property to NSProcessInfo, which can compute
platform-independently what is the uptime of the system.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
644b676949 NSHTTPCookie: add support for HTTPOnly cookies
Add support for parsing HTTPOnly cookies (those that cannot be accessed
by clients). Implement -[NSHTTPCookie isHTTPOnly].
2017-06-29 21:18:16 +01:00
Daniel Ferreira
fae4ff3371 NSHTTPCookie: make -isSessionOnly and -isSecure properties
Make -[NSHTTPCookie isSessionOnly] and -[NSHTTPCookie isSecure] methods
become properties if possible, so that they can be also queried as
`cookie.sessionOnly` and `cookie.secure`. This increases compatibility
with applications that rely on this notation.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
3111003ca1 NSFileManager: create NSFileManagerDelegate
Create NSFileManagerDelegate, a more modern manner to verify whether to
proceed a file operation after an error or whether an operation should
actually be performed by NSFileManager.

No functionality using the delegate is yet implemented.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
2ec3c7bc27 NSURL: create stub for -getResourceValue:forKey:error:
Create an unimplemented stub for NSURL's -getResourceValue:... method,
which can gather a numerous set of information about a URL.

Define the constants which are passed into -getResourceValue:... for
requiring information so that a build that relies on this method does
not break.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
41a00e1ad3 NSURL: create .fileURL property
Create the NSURL.fileURL property to increase compatibility with
applications that rely on this.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
064df5ba69 NSURL: add stubs for alias functions
The OSX filesystem implements "aliases", a species of symlink which
tracks its source if it was moved. Create stubs for the NSURL functions
which handle these aliases.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
e813dde02c NSURL: implement +fileURLWithPath:isDirectory:
Implement +[NSURL fileURLWithPath:isDirectory:], a class method added in
OSX 10.5, which was missing from the implementation.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
314f437f43 NSCoder: implement NSSecureCoding stub
Implement stubs for NSSecureCoding which do not break projects that rely
on it.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
be874e5d8f NSDate: declare system clock change notification
Declare a system clock change notification. Base still does not emit
this notification, but this allows applications that wait for it not to
have their build broken.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
58db96f385 NSObjCRuntime: create NS_ROOT_CLASS macro
Create the NS_ROOT_CLASS macro, a wrapper around the objc_root_class
compiler attribute.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
ec9e4055dd NSObjCRuntime: create stubs for Apple availability macros
Make NS_AVAILABLE and NS_CLASS_AVAILABLE macros no-ops so that their
absence does not break projects that rely on it.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
dc88164c94 NSCalendar: add new NSCalendarUnit definitions
Update NSCalendarUnit definitions with a newer specification from Cocoa.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
959415a236 NSCalendar: add NSCalendarOptions enum
Add the NSCalendarOptions enum to NSCalendar for compatibility purposes.
While NSCalendar does not yet know how to handle them, it will not
generate build errors in projects that attempt to use them.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
5ab00e2c49 NSCalendar: add new calendar identifier constants
Add new calendar identifier constants to NSCalendar, to add
compatibility for newer OSX applications. Some identifiers do not hold
parity with the older equivalents and have been left unimplemented, with
the gregorian calendar as a fallback.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
a9df1b104a NSGeometry: create NSEdgeInsets struct
Create the NSEdgeInsets struct in NSGeometry, introduced in OSX 10.7.
Add helper functions for creating these insets.

This struct is not used in Base. Rather, it is used as part of newer
APIs in GUI.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
47ecf6a90b FoundationErrors: add "no file exists" error
Create a no-file-exists error to the FoundationErrors enums. No function
is yet implemented to throw this error, but it has been added for
compatibility with applications that handle it.
2017-06-29 21:18:16 +01:00
Richard Frith-MacDonald
9400f9105d Make TLS client certificate issuer/owner names available
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40508 72102866-910b-0410-8b05-ffd578937521
2017-05-19 11:38:48 +00:00
Richard Frith-MacDonald
073fb54804 apply bug #49021
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40461 72102866-910b-0410-8b05-ffd578937521
2017-04-09 09:56:55 +00:00
Wolfgang Lux
6df2b6f4c9 Add missing class declaration for new methods in NSStream.h
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40445 72102866-910b-0410-8b05-ffd578937521
2017-04-04 07:44:00 +00:00
Richard Frith-MacDonald
71d1d5c42b implement methods to create a stream to read from a URL
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40420 72102866-910b-0410-8b05-ffd578937521
2017-03-27 09:44:13 +00:00
Richard Frith-MacDonald
7c9d7acafa Update NSComparisonResult to use NS_ENUM
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40418 72102866-910b-0410-8b05-ffd578937521
2017-03-27 09:00:35 +00:00
Richard Frith-MacDonald
5e2d923b78 improve comment
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40179 72102866-910b-0410-8b05-ffd578937521
2016-10-26 11:34:11 +00:00
Richard Frith-MacDonald
3d9ffaf168 Misc tidyuups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40165 72102866-910b-0410-8b05-ffd578937521
2016-10-21 15:32:31 +00:00
Richard Frith-MacDonald
85b02833b1 scanHexLongLong inspider by Abbas Raza
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40070 72102866-910b-0410-8b05-ffd578937521
2016-09-06 07:57:17 +00:00
Niels Grewe
2e18a14485 Avoid reallocating objects post-hoc based on the initializer used.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40038 72102866-910b-0410-8b05-ffd578937521
2016-07-27 07:02:42 +00:00
Niels Grewe
c2be055c3e Add [NSData initWithBytesNoCopy:length:deallocator:]
This new initializer allows customising the deallocation behaviour
through user-supplied blocks. 


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40035 72102866-910b-0410-8b05-ffd578937521
2016-07-26 23:01:11 +00:00