diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-02-15 11:22:03 +0100 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2021-02-15 11:22:03 +0100 |
commit | 74d49fd1921f44f1e42c3ecf442cbf720dcd98af (patch) | |
tree | fa7a4a039911b18880194d74840e23afabba24ec /src/db | |
parent | 1bca3619cae56260faea6cfbc173d0939dc587ee (diff) |
Fix: Remove zero-bytes from script/log before inserting into database
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/models/job.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/db/models/job.rs b/src/db/models/job.rs index de88a0f..de91a25 100644 --- a/src/db/models/job.rs +++ b/src/db/models/job.rs @@ -47,8 +47,8 @@ struct NewJob<'a> { pub package_id: i32, pub image_id: i32, pub container_hash: &'a str, - pub script_text: &'a str, - pub log_text: &'a str, + pub script_text: String, + pub log_text: String, pub uuid: &'a ::uuid::Uuid, } @@ -72,8 +72,8 @@ impl Job { package_id: package.id, image_id: image.id, container_hash: container.as_ref(), - script_text: script.as_ref(), - log_text: log, + script_text: script.as_ref().replace('\0', ""), + log_text: log.replace('\0', ""), }; trace!("Creating Job in database: {:?}", new_job); |