-
Notifications
You must be signed in to change notification settings - Fork 13
iCmd5250 doesn't work properly for CL commands with parameters #49
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
Comments
kadler
added a commit
that referenced
this issue
Feb 21, 2020
iCmd5250 is just a fancy wrapper around iSh, using the PASE system command. It did not do any shell escaping/quoting, so it basically only allowed calling CL commands without parameters or with only positional parameters because the parentheses would cause the shell to gack. eg. iCmd5250('wrkactjob', 'WRKACTJOB SBS(QBATCH)') basically became iSh('wrkactjob', '/QOpenSys/usr/bin/system WRKACTJOB SBS(QBATCH)') When executed, an error would be given from the shell: sh: syntax error at line 1 : `(' unexpected The proper fix is to quote the string, but that can be tricky to get right. Luckily, Python has shlex.quote to do the hard work for us. https://docs.python.org/3/library/shlex.html#shlex.quote Fixes #49
kadler
added a commit
that referenced
this issue
Feb 22, 2020
iCmd5250 is just a fancy wrapper around iSh, using the PASE system command. It did not do any shell escaping/quoting, so it basically only allowed calling CL commands without parameters or with only positional parameters because the parentheses would cause the shell to gack. eg. iCmd5250('wrkactjob', 'WRKACTJOB SBS(QBATCH)') basically became iSh('wrkactjob', '/QOpenSys/usr/bin/system WRKACTJOB SBS(QBATCH)') When executed, an error would be given from the shell: sh: syntax error at line 1 : `(' unexpected The proper fix is to quote the string, but that can be tricky to get right. Luckily, Python has shlex.quote to do the hard work for us. https://docs.python.org/3/library/shlex.html#shlex.quote Fixes #49
kadler
added a commit
that referenced
this issue
Apr 28, 2020
iCmd5250 is just a fancy wrapper around iSh, using the PASE system command. It did not do any shell escaping/quoting, so it basically only allowed calling CL commands without parameters or with only positional parameters because the parentheses would cause the shell to gack. eg. iCmd5250('wrkactjob', 'WRKACTJOB SBS(QBATCH)') basically became iSh('wrkactjob', '/QOpenSys/usr/bin/system WRKACTJOB SBS(QBATCH)') When executed, an error would be given from the shell: sh: syntax error at line 1 : `(' unexpected The proper fix is to quote the string, but that can be tricky to get right. Luckily, Python has shlex.quote to do the hard work for us. https://docs.python.org/3/library/shlex.html#shlex.quote For Python 2, we have to add our own shlex.quote equivalent. Fixes #49
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@kadler after installing
SI70667
PTF we are getting following errorOriginally posted by @ranga543 in #48 (comment)
The text was updated successfully, but these errors were encountered: