Skip to content

Commit

Permalink
Bump version to 1.2 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
russellhancox authored Jul 2, 2018
1 parent 4790f8c commit 3856b7a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion MOLXPCConnection.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'MOLXPCConnection'
s.version = '1.1'
s.version = '1.2'
s.platform = :osx, '10.8'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
s.homepage = 'https://github.com/google/macops-molxpcconnection'
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# MOLXPCConnection

A wrapper around NSXPCListener and NSXPCConnection to provide client multiplexing, signature validation of connecting clients and forced connection establishment.
A wrapper around NSXPCListener and NSXPCConnection to provide client multiplexing,
signature validation of connecting clients, forced connection establishment and
different exported interfaces for privileged/unprivileged clients.

## Installation

Expand All @@ -16,7 +18,7 @@ Example server started by `launchd` where the `launchd` job has a `MachServices`

```objc
MOLXPCConnection *conn = [[MOLXPCConnection alloc] initServerWithName:@"MyServer"];
conn.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyServerProtocol)];
conn.privilegedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyServerProtocol)];
conn.exportedObject = myObject;
[conn resume];
```
Expand Down
11 changes: 6 additions & 5 deletions Source/MOLXPCConnection/MOLXPCConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
@code
MOLXPCConnection *conn = [[MOLXPCConnection alloc] initServerWithName:@"MyServer"];
conn.privilegedExportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyPriamryServerProtocol)];
conn.unprivilegedExportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MySecondaryServerProtocol)];
conn.privilegedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyPriamryServerProtocol)];
conn.unprivilegedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MySecondaryServerProtocol)];
conn.exportedObject = myObject;
[conn resume];
@endcode
Expand Down Expand Up @@ -119,13 +119,14 @@
@property(retain, nullable) NSXPCInterface *privilegedInterface;

/**
The unprivileged interface this object exports. (server)
The unprivileged interface this object exports. (server)
*/
@property(retain, nullable) NSXPCInterface *unprivilegedInterface;

/**
Old interface property, please update to use privilegedExportedInterface and/or unprivilegedExportedInterface instead.
*/
Old interface property, please update to use privilegedExportedInterface and/or
unprivilegedExportedInterface instead.
*/
@property(retain, nullable) NSXPCInterface *exportedInterface __attribute__((
deprecated("Use privilegedExportedInterface and / or unprivilegedExportedInterface instead.")));

Expand Down
4 changes: 2 additions & 2 deletions Source/MOLXPCConnection/MOLXPCConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ - (instancetype)initServerWithListener:(NSXPCListener *)listener {
if (self) {
_listenerObject = listener;
_validationInterface =
[NSXPCInterface interfaceWithProtocol:@protocol(MOLXPCConnectionProtocol)];
[NSXPCInterface interfaceWithProtocol:@protocol(MOLXPCConnectionProtocol)];
}
return self;
}
Expand Down Expand Up @@ -154,7 +154,7 @@ - (BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConne
// Fail this connection if it's from an unprivileged user and we have been
// configured to only allow root/admins
NSXPCInterface *interface;
if ([connection effectiveUserIdentifier] == 0) {
if (connection.effectiveUserIdentifier == 0) {
interface = self.privilegedInterface;
} else {
interface = self.unprivilegedInterface;
Expand Down

0 comments on commit 3856b7a

Please sign in to comment.