@@ -275,6 +275,7 @@ def parse_args(args = None):
275
275
x .add_argument ('-x' ,'--external' , action = 'store_true' , help = 'Launch external browser (for debugging)' )
276
276
x .add_argument ('-P' ,'--pkexec-openconnect' , action = 'store_const' , dest = 'exec' , const = 'pkexec' , help = 'Use PolicyKit to exec openconnect' )
277
277
x .add_argument ('-S' ,'--sudo-openconnect' , action = 'store_const' , dest = 'exec' , const = 'sudo' , help = 'Use sudo to exec openconnect' )
278
+ x .add_argument ('-E' ,'--exec-openconnect' , action = 'store_const' , dest = 'exec' , const = 'exec' , help = 'Execute openconnect directly (advanced users)' )
278
279
g .add_argument ('-u' ,'--uri' , action = 'store_true' , help = 'Treat server as the complete URI of the SAML entry point, rather than GlobalProtect server' )
279
280
g .add_argument ('--clientos' , choices = set (pf2clientos .values ()), default = default_clientos , help = "clientos value to send (default is %(default)s)" )
280
281
p .add_argument ('-f' ,'--field' , dest = 'extra' , action = 'append' , default = [],
@@ -450,10 +451,11 @@ def main(args = None):
450
451
# redirect stdin from this file, before it is closed by the context manager
451
452
# (it will remain accessible via the open file descriptor)
452
453
dup2 (tf .fileno (), 0 )
454
+ cmd = ["openconnect" ] + openconnect_args
453
455
if args .exec == 'pkexec' :
454
- cmd = ["pkexec" , "--user" , "root" , "openconnect" ] + openconnect_args
456
+ cmd = ["pkexec" , "--user" , "root" ] + cmd
455
457
elif args .exec == 'sudo' :
456
- cmd = ["sudo" , "openconnect" ] + openconnect_args
458
+ cmd = ["sudo" ] + cmd
457
459
execvp (cmd [0 ], cmd )
458
460
459
461
else :
0 commit comments