Skip to content

webui: allow saving the firewall IP list with a trailing line break - #84

Merged
jens-maus merged 1 commit into
mainfrom
jens-maus/migrate-0102-webui-firewall-ip-trailing-newline
Sep 30, 2026
Merged

jens-maus merged 1 commit into
mainfrom
jens-maus/migrate-0102-webui-firewall-ip-trailing-newline

Conversation

@jens-maus

@jens-maus jens-maus commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Original OpenCCU rootfs patch: 0102
Original filename: 0102-WebUI-Fix-TrailingNewLineInFirewallIPTextarea.patch
Original patch: ''https://github.com/OpenCCU/OpenCCU/blob/7736adbdbe91d3e64ee678af07e86800c1b8a865/buildroot-external/package/openccu-base/rootfs-patches/0102-WebUI-Fix-TrailingNewLineInFirewallIPTextarea.patch''
Original issue: OpenCCU/OpenCCU#1036 (fixed by OpenCCU/OpenCCU#1038)

When the firewall configuration dialog is saved, ok() in src/webui/www_source/webui/js/dialog/firewallconfigdialog.js first strips a trailing ; from the list of allowed IP addresses, then removes all whitespace and splits the list at ;. If the list ends with ; followed by a line break, the ; is not the last character and is kept. The split then produces an empty last entry, which fails isIPAddressValid(), and the configuration cannot be saved. This trims the text before it is processed.

The file's ISO-8859-1 encoding and CRLF line endings are preserved. It is part of the generated www/webui/webui.js.

32 earlier OpenCCU rootfs patches also modify the generated www/webui/webui.js. None of their hunks covers this line, and the line count is unchanged, so they all still apply unchanged.

Validation

  • OpenCCU scripts/base-patch-migration.py validate with the canonical Buildroot 2026.08 git4 archive of this branch (d849b206, sha256 efd58b4df54d8b29ebe0e079e429c40d11d134b031ad70047c16dc682dd2aa22) and --skip-patch 0102: PASS (the other 119 rootfs patches apply with zero fuzz).
  • compare against the current pin baseline (c827595e, all 120 patches): IDENTICAL (4668 entries).

OpenCCU cleanup PR (patch removal, pin and archive hash update): OpenCCU/OpenCCU#4282

The firewall configuration dialog strips a trailing ";" from the list
of allowed IP addresses before it removes all whitespace and splits
the list. If the list ends with ";" followed by a line break, the ";"
is not the last character, so it is kept. The split then produces an
empty last entry, which fails the IP address validation, and the
configuration cannot be saved. Trim the text first.

This natively replaces OpenCCU rootfs patch
0102-WebUI-Fix-TrailingNewLineInFirewallIPTextarea.patch.
@coderabbitai

coderabbitai Bot commented Sep 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 153570d1-df4f-41cc-9d7f-7d067ceaf6f4

📥 Commits

Reviewing files that changed from the base of the PR and between c827595 and d849b20.

📒 Files selected for processing (1)
  • src/webui/www_source/webui/js/dialog/firewallconfigdialog.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jens-maus
jens-maus merged commit 092ffdf into main Sep 30, 2026
5 checks passed
@jens-maus
jens-maus deleted the jens-maus/migrate-0102-webui-firewall-ip-trailing-newline branch September 30, 2026 12:13
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.

1 participant