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

Add time placeholders for SCP path #1164

Merged
merged 3 commits into from
Jun 30, 2020
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
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