-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
mcu: Restart mcu by running executable on host #4204
mcu: Restart mcu by running executable on host #4204
Conversation
Signed-off-by: Maja Stanislawska <[email protected]>
Signed-off-by: Maja Stanislawska <[email protected]>
Thanks, but I'm not sure this is a good candidate for the master Klipper branch. I'm leery of running arbitrary commands from the Klipper config file for two reasons - it could introduce security issues, and arbitrary shell commands can cause strange interactions with the code (eg, reusing file descriptors, causing spurious unix signals, etc.). FYI, I raised a similar concerns in PR #2173. Could you describe the particular use case you had in mind for this support? Perhaps we could find an alternate solution. Cheers, |
Purpose of this is not to run arbitrary command, only one very specific to task of resetting mcu. Only other alternative solution is clutering code,config and documentation with more of "specific" solutions like rpi_reset is already Could you please elaborate on your "security issues" concerns. |
Sorry, forgot that github editor doesnt fix that automagically. Signed-off-by: Maja Stanislawska <[email protected]>
I've got a printer that is connected do RPi via UART (also reset is tied to raspberry's GPIO), and to reset it I have to go to the printer and press physical button on the main board or run script on RPi that toggles that for me. Klipper could easily do it with this PR, so I think its useful. |
Okay, thanks. My high-level feedback is that we should evaluate the best way to restart that code when (and if) it is submitted for inclusion to the master Klipper branch.
It's common for users to cut-and-paste config file snippets from the internet into their config file. I'm leery of adding a direct method to invoke arbitrary unix commands from the config file.
FYI, due to the way Unix handles "close on exec" and "terminal groups", it can cause confusing file descriptor leaks and signals to both calling and called processes - in particular for long running processes.
I understand that you do not agree, and I understand that you would prefer a different outcome. However, my current feedback is that I do not think this is a good candidate for the master Klipper branch. -Kevin |
It probably never will, as it hardly shares anything with klipper codebase besides protocol.
It's also common that people stuff strange things to their anuses,
Yeah, bring more spooky monsters, are we bordering to mansplaining already?
no you dont.
Maja |
pressed wrong button. |
Then please reevaluate restarting UART only boards right now. E.g. AVR board connected directly to RPi UART - which doesn't have flow control pins, so it cannot reset firmware properly.
People also cut and paste |
You can reopen and merge this when you grow up, Kevin. |
Thinking about this a bit and brainstorming some solutions that could work for everyone... if there is a strong concern about safety with users copying/pasting commands or configs with commands, there are a few ways of ensuring this is a non-issue.
None of the above is too complex or difficult in my opinion, and still allow a very reasonable amount of security/safety prevention. It would be very easy for someone to write their own script that adheres to these standards to do their custom logic. I personally would like to setup scripts for custom notification webhooks among other things. On the notes of file descriptors, and similar, I feel this is a non-issue. Klipper should safely handle this anyway (and if it doesn't, that's a concern exclusive of this feature). If anything happens to the resources that are used by klipper in a way that could break klipper, shouldn't klipper emergency shutdown anyway? e.g an error so deep, that klipper crashes? Lastly what I'd like to make sure we don't forget, is that if Klipper doesn't support this, which I totally understand if that's the case, users will find a way around this that is likely more dangerous than what I or others have mentioned above as concerns. E.g. writing their own plugins and throwing them in the Serious thoughts on some of the suggestions? If the webhook thing sounds promising, could open up another PR for that. |
adding this option to config file and providing value of path to a script, which then literally need to writen by themselves is such step. What more you want? doing that at midnight, during full moon, in a made of salt pentagram with candle at corners, barefoot and while chanting some spells??
there is no danger in such functionality only control freak paranoia about it
it is a single command - there is single call to supbrocess, whoever have write access to klipper config is already in position to inflict more damage more direclty than using klipper to do it. and restricting them in klipper can't save neither klipper nor system that is compromised already.
You dont need to pass parameters from klipper and it definitely doesn't need to be done via ENV, "passing agruments" via ENV is not "safer" its more dangerous, because it ads unnecessary complexity and obscurity, and because of life cycleand scope of ENV makes whole thing more prone to human mistakes. this is not only absurd overkill, this actually could be dangerous if whole this ting wasnt just about just restarting mcu
Yet another unnecessary overkill.
No, it doesnt. (try yourself)
Not user, script writer.
No, all this would make whole that paranoia about "security concerns" little more real actually
putting aside that And finally, whole this stuff runs on just Raspberry for god sake, and finally: "Artificial intelligence is not a cure for natural born stupidity".
oddball indeed
this is indeed not an issue, this was randomly thrown and misfired (another) spooky monster,
exactly, (besides that "i totally udnserstand")
it's seriously tough to remain serious in that amount of absurdity and paranoia.
good luck with that. ;-) |
Adding guardrails to prevent people from shooting themselves in the foot is standard practice with almost all widely adopted software. E.g. It makes sense to be precautionary with something that can easily severely damage a printer, catch a persons house on fire, or worse, if someone else decides they want to have malicious intent and share incorrect configurations. That is a indisputable fact. People copy/paste configs without reading through it, and that's something that's hard to prevent. I don't think it makes any sense to allow the config to simply run any command that are defined in them. Yes, configs can be shared today that have incorrect settings, but they're generally not bad enough to have a serious impact, due to various safety measures currently in place. Unrestricted shell access means any safety precautions, other than hardware ones, are out the window. Unless I happened to have missed something not in this thread, seems like you'd rather attack and name call people despite others being rather helpful/friendly, just because someone disagrees with your ideas. Open-source doesn't mean implementing every request just because it's something you want, even if you think it's correct/incorrect. |
People who are allegedly dumb enough to copy paste This PR is not about running any command for god sake, Yes, you are missing WHOLE POINT |
Tell me more how this "community" was "just being friendly" to Near or Rachel Bryk. |
Signed-off-by: Maja Stanislawska [email protected]