-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
treewide: rpcd scripts needs to be executable in git index #7526
Comments
I've compiled ipk's for |
The git index needs the executable permission to be set to correctly register it with ubus. Link: openwrt#7526 Signed-off-by: Daniel Nilsson <[email protected]>
The git index needs the executable permission on RPC scripts to correctly register them with ubus. Link: openwrt#7526 Signed-off-by: Daniel Nilsson <[email protected]>
Which options do we have?
The last would be great but violates a single responsibility principle. I think the 1 should be enough. |
The git index needs the executable permission on RPC scripts to correctly register them with ubus. Link: #7526 Signed-off-by: Daniel Nilsson <[email protected]>
1 would be good. Ensure that various folders which typically contain |
I also think option 1 would be a good and straightforward way if someone wants to try to implement it, then we can ensure consistency as early as possible. Option 2 could work as a alternative but then you could run into situations where a file is copied directly to the target system from the repo (for example when you do direct changes to a JS file via scp/rsync/sshfs or whatever) without going through the build system, which wouldn't solve the inconsistency problem as mentioned earlier. I can add that this is actually documented in https://openwrt.org/docs/techref/rpcd#plugin_executables near the end of the example where it makes the file executable, so it's at least a known and documented behavior (which makes sense 'cause if the RPC script isn't set as executable how could ubus invoke it?) and we should try to check for it nonetheless. |
|
3 sounds like a nicely prepared step in an attack vector. Good xz points for you. 2 looks like the simple solution that would cover the normal use. Simplest would be to add a section to luci.mk for root/user/libexec/rpcd/ to copy files and use the INSTALL_BIN macro. If the section is right after the normal root section copy, the files would get copied twice, but the latter action would ensure chmod. Lines 216 to 219 in ab1bf13
|
Is there an existing issue for this?
screenshots or captures
Tagging some of the currently most active developers in the repo for discussion.
@systemcrash @stokito @Ramon00 @rdmitry0911 @stangri
Spawned from https://forum.openwrt.org/t/openwrt-24-10-0-rc4-fourth-release-candidate/219368/142?u=dannil
It seems that all apps which doesn't have it's respective RPC scripts set with the executable mask, which at the moment is
luci-app-olsr-viz
andluci-app-squid
, isn't able to register with ubus and therefore crashes in the UI with the very non-descriptive errorRPC call to <name of RPC object> failed with error -32000: Object not found
This makes sense cause if you invoke the RPC script directly on the command line it also fails
If you then invoke
chmod +x /usr/libexec/rpcd/luci.squid
followed byservice rpcd restart
, theObject not found
error will be gone.The affected apps were found with the following command
I have a hunch that this is one of the causes for some of the historical issues when users have been faced with unsuspected
Object not found
errors even when the RPC script file is located in the correct directory.Also, this may be hard to discover during development since you may have inconsistent file masks between the SCP'd/rsync'ed file on your development environment versus the git index. I'm thinking mainly of Windows here where this is a big issue since you can't even set umasks there unless in Git Bash/WSL or using
git update-index
. In some cases the umask isn't even preserved when you copy it to your development environment depending on parameters/tool (for exampIe, I don't think SCP preserves it unless you pass the -p option), then anything goes.This is an invitation to discuss how to handle this going forward, because it'll definitely happen again. I personally would've expected the
postinst
step to automatically handle this but obviously that isn't how it works.Actual behaviour
Some apps with RPC scripts crashes/throws warnings.
Expected behaviour
All apps with RPC scripts should be usable.
Steps to reproduce
Additional Information
What browsers do you see the problem on?
Firefox, Chrome, Safari, Microsoft Edge
Relevant log output
No response
The text was updated successfully, but these errors were encountered: