diff --git a/CHANGELOG.md b/CHANGELOG.md index 973e15ea0..8864aed5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Stop current scheduling of task when permission denied [#1058](https://github.com/greenbone/gvmd/pull/1058) - Trim malloc heap after updating cache [#1085](https://github.com/greenbone/gvmd/pull/1085) - Handle QUEUED osp scan status. [#1113](https://github.com/greenbone/gvmd/pull/1113) +- Add time placeholders for SCP path [#1164](https://github.com/greenbone/gvmd/pull/1164) ### Changed - Update SCAP and CERT feed info in sync scripts [#810](https://github.com/greenbone/gvmd/pull/810) diff --git a/src/manage_sql.c b/src/manage_sql.c index b56decd87..d332b6bda 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -11416,6 +11416,32 @@ scp_alert_path_print (const gchar *message, task_t task) case '$': g_string_append_c (new_message, '$'); break; + case 'D': + case 'T': + { + char time_string[9]; + time_t current_time; + struct tm *tm; + const gchar *format_str; + + if (*point == 'T') + format_str = "%H%M%S"; + else + format_str = "%Y%m%d"; + + memset(&time_string, 0, 9); + current_time = time (NULL); + tm = localtime (¤t_time); + if (tm == NULL) + { + g_warning ("%s: localtime failed, aborting", + __func__); + abort (); + } + if (strftime (time_string, 9, format_str, tm)) + g_string_append (new_message, time_string); + break; + } case 'n': if (task) {