My favorites
|
Sign in
cgpy-shell
A CGI Shell with a browser client
Project Home
Downloads
Wiki
Issues
Source
Summary
|
Updates
|
People
Details:
Show all
Hide all
1 - 5
Older
Oct 23, 2008
sfaqf Wiki page deleted by
clodoaldo.pinto
Oct 23, 2008
sfaqf
(One-sentence summary of this page.) Wiki page edited by
clodoaldo.pinto
Oct 23, 2008
sfaqf
(One-sentence summary of this page.) Wiki page added by
clodoaldo.pinto
Sep 30, 2008
issue 3
(Proposed patch to allow Python 2.3) changed by
clodoaldo.pinto
-
I will test it.
Status:
Accepted
Owner:
clodoaldo.pinto
Labels:
Type-Enhancement
−
Type-Defect
I will test it.
Status:
Accepted
Owner:
clodoaldo.pinto
Labels:
Type-Enhancement
−
Type-Defect
Sep 30, 2008
issue 3
(Proposed patch to allow Python 2.3) reported by
cieslak.dariusz
-
Great tool!. Thanks! This patch allows to use Python 2.3 as well (some hosting providers have older Python version). -- cieslak.dariusz atcharacter gmail.com Index: cgi-shell.py =================================================================== --- cgi-shell.py (
revision 8
) +++ cgi-shell.py (working copy) @@ -1,8 +1,8 @@ -#!/usr/bin/python2.4 +#!/usr/bin/python import cgitb; cgitb.enable() import sys, os sys.path.append(os.path.dirname(os.environ['SCRIPT_FILENAME'])) -import session, time, cgi, urllib, subprocess as sub +import session, time, cgi, urllib, os def login(form, sess): # You absolutely need to change these !!! @@ -50,13 +50,13 @@ if cmd or cmd == '' and sess.data['empty_cmd']: sess.data['cmd'] = cmd cmd = urllib.unquote(cmd) - p = sub.Popen(['/bin/bash', '-c', cmd + '\necho $PWD'], - stdout=sub.PIPE, stderr=sub.STDOUT, cwd=cur_dir) + os.chdir(cur_dir) + p = os.popen('/bin/bash -c "' + cmd + ' 2>&1\npwd"', "r") prompt = '[@' + os.environ['SERVER_NAME'] + ' ' prompt += os.path.basename(cur_dir) + ']$ ' - output = [prompt + cmd + '\n'] + p.stdout.readlines() + output = [prompt + cmd + '\n'] + p.readlines() sess.data['pwd'] = (output[-1:])[0].rstrip() - sess.data['output'] = (sess.data['output'] + output)[-501:-1] + sess.data['output'] = (sess.data['output'] + ["\n"] + output)[-501:-1] else: cmd = urllib.unquote(sess.data.setdefault('cmd', '')) sess.data['empty_cmd'] = True @@ -109,3 +109,5 @@ shell(form, sess) main()
Great tool!. Thanks! This patch allows to use Python 2.3 as well (some hosting providers have older Python version). -- cieslak.dariusz atcharacter gmail.com Index: cgi-shell.py =================================================================== --- cgi-shell.py (
revision 8
) +++ cgi-shell.py (working copy) @@ -1,8 +1,8 @@ -#!/usr/bin/python2.4 +#!/usr/bin/python import cgitb; cgitb.enable() import sys, os sys.path.append(os.path.dirname(os.environ['SCRIPT_FILENAME'])) -import session, time, cgi, urllib, subprocess as sub +import session, time, cgi, urllib, os def login(form, sess): # You absolutely need to change these !!! @@ -50,13 +50,13 @@ if cmd or cmd == '' and sess.data['empty_cmd']: sess.data['cmd'] = cmd cmd = urllib.unquote(cmd) - p = sub.Popen(['/bin/bash', '-c', cmd + '\necho $PWD'], - stdout=sub.PIPE, stderr=sub.STDOUT, cwd=cur_dir) + os.chdir(cur_dir) + p = os.popen('/bin/bash -c "' + cmd + ' 2>&1\npwd"', "r") prompt = '[@' + os.environ['SERVER_NAME'] + ' ' prompt += os.path.basename(cur_dir) + ']$ ' - output = [prompt + cmd + '\n'] + p.stdout.readlines() + output = [prompt + cmd + '\n'] + p.readlines() sess.data['pwd'] = (output[-1:])[0].rstrip() - sess.data['output'] = (sess.data['output'] + output)[-501:-1] + sess.data['output'] = (sess.data['output'] + ["\n"] + output)[-501:-1] else: cmd = urllib.unquote(sess.data.setdefault('cmd', '')) sess.data['empty_cmd'] = True @@ -109,3 +109,5 @@ shell(form, sess) main()
1 - 5
Hosted by