]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Try blithely ignoring lack of IcedTea plugin.jar and/or tncc_preload.so
authorDaniel Lenski <dlenski@gmail.com>
Thu, 2 Apr 2020 04:46:18 +0000 (21:46 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Thu, 2 Apr 2020 04:52:01 +0000 (21:52 -0700)
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
trojans/tncc-wrapper.py

index 63ef643f985e0f4ed6a4f7cb045a5a1f108803c7..8e5c263c6c2c5ae0b95f4381d2ede407729e8fcd 100755 (executable)
@@ -31,7 +31,8 @@ class Tncc:
         self.plugin_jar = '/usr/share/icedtea-web/plugin.jar'
 
         if not os.path.isfile(self.plugin_jar):
-            raise Exception(self.plugin_jar + ' not found')
+            print('WARNING: no IcedTea Java web plugin JAR found at %s' % self.plugin_jar, file=sys.stderr)
+            self.plugin_jar = None
         self.user_agent = 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1'
         
     def tncc_init(self):
@@ -57,14 +58,14 @@ class Tncc:
                     break
                 except:
                     pass
-
-        if self.class_name is None:
-            raise Exception('Could not find class name for', self.tncc_jar)
+            else:
+                raise Exception('Could not find class name for', self.tncc_jar)
 
         self.tncc_preload = \
             os.path.expanduser('~/.juniper_networks/tncc_preload.so')
         if not os.path.isfile(self.tncc_preload):
-            raise Exception('Missing', self.tncc_preload)
+            print('WARNING: no tncc_preload found at %s' % self.tncc_preload, file=sys.stderr)
+            self.tncc_preload = None
 
     def tncc_start(self):
         # tncc is the host checker app. It can check different
@@ -79,7 +80,7 @@ class Tncc:
             self.tncc_init()
 
         self.tncc_process = subprocess.Popen(['java',
-            '-classpath', self.tncc_jar + ':' + self.plugin_jar,
+            '-classpath', self.tncc_jar + (':' + self.plugin_jar if self.plugin_jar else ''),
             self.class_name,
             'log_level', '100',
             'postRetries', '6',
@@ -87,7 +88,7 @@ class Tncc:
             'home_dir', os.path.expanduser('~'),
             'Parameter0', '',
             'user_agent', self.user_agent,
-            ], env={'LD_PRELOAD': self.tncc_preload})
+            ], env={'LD_PRELOAD': self.tncc_preload} if self.tncc_preload else {})