Compare commits

..

200 commits

Author SHA1 Message Date
simono41
82caba2f37 fix 2017-09-14 15:05:15 +02:00
simono41
e73021f2f3 fix 2017-09-14 14:57:56 +02:00
Your Name
6b5862fba1 fix 2017-06-04 01:06:16 +02:00
Your Name
50fba1b2f1 fix 2017-06-04 01:02:11 +02:00
Your Name
15de28e37b Merge branch 'master' of https://github.com/simono41/shellinabox 2017-05-24 18:55:15 +02:00
Your Name
d3a93f8081 fix 2017-05-24 18:54:50 +02:00
Your Name
39b42fb6e4 fix 2017-05-24 11:12:16 +00:00
Simon Rieger
1510811a68 bugfix 2017-01-19 16:02:54 +01:00
Simon Rieger
e7ba13e13d Update shellinabox.service 2017-01-14 11:15:16 +01:00
Simon Rieger
0edee2c12c Update README.md 2017-01-14 11:14:28 +01:00
Simon Rieger
ae78622a58 Update README.md 2017-01-14 11:06:07 +01:00
Simon Rieger
81695461b4 fixing 2017-01-14 11:02:37 +01:00
Simon Rieger
5c5c01ed10 Update auto.sh 2017-01-11 14:18:53 +01:00
Simon Rieger
08d6a40b85 webssh 2017-01-11 13:45:10 +01:00
Simon Rieger
456303fce5 auto script 2017-01-11 13:44:13 +01:00
Marc Singer
5c7fb5cde2 New release with bug fixes.
o Especially important is the OpenSSL fix.
2016-11-09 11:40:33 -08:00
Luka Krajger
05b2d3630c Issue #361: enable builds with MUSL libc
* Added configure option "--disable-utmp" which must be used when
  building with MUSL libc. This option disables login records which
  are stubed out in MUSL anyway.
* Added missing include "sys/ttydefaults.h".
2016-10-11 13:22:52 +02:00
Luka Krajger
d0d8c58882 Issue #384: compatibility with OpenSSL 1.1.0
* Direct usage of BIO struct members is removed for new versions of
  OpenSSL.
* Workaround for double BIO free in SSL_free() was updated to work
  with new and old OpenSSL versions.
* Note that this patch only fixes compatibilty when building with
  configure option "--disable-runtime-loading" (like it is done
  for Debia package.).
2016-10-08 16:10:53 +02:00
Luka Krajger
d4bd77ca45 Added "ready" event for iframe message passing
* When shellinabox is ready it sends "ready" message to parent window.
* Example file was updated with new use case.
2016-09-26 13:16:18 +02:00
Luka Krajger
8e28bb4c2a Merge pull request #391 from tomtor/freebsd
Fix a debug check on FreeBSD and probably Linux for HTTP connection termination.
2016-09-26 12:37:44 +02:00
Tom Vijlbrief
f408467088 Fix a debug check on FreeBSD and probably Linux
On FreeBSD 12.0 I get within a minute:

Check failed at libhttp/httpconnection.c:433 in destroyHttpConnection(): !close(http->fd)

See also:

https://github.com/shellinabox/shellinabox/issues/389

I assume that close() fails with ECONNRESET and that we should just check
for errno != EBADF, which should also be OK for Linux and other systems,
which might return EIO in some conditions.

Linux close(2) manual page:

	EBADF	fd isn't a valid open file descriptor.
	EINTR	The close() call was interrupted by a signal; see signal(7).
	EIO	An I/O error occurred.

FreeBSD close(2) manual page:

     [EBADF]            The fd argument is not an active descriptor.
     [EINTR]            An interrupt was received.
     [ENOSPC]           The underlying object did not fit, cached data was
                        lost.
     [ECONNRESET]       The underlying object was a stream socket that was
                        shut down by the peer before all pending data was
                        delivered.

     In case of any error except EBADF, the supplied file descriptor is
     deallocated and therefore is no longer valid.
2016-09-11 12:31:47 +02:00
Luka Krajger
e6c25e84bc Issue #381: Fixed segfaults at logging
* This patch correctly handles varargs being used two times in the
  same function.
2016-06-06 16:11:11 +02:00
Luka Krajger
cbac76e579 Merge pull request #380 from blakemcbride/master
Spelling and grammar corrections to README.md
2016-05-29 07:37:11 -04:00
Blake McBride
6e475e9686 Spelling and grammar corrections to README.md 2016-05-28 18:59:45 -05:00
KLuka
af162e282a Added shellinaboxd.pdf make target 2016-05-24 19:27:06 +02:00
Luka Krajger
78bed3070b Merge pull request #374 from blakemcbride/master
Changes to support APL characters (unicode)
2016-05-19 10:46:19 -04:00
Blake McBride
863a8d91c7 Changes to support APL characters 2016-05-13 19:15:15 -05:00
KLuka
628d41f32c Added checks and fixes code style 2016-05-06 11:21:14 +02:00
Luka Krajger
e05c6d8178 Merge pull request #372 from StefanAlexandruBogdan/master
free the sshPort to prevent memory leak and indent newly added code to preserve code styling
2016-05-05 16:18:05 -04:00
Alexandru Bogdan Stefan
fb262fb521 free the sshPort to prevent memory leak 2016-05-05 15:31:30 +03:00
Alexandru Bogdan Stefan
1558412cee Ident variable assignments to respect coding style 2016-05-05 15:28:55 +03:00
Luka Krajger
0f1e9ba31c Merge pull request #370 from StefanAlexandruBogdan/master
Add support for using ShellInABox with a custom port in SSH service.
2016-05-04 06:30:26 -04:00
Alexandru Bogdan Stefan
d34d5db9d9 Add support for using ShellInABox with a custom SSH port 2016-04-21 19:14:50 +03:00
Luka Krajger
048cecd2e7 Merge pull request #367 from a-detiste/master
typos
2016-03-09 13:36:54 -05:00
Alexandre Detiste
c8b6a3eddb typos 2016-03-09 19:30:26 +01:00
Luka Krajger
25425bad31 Merge pull request #366 from schoonc/fixtypo
fixes typo: ESVTETitle -> ESVTEtitle

Fixes the patch for #360.
2016-03-09 12:19:26 -05:00
Сорокин Александр
30e293d602 fixes typo: ESVTETitle -> ESVTEtitle 2016-03-09 19:26:25 +03:00
Luka Krajger
ee57908b49 Merge pull request #363 from tomtor/IE
adjust scale on IE

