]>
Commit | Line | Data |
---|---|---|
34d340d7 A |
1 | #include <mach/mach.h> |
2 | #include <mach/mach_error.h> | |
3 | #include <servers/bootstrap.h> | |
4 | #include <unistd.h> | |
5 | #include <stdio.h> | |
6 | #include <stdlib.h> | |
7 | #include <stdbool.h> | |
8 | ||
9 | #include "dirhelper.h" | |
10 | ||
11 | #define DIRHELPER_BOOTSTRAP_NAME "com.apple.bsd.dirhelper" | |
12 | ||
13 | int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused))) | |
14 | { | |
15 | kern_return_t kr; | |
16 | mach_port_t mp; | |
17 | ||
18 | kr = bootstrap_look_up(bootstrap_port, DIRHELPER_BOOTSTRAP_NAME, &mp); | |
19 | if (kr != KERN_SUCCESS) { | |
20 | fprintf(stderr, "bootstrap_look_up(): %s\n", bootstrap_strerror(kr)); | |
21 | exit(EXIT_FAILURE); | |
22 | } | |
23 | ||
24 | kr = __dirhelper_create_user_local(mp); | |
25 | if (kr != KERN_SUCCESS) { | |
26 | fprintf(stderr, "dirhelper_create_user_local(): %s\n", mach_error_string(kr)); | |
27 | exit(EXIT_FAILURE); | |
28 | } | |
29 | ||
30 | exit(EXIT_SUCCESS); | |
31 | } |