Skip to content

Commit 3856b7a

Browse files
Bump version to 1.2 (#5)
1 parent 4790f8c commit 3856b7a

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

MOLXPCConnection.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'MOLXPCConnection'
3-
s.version = '1.1'
3+
s.version = '1.2'
44
s.platform = :osx, '10.8'
55
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
66
s.homepage = 'https://github.com/google/macops-molxpcconnection'

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# MOLXPCConnection
22

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

57
## Installation
68

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

1719
```objc
1820
MOLXPCConnection *conn = [[MOLXPCConnection alloc] initServerWithName:@"MyServer"];
19-
conn.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyServerProtocol)];
21+
conn.privilegedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyServerProtocol)];
2022
conn.exportedObject = myObject;
2123
[conn resume];
2224
```

Source/MOLXPCConnection/MOLXPCConnection.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
2323
@code
2424
MOLXPCConnection *conn = [[MOLXPCConnection alloc] initServerWithName:@"MyServer"];
25-
conn.privilegedExportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyPriamryServerProtocol)];
26-
conn.unprivilegedExportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MySecondaryServerProtocol)];
25+
conn.privilegedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MyPriamryServerProtocol)];
26+
conn.unprivilegedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(MySecondaryServerProtocol)];
2727
conn.exportedObject = myObject;
2828
[conn resume];
2929
@endcode
@@ -119,13 +119,14 @@
119119
@property(retain, nullable) NSXPCInterface *privilegedInterface;
120120

121121
/**
122-
The unprivileged interface this object exports. (server)
122+
The unprivileged interface this object exports. (server)
123123
*/
124124
@property(retain, nullable) NSXPCInterface *unprivilegedInterface;
125125

126126
/**
127-
Old interface property, please update to use privilegedExportedInterface and/or unprivilegedExportedInterface instead.
128-
*/
127+
Old interface property, please update to use privilegedExportedInterface and/or
128+
unprivilegedExportedInterface instead.
129+
*/
129130
@property(retain, nullable) NSXPCInterface *exportedInterface __attribute__((
130131
deprecated("Use privilegedExportedInterface and / or unprivilegedExportedInterface instead.")));
131132

Source/MOLXPCConnection/MOLXPCConnection.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ - (instancetype)initServerWithListener:(NSXPCListener *)listener {
6161
if (self) {
6262
_listenerObject = listener;
6363
_validationInterface =
64-
[NSXPCInterface interfaceWithProtocol:@protocol(MOLXPCConnectionProtocol)];
64+
[NSXPCInterface interfaceWithProtocol:@protocol(MOLXPCConnectionProtocol)];
6565
}
6666
return self;
6767
}
@@ -154,7 +154,7 @@ - (BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConne
154154
// Fail this connection if it's from an unprivileged user and we have been
155155
// configured to only allow root/admins
156156
NSXPCInterface *interface;
157-
if ([connection effectiveUserIdentifier] == 0) {
157+
if (connection.effectiveUserIdentifier == 0) {
158158
interface = self.privilegedInterface;
159159
} else {
160160
interface = self.unprivilegedInterface;

0 commit comments

Comments
 (0)