Merge branch 'master' of git://github.com/KLuka/shellinabox-1 into KLuka-master

Conflicts:
	ChangeLog
This commit is contained in:
KLuka 2015-03-11 13:46:04 +01:00
commit 5f1d52c53b
24 changed files with 142 additions and 126 deletions

View file

@ -234,4 +234,3 @@ an Autoconf bug. Until the bug is fixed you can use this workaround:
`configure' also accepts some other, not widely useful, options. Run `configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details. `configure --help' for more details.

View file

@ -29,4 +29,3 @@ some tips on getting things working:
Make sure you assign the correct SELinux labels to this file when copying Make sure you assign the correct SELinux labels to this file when copying
it into "/etc/pam.d": it into "/etc/pam.d":
cp -Z system_u:object_r:etc_t:s0 etc-pam.d-shellinabox-example /etc/pam.d/ cp -Z system_u:object_r:etc_t:s0 etc-pam.d-shellinabox-example /etc/pam.d/

1
TODO
View file

@ -1,4 +1,3 @@
- Check if there is any way that we could fall back on gnutls if openssl is - Check if there is any way that we could fall back on gnutls if openssl is
unavailable unavailable
- Package for distributions other than Debian - Package for distributions other than Debian

View file

@ -1 +0,0 @@

View file

@ -1183,4 +1183,3 @@ Demo.prototype.Value.prototype.val = function() {
Demo.prototype.Value.prototype.toString = function() { Demo.prototype.Value.prototype.toString = function() {
return this.s; return this.s;
}; };

View file

@ -191,4 +191,3 @@ char *stringPrintfUnchecked(char *buf, const char *fmt, ...)
return s; return s;
} }
#endif #endif

View file

@ -373,4 +373,3 @@ ShellInABox.prototype.about = function() {
"Eric Young\n(eay@cryptsoft.com)" : "Eric Young\n(eay@cryptsoft.com)" :
"")); ""));
}; };

View file

@ -285,6 +285,12 @@ VT100.prototype.getUserSettings = function() {
this.autoprint = true; this.autoprint = true;
this.softKeyboard = false; this.softKeyboard = false;
this.blinkingCursor = true; this.blinkingCursor = true;
this.disableAlt = false;
if (navigator.platform.indexOf("Mac") != -1) {
this.disableAlt = true;
}
if (this.visualBell) { if (this.visualBell) {
this.signature = Math.floor(16807*this.signature + 1) % this.signature = Math.floor(16807*this.signature + 1) %
((1 << 31) - 1); ((1 << 31) - 1);
@ -309,13 +315,14 @@ VT100.prototype.getUserSettings = function() {
if (settings >= 0) { if (settings >= 0) {
settings = document.cookie.substr(settings + key.length). settings = document.cookie.substr(settings + key.length).
replace(/([0-1]*).*/, "$1"); replace(/([0-1]*).*/, "$1");
if (settings.length == 5 + (typeof userCSSList == 'undefined' ? if (settings.length == 6 + (typeof userCSSList == 'undefined' ?
0 : userCSSList.length)) { 0 : userCSSList.length)) {
this.utfPreferred = settings.charAt(0) != '0'; this.utfPreferred = settings.charAt(0) != '0';
this.visualBell = settings.charAt(1) != '0'; this.visualBell = settings.charAt(1) != '0';
this.autoprint = settings.charAt(2) != '0'; this.autoprint = settings.charAt(2) != '0';
this.softKeyboard = settings.charAt(3) != '0'; this.softKeyboard = settings.charAt(3) != '0';
this.blinkingCursor = settings.charAt(4) != '0'; this.blinkingCursor = settings.charAt(4) != '0';
this.disableAlt = settings.charAt(5) != '0';
if (typeof userCSSList != 'undefined') { if (typeof userCSSList != 'undefined') {
for (var i = 0; i < userCSSList.length; ++i) { for (var i = 0; i < userCSSList.length; ++i) {
userCSSList[i][2] = settings.charAt(i + 5) != '0'; userCSSList[i][2] = settings.charAt(i + 5) != '0';
@ -332,7 +339,8 @@ VT100.prototype.storeUserSettings = function() {
(this.visualBell ? '1' : '0') + (this.visualBell ? '1' : '0') +
(this.autoprint ? '1' : '0') + (this.autoprint ? '1' : '0') +
(this.softKeyboard ? '1' : '0') + (this.softKeyboard ? '1' : '0') +
(this.blinkingCursor ? '1' : '0'); (this.blinkingCursor ? '1' : '0') +
(this.disableAlt ? '1' : '0');
if (typeof userCSSList != 'undefined') { if (typeof userCSSList != 'undefined') {
for (var i = 0; i < userCSSList.length; ++i) { for (var i = 0; i < userCSSList.length; ++i) {
settings += userCSSList[i][2] ? '1' : '0'; settings += userCSSList[i][2] ? '1' : '0';
@ -2367,6 +2375,10 @@ VT100.prototype.toggleSoftKeyboard = function() {
this.keyboardImage.style.visibility = this.softKeyboard ? 'visible' : ''; this.keyboardImage.style.visibility = this.softKeyboard ? 'visible' : '';
}; };
VT100.prototype.toggleDisableAlt = function() {
this.disableAlt = !this.disableAlt;
};
VT100.prototype.deselectKeys = function(elem) { VT100.prototype.deselectKeys = function(elem) {
if (elem && elem.className == 'selected') { if (elem && elem.className == 'selected') {
elem.className = ''; elem.className = '';
@ -2468,6 +2480,9 @@ VT100.prototype.showContextMenu = function(x, y) {
'<li>' + '<li>' +
(this.softKeyboard ? '<img src="enabled.gif" />' : '') + (this.softKeyboard ? '<img src="enabled.gif" />' : '') +
'Onscreen Keyboard</li>' + 'Onscreen Keyboard</li>' +
'<li>' +
(this.disableAlt ? '<img src="enabled.gif" />' : '') +
'Disable Alt Key</li>' +
'<li id="endconfig">' + '<li id="endconfig">' +
(this.blinkingCursor ? '<img src="enabled.gif" />' : '') + (this.blinkingCursor ? '<img src="enabled.gif" />' : '') +
'Blinking Cursor</li>'+ 'Blinking Cursor</li>'+
@ -2500,6 +2515,7 @@ VT100.prototype.showContextMenu = function(x, y) {
var actions = [ this.copyLast, p, this.pasteBrowserFnc, this.reset, var actions = [ this.copyLast, p, this.pasteBrowserFnc, this.reset,
this.toggleUTF, this.toggleBell, this.toggleUTF, this.toggleBell,
this.toggleSoftKeyboard, this.toggleSoftKeyboard,
this.toggleDisableAlt,
this.toggleCursorBlinking ]; this.toggleCursorBlinking ];
// Actions for user CSS styles (if any) // Actions for user CSS styles (if any)
@ -2736,7 +2752,9 @@ VT100.prototype.handleKey = function(event) {
case 144: /* Num Lock */ return; case 144: /* Num Lock */ return;
case 145: /* Scroll Lock */ return; case 145: /* Scroll Lock */ return;
case 186: /* ; */ ch = this.applyModifiers(59, event); break; case 186: /* ; */ ch = this.applyModifiers(59, event); break;
case 187: /* = */ ch = this.applyModifiers(61, event); break; // Conflicts with dead keys ` on Danish keyboard
// ¸ on Slovenian keyboard
// case 187: /* = */ ch = this.applyModifiers(61, event); break;
case 188: /* , */ ch = this.applyModifiers(44, event); break; case 188: /* , */ ch = this.applyModifiers(44, event); break;
case 189: /* - */ ch = this.applyModifiers(45, event); break; case 189: /* - */ ch = this.applyModifiers(45, event); break;
case 190: /* . */ ch = this.applyModifiers(46, event); break; case 190: /* . */ ch = this.applyModifiers(46, event); break;
@ -2781,7 +2799,8 @@ VT100.prototype.handleKey = function(event) {
(event.altKey|event.metaKey ? 2 : 0) + (event.altKey|event.metaKey ? 2 : 0) +
(event.ctrlKey ? 4 : 0)) + (event.ctrlKey ? 4 : 0)) +
part2; part2;
} else if (ch.length == 1 && (event.altKey || event.metaKey)) { } else if (ch.length == 1 && (event.altKey || event.metaKey)
&& !this.disableAlt) {
ch = '\u001B' + ch; ch = '\u001B' + ch;
} }
} }
@ -2949,6 +2968,7 @@ VT100.prototype.keyDown = function(event) {
event.keyCode >= 160 && event.keyCode <= 185 || /* FF15 patch */ event.keyCode >= 160 && event.keyCode <= 185 || /* FF15 patch */
event.keyCode >= 186 && event.keyCode <= 191 || event.keyCode >= 186 && event.keyCode <= 191 ||
event.keyCode == 222 || event.keyCode == 222 ||
event.keyCode == 229 ||
event.keyCode == 252; event.keyCode == 252;
try { try {
if (navigator.appName == 'Konqueror') { if (navigator.appName == 'Konqueror') {
@ -2957,6 +2977,10 @@ VT100.prototype.keyDown = function(event) {
} catch (e) { } catch (e) {
} }
if (this.disableAlt && normalKey) {
return true;
}
// We normally prefer to look at keypress events, as they perform the // We normally prefer to look at keypress events, as they perform the
// translation from keyCode to charCode. This is important, as the // translation from keyCode to charCode. This is important, as the
// translation is locale-dependent. // translation is locale-dependent.
@ -4444,4 +4468,3 @@ VT100.prototype.ctrlAlways = [
false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, true, false, false, false, false false, false, false, true, false, false, false, false
]; ];