Skip to content
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

Post-Processing Script Parameters? #4000

Closed
foreachthing opened this issue Jun 2, 2017 · 7 comments
Closed

Post-Processing Script Parameters? #4000

foreachthing opened this issue Jun 2, 2017 · 7 comments
Labels
Feature request This is an idea for a new feature in Slic3r Low Effort UI: Misc Workaround

Comments

@foreachthing
Copy link
Member

Version

Any, so far.

Operating system type + version

Windows 7 Pro

Behavior

I made a post-processing script which accepts parameters (like: Slic3rPostProcessing.exe --output "c:\GeeeeCode\[input_filename_base].gcode" --v 4 --i ) but for some reason, whenever I add such a parameter to the script input box it will fail to execute my script.

Error
---------------------------
The configured post-processing script is not executable: check permissions.
(c:\temp\Slic3rPostProcessing.exe --v 4 --i )
---------------------------
OK   
---------------------------

Is it not possible to pass parameters?

@ReeseWang
Copy link

I met the problem too. My solution is to write a .bat file, e.g. postprocessing.bat and Slic3r will run the script with filename as the first parameter: postprocessing.bat <input_filename>. Then you can pass the filename to Slic3rPostProcessing.exe in postprocessing.bat. See my configuration: https://github.com/thuSkywalker/wiiboox-c300-slic3r-config/blob/master/gpx/gpx.bat

@foreachthing
Copy link
Member Author

@thuSkywalker thank you! :-)

@alranel
Copy link
Member

alranel commented Nov 18, 2018

Actually, that limitation was in place on purpose, for security reasons. I didn't want people to be able to distribute a malicious config file containing, say, rm -rf ~/* thus executing arbitrary commands on other people's machines. Passing only the name of a single executable mitigates this risk. In order to supply arguments to a post-processing script, people could just create a wrapper shell script.

@lordofhyphens lordofhyphens removed this from the 1.3.2 milestone Nov 18, 2018
@alranel
Copy link
Member

alranel commented Nov 20, 2018

I wonder if we should add an option to enable this, and leave it disabled by default. I don't like the idea that Slic3r config files could be used as attack vectors.

@foreachthing
Copy link
Member Author

I understand your concern. But do you have a means to pass parameters the save way?
As long as one can execute something, there's a risk of misuse. I could add that malicious command to my post-processor...

domesticatedviking added a commit to domesticatedviking/skinnydip that referenced this issue Apr 24, 2019
Batch file that helps windows users avoid issues related to slic3r/Slic3r#4000, and which also reveals the output of the post processing script by pausing to keep the command line window open.    Will require editing if users have python stored in a place other than C:/python27.   This batch file must be kept in the same directory as skinnydip.py.
@nwneisen
Copy link
Contributor

It looks like #4363 added the ability to pass parameters to a post-processing script. Is this issue still open because of the enable/disable feature?

@foreachthing
Copy link
Member Author

Nah, I forgot about it and never closed it ... we're done here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request This is an idea for a new feature in Slic3r Low Effort UI: Misc Workaround
Projects
None yet
Development

No branches or pull requests

5 participants