diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-09-09 13:10:10 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-09-12 18:05:17 +0200 |
commit | 76980a2226278eca1c0b31224ae7bdce59d5eabb (patch) | |
tree | dc2b762e93e3905b66ec213357bb42357e9376ea /SECURITY.md | |
parent | 138b09c7e28de336717191ec79c0b0bdf61b448a (diff) | |
download | podman-76980a2226278eca1c0b31224ae7bdce59d5eabb.tar.gz podman-76980a2226278eca1c0b31224ae7bdce59d5eabb.tar.bz2 podman-76980a2226278eca1c0b31224ae7bdce59d5eabb.zip |
event backend journald: fix problem with empty journal
Currently podman events will just fail with `Error: failed to get journal
cursor: failed to get cursor: cannot assign requested address` when the
journal contains zero podman events.
The problem is that we are using the journal accessors wrong. There is no
need to call GetCursor() and compare them manually. The Next() return an
integer which tells if it moved to the next or not. This means the we can
remove GetCursor() which would fail when there is no entry.
This also includes another bug fix. Previously the logic called Next()
twice for the first entry which caused us to miss the first entry.
To reproduce this issue you can run the following commands:
```
sudo journalctl --rotate
sudo journalctl --vacuum-time=1s
```
Note that this will delete the full journal.
Now run podman events and it fails but with this patch it works.
Now generate a single event, i.e. podman pull alpine, and run
podman events --until 1s.
I am not sure how to get a reliable test into CI, I really do not want
to delete the journal and developer or CI systems.
Fixes second part of #15688
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'SECURITY.md')
0 files changed, 0 insertions, 0 deletions