-
Notifications
You must be signed in to change notification settings - Fork 2.9k
luci-mod-system: permit sysupgrade --create-backup over rpcd #8947
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
Open
JuliusBairaktaris
wants to merge
2
commits into
openwrt:master
Choose a base branch
from
JuliusBairaktaris:backup-create-acl
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5
−2
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ACL string itself looks right: rpcd checks the bare executable first and then
executable + " " + each paramjoined with spaces (rpc_file_exec_run()file.c:1055-1083), so this is an exact match for today'sexecl("/sbin/sysupgrade", "/sbin/sysupgrade", "--create-backup", "-", NULL)in cgi-io, and thereadsection next to--list-backupis the right home for it.What I can't square is the transport.
--create-backup -emits a gzip stream on stdout, and rpcd'sfile.execcannot carry that payload:rpc_ustream_to_blobmsg()file.c:889-909), so the archive is cut at the first NUL byte;RPC_FILE_MAX_SIZE= 4096 * 64 = 256 KB (file.c:46, file.c:57-59), and filling it aborts the call withUBUS_STATUS_NOT_SUPPORTED(file.c:982-989);That limit is precisely why cgi-io exists in the first place —
fs.exec_direct()docs, fs.js:404-407 describe/cgi-bin/cgi-execas the path for "large command outputs which might exceed the ubus message size limits or which contain binary data", and flash.js:83 posts the backup form straight atcgi-backup.So: does openwrt/cgi-io#6 still spawn and stream the child's stdout to the HTTP client itself, using rpcd only for the privileged spawn / ACL check, or does it go through
ubus call file exec? If the latter, any backup over 256 KB (i.e. most of them) fails outright and smaller ones come back truncated at the first NUL. I couldn't read that PR from here, so this may already be handled — worth stating in the commit message either way, since the ACL grant is the only visible half.The same question applies to the
luci-mod-statushunk in this PR:iptables-save/ip6tables-saveoutput on a large ruleset also runs past 256 KB.Generated by Claude Code