On IE 11 the computed width (nr of columns) is too large.
2016-03-01 03:22:11 -05:00
Luka Krajger
b778806356 Merge pull request #365 from mvanholsteijn/disable-peer-check
Disable peer check (issue #364)
2016-02-26 06:45:06 -05:00
Mark van Holsteijn
8fd68e147c add option --disable-peer-check to usage help text 2016-02-26 00:24:33 +01:00
Mark van Holsteijn
2034ae1ee5 option to disable the peer check when running behind AWS ELB 2016-02-26 00:01:09 +01:00
Tom Vijlbrief
490cfa0344 adjust scale on IE 2016-02-25 14:47:16 +01:00
Luka Krajger
f17bc266f8 Merge pull request #362 from druzus/master
2016-02-23 23:18 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

Edit and function keys pressed with CTRL, ALT or SHIFT modifiers generated wrong key sequences.
2016-02-24 07:04:21 -05:00
Przemysław Czerpak
790d578cc2 2016-02-23 23:18 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* shellinabox/vt100.jspp
    ! fixed key modifiers encoding.
      They should be calculated as bitfield for
         SHIFT = 1
         ALT   = 2
         CTRL  = 4
      and then incremented by 1.
      ref:
         http://www.xfree86.org/4.7.0/ctlseqs.html#PC-Style%20Function%20Keys
         http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-PC-Style-Function-Keys
2016-02-23 23:18:12 +01:00
KLuka
0c8c295c1a Issue #360: ignore VTE OSC6 and OSC7 escape sequences
* This patch ignores VTE OSC6 and OSC6 escape sequences, so that the
  current directory/file are not displayed in front of the shell prompt.
2016-01-23 16:17:17 +01:00
KLuka
141e641238 Raised version from 2.19 to 2.20 2016-01-23 16:03:32 +01:00
Luka Krajger
2c93404bd0 Merge pull request #357 from KLuka/issue-222
Issue #222: LOGIN service (can't reopen tty)
2016-01-04 10:56:18 -05:00
KLuka
4911d0d39c Issue #222: LOGIN service (can't reopen tty)
* Workaround for random "Session closed" issues related to /bin/login
  closing and reopening our pty during initialization. This happens only
  on some systems like Fedora for example. Now we allow that our pty is
  closed by ignoring POLLHUP on first read. Delay is also needed so that
  login process has some time to reopen pty.
* Note that the issue may occur anyway but with this workaround we reduce
  the chances.
2015-12-28 15:24:49 +01:00
Luka Krajger
d8ef7dad3c Merge pull request #356 from triska/master
fix typo: HTTPS --> HTTP
2015-12-11 09:28:34 +01:00
Markus Triska
dd9f1f01d1 fix typo: HTTPS --> HTTP 2015-12-10 20:03:44 +01:00
Marc Singer
1a8010f2c9 Changelog update before release. 2015-12-05 10:31:36 -08:00
KLuka
8a68194da2 Updated version to 2.19 2015-12-04 18:17:22 +01:00
KLuka
e026df75b0 Fixed spelling errors reported by lintian 2015-12-04 18:14:51 +01:00
KLuka
4aa0eb97e4 Disable HTTP fallback via "/plain" URL (CVE-2015-8400)
* Disabled all methods of HTTP fallback when HTTPS is enabled. This
  is enforced on server side so that even modified client code (JS)
  can not redirect client from HTTPS to HTTP, like it was possible
  before (issue #355).
* Current solution unfortunately also disables automatic upgrade from
  HTTP to HTTPS (when available), since all non-SSL connections are
  droped immediately.
2015-12-03 17:47:26 +01:00
KLuka
aaa00551bf Issue #119, #312, #354: Soft keyboard icon
* Added logic that enables soft keyboard icon by default on some
  clients like Kindle, PS Vita, iPad, ...
2015-11-17 19:43:22 +01:00
KLuka
106bc0aa85 Issue #354: iOS client compatibility
* Added more iOS clients that should use workaround to prevent ever
  groving console.
2015-11-17 19:36:10 +01:00
KLuka
f67073d33e Issue #350: Support for middle click paste
* Added limited support for middle click pasting. For most browsers
  and operating systems middle click pasting works only for concent
  selected in current shellinabox window.
2015-10-20 20:40:20 +02:00
Marc Singer
c87588613a Update version for release. 2015-10-10 10:54:36 -07:00
KLuka
e30c33d323 Issue #347: Added dummy release in Debian changelog
* This is needed so that manualy built Debian packages will contain
  latest version.
2015-09-17 10:39:43 +02:00
KLuka
973f1527bd Updated preview image in README 2015-09-06 21:32:13 +02:00
KLuka
cde2e92378 Issue #341: Fixed reverse video rendering
* Added new CSS class for handling reverse video with default terminal
  colors. For colors given with value 0-255 background and foreground
  values are just switched.
* New CSS classes were also added to Black On White and White On Black
  color themes.
2015-09-03 19:01:48 +02:00
KLuka
7dd9d4300c Minor improvements
* Use stdout for usage and version information. Patch taken from
  issue #344.
* Removed automatic usage display when command line parsing fails.
* Added version information in debug output.
2015-09-03 19:00:16 +02:00
KLuka
b58542eb99 Added CGI session key in HTTP response header
* Session key is returned in first HTTP response if CGI mode is used.
  Header filed is named 'X-ShellInABox-Session'. This can be used by
  some special applications that need unique token.
2015-09-03 18:04:15 +02:00
KLuka
8d3c5cdc3d Raised version to 2.19 2015-09-01 13:13:13 -04:00
Benji Wiebe
09e790bb27 Added config.cache to gitignore 2015-09-01 13:06:21 -04:00
KLuka
b828574899 Issue #103: Child process cleanup under PAM session
* Added signal handling in PAM session process. Now SIGHUP signals are
  forward to child process, which is the actual service. Launcher process
  uses this type of signals to terminate service on http connection
  timeout.
2015-08-30 22:48:14 +02:00
Luka Krajger
eb2968b1d0 Merge pull request #340 from BenjiWiebe/master
Added autoconf/automake stuff for compatibility with older auto* versions
2015-08-30 19:10:04 +02:00
Benji Wiebe
36f512cc63 Added explanatory comments 2015-08-28 23:42:09 -05:00
Benji Wiebe
284265651b Added autoconf/automake stuff for compatibility with older auto* versions 2015-08-28 23:15:13 -05:00
Luka Krajger
0d522a05ca Merge pull request #339 from BenjiWiebe/master
Added --disable-utmp-logging option
2015-08-28 20:44:16 +02:00
Benji Wiebe
3ff0ad5768 Added --disable-utmp-logging option 2015-08-27 23:16:06 -05:00
Luka Krajger
6f30739e33 Merge pull request #338 from BenjiWiebe/master
Kill children with HUP instead of TERM at end of session
2015-08-27 23:49:37 +02:00
Benji Wiebe
7f5064efcd Reset sigaction for SIGHUP to default in child 2015-08-27 14:08:39 -05:00
Benji Wiebe
145abf1fcc Kill children with HUP instead of TERM at end of session 2015-08-27 13:26:42 -05:00
KLuka
48a65d6bcb Fixed handling of large HTTP requests
* Protection against large HTTP requests was fixed by adding some null
  pointer checks. Too large HTTP requests are now correctly handled by
  returning error code and closing connection.
2015-08-26 23:27:06 +02:00
KLuka
6c9f98bf34 Logging and debuging
* Added prefixes to all log messages. Prefix should describe source of
  message, like "config", "http", "ssl", "server", etc... This should
  give users more info to figure out what went wrong or what is going
  on. Prefixes also make automatic processing easier.
* Usage is not displayed by default when given command line options are
  incorrect. This way it is easier to notice actual error.
2015-08-23 19:25:36 +02:00
KLuka
d74e60b6a7 Added system logging for important errors
* Messages with "fatal" or "error" log level are now also passed to
  syslogd service with help of vsyslog() function.
* On systems that use syslog service, these messages will be available
  in default system log files like /var/log/syslog or /var/log/messages.
2015-08-21 18:08:11 +02:00
KLuka
dfd885c011 Raised version 2015-08-21 17:44:06 +02:00
Marc Singer
acba554b6b Package release commit. 2015-08-07 20:53:15 -07:00
Luka Krajger
02838e530f Merge pull request #332 from KLuka/ssl
SSL patches
2015-08-06 18:22:07 +02:00
KLuka
1f54ff5f71 Added prefix to SSL related debug messages 2015-08-06 18:11:32 +02:00
KLuka
eacb2fcb81 Disable secure client-initiated renegotiation
* In case that this SSL feature is abused it is possible to overload the
  server. Other web servers disable this feature by default, but users
  are able to change it with configuration. This is not possible with
  shellinabox as this feature is not needed.
* Solution was implemented similary as in Lighttpd web server.
2015-08-06 18:06:11 +02:00
KLuka
f0437832d3 Added support for Perfect Forward Secrecy (#331)
* Support for PFS is enabled with help of chiper suits that use ECDHE
  key exchange. OpenSSL added support for eliptic curve operations (EC)
  in version 0.9.8. Note that there are also some library distributions
  which don't support EC operations.
* Added precompiler guards for builds with OpenSSL older than 0.9.8 and
  builds with '--enable-runtime-loading' configure script option.
* Cleaned up some SSL related code.
2015-08-05 17:57:05 +02:00
KLuka
477818e088 Fixed broken visual bell style in default CSS 2015-07-27 20:08:47 +02:00
KLuka
7cc877cdd8 Clean up build and lintian warnings (#328)
* Added wrapper macros to suppress compiler warnings about unused return
  values of setres*id() functions. We don't need checks at that point
  as it does't affect our program.
* Added marco in configure.ac script to overwrite default AR_FLAGS,which
  were causing build warnings.
* Removed debian/watch file as is not needed anymore, because now this
  is native Debian package.
2015-07-27 19:57:19 +02:00
Marc Singer
8ac3a4efcf Release to guarantee upgrade. 2015-07-24 11:54:39 -07:00
Marc Singer
7794fa4f64 Merge remote-tracking branch 'refs/remotes/origin/master' 2015-07-24 09:44:50 -07:00
Marc Singer
001613b538 Changing to native package.
o Debian source type is 3.0 native.
o Properly builds package elements ready for release.
o Merging Alexandre's changelog entry with this one and retaining 2.15
  version number.
2015-07-24 09:23:27 -07:00
Marc Singer
655d0a3b0d Improving cleanliness.
o Some files in the demo/ directory were committed and should not have
  been.  These are removed.
o Cleaning includes removing demo/ directory transients.
o Debian rules explicitly perform demo/ cleanup so that source tarball
  is correct.
o Resolves #329
2015-07-24 09:23:27 -07:00
KLuka
9dcef5688f Added Github url in context menu "About..." popup 2015-07-24 16:08:05 +02:00
Luka Krajger
f8f937608c Merge pull request #325 from sroeder/master
Added @ character to the list of valid username characters.

* This allows login with "bad" username, even if shellinabox is configured to
  run with SSH service. For LOGIN service this was always possible.
2015-07-21 18:43:27 +02:00
Scott Roeder
34bbeab314 Added @ character to the list of valid username characters. 2015-07-21 12:27:24 +04:00
KLuka
b4de69ed5c Fixed option --service for running custom scripts
* Full path of command is passed to function execvp(), when we launch
  user defined service. This was broken since commit b3309b2.
2015-07-17 13:43:01 +02:00
KLuka
458cd7aa8f Minor improvments
* Added "reconnect" and "onsessionchange" message types to use with
  embedded terminal. Usage examples were added to misc/embedded.html
  file.
* Improved code for unix domain socket functionality.
2015-07-09 21:51:43 +02:00
KLuka
bdca920abc Another update for unix domain sockets support
* Changed initialization of variables and handling of unix socket path.
* Added fixes for command line argument parsing, that I forgot in previous
  commit.
2015-07-07 10:48:14 +02:00
KLuka
c6186530bb Minor fixes for unix domain sockets
* Improved user input checking and error handling for code from #320.
* Added some guards for unlinking socket file in server init and destroy
  functions.
* Added peer name handling for AF_UNIX type connections in HTTP handling
  code.
2015-07-06 22:02:54 +02:00
Luka Krajger
c7b41ad4ce Merge pull request #320 from rkd77/unixdomain
Unix domain sockets support.
2015-07-06 21:14:22 +02:00
Witold Filipczyk
4d8ec30100 Unix domain sockets support.
The socket is not removed on shutdown, but the rest seems to work.
2015-07-01 13:06:04 +02:00
Luka Krajger
8f38e7873b Merge pull request #317 from KLuka/messages
Message passing to embedded shellinabox

* Added ability to pass messages to or from shellinabox embedded iframe.
* Added example file.
2015-06-19 09:22:18 +02:00
KLuka
fb4ebaf01f Improved message passing info and examples 2015-06-17 18:11:59 +02:00
KLuka
4f32ae3f2f Message passing examples for embedded shellinabox
* Added misc/embedded.html file with more info and actual examples
  on message passing to or from embedded shellinabox frame.
2015-06-16 22:30:02 +02:00
KLuka
1676f1a887 Message passing support for embedded shellinabox
* Added basic support for message passing to or from embedded
  shellinabox iframe. Now we can write to terminal, read the
  terminal output and request session status from parent window.
* This functionality must be enabled with command line parameter
  "--messages-origin ORIGIN". Value ORIGIN, which is compared with
  message against received message origin, must be set to specific
  url, or to "*" to allow messages from any origin.
2015-06-16 18:54:39 +02:00
KLuka
bcac95b9fa Issue #63, #315: only one line is displayed
* Changed detection for when terminal is embedded in another element.
  Now we allow one pixel difference between calculated terminal width
  and body width. This needs to be done because some browsers report
  wrong width in offsetWidth property, when browser zoom is in use.
* Updated README
2015-06-12 15:53:57 +02:00
Luka Krajger
14d44513ff Merge pull request #316 from gitter-badger/gitter-badge
Add a Gitter chat badge to README.md
2015-06-11 13:06:12 +02:00
The Gitter Badger
8029a2d9dd Added Gitter badge 2015-06-11 10:57:38 +00:00
Luka Krajger
4f9c682860 Updated README 2015-06-06 15:06:47 +02:00
KLuka
b3309b23d8 Fixes for some defects found by Coverity
* Added more checks for return values and null pointers.
* Removed some dead code and unused variables.
* Fixed handling of calls to exec() family functions. If this functions
  fail we need to cleanup resources.
2015-05-31 13:04:00 +02:00
Luka Krajger
21c8d8e0b7 Merge pull request #314 from a-detiste/master
debian: preserve user options on upgrade
2015-05-28 19:39:24 +02:00
Alexandre Detiste
4ccab0aa0d debian: also work correclty when _all_ options have been disabled
make #DEBHELPER# future-proof (now a no-op)
2015-05-27 17:14:50 +02:00
Alexandre Detiste
f77c7d06a5 debian: preserve user options on upgrade 2015-05-27 15:00:49 +02:00
KLuka
6402688084 Improved code session and URL handling
* URL dependency was removed from session handling code. URL object
  was only needed to get session key from client request. This was
  moved somewhere else to achive better code reusability.
* Added URL parsing functionality that can be used without URL object.
2015-05-26 22:37:32 +02:00
Luka Krajger
fad30cd57c Merge pull request #311 from KLuka/colors
Solution for issue #255, manuals update
2015-05-23 10:40:43 +02:00
KLuka
8923598a6d Improved terminal cursor style
* Changed "dim" cursor visibility from invisible to almost transparent
  and in the same color as default background. This improves visibility
  of cursor, if we are usign application (like vim for example) with
  dark background and the "Black on White" user CSS is set.
2015-05-23 10:38:08 +02:00
KLuka
9bb3b787ae Updated manuals for SSH service 2015-05-21 09:51:59 +02:00
KLuka
0a2ba7c052 Issue #255: Fixed "White on Black" color theme
* Changed handling of ANSI escape codes. Now we detect when to use
  default colors and when to use explicit ANSI colors.
* Added new CSS classes "ansiDef" and "bgAnsiDef" for default terminal
  foreground and background. Before we were using "ansi0" and "bgAnsi15"
  for default bg/fg colors. This was causing problems, when "White on
  Black" color theme modified their values. Now just this two classes
  are changed when user changes his color theme.
2015-05-20 16:50:32 +02:00
KLuka
e6a6857cb1 SSH service debugging and addtional information
* Changed ssh command log level from QUIET to FATAL. This will help
  users with debugging in case of errors related to SSH service.
  (See issues #112, #310)
* Added more information about SSH service in manual page. For SSH
  service to work, sshd server needs to be running on local system
  and must be configured to accept password authentication.
2015-05-19 21:39:11 +02:00
Luka Krajger
ce25d2f2b1 Merge pull request #309 from KLuka/realip
Real IP recognition over proxy

* Recogniton of HTTP header field 'X-Real-IP' was added. Value
  is used in LOGIN service with peer name as remote host identifier.
  This was we are able to see real IP in login related log files
  such as /var/log/auth.log, etc...

  Example for failed logins over nginx as can be seen in `/var/log/auth.log` file:
  ```
  May 17 20:17:20 luka-ubuntu login[9888]: FAILED LOGIN (1) on '/dev/pts/20' from '127.0.0.1, 192.168.1.100' FOR 'UNKNOWN', User not known to the underlying authentication module
  May 17 20:17:25 luka-ubuntu login[9888]: FAILED LOGIN (2) on '/dev/pts/20' from '127.0.0.1, 192.168.1.100' FOR 'luka', Authentication failure
  ```


* Real IP, peer name and URL are also passed to launched  service
  as environment variables (SHELLINABOX_PEERNAME, SHELLINABOX_REALIP
  and SHELLINABOX_URL). This can be used by custom user service shell
  scripts or programs.

  ```
  SHELLINABOX_REALIP=192.168.1.100
  SHELLINABOX_URL=http://192.168.1.150:81/
  SHELLINABOX_PEERNAME=127.0.0.1
  ```

* Real IP can also be passed to custom user service as command line
  parameter ${realip}.

  See this example:
  ```
  ./shellinaboxd --service  '/:luka:luka:/:/home/luka/test.sh --peer ${peer} --realip ${realip}'
  ```
2015-05-19 09:54:09 +02:00
KLuka
17dd88e804 Real IP recognition over proxy (man, help)
* Manual page and output of --help parameter were updated according
  to changes in previous commit.
2015-05-18 16:28:14 +02:00
KLuka
883b7aa7f0 Real IP recognition over proxy (partial fix #54)
* Recogniton of HTTP header field 'X-Real-IP' was added. Value
  is used in LOGIN service with peer name as remote host identifier.
  This was we are able to see real IP in login related log files
  such as /var/log/auth.log, etc...
* Real IP, peer name and URL are also passed to launched  service
  as environment variables (SHELLINABOX_PEERNAME, SHELLINABOX_REALIP
  and SHELLINABOX_URL). This can be used by custom user service shell
  scripts or programs.
* Real IP can also be passed to custom user service as command line
  parameter ${realip}.
2015-05-17 20:05:15 +02:00
Luka Krajger
89d4a87c53 Merge pull request #308 from a-detiste/master
clean up debian/rules
2015-05-16 18:14:18 +02:00
Alexandre Detiste
955c7cdd46 debian: use coherant casing for user css options 2015-05-15 20:36:29 +02:00
Alexandre Detiste
b460a0ba72 debian: close release metabug 2015-05-15 18:17:56 +02:00
Alexandre Detiste
97813e9235 clean up debian/rules
so much more simple to read, yet it yelds an identical .deb

For people building the package without debian tools,
the 4 *.css won't be installed in /usr/share/doc/shellinabox;
anymore, but those aren't _documentation_,
merely sample configuration files.

The stubby Changelog "Please see CHANGELOG.md" is replaced
by a symlink; that explains the size increase of 6kb;
but Debian package should by policy ship the upstream
CHANGELOG if avaible.

```
debdiff GOOD_shellinabox_2.15-1_armhf.deb shellinabox_2.15-1_armhf.deb

File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------

Installed-Size: [-510-] {+516+}
```
2015-05-15 15:49:32 +02:00
Luka Krajger
458d441e75 Merge pull request #300 from KLuka/usercss
User CSS related fixes
2015-05-14 16:31:15 +02:00
KLuka
94a7f6339f User CSS minor typo fix
* Fixed typo for context menu option "Black On White"
2015-05-14 12:52:10 +02:00
Luka Krajger
62c36796fb Merge pull request #306 from a-detiste/master
VCS_VERSION: remove Subversion support, add support for Git & tarball
2015-05-14 12:43:25 +02:00
Alexandre Detiste
f3bb90eaf4 VCS_VERSION: remove Subversion support, add support for Git & tarball
building from tarball can be tested this way:

rsync -avix . /tmp/shellinabox --exclude-from=.gitignore --exclude=.git --delete --delete-excluded
(cd /tmp/shellinabox && autoreconf -i && ./configure && make && ./shellinaboxd --version)
2015-05-14 12:34:47 +02:00
KLuka
9d87e59356 User CSS initialization fix (issue #138)
* Now we use onload event to disable user CSS accoring to default
  or user settings. Problem was that we were setting the 'disabled'
  attribute on unloaded stylesheet. This should work in all moderen
  browsers.
2015-05-14 11:12:35 +02:00
Luka Krajger
89e40c5e3a Merge pull request #303 from a-detiste/master
fix building with debuild
2015-05-13 23:06:13 +02:00
Alexandre Detiste
29b12cba45 README.md: only 'apt-get install' the minimum
apt-get will resolve depedencies automatically
2015-05-13 10:25:07 +02:00
Alexandre Detiste
3d7c86f504 README.md: add dh-autoreconf depedency 2015-05-13 10:05:14 +02:00
Luka Krajger
3b40013406 Added build status to README.md 2015-05-13 09:30:10 +02:00
Alexandre Detiste
b244e3ffc8 ignore files generated by debuild 2015-05-13 09:00:20 +02:00
Alexandre Detiste
26d8a34638 debian: use dh-autoreconf 2015-05-13 08:56:30 +02:00
Alexandre Detiste
b54b3fa3f7 remove more autogenerated cruft 2015-05-13 08:55:29 +02:00
KLuka
371f061279 Project cleanup of build and demo files
* Removed autogenerated build files
* Removed autogenerated demo files
* Updated .gitignore
2015-05-12 20:02:59 +02:00
Luka Krajger
597890ed33 Merge pull request #299 from a-detiste/master
Refresh debian packaging
2015-05-12 18:18:34 +02:00
KLuka
e341a3e97c User CSS context menu settings fix
* Fixed initialization of user CSS settings from cookie. Now we the correct
  values are being read. This could be possible fix for issue #138.
* Changed generation of CSS link elements to get rid of JS deprecated
  warnings.
2015-05-12 16:46:53 +02:00
Alexandre Detiste
e59a2e32ae .gitignore 2015-05-12 14:52:15 +02:00
Alexandre Detiste
49d7515509 refresh Debian packaging
handle lintian file automatically
2015-05-12 14:45:56 +02:00
Luka Krajger
cb2c39c502 Merge pull request #298 from tickelton/fix_243
Issue #243: Cannot look up group "shellinabox" at service start
2015-05-08 16:39:10 +02:00
tickelton
5f1aaea6f1 Issue #243: Cannot look up group "shellinabox" at service start
_SC_GETGR_R_SIZE_MAX was treated as a maximum buffer size while
it should only be a proposition for an initial size.

The buffer size is now increased dynamically if the initial size
is not sufficient.
2015-05-08 09:03:16 +02:00
Luka Krajger
5372964801 Merge pull request #297 from Thubo/master
Added libtool and autoconf to build dependencies in README.md
2015-05-06 16:07:14 +02:00
Matthias Thubauville
8cfce23076 Added libtool and autoconf to build dependencies in README.md 2015-05-06 10:06:21 +02:00
Luka Krajger
170704671c Merge pull request #296 from tickelton/fix_disable-ssl
Fix build with --disable-ssl
2015-05-02 16:37:53 +02:00
tickelton
228dd0c69c fix build with --disable-ssl
Commit b06b1f15ac broke the configure option
"--disable-ssl" as the function sslMakeContext() was not enclosed in an
"#if defined(HAVE_OPENSSL)" statement.
2015-05-02 16:12:33 +02:00
KLuka
8e09b8f2a6 Added empty m4 directory for autotools 2015-04-27 16:20:44 +02:00
KLuka
f0014c3a7a Firefox keyboard fix (German layout)
Some keycodes were moved from "normalKey" flag under "alphNumKey" flag.
2015-04-22 21:42:01 +02:00
KLuka
273be9b295 Update of project build scripts
* Updated README.md with additional instructions
* Updated configure.ac and Makefile.am to remove configuration warnings

Fixes were made according to information from issue #295
2015-04-22 11:04:22 +02:00
KLuka
c13170fe33 Minor typo and font fixes
* Added "Consolas" to terminal font stack
* Fixed some typos in README.md
* Fixed consistency of "attrFg" and "attrBg" in VT100 class
2015-03-19 22:33:49 +01:00
KLuka
fc89cb1ad5 Issue #105: Extend vt100.js to support xterm 256 colors
Now we are able to catch 38 and 48 ANSI escape codes in csim funcion. This two codes
define extended foreground/background color of terminal output in 256 color mode.

This enables us to add CSS classes "ansi0-ansi255" and "bgAnsi0-bgAnsi255" to related
output sections. Colors defined in CSS classes are the same as xterm colors.
2015-03-19 18:48:01 +01:00
KLuka
62871a605d Issue #186: Does not build on OpenBSD
* Added stdint.h include for uintptr_t compilation error
2015-03-17 13:32:05 +01:00
KLuka
38362b591e Better handling of Ctrl-W event
* IE doesn't trigger warning when session is closed
* IE and Firefox actually sends Ctrl-W event to terminal
* In Chrome user still gets warning and event is NOT sent to terminal
2015-03-14 13:30:18 +01:00
Luka Krajger
57cb829be9 Update README.md with Debian info
This update is related to issues: #227, #181, #193 ...
2015-03-13 13:09:19 +01:00
KLuka
1fc7a14c19 Updated README.md
* Added preview image
* Added sections Build and Issues
2015-03-12 15:28:14 +01:00
Philip Hughes
252dbaed88 Automake requires ChangeLog file
Add a placeholder to point the user to CHANGELOG.md instead (thanks
automake).
2015-03-11 16:40:42 +01:00
KLuka
cca02b1fee Issue #52: Emacs refresh is slow
When new process is launched default terminal speed is correctly set to 38400.
This improves usage of Emacs editor and perhaps some other applications.

This is also partial fix for issue #58
2015-03-11 16:21:15 +01:00
Luka Krajger
2f2d6ffabf Merge pull request #294 from Grimthorr/changelog
Fix build error caused by #293
2015-03-11 14:18:08 +01:00
KLuka
596776756d Merge branch 'KLuka-master' 2015-03-11 13:48:15 +01:00
Philip Hughes
52acf0a6f2 Update change log file name in Makefiles 2015-03-11 12:46:16 +00:00
KLuka
5f1d52c53b Merge branch 'master' of git://github.com/KLuka/shellinabox-1 into KLuka-master
Conflicts:
	ChangeLog
2015-03-11 13:46:04 +01:00
KLuka
cb3957f770 Issue #51: backtick key not working in Chrome
This patch was created with help from @dezza
2015-03-11 18:39:46 +01:00
Ezra Buehler
284d90ccc4 Remove trailing whitespace 2015-03-11 17:56:36 +01:00
Ezra Buehler
1dd42d66c2 Add menu option "Disable Alt Key"
This makes the application usable for Mac OS clients using international
keyboards.

This patch was modified to fit in our fork by @KLuka.
2015-03-11 17:41:44 +01:00
Luka Krajger
6984ce4b56 Merge pull request #293 from Grimthorr/changelog
Adds CHANGELOG.md
2015-03-11 13:18:49 +01:00
Philip Hughes
a129d17072 Update CHANGELOG.md 2015-03-11 12:07:12 +00:00
Philip Hughes
50ef89cc54 Implement a change log
Replaced old change log file with a GitHub-friendly version which
loosely follows the keepachangelog.com convention.
2015-03-11 11:42:08 +00:00
Luka Krajger
4ced3d2738 Merge pull request #290 from Grimthorr/master
Swap to gzip compression (drops support for IE6)
2015-03-10 12:22:41 +01:00
KLuka
b2f039d9c2 Fixed error from previous merge 2015-03-10 17:51:25 +01:00
Philip Hughes
939068c533 Swap to gzip compression (fixes #262 and #266)
Instead of making the browser sniffing more complicated, it's probably
better to use code that works for all current browsers. As such, this
swaps to use gzip compression encoding instead of deflate and drops the
IE browser sniffing code. This means shellinabox works in IE11 and
should work in every version of IE since IE7. From this commit, IE6 is
no longer supported. Thanks @lfourquaux.
2015-03-10 10:21:20 +00:00
Luka Krajger
5a69cc67ca Merge pull request #289 from KLuka/master
Keyboard icon, some html fixes ...
2015-03-10 10:51:55 +01:00
Guillaume Martres
a75bacb840 Set the encoding of .html files to UTF-8 2015-03-10 17:15:06 +01:00
Daniel Gröber
6d5b639816 Fix <input> element type
type="textfield" is invalid, however most browsers seem to default to
type="text" so this must have been overlooked.

This patch was modified to fit in our fork by @KLuka.
2015-03-10 17:13:47 +01:00
KLuka
25921c9961 Issue #173: Keyboard icon on dark background
Keyboard icon was not visible on dark background. This fixes icon to work well
on light and dark background. Image was fixed by @Grimthorr.

Copy of icon was removed from demo directory.
2015-03-10 17:04:06 +01:00
Luka Krajger
2754240709 Merge pull request #288 from KLuka/master
Another (final) fix for Firefox keycodes problems
2015-03-08 21:50:54 +01:00
KLuka
3570f20b0b Another (final) fix for Firefox keycodes problems
This patch adds new Firefox codes as normal keys.

Patch was taken from issue #202 comments, and merged to fit in our
code. Previous related patches were removed.

https://code.google.com/p/shellinabox/issues/detail?id=202#c23
2015-03-08 21:30:42 +01:00
Luka Krajger
ccbad6b906 Merge pull request #287 from KLuka/master
Keyboard fixes, raised version, ...
2015-03-08 16:06:31 +01:00
KLuka
61184ca8a5 Raised version to 2.15 2015-03-08 15:36:50 +01:00
KLuka
46ea812284 Removed at sign (@) from beggining of some JS comments
Posts from issue #118 tells us that at signs in JavaScript comments could produce
some troubles in IE browsers.

This related to something called "contional compilation" in JS ...
2015-03-08 15:14:20 +01:00
KLuka
699132d536 Issues #51, #202 ... : Keycodes fixes for FireFox
Added keycodes for handling <, >, + and * on Firefox 15+.
2015-03-08 14:50:25 +01:00
Luka Krajger
cc3f2fe917 Merge pull request #286 from KLuka/master
Partial fixes for issues #103, #203, #195 and README.md
2015-03-06 13:43:12 +01:00
KLuka
26fbc157ca Added README.md with basic info 2015-03-06 16:39:33 +01:00
KLuka
502891c626 Issue #195: A couple of bugs in vt100.jspp ...
Applied some fixes from issue comments.

https://code.google.com/p/shellinabox/issues/detail?id=195
2015-03-06 16:39:13 +01:00
KLuka
91f6eabe49 Issue #103, #203: Child process termination (partial fix)
When browser tab/window is closed during active session, child process
stays alive forever (even if shellinaboxd is terminated).

This fix works only if shellinaboxd is started without root privileges.
Droping them at runtime doesn't help either. Issue is related to PAM
session management process.

If we start shellinaboxd with root priviliges this fix will not affect
anything.

* When session timeouts cleanup procedure is triggered. Procedure is executed
in launcher process, because this is parent of child (service) process.
There we execute checks, if we have correct child pid (stored in session) and
than we can terminate process.
* Added debug information about cleaning up child process

https://code.google.com/p/shellinabox/issues/detail?id=103
https://code.google.com/p/shellinabox/issues/detail?id=203
2015-03-06 16:39:02 +01:00
Luka Krajger
68b5a487b4 Merge pull request #285 from KLuka/master
SSL patches, HTTP timeout patch
2015-03-05 18:36:58 +01:00
KLuka
97521bbfeb Issue #275: gracefully manage HTTP time-outs and connection problems
Patch reference: e69132f3762bd57a328dfc40b645d670d651afe7
Patch message:

When connecting to shellinabox through an HTTP Proxy, we need to be careful
in holding the HTTP/S connection with unbound pending HTTP-POST as they would
occupy one thread in the outbound proxy.

We do need to make sure that:
- HTTP POST will graceful time-out from the client side, if no data is returned
  by the server in 30s (gives the impression to the HTTP Proxy that the "page load"
  is completed after tha time and then would release the thread)
- In case of connection errors, the browser doesn't retry with a short loop but
  waits 1s before trying again. This prevent the browser freezing and the CPU looping.
2015-03-05 18:34:21 +01:00
Jonathan G Rennison
490781d998 Add dynamic linking for functions required by SSL v2/3 disabling patch. 2015-03-05 18:02:09 +01:00
Anders Kaseorg
b06b1f15ac Set SSL options for increased security
Disable SSLv2, SSLv3, and compression; generate new DH or ECDH keys
during each handshake; always start a new session on server
renegotiation; set a strong cipher list.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

[ Patch from https://code.google.com/p/shellinabox/issues/detail?id=215 ]
2015-03-05 18:00:16 +01:00
KLuka
4f0b949081 IE 11 - This page can’t be displayed (Issue #262)
Now we are able to identify IE11 as MSIE browser and disable
compresion.

Patch taken from issue comments.

https://code.google.com/p/shellinabox/issues/detail?id=262
2015-03-05 17:26:47 +01:00
KLuka
bd3f0bd9fd Debug info and minor fix on child process exit (service exit)
* Added debug information when child process exits
	- pid of child process (service)
	- exit code (this should help for debuging issues related to "Session closed")

* Fixed status checking from waitpid() when child process exits
	- before we were checking wrong variable (checks were allways true)
	- now we use correct status variable
2015-03-05 17:23:24 +01:00
KLuka
7e0374b783 Issue #180: Ever growing console occurs in iPad
Patch taken from comments.

More info: https://code.google.com/p/shellinabox/issues/detail?id=180
Refernece: 7ba55246327ad9934ed5d082a12b6cc73f381511
2015-03-05 17:17:41 +01:00
KLuka
8e68059b50 Issue #202: "-_" keys don't not work in FF > 15
Added new keycodes for Firefox

More info: https://code.google.com/p/shellinabox/issues/detail?id=202
Refernece: 49b538590ea57da76a0af895a23c521c9a4538be
2015-03-05 17:10:55 +01:00
Ezra Buehler
821ee789c4 No longer set HTTP Content-Length 2015-03-05 16:27:35 +01:00
KLuka
33813cd46d Issue #245: Blank screen in Chrome 31.0.1650.57
Applied patch and fixed some formating.

Patch: https://code.google.com/p/shellinabox/issues/detail?id=245#c5
2015-03-05 16:15:12 +01:00
KLuka
618999f3cc Issue #114: popup warning on tab/window close
JS `window.onbeforeunload` handler was added, and it will be
trigger if session is active.

Reference: 6693512fde244cbb7f10e0033d4b4e5ec1b20e32
2015-03-05 15:46:13 +01:00
Luka Krajger
1dd54b224b Merge pull request #284 from KLuka/master
Some fixes
2015-03-05 15:32:24 +01:00
Luka Krajger
79574d8ac4 Merge pull request #283 from KLuka/cleanup
Project cleanup

* Updated .gitignore
* Autogenerated .js files were removed.
* Fixes for issues 39, 43, 166 and 172 were transferred from .js to .jspp files
2015-03-04 16:17:29 +01:00
KLuka
6336e9f376 Issues 39, 43, 166 and 172 commits applied to .jspp files
Autogenerated .js files with fixes were removed. Patches were taken
from commits:

* 7d396c8273
* b7dac10ec1
* ea179e89f7
* b74ddd066b
2015-03-04 17:01:06 +01:00
KLuka
7b7a844175 Updated .gitignore 2015-03-04 15:37:47 +01:00
KLuka
7859ad6868 Updated .gitignore and removed autogenerated .js files 2015-03-04 15:28:32 +01:00
124 changed files with 4477 additions and 49242 deletions

58
.gitignore vendored Normal file → Executable file
View file

@ -1,4 +1,62 @@
*.o *.o
*.la
*.lo *.lo
*~ *~
.libs .libs
.deps
.dirstamp
aclocal.m4
autom4te.cache
certificate.pem
compile
config.cache
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
debian/autoreconf.after
debian/autoreconf.before
debian/files
debian/*.debhelper.log
debian/*.debhelper
debian/*.substvars
debian/shellinabox/
debian/tmp/
demo/beep.wav
demo/demo.js
demo/enabled.gif
demo/favicon.ico
demo/keyboard.png
demo/print-styles.css
demo/styles.css
demo/usercss-*.css
demo/vt100.js
depcomp
INSTALL
install-sh
libtool
ltmain.sh
Makefile
Makefile.in
missing
m4/
shellinabox/beep.h
shellinabox/cgi_root.h
shellinabox/enabled.h
shellinabox/favicon.h
shellinabox/keyboard.h
shellinabox/keyboard-layout.h
shellinabox/print-styles.h
shellinabox/root_page.h
shellinabox/shell_in_a_box.h
shellinabox/shell_in_a_box.js
shellinabox/styles.h
shellinabox/vt100.h
shellinabox/vt100.js
shellinaboxd
shellinaboxd.1
shellinaboxd.ps
stamp-h1

0
AUTHORS Normal file → Executable file
View file

544
CHANGELOG.md Executable file
View file

@ -0,0 +1,544 @@
# Change Log
All notable changes to this project will be documented in this file.
## 2015-03
Contributors: [Luka Krajger](https://github.com/KLuka), [Philip Hughes](https://github.com/Grimthorr), [Daniel Gröber](https://github.com/DanielG), [Ezra Buehler](https://github.com/easybe), [Anders Kaseorg](https://github.com/andersk), [Jonathan Rennison](https://github.com/JGRennison), [Guillaume Martres](https://github.com/smarter)
- Swap to gzip compression (fixes #262 and #266).
- Set the encoding of .html files to UTF-8.
- Fix <input> element type.
- Issue #173: Keyboard icon on dark background.
- Another (final) fix for Firefox keycodes problems.
- Removed at sign (@) from beginning of some JS comments.
- Issues #51, #202 ... : Keycodes fixes for FireFox.
- Issue #195: A couple of bugs in vt100.jspp.
- Issue #103, #203: Child process termination (partial fix).
- Merge pull request #285 from KLuka/master.
- Issue #275: gracefully manage HTTP time-outs and connection problems.
- Set SSL options for increased security and disable compromised SSL
version 2.0 and 3.0.
- Issue #262: Page cannot be displayed.
- Issue #180: Ever growing console occurs in iPad.
- Issue #202: "-_" keys don't not work in FF > 15.
- No longer set HTTP Content-Length.
- Issue #245: Blank screen in Chrome 31.0.1650.57.
- Issue #114: popup warning on tab/window close.
- Issues 39, 43, 166 and 172 commits applied to .jspp files.
- Removed auto-generated .js files.
## 2012-04 Marc Singer <elf@woollysoft.com>
- Fixing errors reported by piuparts.
- Debian build now defaults to direct link with shared libraries.
- Removing PATH_MAX reference.
- Fixing Valgrind discovered issues.
- Issue 172: autocorrect/autocapitalize can cause problems on
mobile devices.
- Issue 167: Accept connections in subfolders.
- Issue 39: Clipboard not integrated with client operating system
- Cleanup of debian control file before 2.11.
- Issue 166: Color goes away.
- Issue 167: Accept connections in subfolders.
## 2012-03 Marc Singer <elf@woollysoft.com>
- Issue 134: How to add arguments.
- Issue 116: A shellinthebox runner / configuration file.
- Issue 93: openssl required install-time.
- Issue 50: SSH service not working on Centos/RHEL.
- Issue 49: Debian packageing uses cross-directory hardlinks.
- Issue 47: Does not build on Mac OSX.
- Issue 43: 2.10 version introduces a keyboard layout problem.
- Issue 39: clipboard not integrated with client operating system.
## 2012-02-02 Jay Weisskopf <jay@jayschwa.net>
- Use 2048-bit RSA keys for auto-generated certificates.
- Assume a private key is RSA if the header does not specify a type.
## 2012-01-12 Anders Kaseorg <andersk@mit.edu>
- sslGenerateCertificate: Don't use the shell.
- sslSNICallback: Properly disallow invalid characters.
- Fix miscellaneous strncat buffer overflows.
## 2012-01-04 Jay Weisskopf <jay@jayschwa.net>
- Fixed an error in the init script's status function.
- Check for null pointers from gethostbyname_r() to prevent seg faults.
## 2012-01-01 Jay Weisskopf <jay@jayschwa.net>
- Removed "Lucida Console" font because bold is wider than normal.
- Bold and underline SGR attributes now utilize CSS.
- Removed color pair restrictions.
- Removed config.h. It is auto-generated by the configure script.
- Changed the cursor color to match the default text color.
- Write the OSC title to the window's title instead of the status bar. …
## 2010-10 Markus Gutschke <markus@shellinabox.com>
- Fixed inefficient I/O behavior and ability to interrupt long running
output with CTRL-C.
- Fixed confusing error message when we fail to dynamically load
PAM support.
- Fall back to calling select() instead of poll() for MacOS X.
## 2010-09 Markus Gutschke <markus@shellinabox.com>
- Implement a few work-arounds to avoid some problems with
pututxline() on MacOS X.
- Relax a check() that would trigger when using old-style
(pre-Unix 98) pseudo terminals.
- Another iteration of changes intended to deal with MacOS X
specific build.
- In an attempt to reduce build dependencies, remove the requirement
for objcopy. Instead, we are now using "od" to generate C source code.
- Added support for building with toolchains that don't support
symbol aliasing.
- Adjusted MIME types.
- Store keyboard layout in separate HTML file.
## 2010-09-11 Markus Gutschke <markus@shellinabox.com>
- Added --pidfile= option that can be used even if running in the
foreground.
## 2010-09-04 Markus Gutschke <markus@shellinabox.com>
- Added an optional on-screen keyboard. Must be activated by the
user by selecting the option in the context-menu.
## 2010-09-03 Markus Gutschke <markus@shellinabox.com>
- Fix some scaling related issues. This fix is thanks to some
excellent detective work by Jan <siev...@zedat.fu-berlin.de>.
- Allow changing of font sizes in the user CSS.
## 2010-08-19 Markus Gutschke <markus@shellinabox.com>
- Thanks to lotr44's excellent analysis of the problem, we now have
a fix for the problem with typing "!" on French keyboards.
## 2010-08-06 Markus Gutschke <markus@shellinabox.com>
- Allow users to disable the blinking cursor from the context menu.
## 2010-07-08 Markus Gutschke <markus@shellinabox.com>
- Added support for systems that have utmpx.h, but don't implement
updwtmpx().
## 2010-07-02 Markus Gutschke <markus@shellinabox.com>
- Fixed a NULL pointer dereference that can occur when hostnames
do not resolve. Thanks to <vmagerya> for pointing out this problem.
## 2010-03-31 Markus Gutschke <markus@shellinabox.com>
- Tweaked the build system to work better on OpenWRT. This is largely
thanks to very helpful bug reports, and lots of testing by Jan Jaeger.
## 2010-03-29 Markus Gutschke <markus@shellinabox.com>
- Started working on support for WebSockets.
- Fixed some compiler warnings when compiling with -Wextra
- Thanks to Jan Jaeger's excellent bug report, made some changes
that should make it easier to build ShellInABox for OpenWRT.
## 2009-12-10 Markus Gutschke <markus@shellinabox.com>
- Add .note.GNU-stack to all object files so that the generated
binary doesn't erroneously request an executable stack.
## 2009-12-03 Markus Gutschke <markus@shellinabox.com>
- Allow retrieval of the user's default login shell from
/etc/passwd.
- Allow the code to be built without support for the LOGIN
service, as calling /bin/login does not work well on Fedora.
## 2009-12-02 Markus Gutschke <markus@shellinabox.com>
- Added fallback code that dynamically computes the correct commandline
arguments for "objcopy" if building for an otherwise unknown target
platform.
## 2009-12-01 Markus Gutschke <markus@shellinabox.com>
- Added some basic sanity checks to the commit script that now makes
sure we at least attempt to keep copyright dates updated whenever we
make changes.
- Added checks that the debian/changelog file is up-to-date
- Added debian/watch file
- Updated the Standards-Version in debian/control. Still need to
review whether we are in full compliance, though.
- Fixed lintian errors.
## 2009-11-29 Markus Gutschke <markus@shellinabox.com>
- Preparations for packaging ShellInABox in a way that makes it
easy for Debian package maintainers to pick it up.
## 2009-11-25 Markus Gutschke <markus@shellinabox.com>
- On browsers that support CSS transforms, enable switching between
80 and 132 column mode.
## 2009-11-21 Markus Gutschke <markus@shellinabox.com>
- Updated manual page documenting --user-css
- Released version 2.10
## 2009-11-18 Markus Gutschke <markus@shellinabox.com>
- Fixed some compiler warnings when using more recent versions of
gcc and glibc.
- Tweak the handling of CTRL keys, so that some of the more unusual
combinations work. For historic reasons, there is an expectation that
CTRL-3..CTRL-8 return specific control characters. Also fixed the
handling of CTRL-\ which could cause problems with some browsers.
- Rely on the browser for capitalization. This should fix Capslock
behavior. Hopefully, it won't break any other keyboard features or
layouts.
## 2009-08-20 Markus Gutschke <markus@shellinabox.com>
- Added transparent printing support. The development of this
feature is sponsored by De Bortoli Wines Pty Limited and by
Eternity Technologies.
## 2009-08-19 Markus Gutschke <markus@shellinabox.com>
- Added a ${url} parameter that can be used in the service description.
## 2009-08-11 Markus Gutschke <markus@shellinabox.com>
- Added support for user selectable style sheets. Included example
style sheets that allow switching to white-on-black or to monochrome
mode from the right click context menu.
- Fixed the "|" key on Swedish keyboards.
## 2009-07-30 Markus Gutschke <markus@shellinabox.com>
- Added the --css command line option to make incremental changes
to the style sheet without having to load a full replacement with
the --static-file option. Added an example that enables white text
on a black background.
- Added Debian specific documentation to the manual page.
## 2009-07-29 Markus Gutschke <markus@shellinabox.com>
- Allow unprivileged users to run the daemon. This requires
calling "ssh" instead of "login".
## 2009-07-27 Markus Gutschke <markus@shellinabox.com>
- Use JavaScript redirection for attaching the missing slash to
the URL. This should make it easier to use reverse proxies. It was
already possible to run shellinaboxd behind a proxy, but a lot of
users got the configuration wrong.
## 2009-07-08 Markus Gutschke <markus@shellinabox.com>
- Optionally compress large responses, if the browser accepts
deflate compression. This mainly improves start up time.
- More fine tuning of the regular expressions that detect URLs.
We now allow '.' and ',' in URLs, as long as they are not at the
very end of the URL, where they would probably be part of the
enclosing sentence and not actually part of the URL.
## 2009-07-06 Markus Gutschke <markus@shellinabox.com>
- Making it easier to host the terminal on non-root URLs by always
redirecting to a URL that includes a trailing slash.
- Run-time testing for availability of libpthread functions does not
work reliably on some platforms. So, avoid doing so on anything
other than Linux/i386. For all other platforms, assume that the code
is not linked against libpthread. For ShellInABox, this is always
the correct assumption. But if the code gets embedded into other
projects, this might have to be changed.
## 2009-07-05 Markus Gutschke <markus@shellinabox.com>
- Released version 2.9
## 2009-07-04 Markus Gutschke <markus@shellinabox.com>
- Refined regular expressions for finding URLs.
- Show new terminal size when resizing the browser.
- Restored compatibility with IE5 and IE6.
## 2009-07-03 Markus Gutschke <markus@shellinabox.com>
- Added --linkify option. Default settings cause the terminal to
recognize fully qualified URLs and to make them clickable.
## 2009-06-28 Markus Gutschke <markus@shellinabox.com>
- Added support for keyboards that have a dedicated "<" / ">" key.
## 2009-06-21 Markus Gutschke <markus@shellinabox.com>
- Added --localhost option.
- Added support for building on ARM.
- Respect "Connection: close" for proxies that rely on pre-HTTP/1.1
behavior.
## 2009-05-24 Markus Gutschke <markus@shellinabox.com>
- Added SSL support for OpenBSD
## 2009-05-23 Markus Gutschke <markus@shellinabox.com>
- Released version 2.8
## 2009-05-22 Markus Gutschke <markus@shellinabox.com>
- Improved support for entering non-ASCII characters.
## 2009-05-20 Markus Gutschke <markus@shellinabox.com>
- Fixed various issues with building on OpenBSD
## 2009-04-28 Markus Gutschke <markus@shellinabox.com>
- Fixed variable expansion in service descriptions.
## 2009-04-27 Markus Gutschke <markus@shellinabox.com>
- Released version 2.7
- Improved compatibility with some PAM configurations when running
as a non-privileged user.
- Fixed a bug that required shells to output data (e.g. a prompt)
before they could read the first data.
- Fixed a potential crash.
## 2009-04-12 Markus Gutschke <markus@shellinabox.com>
- Released version 2.6
- The demo application is still incomplete, but starting to be
somewhat functional. The BASIC interpreter supports variables, and
can parse expressions. But it is still missing all flow-control
commands, making it somewhat useless for writing real programs.
## 2009-03-30 Markus Gutschke <markus@shellinabox.com>
- Added initial revision of demo application.
- Show fatal error message even when running in "quiet" mode.
- Make it easier to override parameters needed by the system startup
scripts.
## 2009-03-29 Markus Gutschke <markus@shellinabox.com>
- Added support for chained SSL certificates
## 2009-03-23 Markus Gutschke <markus@shellinabox.com>
- Added an INSTALL.Debian file with Debian-specific instructions on
how to build and install a package file.
## 2009-03-21 Markus Gutschke <markus@shellinabox.com>
- Possible fix for IE problems with horizontal positioning of
cursor if the line ends in spaces.
- Work-around for an IE6 bug when doing HTTPS through proxies.
## 2009-03-21 Markus Gutschke <markus@shellinabox.com>
- Released version 2.5
- More testing on older IE versions.
## 2009-03-19 Markus Gutschke <markus@shellinabox.com>
- Fixed cursor positioning. Hopefully, more browsers will be happy
with this, now.
- Explicitly added no-cache headers to our responses. This might help
with the IE6 problems.
## 2009-03-17 Markus Gutschke <markus@shellinabox.com>
- Allow root to bind to privileged port.
## 2009-03-17 Markus Gutschke <markus@shellinabox.com>
- Fixed IE6 support.
- Fixed possible memory corruption, when sessions time out.
## 2009-03-16 Markus Gutschke <markus@shellinabox.com>
- Fixed some compiler warnings, that newer versions of GCC issue.
## 2009-02-27 Markus Gutschke <markus@shellinabox.com>
- Added fallback on old-style pty's, if /dev/pts is not mounted.
- Work-around for systems that don't define a "nogroup" group.
- Remove the dependency on fdopendir, which does not exist
everywhere.
## 2009-02-16 Markus Gutschke <markus@shellinabox.com>
- Include VCS revision number in user-visible version string.
- Allow "configure" to select whether OpenSSL and PAM libraries
should be used at all, dynamically searched-for at run-time, or
linked as a regular dynamic library.
- Fixed various bugs that prevents ShellInABox from running on
FreeBSD
## 2009-02-12 Markus Gutschke <markus@shellinabox.com>
- Released version 2.4
## 2009-02-11 Markus Gutschke <markus@shellinabox.com>
- Fixed fatal compiler warning if compiling without SSL support.
- Fixed cursor hiding and showing
- Fixed various rendering glitches reported by Phil Endecott of
Anyterm (http://anyterm.org) fame.
- Made code more portable. In particular, fixed sed scripts.
- Added explicit config.h file, instead of passing configuration
options on the compiler's command line.
- Fixed compilation issues on BSD systems. Code is still untested
and unsupported on non-Linux systems at this time.
## 2009-01-21 Markus Gutschke <markus@shellinabox.com>
- Released version 2.3
- Fixed a show-stopper bug that broke the --cert option.
## 2009-01-21 Markus Gutschke <markus@shellinabox.com>
- Released version 2.2
- Fixed a bug that could result in the font getting corrupted.
- Improved compatibility with more versions of the OpenSSL library.
Previously, the feature test for TLSEXT did not always work correctly,
resulting in compilation failures.
- Improved support for embedding shellinaboxd into existing web
services. SSL certificates can now be passed in through a file
handle, and port and pid numbers can be retrieved from the CGI header.
## 2009-01-08 Markus Gutschke <markus@shellinabox.com>
- Released version 2.1
- Fixed build errors mostly related to x86_64.
- Added --no-beep command line option to avoid VLC plugin crashing
Firefox/x86_64.
- Fixed multi-line selections in Firefox.
## 2009-01-01 Markus Gutschke <markus@shellinabox.com>
- Added CGI mode for demand-loading the shellinaboxd daemon
from a web server. This also allows for the web server to
perform authentication, instead of having shellinaboxd do so.
- Tightened setuid-root operation to no longer allow switching
to arbitrary users/groups. As before, setuid-root remains a
non-standard configuration that is not currently recommended.
- Fixed session management to deal better with torn down
connections. Closed one bug that could have resulted in
permanently orphaned connections, when the browser navigated
away from the page.
## 2008-12-27 Markus Gutschke <markus@shellinabox.com>
- First public release of the version 2.0 rewrite. This is the
first release of ShellInABox that supports an AJAX interface
instead of the original Java applet.

0
COPYING Normal file → Executable file
View file

392
ChangeLog
View file

@ -1,392 +0,0 @@
2010-09-11 Markus Gutschke <markus@shellinabox.com>
* Added --pidfile= option that can be used even if running in the
foreground.
2010-09-04 Markus Gutschke <markus@shellinabox.com>
* Added an optional on-screen keyboard. Must be activated by the
user by selecting the option in the context-menu.
2010-09-03 Markus Gutschke <markus@shellinabox.com>
* Fix some scaling related issues. This fix is thanks to some
excellent detective work by Jan <siev...@zedat.fu-berlin.de>.
* Allow changing of font sizes in the user CSS.
2010-08-19 Markus Gutschke <markus@shellinabox.com>
* Thanks to lotr44's excellent analysis of the problem, we now have
a fix for the problem with typing "!" on French keyboards.
2010-08-06 Markus Gutschke <markus@shellinabox.com>
* Allow users to disable the blinking cursor from the context menu.
2010-07-08 Markus Gutschke <markus@shellinabox.com>
* Added support for systems that have utmpx.h, but don't implement
updwtmpx().
2010-07-02 Markus Gutschke <markus@shellinabox.com>
* Fixed a NULL pointer dereference that can occur when hostnames
do not resolve. Thanks to <vmagerya> for pointing out this problem.
2010-03-31 Markus Gutschke <markus@shellinabox.com>
* Tweaked the build system to work better on OpenWRT. This is largely
thanks to very helpful bug reports, and lots of testing by Jan Jaeger.
2010-03-29 Markus Gutschke <markus@shellinabox.com>
* Started working on support for WebSockets.
* Fixed some compiler warnings when compiling with -Wextra
* Thanks to Jan Jaeger's excellent bug report, made some changes
that should make it easier to build ShellInABox for OpenWRT.
2009-12-10 Markus Gutschke <markus@shellinabox.com>
* Add .note.GNU-stack to all object files so that the generated
binary doesn't erroneously request an executable stack.
2009-12-03 Markus Gutschke <markus@shellinabox.com>
* Allow retrieval of the user's default login shell from
/etc/passwd.
* Allow the code to be built without support for the LOGIN
service, as calling /bin/login does not work well on Fedora.
2009-12-02 Markus Gutschke <markus@shellinabox.com>
* Added fallback code that dynamically computes the correct commandline
arguments for "objcopy" if building for an otherwise unknown target
platform.
2009-12-01 Markus Gutschke <markus@shellinabox.com>
* Added some basic sanity checks to the commit script that now makes
sure we at least attempt to keep copyright dates updated whenever we
make changes.
* Added checks that the debian/changelog file is up-to-date
* Added debian/watch file
* Updated the Standards-Version in debian/control. Still need to
review whether we are in full compliance, though.
* Fixed lintian errors.
2009-11-29 Markus Gutschke <markus@shellinabox.com>
* Preparations for packaging ShellInABox in a way that makes it
easy for Debian package maintainers to pick it up.
2009-11-25 Markus Gutschke <markus@shellinabox.com>
* On browsers that support CSS transforms, enable switching between
80 and 132 column mode.
2009-11-21 Markus Gutschke <markus@shellinabox.com>
* Updated manual page documenting --user-css
* Released version 2.10
2009-11-18 Markus Gutschke <markus@shellinabox.com>
* Fixed some compiler warnings when using more recent versions of
gcc and glibc.
* Tweak the handling of CTRL keys, so that some of the more unusual
combinations work. For historic reasons, there is an expectation that
CTRL-3..CTRL-8 return specific control characters. Also fixed the
handling of CTRL-\ which could cause problems with some browsers.
* Rely on the browser for capitalization. This should fix Capslock
behavior. Hopefully, it won't break any other keyboard features or
layouts.
2009-08-20 Markus Gutschke <markus@shellinabox.com>
* Added transparent printing support. The development of this
feature is sponsored by De Bortoli Wines Pty Limited and by
Eternity Technologies.
2009-08-19 Markus Gutschke <markus@shellinabox.com>
* Added a ${url} parameter that can be used in the service description.
2009-08-11 Markus Gutschke <markus@shellinabox.com>
* Added support for user selectable style sheets. Included example
style sheets that allow switching to white-on-black or to monochrome
mode from the right click context menu.
* Fixed the "|" key on Swedish keyboards.
2009-07-30 Markus Gutschke <markus@shellinabox.com>
* Added the --css command line option to make incremental changes
to the style sheet without having to load a full replacement with
the --static-file option. Added an example that enables white text
on a black background.
* Added Debian specific documentation to the manual page.
2009-07-29 Markus Gutschke <markus@shellinabox.com>
* Allow unprivileged users to run the daemon. This requires
calling "ssh" instead of "login".
2009-07-27 Markus Gutschke <markus@shellinabox.com>
* Use JavaScript redirection for attaching the missing slash to
the URL. This should make it easier to use reverse proxies. It was
already possible to run shellinaboxd behind a proxy, but a lot of
users got the configuration wrong.
2009-07-08 Markus Gutschke <markus@shellinabox.com>
* Optionally compress large responses, if the browser accepts
deflate compression. This mainly improves start up time.
* More fine tuning of the regular expressions that detect URLs.
We now allow '.' and ',' in URLs, as long as they are not at the
very end of the URL, where they would probably be part of the
enclosing sentence and not actually part of the URL.
2009-07-06 Markus Gutschke <markus@shellinabox.com>
* Making it easier to host the terminal on non-root URLs by always
redirecting to a URL that includes a trailing slash.
* Run-time testing for availability of libpthread functions does not
work reliably on some platforms. So, avoid doing so on anything
other than Linux/i386. For all other platforms, assume that the code
is not linked against libpthread. For ShellInABox, this is always
the correct assumption. But if the code gets embedded into other
projects, this might have to be changed.
2009-07-05 Markus Gutschke <markus@shellinabox.com>
* Released version 2.9
2009-07-04 Markus Gutschke <markus@shellinabox.com>
* Refined regular expressions for finding URLs.
* Show new terminal size when resizing the browser.
* Restored compatibility with IE5 and IE6.
2009-07-03 Markus Gutschke <markus@shellinabox.com>
* Added --linkify option. Default settings cause the terminal to
recognize fully qualified URLs and to make them clickable.
2009-06-28 Markus Gutschke <markus@shellinabox.com>
* Added support for keyboards that have a dedicated "<" / ">" key.
2009-06-21 Markus Gutschke <markus@shellinabox.com>
* Added --localhost option.
* Added support for building on ARM.
* Respect "Connection: close" for proxies that rely on pre-HTTP/1.1
behavior.
2009-05-24 Markus Gutschke <markus@shellinabox.com>
* Added SSL support for OpenBSD
2009-05-23 Markus Gutschke <markus@shellinabox.com>
* Released version 2.8
2009-05-22 Markus Gutschke <markus@shellinabox.com>
* Improved support for entering non-ASCII characters.
2009-05-20 Markus Gutschke <markus@shellinabox.com>
* Fixed various issues with building on OpenBSD
2009-04-28 Markus Gutschke <markus@shellinabox.com>
* Fixed variable expansion in service descriptions.
2009-04-27 Markus Gutschke <markus@shellinabox.com>
* Released version 2.7
* Improved compatibility with some PAM configurations when running
as a non-privileged user.
* Fixed a bug that required shells to output data (e.g. a prompt)
before they could read the first data.
* Fixed a potential crash.
2009-04-12 Markus Gutschke <markus@shellinabox.com>
* Released version 2.6
* The demo application is still incomplete, but starting to be
somewhat functional. The BASIC interpreter supports variables, and
can parse expressions. But it is still missing all flow-control
commands, making it somewhat useless for writing real programs.
2009-03-30 Markus Gutschke <markus@shellinabox.com>
* Added initial revision of demo application.
* Show fatal error message even when running in "quiet" mode.
* Make it easier to override parameters needed by the system startup
scripts.
2009-03-29 Markus Gutschke <markus@shellinabox.com>
* Added support for chained SSL certificates
2009-03-23 Markus Gutschke <markus@shellinabox.com>
* Added an INSTALL.Debian file with Debian-specific instructions on
how to build and install a package file.
2009-03-21 Markus Gutschke <markus@shellinabox.com>
* Possible fix for IE problems with horizontal positioning of
cursor if the line ends in spaces.
* Work-around for an IE6 bug when doing HTTPS through proxies.
2009-03-21 Markus Gutschke <markus@shellinabox.com>
* Released version 2.5
* More testing on older IE versions.
2009-03-19 Markus Gutschke <markus@shellinabox.com>
* Fixed cursor positioning. Hopefully, more browsers will be happy
with this, now.
* Explicitly added no-cache headers to our responses. This might help
with the IE6 problems.
2009-03-17 Markus Gutschke <markus@shellinabox.com>
* Allow root to bind to privileged port.
2009-03-17 Markus Gutschke <markus@shellinabox.com>
* Fixed IE6 support.
* Fixed possible memory corruption, when sessions time out.
2009-03-16 Markus Gutschke <markus@shellinabox.com>
* Fixed some compiler warnings, that newer versions of GCC issue.
2009-02-27 Markus Gutschke <markus@shellinabox.com>
* Added fallback on old-style pty's, if /dev/pts is not mounted.
* Work-around for systems that don't define a "nogroup" group.
* Remove the dependency on fdopendir, which does not exist
everywhere.
2009-02-16 Markus Gutschke <markus@shellinabox.com>
* Include VCS revision number in user-visible version string.
* Allow "configure" to select whether OpenSSL and PAM libraries
should be used at all, dynamically searched-for at run-time, or
linked as a regular dynamic library.
* Fixed various bugs that prevents ShellInABox from running on
FreeBSD
2009-02-12 Markus Gutschke <markus@shellinabox.com>
* Released version 2.4
2009-02-11 Markus Gutschke <markus@shellinabox.com>
* Fixed fatal compiler warning if compiling without SSL support.
* Fixed cursor hiding and showing
* Fixed various rendering glitches reported by Phil Endecott of
Anyterm (http://anyterm.org) fame.
* Made code more portable. In particular, fixed sed scripts.
* Added explicit config.h file, instead of passing configuration
options on the compiler's command line.
* Fixed compilation issues on BSD systems. Code is still untested
and unsupported on non-Linux systems at this time.
2009-01-21 Markus Gutschke <markus@shellinabox.com>
* Released version 2.3
* Fixed a show-stopper bug that broke the --cert option.
2009-01-21 Markus Gutschke <markus@shellinabox.com>
* Released version 2.2
* Fixed a bug that could result in the font getting corrupted.
* Improved compatibility with more versions of the OpenSSL library.
Previously, the feature test for TLSEXT did not always work correctly,
resulting in compilation failures.
* Improved support for embedding shellinaboxd into existing web
services. SSL certificates can now be passed in through a file
handle, and port and pid numbers can be retrieved from the CGI header.
2009-01-08 Markus Gutschke <markus@shellinabox.com>
* Released version 2.1
* Fixed build errors mostly related to x86_64.
* Added --no-beep command line option to avoid VLC plugin crashing
Firefox/x86_64.
* Fixed multi-line selections in Firefox.
2009-01-01 Markus Gutschke <markus@shellinabox.com>
* Added CGI mode for demand-loading the shellinaboxd daemon
from a web server. This also allows for the web server to
perform authentication, instead of having shellinaboxd do so.
* Tightened setuid-root operation to no longer allow switching
to arbitrary users/groups. As before, setuid-root remains a
non-standard configuration that is not currently recommended.
* Fixed session management to deal better with torn down
connections. Closed one bug that could have resulted in
permanently orphaned connections, when the browser navigated
away from the page.
2008-12-27 Markus Gutschke <markus@shellinabox.com>
* First public release of the version 2.0 rewrite. This is the
first release of ShellInABox that supports an AJAX interface
instead of the original Java applet.

1
ChangeLog Symbolic link
View file

@ -0,0 +1 @@
CHANGELOG.md

0
GPL-2 Normal file → Executable file
View file

237
INSTALL
View file

@ -1,237 +0,0 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
6. Often, you can also type `make uninstall' to remove the installed
files again.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that the
`configure' script does not know about. Run `./configure --help' for
details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

2
INSTALL.Debian Normal file → Executable file
View file

@ -41,7 +41,7 @@ you point your browser to the site.
At the very least, you need a file called "certificate.pem" that includes At the very least, you need a file called "certificate.pem" that includes
both the private key and the public certificate in PEM (i.e. ASCII) format. both the private key and the public certificate in PEM (i.e. ASCII) format.
Additionally, you should create files for each of the publically visible Additionally, you should create files for each of the publicly visible
hostnames that your machine has. These are named "certificate-${FQDN}.pem". hostnames that your machine has. These are named "certificate-${FQDN}.pem".
You probably also want "certificate-localhost.pem". You probably also want "certificate-localhost.pem".

49
Makefile.am Normal file → Executable file
View file

@ -1,6 +1,7 @@
AM_CPPFLAGS = AM_CPPFLAGS =
AM_CFLAGS = -g -std=gnu99 -Wall AM_CFLAGS = -g -std=gnu99 -Wall
AM_LDFLAGS = -g -lm AM_LDFLAGS = -g -lm
ACLOCAL_AMFLAGS = -I m4
noinst_LTLIBRARIES = libhttp.la \ noinst_LTLIBRARIES = libhttp.la \
liblogging.la liblogging.la
@ -11,17 +12,12 @@ noinst_HEADERS = libhttp/http.h
dist_doc_DATA = AUTHORS \ dist_doc_DATA = AUTHORS \
COPYING \ COPYING \
GPL-2 \ GPL-2 \
ChangeLog \ NEWS
INSTALL \
NEWS \
README \
TODO \
shellinabox/white-on-black.css \
shellinabox/black-on-white.css \
shellinabox/monochrome.css \
shellinabox/color.css
EXTRA_DIST = INSTALL.Debian \ EXTRA_DIST = INSTALL.Debian \
README.Fedora \ README.Fedora \
INSTALL \
README \
TODO \
demo/beep.wav \ demo/beep.wav \
demo/favicon.ico \ demo/favicon.ico \
demo/demo.html \ demo/demo.html \
@ -43,6 +39,10 @@ EXTRA_DIST = INSTALL.Debian \
shellinabox/shell_in_a_box.js \ shellinabox/shell_in_a_box.js \
shellinabox/vt100.js \ shellinabox/vt100.js \
shellinabox/cgi-mode-example.sh \ shellinabox/cgi-mode-example.sh \
shellinabox/white-on-black.css \
shellinabox/black-on-white.css \
shellinabox/monochrome.css \
shellinabox/color.css \
debian/README \ debian/README \
debian/README.available \ debian/README.available \
debian/README.enabled \ debian/README.enabled \
@ -127,6 +127,8 @@ BUILT_SOURCES = shellinabox/beep.h \
shellinaboxd_LDADD = liblogging.la \ shellinaboxd_LDADD = liblogging.la \
libhttp.la libhttp.la
shellinaboxd_LDFLAGS = -static shellinaboxd_LDFLAGS = -static
## Added this for compatibility with older versions of autoconf/automake
docdir = ${datadir}/doc/${PACKAGE}
symbolname = \ symbolname = \
sed -e 's/.*\/\([^.]*\)[.].*/\1/' \ sed -e 's/.*\/\([^.]*\)[.].*/\1/' \
@ -238,9 +240,10 @@ shellinaboxd.1: ${top_srcdir}/shellinabox/shellinaboxd.man.in \
@out=`echo "$@" 2>/dev/null|sed -e 's/\.[^.]*$$/.ps/'`; \ @out=`echo "$@" 2>/dev/null|sed -e 's/\.[^.]*$$/.ps/'`; \
man -Tps "./$@" >"$${out}" 2>/dev/null || rm -f "$${out}" man -Tps "./$@" >"$${out}" 2>/dev/null || rm -f "$${out}"
clean-local: clean-local: clean-demo
-rm -rf shellinaboxd.1 \ -rm -rf shellinaboxd.1 \
shellinaboxd.ps shellinaboxd.ps \
shellinaboxd.pdf
-rm -rf debian/shellinabox \ -rm -rf debian/shellinabox \
debian/shellinabox*.debhelper* \ debian/shellinabox*.debhelper* \
debian/shellinabox.substvars \ debian/shellinabox.substvars \
@ -253,10 +256,26 @@ clean-local:
shellinabox/keyboard-layout.h \ shellinabox/keyboard-layout.h \
shellinabox/print-styles.h \ shellinabox/print-styles.h \
shellinabox/root_page.h \ shellinabox/root_page.h \
shellinabox/shell_in_a_box.js \
shellinabox/shell_in_a_box.h \ shellinabox/shell_in_a_box.h \
shellinabox/styles.h \ shellinabox/styles.h \
shellinabox/vt100.js \
shellinabox/vt100.h shellinabox/vt100.h
clean-demo:
-rm demo/beep.wav \
demo/demo.js \
demo/enabled.gif \
demo/favicon.ico \
demo/keyboard.png \
demo/print-styles.css \
demo/styles.css \
demo/usercss-0.css \
demo/usercss-1.css \
demo/usercss-2.css \
demo/usercss-3.css \
demo/vt100.js
.css.h: .css.h:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@ -320,7 +339,7 @@ clean-local:
-e t \ -e t \
-e d "$<"`" \ -e d "$<"`" \
-e "s/^#/\/\/ #/" \ -e "s/^#/\/\/ #/" \
-e "s/VERSION/\"@VERSION@ (revision @VCS_REVISION@)\"/g" \ -e "s/VERSION/\"@VERSION@ @VCS_REVISION@\"/g" \
"$<" >"$@" "$<" >"$@"
.js.h: .js.h:
@ -346,3 +365,9 @@ clean-local:
"(int)sizeof($${sym}Start);"; \ "(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
shellinaboxd.ps: shellinaboxd.1
groff -man -T ps $^ >$@
shellinaboxd.pdf: shellinaboxd.ps
ps2pdf $^ $@

File diff suppressed because it is too large Load diff

0
NEWS Normal file → Executable file
View file

0
README Normal file → Executable file
View file

1
README.Fedora Normal file → Executable file
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/

104
README.md Executable file
View file

@ -0,0 +1,104 @@
shellinabox
===========
[![Build Status](https://drone.io/github.com/shellinabox/shellinabox/status.png)](https://drone.io/github.com/shellinabox/shellinabox/latest)
[![Join the chat at https://gitter.im/shellinabox/shellinabox](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/shellinabox/shellinabox?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
This is an unofficial fork of the project **Shell In A Box**. The fork was created because
the original project was not maintained anymore and we cannot contact the original
repository owners.
Our aim is to continue with maintenance of the shellinabox project. For a list of
recent changes, please see [CHANGELOG.md](/CHANGELOG.md).
If you have any questions, issues, or patches, please feel free to submit a pull
request or report an issue. You can also drop an email to the original project
[issue #261](https://code.google.com/p/shellinabox/issues/detail?id=261) discussion
from where this fork started.
About shellinabox
-----------------
Shell In A Box implements a web server that can export arbitrary command line
tools to a web based terminal emulator. This emulator is accessible to any
JavaScript and CSS enabled web browser and does not require any additional
browser plugins.
![Shell In A Box preview](/misc/preview.gif?raw=true)
More information:
* [Manual page](https://github.com/shellinabox/shellinabox/wiki/shellinaboxd_man)
* [Official site](https://code.google.com/p/shellinabox)
* [Official wiki](https://code.google.com/p/shellinabox/wiki/shellinaboxd_man)
Build
-----------------
For building **shellinabox** from source on Debian or RHEL based systems use commands
listed below. This will create executable file `shellinaboxd` in project directory.
1. Clone the autotools
```
wget https://raw.githubusercontent.com/simono41/shellinabox/master/auto.sh
```
3. Run autotools
```
chmod +x auto.sh
./auto.sh
```
#### Debian package
For building and installing `.deb` packages you can use commands listed bellow.
Note that dependencies from the first step above are also required.
1. Build package
```
dpkg-buildpackage -b
```
2. Install package
```
dpkg -i ../shellinabox_{ver}_{arch}.deb
```
For more information about `.deb` packages please see [INSTALL.Debian](/INSTALL.Debian) file.
Issues
-----------------
All reported issues were imported from [Google Code Project Issues](https://code.google.com/p/shellinabox/issues/list).
You can report new issues here, but first please try to reproduce them with package
created from our sources. In new issue report please include following things:
* Name and version of your operating system
* Name and version of your browser
* Version of shellinabox
* Steps to reproduce the problem
Also feel free to post any questions or comments in [shellinabox chat room](https://gitter.im/shellinabox/shellinabox)
on Gitter.
Known Issues
------------
* The openssl package is required for HTTP/SSL support.
Shell-in-a-box may be used without SSL such that the login session
is not encrypted. To enable automatic creation of self-signed
certificates or to use a generated certificate, install openssl.
* On Debian Jessie, the default openssl package does not include the
utilities necessary for Shell-in-a-box to generate self-signed
certificates. Upgrade openssl to install a version of the tools
that support certificate creation.

1
TODO Normal file → Executable file
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

8929
aclocal.m4 vendored

File diff suppressed because it is too large Load diff

56
auto.sh Executable file
View file

@ -0,0 +1,56 @@
#!/bin/bash
set -ex
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
echo "Als root Angemeldet"
if [ -f /usr/bin/apt ]; then
apt update
apt install git libssl-dev libpam0g-dev zlib1g-dev dh-autoreconf
fi
if [ -f /usr/bin/pacman ]; then
pacman -Sy git openssl autoconf automake make gcc
fi
cd /opt/
git clone https://github.com/simono41/shellinabox.git
cd shellinabox
autoreconf -i
./configure && make
cp shellinabox.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable shellinabox.service
# adduser
echo adduser webssh
useradd webssh
mkdir /home/webssh
cp shellinabox_sshwrapper.sh /home/webssh/
chmod 770 -R /home/webssh/
chown -cR webssh:webssh /home/webssh/
passwd webssh <<EOT
webssh
webssh
EOT
systemctl start shellinabox.service &

5
commit
View file

@ -1,5 +1,10 @@
#!/bin/bash -e #!/bin/bash -e
echo "This script would only work on a Subversion repository"
echo "and is only kept for historical purpose... for now."
exit 1
# The script ensures that all commands succeed unless an error occurred. If it # The script ensures that all commands succeed unless an error occurred. If it
# does though, the shell terminates the script and our exit handler runs. # does though, the shell terminates the script and our exit handler runs.
trap 'tput bel || :; echo Failed! >&2' EXIT trap 'tput bel || :; echo Failed! >&2' EXIT

1530
config.guess vendored

File diff suppressed because it is too large Load diff

View file

@ -1,182 +0,0 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have support for symbol aliasing */
#undef HAVE_ATTRIBUTE_ALIAS
/* Define to 1 if you have support for the "unused" attribute */
#undef HAVE_ATTRIBUTE_UNUSED
/* Set if you want support for calling /bin/login */
#undef HAVE_BIN_LOGIN
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `dlopen' function. */
#undef HAVE_DLOPEN
/* Define to 1 if you have the `getgrgid_r' function. */
#undef HAVE_GETGRGID_R
/* Define to 1 if you have the `getgrnam_r' function. */
#undef HAVE_GETGRNAM_R
/* Define to 1 if getgrouplist() takes ints as arguments */
#undef HAVE_GETGROUPLIST_TAKES_INTS
/* Define to 1 if you have the `gethostbyname_r' function. */
#undef HAVE_GETHOSTBYNAME_R
/* Define to 1 if you have the `getpwnam_r' function. */
#undef HAVE_GETPWNAM_R
/* Define to 1 if you have the `getpwuid_r' function. */
#undef HAVE_GETPWUID_R
/* Define to 1 if you have the `getresgid' function. */
#undef HAVE_GETRESGID
/* Define to 1 if you have the `getresuid' function. */
#undef HAVE_GETRESUID
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have support for isnan */
#undef HAVE_ISNAN
/* Define to 1 if you have the <libutil.h> header file. */
#undef HAVE_LIBUTIL_H
/* Define to 1 if you have the `login_tty' function. */
#undef HAVE_LOGIN_TTY
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `openpty' function. */
#undef HAVE_OPENPTY
/* Define to 1 if you have the <openssl/bio.h> header file. */
#undef HAVE_OPENSSL_BIO_H
/* Define to 1 if you have the <openssl/err.h> header file. */
#undef HAVE_OPENSSL_ERR_H
/* Define to 1 if you have the <openssl/ssl.h> header file. */
#undef HAVE_OPENSSL_SSL_H
/* Define to 1 if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
/* Define to 1 if you have a re-entrant version of ptsname */
#undef HAVE_PTSNAME_R
/* Define to 1 if you have the <pty.h> header file. */
#undef HAVE_PTY_H
/* Define to 1 if you have the <security/pam_appl.h> header file. */
#undef HAVE_SECURITY_PAM_APPL_H
/* Define to 1 if you have the <security/pam_client.h> header file. */
#undef HAVE_SECURITY_PAM_CLIENT_H
/* Define to 1 if you have the <security/pam_misc.h> header file. */
#undef HAVE_SECURITY_PAM_MISC_H
/* Define to 1 if you have the `setresgid' function. */
#undef HAVE_SETRESGID
/* Define to 1 if you have the `setresuid' function. */
#undef HAVE_SETRESUID
/* Define to 1 if you have a working sigwait */
#undef HAVE_SIGWAIT
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasestr' function. */
#undef HAVE_STRCASESTR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strlcat' function. */
#undef HAVE_STRLCAT
/* Define to 1 if you have the <sys/prctl.h> header file. */
#undef HAVE_SYS_PRCTL_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/uio.h> header file. */
#undef HAVE_SYS_UIO_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have support for updwtmp */
#undef HAVE_UPDWTMP
/* Define to 1 if you have support for updwtmpx */
#undef HAVE_UPDWTMPX
/* Define to 1 if you have the <util.h> header file. */
#undef HAVE_UTIL_H
/* Define to 1 if you have the <utmpx.h> header file. */
#undef HAVE_UTMPX_H
/* Define to 1 if you have the <utmp.h> header file. */
#undef HAVE_UTMP_H
/* Define to 1 if zlib development files are installed */
#undef HAVE_ZLIB
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Most recent revision number in the version control system */
#undef VCS_REVISION
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const

1773
config.sub vendored

File diff suppressed because it is too large Load diff

13365
configure vendored

File diff suppressed because it is too large Load diff

57
configure.ac Normal file → Executable file
View file

@ -1,27 +1,38 @@
AC_PREREQ(2.57) AC_PREREQ(2.57)
dnl This is the one location where the authoritative version number is stored dnl This is one of the locations where the authoritative version
AC_INIT(shellinabox, 2.10, markus@shellinabox.com) dnl number is stored. The other is in the debian/changelog.
VCS_REVISION=239 AC_INIT(shellinabox, 2.20, markus@shellinabox.com)
if test -e .git; then
VCS_REVISION=" (revision `cd $srcdir && git log -1 --format=format:%h`)"
else
VCS_REVISION=""
fi
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])
dnl Set up autoconf/automake for building C libraries and binaries with GCC dnl Set up autoconf/automake for building C libraries and binaries with GCC
CFLAGS="${CFLAGS:--Os}" CFLAGS="${CFLAGS:--Os}"
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE([subdir-objects])
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
AC_PROG_CC AC_PROG_CC
dnl Added this for compatibility with older versions of autoconf/automake
AM_PROG_CC_C_O
AC_LANG_WERROR AC_LANG_WERROR
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS) AC_SUBST(LIBTOOL_DEPS)
AC_C_CONST AC_C_CONST
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_CONFIG_MACRO_DIR([m4])
dnl Overwrite default archiver flags.
AC_SUBST(AR_FLAGS, [cr])
dnl Check for header files that do not exist on all platforms dnl Check for header files that do not exist on all platforms
AC_CHECK_HEADERS([libutil.h pthread.h pty.h strings.h sys/prctl.h sys/uio.h \ AC_CHECK_HEADERS([libutil.h pthread.h pty.h strings.h syslog.h sys/prctl.h \
util.h utmp.h utmpx.h]) sys/uio.h util.h])
dnl Most systems require linking against libutil.so in order to get login_tty() dnl Most systems require linking against libutil.so in order to get login_tty()
AC_CHECK_FUNCS(login_tty, [], AC_CHECK_FUNCS(login_tty, [],
@ -32,6 +43,9 @@ AC_CHECK_FUNCS(login_tty, [],
dnl Use strlcat() instead of strncat() to avoid spurious warnings dnl Use strlcat() instead of strncat() to avoid spurious warnings
AC_CHECK_FUNCS([strlcat]) AC_CHECK_FUNCS([strlcat])
dnl Use vsyslog() for logging important error messages
AC_CHECK_FUNCS([vsyslog])
dnl Prefer thread-safe functions, if available dnl Prefer thread-safe functions, if available
AC_CHECK_FUNCS([getgrgid_r getgrnam_r gethostbyname_r getpwnam_r getpwuid_r \ AC_CHECK_FUNCS([getgrgid_r getgrnam_r gethostbyname_r getpwnam_r getpwuid_r \
openpty strcasestr getresuid getresgid setresuid setresgid ]) openpty strcasestr getresuid getresgid setresuid setresgid ])
@ -61,15 +75,6 @@ AC_TRY_LINK([#include <math.h>],
[AC_DEFINE(HAVE_ISNAN, 1, [AC_DEFINE(HAVE_ISNAN, 1,
Define to 1 if you have support for isnan)]) Define to 1 if you have support for isnan)])
dnl Even if utmpx.h exists, not all systems have support for updwtmpx()
AC_TRY_LINK([#include <utmp.h>],
[updwtmp(0, 0);],
[AC_DEFINE(HAVE_UPDWTMP, 1,
Define to 1 if you have support for updwtmp)])
AC_TRY_LINK([#include <utmpx.h>],
[updwtmpx(0, 0);],
[AC_DEFINE(HAVE_UPDWTMPX, 1,
Define to 1 if you have support for updwtmpx)])
dnl Check if the compiler supports aliasing of symbols dnl Check if the compiler supports aliasing of symbols
AC_TRY_LINK([void x(void) { }; AC_TRY_LINK([void x(void) { };
@ -133,6 +138,28 @@ AC_ARG_ENABLE(runtime-loading,
these libraries into the binary, thus making them a these libraries into the binary, thus making them a
hard dependency, then disable runtime-loading.]) hard dependency, then disable runtime-loading.])
dnl This is feature is not suported in some standard C libs. So users can use
dnl this switch to avoid compile and runtime problems. Note that utmp must
dnl disabled on systems with musl libc.
AC_ARG_ENABLE(utmp,
[ --disable-utmp Disable support for login records. Note
that for systems with musl libc utmp must
be disabled.])
if test "x$enable_utmp" != xno; then
AC_CHECK_HEADERS([utmp.h utmpx.h])
dnl Even if utmpx.h exists, not all systems have support for updwtmpx()
AC_TRY_LINK([#include <utmp.h>],
[updwtmp(0, 0);],
[AC_DEFINE(HAVE_UPDWTMP, 1,
Define to 1 if you have support for updwtmp)])
AC_TRY_LINK([#include <utmpx.h>],
[updwtmpx(0, 0);],
[AC_DEFINE(HAVE_UPDWTMPX, 1,
Define to 1 if you have support for updwtmpx)])
fi
dnl Only test for OpenSSL headers, if not explicitly disabled dnl Only test for OpenSSL headers, if not explicitly disabled
if test "x$enable_ssl" != xno; then if test "x$enable_ssl" != xno; then
AC_CHECK_HEADERS([openssl/bio.h openssl/err.h openssl/ssl.h]) AC_CHECK_HEADERS([openssl/bio.h openssl/err.h openssl/ssl.h])

0
contrib/README-siab.rb Normal file → Executable file
View file

0
contrib/siab.rb Normal file → Executable file
View file

0
debian/README.available vendored Normal file → Executable file
View file

0
debian/README.enabled vendored Normal file → Executable file
View file

6
debian/README.source vendored Normal file → Executable file
View file

@ -1,3 +1,3 @@
The upstream source for shellinabox is archived in googlecode GIT The upstream source for shellinabox is archived in GitHub GIT
repository, <http://code.google.com/p/shellinabox/>. The package is repository, <https://github.com/shellinabox/shellinabox/>.
being maintained as a native Debian package. The package is being maintained as a native Debian package.

79
debian/changelog vendored Normal file → Executable file
View file

@ -1,3 +1,82 @@
shellinabox (2.20) unstable; urgency=medium
* Fixed issue #222, LOGIN service
* Fixed issue #360, ignore escape sequences to fix dir listing
* Fix for function key presses
* Adjusting scale on IE
* New option to disable peer check (#364)
* Add option for custom SSH port
* Support for APL characters
* PDF documentation
* Fix for BSD build
* New ready event support
* OpenSSL 1.1 fixes (Closes: #828542)
* May build with MUSL library
* Documentation added that SSL support is optional and requires
installation of openssl on Debian. (Closes: #839067)
* Jessie requires explicit installation of openssl because the default
package does not include the necessary utilities to support creation
of certificates. (Closes: #839066)
-- Marc Singer <elf@debian.org> Wed, 09 Nov 2016 09:52:24 -0800
shellinabox (2.19) unstable; urgency=high
* Added support for middle-click paste, #350.
* Improved iOS support, #354.
* New logic to enable soft keyboard icon, #119, #321, #354.
* Disable HTTP fallback using the URL /plain. Consequently disables
automatic upgrades from HTTP to HTTPS, #355. (CVE-2015-8400).
-- Marc Singer <elf@debian.org> Sat, 05 Dec 2015 10:24:12 -0800
shellinabox (2.18) unstable; urgency=low
* Fixed reverse vide rendering, #341.
* Using stdout for version information, #344.
* Added CGI session key in HTTP response.
* Child process cleanup, #103.
* Merged #340.
* Autoconf updates.
* Disabled utmp logging.
* Merge #338, killing children with HUP.
* Fixed handling of large HTTP requests.
* Enhanced logging clarity with prefix.
-- Marc Singer <elf@debian.org> Sat, 10 Oct 2015 10:53:38 -0700
shellinabox (2.17) unstable; urgency=medium
* Generally, SSL updates.
* Disabling secure client-initiated renegotiation, an abused and
unnecessary feature.
* Added support for PFS using ECDHE.
* Guarding build against old versions of SSL.
-- Marc Singer <elf@debian.org> Fri, 07 Aug 2015 20:48:33 -0700
shellinabox (2.16) unstable; urgency=low
* New release to guarantee upgrades for people who had installed a
2.15-1 release candidate.
* Update to About dialog to use GitHub URLs.
-- Marc Singer <elf@debian.org> Fri, 24 Jul 2015 11:45:22 -0700
shellinabox (2.15) unstable; urgency=low
* Improved clean-liness so that source archive is clean.
* First release from GitHub. (Closes: #785181)
[Contributions by Alexandre Detiste <alexandre.detiste@gmail.com>]
* Bump std version to 3.9.6, no change needed
* Bump debhelper compat to 9
* Move lintian exception in d/shellinabox.lintian
* Change urls to new GitHub repos
* Retain user preferences on upgrade (Closes: #786441)
-- Marc Singer <elf@debian.org> Fri, 24 Jul 2015 09:16:18 -0700
shellinabox (2.14-1) unstable; urgency=low shellinabox (2.14-1) unstable; urgency=low
* Revised install target of debian/rules. * Revised install target of debian/rules.

2
debian/compat vendored Normal file → Executable file
View file

@ -1 +1 @@
8 9

16
debian/control vendored Normal file → Executable file
View file

@ -2,12 +2,12 @@ Source: shellinabox
Section: web Section: web
Priority: optional Priority: optional
Maintainer: Marc Singer <elf@debian.org> Maintainer: Marc Singer <elf@debian.org>
Build-Depends: debhelper (>= 8.0.0), autotools-dev, binutils, Build-Depends: debhelper (>= 9), autotools-dev, binutils,
libssl-dev, libpam0g-dev, zlib1g-dev libssl-dev, libpam0g-dev, zlib1g-dev, dh-autoreconf
Standards-Version: 3.9.3 Standards-Version: 3.9.6
Homepage: http://shellinabox.com Homepage: http://shellinabox.com
Vcs-Git: https://code.google.com/p/shellinabox/ Vcs-Git: https://github.com/shellinabox/shellinabox/
Vcs-Browser: https://code.google.com/p/shellinabox/source/browse/ Vcs-Browser: https://github.com/shellinabox/shellinabox/
Package: shellinabox Package: shellinabox
Architecture: any Architecture: any
@ -16,5 +16,7 @@ Suggests: openssl
Description: publish command line shell through AJAX interface Description: publish command line shell through AJAX interface
Shellinabox can export arbitrary command line programs to any JavaScript Shellinabox can export arbitrary command line programs to any JavaScript
enabled web browser. By default, it prompts for username and password enabled web browser. By default, it prompts for username and password
and then exports a SSL/TLS encrypted login shell. Shellinabox provides and then exports a login shell. Shellinabox provides a VT100
a VT100 compatible terminal emulator that runs within any modern browser. compatible terminal emulator that runs within any modern
browser. Support for HTTPS protocol (SSL/TLS encryption) is optional
and requires installation of openssl.

8
debian/copyright vendored Normal file → Executable file
View file

@ -1,9 +1,13 @@
Format: http://dep.debian.net/deps/dep5 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: shellinabox Upstream-Name: shellinabox
Source: <https://code.google.com/p/shellinabox/> Source: <https://github.com/shellinabox/shellinabox/>
Files: * Files: *
Copyright: Copyright 2008-2012, Markus Gutschke All rights reserved. Copyright: Copyright 2008-2012, Markus Gutschke All rights reserved.
2012, Marc Singer
2015, Luka Krajger, Philip Hughes, Daniel Gröber,
Ezra Buehler, Anders Kaseorg,
Jonathan Rennison, Guillaume Martres
Upstream-Author: markus@shellinabox.com Upstream-Author: markus@shellinabox.com
License: GPL-2+ License: GPL-2+
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify

0
debian/docs vendored Normal file → Executable file
View file

66
debian/rules vendored
View file

@ -1,16 +1,17 @@
#!/usr/bin/make -f #!/usr/bin/make -f
# -*- makefile -*- # -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode. # Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1 #export DH_VERBOSE=1
DH_WITH=--with autotools-dev,autoreconf
clean:
[ ! -f Makefile ] || make clean-demo
dh clean $(DH_WITH)
%: %:
dh $@ --with autotools-dev dh $@ $(DH_WITH)
# elf-2012.04.10: Since Debian manages package dependencies we can # elf-2012.04.10: Since Debian manages package dependencies we can
# force linkage of ssl s.t. the dependency is properly kept # force linkage of ssl s.t. the dependency is properly kept
@ -20,45 +21,18 @@
override_dh_auto_configure: override_dh_auto_configure:
dh_auto_configure -- --disable-runtime-loading dh_auto_configure -- --disable-runtime-loading
# elf-2012.03.24: This work should be done in the Makefile install AVAILABLE=debian/shellinabox/etc/shellinabox/options-available
# target instead of debian/rules. ENABLED=debian/shellinabox/etc/shellinabox/options-enabled
DESTDIR=$(CURDIR)/debian/tmp
override_dh_install: override_dh_install:
dh_testdir
dh_testroot
dh_prep
dh_installdirs
# We need to install some files for the benefit of Debian that aren't
# going into the program instal target. So, we install into
# debian/tmp the things that need to be included in the package.
$(MAKE) install DESTDIR=$(DESTDIR)
# Set up system-wide user CSS style options
mkdir -p "$(DESTDIR)/etc/shellinabox/options-available"
mkdir -p "$(DESTDIR)/etc/shellinabox/options-enabled"
for i in \
"00+Black on White" \
"00_White On Black" \
"01_Monochrome" \
"01+Color Terminal"; do \
cp "$(DESTDIR)/usr/share/doc/shellinabox/$$(echo "$$i"| \
sed -e 's/[0-9]*[_+]\([^ ]*\).*/\1/'| \
tr A-Z a-z)"*.css \
"$(DESTDIR)/etc/shellinabox/options-available/$$i.css"; \
done
cd "$(DESTDIR)/etc/shellinabox/options-enabled" \
&& ln -s ../options-available/*.css .
cp "$(CURDIR)/debian/README.available" \
"$(DESTDIR)/etc/shellinabox/options-available/README"
cp "$(CURDIR)/debian/README.enabled" \
"$(DESTDIR)/etc/shellinabox/options-enabled/README"
# Shellinabox home directory
# mkdir -p "$(DESTDIR)/var/lib/shellinabox"
# Add Lintian override. ShellInABox has an explicit exemption allowing
# the linking its GPLv2 code with OpenSSL.
mkdir -p "$(DESTDIR)/usr/share/lintian/overrides/"
{ echo '# ShellInABox has an explicit exemption allowing the linking';\
echo '# of its GPLv2 code with OpenSSL'; \
echo 'shellinabox binary: possible-gpl-code-linked-with-openssl'; } \
>"$(DESTDIR)/usr/share/lintian/overrides/shellinabox"
# Now perform the normal debhelper install.
dh_install dh_install
install -D -m644 shellinabox/black-on-white.css "$(AVAILABLE)/00+Black on White.css"
install -D -m644 shellinabox/white-on-black.css "$(AVAILABLE)/00_White On Black.css"
install -D -m644 shellinabox/color.css "$(AVAILABLE)/01+Color Terminal.css"
install -D -m644 shellinabox/monochrome.css "$(AVAILABLE)/01_Monochrome.css"
install -D -m644 debian/README.available "$(AVAILABLE)/README"
install -D -m644 debian/README.enabled "$(ENABLED)/README"
# info duplicated in debian/copyright
# and /usr/share/common-licenses/GPL-2
rm debian/shellinabox/usr/share/doc/shellinabox/COPYING
rm debian/shellinabox/usr/share/doc/shellinabox/GPL-2

0
debian/shellinabox.default vendored Normal file → Executable file
View file

0
debian/shellinabox.dirs vendored Normal file → Executable file
View file

0
debian/shellinabox.examples vendored Normal file → Executable file
View file

View file

@ -1,5 +0,0 @@
etc/shellinabox/options-available
etc/shellinabox/options-enabled
usr/bin
usr/share/lintian/overrides
usr/share/man/man1

3
debian/shellinabox.lintian-overrides vendored Executable file
View file

@ -0,0 +1,3 @@
# ShellInABox has an explicit exemption allowing the linking
# of its GPLv2 code with OpenSSL
shellinabox binary: possible-gpl-code-linked-with-openssl

View file

@ -29,6 +29,16 @@ case "$1" in
# can write the certificate even when the daemon has given-up # can write the certificate even when the daemon has given-up
# root privileges. # root privileges.
# chown shellinabox:shellinabox /var/lib/shellinabox # chown shellinabox:shellinabox /var/lib/shellinabox
# new install, enable all options
if [ -z "$2" ]; then
(cd /etc/shellinabox/options-enabled; ln -s ../options-available/*.css .)
# upgrade from <= v2.14, re-enable saved options
elif [ -d /etc/shellinabox/options-enabled-save ]; then
mv /etc/shellinabox/options-enabled-save/*.css /etc/shellinabox/options-enabled
rm -r /etc/shellinabox/options-enabled-save
fi
# future upgrades: no-op
;; ;;
abort-upgrade|abort-remove|abort-deconfigure) abort-upgrade|abort-remove|abort-deconfigure)

View file

@ -33,6 +33,7 @@ case "$1" in
deluser --quiet --system shellinabox > /dev/null || true deluser --quiet --system shellinabox > /dev/null || true
delgroup --quiet --system shellinabox > /dev/null || true delgroup --quiet --system shellinabox > /dev/null || true
[ ! -d "$d" ] || rmdir "$d" || true # deluser can't do this for /var [ ! -d "$d" ] || rmdir "$d" || true # deluser can't do this for /var
rm -rf "/etc/shellinabox/options-enabled"
exit 0 exit 0
;; ;;
esac esac

33
debian/shellinabox.preinst vendored Executable file
View file

@ -0,0 +1,33 @@
#!/bin/sh
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#DEBHELPER#
case "$1" in
upgrade)
# save old configuration
test -d /etc/shellinabox/options-enabled || exit 0
ls /etc/shellinabox/options-enabled/*.css > /dev/null 2>&1 || exit 0
if dpkg --compare-versions "$2" le "2.14-1"; then
mkdir -p /etc/shellinabox/options-enabled-save
cp -a /etc/shellinabox/options-enabled/*.css /etc/shellinabox/options-enabled-save
fi
;;
install|abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

0
debian/shellinabox.prerm vendored Normal file → Executable file
View file

2
debian/source/format vendored Normal file → Executable file
View file

@ -1 +1 @@
3.0 (quilt) 3.0 (native)

0
debian/source/include-binaries vendored Normal file → Executable file
View file

1
debian/source/options vendored Normal file → Executable file
View file

@ -1 +0,0 @@

2
debian/watch vendored
View file

@ -1,2 +0,0 @@
version=3
https://code.google.com/p/shellinabox/downloads/detail?name=shellinabox-(.+).tar.gz

Binary file not shown.

1
demo/demo.html Normal file → Executable file
View file

@ -2,6 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- <!--
ShellInABox - Make command line applications available as AJAX web applications ShellInABox - Make command line applications available as AJAX web applications
Copyright (C) 2008-2010 Markus Gutschke markus@shellinabox.com Copyright (C) 2008-2010 Markus Gutschke markus@shellinabox.com

File diff suppressed because it is too large Load diff

1
demo/demo.jspp Normal file → Executable file
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;
}; };

0
demo/demo.xml Normal file → Executable file
View file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

1
demo/keyboard.html Normal file → Executable file
View file

@ -2,6 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head> </head>
<body><pre class="box"><div <body><pre class="box"><div
><i id="27">Esc</i><i id="112">F1</i><i id="113">F2</i><i id="114">F3</i ><i id="27">Esc</i><i id="112">F1</i><i id="113">F2</i><i id="114">F3</i

Binary file not shown.

Before

Width:  |  Height:  |  Size: 808 B

View file

@ -1,42 +0,0 @@
/* Set styles used when opening the printer window */
#print {
margin: 0.5ex 0px 0px 0px;
}
#options, #spacer {
font-family: sans;
font-size: smaller;
position: fixed;
top: 0px;
left: 0px;
right: 0px;
background-color: #EEEEEE;
border-style: solid;
border-top: 0px solid black;
border-left: 0px solid black;
border-right: 0px solid black;
border-bottom: 1px solid black;
}
#spacer {
position: static;
visibility: hidden;
}
@media print {
body {
margin: 0px;
}
#print {
margin: 0px;
}
#print .pagebreak {
page-break-before: always;
}
#print .pagebreak hr, #options {
display: none;
}
}

View file

@ -1,233 +0,0 @@
#vt100 a {
text-decoration: none;
color: inherit;
}
#vt100 a:hover {
text-decoration: underline;
}
#vt100 #reconnect {
position: absolute;
z-index: 2;
}
#vt100 #reconnect input {
padding: 1ex;
font-weight: bold;
font-size: x-large;
}
#vt100 #cursize {
background: #EEEEEE;
border: 1px solid black;
font-family: sans-serif;
font-size: large;
font-weight: bold;
padding: 1ex;
position: absolute;
z-index: 2;
}
#vt100 pre {
margin: 0px;
}
#vt100 pre pre {
overflow: hidden;
}
#vt100 #scrollable {
overflow-x: hidden;
overflow-y: scroll;
position: relative;
padding: 1px;
}
#vt100 #console, #vt100 #alt_console, #vt100 #cursor, #vt100 #lineheight, #vt100 .hidden pre {
font-family: "DejaVu Sans Mono", "Everson Mono", FreeMono, "Andale Mono", monospace;
}
#vt100 #lineheight {
position: absolute;
visibility: hidden;
}
#vt100 #cursor {
position: absolute;
left: 0px;
top: 0px;
overflow: hidden;
z-index: 1;
}
#vt100 #cursor.bright {
background-color: black;
color: white;
}
#vt100 #cursor.dim {
visibility: hidden;
}
#vt100 #cursor.inactive {
border: 1px solid;
margin: -1px;
}
#vt100 #padding {
visibility: hidden;
width: 1px;
height: 0px;
overflow: hidden;
}
#vt100 .hidden {
position: absolute;
top: -10000px;
left: -10000px;
width: 0px;
height: 0px;
}
#vt100 #menu {
overflow: visible;
position: absolute;
z-index: 3;
}
#vt100 #menu .popup {
background-color: #EEEEEE;
border: 1px solid black;
font-family: sans-serif;
position: absolute;
}
#vt100 #menu .popup ul {
list-style-type: none;
padding: 0px;
margin: 0px;
min-width: 10em;
}
#vt100 #menu .popup li {
padding: 3px 0.5ex 3px 0.5ex;
}
#vt100 #menu .popup li.hover {
background-color: #444444;
color: white;
}
#vt100 #menu .popup li.disabled {
color: #AAAAAA;
}
#vt100 #menu .popup hr {
margin: 0.5ex 0px 0.5ex 0px;
}
#vt100 #menu img {
margin-right: 0.5ex;
width: 1ex;
height: 1ex;
}
#vt100 #scrollable.inverted { color: #ffffff;
background-color: #000000; }
#vt100 #kbd_button {
float: left;
position: fixed;
z-index: 0;
visibility: hidden;
}
#vt100 #keyboard {
z-index: 3;
position: absolute;
}
#vt100 #keyboard .box {
font-family: sans-serif;
background-color: #cccccc;
padding: .8em;
float: left;
position: absolute;
border-radius: 10px;
-moz-border-radius: 10px;
box-shadow: 4px 4px 6px #222222;
-webkit-box-shadow: 4px 4px 6px #222222;
/* Don't set the -moz-box-shadow. It doesn't properly scale when CSS
* transforms are in effect. Once Firefox supports box-shadow, it should
* automatically do the right thing. Until then, leave shadows disabled
* for Firefox.
*/
opacity: 0.85;
-moz-opacity: 0.85;
filter: alpha(opacity=85);
}
#vt100 #keyboard .box * {
vertical-align: top;
display: inline-block;
}
#vt100 #keyboard b, #vt100 #keyboard i, #vt100 #keyboard s, #vt100 #keyboard u {
font-style: normal;
font-weight: bold;
border-radius: 5px;
-moz-border-radius: 5px;
background-color: #555555;
color: #eeeeee;
box-shadow: 2px 2px 3px #222222;
-webkit-box-shadow: 2px 2px 3px #222222;
padding: 4px;
margin: 2px;
height: 2ex;
display: inline-block;
text-align: center;
text-decoration: none;
}
#vt100 #keyboard b, #vt100 #keyboard s {
width: 2ex;
}
#vt100 #keyboard u, #vt100 #keyboard s {
visibility: hidden;
}
#vt100 #keyboard .shifted {
display: none;
}
#vt100 #keyboard .selected {
color: #888888;
background-color: #eeeeee;
box-shadow: 0px 0px 3px #222222;
-webkit-box-shadow: 0px 0px 3px #222222;
position: relative;
top: 1px;
left: 1px;
}
@media print {
#vt100 .scrollback {
display: none;
}
#vt100 #reconnect, #vt100 #cursor, #vt100 #menu, #vt100 #kbd_button, #vt100 #keyboard {
visibility: hidden;
}
#vt100 #scrollable {
overflow: hidden;
}
#vt100 #console, #vt100 #alt_console {
overflow: hidden;
width: 1000000ex;
}
}

