diff --git a/CMakeLists.txt b/CMakeLists.txt index 4db08b9..4b14dd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/) # now build our various libraries, agents, binaries. # DO NOT ALTER (SO)VERSION ON LIBRARIES WITHOUT ASKING! -foreach (LIBRARY xpl streamio msgapi connio util json cal nmap) +foreach (LIBRARY xpl streamio msgapi connio util json cal) add_subdirectory (src/libs/${LIBRARY}) set_target_properties(bongo${LIBRARY} PROPERTIES SOVERSION 0 diff --git a/src/agents/imap/CMakeLists.txt b/src/agents/imap/CMakeLists.txt index eaac244..d2bb5e2 100644 --- a/src/agents/imap/CMakeLists.txt +++ b/src/agents/imap/CMakeLists.txt @@ -17,6 +17,7 @@ target_link_libraries(bongoimap bongoutil bongojson bongomsgapi + bongostreamio ) install(TARGETS bongoimap DESTINATION ${SBIN_INSTALL_DIR}) diff --git a/src/agents/store/CMakeLists.txt b/src/agents/store/CMakeLists.txt index 801f5c5..983609d 100644 --- a/src/agents/store/CMakeLists.txt +++ b/src/agents/store/CMakeLists.txt @@ -29,6 +29,7 @@ add_executable(bongostore watch.c) target_link_libraries(bongostore + bongostreamio bongoxpl bongoconnio bongoutil diff --git a/src/apps/config/CMakeLists.txt b/src/apps/config/CMakeLists.txt index d045b33..a52a72e 100644 --- a/src/apps/config/CMakeLists.txt +++ b/src/apps/config/CMakeLists.txt @@ -4,7 +4,7 @@ add_executable(bongo-config ) target_link_libraries(bongo-config - bongonmap + bongoconnio bongomsgapi bongojson bongoutil diff --git a/src/apps/manager/CMakeLists.txt b/src/apps/manager/CMakeLists.txt index 702de5a..aed7379 100644 --- a/src/apps/manager/CMakeLists.txt +++ b/src/apps/manager/CMakeLists.txt @@ -3,7 +3,7 @@ add_executable(bongo-manager ) target_link_libraries(bongo-manager - bongonmap + bongoconnio bongomsgapi bongojson bongoutil diff --git a/src/apps/testtool/CMakeLists.txt b/src/apps/testtool/CMakeLists.txt index d55ac1f..622afed 100644 --- a/src/apps/testtool/CMakeLists.txt +++ b/src/apps/testtool/CMakeLists.txt @@ -3,7 +3,7 @@ add_executable(bongo-testtool ) target_link_libraries(bongo-testtool - bongonmap + bongoconnio bongomsgapi bongojson bongoutil diff --git a/src/libs/connio/CMakeLists.txt b/src/libs/connio/CMakeLists.txt index c56f821..1178745 100644 --- a/src/libs/connio/CMakeLists.txt +++ b/src/libs/connio/CMakeLists.txt @@ -1,4 +1,4 @@ -StrictCompile() +#StrictCompile() add_library(bongoconnio SHARED sockets.c @@ -6,6 +6,7 @@ add_library(bongoconnio SHARED trace.c addrpool.c unix-ip.c + nmap.c ) target_link_libraries(bongoconnio diff --git a/src/libs/nmap/mime.c b/src/libs/connio/mime.c similarity index 100% rename from src/libs/nmap/mime.c rename to src/libs/connio/mime.c diff --git a/src/libs/nmap/nmap.c b/src/libs/connio/nmap.c similarity index 100% rename from src/libs/nmap/nmap.c rename to src/libs/connio/nmap.c diff --git a/src/libs/msgapi/CMakeLists.txt b/src/libs/msgapi/CMakeLists.txt index 77e6127..14a4182 100644 --- a/src/libs/msgapi/CMakeLists.txt +++ b/src/libs/msgapi/CMakeLists.txt @@ -13,7 +13,6 @@ add_library(bongomsgapi SHARED target_link_libraries(bongomsgapi bongoxpl - bongonmap bongocal bongojson ${SQLITE_LIBRARIES} diff --git a/src/libs/nmap/CMakeLists.txt b/src/libs/nmap/CMakeLists.txt deleted file mode 100644 index 45e4daf..0000000 --- a/src/libs/nmap/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -#StrictCompile() - -add_library(bongonmap SHARED - bongoagent.c - nmap.c - hashcred.c - mime.c) - -target_link_libraries(bongonmap - bongoconnio - bongoxpl - bongojson - bongostreamio - ${GNUTLS_LIBRARIES} - ${GCRYPT_LIBRARIES} - ${PTHREAD_LIBRARIES} - ) - -install(TARGETS bongonmap DESTINATION ${LIB_INSTALL_DIR}) diff --git a/src/libs/nmap/hashcred.c b/src/libs/nmap/hashcred.c deleted file mode 100644 index 08f3e60..0000000 --- a/src/libs/nmap/hashcred.c +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2001 Novell, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public License - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, contact Novell, Inc. - * - * To contact Novell about this file by physical or electronic mail, you - * may find current contact information at www.novell.com. - * - ****************************************************************************/ - -#if 0 -#include -#include -#include -#include -#include - -#define ORGANIZATION_BUFFER_SIZE 100 - -#define NMAP_CRED_STORE_SIZE 4096 -#define NMAP_CRED_DIGEST_SIZE 16 -#define NMAP_CRED_CHUNK_SIZE (NMAP_CRED_STORE_SIZE * NMAP_CRED_DIGEST_SIZE) / NMAP_HASH_SIZE - -static BOOL -GetOrgName(unsigned char *Organization) -{ - unsigned long len; - unsigned char *ptr; - unsigned char *buffer; - - /* get the treename */ - buffer = MemStrdup(MsgGetServerDN(NULL)); - if (buffer) { - if (buffer[0] == '\\') { - ptr = strchr(buffer + 1, '\\'); - if (ptr) { - len = ptr - (buffer + 1); - if (len > 0) { - if (len < ORGANIZATION_BUFFER_SIZE) { - *ptr = '\0'; - strcpy(Organization, buffer + 1); - *ptr = '\\'; - } else { - memcpy(Organization, buffer + 1, ORGANIZATION_BUFFER_SIZE); - Organization[ORGANIZATION_BUFFER_SIZE] = '\0'; - } - MemFree(buffer); - return(TRUE); - } - } - } - - MemFree(buffer); - } - - return(FALSE); -} - -BOOL -HashCredential(unsigned char *Credential, unsigned char *Hash) -{ - unsigned char organization[ORGANIZATION_BUFFER_SIZE + 1]; - unsigned char *ptr; - unsigned long organizationLen; - unsigned long len; - - if (Hash && Credential) { - len = strlen(Credential); - if (GetOrgName(organization)) { - organizationLen = strlen(organization); - if (len >= NMAP_CRED_STORE_SIZE) { - unsigned long i; - MD5_CTX mdContext; - unsigned char digest[NMAP_CRED_DIGEST_SIZE]; - unsigned char *srcPtr; - unsigned char *dstPtr; - unsigned char *dstEnd; - - srcPtr = Credential; - dstPtr = Hash; - dstEnd = Hash + NMAP_HASH_SIZE; - - MD5_Init(&mdContext); - MD5_Update(&mdContext, srcPtr, NMAP_CRED_CHUNK_SIZE); - MD5_Update(&mdContext, organization, organizationLen); - MD5_Final(digest, &mdContext); - - srcPtr += NMAP_CRED_CHUNK_SIZE; - - for (i = 0; i < NMAP_CRED_DIGEST_SIZE; i++) { - if (dstPtr < dstEnd) { - *dstPtr = digest[i]; - dstPtr++; - } - } - - do { - MD5_Init(&mdContext); - MD5_Update(&mdContext, srcPtr, NMAP_CRED_CHUNK_SIZE); - MD5_Update(&mdContext, Hash, dstPtr - Hash); - MD5_Final(digest, &mdContext); - - srcPtr += NMAP_CRED_CHUNK_SIZE; - - for (i = 0; i < NMAP_CRED_DIGEST_SIZE; i++) { - if (dstPtr < dstEnd) { - *dstPtr = digest[i]; - dstPtr++; - } - } - } while (dstPtr < dstEnd); - - /* Hash now contains a non-terminated 128 byte octet string */ - return(TRUE); - } - - XplConsolePrintf("\rNMAP credentials are not properly configured!\r\n"); - return(FALSE); - } - - XplConsolePrintf("\Bongo can not determine what organization it is running on.\r\n"); - return(FALSE); - } - return(FALSE); -} -#endif diff --git a/src/libs/python/libbongo/CMakeLists.txt b/src/libs/python/libbongo/CMakeLists.txt index cb78dc9..494c233 100644 --- a/src/libs/python/libbongo/CMakeLists.txt +++ b/src/libs/python/libbongo/CMakeLists.txt @@ -26,7 +26,6 @@ set_target_properties(libs bootstrap ) target_link_libraries(libs - bongonmap bongomsgapi bongojson bongoutil diff --git a/src/libs/util/CMakeLists.txt b/src/libs/util/CMakeLists.txt index efcc2f4..8c35016 100644 --- a/src/libs/util/CMakeLists.txt +++ b/src/libs/util/CMakeLists.txt @@ -12,6 +12,7 @@ add_library(bongoutil SHARED quicksort.c utf7mod.c logging.c + bongoagent.c bongoutil.c) target_link_libraries(bongoutil diff --git a/src/libs/nmap/bongoagent.c b/src/libs/util/bongoagent.c similarity index 100% rename from src/libs/nmap/bongoagent.c rename to src/libs/util/bongoagent.c