mirror of https://git.tukaani.org/xz.git
xzdec: Call tuklib_progname_init() early enough
If the early pledge() call on OpenBSD fails, it calls my_errorf()
which requires the "progname" variable.
Fixes: d74fb5f060
This commit is contained in:
parent
61feaf681b
commit
4e936f2340
|
@ -391,6 +391,9 @@ error:
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
// Initialize progname which we will be used in error messages.
|
||||||
|
tuklib_progname_init(argv);
|
||||||
|
|
||||||
#ifdef HAVE_PLEDGE
|
#ifdef HAVE_PLEDGE
|
||||||
// OpenBSD's pledge(2) sandbox.
|
// OpenBSD's pledge(2) sandbox.
|
||||||
// Initially enable the sandbox slightly more relaxed so that
|
// Initially enable the sandbox slightly more relaxed so that
|
||||||
|
@ -416,9 +419,6 @@ main(int argc, char **argv)
|
||||||
(void)prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
|
(void)prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Initialize progname which we will be used in error messages.
|
|
||||||
tuklib_progname_init(argv);
|
|
||||||
|
|
||||||
// Parse the command line options.
|
// Parse the command line options.
|
||||||
parse_options(argc, argv);
|
parse_options(argc, argv);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue