Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwrite install.log instead of appending to it #1706

Merged
merged 2 commits into from
May 5, 2020
Merged

Conversation

dlon
Copy link
Member

@dlon dlon commented May 4, 2020

Some sensitive information used to be logged here. This was fixed in #1521. But it could still end up in problem reports since updating the app only appended to the existing log. Fix by overwriting the file.


This change is Reviewable

Copy link
Contributor

@mvd-ows mvd-ows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


windows/nsis-plugins/src/log/log.cpp, line 240 at r1 (raw file):

				const auto logfile = decltype(logpath)(logpath).append(L"install.log");

				g_logger = new Logger(std::make_unique<Utf8FileLogSink>(logfile, false));

I think it was I that added the optional argument? A better solution for modeling this is to use an enum, even when there are only two possible values.

Because then, the code at the call site is immensely more readable.


windows/nsis-plugins/src/log/logger.cpp, line 29 at r1 (raw file):

		if (FALSE == seekStatus)
		{
			CloseHandle(m_logfile);

Good catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants