- 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:
parent
2212ea7606
commit
537d83a5b1
9 changed files with 67 additions and 28 deletions
11
ChangeLog
11
ChangeLog
|
@ -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>
|
2009-01-01 Markus Gutschke <markus@shellinabox.com>
|
||||||
|
|
||||||
* Added CGI mode for demand-loading the shellinaboxd daemon
|
* Added CGI mode for demand-loading the shellinaboxd daemon
|
||||||
|
|
10
Makefile.am
10
Makefile.am
|
@ -98,7 +98,7 @@ clean-local:
|
||||||
.css.o:
|
.css.o:
|
||||||
@$(ECHO) objcopy "$<" "$@"
|
@$(ECHO) objcopy "$<" "$@"
|
||||||
@objcopy \
|
@objcopy \
|
||||||
-I binary `echo "$(build_cpu)" | \
|
-I binary `echo "$(host_cpu)" | \
|
||||||
grep -q '^i[0-9]86$$' && \
|
grep -q '^i[0-9]86$$' && \
|
||||||
echo ' -O elf32-i386 -B i386' || \
|
echo ' -O elf32-i386 -B i386' || \
|
||||||
echo ' -O elf64-x86-64 -B i386:x86-64'` \
|
echo ' -O elf64-x86-64 -B i386:x86-64'` \
|
||||||
|
@ -120,7 +120,7 @@ clean-local:
|
||||||
.html.o:
|
.html.o:
|
||||||
@$(ECHO) objcopy "$<" "$@"
|
@$(ECHO) objcopy "$<" "$@"
|
||||||
@objcopy \
|
@objcopy \
|
||||||
-I binary `echo "$(build_cpu)" | \
|
-I binary `echo "$(host_cpu)" | \
|
||||||
grep -q '^i[0-9]86$$' && \
|
grep -q '^i[0-9]86$$' && \
|
||||||
echo ' -O elf32-i386 -B i386' || \
|
echo ' -O elf32-i386 -B i386' || \
|
||||||
echo ' -O elf64-x86-64 -B i386:x86-64'` \
|
echo ' -O elf64-x86-64 -B i386:x86-64'` \
|
||||||
|
@ -142,7 +142,7 @@ clean-local:
|
||||||
.ico.o:
|
.ico.o:
|
||||||
@$(ECHO) objcopy "$<" "$@"
|
@$(ECHO) objcopy "$<" "$@"
|
||||||
@objcopy \
|
@objcopy \
|
||||||
-I binary `echo "$(build_cpu)" | \
|
-I binary `echo "$(host_cpu)" | \
|
||||||
grep -q '^i[0-9]86$$' && \
|
grep -q '^i[0-9]86$$' && \
|
||||||
echo ' -O elf32-i386 -B i386' || \
|
echo ' -O elf32-i386 -B i386' || \
|
||||||
echo ' -O elf64-x86-64 -B i386:x86-64'` \
|
echo ' -O elf64-x86-64 -B i386:x86-64'` \
|
||||||
|
@ -169,7 +169,7 @@ clean-local:
|
||||||
;s/^#/\/\/ #/ \
|
;s/^#/\/\/ #/ \
|
||||||
;s/VERSION/\"@VERSION@\"/g" "$<" >"$@.pre" && \
|
;s/VERSION/\"@VERSION@\"/g" "$<" >"$@.pre" && \
|
||||||
objcopy \
|
objcopy \
|
||||||
-I binary `echo $(build_cpu) | \
|
-I binary `echo $(host_cpu) | \
|
||||||
grep -q '^i[0-9]86$$' && \
|
grep -q '^i[0-9]86$$' && \
|
||||||
echo ' -O elf32-i386 -B i386' || \
|
echo ' -O elf32-i386 -B i386' || \
|
||||||
echo ' -O elf64-x86-64 -B i386:x86-64'` \
|
echo ' -O elf64-x86-64 -B i386:x86-64'` \
|
||||||
|
@ -191,7 +191,7 @@ objcopy \
|
||||||
.wav.o:
|
.wav.o:
|
||||||
@$(ECHO) objcopy "$<" "$@"
|
@$(ECHO) objcopy "$<" "$@"
|
||||||
@objcopy \
|
@objcopy \
|
||||||
-I binary `echo "$(build_cpu)" | \
|
-I binary `echo "$(host_cpu)" | \
|
||||||
grep -q '^i[0-9]86$$' && \
|
grep -q '^i[0-9]86$$' && \
|
||||||
echo ' -O elf32-i386 -B i386' || \
|
echo ' -O elf32-i386 -B i386' || \
|
||||||
echo ' -O elf64-x86-64 -B i386:x86-64'` \
|
echo ' -O elf64-x86-64 -B i386:x86-64'` \
|
||||||
|
|
20
Makefile.in
20
Makefile.in
|
@ -989,10 +989,10 @@ clean-local:
|
||||||
.css.o:
|
.css.o:
|
||||||
@$(ECHO) objcopy "$<" "$@"
|
@$(ECHO) objcopy "$<" "$@"
|
||||||
@objcopy \
|
@objcopy \
|
||||||
-I binary `echo "$(build_cpu)" | \
|
-I binary `echo "$(host_cpu)" | \
|
||||||
grep -q '^i[0-9]86$$' && \
|
grep -q '^i[0-9]86$$' && \
|
||||||
echo ' -O elf32-i386 -B i386' || \
|
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 ' \
|
`echo "$<" | sed -e ' \
|
||||||
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
|
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
|
||||||
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
|
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
|
||||||
|
@ -1011,10 +1011,10 @@ clean-local:
|
||||||
.html.o:
|
.html.o:
|
||||||
@$(ECHO) objcopy "$<" "$@"
|
@$(ECHO) objcopy "$<" "$@"
|
||||||
@objcopy \
|
@objcopy \
|
||||||
-I binary `echo "$(build_cpu)" | \
|
-I binary `echo "$(host_cpu)" | \
|
||||||
grep -q '^i[0-9]86$$' && \
|
grep -q '^i[0-9]86$$' && \
|
||||||
echo ' -O elf32-i386 -B i386' || \
|
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 ' \
|
`echo "$<" | sed -e ' \
|
||||||
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
|
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
|
||||||
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
|
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
|
||||||
|
@ -1033,10 +1033,10 @@ clean-local:
|
||||||
.ico.o:
|
.ico.o:
|
||||||
@$(ECHO) objcopy "$<" "$@"
|
@$(ECHO) objcopy "$<" "$@"
|
||||||
@objcopy \
|
@objcopy \
|
||||||
-I binary `echo "$(build_cpu)" | \
|
-I binary `echo "$(host_cpu)" | \
|
||||||
grep -q '^i[0-9]86$$' && \
|
grep -q '^i[0-9]86$$' && \
|
||||||
echo ' -O elf32-i386 -B i386' || \
|
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 ' \
|
`echo "$<" | sed -e ' \
|
||||||
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
|
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
|
||||||
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
|
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
|
||||||
|
@ -1060,10 +1060,10 @@ clean-local:
|
||||||
;s/^#/\/\/ #/ \
|
;s/^#/\/\/ #/ \
|
||||||
;s/VERSION/\"@VERSION@\"/g" "$<" >"$@.pre" && \
|
;s/VERSION/\"@VERSION@\"/g" "$<" >"$@.pre" && \
|
||||||
objcopy \
|
objcopy \
|
||||||
-I binary `echo $(build_cpu) | \
|
-I binary `echo $(host_cpu) | \
|
||||||
grep -q '^i[0-9]86$$' && \
|
grep -q '^i[0-9]86$$' && \
|
||||||
echo ' -O elf32-i386 -B i386' || \
|
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 ' \
|
`echo "$@" | sed -e ' \
|
||||||
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
|
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
|
||||||
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
|
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
|
||||||
|
@ -1082,10 +1082,10 @@ objcopy \
|
||||||
.wav.o:
|
.wav.o:
|
||||||
@$(ECHO) objcopy "$<" "$@"
|
@$(ECHO) objcopy "$<" "$@"
|
||||||
@objcopy \
|
@objcopy \
|
||||||
-I binary `echo "$(build_cpu)" | \
|
-I binary `echo "$(host_cpu)" | \
|
||||||
grep -q '^i[0-9]86$$' && \
|
grep -q '^i[0-9]86$$' && \
|
||||||
echo ' -O elf32-i386 -B i386' || \
|
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 ' \
|
`echo "$<" | sed -e ' \
|
||||||
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
|
s/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /; \
|
||||||
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
|
t0; s/\([^.]*\)\([.].*\)/\1\2=\1 /; t0; s/.*/&=& /;:0; \
|
||||||
|
|
20
configure
vendored
20
configure
vendored
|
@ -1,6 +1,6 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.61 for shellinabox 2.0.
|
# Generated by GNU Autoconf 2.61 for shellinabox 2.1.
|
||||||
#
|
#
|
||||||
# Report bugs to <markus@shellinabox.com>.
|
# Report bugs to <markus@shellinabox.com>.
|
||||||
#
|
#
|
||||||
|
@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='shellinabox'
|
PACKAGE_NAME='shellinabox'
|
||||||
PACKAGE_TARNAME='shellinabox'
|
PACKAGE_TARNAME='shellinabox'
|
||||||
PACKAGE_VERSION='2.0'
|
PACKAGE_VERSION='2.1'
|
||||||
PACKAGE_STRING='shellinabox 2.0'
|
PACKAGE_STRING='shellinabox 2.1'
|
||||||
PACKAGE_BUGREPORT='markus@shellinabox.com'
|
PACKAGE_BUGREPORT='markus@shellinabox.com'
|
||||||
|
|
||||||
# Factoring default headers for most tests.
|
# 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.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures shellinabox 2.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]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
|
@ -1463,7 +1463,7 @@ fi
|
||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of shellinabox 2.0:";;
|
short | recursive ) echo "Configuration of shellinabox 2.1:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
|
@ -1565,7 +1565,7 @@ fi
|
||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
shellinabox configure 2.0
|
shellinabox configure 2.1
|
||||||
generated by GNU Autoconf 2.61
|
generated by GNU Autoconf 2.61
|
||||||
|
|
||||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
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
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by shellinabox $as_me 2.0, which was
|
It was created by shellinabox $as_me 2.1, which was
|
||||||
generated by GNU Autoconf 2.61. Invocation command line was
|
generated by GNU Autoconf 2.61. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
|
@ -2269,7 +2269,7 @@ fi
|
||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='shellinabox'
|
PACKAGE='shellinabox'
|
||||||
VERSION='2.0'
|
VERSION='2.1'
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
@ -20588,7 +20588,7 @@ exec 6>&1
|
||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by shellinabox $as_me 2.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
|
generated by GNU Autoconf 2.61. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
|
@ -20635,7 +20635,7 @@ Report bugs to <bug-autoconf@gnu.org>."
|
||||||
_ACEOF
|
_ACEOF
|
||||||
cat >>$CONFIG_STATUS <<_ACEOF
|
cat >>$CONFIG_STATUS <<_ACEOF
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
shellinabox config.status 2.0
|
shellinabox config.status 2.1
|
||||||
configured by $0, generated by GNU Autoconf 2.61,
|
configured by $0, generated by GNU Autoconf 2.61,
|
||||||
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
AC_PREREQ(2.57)
|
AC_PREREQ(2.57)
|
||||||
AC_INIT(shellinabox, 2.0, markus@shellinabox.com)
|
AC_INIT(shellinabox, 2.1, markus@shellinabox.com)
|
||||||
AM_INIT_AUTOMAKE
|
AM_INIT_AUTOMAKE
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
|
|
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -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
|
shellinabox (2.0-1) unstable; urgency=low
|
||||||
|
|
||||||
* Initial release.
|
* Initial release.
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/ioctl.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
|
// If PAM support is available, take advantage of it. Otherwise, silently fall
|
||||||
// back on legacy operations for session management.
|
// 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_acct_mgmt)(pam_handle_t *, int);
|
||||||
static int (*x_pam_authenticate)(pam_handle_t *, int);
|
static int (*x_pam_authenticate)(pam_handle_t *, int);
|
||||||
static int (*x_pam_close_session)(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 **);
|
pam_handle_t **);
|
||||||
static int (*x_misc_conv)(int, const struct pam_message **,
|
static int (*x_misc_conv)(int, const struct pam_message **,
|
||||||
struct pam_response **, void *);
|
struct pam_response **, void *);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Older versions of glibc might not support fdopendir(). That's OK, we can
|
// Older versions of glibc might not support fdopendir(). That's OK, we can
|
||||||
// work around the lack of it, at a small performance loss.
|
// work around the lack of it, at a small performance loss.
|
||||||
|
@ -106,6 +109,7 @@ static int launcher = -1;
|
||||||
static uid_t restricted;
|
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) {
|
static void *loadSymbol(const char *lib, const char *fn) {
|
||||||
void *dl = RTLD_DEFAULT;
|
void *dl = RTLD_DEFAULT;
|
||||||
void *rc = dlsym(dl, fn);
|
void *rc = dlsym(dl, fn);
|
||||||
|
@ -154,6 +158,7 @@ static void loadPAM(void) {
|
||||||
}
|
}
|
||||||
debug("Loaded PAM suppport");
|
debug("Loaded PAM suppport");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int supportsPAM(void) {
|
int supportsPAM(void) {
|
||||||
#if defined(HAVE_SECURITY_PAM_APPL_H) && defined(HAVE_SECURITY_PAM_MISC_H)
|
#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
|
// Use PAM to negotiate user authentication and authorization
|
||||||
const struct passwd *pw;
|
const struct passwd *pw;
|
||||||
pam_handle_t *pam = NULL;
|
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 };
|
struct pam_conv conv = { .conv = x_misc_conv };
|
||||||
if (service->authUser) {
|
if (service->authUser) {
|
||||||
check(supportsPAM());
|
check(supportsPAM());
|
||||||
|
@ -535,18 +541,28 @@ static pam_handle_t *internalLogin(struct Service *service, struct Utmp *utmp,
|
||||||
}
|
}
|
||||||
pw = getPWEnt(service->uid);
|
pw = getPWEnt(service->uid);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
check(!supportsPAM());
|
||||||
|
pw = getPWEnt(service->uid);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (restricted &&
|
if (restricted &&
|
||||||
(service->uid != restricted || service->gid != pw->pw_gid)) {
|
(service->uid != restricted || service->gid != pw->pw_gid)) {
|
||||||
puts("\nAccess denied!");
|
puts("\nAccess denied!");
|
||||||
|
#if defined(HAVE_SECURITY_PAM_APPL_H) && defined(HAVE_SECURITY_PAM_MISC_H)
|
||||||
x_pam_end(pam, PAM_SUCCESS);
|
x_pam_end(pam, PAM_SUCCESS);
|
||||||
|
#endif
|
||||||
_exit(1);
|
_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_SECURITY_PAM_APPL_H) && defined(HAVE_SECURITY_PAM_MISC_H)
|
||||||
if (pam) {
|
if (pam) {
|
||||||
check(x_pam_set_item(pam, PAM_TTY, (const void **)utmp->utmpx.ut_line) ==
|
check(x_pam_set_item(pam, PAM_TTY, (const void **)utmp->utmpx.ut_line) ==
|
||||||
PAM_SUCCESS);
|
PAM_SUCCESS);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
check(!pam);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Retrieve supplementary group ids.
|
// Retrieve supplementary group ids.
|
||||||
int ngroups = 0;
|
int ngroups = 0;
|
||||||
|
@ -798,7 +814,7 @@ static void childProcess(struct Service *service, int width, int height,
|
||||||
char **environment;
|
char **environment;
|
||||||
check(environment = malloc(2*sizeof(char *)));
|
check(environment = malloc(2*sizeof(char *)));
|
||||||
int numEnvVars = 1;
|
int numEnvVars = 1;
|
||||||
environment[0] = "TERM=xterm";
|
check(environment[0] = strdup("TERM=xterm"));
|
||||||
if (width > 0 && height > 0) {
|
if (width > 0 && height > 0) {
|
||||||
numEnvVars += 2;
|
numEnvVars += 2;
|
||||||
check(environment = realloc(environment,
|
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.
|
// In that case, we do not bother about session management.
|
||||||
if (!service->useLogin) {
|
if (!service->useLogin) {
|
||||||
pam_handle_t *pam = internalLogin(service, utmp, &environment);
|
pam_handle_t *pam = internalLogin(service, utmp, &environment);
|
||||||
|
#if defined(HAVE_SECURITY_PAM_APPL_H) && defined(HAVE_SECURITY_PAM_MISC_H)
|
||||||
if (pam && !geteuid()) {
|
if (pam && !geteuid()) {
|
||||||
check(x_pam_open_session(pam, PAM_SILENT) == PAM_SUCCESS);
|
check(x_pam_open_session(pam, PAM_SILENT) == PAM_SUCCESS);
|
||||||
pid_t pid = fork();
|
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));
|
_exit(WIFEXITED(status) ? WEXITSTATUS(status) : -WTERMSIG(status));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
check(!pam);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change user and group ids
|
// Change user and group ids
|
||||||
|
|
|
@ -148,7 +148,7 @@ static char *jsonEscape(const char *buf, int len) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int completePendingRequest(struct Session *session,
|
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
|
// If there is no pending HTTP request, save the data and return
|
||||||
// immediately.
|
// immediately.
|
||||||
if (!session->http) {
|
if (!session->http) {
|
||||||
|
|
Loading…
Reference in a new issue