aboutsummaryrefslogtreecommitdiffstats
path: root/NEWS
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2014-10-23 00:23:12 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2014-10-23 00:37:22 +0200
commit9da52289488329a59123d27dfc90f7b03801e89f (patch)
tree72f5c5e83c916eb992d1d4ac095232f6ba321526 /NEWS
parent0f122c39101955dc584fe8e0dacfed17dfc7c831 (diff)
downloadperl-URPM-9da52289488329a59123d27dfc90f7b03801e89f.tar
perl-URPM-9da52289488329a59123d27dfc90f7b03801e89f.tar.gz
perl-URPM-9da52289488329a59123d27dfc90f7b03801e89f.tar.bz2
perl-URPM-9da52289488329a59123d27dfc90f7b03801e89f.tar.xz
perl-URPM-9da52289488329a59123d27dfc90f7b03801e89f.zip
fix crashing in ptread when using log callback with rpm-4.12
fix by Panu Matilainen When rpmlog() occurs, it now grabs a read/write lock on the log context depending on whether it needs to save the log or not. The callback executes while the context lock is held, so when one call rpmlogMessage() or pretty much any rpmlog-related function from the callback, it'll try to lock the context again. Which is okay as long as rpmlog() only needed a read-lock on the context. However if it has a write-lock then attempting to grab a read-lock for rpmlogMessage() fails, but due to the largely missing error handling in rpmlog.c it falls through to crash and burn. The only reason we need to call rpmlogMessage() is that the callback does not match the callback function type in rpm >= 4.6: typedef int (*rpmlogCallback) (rpmlogRec rec, rpmlogCallbackData data); We shouldn't call that from log callback. We can avoid the issue by using rpmlogRecMessage() instead of rpmlogMessage() inside the callback. These are not the same, rpmlogRecMessage() returns the message of the *current* log event, whereas rpmlogMessage() returns the last *saved* log event. Which might not exist, might be from an earlier event or it might be the current event. ...and it'll not only work in all rpm >= 4.6 versions, but also give the actual log message at hand, instead of something that might have happened in the past.
Diffstat (limited to 'NEWS')
-rw-r--r--NEWS2
1 files changed, 2 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 9028bb4..9b687d1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- fix crashing in ptread when using log callback with rpm-4.12
+
Version 5.00 - 12 September 2014
- make it compatible with rpm-4.12.0