Skip to content

Commit

Permalink
Merge pull request #1164 from timopollmeier/scp-path-placehoders
Browse files Browse the repository at this point in the history
Add time placeholders for SCP path
  • Loading branch information
mattmundell authored Jun 30, 2020
2 parents c895627 + a228096 commit d2437d1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 26 additions & 0 deletions src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 (&current_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)
{
Expand Down

0 comments on commit d2437d1

Please sign in to comment.