Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to configure the path to the redis socket #256

Merged
merged 2 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]

### Added
- Allow to configure the path to the redis socket via CMake [#256](https://github.com/greenbone/gvm-libs/pull/256)
- A new data model for unified handling of cross references in the NVT meta data as been added. All previous API elements to handle cve, bid, xref werehas been removed. [#225](https://github.com/greenbone/gvm-libs/pull/225) [#232](https://github.com/greenbone/gvm-libs/pull/232).

### Changed
- Change the default path to the redis socket to /run/redis/redis.sock [#256](https://github.com/greenbone/gvm-libs/pull/256)
- Handle EAI_AGAIN in gvm_host_reverse_lookup() IPv6 case and function refactor. [#229](https://github.com/greenbone/gvm-libs/pull/229)
- Prevent g_strsplit to be called with NULL. [#238](https://github.com/greenbone/gvm-libs/pull/238)

Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ if (NOT GVM_SYSCONF_DIR)
set (GVM_SYSCONF_DIR "${SYSCONFDIR}/gvm")
endif (NOT GVM_SYSCONF_DIR)


if (NOT REDIS_SOCKET_PATH)
set (REDIS_SOCKET_PATH "/run/redis/redis.sock")
endif ()

add_definitions (-DREDIS_SOCKET_PATH="${REDIS_SOCKET_PATH}")
message ("-- Using redis socket ${REDIS_SOCKET_PATH}")

message ("-- Install prefix: ${CMAKE_INSTALL_PREFIX}")

if (ENABLE_COVERAGE)
Expand Down
6 changes: 5 additions & 1 deletion util/kb.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
/**
* @brief Default KB location.
*/
#define KB_PATH_DEFAULT "/tmp/redis.sock"
#ifdef REDIS_SOCKET_PATH
#define KB_PATH_DEFAULT REDIS_SOCKET_PATH
#else
#define KB_PATH_DEFAULT "/run/redis/redis.sock"
#endif

/**
* @brief Possible type of a kb_item.
Expand Down