From 537d83a5b1b8d9517893e01c2983029206da986a Mon Sep 17 00:00:00 2001 From: zodiac Date: Mon, 12 Jan 2009 18:59:06 +0000 Subject: [PATCH] - 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 --- ChangeLog | 11 +++++++++++ Makefile.am | 10 +++++----- Makefile.in | 20 ++++++++++---------- configure | 20 ++++++++++---------- configure.ac | 2 +- debian/changelog | 6 ++++++ shellinabox/externalfile.c | 2 ++ shellinabox/launcher.c | 22 +++++++++++++++++++++- shellinabox/shellinaboxd.c | 2 +- 9 files changed, 67 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47462db..188b9ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-08-01 Markus Gutschke + + * 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 * Added CGI mode for demand-loading the shellinaboxd daemon diff --git a/Makefile.am b/Makefile.am index 149003c..0079d94 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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'` \ diff --git a/Makefile.in b/Makefile.in index 00d9db4..90ee59b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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; \ diff --git a/configure b/configure index 02acdac..0ff48a1 100755 --- a/configure +++ b/configure @@ -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 . # @@ -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 ." _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'`\\" diff --git a/configure.ac b/configure.ac index ee8747a..9f25f99 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/debian/changelog b/debian/changelog index eeb94a3..3f88646 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +shellinabox (2.1-1) unstable; urgency=low + + * New upstream release, version 2.1. + + -- Markus Gutschke Thu, 8 Jan 2009 18:47:08 -0800 + shellinabox (2.0-1) unstable; urgency=low * Initial release. diff --git a/shellinabox/externalfile.c b/shellinabox/externalfile.c index e79a3a3..a7dbb0c 100644 --- a/shellinabox/externalfile.c +++ b/shellinabox/externalfile.c @@ -46,6 +46,8 @@ #define _GNU_SOURCE #include +#include +#include #include #include #include diff --git a/shellinabox/launcher.c b/shellinabox/launcher.c index d354578..340db01 100644 --- a/shellinabox/launcher.c +++ b/shellinabox/launcher.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -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 diff --git a/shellinabox/shellinaboxd.c b/shellinabox/shellinaboxd.c index 0474f43..3459061 100644 --- a/shellinabox/shellinaboxd.c +++ b/shellinabox/shellinaboxd.c @@ -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) {