if (!err) {
#warning Send init message to main thread with 2 ports, name and path
+ NSLog (@"Got init message with pid '%d', name '%s', path '%s'",
+ pid, name, path);
+ err = kim_handle_reply_init (in_reply_port, 0);
}
k5_ipc_stream_free_string (name);
if (!err) {
#warning Send enter identity message to main thread with 2 ports
+ kim_identity identity = NULL;
+ NSLog (@"Got enter identity message");
+ err = kim_identity_create_from_string (&identity, "nobody@TEST-KERBEROS-1.3.1");
+ if (!err) {
+ err = kim_handle_reply_enter_identity (in_reply_port, identity, 0);
+ }
+ kim_identity_free (&identity);
}
return err;
if (!err) {
#warning Send select identity message to main thread with 2 ports
+ kim_identity identity = NULL;
+ NSLog (@"Got select identity message");
+ err = kim_identity_create_from_string (&identity, "nobody@TEST-KERBEROS-1.3.1");
+ if (!err) {
+ err = kim_handle_reply_select_identity (in_reply_port, identity, 0);
+ }
+ kim_identity_free (&identity);
}
kim_selection_hints_free (&hints);
}
if (!err) {
+ NSLog (@"Got auth prompt with identity '%s', type '%d', hide '%d', title '%s', message '%s', description '%s'",
+ identity_string, type, hide_reply, title, message, description);
+ err = kim_handle_reply_auth_prompt (in_reply_port, "ydobon", 0);
#warning Send auth prompt message to main thread with 2 ports and arguments
}
if (!err) {
#warning Send change password message to main thread with 2 ports and arguments
+ NSLog (@"Got change password with identity '%s', old_password_expired '%d'",
+ identity_string, old_password_expired);
+ err = kim_handle_reply_change_password (in_reply_port,
+ "ydobon",
+ "foo",
+ "bar", 0);
}
k5_ipc_stream_free_string (identity_string);
if (!err) {
#warning Send handle error message to main thread with 2 ports and arguments
+ NSLog (@"Got handle error with identity '%s', error '%d', message '%s', description '%s'",
+ identity_string, error, message, description);
+ err = kim_handle_reply_handle_error (in_reply_port, 0);
}
k5_ipc_stream_free_string (identity_string);
if (!err) {
#warning Send fini message to main thread with 2 ports
+ NSLog (@"Got fini message");
+ err = kim_handle_reply_fini (in_reply_port, 0);
}
return err;
#import <Cocoa/Cocoa.h>
+
+#import "ServerDemux.h"
#import "k5_mig_server.h"
+#include <Kerberos/kipc_server.h>
+#include <syslog.h>
+
int main(int argc, const char *argv[])
{
int err = 0;
+ NSAutoreleasePool *pool = NULL;
- err = k5_ipc_server_initialize (argc, argv);
+ openlog (argv[0], LOG_CONS | LOG_PID, LOG_AUTH);
+ syslog (LOG_INFO, "Starting up.");
+
+ pool = [[NSAutoreleasePool alloc] init];
+
+ [NSApplication sharedApplication];
+ [NSBundle loadNibNamed: @"MainMenu" owner: NSApp];
- if (!err) {
- err = NSApplicationMain(argc, argv);
- }
+ err = k5_ipc_server_listen_loop ();
- if (!err) {
- err = k5_ipc_server_cleanup (argc, argv);
- }
+ syslog (LOG_NOTICE, "Exiting: %s (%d)", kipc_error_string (err), err);
return err;
}