Konstantin Belousov 630caa95d4 rtld: preserve the 'seen' state of the dlerror message in errmsg_save()
rtld preserves its current error message around calls to user init/fini
lists, to not override original error with potential secondary errors
caused by user code recursing into rtld.  After 4d9128da54f8f8e2a29190,
the preservation of the string itself is not enough, the 'seen'
indicator must be preserved as well.  Otherwise, since new code does not
clear string (it cannot), call to _rtld_error() from errmsg_restore()
revived whatever message was consumed last.

Change errmsg_save() to return structure recording both 'seen' indicator
and the message, if any.

PR:	255698
Reported by:	Eugene M. Kim <astralblue@gmail.com>
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2021-05-11 02:47:00 +03:00
..
2020-09-11 13:28:37 +00:00
2019-12-11 17:37:53 +00:00
2020-09-09 00:39:47 +00:00
2018-03-05 16:11:07 +00:00
2019-11-12 22:31:59 +00:00
2017-10-31 00:07:04 +00:00
2019-12-04 16:56:11 +00:00
2017-10-31 00:07:04 +00:00
2019-12-11 17:37:53 +00:00
2021-04-10 11:16:02 +02:00
2020-04-06 23:16:05 +00:00
2020-09-09 00:39:47 +00:00