Released version 2.8

git-svn-id: https://shellinabox.googlecode.com/svn/trunk@121 0da03de8-d603-11dd-86c2-0f8696b7b6f9
This commit is contained in:
zodiac@gmail.com 2009-05-23 19:53:09 +00:00
parent 60b5f38d74
commit adadddf91c
12 changed files with 127 additions and 91 deletions

View file

@ -1,3 +1,7 @@
2009-05-23 Markus Gutschke <markus@shellinabox.com>
* Released version 2.8
2009-05-22 Markus Gutschke <markus@shellinabox.com> 2009-05-22 Markus Gutschke <markus@shellinabox.com>
* Improved support for entering non-ASCII characters. * Improved support for entering non-ASCII characters.

View file

@ -117,22 +117,22 @@
#define PACKAGE_NAME "shellinabox" #define PACKAGE_NAME "shellinabox"
/* Define to the full name and version of this package. */ /* Define to the full name and version of this package. */
#define PACKAGE_STRING "shellinabox 2.7" #define PACKAGE_STRING "shellinabox 2.8"
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "shellinabox" #define PACKAGE_TARNAME "shellinabox"
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "2.7" #define PACKAGE_VERSION "2.8"
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Most recent revision number in the version control system */ /* Most recent revision number in the version control system */
#define VCS_REVISION "120" #define VCS_REVISION "121"
/* Version number of package */ /* Version number of package */
#define VERSION "2.7" #define VERSION "2.8"
/* Define to empty if `const' does not conform to ANSI C. */ /* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */ /* #undef const */

