Skip to content

Improve FTL's file comparsion algorithm#1785

Merged
DL6ER merged 1 commit into
development-v6from
fix/files_different
Dec 1, 2023
Merged

Improve FTL's file comparsion algorithm#1785
DL6ER merged 1 commit into
development-v6from
fix/files_different

Conversation

@DL6ER

@DL6ER DL6ER commented Nov 27, 2023

Copy link
Copy Markdown
Member

What does this implement/fix?

Fix file comparison and add more debug logging during file comparison. So far, this should not have any negative consequences as all files we apply this function on will always differ somewhere before the end of the files when they are different (custom.list has the total number of lines on the end, dnsmasq.conf and pihole.toml have no multi-line options at the end).

Related issue or feature (if applicable): N/A

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

…le comparison (debug.config)

Signed-off-by: DL6ER <dl6er@dl6er.de>
@pralor-bot

Copy link
Copy Markdown

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/local-dns-records-not-resolving/66521/14

@DL6ER DL6ER marked this pull request as ready for review November 27, 2023 13:54
@DL6ER DL6ER requested a review from a team November 27, 2023 13:54
@DL6ER

DL6ER commented Nov 27, 2023

Copy link
Copy Markdown
Member Author

Bugfix confirmed working by OP on Discourse. The key issue we solve here was that file_different() had a small bug that did not detect if one of the files we compare to is completely empty.

Comment thread src/files.c
@DL6ER DL6ER merged commit 2db9776 into development-v6 Dec 1, 2023
@DL6ER DL6ER deleted the fix/files_different branch December 1, 2023 06:50
@PromoFaux PromoFaux mentioned this pull request Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants