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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
/*
* helper.h
* MySQL PreferencePane Helper
*
* Created by Alfredo Kojima on Tue Aug 03 2004.
* Copyright (c) 2004, 2005, 2006 MySQL AB. All rights reserved.
*
*/
#ifndef __HELPER_H__
#define __HELPER_H__
#include <Security/Authorization.h>
#include <sys/param.h>
typedef enum
{
MAHelperStartMySQL = 1, // executes mysql.server start
MAHelperStopMySQL = 2, // executes mysql.server stop
MAHelperToggleAutoStart = 3, // edits /etc/hostconfig
MAHelperShutdownMySQL = 4, // executes mysqladmin shutdown
MAHelperToggleUseMySQLD,
MAHelperSetIMPassword,
// following commands will send the open file descriptor through the socket
MAHelperCreateMyCnf= 100 // opens /etc/my.cnf.new writable
} MAHelperCommandType;
typedef struct
{
MAHelperCommandType authorizedCommandId;
char username[33];
char password[33];
bool enable;
} MAHelperCommand;
// Exit codes (positive values) and return codes from exec function
enum
{
MAHelperCommandInternalError = -1,
MAHelperCommandSuccess = 0,
MAHelperCommandSuccessTrue,
MAHelperCommandSuccessFalse,
MAHelperCommandExecFailed,
MAHelperCommandChildError,
MAHelperCommandAuthFailed,
MAHelperCommandOperationFailed,
MAHelperCommandCancelled,
MAHelperCommandHelperNotFound,
MAHelperCommandNeedsRestart
};
int mhelperPerformCommand2(AuthorizationRef authorizationRef,
const char *helperPath, MAHelperCommand command,
void(*output_callback)(const char*, void*),
void *callback_data);
int mhelperPerformCommand(AuthorizationRef authorizationRef,
const char *helperPath, MAHelperCommand command);
int mhelperPerformOpenCommand(AuthorizationRef authorizationRef,
const char *helperPath, MAHelperCommand command,
int *fdret, char **error_message);
int mautoStartState();
#endif
|