View file

@ -1,22 +0,0 @@
#vt100 #cursor.bright {
background-color: white;
color: black;
}
#vt100 #scrollable {
color: #ffffff;
background-color: #000000;
}
#vt100 #scrollable.inverted {
color: #000000;
background-color: #ffffff;
}
#vt100 .ansi15 {
color: #000000;
}
#vt100 .bgAnsi0 {
background-color: #ffffff;
}

View file

View file

@ -1,29 +0,0 @@
#vt100 .ansi1 { color: inherit; }
#vt100 .ansi2 { color: inherit; }
#vt100 .ansi3 { color: inherit; }
#vt100 .ansi4 { color: inherit; }
#vt100 .ansi5 { color: inherit; }
#vt100 .ansi6 { color: inherit; }
#vt100 .ansi7 { color: inherit; }
#vt100 .ansi8 { color: inherit; }
#vt100 .ansi9 { color: inherit; }
#vt100 .ansi10 { color: inherit; }
#vt100 .ansi11 { color: inherit; }
#vt100 .ansi12 { color: inherit; }
#vt100 .ansi13 { color: inherit; }
#vt100 .ansi14 { color: inherit; }
#vt100 .bgAnsi1 { background-color: transparent; }
#vt100 .bgAnsi2 { background-color: transparent; }
#vt100 .bgAnsi3 { background-color: transparent; }
#vt100 .bgAnsi4 { background-color: transparent; }
#vt100 .bgAnsi5 { background-color: transparent; }
#vt100 .bgAnsi6 { background-color: transparent; }
#vt100 .bgAnsi7 { background-color: transparent; }
#vt100 .bgAnsi8 { background-color: transparent; }
#vt100 .bgAnsi9 { background-color: transparent; }
#vt100 .bgAnsi10 { background-color: transparent; }
#vt100 .bgAnsi11 { background-color: transparent; }
#vt100 .bgAnsi12 { background-color: transparent; }
#vt100 .bgAnsi13 { background-color: transparent; }
#vt100 .bgAnsi14 { background-color: transparent; }

