-
Notifications
You must be signed in to change notification settings - Fork 0
/
BLAuthentication.h
48 lines (32 loc) · 1.39 KB
/
BLAuthentication.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// ====================================================================== //
// BLAuthentication.h //
// //
// Last Modified on Tuesday April 24 2001 //
// Copyright 2001 Ben Lachman //
// //
// Thanks to Brian R. Hill <http://personalpages.tds.net/~brian_hill/> //
// ====================================================================== //
#import <Cocoa/Cocoa.h>
#import <Security/Authorization.h>
@interface BLAuthentication : NSObject {
AuthorizationRef authorizationRef;
}
// returns a shared instance of the class
+ sharedInstance;
// checks if user is authentcated forCommands
- (BOOL)isAuthenticated:(NSArray *)forCommands;
// authenticates user forCommands
- (BOOL)authenticate:(NSArray *)forCommands;
// deauthenticates user
- (void)deauthenticate;
// gets the pid forProcess
- (int)getPID:(NSString *)forProcess;
// executes pathToCommand with privileges, returns stdout as NSString*
- (NSString *)executeCommand:(NSString *)pathToCommand withArgs:(NSArray *)arguments withPipe: (NSPipe *)pipe;
- (NSString *)executeCommand:(NSString *)pathToCommand withArgs:(NSArray *)arguments;
// kills the process specified by commandFromPS
- (void)killProcess:(NSString *)commandFromPS;
@end
// strings for notification center
extern NSString* BLAuthenticatedNotification;
extern NSString* BLDeauthenticatedNotification;