<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/pysim/+/23680">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pySim-shell: be sure that startup script file exists<br><br>When a startup script file is specified that does not exists pySim-shell<br>skips the script and starts normally. This is dangerous because if<br>pySim-shell is called by a shellscript with a nonexisting script file<br>the shellscript may hang forever because there is no script that exists<br>pySim-shell again<br><br>Change-Id: I4ff2226c8852727aa23357aa54d1e2d480bfaf2d<br>Related: OS#4963<br>---<br>M pySim-shell.py<br>1 file changed, 6 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/80/23680/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/pySim-shell.py b/pySim-shell.py</span><br><span>index f1060de..53c8585 100755</span><br><span>--- a/pySim-shell.py</span><br><span>+++ b/pySim-shell.py</span><br><span>@@ -450,6 +450,12 @@</span><br><span>    rs.mf.add_file(DF_TELECOM())</span><br><span>         rs.mf.add_file(DF_GSM())</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+  # If a script file is specified, be sure that it actually exists</span><br><span style="color: hsl(120, 100%, 40%);">+      if opts.script:</span><br><span style="color: hsl(120, 100%, 40%);">+               if not os.path.exists(opts.script) or not os.path.isfile(opts.script):</span><br><span style="color: hsl(120, 100%, 40%);">+                        print("Invalid script file!")</span><br><span style="color: hsl(120, 100%, 40%);">+                       sys.exit(2)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>        app = PysimApp(card, rs, opts.script)</span><br><span>        rs.select('MF', app)</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/23680">change 23680</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/pysim/+/23680"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: pysim </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I4ff2226c8852727aa23357aa54d1e2d480bfaf2d </div>
<div style="display:none"> Gerrit-Change-Number: 23680 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>