22
configure vendored
View file

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.63 for shellinabox 2.7. # Generated by GNU Autoconf 2.63 for shellinabox 2.8.
# #
# Report bugs to <markus@shellinabox.com>. # Report bugs to <markus@shellinabox.com>.
# #
@ -745,8 +745,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package. # Identity of this package.
PACKAGE_NAME='shellinabox' PACKAGE_NAME='shellinabox'
PACKAGE_TARNAME='shellinabox' PACKAGE_TARNAME='shellinabox'
PACKAGE_VERSION='2.7' PACKAGE_VERSION='2.8'
PACKAGE_STRING='shellinabox 2.7' PACKAGE_STRING='shellinabox 2.8'
PACKAGE_BUGREPORT='markus@shellinabox.com' PACKAGE_BUGREPORT='markus@shellinabox.com'
ac_c_werror_flag= ac_c_werror_flag=
@ -1469,7 +1469,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures shellinabox 2.7 to adapt to many kinds of systems. \`configure' configures shellinabox 2.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1539,7 +1539,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of shellinabox 2.7:";; short | recursive ) echo "Configuration of shellinabox 2.8:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1655,7 +1655,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
shellinabox configure 2.7 shellinabox configure 2.8
generated by GNU Autoconf 2.63 generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@ -1669,7 +1669,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by shellinabox $as_me 2.7, which was It was created by shellinabox $as_me 2.8, which was
generated by GNU Autoconf 2.63. Invocation command line was generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@ $ $0 $@
@ -2037,7 +2037,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
VCS_REVISION=120 VCS_REVISION=121
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -2394,7 +2394,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='shellinabox' PACKAGE='shellinabox'
VERSION='2.7' VERSION='2.8'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -13592,7 +13592,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by shellinabox $as_me 2.7, which was This file was extended by shellinabox $as_me 2.8, which was
generated by GNU Autoconf 2.63. Invocation command line was generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -13655,7 +13655,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\ ac_cs_version="\\
shellinabox config.status 2.7 shellinabox config.status 2.8
configured by $0, generated by GNU Autoconf 2.63, configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"

View file

@ -1,8 +1,8 @@
AC_PREREQ(2.57) AC_PREREQ(2.57)
dnl This is the one location where the authoritative version number is stored dnl This is the one location where the authoritative version number is stored
AC_INIT(shellinabox, 2.7, markus@shellinabox.com) AC_INIT(shellinabox, 2.8, markus@shellinabox.com)
VCS_REVISION=120 VCS_REVISION=121
AC_SUBST(VCS_REVISION) AC_SUBST(VCS_REVISION)
AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}", AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}",
[Most recent revision number in the version control system]) [Most recent revision number in the version control system])

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
shellinabox (2.8-1) unstable; urgency=low
* New upstream release, version 2.8.
-- Markus Gutschke <markus@shellinabox.com> Sat, 23 May 2009 11:53:13 -0800
shellinabox (2.7-1) unstable; urgency=low shellinabox (2.7-1) unstable; urgency=low
* New upstream release, version 2.7. * New upstream release, version 2.7.

View file

@ -89,32 +89,17 @@ function Demo(container) {
extend(Demo, VT100); extend(Demo, VT100);
Demo.prototype.keysPressed = function(ch) { Demo.prototype.keysPressed = function(ch) {
for (var i = 0; i < ch.length; i++) {
var c = ch.charCodeAt(i);
if (c == 3) {
if (this.state == 5 /* STATE_EXEC */) { if (this.state == 5 /* STATE_EXEC */) {
for (var i = 0; i < ch.length; i++) {
var c = ch.charAt(i);
if (c == '\u0003') {
this.keys = ''; this.keys = '';
this.error('Interrupted'); this.error('Interrupted');
return; return;
} }
} else {
if (c < 128) {
this.keys += String.fromCharCode(c);
} else if (c < 0x800) {
this.keys += String.fromCharCode(0xC0 + (c >> 6) ) +
String.fromCharCode(0x80 + ( c & 0x3F));
} else if (c < 0x10000) {
this.keys += String.fromCharCode(0xE0 + (c >> 12) ) +
String.fromCharCode(0x80 + ((c >> 6) & 0x3F)) +
String.fromCharCode(0x80 + ( c & 0x3F));
} else if (c < 0x110000) {
this.keys += String.fromCharCode(0xF0 + (c >> 18) ) +
String.fromCharCode(0x80 + ((c >> 12) & 0x3F)) +
String.fromCharCode(0x80 + ((c >> 6) & 0x3F)) +
String.fromCharCode(0x80 + ( c & 0x3F));
}
} }
} }
this.keys += ch;
this.gotoState(this.state); this.gotoState(this.state);
}; };
@ -175,9 +160,9 @@ Demo.prototype.error = function(msg) {
if (msg == undefined) { if (msg == undefined) {
msg = 'Syntax Error'; msg = 'Syntax Error';
} }
this.vt100((this.cursorX != 0 ? '\r\n' : '') + '\u0007? ' + msg + this.printUnicode((this.cursorX != 0 ? '\r\n' : '') + '\u0007? ' + msg +
(this.currentLineIndex >= 0 ? (this.currentLineIndex >= 0 ? ' in line ' +
' in line ' + this.program[this.evalLineIndex].lineNumber() : this.program[this.evalLineIndex].lineNumber() :
'') + '\r\n'); '') + '\r\n');
this.gotoState(2 /* STATE_PROMPT */); this.gotoState(2 /* STATE_PROMPT */);
this.currentLineIndex = -1; this.currentLineIndex = -1;
@ -188,7 +173,7 @@ Demo.prototype.error = function(msg) {
Demo.prototype.doInit = function() { Demo.prototype.doInit = function() {
this.vars = new Object(); this.vars = new Object();
this.program = new Array(); this.program = new Array();
this.vt100( this.printUnicode(
'\u001Bc\u001B[34;4m' + '\u001Bc\u001B[34;4m' +
'ShellInABox Demo Script\u001B[24;31m\r\n' + 'ShellInABox Demo Script\u001B[24;31m\r\n' +
'\r\n' + '\r\n' +
@ -215,20 +200,39 @@ Demo.prototype.doPrompt = function() {
return false; return false;
}; };
Demo.prototype.printUnicode = function(s) {
var out = '';
for (var i = 0; i < s.length; i++) {
var c = s.charAt(i);
if (c < '\x0080') {
out += c;
} else {
var c = s.charCodeAt(i);
if (c < 0x800) {
out += String.fromCharCode(0xC0 + (c >> 6) ) +
String.fromCharCode(0x80 + ( c & 0x3F));
} else if (c < 0x10000) {
out += String.fromCharCode(0xE0 + (c >> 12) ) +
String.fromCharCode(0x80 + ((c >> 6) & 0x3F)) +
String.fromCharCode(0x80 + ( c & 0x3F));
} else if (c < 0x110000) {
out += String.fromCharCode(0xF0 + (c >> 18) ) +
String.fromCharCode(0x80 + ((c >> 12) & 0x3F)) +
String.fromCharCode(0x80 + ((c >> 6) & 0x3F)) +
String.fromCharCode(0x80 + ( c & 0x3F));
}
}
}
this.vt100(out);
};
Demo.prototype.doReadLine = function() { Demo.prototype.doReadLine = function() {
this.gotoState(3 /* STATE_READLINE */); this.gotoState(3 /* STATE_READLINE */);
var keys = this.keys; var keys = this.keys;
this.keys = ''; this.keys = '';
for (var i = 0; i < keys.length; i++) { for (var i = 0; i < keys.length; i++) {
var ch = keys.charAt(i); var ch = keys.charAt(i);
if (ch >= ' ') { if (ch == '\u0008' || ch == '\u007F') {
this.line += ch;
this.vt100(ch);
} else if (ch == '\r' || ch == '\n') {
this.vt100('\r\n');
this.gotoState(4 /* STATE_COMMAND */);
return false;
} else if (ch == '\u0008' || ch == '\u007F') {
if (this.line.length > 0) { if (this.line.length > 0) {
this.line = this.line.substr(0, this.line.length - 1); this.line = this.line.substr(0, this.line.length - 1);
if (this.cursorX == 0) { if (this.cursorX == 0) {
@ -243,6 +247,13 @@ Demo.prototype.doReadLine = function() {
} else { } else {
this.vt100('\u0007'); this.vt100('\u0007');
} }
} else if (ch >= ' ') {
this.line += ch;
this.printUnicode(ch);
} else if (ch == '\r' || ch == '\n') {
this.vt100('\r\n');
this.gotoState(4 /* STATE_COMMAND */);
return false;
} else if (ch == '\u001B') { } else if (ch == '\u001B') {
// This was probably a function key. Just eat all of the following keys. // This was probably a function key. Just eat all of the following keys.
break; break;
@ -592,7 +603,7 @@ Demo.prototype.doList = function() {
token = 'PRINT'; token = 'PRINT';
// fall thru // fall thru
default: default:
this.vt100((id ? ' ' : '') + token); this.printUnicode((id ? ' ' : '') + token);
space = false; space = false;
id = true; id = true;
break; break;
@ -621,7 +632,7 @@ Demo.prototype.doPrint = function() {
if (value == undefined) { if (value == undefined) {
return; return;
} }
this.vt100(value.toString()); this.printUnicode(value.toString());
} }
} }
if (last != ';') { if (last != ';') {

View file

@ -89,32 +89,17 @@ function Demo(container) {
extend(Demo, VT100); extend(Demo, VT100);
Demo.prototype.keysPressed = function(ch) { Demo.prototype.keysPressed = function(ch) {
for (var i = 0; i < ch.length; i++) {
var c = ch.charCodeAt(i);
if (c == 3) {
if (this.state == STATE_EXEC) { if (this.state == STATE_EXEC) {
for (var i = 0; i < ch.length; i++) {
var c = ch.charAt(i);
if (c == '\u0003') {
this.keys = ''; this.keys = '';
this.error('Interrupted'); this.error('Interrupted');
return; return;
} }
} else {
if (c < 128) {
this.keys += String.fromCharCode(c);
} else if (c < 0x800) {
this.keys += String.fromCharCode(0xC0 + (c >> 6) ) +
String.fromCharCode(0x80 + ( c & 0x3F));
} else if (c < 0x10000) {
this.keys += String.fromCharCode(0xE0 + (c >> 12) ) +
String.fromCharCode(0x80 + ((c >> 6) & 0x3F)) +
String.fromCharCode(0x80 + ( c & 0x3F));
} else if (c < 0x110000) {
this.keys += String.fromCharCode(0xF0 + (c >> 18) ) +
String.fromCharCode(0x80 + ((c >> 12) & 0x3F)) +
String.fromCharCode(0x80 + ((c >> 6) & 0x3F)) +
String.fromCharCode(0x80 + ( c & 0x3F));
}
} }
} }
this.keys += ch;
this.gotoState(this.state); this.gotoState(this.state);
}; };
@ -175,9 +160,9 @@ Demo.prototype.error = function(msg) {
if (msg == undefined) { if (msg == undefined) {
msg = 'Syntax Error'; msg = 'Syntax Error';
} }
this.vt100((this.cursorX != 0 ? '\r\n' : '') + '\u0007? ' + msg + this.printUnicode((this.cursorX != 0 ? '\r\n' : '') + '\u0007? ' + msg +
(this.currentLineIndex >= 0 ? (this.currentLineIndex >= 0 ? ' in line ' +
' in line ' + this.program[this.evalLineIndex].lineNumber() : this.program[this.evalLineIndex].lineNumber() :
'') + '\r\n'); '') + '\r\n');
this.gotoState(STATE_PROMPT); this.gotoState(STATE_PROMPT);
this.currentLineIndex = -1; this.currentLineIndex = -1;
@ -188,7 +173,7 @@ Demo.prototype.error = function(msg) {
Demo.prototype.doInit = function() { Demo.prototype.doInit = function() {
this.vars = new Object(); this.vars = new Object();
this.program = new Array(); this.program = new Array();
this.vt100( this.printUnicode(
'\u001Bc\u001B[34;4m' + '\u001Bc\u001B[34;4m' +
'ShellInABox Demo Script\u001B[24;31m\r\n' + 'ShellInABox Demo Script\u001B[24;31m\r\n' +
'\r\n' + '\r\n' +
@ -215,20 +200,39 @@ Demo.prototype.doPrompt = function() {
return false; return false;
}; };
Demo.prototype.printUnicode = function(s) {
var out = '';
for (var i = 0; i < s.length; i++) {
var c = s.charAt(i);
if (c < '\x0080') {
out += c;
} else {
var c = s.charCodeAt(i);
if (c < 0x800) {
out += String.fromCharCode(0xC0 + (c >> 6) ) +
String.fromCharCode(0x80 + ( c & 0x3F));
} else if (c < 0x10000) {
out += String.fromCharCode(0xE0 + (c >> 12) ) +
String.fromCharCode(0x80 + ((c >> 6) & 0x3F)) +
String.fromCharCode(0x80 + ( c & 0x3F));
} else if (c < 0x110000) {
out += String.fromCharCode(0xF0 + (c >> 18) ) +
String.fromCharCode(0x80 + ((c >> 12) & 0x3F)) +
String.fromCharCode(0x80 + ((c >> 6) & 0x3F)) +
String.fromCharCode(0x80 + ( c & 0x3F));
}
}
}
this.vt100(out);
};
Demo.prototype.doReadLine = function() { Demo.prototype.doReadLine = function() {
this.gotoState(STATE_READLINE); this.gotoState(STATE_READLINE);
var keys = this.keys; var keys = this.keys;
this.keys = ''; this.keys = '';
for (var i = 0; i < keys.length; i++) { for (var i = 0; i < keys.length; i++) {
var ch = keys.charAt(i); var ch = keys.charAt(i);
if (ch >= ' ') { if (ch == '\u0008' || ch == '\u007F') {
this.line += ch;
this.vt100(ch);
} else if (ch == '\r' || ch == '\n') {
this.vt100('\r\n');
this.gotoState(STATE_COMMAND);
return false;
} else if (ch == '\u0008' || ch == '\u007F') {
if (this.line.length > 0) { if (this.line.length > 0) {
this.line = this.line.substr(0, this.line.length - 1); this.line = this.line.substr(0, this.line.length - 1);
if (this.cursorX == 0) { if (this.cursorX == 0) {
@ -243,6 +247,13 @@ Demo.prototype.doReadLine = function() {
} else { } else {
this.vt100('\u0007'); this.vt100('\u0007');
} }
} else if (ch >= ' ') {
this.line += ch;
this.printUnicode(ch);
} else if (ch == '\r' || ch == '\n') {
this.vt100('\r\n');
this.gotoState(STATE_COMMAND);
return false;
} else if (ch == '\u001B') { } else if (ch == '\u001B') {
// This was probably a function key. Just eat all of the following keys. // This was probably a function key. Just eat all of the following keys.
break; break;
@ -592,7 +603,7 @@ Demo.prototype.doList = function() {
token = 'PRINT'; token = 'PRINT';
// fall thru // fall thru
default: default:
this.vt100((id ? ' ' : '') + token); this.printUnicode((id ? ' ' : '') + token);
space = false; space = false;
id = true; id = true;
break; break;
@ -621,7 +632,7 @@ Demo.prototype.doPrint = function() {
if (value == undefined) { if (value == undefined) {
return; return;
} }
this.vt100(value.toString()); this.printUnicode(value.toString());
} }
} }
if (last != ';') { if (last != ';') {

View file

@ -1500,7 +1500,7 @@ VT100.prototype.toggleBell = function() {
}; };
VT100.prototype.about = function() { VT100.prototype.about = function() {
alert("VT100 Terminal Emulator " + "2.7 (revision 120)" + alert("VT100 Terminal Emulator " + "2.8 (revision 121)" +
"\nCopyright 2008-2009 by Markus Gutschke\n" + "\nCopyright 2008-2009 by Markus Gutschke\n" +
"For more information check http://shellinabox.com"); "For more information check http://shellinabox.com");
}; };

View file

@ -59,6 +59,10 @@
#include "libhttp/server.h" #include "libhttp/server.h"
#include "logging/logging.h" #include "logging/logging.h"
#ifdef HAVE_STRLCAT
#define strncat(a,b,c) ({ char *_a = (a); strlcat(_a, (b), (c)+1); _a; })
#endif
static int externalFileHttpHandler(HttpConnection *http, void *arg, static int externalFileHttpHandler(HttpConnection *http, void *arg,
const char *buf, int len) { const char *buf, int len) {
checkGraveyard(); checkGraveyard();

View file

@ -576,7 +576,7 @@ void closeAllFds(int *exceptFds, int num) {
} }
} }
#if !defined(HAVE_PTSNAME_R) && 0 #if !defined(HAVE_OPENPTY) && !defined(HAVE_PTSNAME_R)
static int ptsname_r(int fd, char *buf, size_t buflen) { static int ptsname_r(int fd, char *buf, size_t buflen) {
// It is unfortunate that ptsname_r is not universally available. // It is unfortunate that ptsname_r is not universally available.
// For the time being, this is not a big problem, as ShellInABox is // For the time being, this is not a big problem, as ShellInABox is

View file

@ -355,7 +355,7 @@ ShellInABox.prototype.extendContextMenu = function(entries, actions) {
}; };
ShellInABox.prototype.about = function() { ShellInABox.prototype.about = function() {
alert("Shell In A Box version " + "2.7 (revision 120)" + alert("Shell In A Box version " + "2.8 (revision 121)" +
"\nCopyright 2008-2009 by Markus Gutschke\n" + "\nCopyright 2008-2009 by Markus Gutschke\n" +
"For more information check http://shellinabox.com" + "For more information check http://shellinabox.com" +
(typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ? (typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ?

View file

@ -1500,7 +1500,7 @@ VT100.prototype.toggleBell = function() {
}; };
VT100.prototype.about = function() { VT100.prototype.about = function() {
alert("VT100 Terminal Emulator " + "2.7 (revision 120)" + alert("VT100 Terminal Emulator " + "2.8 (revision 121)" +
"\nCopyright 2008-2009 by Markus Gutschke\n" + "\nCopyright 2008-2009 by Markus Gutschke\n" +
"For more information check http://shellinabox.com"); "For more information check http://shellinabox.com");
}; };