From b6daf31b2ddc3291afebea6297b2d7a46b9d9b00 Mon Sep 17 00:00:00 2001 From: Andrew Hyatt Date: Mon, 17 Dec 2018 16:12:58 -0500 Subject: [PATCH] Get libinfo to attempt to talk to DS (#357) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Many xpc functions related to talking to DirectoryService are stubs, so this won’t work. This does get it to attempt talking to DirectoryService, however. --- src/external/DirectoryService | 2 +- src/external/libxpc | 2 +- src/libinfo/CMakeLists.txt | 4 ++++ .../include/opendirectory/CAuditUtils.h | 1 + src/opendirectory/include/opendirectory/CHandlers.h | 1 + .../include/opendirectory/CInternalDispatch.h | 1 + src/opendirectory/include/opendirectory/CLauncher.h | 1 + src/opendirectory/include/opendirectory/CNodeList.h | 1 + .../include/opendirectory/CPlugInList.h | 1 + .../include/opendirectory/CPluginConfig.h | 1 + .../include/opendirectory/CPluginHandler.h | 1 + src/opendirectory/include/opendirectory/CRefTable.h | 1 + .../include/opendirectory/CServerPlugin.h | 1 + .../include/opendirectory/CSrvrMessaging.h | 1 + .../include/opendirectory/DSMachEndian.h | 1 + .../include/opendirectory/DSSwapUtils.h | 1 + .../include/opendirectory/DSlibinfoMIG_types.h | 1 + .../include/opendirectory/DSmemberdMIG_types.h | 1 + .../include/opendirectory/DirServiceMain.h | 1 + .../include/opendirectory/DirectoryService | 1 + src/opendirectory/include/opendirectory/Mbrd_Cache.h | 1 + .../include/opendirectory/Mbrd_HashTable.h | 1 + .../include/opendirectory/Mbrd_MembershipResolver.h | 1 + .../include/opendirectory/Mbrd_UserGroup.h | 1 + .../include/opendirectory/ServerControl.h | 1 + .../include/opendirectory/od_passthru.h | 1 + src/opendirectory/include/opendirectory/odipc.h | 12 ++++++++++-- src/opendirectory/include/opendirectory/rb.h | 1 + 28 files changed, 40 insertions(+), 4 deletions(-) create mode 120000 src/opendirectory/include/opendirectory/CAuditUtils.h create mode 120000 src/opendirectory/include/opendirectory/CHandlers.h create mode 120000 src/opendirectory/include/opendirectory/CInternalDispatch.h create mode 120000 src/opendirectory/include/opendirectory/CLauncher.h create mode 120000 src/opendirectory/include/opendirectory/CNodeList.h create mode 120000 src/opendirectory/include/opendirectory/CPlugInList.h create mode 120000 src/opendirectory/include/opendirectory/CPluginConfig.h create mode 120000 src/opendirectory/include/opendirectory/CPluginHandler.h create mode 120000 src/opendirectory/include/opendirectory/CRefTable.h create mode 120000 src/opendirectory/include/opendirectory/CServerPlugin.h create mode 120000 src/opendirectory/include/opendirectory/CSrvrMessaging.h create mode 120000 src/opendirectory/include/opendirectory/DSMachEndian.h create mode 120000 src/opendirectory/include/opendirectory/DSSwapUtils.h create mode 120000 src/opendirectory/include/opendirectory/DSlibinfoMIG_types.h create mode 120000 src/opendirectory/include/opendirectory/DSmemberdMIG_types.h create mode 120000 src/opendirectory/include/opendirectory/DirServiceMain.h create mode 120000 src/opendirectory/include/opendirectory/DirectoryService create mode 120000 src/opendirectory/include/opendirectory/Mbrd_Cache.h create mode 120000 src/opendirectory/include/opendirectory/Mbrd_HashTable.h create mode 120000 src/opendirectory/include/opendirectory/Mbrd_MembershipResolver.h create mode 120000 src/opendirectory/include/opendirectory/Mbrd_UserGroup.h create mode 120000 src/opendirectory/include/opendirectory/ServerControl.h create mode 120000 src/opendirectory/include/opendirectory/od_passthru.h create mode 120000 src/opendirectory/include/opendirectory/rb.h diff --git a/src/external/DirectoryService b/src/external/DirectoryService index 164c5fa63..feb9742f5 160000 --- a/src/external/DirectoryService +++ b/src/external/DirectoryService @@ -1 +1 @@ -Subproject commit 164c5fa63935244e43eb3570cf374926a54f062e +Subproject commit feb9742f574ab812a210634fd3997f19b645095f diff --git a/src/external/libxpc b/src/external/libxpc index 801e57848..d3dcb32ff 160000 --- a/src/external/libxpc +++ b/src/external/libxpc @@ -1 +1 @@ -Subproject commit 801e57848ee7d26b9abf1861ba892e460eb75277 +Subproject commit d3dcb32fffdce4e067674f88ba336d1577e00a16 diff --git a/src/libinfo/CMakeLists.txt b/src/libinfo/CMakeLists.txt index a826279a2..3cf9858c6 100644 --- a/src/libinfo/CMakeLists.txt +++ b/src/libinfo/CMakeLists.txt @@ -15,6 +15,8 @@ add_definitions(-DHAVE_STDINT_H=1) add_definitions(-D__APPLE__ -D__DYNAMIC__) add_definitions(-D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=1080) +add_definitions(-DDS_AVAILABLE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdinc -D__DARWIN_UNIX03 -fPIC -ggdb") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -nostdlib") @@ -67,9 +69,11 @@ add_circular(system_info FAT system_pthread libdispatch_shared system_notify + system_asl platform xpc compiler_rt + launch DEPENDENCIES resolv-darwin ) diff --git a/src/opendirectory/include/opendirectory/CAuditUtils.h b/src/opendirectory/include/opendirectory/CAuditUtils.h new file mode 120000 index 000000000..766710c11 --- /dev/null +++ b/src/opendirectory/include/opendirectory/CAuditUtils.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/CAuditUtils.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/CHandlers.h b/src/opendirectory/include/opendirectory/CHandlers.h new file mode 120000 index 000000000..77bcc3698 --- /dev/null +++ b/src/opendirectory/include/opendirectory/CHandlers.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/CHandlers.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/CInternalDispatch.h b/src/opendirectory/include/opendirectory/CInternalDispatch.h new file mode 120000 index 000000000..af89fdfc4 --- /dev/null +++ b/src/opendirectory/include/opendirectory/CInternalDispatch.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/CInternalDispatch.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/CLauncher.h b/src/opendirectory/include/opendirectory/CLauncher.h new file mode 120000 index 000000000..60dbb889d --- /dev/null +++ b/src/opendirectory/include/opendirectory/CLauncher.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/CLauncher.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/CNodeList.h b/src/opendirectory/include/opendirectory/CNodeList.h new file mode 120000 index 000000000..7224b16bb --- /dev/null +++ b/src/opendirectory/include/opendirectory/CNodeList.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/CNodeList.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/CPlugInList.h b/src/opendirectory/include/opendirectory/CPlugInList.h new file mode 120000 index 000000000..3bb8b9612 --- /dev/null +++ b/src/opendirectory/include/opendirectory/CPlugInList.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/CPlugInList.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/CPluginConfig.h b/src/opendirectory/include/opendirectory/CPluginConfig.h new file mode 120000 index 000000000..efa9e1393 --- /dev/null +++ b/src/opendirectory/include/opendirectory/CPluginConfig.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/CPluginConfig.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/CPluginHandler.h b/src/opendirectory/include/opendirectory/CPluginHandler.h new file mode 120000 index 000000000..9a8e75c01 --- /dev/null +++ b/src/opendirectory/include/opendirectory/CPluginHandler.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/CPluginHandler.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/CRefTable.h b/src/opendirectory/include/opendirectory/CRefTable.h new file mode 120000 index 000000000..6858c2c5a --- /dev/null +++ b/src/opendirectory/include/opendirectory/CRefTable.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/CRefTable.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/CServerPlugin.h b/src/opendirectory/include/opendirectory/CServerPlugin.h new file mode 120000 index 000000000..a7b9e6492 --- /dev/null +++ b/src/opendirectory/include/opendirectory/CServerPlugin.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/CServerPlugin.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/CSrvrMessaging.h b/src/opendirectory/include/opendirectory/CSrvrMessaging.h new file mode 120000 index 000000000..9e355fef0 --- /dev/null +++ b/src/opendirectory/include/opendirectory/CSrvrMessaging.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/CSrvrMessaging.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/DSMachEndian.h b/src/opendirectory/include/opendirectory/DSMachEndian.h new file mode 120000 index 000000000..accee7e2d --- /dev/null +++ b/src/opendirectory/include/opendirectory/DSMachEndian.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/DSMachEndian.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/DSSwapUtils.h b/src/opendirectory/include/opendirectory/DSSwapUtils.h new file mode 120000 index 000000000..79640e9a3 --- /dev/null +++ b/src/opendirectory/include/opendirectory/DSSwapUtils.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/DSSwapUtils.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/DSlibinfoMIG_types.h b/src/opendirectory/include/opendirectory/DSlibinfoMIG_types.h new file mode 120000 index 000000000..51d9cc77b --- /dev/null +++ b/src/opendirectory/include/opendirectory/DSlibinfoMIG_types.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/DSlibinfoMIG_types.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/DSmemberdMIG_types.h b/src/opendirectory/include/opendirectory/DSmemberdMIG_types.h new file mode 120000 index 000000000..cd9bca84a --- /dev/null +++ b/src/opendirectory/include/opendirectory/DSmemberdMIG_types.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/DSmemberdMIG_types.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/DirServiceMain.h b/src/opendirectory/include/opendirectory/DirServiceMain.h new file mode 120000 index 000000000..19708da59 --- /dev/null +++ b/src/opendirectory/include/opendirectory/DirServiceMain.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/DirServiceMain.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/DirectoryService b/src/opendirectory/include/opendirectory/DirectoryService new file mode 120000 index 000000000..1a00fb70e --- /dev/null +++ b/src/opendirectory/include/opendirectory/DirectoryService @@ -0,0 +1 @@ +../../../external/DirectoryService/include/DirectoryService \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/Mbrd_Cache.h b/src/opendirectory/include/opendirectory/Mbrd_Cache.h new file mode 120000 index 000000000..2f8a2186d --- /dev/null +++ b/src/opendirectory/include/opendirectory/Mbrd_Cache.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/Mbrd_Cache.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/Mbrd_HashTable.h b/src/opendirectory/include/opendirectory/Mbrd_HashTable.h new file mode 120000 index 000000000..92e6ac3c2 --- /dev/null +++ b/src/opendirectory/include/opendirectory/Mbrd_HashTable.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/Mbrd_HashTable.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/Mbrd_MembershipResolver.h b/src/opendirectory/include/opendirectory/Mbrd_MembershipResolver.h new file mode 120000 index 000000000..054c04089 --- /dev/null +++ b/src/opendirectory/include/opendirectory/Mbrd_MembershipResolver.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/Mbrd_MembershipResolver.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/Mbrd_UserGroup.h b/src/opendirectory/include/opendirectory/Mbrd_UserGroup.h new file mode 120000 index 000000000..12fcf9cb2 --- /dev/null +++ b/src/opendirectory/include/opendirectory/Mbrd_UserGroup.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/Mbrd_UserGroup.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/ServerControl.h b/src/opendirectory/include/opendirectory/ServerControl.h new file mode 120000 index 000000000..639ec3fac --- /dev/null +++ b/src/opendirectory/include/opendirectory/ServerControl.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/ServerControl.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/od_passthru.h b/src/opendirectory/include/opendirectory/od_passthru.h new file mode 120000 index 000000000..52920cbfa --- /dev/null +++ b/src/opendirectory/include/opendirectory/od_passthru.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/od_passthru.h \ No newline at end of file diff --git a/src/opendirectory/include/opendirectory/odipc.h b/src/opendirectory/include/opendirectory/odipc.h index 3b1a7fbf3..59ba58a87 100644 --- a/src/opendirectory/include/opendirectory/odipc.h +++ b/src/opendirectory/include/opendirectory/odipc.h @@ -1,7 +1,15 @@ #ifndef _OD_ODIPC_H_ #define _OD_ODIPC_H_ -#define kODMachMembershipPortNameDebug 1 -#define kODMachMembershipPortName 1 +#define kODMachMembershipPortNameDebug 401 +#define kODMachMembershipPortName 400 + +#define kODMachLibinfoPortName 500 +#define kODMachLibinfoPortNameDebug 501 + +#define OD_RPC_NAME "rpc_name" +#define OD_RPC_VERSION "rpc_version" +#define OD_RPC_RESULT "rpc_result" +#define OD_RPC_ERROR "rpc_error" #endif diff --git a/src/opendirectory/include/opendirectory/rb.h b/src/opendirectory/include/opendirectory/rb.h new file mode 120000 index 000000000..d224d1b9f --- /dev/null +++ b/src/opendirectory/include/opendirectory/rb.h @@ -0,0 +1 @@ +../../../external/DirectoryService/include/rb.h \ No newline at end of file