View file

@ -1,34 +0,0 @@
/* DEFINES_COLORS */
#vt100 .ansi0 { }
#vt100 .ansi1 { color: #cd0000; }
#vt100 .ansi2 { color: #00cd00; }
#vt100 .ansi3 { color: #cdcd00; }
#vt100 .ansi4 { color: #0000ee; }
#vt100 .ansi5 { color: #cd00cd; }
#vt100 .ansi6 { color: #00cdcd; }
#vt100 .ansi7 { color: #e5e5e5; }
#vt100 .ansi8 { color: #7f7f7f; }
#vt100 .ansi9 { color: #ff0000; }
#vt100 .ansi10 { color: #00ff00; }
#vt100 .ansi11 { color: #e8e800; }
#vt100 .ansi12 { color: #5c5cff; }
#vt100 .ansi13 { color: #ff00ff; }
#vt100 .ansi14 { color: #00ffff; }
#vt100 .ansi15 { color: #ffffff; }
#vt100 .bgAnsi0 { background-color: #000000; }
#vt100 .bgAnsi1 { background-color: #cd0000; }
#vt100 .bgAnsi2 { background-color: #00cd00; }
#vt100 .bgAnsi3 { background-color: #cdcd00; }
#vt100 .bgAnsi4 { background-color: #0000ee; }
#vt100 .bgAnsi5 { background-color: #cd00cd; }
#vt100 .bgAnsi6 { background-color: #00cdcd; }
#vt100 .bgAnsi7 { background-color: #e5e5e5; }
#vt100 .bgAnsi8 { background-color: #7f7f7f; }
#vt100 .bgAnsi9 { background-color: #ff0000; }
#vt100 .bgAnsi10 { background-color: #00ff00; }
#vt100 .bgAnsi11 { background-color: #e8e800; }
#vt100 .bgAnsi12 { background-color: #5c5cff; }
#vt100 .bgAnsi13 { background-color: #ff00ff; }
#vt100 .bgAnsi14 { background-color: #00ffff; }
#vt100 .bgAnsi15 { }

