- Released version 2.1

- Fixed a few more build issues.


git-svn-id: https://shellinabox.googlecode.com/svn/trunk@36 0da03de8-d603-11dd-86c2-0f8696b7b6f9
This commit is contained in:
zodiac 2009-01-12 18:59:06 +00:00
parent 2212ea7606
commit 537d83a5b1
9 changed files with 67 additions and 28 deletions

View file

@ -1,3 +1,14 @@
2009-08-01 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

View file

@ -98,7 +98,7 @@ clean-local:
.css.o:
@$(ECHO) objcopy "$<" "$@"
@objcopy \
-I binary `echo "$(build_cpu)" | \
-I binary `echo "$(host_cpu)" | \
grep -q '^i[0-9]86$$' && \
echo ' -O elf32-i386 -B i386' || \
echo ' -O elf64-x86-64 -B i386:x86-64'` \
@ -120,7 +120,7 @@ clean-local:
.html.o:
@$(ECHO) objcopy "$<" "$@"
@objcopy \
-I binary `echo "$(build_cpu)" | \
-I binary `echo "$(host_cpu)" | \
grep -q '^i[0-9]86$$' && \
echo ' -O elf32-i386 -B i386' || \
echo ' -O elf64-x86-64 -B i386:x86-64'` \
@ -142,7 +142,7 @@ clean-local:
.ico.o:
@$(ECHO) objcopy "$<" "$@"
@objcopy \
-I binary `echo "$(build_cpu)" | \
-I binary `echo "$(host_cpu)" | \
grep -q '^i[0-9]86$$' && \
echo ' -O elf32-i386 -B i386' || \
echo ' -O elf64-x86-64 -B i386:x86-64'` \
@ -169,7 +169,7 @@ clean-local:
;s/^#/\/\/ #/ \
;s/VERSION/\"@VERSION@\"/g" "$<" >"$@.pre" && \
objcopy \
-I binary `echo $(build_cpu) | \
-I binary `echo $(host_cpu) | \
grep -q '^i[0-9]86$$' && \
echo ' -O elf32-i386 -B i386' || \
echo ' -O elf64-x86-64 -B i386:x86-64'` \
@ -191,7 +191,7 @@ objcopy \
.wav.o:
@$(ECHO) objcopy "$<" "$@"
@objcopy \
-I binary `echo "$(build_cpu)" | \
-I binary `echo "$(host_cpu)" | \
grep -q '^i[0-9]86$$' && \
echo ' -O elf32-i386 -B i386' || \
echo ' -O elf64-x86-64 -B i386:x86-64'` \

View file

@ -989,10 +989,10 @@ clean-local:
.css.o:
@$(ECHO) objcopy "$<" "$@"
@objcopy \
-I binary `echo "$(build_cpu)" | \
-I binary `echo "$(host_cpu)" | \
grep -q '^i[0-9]86$$' && \
echo ' -O elf32-i386 -B i386' || \
echo ' -O elf64-x86-64 -B x86-64'` \
echo ' -O elf64-x86-64 -B i386:x86-64'` \
`echo "$<" | sed -e ' \
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
@ -1011,10 +1011,10 @@ clean-local:
.html.o:
@$(ECHO) objcopy "$<" "$@"
@objcopy \
-I binary `echo "$(build_cpu)" | \
-I binary `echo "$(host_cpu)" | \
grep -q '^i[0-9]86$$' && \
echo ' -O elf32-i386 -B i386' || \
echo ' -O elf64-x86-64 -B x86-64'` \
echo ' -O elf64-x86-64 -B i386:x86-64'` \
`echo "$<" | sed -e ' \
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
@ -1033,10 +1033,10 @@ clean-local:
.ico.o:
@$(ECHO) objcopy "$<" "$@"
@objcopy \
-I binary `echo "$(build_cpu)" | \
-I binary `echo "$(host_cpu)" | \
grep -q '^i[0-9]86$$' && \
echo ' -O elf32-i386 -B i386' || \
echo ' -O elf64-x86-64 -B x86-64'` \
echo ' -O elf64-x86-64 -B i386:x86-64'` \
`echo "$<" | sed -e ' \
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
@ -1060,10 +1060,10 @@ clean-local:
;s/^#/\/\/ #/ \
;s/VERSION/\"@VERSION@\"/g" "$<" >"$@.pre" && \
objcopy \
-I binary `echo $(build_cpu) | \
-I binary `echo $(host_cpu) | \
grep -q '^i[0-9]86$$' && \
echo ' -O elf32-i386 -B i386' || \
echo ' -O elf64-x86-64 -B x86-64'` \
echo ' -O elf64-x86-64 -B i386:x86-64'` \
`echo "$@" | sed -e ' \
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
@ -1082,10 +1082,10 @@ objcopy \
.wav.o:
@$(ECHO) objcopy "$<" "$@"
@objcopy \
-I binary `echo "$(build_cpu)" | \
-I binary `echo "$(host_cpu)" | \
grep -q '^i[0-9]86$$' && \
echo ' -O elf32-i386 -B i386' || \
echo ' -O elf64-x86-64 -B x86-64'` \
echo ' -O elf64-x86-64 -B i386:x86-64'` \
`echo "$<" | sed -e ' \
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \

