|
@@ -1,4 +1,4 @@
|
|
|
-#!/usr/bin/env python
|
|
|
+#!/usr/bin/env python3
|
|
|
|
|
|
import os
|
|
|
import re
|
|
@@ -33,7 +33,7 @@ allowed = [
|
|
|
|
|
|
cmdline = os.getenv('SSH_ORIGINAL_COMMAND')
|
|
|
if not cmdline:
|
|
|
- print 'This is just a wrapper, no command specified!'
|
|
|
+ print('This is just a wrapper, no command specified!')
|
|
|
sys.exit(3)
|
|
|
|
|
|
for maybe in allowed:
|
|
@@ -42,13 +42,13 @@ for maybe in allowed:
|
|
|
|
|
|
try:
|
|
|
cmd = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
|
|
|
- except Exception, exc:
|
|
|
- print 'Could not execute plugin ("%s"): %s' % (' '.join(cmdline), exc)
|
|
|
+ except Exception as exc:
|
|
|
+ print('Could not execute plugin ("%s"): %s' % (' '.join(cmdline), exc))
|
|
|
sys.exit(3)
|
|
|
else:
|
|
|
- print cmd.communicate()[0].rstrip()
|
|
|
+ print(cmd.communicate()[0].rstrip().decode('utf-8'))
|
|
|
sys.exit(cmd.returncode)
|
|
|
|
|
|
-print '%s: No allowed command found!' % sys.argv[0]
|
|
|
+print('%s: No allowed command found!' % sys.argv[0])
|
|
|
sys.exit(3)
|
|
|
|