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

[makeotf] prevent bash and python code execution #877

Merged
merged 12 commits into from
Aug 2, 2019

Conversation

josh-hadley
Copy link
Collaborator

Copy link
Member

@miguelsousa miguelsousa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good overall but I need to do a few real usage tests to better validate the change related to the fdkutils call.

python/afdko/makeotf.py Show resolved Hide resolved

fdkutils.runShellCmdLogging(commandString)
success = fdkutils.run_shell_command(params, suppress_output=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a closer look, the output cannot be suppressed because it suppresses all the errors and warnings issued by makeotfexe. Run this for example:

makeotf -f makeotf_data/input/cidfont.ps

This is why I wanted to run a few commands first; the test suite doesn't tell the full story.

josh-hadley and others added 12 commits August 1, 2019 22:00
- new routines do not set `shell=True`
- several updates related to command handling differences (list of strings vs single string, int vs string args)
- updated a few test cases related to command result differences (ints vs strings)
- don't use `eval()`
- use `.isnumeric()` rather than `try`/`except`
returns head.fontRevision value from supplied font_path
- add `suppress_output` option to `run_shell_command()` to prevent unexpected blank lines in captured output
- update version #
- use `run_shell_command` instead of discarding output of `get_shell_command_output`
- update version #
@miguelsousa miguelsousa force-pushed the jh-fix-makeotf-bash-code-exec branch from 30c9d36 to a515254 Compare August 2, 2019 07:58
@miguelsousa miguelsousa merged commit 9a057ff into develop Aug 2, 2019
@miguelsousa miguelsousa deleted the jh-fix-makeotf-bash-code-exec branch August 2, 2019 08:12
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.

[makeotf] bash code in style name is executed
2 participants