File diff suppressed because it is too large Load diff

589
depcomp
View file

@ -1,589 +0,0 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2007-03-29.01
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add `dependent.h:' lines.
sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

0
etc-pam.d-shellinabox-example Normal file → Executable file
View file

View file

@ -1,519 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2006-12-25.00
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

0
libhttp/hashmap.c Normal file → Executable file
View file

0
libhttp/hashmap.h Normal file → Executable file
View file

3
libhttp/http.h Normal file → Executable file
View file

@ -102,7 +102,7 @@ short serverConnectionSetEvents(Server *server, ServerConnection *connection,
void serverExitLoop(Server *server, int exitAll); void serverExitLoop(Server *server, int exitAll);
void serverLoop(Server *server); void serverLoop(Server *server);
int serverSupportsSSL(); int serverSupportsSSL();
void serverEnableSSL(Server *server, int flag); void serverSetupSSL(Server *server, int enable, int force);
void serverSetCertificate(Server *server, const char *filename, void serverSetCertificate(Server *server, const char *filename,
int autoGenerateMissing); int autoGenerateMissing);
void serverSetCertificateFd(Server *server, int fd); void serverSetCertificateFd(Server *server, int fd);
@ -127,6 +127,7 @@ Server *httpGetServer(const HttpConnection *http);
ServerConnection *httpGetServerConnection(const HttpConnection *); ServerConnection *httpGetServerConnection(const HttpConnection *);
int httpGetFd(const HttpConnection *http); int httpGetFd(const HttpConnection *http);
const char *httpGetPeerName(const HttpConnection *http); const char *httpGetPeerName(const HttpConnection *http);
const char *httpGetRealIP(const HttpConnection *http);
const char *httpGetMethod(const HttpConnection *http); const char *httpGetMethod(const HttpConnection *http);
const char *httpGetVersion(const HttpConnection *http); const char *httpGetVersion(const HttpConnection *http);
const HashMap *httpGetHeaders(const HttpConnection *http); const HashMap *httpGetHeaders(const HttpConnection *http);

92
libhttp/httpconnection.c Normal file → Executable file
View file

@ -88,7 +88,7 @@
static int httpPromoteToSSL(struct HttpConnection *http, const char *buf, static int httpPromoteToSSL(struct HttpConnection *http, const char *buf,
int len) { int len) {
if (http->ssl->enabled && !http->sslHndl) { if (http->ssl->enabled && !http->sslHndl) {
debug("Switching to SSL (replaying %d+%d bytes)", debug("[ssl] Switching to SSL (replaying %d+%d bytes)...",
http->partialLength, len); http->partialLength, len);
if (http->partial && len > 0) { if (http->partial && len > 0) {
check(http->partial = realloc(http->partial, check(http->partial = realloc(http->partial,
@ -102,6 +102,8 @@ static int httpPromoteToSSL(struct HttpConnection *http, const char *buf,
http->partial ? http->partialLength : len); http->partial ? http->partialLength : len);
if (http->sslHndl) { if (http->sslHndl) {
check(!rc); check(!rc);
// Reset renegotiations count for connections promoted to SSL.
http->ssl->renegotiationCount = 0;
SSL_set_app_data(http->sslHndl, http); SSL_set_app_data(http->sslHndl, http);
} }
free(http->partial); free(http->partial);
@ -138,6 +140,13 @@ static ssize_t httpRead(struct HttpConnection *http, char *buf, ssize_t len) {
break; break;
} }
dcheck(!ERR_peek_error()); dcheck(!ERR_peek_error());
// Shutdown SSL connection, if client initiated renegotiation.
if (http->ssl->renegotiationCount > 1) {
debug("[ssl] Connection shutdown due to client initiated renegotiation!");
rc = 0;
errno = EINVAL;
}
} else { } else {
rc = NOINTR(read(http->fd, buf, len)); rc = NOINTR(read(http->fd, buf, len));
} }
@ -183,18 +192,13 @@ static ssize_t httpWrite(struct HttpConnection *http, const char *buf,
static int httpShutdown(struct HttpConnection *http, int how) { static int httpShutdown(struct HttpConnection *http, int how) {
if (http->sslHndl) { if (http->sslHndl) {
int rc = 0;
if (how != SHUT_RD) { if (how != SHUT_RD) {
dcheck(!ERR_peek_error()); dcheck(!ERR_peek_error());
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
sslBlockSigPipe(); sslBlockSigPipe();
rc = SSL_shutdown(http->sslHndl); int rc = SSL_shutdown(http->sslHndl);
int sPipe = sslUnblockSigPipe(); int sPipe = sslUnblockSigPipe();
if (rc > 0) { if (rc < 1) {
rc = 0;
break;
} else {
rc = -1;
// Retry a few times in order to prefer a clean bidirectional // Retry a few times in order to prefer a clean bidirectional
// shutdown. But don't bother if the other side already closed // shutdown. But don't bother if the other side already closed
// the connection. // the connection.
@ -269,7 +273,7 @@ static int httpFinishCommand(struct HttpConnection *http) {
*lengthBuf = '\000'; *lengthBuf = '\000';
strncat(lengthBuf, "-", sizeof(lengthBuf)-1); strncat(lengthBuf, "-", sizeof(lengthBuf)-1);
} }
info("%s - - %s \"%s %s %s\" %d %s", info("[http] %s - - %s \"%s %s %s\" %d %s",
http->peerName, timeBuf, http->method, http->path, http->version, http->peerName, timeBuf, http->method, http->path, http->version,
http->code, lengthBuf); http->code, lengthBuf);
} }
@ -292,6 +296,14 @@ static char *getPeerName(int fd, int *port, int numericHosts) {
} }
return NULL; return NULL;
} }
char *ret;
if (peerAddr.sa_family == AF_UNIX) {
if (port) {
*port = 0;
}
check(ret = strdup("localhost"));
return ret;
}
char host[256]; char host[256];
if (numericHosts || if (numericHosts ||
getnameinfo(&peerAddr, sockLen, host, sizeof(host), NULL, 0, NI_NOFQDN)){ getnameinfo(&peerAddr, sockLen, host, sizeof(host), NULL, 0, NI_NOFQDN)){
@ -302,7 +314,6 @@ static char *getPeerName(int fd, int *port, int numericHosts) {
if (port) { if (port) {
*port = ntohs(((struct sockaddr_in *)&peerAddr)->sin_port); *port = ntohs(((struct sockaddr_in *)&peerAddr)->sin_port);
} }
char *ret;
check(ret = strdup(host)); check(ret = strdup(host));
return ret; return ret;
} }
@ -394,7 +405,7 @@ void initHttpConnection(struct HttpConnection *http, struct Server *server,
http->sslHndl = NULL; http->sslHndl = NULL;
http->lastError = 0; http->lastError = 0;
if (logIsInfo()) { if (logIsInfo()) {
debug("Accepted connection from %s:%d", debug("[http] Accepted connection from %s:%d",
http->peerName ? http->peerName : "???", http->peerPort); http->peerName ? http->peerName : "???", http->peerPort);
} }
} }
@ -415,11 +426,11 @@ void destroyHttpConnection(struct HttpConnection *http) {
} }
httpSetState(http, COMMAND); httpSetState(http, COMMAND);
if (logIsInfo()) { if (logIsInfo()) {
debug("Closing connection to %s:%d", debug("[http] Closing connection to %s:%d",
http->peerName ? http->peerName : "???", http->peerPort); http->peerName ? http->peerName : "???", http->peerPort);
} }
httpShutdown(http, http->closed ? SHUT_WR : SHUT_RDWR); httpShutdown(http, http->closed ? SHUT_WR : SHUT_RDWR);
dcheck(!close(http->fd)); dcheck(!close(http->fd) || errno != EBADF);
free(http->peerName); free(http->peerName);
free(http->url); free(http->url);
free(http->method); free(http->method);
@ -564,15 +575,6 @@ void httpTransfer(struct HttpConnection *http, char *msg, int len) {
check(msg); check(msg);
check(len >= 0); check(len >= 0);
// Internet Explorer seems to have difficulties with compressed data. It
// also has difficulties with SSL connections that are being proxied.
int ieBug = 0;
const char *userAgent = getFromHashMap(&http->header, "user-agent");
const char *msie = userAgent ? strstr(userAgent, "MSIE ") : NULL;
if (msie) {
ieBug++;
}
char *header = NULL; char *header = NULL;
int headerLength = 0; int headerLength = 0;
int bodyOffset = 0; int bodyOffset = 0;
@ -607,15 +609,15 @@ void httpTransfer(struct HttpConnection *http, char *msg, int len) {
// Found the end of the headers. // Found the end of the headers.
// Check that we don't send any data with HEAD requests // Check that we don't send any data with HEAD requests
int isHead = !strcmp(http->method, "HEAD"); int isHead = http->method && !strcmp(http->method, "HEAD");
check(l == 2 || !isHead); check(l == 2 || !isHead);
#ifdef HAVE_ZLIB #ifdef HAVE_ZLIB
// Compress replies that might exceed the size of a single IP packet // Compress replies that might exceed the size of a single IP packet
compress = !ieBug && !isHead && compress = !isHead &&
!http->isPartialReply && !http->isPartialReply &&
len > 1400 && len > 1400 &&
httpAcceptsEncoding(http, "deflate"); httpAcceptsEncoding(http, "gzip");
#endif #endif
break; break;
} else { } else {
@ -630,7 +632,7 @@ void httpTransfer(struct HttpConnection *http, char *msg, int len) {
line = eol + 1; line = eol + 1;
} }
if (ieBug || compress) { if (compress) {
if (l >= 2 && !memcmp(line, "\r\n", 2)) { if (l >= 2 && !memcmp(line, "\r\n", 2)) {
line += 2; line += 2;
l -= 2; l -= 2;
@ -640,10 +642,6 @@ void httpTransfer(struct HttpConnection *http, char *msg, int len) {
check(header = malloc(headerLength)); check(header = malloc(headerLength));
memcpy(header, msg, headerLength); memcpy(header, msg, headerLength);
} }
if (ieBug) {
removeHeader(header, &headerLength, "connection:");
addHeader(&header, &headerLength, "Connection: close\r\n");
}
if (compress) { if (compress) {
#ifdef HAVE_ZLIB #ifdef HAVE_ZLIB
@ -659,10 +657,11 @@ void httpTransfer(struct HttpConnection *http, char *msg, int len) {
.avail_out = len, .avail_out = len,
.next_out = (unsigned char *)compressed .next_out = (unsigned char *)compressed
}; };
if (deflateInit(&strm, Z_DEFAULT_COMPRESSION) == Z_OK) { if (deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED,
31, 8, Z_DEFAULT_STRATEGY) == Z_OK) {
if (deflate(&strm, Z_FINISH) == Z_STREAM_END) { if (deflate(&strm, Z_FINISH) == Z_STREAM_END) {
// Compression was successful and resulted in reduction in size // Compression was successful and resulted in reduction in size
debug("Compressed response from %d to %d", len, len-strm.avail_out); debug("[http] Compressed response from %d to %d", len, len-strm.avail_out);
free(msg); free(msg);
msg = compressed; msg = compressed;
len -= strm.avail_out; len -= strm.avail_out;
@ -670,7 +669,7 @@ void httpTransfer(struct HttpConnection *http, char *msg, int len) {
removeHeader(header, &headerLength, "content-length:"); removeHeader(header, &headerLength, "content-length:");
removeHeader(header, &headerLength, "content-encoding:"); removeHeader(header, &headerLength, "content-encoding:");
addHeader(&header, &headerLength, "Content-Length: %d\r\n", len); addHeader(&header, &headerLength, "Content-Length: %d\r\n", len);
addHeader(&header, &headerLength, "Content-Encoding: deflate\r\n"); addHeader(&header, &headerLength, "Content-Encoding: gzip\r\n");
} else { } else {
free(compressed); free(compressed);
} }
@ -758,7 +757,7 @@ void httpTransfer(struct HttpConnection *http, char *msg, int len) {
if (!http->isPartialReply) { if (!http->isPartialReply) {
if (http->expecting < 0) { if (http->expecting < 0) {
// If we do not know the length of the content, close the connection. // If we do not know the length of the content, close the connection.
debug("Closing previously suspended connection"); debug("[http] Closing previously suspended connection!");
httpCloseRead(http); httpCloseRead(http);
httpSetState(http, DISCARD_PAYLOAD); httpSetState(http, DISCARD_PAYLOAD);
} else if (http->expecting == 0) { } else if (http->expecting == 0) {
@ -773,10 +772,6 @@ void httpTransfer(struct HttpConnection *http, char *msg, int len) {
} }
} }
} }
if (ieBug) {
httpCloseRead(http);
}
} }
void httpTransferPartialReply(struct HttpConnection *http, char *msg, int len){ void httpTransferPartialReply(struct HttpConnection *http, char *msg, int len){
@ -791,7 +786,7 @@ void httpTransferPartialReply(struct HttpConnection *http, char *msg, int len){
static int httpHandleCommand(struct HttpConnection *http, static int httpHandleCommand(struct HttpConnection *http,
const struct Trie *handlers) { const struct Trie *handlers) {
debug("Handling \"%s\" \"%s\"", http->method, http->path); debug("[http] Handling \"%s\" \"%s\"", http->method, http->path);
const char *contentLength = getFromHashMap(&http->header, const char *contentLength = getFromHashMap(&http->header,
"content-length"); "content-length");
if (contentLength != NULL && *contentLength) { if (contentLength != NULL && *contentLength) {
@ -906,7 +901,7 @@ static int httpHandleCommand(struct HttpConnection *http,
protocol ? protocol : "", protocol ? protocol : "",
protocol ? "\r\n" : ""); protocol ? "\r\n" : "");
free(port); free(port);
debug("Switching to WebSockets"); debug("[http] Switching to WebSockets");
httpTransfer(http, response, strlen(response)); httpTransfer(http, response, strlen(response));
if (http->expecting < 0) { if (http->expecting < 0) {
http->expecting = 0; http->expecting = 0;
@ -1163,7 +1158,7 @@ static int httpParseHeaders(struct HttpConnection *http,
} }
value[j] = '\000'; value[j] = '\000';
if (getRefFromHashMap(&http->header, http->key)) { if (getRefFromHashMap(&http->header, http->key)) {
debug("Dropping duplicate header \"%s\"", http->key); debug("[http] Dropping duplicate header \"%s\"", http->key);
free(http->key); free(http->key);
free(value); free(value);
http->key = NULL; http->key = NULL;
@ -1426,6 +1421,7 @@ int httpHandleConnection(struct ServerConnection *connection, void *http_,
if (bytes > 0) { if (bytes > 0) {
http->headerLength += bytes; http->headerLength += bytes;
if (http->headerLength > MAX_HEADER_LENGTH) { if (http->headerLength > MAX_HEADER_LENGTH) {
debug("[http] Connection closed due to exceeded header size!");
httpSendReply(http, 413, "Header too big", NO_MSG); httpSendReply(http, 413, "Header too big", NO_MSG);
bytes = 0; bytes = 0;
eof = 1; eof = 1;
@ -1484,6 +1480,13 @@ int httpHandleConnection(struct ServerConnection *connection, void *http_,
*events |= POLLIN; *events |= POLLIN;
continue; continue;
} }
} else {
if (http->ssl && http->ssl->enabled && http->ssl->force) {
debug("[http] Non-SSL connections not allowed!");
httpCloseRead(http);
bytes = 0;
eof = 1;
}
} }
} }
@ -1787,11 +1790,12 @@ void httpSendReply(struct HttpConnection *http, int code,
code != 200 ? "Connection: close\r\n" : "", code != 200 ? "Connection: close\r\n" : "",
(long)strlen(body)); (long)strlen(body));
} }
int isHead = !strcmp(http->method, "HEAD"); int isHead = http->method && !strcmp(http->method, "HEAD");
if (!isHead) { if (!isHead) {
response = stringPrintf(response, "%s", body); response = stringPrintf(response, "%s", body);
} }
free(body); free(body);
check(response);
httpTransfer(http, response, strlen(response)); httpTransfer(http, response, strlen(response));
if (code != 200 || isHead) { if (code != 200 || isHead) {
httpCloseRead(http); httpCloseRead(http);
@ -1905,6 +1909,10 @@ const char *httpGetPeerName(const struct HttpConnection *http) {
return http->peerName; return http->peerName;
} }
const char *httpGetRealIP(const struct HttpConnection *http) {
return getFromHashMap(&http->header, "x-real-ip");
}
const char *httpGetMethod(const struct HttpConnection *http) { const char *httpGetMethod(const struct HttpConnection *http) {
return http->method; return http->method;
} }

1
libhttp/httpconnection.h Normal file → Executable file
View file

@ -148,6 +148,7 @@ struct Server *httpGetServer(const struct HttpConnection *http);
struct ServerConnection *httpGetServerConnection(const struct HttpConnection*); struct ServerConnection *httpGetServerConnection(const struct HttpConnection*);
int httpGetFd(const HttpConnection *http); int httpGetFd(const HttpConnection *http);
const char *httpGetPeerName(const struct HttpConnection *http); const char *httpGetPeerName(const struct HttpConnection *http);
const char *httpGetRealIP(const struct HttpConnection *http);
const char *httpGetMethod(const struct HttpConnection *http); const char *httpGetMethod(const struct HttpConnection *http);
const char *httpGetProtocol(const struct HttpConnection *http); const char *httpGetProtocol(const struct HttpConnection *http);
const char *httpGetHost(const struct HttpConnection *http); const char *httpGetHost(const struct HttpConnection *http);

0
libhttp/libhttp.sym Normal file → Executable file
View file

74
libhttp/server.c Normal file → Executable file
View file

@ -48,10 +48,13 @@
#include <arpa/inet.h> #include <arpa/inet.h>
#include <fcntl.h> #include <fcntl.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/poll.h> #include <sys/poll.h>
#include <sys/stat.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/un.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
@ -138,6 +141,10 @@ int x_poll(struct pollfd *fds, nfds_t nfds, int timeout) {
#endif #endif
time_t currentTime; time_t currentTime;
char *unixDomainPath = NULL;
int unixDomainUser = 0;
int unixDomainGroup = 0;
int unixDomainChmod = 0;
struct PayLoad { struct PayLoad {
int (*handler)(struct HttpConnection *, void *, const char *, int); int (*handler)(struct HttpConnection *, void *, const char *, int);
@ -282,6 +289,50 @@ void initServer(struct Server *server, int localhostOnly, int portMin,
server->numConnections = 0; server->numConnections = 0;
int true = 1; int true = 1;
if (unixDomainPath && *unixDomainPath) {
server->serverFd = socket(AF_UNIX, SOCK_STREAM, 0);
check(server->serverFd >= 0);
check(!setsockopt(server->serverFd, SOL_SOCKET, SO_REUSEADDR,
&true, sizeof(true)));
struct stat st;
if (!stat(unixDomainPath, &st) && S_ISSOCK(st.st_mode)) {
unlink(unixDomainPath);
}
struct sockaddr_un serverAddr = { 0 };
serverAddr.sun_family = AF_UNIX;
memcpy(serverAddr.sun_path, unixDomainPath, sizeof(serverAddr.sun_path));
int servlen = sizeof(serverAddr.sun_family)
+ strlen(unixDomainPath);
if (bind(server->serverFd, (struct sockaddr *)&serverAddr, servlen)) {
fatal("[server] Failed to bind to unix socket! [%d: %s]",
errno, strerror(errno));
}
if (chown(unixDomainPath, unixDomainUser, unixDomainGroup)) {
fatal("[server] Unable to change ownership on unix socket! [%d: %s]",
errno, strerror(errno));
}
if (chmod(unixDomainPath, unixDomainChmod)) {
fatal("[server] Unable to change permission on unix socket! [%d: %s]",
errno, strerror(errno));
}
check(!listen(server->serverFd, SOMAXCONN));
info("[server] Listening on unix domain socket %s...", unixDomainPath);
check(server->pollFds = malloc(sizeof(struct pollfd)));
server->pollFds->fd = server->serverFd;
server->pollFds->events = POLLIN;
initTrie(&server->handlers, serverDestroyHandlers, NULL);
serverRegisterStreamingHttpHandler(server, "/quit", serverQuitHandler, NULL);
initSSL(&server->ssl);
return;
}
server->serverFd = socket(PF_INET, SOCK_STREAM, 0); server->serverFd = socket(PF_INET, SOCK_STREAM, 0);
check(server->serverFd >= 0); check(server->serverFd >= 0);
check(!setsockopt(server->serverFd, SOL_SOCKET, SO_REUSEADDR, check(!setsockopt(server->serverFd, SOL_SOCKET, SO_REUSEADDR,
@ -312,7 +363,7 @@ void initServer(struct Server *server, int localhostOnly, int portMin,
serverAddr.sin_port = 0; serverAddr.sin_port = 0;
} }
if (!serverAddr.sin_port) { if (!serverAddr.sin_port) {
fatal("Failed to find any available port"); fatal("[server] Failed to find any available port!");
} }
} }
@ -322,7 +373,7 @@ void initServer(struct Server *server, int localhostOnly, int portMin,
&socklen)); &socklen));
check(socklen == sizeof(serverAddr)); check(socklen == sizeof(serverAddr));
server->port = ntohs(serverAddr.sin_port); server->port = ntohs(serverAddr.sin_port);
info("Listening on port %d", server->port); info("[server] Listening on port %d...", server->port);
check(server->pollFds = malloc(sizeof(struct pollfd))); check(server->pollFds = malloc(sizeof(struct pollfd)));
server->pollFds->fd = server->serverFd; server->pollFds->fd = server->serverFd;
@ -336,8 +387,8 @@ void initServer(struct Server *server, int localhostOnly, int portMin,
void destroyServer(struct Server *server) { void destroyServer(struct Server *server) {
if (server) { if (server) {
if (server->serverFd >= 0) { if (server->serverFd >= 0) {
info("Shutting down server"); info("[server] Shutting down server");
close(server->serverFd); NOINTR(close(server->serverFd));
} }
for (int i = 0; i < server->numConnections; i++) { for (int i = 0; i < server->numConnections; i++) {
server->connections[i].destroyConnection(server->connections[i].arg); server->connections[i].destroyConnection(server->connections[i].arg);
@ -346,6 +397,14 @@ void destroyServer(struct Server *server) {
free(server->pollFds); free(server->pollFds);
destroyTrie(&server->handlers); destroyTrie(&server->handlers);
destroySSL(&server->ssl); destroySSL(&server->ssl);
if (unixDomainPath) {
struct stat st;
if (*unixDomainPath && !stat(unixDomainPath, &st) && S_ISSOCK(st.st_mode)) {
unlink(unixDomainPath);
}
free(unixDomainPath);
}
} }
} }
@ -611,11 +670,12 @@ void serverLoop(struct Server *server) {
server->looping = loopDepth - 1; server->looping = loopDepth - 1;
} }
void serverEnableSSL(struct Server *server, int flag) { void serverSetupSSL(struct Server *server, int enable, int force) {
if (flag) { if (enable) {
check(serverSupportsSSL()); check(serverSupportsSSL());
} }
sslEnable(&server->ssl, flag); sslEnable(&server->ssl, enable);
sslForce(&server->ssl, force);
} }
void serverSetCertificate(struct Server *server, const char *filename, void serverSetCertificate(struct Server *server, const char *filename,

11
libhttp/server.h Normal file → Executable file
View file

@ -52,6 +52,11 @@
#include "libhttp/http.h" #include "libhttp/http.h"
#include "libhttp/ssl.h" #include "libhttp/ssl.h"
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX 108
#endif
struct Server; struct Server;
struct ServerConnection { struct ServerConnection {
@ -113,7 +118,7 @@ short serverConnectionSetEvents(struct Server *server,
short events); short events);
void serverExitLoop(struct Server *server, int exitAll); void serverExitLoop(struct Server *server, int exitAll);
void serverLoop(struct Server *server); void serverLoop(struct Server *server);
void serverEnableSSL(struct Server *server, int flag); void serverSetupSSL(struct Server *server, int enable, int force);
void serverSetCertificate(struct Server *server, const char *filename, void serverSetCertificate(struct Server *server, const char *filename,
int autoGenerateMissing); int autoGenerateMissing);
void serverSetCertificateFd(struct Server *server, int fd); void serverSetCertificateFd(struct Server *server, int fd);
@ -121,5 +126,9 @@ void serverSetNumericHosts(struct Server *server, int numericHosts);
struct Trie *serverGetHttpHandlers(struct Server *server); struct Trie *serverGetHttpHandlers(struct Server *server);
extern time_t currentTime; extern time_t currentTime;
extern char *unixDomainPath;
extern int unixDomainUser;
extern int unixDomainGroup;
extern int unixDomainChmod;
#endif #endif

186
libhttp/ssl.c Normal file → Executable file
View file

@ -100,17 +100,23 @@ BIO_METHOD * (*BIO_f_buffer)(void);
void (*BIO_free_all)(BIO *); void (*BIO_free_all)(BIO *);
BIO * (*BIO_new)(BIO_METHOD *); BIO * (*BIO_new)(BIO_METHOD *);
BIO * (*BIO_new_socket)(int, int); BIO * (*BIO_new_socket)(int, int);
BIO * (*BIO_next)(BIO *);
BIO * (*BIO_pop)(BIO *); BIO * (*BIO_pop)(BIO *);
BIO * (*BIO_push)(BIO *, BIO *); BIO * (*BIO_push)(BIO *, BIO *);
#if defined(HAVE_OPENSSL_EC)
void (*EC_KEY_free)(EC_KEY *);
EC_KEY * (*EC_KEY_new_by_curve_name)(int);
#endif
void (*ERR_clear_error)(void); void (*ERR_clear_error)(void);
void (*ERR_clear_error)(void);
unsigned long (*ERR_peek_error)(void);
unsigned long (*ERR_peek_error)(void); unsigned long (*ERR_peek_error)(void);
long (*SSL_CTX_callback_ctrl)(SSL_CTX *, int, void (*)(void)); long (*SSL_CTX_callback_ctrl)(SSL_CTX *, int, void (*)(void));
int (*SSL_CTX_check_private_key)(const SSL_CTX *); int (*SSL_CTX_check_private_key)(const SSL_CTX *);
long (*SSL_CTX_ctrl)(SSL_CTX *, int, long, void *); long (*SSL_CTX_ctrl)(SSL_CTX *, int, long, void *);
void (*SSL_CTX_free)(SSL_CTX *); void (*SSL_CTX_free)(SSL_CTX *);
SSL_CTX * (*SSL_CTX_new)(SSL_METHOD *); SSL_CTX * (*SSL_CTX_new)(SSL_METHOD *);
int (*SSL_CTX_set_cipher_list)(SSL_CTX *, const char *);
void (*SSL_CTX_set_info_callback)(SSL_CTX *,
void (*)(const SSL *, int, int));
int (*SSL_CTX_use_PrivateKey_file)(SSL_CTX *, const char *, int); int (*SSL_CTX_use_PrivateKey_file)(SSL_CTX *, const char *, int);
int (*SSL_CTX_use_PrivateKey_ASN1)(int, SSL_CTX *, int (*SSL_CTX_use_PrivateKey_ASN1)(int, SSL_CTX *,
const unsigned char *, long); const unsigned char *, long);
@ -136,6 +142,8 @@ int (*SSL_write)(SSL *, const void *, int);
SSL_METHOD * (*SSLv23_server_method)(void); SSL_METHOD * (*SSLv23_server_method)(void);
X509 * (*d2i_X509)(X509 **px, const unsigned char **in, int len); X509 * (*d2i_X509)(X509 **px, const unsigned char **in, int len);
void (*X509_free)(X509 *a); void (*X509_free)(X509 *a);
void (*x_sk_zero)(void *st);
void * (*x_SSL_COMP_get_compression_methods)(void);
#endif #endif
static void sslDestroyCachedContext(void *ssl_, char *context_) { static void sslDestroyCachedContext(void *ssl_, char *context_) {
@ -160,9 +168,11 @@ struct SSLSupport *newSSL(void) {
void initSSL(struct SSLSupport *ssl) { void initSSL(struct SSLSupport *ssl) {
ssl->enabled = serverSupportsSSL(); ssl->enabled = serverSupportsSSL();
ssl->force = 0;
ssl->sslContext = NULL; ssl->sslContext = NULL;
ssl->sniCertificatePattern = NULL; ssl->sniCertificatePattern = NULL;
ssl->generateMissing = 0; ssl->generateMissing = 0;
ssl->renegotiationCount = 0;
initTrie(&ssl->sniContexts, sslDestroyCachedContext, ssl); initTrie(&ssl->sniContexts, sslDestroyCachedContext, ssl);
} }
@ -271,17 +281,24 @@ static void loadSSL(void) {
{ { &BIO_free_all }, "BIO_free_all" }, { { &BIO_free_all }, "BIO_free_all" },
{ { &BIO_new }, "BIO_new" }, { { &BIO_new }, "BIO_new" },
{ { &BIO_new_socket }, "BIO_new_socket" }, { { &BIO_new_socket }, "BIO_new_socket" },
{ { &BIO_next }, "BIO_next" },
{ { &BIO_pop }, "BIO_pop" }, { { &BIO_pop }, "BIO_pop" },
{ { &BIO_push }, "BIO_push" }, { { &BIO_push }, "BIO_push" },
{ { &ERR_clear_error }, "ERR_clear_error" }, { { &ERR_clear_error }, "ERR_clear_error" },
{ { &ERR_clear_error }, "ERR_clear_error" }, { { &ERR_clear_error }, "ERR_clear_error" },
{ { &ERR_peek_error }, "ERR_peek_error" }, { { &ERR_peek_error }, "ERR_peek_error" },
{ { &ERR_peek_error }, "ERR_peek_error" }, { { &ERR_peek_error }, "ERR_peek_error" },
#ifdef HAVE_OPENSSL_EC
{ { &EC_KEY_free }, "EC_KEY_free" },
{ { &EC_KEY_new_by_curve_name }, "EC_KEY_new_by_curve_name" },
#endif
{ { &SSL_CTX_callback_ctrl }, "SSL_CTX_callback_ctrl" }, { { &SSL_CTX_callback_ctrl }, "SSL_CTX_callback_ctrl" },
{ { &SSL_CTX_check_private_key }, "SSL_CTX_check_private_key" }, { { &SSL_CTX_check_private_key }, "SSL_CTX_check_private_key" },
{ { &SSL_CTX_ctrl }, "SSL_CTX_ctrl" }, { { &SSL_CTX_ctrl }, "SSL_CTX_ctrl" },
{ { &SSL_CTX_free }, "SSL_CTX_free" }, { { &SSL_CTX_free }, "SSL_CTX_free" },
{ { &SSL_CTX_new }, "SSL_CTX_new" }, { { &SSL_CTX_new }, "SSL_CTX_new" },
{ { &SSL_CTX_set_cipher_list }, "SSL_CTX_set_cipher_list" },
{ { &SSL_CTX_set_info_callback }, "SSL_CTX_set_info_callback" },
{ { &SSL_CTX_use_PrivateKey_file }, "SSL_CTX_use_PrivateKey_file" }, { { &SSL_CTX_use_PrivateKey_file }, "SSL_CTX_use_PrivateKey_file" },
{ { &SSL_CTX_use_PrivateKey_ASN1 }, "SSL_CTX_use_PrivateKey_ASN1" }, { { &SSL_CTX_use_PrivateKey_ASN1 }, "SSL_CTX_use_PrivateKey_ASN1" },
{ { &SSL_CTX_use_certificate_file },"SSL_CTX_use_certificate_file"}, { { &SSL_CTX_use_certificate_file },"SSL_CTX_use_certificate_file"},
@ -308,11 +325,12 @@ static void loadSSL(void) {
{ { &SSL_write }, "SSL_write" }, { { &SSL_write }, "SSL_write" },
{ { &SSLv23_server_method }, "SSLv23_server_method" }, { { &SSLv23_server_method }, "SSLv23_server_method" },
{ { &d2i_X509 }, "d2i_X509" }, { { &d2i_X509 }, "d2i_X509" },
{ { &X509_free }, "X509_free" } { { &X509_free }, "X509_free" },
{ { &x_sk_zero }, "sk_zero" }
}; };
for (unsigned i = 0; i < sizeof(symbols)/sizeof(symbols[0]); i++) { for (unsigned i = 0; i < sizeof(symbols)/sizeof(symbols[0]); i++) {
if (!(*symbols[i].var = loadSymbol(path_libssl, symbols[i].fn))) { if (!(*symbols[i].var = loadSymbol(path_libssl, symbols[i].fn))) {
debug("Failed to load SSL support. Could not find \"%s\"", debug("[ssl] Failed to load SSL support. Could not find \"%s\"!",
symbols[i].fn); symbols[i].fn);
for (unsigned j = 0; j < sizeof(symbols)/sizeof(symbols[0]); j++) { for (unsigned j = 0; j < sizeof(symbols)/sizeof(symbols[0]); j++) {
*symbols[j].var = NULL; *symbols[j].var = NULL;
@ -320,9 +338,14 @@ static void loadSSL(void) {
return; return;
} }
} }
// These are optional
x_SSL_COMP_get_compression_methods = loadSymbol(path_libssl, "SSL_COMP_get_compression_methods");
// ends
SSL_library_init(); SSL_library_init();
dcheck(!ERR_peek_error()); dcheck(!ERR_peek_error());
debug("Loaded SSL suppport"); debug("[ssl] Loaded SSL suppport...");
} }
#endif #endif
@ -359,12 +382,12 @@ int serverSupportsSSL(void) {
#if defined(HAVE_OPENSSL) #if defined(HAVE_OPENSSL)
static void sslGenerateCertificate(const char *certificate, static void sslGenerateCertificate(const char *certificate,
const char *serverName) { const char *serverName) {
debug("Auto-generating missing certificate \"%s\" for \"%s\"", info("[ssl] Auto-generating missing certificate \"%s\" for \"%s\"...",
certificate, serverName); certificate, serverName);
pid_t pid = fork(); pid_t pid = fork();
if (pid == -1) { if (pid == -1) {
warn("Failed to generate self-signed certificate \"%s\"", certificate); warn("[ssl] Failed to generate self-signed certificate \"%s\"!", certificate);
} else if (pid == 0) { } else if (pid == 0) {
int fd = NOINTR(open("/dev/null", O_RDONLY)); int fd = NOINTR(open("/dev/null", O_RDONLY));
check(fd != -1); check(fd != -1);
@ -376,16 +399,22 @@ static void sslGenerateCertificate(const char *certificate,
check(NOINTR(close(fd)) == 0); check(NOINTR(close(fd)) == 0);
umask(077); umask(077);
check(setenv("PATH", "/usr/bin:/usr/sbin", 1) == 0); check(setenv("PATH", "/usr/bin:/usr/sbin", 1) == 0);
execlp("openssl", "openssl", "req", "-x509", "-nodes", "-days", "7300", char *subject;
check(subject = stringPrintf(NULL, "/CN=%s/", serverName));
if (execlp("openssl", "openssl", "req", "-x509", "-nodes", "-days", "7300",
"-newkey", "rsa:2048", "-keyout", certificate, "-out", certificate, "-newkey", "rsa:2048", "-keyout", certificate, "-out", certificate,
"-subj", stringPrintf(NULL, "/CN=%s/", serverName), "-subj", subject, (char *)NULL) < 0) {
(char *)NULL); warn("[ssl] Failed to generate self-signed certificate \"%s\"!", certificate);
check(0); free(subject);
}
} else { } else {
int status; int status;
check(NOINTR(waitpid(pid, &status, 0)) == pid); check(NOINTR(waitpid(pid, &status, 0)) == pid);
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
warn("Failed to generate self-signed certificate \"%s\"", certificate); warn("[ssl] Failed to generate self-signed certificate \"%s\"!", certificate);
} else {
info("[ssl] Certificate successfully generated.");
}
} }
} }
@ -581,6 +610,76 @@ static int sslSetCertificateFromFile(SSL_CTX *context,
int rc = sslSetCertificateFromFd(context, fd); int rc = sslSetCertificateFromFd(context, fd);
return rc; return rc;
} }
static void sslInfoCallback(const SSL *sslHndl, int type, int val) {
// Count the number of renegotiations for each SSL session.
if (type & SSL_CB_HANDSHAKE_START) {
struct HttpConnection *http =
(struct HttpConnection *) SSL_get_app_data(sslHndl);
http->ssl->renegotiationCount += 1;
}
}
static SSL_CTX *sslMakeContext(void) {
SSL_CTX *context;
check(context = SSL_CTX_new(SSLv23_server_method()));
long options = SSL_OP_ALL;
options |= SSL_OP_NO_SSLv2;
options |= SSL_OP_NO_SSLv3;
options |= SSL_OP_SINGLE_DH_USE;
#ifdef SSL_OP_NO_COMPRESSION
options |= SSL_OP_NO_COMPRESSION;
#endif
#ifdef SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
options |= SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION;
#endif
// Set default SSL options.
SSL_CTX_set_options(context, options);
// Workaround for SSL_OP_NO_COMPRESSION with older OpenSSL versions.
#ifdef HAVE_DLOPEN
if (SSL_COMP_get_compression_methods) {
sk_SSL_COMP_zero(SSL_COMP_get_compression_methods());
}
#elif OPENSSL_VERSION_NUMBER >= 0x00908000L
sk_SSL_COMP_zero(SSL_COMP_get_compression_methods());
#endif
// For Perfect Forward Secrecy (PFS) support we need to enable some additional
// SSL options, provide eliptic curve key object for handshake and add chipers
// suits with ECDHE handshake on top of the ciper list.
#ifdef HAVE_OPENSSL_EC
SSL_CTX_set_options(context, SSL_OP_SINGLE_ECDH_USE);
SSL_CTX_set_options(context, SSL_OP_CIPHER_SERVER_PREFERENCE);
EC_KEY *ecKey;
check(ecKey = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1));
SSL_CTX_set_tmp_ecdh(context, ecKey);
EC_KEY_free(ecKey);
debug("[ssl] Support for PFS enabled...");
#endif
check(SSL_CTX_set_cipher_list(context,
"ECDHE-RSA-AES256-GCM-SHA384:"
"ECDHE-RSA-AES128-GCM-SHA256:"
"ECDHE-RSA-AES256-SHA384:"
"ECDHE-RSA-AES128-SHA256:"
"ECDHE-RSA-AES256-SHA:"
"ECDHE-RSA-AES128-SHA:"
"ECDHE-RSA-DES-CBC3-SHA:"
"HIGH:MEDIUM:!RC4:!aNULL:!MD5"));
SSL_CTX_set_info_callback(context, sslInfoCallback);
debug("[ssl] Server context successfully initialized...");
return context;
}
#endif #endif
#ifdef HAVE_TLSEXT #ifdef HAVE_TLSEXT
@ -595,7 +694,7 @@ static int sslSNICallback(SSL *sslHndl, int *al ATTR_UNUSED,
} }
struct HttpConnection *http = struct HttpConnection *http =
(struct HttpConnection *)SSL_get_app_data(sslHndl); (struct HttpConnection *)SSL_get_app_data(sslHndl);
debug("Received SNI callback for virtual host \"%s\" from \"%s:%d\"", debug("[ssl] Received SNI callback for virtual host \"%s\" from \"%s:%d\"...",
name, httpGetPeerName(http), httpGetPort(http)); name, httpGetPeerName(http), httpGetPort(http));
char *serverName; char *serverName;
check(serverName = malloc(strlen(name)+2)); check(serverName = malloc(strlen(name)+2));
@ -619,7 +718,7 @@ static int sslSNICallback(SSL *sslHndl, int *al ATTR_UNUSED,
serverName+1, serverName+1,
NULL); NULL);
if (context == NULL) { if (context == NULL) {
check(context = SSL_CTX_new(SSLv23_server_method())); context = sslMakeContext();
check(ssl->sniCertificatePattern); check(ssl->sniCertificatePattern);
char *certificate = stringPrintfUnchecked(NULL, char *certificate = stringPrintfUnchecked(NULL,
ssl->sniCertificatePattern, ssl->sniCertificatePattern,
@ -632,7 +731,7 @@ static int sslSNICallback(SSL *sslHndl, int *al ATTR_UNUSED,
// the default certificate, instead. // the default certificate, instead.
sslSetCertificateFromFile(context, certificate); sslSetCertificateFromFile(context, certificate);
} else { } else {
warn("Could not find matching certificate \"%s\" for \"%s\"", warn("[ssl] Could not find matching certificate \"%s\" for \"%s\"",
certificate, serverName + 1); certificate, serverName + 1);
SSL_CTX_free(context); SSL_CTX_free(context);
context = ssl->sslContext; context = ssl->sslContext;
@ -697,7 +796,7 @@ void sslSetCertificate(struct SSLSupport *ssl, const char *filename,
} }
// Try to set the default certificate. If necessary, (re-)generate it. // Try to set the default certificate. If necessary, (re-)generate it.
check(ssl->sslContext = SSL_CTX_new(SSLv23_server_method())); ssl->sslContext = sslMakeContext();
if (autoGenerateMissing) { if (autoGenerateMissing) {
if (sslSetCertificateFromFile(ssl->sslContext, defaultCertificate) < 0) { if (sslSetCertificateFromFile(ssl->sslContext, defaultCertificate) < 0) {
char hostname[256], buf[4096]; char hostname[256], buf[4096];
@ -709,7 +808,7 @@ void sslSetCertificate(struct SSLSupport *ssl, const char *filename,
sslGenerateCertificate(defaultCertificate, he->h_name); sslGenerateCertificate(defaultCertificate, he->h_name);
} else { } else {
if (h_err) { if (h_err) {
warn("Error getting host information: \"%s\".", hstrerror(h_err)); warn("[ssl] Error getting host information: \"%s\".", hstrerror(h_err));
} }
sslGenerateCertificate(defaultCertificate, hostname); sslGenerateCertificate(defaultCertificate, hostname);
} }
@ -718,7 +817,7 @@ void sslSetCertificate(struct SSLSupport *ssl, const char *filename,
} }
} }
if (sslSetCertificateFromFile(ssl->sslContext, defaultCertificate) < 0) { if (sslSetCertificateFromFile(ssl->sslContext, defaultCertificate) < 0) {
fatal("Cannot read valid certificate from \"%s\". " fatal("[ssl] Cannot read valid certificate from \"%s\"! "
"Check file permissions and file format.", defaultCertificate); "Check file permissions and file format.", defaultCertificate);
} }
valid_certificate: valid_certificate:
@ -781,10 +880,10 @@ static char *sslFdToFilename(int fd) {
void sslSetCertificateFd(struct SSLSupport *ssl, int fd) { void sslSetCertificateFd(struct SSLSupport *ssl, int fd) {
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
check(ssl->sslContext = SSL_CTX_new(SSLv23_server_method())); ssl->sslContext = sslMakeContext();
char *filename = sslFdToFilename(fd); char *filename = sslFdToFilename(fd);
if (!sslSetCertificateFromFd(ssl->sslContext, fd)) { if (!sslSetCertificateFromFd(ssl->sslContext, fd)) {
fatal("Cannot read valid certificate from %s. Check file format.", fatal("[ssl] Cannot read valid certificate from %s. Check file format.",
filename); filename);
} }
free(filename); free(filename);
@ -798,6 +897,12 @@ int sslEnable(struct SSLSupport *ssl, int enabled) {
return old; return old;
} }
int sslForce(struct SSLSupport *ssl, int force) {
int old = ssl->force;
ssl->force = force;
return old;
}
void sslBlockSigPipe(void) { void sslBlockSigPipe(void) {
sigset_t set; sigset_t set;
sigemptyset(&set); sigemptyset(&set);
@ -910,6 +1015,14 @@ int sslPromoteToSSL(struct SSLSupport *ssl, SSL **sslHndl, int fd,
#endif #endif
} }
BIO *sslGetNextBIO(BIO *b) {
#if OPENSSL_VERSION_NUMBER <= 0x10100000L
return b->next_bio;
#else
return BIO_next(b);
#endif
}
void sslFreeHndl(SSL **sslHndl) { void sslFreeHndl(SSL **sslHndl) {
#if defined(HAVE_OPENSSL) #if defined(HAVE_OPENSSL)
if (*sslHndl) { if (*sslHndl) {
@ -917,24 +1030,23 @@ void sslFreeHndl(SSL **sslHndl) {
// BIOs. This is particularly a problem if an SSL connection has two // BIOs. This is particularly a problem if an SSL connection has two
// different BIOs for the read and the write end, with one being a stacked // different BIOs for the read and the write end, with one being a stacked
// derivative of the other. Unfortunately, this is exactly the scenario // derivative of the other. Unfortunately, this is exactly the scenario
// that we set up. // that we set up with call to "BIO_push(readBIO, writeBIO)" in function
// "sslPromoteToSSL()".
// As a work-around, we un-stack the BIOs prior to freeing the SSL // As a work-around, we un-stack the BIOs prior to freeing the SSL
// connection. // connection.
debug("[ssl] Freeing SSL handle.");
ERR_clear_error(); ERR_clear_error();
BIO *writeBIO, *readBIO; BIO *writeBIO, *readBIO;
check(writeBIO = SSL_get_wbio(*sslHndl)); check(writeBIO = SSL_get_wbio(*sslHndl));
check(readBIO = SSL_get_rbio(*sslHndl)); check(readBIO = SSL_get_rbio(*sslHndl));
if (writeBIO != readBIO) { if (writeBIO != readBIO) {
if (readBIO->next_bio == writeBIO) { if (sslGetNextBIO(readBIO) == writeBIO) {
// OK, that's exactly the bug we are looking for. We know how to // OK, that's exactly the bug we are looking for. We know that
// fix it. // writeBIO needs to be removed from readBIO chain.
debug("[ssl] Removing stacked write BIO!");
check(BIO_pop(readBIO) == writeBIO); check(BIO_pop(readBIO) == writeBIO);
check(readBIO->references == 1); check(!sslGetNextBIO(readBIO));
check(writeBIO->references == 1); } else if (sslGetNextBIO(readBIO) == sslGetNextBIO(writeBIO)) {
check(!readBIO->next_bio);
check(!writeBIO->prev_bio);
} else if (readBIO->next_bio == writeBIO->next_bio &&
writeBIO->next_bio->prev_bio == writeBIO) {
// Things get even more confused, if the SSL handshake is aborted // Things get even more confused, if the SSL handshake is aborted
// prematurely. // prematurely.
// OpenSSL appears to internally stack a BIO onto the read end that // OpenSSL appears to internally stack a BIO onto the read end that
@ -943,21 +1055,19 @@ void sslFreeHndl(SSL **sslHndl) {
// reading and one for writing). In this case, not only is the // reading and one for writing). In this case, not only is the
// reference count wrong, but the chain of next_bio/prev_bio pairs // reference count wrong, but the chain of next_bio/prev_bio pairs
// is corrupted, too. // is corrupted, too.
warn("[ssl] Removing stacked socket BIO!");
BIO *sockBIO; BIO *sockBIO;
check(sockBIO = BIO_pop(readBIO)); check(sockBIO = BIO_pop(readBIO));
check(sockBIO == BIO_pop(writeBIO)); check(sockBIO == BIO_pop(writeBIO));
check(readBIO->references == 1); check(!sslGetNextBIO(readBIO));
check(writeBIO->references == 1); check(!sslGetNextBIO(writeBIO));
check(sockBIO->references == 1); check(!sslGetNextBIO(sockBIO));
check(!readBIO->next_bio);
check(!writeBIO->next_bio);
check(!sockBIO->prev_bio);
BIO_free_all(sockBIO); BIO_free_all(sockBIO);
} else { } else {
// We do not know, how to fix this situation. Something must have // We do not know, how to fix this situation. Something must have
// changed in the OpenSSL internals. Either, this is a new bug, or // changed in the OpenSSL internals. Either, this is a new bug, or
// somebody fixed the code in a way that we did not anticipate. // somebody fixed the code in a way that we did not anticipate.
fatal("Unexpected corruption of OpenSSL data structures"); fatal("[ssl] Unexpected corruption of OpenSSL data structures");
} }
} }
SSL_free(*sslHndl); SSL_free(*sslHndl);

35
libhttp/ssl.h Normal file → Executable file
View file

@ -61,6 +61,7 @@
#undef HAVE_OPENSSL #undef HAVE_OPENSSL
typedef struct BIO BIO; typedef struct BIO BIO;
typedef struct BIO_METHOD BIO_METHOD; typedef struct BIO_METHOD BIO_METHOD;
typedef struct EC_KEY EC_KEY;
typedef struct SSL SSL; typedef struct SSL SSL;
typedef struct SSL_CTX SSL_CTX; typedef struct SSL_CTX SSL_CTX;
typedef struct SSL_METHOD SSL_METHOD; typedef struct SSL_METHOD SSL_METHOD;
@ -69,23 +70,35 @@ typedef struct X509 X509;
#define SSL_ERROR_WANT_WRITE 3 #define SSL_ERROR_WANT_WRITE 3
#endif #endif
// EC support was added to OpenSSL in 0.9.8, but it can be disabled in some
// distributions.
#if OPENSSL_VERSION_NUMBER >= 0x0090800fL && !defined(OPENSSL_NO_EC)
# define HAVE_OPENSSL_EC
#endif
#if defined(HAVE_DLOPEN) #if defined(HAVE_DLOPEN)
extern long (*x_BIO_ctrl)(BIO *, int, long, void *); extern long (*x_BIO_ctrl)(BIO *, int, long, void *);
extern BIO_METHOD *(*x_BIO_f_buffer)(void); extern BIO_METHOD *(*x_BIO_f_buffer)(void);
extern void (*x_BIO_free_all)(BIO *); extern void (*x_BIO_free_all)(BIO *);
extern BIO *(*x_BIO_new)(BIO_METHOD *); extern BIO *(*x_BIO_new)(BIO_METHOD *);
extern BIO *(*x_BIO_new_socket)(int, int); extern BIO *(*x_BIO_new_socket)(int, int);
extern BIO *(*x_BIO_next)(BIO *);
extern BIO *(*x_BIO_pop)(BIO *); extern BIO *(*x_BIO_pop)(BIO *);
extern BIO *(*x_BIO_push)(BIO *, BIO *); extern BIO *(*x_BIO_push)(BIO *, BIO *);
#if defined(HAVE_OPENSSL_EC)
extern void (*x_EC_KEY_free)(EC_KEY *);
extern EC_KEY *(*x_EC_KEY_new_by_curve_name)(int);
#endif
extern void (*x_ERR_clear_error)(void); extern void (*x_ERR_clear_error)(void);
extern void (*x_ERR_clear_error)(void);
extern unsigned long (*x_ERR_peek_error)(void);
extern unsigned long (*x_ERR_peek_error)(void); extern unsigned long (*x_ERR_peek_error)(void);
extern long (*x_SSL_CTX_callback_ctrl)(SSL_CTX *, int, void (*)(void)); extern long (*x_SSL_CTX_callback_ctrl)(SSL_CTX *, int, void (*)(void));
extern int (*x_SSL_CTX_check_private_key)(const SSL_CTX *); extern int (*x_SSL_CTX_check_private_key)(const SSL_CTX *);
extern long (*x_SSL_CTX_ctrl)(SSL_CTX *, int, long, void *); extern long (*x_SSL_CTX_ctrl)(SSL_CTX *, int, long, void *);
extern void (*x_SSL_CTX_free)(SSL_CTX *); extern void (*x_SSL_CTX_free)(SSL_CTX *);
extern SSL_CTX*(*x_SSL_CTX_new)(SSL_METHOD *); extern SSL_CTX*(*x_SSL_CTX_new)(SSL_METHOD *);
extern int (*x_SSL_CTX_set_cipher_list)(SSL_CTX *, const char *);
extern void (*x_SSL_CTX_set_info_callback)(SSL_CTX *,
void (*)(const SSL *, int, int));
extern int (*x_SSL_CTX_use_PrivateKey_file)(SSL_CTX *, const char *, int); extern int (*x_SSL_CTX_use_PrivateKey_file)(SSL_CTX *, const char *, int);
extern int (*x_SSL_CTX_use_PrivateKey_ASN1)(int, SSL_CTX *, extern int (*x_SSL_CTX_use_PrivateKey_ASN1)(int, SSL_CTX *,
const unsigned char *, long); const unsigned char *, long);
@ -111,23 +124,28 @@ extern int (*x_SSL_write)(SSL *, const void *, int);
extern SSL_METHOD *(*x_SSLv23_server_method)(void); extern SSL_METHOD *(*x_SSLv23_server_method)(void);
extern X509 * (*x_d2i_X509)(X509 **px, const unsigned char **in, int len); extern X509 * (*x_d2i_X509)(X509 **px, const unsigned char **in, int len);
extern void (*x_X509_free)(X509 *a); extern void (*x_X509_free)(X509 *a);
extern void (*x_sk_zero)(void *st);
extern void *(*x_SSL_COMP_get_compression_methods)(void);
#define BIO_ctrl x_BIO_ctrl #define BIO_ctrl x_BIO_ctrl
#define BIO_f_buffer x_BIO_f_buffer #define BIO_f_buffer x_BIO_f_buffer
#define BIO_free_all x_BIO_free_all #define BIO_free_all x_BIO_free_all
#define BIO_new x_BIO_new #define BIO_new x_BIO_new
#define BIO_new_socket x_BIO_new_socket #define BIO_new_socket x_BIO_new_socket
#define BIO_next x_BIO_next
#define BIO_pop x_BIO_pop #define BIO_pop x_BIO_pop
#define BIO_push x_BIO_push #define BIO_push x_BIO_push
#define EC_KEY_free x_EC_KEY_free
#define EC_KEY_new_by_curve_name x_EC_KEY_new_by_curve_name
#define ERR_clear_error x_ERR_clear_error #define ERR_clear_error x_ERR_clear_error
#define ERR_clear_error x_ERR_clear_error
#define ERR_peek_error x_ERR_peek_error
#define ERR_peek_error x_ERR_peek_error #define ERR_peek_error x_ERR_peek_error
#define SSL_CTX_callback_ctrl x_SSL_CTX_callback_ctrl #define SSL_CTX_callback_ctrl x_SSL_CTX_callback_ctrl
#define SSL_CTX_check_private_key x_SSL_CTX_check_private_key #define SSL_CTX_check_private_key x_SSL_CTX_check_private_key
#define SSL_CTX_ctrl x_SSL_CTX_ctrl #define SSL_CTX_ctrl x_SSL_CTX_ctrl
#define SSL_CTX_free x_SSL_CTX_free #define SSL_CTX_free x_SSL_CTX_free
#define SSL_CTX_new x_SSL_CTX_new #define SSL_CTX_new x_SSL_CTX_new
#define SSL_CTX_set_cipher_list x_SSL_CTX_set_cipher_list
#define SSL_CTX_set_info_callback x_SSL_CTX_set_info_callback
#define SSL_CTX_use_PrivateKey_file x_SSL_CTX_use_PrivateKey_file #define SSL_CTX_use_PrivateKey_file x_SSL_CTX_use_PrivateKey_file
#define SSL_CTX_use_PrivateKey_ASN1 x_SSL_CTX_use_PrivateKey_ASN1 #define SSL_CTX_use_PrivateKey_ASN1 x_SSL_CTX_use_PrivateKey_ASN1
#define SSL_CTX_use_certificate_file x_SSL_CTX_use_certificate_file #define SSL_CTX_use_certificate_file x_SSL_CTX_use_certificate_file
@ -151,10 +169,13 @@ extern void (*x_X509_free)(X509 *a);
#define SSLv23_server_method x_SSLv23_server_method #define SSLv23_server_method x_SSLv23_server_method
#define d2i_X509 x_d2i_X509 #define d2i_X509 x_d2i_X509
#define X509_free x_X509_free #define X509_free x_X509_free
#define sk_zero x_sk_zero
#define SSL_COMP_get_compression_methods x_SSL_COMP_get_compression_methods
#undef BIO_set_buffer_read_data #undef BIO_set_buffer_read_data
#undef SSL_CTX_set_tlsext_servername_arg #undef SSL_CTX_set_tlsext_servername_arg
#undef SSL_CTX_set_tlsext_servername_callback #undef SSL_CTX_set_tlsext_servername_callback
#undef SSL_CTX_set_tmp_ecdh
#undef SSL_get_app_data #undef SSL_get_app_data
#undef SSL_set_app_data #undef SSL_set_app_data
#undef SSL_set_mode #undef SSL_set_mode
@ -169,6 +190,9 @@ extern void (*x_X509_free)(X509 *a);
(x_SSL_CTX_callback_ctrl(ctx, \ (x_SSL_CTX_callback_ctrl(ctx, \
SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, \ SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, \
(void (*)(void))cb)) (void (*)(void))cb))
#define SSL_CTX_set_tmp_ecdh(ctx, ecdh) \
(x_SSL_CTX_ctrl(ctx, SSL_CTRL_SET_TMP_ECDH, \
0, (char *)ecdh))
#define SSL_get_app_data(s) (x_SSL_get_ex_data(s, 0)) #define SSL_get_app_data(s) (x_SSL_get_ex_data(s, 0))
#define SSL_set_app_data(s, arg) (x_SSL_set_ex_data(s, 0, (char *)arg)) #define SSL_set_app_data(s, arg) (x_SSL_set_ex_data(s, 0, (char *)arg))
#define SSL_set_mode(ssl, op) (x_SSL_ctrl((ssl), SSL_CTRL_MODE, (op), NULL)) #define SSL_set_mode(ssl, op) (x_SSL_ctrl((ssl), SSL_CTRL_MODE, (op), NULL))
@ -176,9 +200,11 @@ extern void (*x_X509_free)(X509 *a);
struct SSLSupport { struct SSLSupport {
int enabled; int enabled;
int force;
SSL_CTX *sslContext; SSL_CTX *sslContext;
char *sniCertificatePattern; char *sniCertificatePattern;
int generateMissing; int generateMissing;
int renegotiationCount;
struct Trie sniContexts; struct Trie sniContexts;
}; };
@ -191,6 +217,7 @@ void sslSetCertificate(struct SSLSupport *ssl, const char *filename,
int autoGenerateMissing); int autoGenerateMissing);
void sslSetCertificateFd(struct SSLSupport *ssl, int fd); void sslSetCertificateFd(struct SSLSupport *ssl, int fd);
int sslEnable(struct SSLSupport *ssl, int enabled); int sslEnable(struct SSLSupport *ssl, int enabled);
int sslForce(struct SSLSupport *ssl, int force);
void sslBlockSigPipe(); void sslBlockSigPipe();
int sslUnblockSigPipe(); int sslUnblockSigPipe();
int sslPromoteToSSL(struct SSLSupport *ssl, SSL **sslHndl, int fd, int sslPromoteToSSL(struct SSLSupport *ssl, SSL **sslHndl, int fd,

0
libhttp/trie.c Normal file → Executable file
View file

0
libhttp/trie.h Normal file → Executable file
View file

29
libhttp/url.c Normal file → Executable file
View file

@ -82,10 +82,10 @@ static char *urlUnescape(char *s) {
ch = (ch << 4) + c2 - (c2 > '9' ? 'A' - 10 : '0'); ch = (ch << 4) + c2 - (c2 > '9' ? 'A' - 10 : '0');
++u; ++u;
} else if (!warned++) { } else if (!warned++) {
warn("Malformed URL encoded data \"%s\"", r); warn("[http] Malformed URL encoded data \"%s\"!", r);
} }
} else if (!warned++) { } else if (!warned++) {
warn("Malformed URL encoded data \"%s\"", r); warn("[http] Malformed URL encoded data \"%s\"!", r);
} }
} }
*s++ = ch; *s++ = ch;
@ -113,7 +113,7 @@ static char *urlMakeString(const char *buf, int len) {
} }
} }
static void urlParseQueryString(struct URL *url, const char *query, int len) { static void urlParseQueryString(struct HashMap *hashmap, const char *query, int len) {
const char *key = query; const char *key = query;
const char *value = NULL; const char *value = NULL;
for (const char *ampersand = query; len-- >= 0; ampersand++) { for (const char *ampersand = query; len-- >= 0; ampersand++) {
@ -131,7 +131,7 @@ static void urlParseQueryString(struct URL *url, const char *query, int len) {
v = urlMakeString(value, vl); v = urlMakeString(value, vl);
urlUnescape(v); urlUnescape(v);
} }
addToHashMap(&url->args, k, v); addToHashMap(hashmap, k, v);
} }
key = ampersand + 1; key = ampersand + 1;
value = NULL; value = NULL;
@ -275,7 +275,7 @@ static void urlParsePostBody(struct URL *url,
const char *ctHeader = getFromHashMap(&http->header, "content-type"); const char *ctHeader = getFromHashMap(&http->header, "content-type");
urlParseHeaderLine(&contentType, ctHeader, ctHeader ? strlen(ctHeader) : 0); urlParseHeaderLine(&contentType, ctHeader, ctHeader ? strlen(ctHeader) : 0);
if (getRefFromHashMap(&contentType, "application/x-www-form-urlencoded")) { if (getRefFromHashMap(&contentType, "application/x-www-form-urlencoded")) {
urlParseQueryString(url, buf, len); urlParseQueryString(&url->args, buf, len);
} else if (getRefFromHashMap(&contentType, "multipart/form-data")) { } else if (getRefFromHashMap(&contentType, "multipart/form-data")) {
const char *boundary = getFromHashMap(&contentType, "boundary"); const char *boundary = getFromHashMap(&contentType, "boundary");
if (boundary && *boundary) { if (boundary && *boundary) {
@ -297,7 +297,7 @@ static void urlParsePostBody(struct URL *url,
urlParsePart(url, lastPart, ptr - lastPart); urlParsePart(url, lastPart, ptr - lastPart);
} else { } else {
if (ptr != buf) { if (ptr != buf) {
info("Ignoring prologue before \"multipart/form-data\""); info("[http] Ignoring prologue before \"multipart/form-data\"!");
} }
} }
lastPart = part; lastPart = part;
@ -307,18 +307,18 @@ static void urlParsePostBody(struct URL *url,
urlParsePart(url, lastPart, ptr - lastPart); urlParsePart(url, lastPart, ptr - lastPart);
lastPart = NULL; lastPart = NULL;
if (len > 0) { if (len > 0) {
info("Ignoring epilogue past end of \"multipart/" info("[http] Ignoring epilogue past end of \"multipart/"
"form-data\""); "form-data\"!");
} }
} }
} }
} }
} }
if (lastPart) { if (lastPart) {
warn("Missing final \"boundary\" for \"multipart/form-data\""); warn("[http] Missing final \"boundary\" for \"multipart/form-data\"!");
} }
} else { } else {
warn("Missing \"boundary\" information for \"multipart/form-data\""); warn("[http] Missing \"boundary\" information for \"multipart/form-data\"!");
} }
} }
destroyHashMap(&contentType); destroyHashMap(&contentType);
@ -346,7 +346,8 @@ void initURL(struct URL *url, const struct HttpConnection *http,
url->url = NULL; url->url = NULL;
initHashMap(&url->args, urlDestroyHashMapEntry, NULL); initHashMap(&url->args, urlDestroyHashMapEntry, NULL);
if (!strcmp(http->method, "GET")) { if (!strcmp(http->method, "GET")) {
urlParseQueryString(url, url->query, strlen(url->query)); check(url->query);
urlParseQueryString(&url->args, url->query, strlen(url->query));
} else if (!strcmp(http->method, "POST")) { } else if (!strcmp(http->method, "POST")) {
urlParsePostBody(url, http, buf, len); urlParsePostBody(url, http, buf, len);
} }
@ -428,3 +429,9 @@ const char *urlGetURL(struct URL *url) {
const struct HashMap *urlGetArgs(struct URL *url) { const struct HashMap *urlGetArgs(struct URL *url) {
return &url->args; return &url->args;
} }
struct HashMap *urlParseQuery(const char *buf, int len) {
struct HashMap *hashmap = newHashMap(urlDestroyHashMapEntry, NULL);
urlParseQueryString(hashmap, buf, len);
return hashmap;
}

2
libhttp/url.h Normal file → Executable file
View file

@ -83,4 +83,6 @@ const char *urlGetAnchor(struct URL *url);
const char *urlGetURL(struct URL *url); const char *urlGetURL(struct URL *url);
const struct HashMap *urlGetArgs(struct URL *url); const struct HashMap *urlGetArgs(struct URL *url);
struct HashMap *urlParseQuery(const char *buf, int len);
#endif /* URL_H__ */ #endif /* URL_H__ */

29
logging/logging.c Normal file → Executable file
View file

@ -52,6 +52,19 @@
#include "logging/logging.h" #include "logging/logging.h"
#ifdef HAVE_SYSLOG_H
# include <syslog.h>
# ifndef HAVE_VSYSLOG
static void vsyslog(int priority, const char *fmt, va_list ap) {
char *s = vStringPrintf(NULL, fmt, ap);
if (s) {
syslog(priority, "%s", s);
free(s);
}
}
# endif
#endif
static int verbosity = MSG_DEFAULT; static int verbosity = MSG_DEFAULT;
static void debugMsg(int level, const char *fmt, va_list ap) { static void debugMsg(int level, const char *fmt, va_list ap) {
@ -86,6 +99,13 @@ void error(const char *fmt, ...) {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
debugMsg(MSG_ERROR, fmt, ap); debugMsg(MSG_ERROR, fmt, ap);
#ifdef HAVE_SYSLOG_H
va_list apSyslog;
va_copy(apSyslog, ap);
va_start(apSyslog, fmt);
vsyslog(LOG_ERR, fmt, apSyslog);
va_end(apSyslog);
#endif
va_end(ap); va_end(ap);
} }
@ -100,6 +120,14 @@ void fatal(const char *fmt, ...) {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
debugMsg(MSG_QUIET, fmt, ap); debugMsg(MSG_QUIET, fmt, ap);
#ifdef HAVE_SYSLOG_H
va_list apSyslog;
va_copy(apSyslog, ap);
va_start(apSyslog, fmt);
vsyslog(LOG_CRIT, fmt, apSyslog);
va_end(apSyslog);
syslog(LOG_CRIT, "[server] Aborting...");
#endif
va_end(ap); va_end(ap);
_exit(1); _exit(1);
} }
@ -191,4 +219,3 @@ char *stringPrintfUnchecked(char *buf, const char *fmt, ...)
return s; return s;
} }
#endif #endif

0
logging/logging.h Normal file → Executable file
View file

8413
ltmain.sh

File diff suppressed because it is too large Load diff

3
m4/.gitignore vendored Executable file
View file

@ -0,0 +1,3 @@
# This directory is used by autotools, so we ignore all files except this one.
*
!.gitignore

237
misc/embedded.html Executable file
View file

@ -0,0 +1,237 @@
<!DOCTYPE HTML>
<!--
##
# Example page with embedded Shell In A Box.
#
On this page we can see how Shell In A Box can be embedded in another page and
how can we comunicate with it.
##
# Server Side
#
For communication with Shell In A Box we need to set '-m' (messages-origin)
command line option with appropriate messages origin. Origin should be set to
URL of parent (this) window. If origin is set to '*' Shell In A Box won't check
origin on received messages. This is usually unsafe option.
Command line example:
shellinaboxd -p 4200 -m 'https://192.168.1.150'
##
# Client Side
#
Shell In A Box accepts messages formatted as JSON strings with 'type' and 'data'
fields. Messages with same format can be passed back to parent (this) window.
Message example:
var message = JSON.stringify({
type : "message type",
data : "additional data"
});
Messages are passed with function postMessage() and are received in "message"
events.
Following types of message can be sent to shellinabox:
* input
writes content of data field to terminal
* output
enables passing of output to parent window (data field must be set
to enable, disable or toggle)
* session
request sessions status
* onsessionchange
enables passing session status to parent window (data field must be
set to enable, disable or toggle)
* reconnect
reconnects the terminal
Following types of messages can be received from shellinabox:
* ready
signals that shellinabox is ready to send and receive messages
* output
data field contains terminal output
* session
data field contains session status (alive or closed)
Example for passing command to Shell In A Box frame:
iframe.contentWindow.postMessage(JSON.stringify({
type : "input",
data : "ls -l\n"
}), "https://192.168.1.150:4200");
Please note that message passing and JSON operations are only supported on moderen
browsers.
##
# Info
#
For working examples please see HTML and JS code bellow...
For more info and browser limitations on iframe message passing please check:
https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
-->
<html>
<head>
<style>
p {
font-size: 1.1em;
}
#shell, #output {
width: 640px;
height: 300px;
margin: 20px 10px;
}
#output {
overflow: scroll;
border: 2px solid #999;
}
</style>
</head>
<body>
<h3>
Embedded Shell In A Box example page.
</h3>
<p>Controls:</p>
<div>
<input type="text" id="input"></input>
<input type="button" id="execute" value="Execute"></input>
<input type="button" id="output-enable" value="Output Enable"></input>
<input type="button" id="output-disable" value="Output Disable"></input>
<input type="button" id="reconnect" value="Reconnect"></input>
<input type="button" id="session-reload" value="Session Status"></input>
<input type="button" id="session-toggle" value="Session Status Toggle"></input>
</div>
<p id="session">Session status: ???</p>
<!--
Embedded shellinabox. In our case src attribute will be added with help
of JS. -->
<iframe id="shell" src=""></iframe>
<!-- Ouput -->
<p>Terminal output:</p>
<pre id="output"></pre>
<script>
// Shellinabox url
var url = "https://192.168.1.150:4200";
var input = document.getElementById("input");
var iframe = document.getElementById("shell");
var output = document.getElementById("output");
var session = document.getElementById("session");
document.getElementById("execute").addEventListener("click", function() {
// Send input to shellinabox
var message = JSON.stringify({
type : 'input',
data : input.value + '\n'
});
iframe.contentWindow.postMessage(message, url);
});
document.getElementById("output-enable").addEventListener("click", function() {
// Enable output replay from shellinabox iframe
var message = JSON.stringify({
type : 'output',
data : 'enable'
});
iframe.contentWindow.postMessage(message, url);
});
document.getElementById("output-disable").addEventListener("click", function() {
// Disable output replay from shellinabox iframe
var message = JSON.stringify({
type : 'output',
data : 'disable'
});
iframe.contentWindow.postMessage(message, url);
// Clear output window
output.innerHTML = '';
});
document.getElementById("session-reload").addEventListener("click", function() {
// Request shellianbox session status
var message = JSON.stringify({
type : 'session'
});
iframe.contentWindow.postMessage(message, url);
});
document.getElementById("session-toggle").addEventListener("click", function() {
// Toggles shellinabox session status reporting
var message = JSON.stringify({
type : 'onsessionchange',
data : 'toggle'
});
iframe.contentWindow.postMessage(message, url);
});
document.getElementById("reconnect").addEventListener("click", function() {
// Request shellianbox session status
var message = JSON.stringify({
type : 'reconnect'
});
iframe.contentWindow.postMessage(message, url);
});
// Receive response from shellinabox
window.addEventListener("message", function(message) {
// Allow messages only from shellinabox
if (message.origin !== url) {
return;
}
// Handle response according to response type
var decoded = JSON.parse(message.data);
switch (decoded.type) {
case "ready":
// Shellinabox is ready to communicate and we will enable console output
// by default.
var message = JSON.stringify({
type : 'output',
data : 'enable'
});
iframe.contentWindow.postMessage(message, url);
break;
case "output" :
// Append new output
output.innerHTML = output.innerHTML + decoded.data;
break;
case "session" :
// Reload session status
session.innerHTML = 'Session status: ' + decoded.data;
break;
}
}, false);
// Add url to our iframe after the event listener is installed.
iframe.src = url;
</script>
</body>
</html>

BIN
misc/preview.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 KiB

BIN
misc/preview.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

367
missing
View file

@ -1,367 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2006-05-10.23
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case $1 in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $1 in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG="\${$#}"
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

22
sgit Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
set -ex
if [[ "--help" == "${1}" ]]; then
echo "bash ./sgit user.email commit"
fi
if [[ -z "${2}" ]]; then
echo "Bitte email und commit angeben!!!"
exit 1
fi
git config --global user.email "${1}"
git config --global user.name "${1}"
git status
git pull
git add --all
git commit --all -m "${2}"
git show
git push
git status

9
shellinabox.service Executable file
View file

@ -0,0 +1,9 @@
[Unit]
Description=shellinabox
[Service]
Type=oneshot
ExecStart=/opt/shellinabox/shellinaboxd -t --service=/:webssh:webssh:HOME:'/home/webssh/shellinabox_sshwrapper.sh'
[Install]
WantedBy=multi-user.target

0
shellinabox/beep.wav Normal file → Executable file
View file

16
shellinabox/black-on-white.css Normal file → Executable file
View file

@ -0,0 +1,16 @@
#vt100 .ansiDefR {
color: #ffffff;
}
#vt100 .bgAnsiDefR {
background-color: #000000;
}
#vt100 #scrollable.inverted .ansiDefR {
color: #000000;
}
#vt100 #scrollable.inverted .bgAnsiDefR {
background-color: #ffffff;
}

1
shellinabox/cgi_root.html Normal file → Executable file
View file

@ -2,6 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- <!--
ShellInABox - Make command line applications available as AJAX web applications ShellInABox - Make command line applications available as AJAX web applications
Copyright (C) 2008-2009 Markus Gutschke markus@shellinabox.com Copyright (C) 2008-2009 Markus Gutschke markus@shellinabox.com

497
shellinabox/color.css Normal file → Executable file
View file

@ -1,5 +1,10 @@
/* DEFINES_COLORS */ /* DEFINES_COLORS */
#vt100 .ansi0 { }
/* SYSTEM colors */
#vt100 .ansiDef { }
#vt100 .ansiDefR { }
#vt100 .ansi0 { color: #000000; }
#vt100 .ansi1 { color: #cd0000; } #vt100 .ansi1 { color: #cd0000; }
#vt100 .ansi2 { color: #00cd00; } #vt100 .ansi2 { color: #00cd00; }
#vt100 .ansi3 { color: #cdcd00; } #vt100 .ansi3 { color: #cdcd00; }
@ -16,6 +21,252 @@
#vt100 .ansi14 { color: #00ffff; } #vt100 .ansi14 { color: #00ffff; }
#vt100 .ansi15 { color: #ffffff; } #vt100 .ansi15 { color: #ffffff; }
/* XTERM colors - 256 color mode */
#vt100 .ansi16 { color: #000000; }
#vt100 .ansi17 { color: #00005f; }
#vt100 .ansi18 { color: #000087; }
#vt100 .ansi19 { color: #0000af; }
#vt100 .ansi20 { color: #0000d7; }
#vt100 .ansi21 { color: #0000ff; }
#vt100 .ansi22 { color: #005f00; }
#vt100 .ansi23 { color: #005f5f; }
#vt100 .ansi24 { color: #005f87; }
#vt100 .ansi25 { color: #005faf; }
#vt100 .ansi26 { color: #005fd7; }
#vt100 .ansi27 { color: #005fff; }
#vt100 .ansi28 { color: #008700; }
#vt100 .ansi29 { color: #00875f; }
#vt100 .ansi30 { color: #008787; }
#vt100 .ansi31 { color: #0087af; }
#vt100 .ansi32 { color: #0087d7; }
#vt100 .ansi33 { color: #0087ff; }
#vt100 .ansi34 { color: #00af00; }
#vt100 .ansi35 { color: #00af5f; }
#vt100 .ansi36 { color: #00af87; }
#vt100 .ansi37 { color: #00afaf; }
#vt100 .ansi38 { color: #00afd7; }
#vt100 .ansi39 { color: #00afff; }
#vt100 .ansi40 { color: #00d700; }
#vt100 .ansi41 { color: #00d75f; }
#vt100 .ansi42 { color: #00d787; }
#vt100 .ansi43 { color: #00d7af; }
#vt100 .ansi44 { color: #00d7d7; }
#vt100 .ansi45 { color: #00d7ff; }
#vt100 .ansi46 { color: #00ff00; }
#vt100 .ansi47 { color: #00ff5f; }
#vt100 .ansi48 { color: #00ff87; }
#vt100 .ansi49 { color: #00ffaf; }
#vt100 .ansi50 { color: #00ffd7; }
#vt100 .ansi51 { color: #00ffff; }
#vt100 .ansi52 { color: #5f0000; }
#vt100 .ansi53 { color: #5f005f; }
#vt100 .ansi54 { color: #5f0087; }
#vt100 .ansi55 { color: #5f00af; }
#vt100 .ansi56 { color: #5f00d7; }
#vt100 .ansi57 { color: #5f00ff; }
#vt100 .ansi58 { color: #5f5f00; }
#vt100 .ansi59 { color: #5f5f5f; }
#vt100 .ansi60 { color: #5f5f87; }
#vt100 .ansi61 { color: #5f5faf; }
#vt100 .ansi62 { color: #5f5fd7; }
#vt100 .ansi63 { color: #5f5fff; }
#vt100 .ansi64 { color: #5f8700; }
#vt100 .ansi65 { color: #5f875f; }
#vt100 .ansi66 { color: #5f8787; }
#vt100 .ansi67 { color: #5f87af; }
#vt100 .ansi68 { color: #5f87d7; }
#vt100 .ansi69 { color: #5f87ff; }
#vt100 .ansi70 { color: #5faf00; }
#vt100 .ansi71 { color: #5faf5f; }
#vt100 .ansi72 { color: #5faf87; }
#vt100 .ansi73 { color: #5fafaf; }
#vt100 .ansi74 { color: #5fafd7; }
#vt100 .ansi75 { color: #5fafff; }
#vt100 .ansi76 { color: #5fd700; }
#vt100 .ansi77 { color: #5fd75f; }
#vt100 .ansi78 { color: #5fd787; }
#vt100 .ansi79 { color: #5fd7af; }
#vt100 .ansi80 { color: #5fd7d7; }
#vt100 .ansi81 { color: #5fd7ff; }
#vt100 .ansi82 { color: #5fff00; }
#vt100 .ansi83 { color: #5fff5f; }
#vt100 .ansi84 { color: #5fff87; }
#vt100 .ansi85 { color: #5fffaf; }
#vt100 .ansi86 { color: #5fffd7; }
#vt100 .ansi87 { color: #5fffff; }
#vt100 .ansi88 { color: #870000; }
#vt100 .ansi89 { color: #87005f; }
#vt100 .ansi90 { color: #870087; }
#vt100 .ansi91 { color: #8700af; }
#vt100 .ansi92 { color: #8700d7; }
#vt100 .ansi93 { color: #8700ff; }
#vt100 .ansi94 { color: #875f00; }
#vt100 .ansi95 { color: #875f5f; }
#vt100 .ansi96 { color: #875f87; }
#vt100 .ansi97 { color: #875faf; }
#vt100 .ansi98 { color: #875fd7; }
#vt100 .ansi99 { color: #875fff; }
#vt100 .ansi100 { color: #878700; }
#vt100 .ansi101 { color: #87875f; }
#vt100 .ansi102 { color: #878787; }
#vt100 .ansi103 { color: #8787af; }
#vt100 .ansi104 { color: #8787d7; }
#vt100 .ansi105 { color: #8787ff; }
#vt100 .ansi106 { color: #87af00; }
#vt100 .ansi107 { color: #87af5f; }
#vt100 .ansi108 { color: #87af87; }
#vt100 .ansi109 { color: #87afaf; }
#vt100 .ansi110 { color: #87afd7; }
#vt100 .ansi111 { color: #87afff; }
#vt100 .ansi112 { color: #87d700; }
#vt100 .ansi113 { color: #87d75f; }
#vt100 .ansi114 { color: #87d787; }
#vt100 .ansi115 { color: #87d7af; }
#vt100 .ansi116 { color: #87d7d7; }
#vt100 .ansi117 { color: #87d7ff; }
#vt100 .ansi118 { color: #87ff00; }
#vt100 .ansi119 { color: #87ff5f; }
#vt100 .ansi120 { color: #87ff87; }
#vt100 .ansi121 { color: #87ffaf; }
#vt100 .ansi122 { color: #87ffd7; }
#vt100 .ansi123 { color: #87ffff; }
#vt100 .ansi124 { color: #af0000; }
#vt100 .ansi125 { color: #af005f; }
#vt100 .ansi126 { color: #af0087; }
#vt100 .ansi127 { color: #af00af; }
#vt100 .ansi128 { color: #af00d7; }
#vt100 .ansi129 { color: #af00ff; }
#vt100 .ansi130 { color: #af5f00; }
#vt100 .ansi131 { color: #af5f5f; }
#vt100 .ansi132 { color: #af5f87; }
#vt100 .ansi133 { color: #af5faf; }
#vt100 .ansi134 { color: #af5fd7; }
#vt100 .ansi135 { color: #af5fff; }
#vt100 .ansi136 { color: #af8700; }
#vt100 .ansi137 { color: #af875f; }
#vt100 .ansi138 { color: #af8787; }
#vt100 .ansi139 { color: #af87af; }
#vt100 .ansi140 { color: #af87d7; }
#vt100 .ansi141 { color: #af87ff; }
#vt100 .ansi142 { color: #afaf00; }
#vt100 .ansi143 { color: #afaf5f; }
#vt100 .ansi144 { color: #afaf87; }
#vt100 .ansi145 { color: #afafaf; }
#vt100 .ansi146 { color: #afafd7; }
#vt100 .ansi147 { color: #afafff; }
#vt100 .ansi148 { color: #afd700; }
#vt100 .ansi149 { color: #afd75f; }
#vt100 .ansi150 { color: #afd787; }
#vt100 .ansi151 { color: #afd7af; }
#vt100 .ansi152 { color: #afd7d7; }
#vt100 .ansi153 { color: #afd7ff; }
#vt100 .ansi154 { color: #afff00; }
#vt100 .ansi155 { color: #afff5f; }
#vt100 .ansi156 { color: #afff87; }
#vt100 .ansi157 { color: #afffaf; }
#vt100 .ansi158 { color: #afffd7; }
#vt100 .ansi159 { color: #afffff; }
#vt100 .ansi160 { color: #d70000; }
#vt100 .ansi161 { color: #d7005f; }
#vt100 .ansi162 { color: #d70087; }
#vt100 .ansi163 { color: #d700af; }
#vt100 .ansi164 { color: #d700d7; }
#vt100 .ansi165 { color: #d700ff; }
#vt100 .ansi166 { color: #d75f00; }
#vt100 .ansi167 { color: #d75f5f; }
#vt100 .ansi168 { color: #d75f87; }
#vt100 .ansi169 { color: #d75faf; }
#vt100 .ansi170 { color: #d75fd7; }
#vt100 .ansi171 { color: #d75fff; }
#vt100 .ansi172 { color: #d78700; }
#vt100 .ansi173 { color: #d7875f; }
#vt100 .ansi174 { color: #d78787; }
#vt100 .ansi175 { color: #d787af; }
#vt100 .ansi176 { color: #d787d7; }
#vt100 .ansi177 { color: #d787ff; }
#vt100 .ansi178 { color: #d7af00; }
#vt100 .ansi179 { color: #d7af5f; }
#vt100 .ansi180 { color: #d7af87; }
#vt100 .ansi181 { color: #d7afaf; }
#vt100 .ansi182 { color: #d7afd7; }
#vt100 .ansi183 { color: #d7afff; }
#vt100 .ansi184 { color: #d7d700; }
#vt100 .ansi185 { color: #d7d75f; }
#vt100 .ansi186 { color: #d7d787; }
#vt100 .ansi187 { color: #d7d7af; }
#vt100 .ansi188 { color: #d7d7d7; }
#vt100 .ansi189 { color: #d7d7ff; }
#vt100 .ansi190 { color: #d7ff00; }
#vt100 .ansi191 { color: #d7ff5f; }
#vt100 .ansi192 { color: #d7ff87; }
#vt100 .ansi193 { color: #d7ffaf; }
#vt100 .ansi194 { color: #d7ffd7; }
#vt100 .ansi195 { color: #d7ffff; }
#vt100 .ansi196 { color: #ff0000; }
#vt100 .ansi197 { color: #ff005f; }
#vt100 .ansi198 { color: #ff0087; }
#vt100 .ansi199 { color: #ff00af; }
#vt100 .ansi200 { color: #ff00d7; }
#vt100 .ansi201 { color: #ff00ff; }
#vt100 .ansi202 { color: #ff5f00; }
#vt100 .ansi203 { color: #ff5f5f; }
#vt100 .ansi204 { color: #ff5f87; }
#vt100 .ansi205 { color: #ff5faf; }
#vt100 .ansi206 { color: #ff5fd7; }
#vt100 .ansi207 { color: #ff5fff; }
#vt100 .ansi208 { color: #ff8700; }
#vt100 .ansi209 { color: #ff875f; }
#vt100 .ansi210 { color: #ff8787; }
#vt100 .ansi211 { color: #ff87af; }
#vt100 .ansi212 { color: #ff87d7; }
#vt100 .ansi213 { color: #ff87ff; }
#vt100 .ansi214 { color: #ffaf00; }
#vt100 .ansi215 { color: #ffaf5f; }
#vt100 .ansi216 { color: #ffaf87; }
#vt100 .ansi217 { color: #ffafaf; }
#vt100 .ansi218 { color: #ffafd7; }
#vt100 .ansi219 { color: #ffafff; }
#vt100 .ansi220 { color: #ffd700; }
#vt100 .ansi221 { color: #ffd75f; }
#vt100 .ansi222 { color: #ffd787; }
#vt100 .ansi223 { color: #ffd7af; }
#vt100 .ansi224 { color: #ffd7d7; }
#vt100 .ansi225 { color: #ffd7ff; }
#vt100 .ansi226 { color: #ffff00; }
#vt100 .ansi227 { color: #ffff5f; }
#vt100 .ansi228 { color: #ffff87; }
#vt100 .ansi229 { color: #ffffaf; }
#vt100 .ansi230 { color: #ffffd7; }
#vt100 .ansi231 { color: #ffffff; }
#vt100 .ansi232 { color: #080808; }
#vt100 .ansi233 { color: #121212; }
#vt100 .ansi234 { color: #1c1c1c; }
#vt100 .ansi235 { color: #262626; }
#vt100 .ansi236 { color: #303030; }
#vt100 .ansi237 { color: #3a3a3a; }
#vt100 .ansi238 { color: #444444; }
#vt100 .ansi239 { color: #4e4e4e; }
#vt100 .ansi240 { color: #585858; }
#vt100 .ansi241 { color: #626262; }
#vt100 .ansi242 { color: #6c6c6c; }
#vt100 .ansi243 { color: #767676; }
#vt100 .ansi244 { color: #808080; }
#vt100 .ansi245 { color: #8a8a8a; }
#vt100 .ansi246 { color: #949494; }
#vt100 .ansi247 { color: #9e9e9e; }
#vt100 .ansi248 { color: #a8a8a8; }
#vt100 .ansi249 { color: #b2b2b2; }
#vt100 .ansi250 { color: #bcbcbc; }
#vt100 .ansi251 { color: #c6c6c6; }
#vt100 .ansi252 { color: #d0d0d0; }
#vt100 .ansi253 { color: #dadada; }
#vt100 .ansi254 { color: #e4e4e4; }
#vt100 .ansi255 { color: #eeeeee; }
/* SYSTEM colors */
#vt100 .bgAnsiDef { }
#vt100 .bgAnsiDefR { }
#vt100 .bgAnsi0 { background-color: #000000; } #vt100 .bgAnsi0 { background-color: #000000; }
#vt100 .bgAnsi1 { background-color: #cd0000; } #vt100 .bgAnsi1 { background-color: #cd0000; }
#vt100 .bgAnsi2 { background-color: #00cd00; } #vt100 .bgAnsi2 { background-color: #00cd00; }
@ -31,4 +282,246 @@
#vt100 .bgAnsi12 { background-color: #5c5cff; } #vt100 .bgAnsi12 { background-color: #5c5cff; }
#vt100 .bgAnsi13 { background-color: #ff00ff; } #vt100 .bgAnsi13 { background-color: #ff00ff; }
#vt100 .bgAnsi14 { background-color: #00ffff; } #vt100 .bgAnsi14 { background-color: #00ffff; }
#vt100 .bgAnsi15 { } #vt100 .bgAnsi15 { background-color: #ffffff; }
/* XTERM colors - 256 color mode */
#vt100 .bgAnsi16 { background-color: #000000; }
#vt100 .bgAnsi17 { background-color: #00005f; }
#vt100 .bgAnsi18 { background-color: #000087; }
#vt100 .bgAnsi19 { background-color: #0000af; }
#vt100 .bgAnsi20 { background-color: #0000d7; }
#vt100 .bgAnsi21 { background-color: #0000ff; }
#vt100 .bgAnsi22 { background-color: #005f00; }
#vt100 .bgAnsi23 { background-color: #005f5f; }
#vt100 .bgAnsi24 { background-color: #005f87; }
#vt100 .bgAnsi25 { background-color: #005faf; }
#vt100 .bgAnsi26 { background-color: #005fd7; }
#vt100 .bgAnsi27 { background-color: #005fff; }
#vt100 .bgAnsi28 { background-color: #008700; }
#vt100 .bgAnsi29 { background-color: #00875f; }
#vt100 .bgAnsi30 { background-color: #008787; }
#vt100 .bgAnsi31 { background-color: #0087af; }
#vt100 .bgAnsi32 { background-color: #0087d7; }
#vt100 .bgAnsi33 { background-color: #0087ff; }
#vt100 .bgAnsi34 { background-color: #00af00; }
#vt100 .bgAnsi35 { background-color: #00af5f; }
#vt100 .bgAnsi36 { background-color: #00af87; }
#vt100 .bgAnsi37 { background-color: #00afaf; }
#vt100 .bgAnsi38 { background-color: #00afd7; }
#vt100 .bgAnsi39 { background-color: #00afff; }
#vt100 .bgAnsi40 { background-color: #00d700; }
#vt100 .bgAnsi41 { background-color: #00d75f; }
#vt100 .bgAnsi42 { background-color: #00d787; }
#vt100 .bgAnsi43 { background-color: #00d7af; }
#vt100 .bgAnsi44 { background-color: #00d7d7; }
#vt100 .bgAnsi45 { background-color: #00d7ff; }
#vt100 .bgAnsi46 { background-color: #00ff00; }
#vt100 .bgAnsi47 { background-color: #00ff5f; }
#vt100 .bgAnsi48 { background-color: #00ff87; }
#vt100 .bgAnsi49 { background-color: #00ffaf; }
#vt100 .bgAnsi50 { background-color: #00ffd7; }
#vt100 .bgAnsi51 { background-color: #00ffff; }
#vt100 .bgAnsi52 { background-color: #5f0000; }
#vt100 .bgAnsi53 { background-color: #5f005f; }
#vt100 .bgAnsi54 { background-color: #5f0087; }
#vt100 .bgAnsi55 { background-color: #5f00af; }
#vt100 .bgAnsi56 { background-color: #5f00d7; }
#vt100 .bgAnsi57 { background-color: #5f00ff; }
#vt100 .bgAnsi58 { background-color: #5f5f00; }
#vt100 .bgAnsi59 { background-color: #5f5f5f; }
#vt100 .bgAnsi60 { background-color: #5f5f87; }
#vt100 .bgAnsi61 { background-color: #5f5faf; }
#vt100 .bgAnsi62 { background-color: #5f5fd7; }
#vt100 .bgAnsi63 { background-color: #5f5fff; }
#vt100 .bgAnsi64 { background-color: #5f8700; }
#vt100 .bgAnsi65 { background-color: #5f875f; }
#vt100 .bgAnsi66 { background-color: #5f8787; }
#vt100 .bgAnsi67 { background-color: #5f87af; }
#vt100 .bgAnsi68 { background-color: #5f87d7; }
#vt100 .bgAnsi69 { background-color: #5f87ff; }
#vt100 .bgAnsi70 { background-color: #5faf00; }
#vt100 .bgAnsi71 { background-color: #5faf5f; }
#vt100 .bgAnsi72 { background-color: #5faf87; }
#vt100 .bgAnsi73 { background-color: #5fafaf; }
#vt100 .bgAnsi74 { background-color: #5fafd7; }
#vt100 .bgAnsi75 { background-color: #5fafff; }
#vt100 .bgAnsi76 { background-color: #5fd700; }
#vt100 .bgAnsi77 { background-color: #5fd75f; }
#vt100 .bgAnsi78 { background-color: #5fd787; }
#vt100 .bgAnsi79 { background-color: #5fd7af; }
#vt100 .bgAnsi80 { background-color: #5fd7d7; }
#vt100 .bgAnsi81 { background-color: #5fd7ff; }
#vt100 .bgAnsi82 { background-color: #5fff00; }
#vt100 .bgAnsi83 { background-color: #5fff5f; }
#vt100 .bgAnsi84 { background-color: #5fff87; }
#vt100 .bgAnsi85 { background-color: #5fffaf; }
#vt100 .bgAnsi86 { background-color: #5fffd7; }
#vt100 .bgAnsi87 { background-color: #5fffff; }
#vt100 .bgAnsi88 { background-color: #870000; }
#vt100 .bgAnsi89 { background-color: #87005f; }
#vt100 .bgAnsi90 { background-color: #870087; }
#vt100 .bgAnsi91 { background-color: #8700af; }
#vt100 .bgAnsi92 { background-color: #8700d7; }
#vt100 .bgAnsi93 { background-color: #8700ff; }
#vt100 .bgAnsi94 { background-color: #875f00; }
#vt100 .bgAnsi95 { background-color: #875f5f; }
#vt100 .bgAnsi96 { background-color: #875f87; }
#vt100 .bgAnsi97 { background-color: #875faf; }
#vt100 .bgAnsi98 { background-color: #875fd7; }
#vt100 .bgAnsi99 { background-color: #875fff; }
#vt100 .bgAnsi100 { background-color: #878700; }
#vt100 .bgAnsi101 { background-color: #87875f; }
#vt100 .bgAnsi102 { background-color: #878787; }
#vt100 .bgAnsi103 { background-color: #8787af; }
#vt100 .bgAnsi104 { background-color: #8787d7; }
#vt100 .bgAnsi105 { background-color: #8787ff; }
#vt100 .bgAnsi106 { background-color: #87af00; }
#vt100 .bgAnsi107 { background-color: #87af5f; }
#vt100 .bgAnsi108 { background-color: #87af87; }
#vt100 .bgAnsi109 { background-color: #87afaf; }
#vt100 .bgAnsi110 { background-color: #87afd7; }
#vt100 .bgAnsi111 { background-color: #87afff; }
#vt100 .bgAnsi112 { background-color: #87d700; }
#vt100 .bgAnsi113 { background-color: #87d75f; }
#vt100 .bgAnsi114 { background-color: #87d787; }
#vt100 .bgAnsi115 { background-color: #87d7af; }
#vt100 .bgAnsi116 { background-color: #87d7d7; }
#vt100 .bgAnsi117 { background-color: #87d7ff; }
#vt100 .bgAnsi118 { background-color: #87ff00; }
#vt100 .bgAnsi119 { background-color: #87ff5f; }
#vt100 .bgAnsi120 { background-color: #87ff87; }
#vt100 .bgAnsi121 { background-color: #87ffaf; }
#vt100 .bgAnsi122 { background-color: #87ffd7; }
#vt100 .bgAnsi123 { background-color: #87ffff; }
#vt100 .bgAnsi124 { background-color: #af0000; }
#vt100 .bgAnsi125 { background-color: #af005f; }
#vt100 .bgAnsi126 { background-color: #af0087; }
#vt100 .bgAnsi127 { background-color: #af00af; }
#vt100 .bgAnsi128 { background-color: #af00d7; }
#vt100 .bgAnsi129 { background-color: #af00ff; }
#vt100 .bgAnsi130 { background-color: #af5f00; }
#vt100 .bgAnsi131 { background-color: #af5f5f; }
#vt100 .bgAnsi132 { background-color: #af5f87; }
#vt100 .bgAnsi133 { background-color: #af5faf; }
#vt100 .bgAnsi134 { background-color: #af5fd7; }
#vt100 .bgAnsi135 { background-color: #af5fff; }
#vt100 .bgAnsi136 { background-color: #af8700; }
#vt100 .bgAnsi137 { background-color: #af875f; }
#vt100 .bgAnsi138 { background-color: #af8787; }
#vt100 .bgAnsi139 { background-color: #af87af; }
#vt100 .bgAnsi140 { background-color: #af87d7; }
#vt100 .bgAnsi141 { background-color: #af87ff; }
#vt100 .bgAnsi142 { background-color: #afaf00; }
#vt100 .bgAnsi143 { background-color: #afaf5f; }
#vt100 .bgAnsi144 { background-color: #afaf87; }
#vt100 .bgAnsi145 { background-color: #afafaf; }
#vt100 .bgAnsi146 { background-color: #afafd7; }
#vt100 .bgAnsi147 { background-color: #afafff; }
#vt100 .bgAnsi148 { background-color: #afd700; }
#vt100 .bgAnsi149 { background-color: #afd75f; }
#vt100 .bgAnsi150 { background-color: #afd787; }
#vt100 .bgAnsi151 { background-color: #afd7af; }
#vt100 .bgAnsi152 { background-color: #afd7d7; }
#vt100 .bgAnsi153 { background-color: #afd7ff; }
#vt100 .bgAnsi154 { background-color: #afff00; }
#vt100 .bgAnsi155 { background-color: #afff5f; }
#vt100 .bgAnsi156 { background-color: #afff87; }
#vt100 .bgAnsi157 { background-color: #afffaf; }
#vt100 .bgAnsi158 { background-color: #afffd7; }
#vt100 .bgAnsi159 { background-color: #afffff; }
#vt100 .bgAnsi160 { background-color: #d70000; }
#vt100 .bgAnsi161 { background-color: #d7005f; }
#vt100 .bgAnsi162 { background-color: #d70087; }
#vt100 .bgAnsi163 { background-color: #d700af; }
#vt100 .bgAnsi164 { background-color: #d700d7; }
#vt100 .bgAnsi165 { background-color: #d700ff; }
#vt100 .bgAnsi166 { background-color: #d75f00; }
#vt100 .bgAnsi167 { background-color: #d75f5f; }
#vt100 .bgAnsi168 { background-color: #d75f87; }
#vt100 .bgAnsi169 { background-color: #d75faf; }
#vt100 .bgAnsi170 { background-color: #d75fd7; }
#vt100 .bgAnsi171 { background-color: #d75fff; }
#vt100 .bgAnsi172 { background-color: #d78700; }
#vt100 .bgAnsi173 { background-color: #d7875f; }
#vt100 .bgAnsi174 { background-color: #d78787; }
#vt100 .bgAnsi175 { background-color: #d787af; }
#vt100 .bgAnsi176 { background-color: #d787d7; }
#vt100 .bgAnsi177 { background-color: #d787ff; }
#vt100 .bgAnsi178 { background-color: #d7af00; }
#vt100 .bgAnsi179 { background-color: #d7af5f; }
#vt100 .bgAnsi180 { background-color: #d7af87; }
#vt100 .bgAnsi181 { background-color: #d7afaf; }
#vt100 .bgAnsi182 { background-color: #d7afd7; }
#vt100 .bgAnsi183 { background-color: #d7afff; }
#vt100 .bgAnsi184 { background-color: #d7d700; }
#vt100 .bgAnsi185 { background-color: #d7d75f; }
#vt100 .bgAnsi186 { background-color: #d7d787; }
#vt100 .bgAnsi187 { background-color: #d7d7af; }
#vt100 .bgAnsi188 { background-color: #d7d7d7; }
#vt100 .bgAnsi189 { background-color: #d7d7ff; }
#vt100 .bgAnsi190 { background-color: #d7ff00; }
#vt100 .bgAnsi191 { background-color: #d7ff5f; }
#vt100 .bgAnsi192 { background-color: #d7ff87; }
#vt100 .bgAnsi193 { background-color: #d7ffaf; }
#vt100 .bgAnsi194 { background-color: #d7ffd7; }
#vt100 .bgAnsi195 { background-color: #d7ffff; }
#vt100 .bgAnsi196 { background-color: #ff0000; }
#vt100 .bgAnsi197 { background-color: #ff005f; }
#vt100 .bgAnsi198 { background-color: #ff0087; }
#vt100 .bgAnsi199 { background-color: #ff00af; }
#vt100 .bgAnsi200 { background-color: #ff00d7; }
#vt100 .bgAnsi201 { background-color: #ff00ff; }
#vt100 .bgAnsi202 { background-color: #ff5f00; }
#vt100 .bgAnsi203 { background-color: #ff5f5f; }
#vt100 .bgAnsi204 { background-color: #ff5f87; }
#vt100 .bgAnsi205 { background-color: #ff5faf; }
#vt100 .bgAnsi206 { background-color: #ff5fd7; }
#vt100 .bgAnsi207 { background-color: #ff5fff; }
#vt100 .bgAnsi208 { background-color: #ff8700; }
#vt100 .bgAnsi209 { background-color: #ff875f; }
#vt100 .bgAnsi210 { background-color: #ff8787; }
#vt100 .bgAnsi211 { background-color: #ff87af; }
#vt100 .bgAnsi212 { background-color: #ff87d7; }
#vt100 .bgAnsi213 { background-color: #ff87ff; }
#vt100 .bgAnsi214 { background-color: #ffaf00; }
#vt100 .bgAnsi215 { background-color: #ffaf5f; }
#vt100 .bgAnsi216 { background-color: #ffaf87; }
#vt100 .bgAnsi217 { background-color: #ffafaf; }
#vt100 .bgAnsi218 { background-color: #ffafd7; }
#vt100 .bgAnsi219 { background-color: #ffafff; }
#vt100 .bgAnsi220 { background-color: #ffd700; }
#vt100 .bgAnsi221 { background-color: #ffd75f; }
#vt100 .bgAnsi222 { background-color: #ffd787; }
#vt100 .bgAnsi223 { background-color: #ffd7af; }
#vt100 .bgAnsi224 { background-color: #ffd7d7; }
#vt100 .bgAnsi225 { background-color: #ffd7ff; }
#vt100 .bgAnsi226 { background-color: #ffff00; }
#vt100 .bgAnsi227 { background-color: #ffff5f; }
#vt100 .bgAnsi228 { background-color: #ffff87; }
#vt100 .bgAnsi229 { background-color: #ffffaf; }
#vt100 .bgAnsi230 { background-color: #ffffd7; }
#vt100 .bgAnsi231 { background-color: #ffffff; }
#vt100 .bgAnsi232 { background-color: #080808; }
#vt100 .bgAnsi233 { background-color: #121212; }
#vt100 .bgAnsi234 { background-color: #1c1c1c; }
#vt100 .bgAnsi235 { background-color: #262626; }
#vt100 .bgAnsi236 { background-color: #303030; }
#vt100 .bgAnsi237 { background-color: #3a3a3a; }
#vt100 .bgAnsi238 { background-color: #444444; }
#vt100 .bgAnsi239 { background-color: #4e4e4e; }
#vt100 .bgAnsi240 { background-color: #585858; }
#vt100 .bgAnsi241 { background-color: #626262; }
#vt100 .bgAnsi242 { background-color: #6c6c6c; }
#vt100 .bgAnsi243 { background-color: #767676; }
#vt100 .bgAnsi244 { background-color: #808080; }
#vt100 .bgAnsi245 { background-color: #8a8a8a; }
#vt100 .bgAnsi246 { background-color: #949494; }
#vt100 .bgAnsi247 { background-color: #9e9e9e; }
#vt100 .bgAnsi248 { background-color: #a8a8a8; }
#vt100 .bgAnsi249 { background-color: #b2b2b2; }
#vt100 .bgAnsi250 { background-color: #bcbcbc; }
#vt100 .bgAnsi251 { background-color: #c6c6c6; }
#vt100 .bgAnsi252 { background-color: #d0d0d0; }
#vt100 .bgAnsi253 { background-color: #dadada; }
#vt100 .bgAnsi254 { background-color: #e4e4e4; }
#vt100 .bgAnsi255 { background-color: #eeeeee; }

0
shellinabox/enabled.gif Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 847 B

After

Width:  |  Height:  |  Size: 847 B

0
shellinabox/externalfile.c Normal file → Executable file
View file

0
shellinabox/externalfile.h Normal file → Executable file
View file

0
shellinabox/favicon.ico Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

1
shellinabox/keyboard-layout.html Normal file → Executable file
View file

@ -2,6 +2,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xml:lang="en" lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head> </head>
<body><pre class="box"><div <body><pre class="box"><div
><i id="27">Esc</i><i id="112">F1</i><i id="113">F2</i><i id="114">F3</i ><i id="27">Esc</i><i id="112">F1</i><i id="113">F2</i><i id="114">F3</i

Some files were not shown because too many files have changed in this diff Show more