20
configure vendored
View file

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for shellinabox 2.0.
# Generated by GNU Autoconf 2.61 for shellinabox 2.1.
#
# Report bugs to <markus@shellinabox.com>.
#
@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='shellinabox'
PACKAGE_TARNAME='shellinabox'
PACKAGE_VERSION='2.0'
PACKAGE_STRING='shellinabox 2.0'
PACKAGE_VERSION='2.1'
PACKAGE_STRING='shellinabox 2.1'
PACKAGE_BUGREPORT='markus@shellinabox.com'
# Factoring default headers for most tests.
@ -1393,7 +1393,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures shellinabox 2.0 to adapt to many kinds of systems.
\`configure' configures shellinabox 2.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1463,7 +1463,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of shellinabox 2.0:";;
short | recursive ) echo "Configuration of shellinabox 2.1:";;
esac
cat <<\_ACEOF
@ -1565,7 +1565,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
shellinabox configure 2.0
shellinabox configure 2.1
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@ -1579,7 +1579,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by shellinabox $as_me 2.0, which was
It was created by shellinabox $as_me 2.1, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@ -2269,7 +2269,7 @@ fi
# Define the identity of the package.
PACKAGE='shellinabox'
VERSION='2.0'
VERSION='2.1'
cat >>confdefs.h <<_ACEOF
@ -20588,7 +20588,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by shellinabox $as_me 2.0, which was
This file was extended by shellinabox $as_me 2.1, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -20635,7 +20635,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
shellinabox config.status 2.0
shellinabox config.status 2.1
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"

View file

@ -1,5 +1,5 @@
AC_PREREQ(2.57)
AC_INIT(shellinabox, 2.0, markus@shellinabox.com)
AC_INIT(shellinabox, 2.1, markus@shellinabox.com)
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_PROG_INSTALL

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
shellinabox (2.1-1) unstable; urgency=low
* New upstream release, version 2.1.
-- Markus Gutschke <markus@shellinabox.com> Thu, 8 Jan 2009 18:47:08 -0800
shellinabox (2.0-1) unstable; urgency=low
* Initial release.

View file

@ -46,6 +46,8 @@
#define _GNU_SOURCE
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

View file

@ -50,6 +50,7 @@
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
@ -86,6 +87,7 @@ extern int pthread_once(pthread_once_t *, void (*)(void))__attribute__((weak));
// If PAM support is available, take advantage of it. Otherwise, silently fall
// back on legacy operations for session management.
#if defined(HAVE_SECURITY_PAM_APPL_H) && defined(HAVE_SECURITY_PAM_MISC_H)
static int (*x_pam_acct_mgmt)(pam_handle_t *, int);
static int (*x_pam_authenticate)(pam_handle_t *, int);
static int (*x_pam_close_session)(pam_handle_t *, int);
@ -97,6 +99,7 @@ static int (*x_pam_start)(const char *, const char *, const struct pam_conv *,
pam_handle_t **);
static int (*x_misc_conv)(int, const struct pam_message **,
struct pam_response **, void *);
#endif
// Older versions of glibc might not support fdopendir(). That's OK, we can
// work around the lack of it, at a small performance loss.
@ -106,6 +109,7 @@ static int launcher = -1;
static uid_t restricted;
#if defined(HAVE_SECURITY_PAM_APPL_H) && defined(HAVE_SECURITY_PAM_MISC_H)
static void *loadSymbol(const char *lib, const char *fn) {
void *dl = RTLD_DEFAULT;
void *rc = dlsym(dl, fn);
@ -154,6 +158,7 @@ static void loadPAM(void) {
}
debug("Loaded PAM suppport");
}
#endif
int supportsPAM(void) {
#if defined(HAVE_SECURITY_PAM_APPL_H) && defined(HAVE_SECURITY_PAM_MISC_H)
@ -463,6 +468,7 @@ static pam_handle_t *internalLogin(struct Service *service, struct Utmp *utmp,
// Use PAM to negotiate user authentication and authorization
const struct passwd *pw;
pam_handle_t *pam = NULL;
#if defined(HAVE_SECURITY_PAM_APPL_H) && defined(HAVE_SECURITY_PAM_MISC_H)
struct pam_conv conv = { .conv = x_misc_conv };
if (service->authUser) {
check(supportsPAM());
@ -535,18 +541,28 @@ static pam_handle_t *internalLogin(struct Service *service, struct Utmp *utmp,
}
pw = getPWEnt(service->uid);
}
#else
check(!supportsPAM());
pw = getPWEnt(service->uid);
#endif
if (restricted &&
(service->uid != restricted || service->gid != pw->pw_gid)) {
puts("\nAccess denied!");
#if defined(HAVE_SECURITY_PAM_APPL_H) && defined(HAVE_SECURITY_PAM_MISC_H)
x_pam_end(pam, PAM_SUCCESS);
#endif
_exit(1);
}
#if defined(HAVE_SECURITY_PAM_APPL_H) && defined(HAVE_SECURITY_PAM_MISC_H)
if (pam) {
check(x_pam_set_item(pam, PAM_TTY, (const void **)utmp->utmpx.ut_line) ==
PAM_SUCCESS);
}
#else
check(!pam);
#endif
// Retrieve supplementary group ids.
int ngroups = 0;
@ -798,7 +814,7 @@ static void childProcess(struct Service *service, int width, int height,
char **environment;
check(environment = malloc(2*sizeof(char *)));
int numEnvVars = 1;
environment[0] = "TERM=xterm";
check(environment[0] = strdup("TERM=xterm"));
if (width > 0 && height > 0) {
numEnvVars += 2;
check(environment = realloc(environment,
@ -854,6 +870,7 @@ static void childProcess(struct Service *service, int width, int height,
// In that case, we do not bother about session management.
if (!service->useLogin) {
pam_handle_t *pam = internalLogin(service, utmp, &environment);
#if defined(HAVE_SECURITY_PAM_APPL_H) && defined(HAVE_SECURITY_PAM_MISC_H)
if (pam && !geteuid()) {
check(x_pam_open_session(pam, PAM_SILENT) == PAM_SUCCESS);
pid_t pid = fork();
@ -872,6 +889,9 @@ static void childProcess(struct Service *service, int width, int height,
_exit(WIFEXITED(status) ? WEXITSTATUS(status) : -WTERMSIG(status));
}
}
#else
check(!pam);
#endif
}
// Change user and group ids

View file

@ -148,7 +148,7 @@ static char *jsonEscape(const char *buf, int len) {
}
static int completePendingRequest(struct Session *session,
char *buf, int len, int maxLength) {
const char *buf, int len, int maxLength) {
// If there is no pending HTTP request, save the data and return
// immediately.
if (!session->http) {