From 610b10bcd5c36b59ab8507475df7722ad8a2a13a Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Wed, 8 Jul 2015 19:01:19 -0300 Subject: [PATCH] Adds ascTime function to utils Further this function will be used by the audit logs. --- src/utils.cc | 7 +++++++ src/utils.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/utils.cc b/src/utils.cc index 47b11dad..658155a1 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -55,5 +55,12 @@ double generate_assay_unique_id() { } +std::string ascTime(time_t *t) { + std::string ts = std::ctime(t); + ts.pop_back(); + return ts; +} + + } // namespace ModSecurity diff --git a/src/utils.h b/src/utils.h index cdf00ef0..b68538cc 100644 --- a/src/utils.h +++ b/src/utils.h @@ -26,6 +26,7 @@ namespace ModSecurity { std::vector split(std::string str, char delimiter); double random_number(const double from, const double to); double generate_assay_unique_id(); + std::string ascTime(time_t *t); } // namespace ModSecurity #define SRC_UTILS_H_