OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: r...@openpkg.org Module: openpkg-src Date: 14-Feb-2009 00:12:24 Branch: HEAD Handle: 2009021323122400 Modified files: openpkg-src/shellinabox shellinabox.patch shellinabox.spec Log: upgrading package: shellinabox 2.3 -> 2.4 Summary: Revision Changes Path 1.2 +19 -267 openpkg-src/shellinabox/shellinabox.patch 1.3 +2 -2 openpkg-src/shellinabox/shellinabox.spec ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/shellinabox/shellinabox.patch ============================================================================ $ cvs diff -u -r1.1 -r1.2 shellinabox.patch --- openpkg-src/shellinabox/shellinabox.patch 31 Jan 2009 21:38:22 -0000 1.1 +++ openpkg-src/shellinabox/shellinabox.patch 13 Feb 2009 23:12:24 -0000 1.2 @@ -1,7 +1,7 @@ Index: Makefile.in ---- Makefile.in.orig 2009-01-22 03:40:12 +0100 -+++ Makefile.in 2009-01-31 19:57:21 +0100 -@@ -234,7 +234,7 @@ +--- Makefile.in.orig 2009-02-13 02:52:39 +0100 ++++ Makefile.in 2009-02-14 00:06:15 +0100 +@@ -235,7 +235,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = @@ -10,36 +10,21 @@ AM_LDFLAGS = -g noinst_LTLIBRARIES = libhttp.la \ liblogging.la -@@ -287,7 +287,7 @@ - libhttp/libhttp.sym - - libhttp_la_LDFLAGS = -export-symbols $(top_srcdir)/libhttp/libhttp.sym \ -- -version 1:0:0 -ldl -+ -version 1:0:0 - - shellinaboxd_SOURCES = shellinabox/shellinaboxd.c \ - shellinabox/externalfile.c \ -@@ -311,7 +311,7 @@ - shellinaboxd_LDADD = liblogging.la \ - libhttp.la - --shellinaboxd_LDFLAGS = -static -ldl -+shellinaboxd_LDFLAGS = -static - all: all-am - - .SUFFIXES: -@@ -976,7 +976,6 @@ - else \ - sed -e '/^#ifdef *HAVE_OPENSSL$$/,/^#endif$$/d' "$<" >"$@"; \ - fi -- @man -Tps "./$@" >`echo "$@"|sed -e 's/\.[^.]*$$/.ps/'` || true +@@ -1001,9 +1001,7 @@ + -e '/^#endif$$/d' "$$src" >"$@"; \ + else \ + sed -e '/^#ifdef *HAVE_OPENSSL$$/,/^#endif$$/d' "$$src" >"$@"; \ +- fi +- @man -Tps "./$@" >`echo "$@" 2>/dev/null|sed -e 's/\.[^.]*$$/.ps/'` \ +- || true ++ fi || true clean-local: -rm -rf shellinaboxd.1 \ Index: libhttp/httpconnection.c ---- libhttp/httpconnection.c.orig 2009-01-22 00:47:55 +0100 -+++ libhttp/httpconnection.c 2009-01-31 19:56:48 +0100 -@@ -47,6 +47,7 @@ +--- libhttp/httpconnection.c.orig 2009-02-11 23:58:39 +0100 ++++ libhttp/httpconnection.c 2009-02-14 00:05:28 +0100 +@@ -49,6 +49,7 @@ #include <arpa/inet.h> #include <netdb.h> #include <netinet/in.h> @@ -48,246 +33,13 @@ #include <stdlib.h> #include <string.h> Index: libhttp/server.c ---- libhttp/server.c.orig 2009-01-22 00:47:55 +0100 -+++ libhttp/server.c 2009-01-31 19:56:48 +0100 -@@ -44,6 +44,7 @@ - // http://shellinabox.com +--- libhttp/server.c.orig 2009-02-11 23:58:48 +0100 ++++ libhttp/server.c 2009-02-14 00:05:28 +0100 +@@ -46,6 +46,7 @@ + #include "config.h" #include <arpa/inet.h> +#include <netinet/in.h> #include <fcntl.h> + #include <netinet/in.h> #include <stdlib.h> - #include <string.h> -Index: libhttp/ssl.c ---- libhttp/ssl.c.orig 2009-01-22 00:47:55 +0100 -+++ libhttp/ssl.c 2009-01-31 19:56:48 +0100 -@@ -167,10 +167,14 @@ - void *dl = RTLD_DEFAULT; - void *rc = dlsym(dl, fn); - if (!rc) { -+#ifdef RTLD_NOLOAD - dl = dlopen(lib, RTLD_LAZY|RTLD_GLOBAL|RTLD_NOLOAD); - if (dl == NULL) { -+#endif - dl = dlopen(lib, RTLD_LAZY|RTLD_GLOBAL); -+#ifdef RTLD_NOLOAD - } -+#endif - if (dl != NULL) { - rc = dlsym(dl, fn); - } -@@ -548,9 +552,11 @@ - (dsaSize > 0 && - !SSL_CTX_use_PrivateKey_ASN1(EVP_PKEY_DSA, ssl->sslContext, dsa, - dsaSize)) || -+#ifdef EVP_PKEY_EC - (ecSize > 0 && - !SSL_CTX_use_PrivateKey_ASN1(EVP_PKEY_EC, ssl->sslContext, ec, - ecSize)) || -+#endif - !SSL_CTX_check_private_key(ssl->sslContext)) { - fatal("Cannot read valid certificate from fd %d. Check file format.", fd); - } -Index: shellinabox/externalfile.c ---- shellinabox/externalfile.c.orig 2009-01-22 00:47:56 +0100 -+++ shellinabox/externalfile.c 2009-01-31 19:56:48 +0100 -@@ -99,7 +99,11 @@ - } - - // Open file for reading -+#ifdef O_LARGEFILE - int fd = NOINTR(open(fn, O_RDONLY|O_LARGEFILE)); -+#else -+ int fd = NOINTR(open(fn, O_RDONLY)); -+#endif - - // Recognize a couple of common MIME types - static const struct { -@@ -141,9 +145,9 @@ - - // We only serve regular files, and restrict the file size to 100MB. - // As a special-case, we also allow access to /dev/null. -- struct stat64 sb = { 0 }; -+ struct stat sb = { 0 }; - if (strcmp(fn, "/dev/null") && -- (fstat64(fd, &sb) || -+ (fstat(fd, &sb) || - !S_ISREG(sb.st_mode) || - sb.st_size > (100 << 20))) { - free(fn); -Index: shellinabox/launcher.c ---- shellinabox/launcher.c.orig 2009-01-22 00:47:56 +0100 -+++ shellinabox/launcher.c 2009-01-31 19:56:48 +0100 -@@ -62,7 +62,10 @@ - #include <sys/utsname.h> - #include <termios.h> - #include <unistd.h> -+#ifdef __linux__ - #include <utmpx.h> -+#endif -+#include <signal.h> - - #if defined(HAVE_SECURITY_PAM_APPL_H) && defined(HAVE_SECURITY_PAM_MISC_H) - #include <security/pam_appl.h> -@@ -228,7 +231,9 @@ - const char pid[32]; - int pty; - int useLogin; -+#ifdef __linux__ - struct utmpx utmpx; -+#endif - }; - - static HashMap *childProcesses; -@@ -238,16 +243,22 @@ - memset(utmp, 0, sizeof(struct Utmp)); - utmp->pty = -1; - utmp->useLogin = useLogin; -+#ifdef __linux__ - utmp->utmpx.ut_type = useLogin ? LOGIN_PROCESS : USER_PROCESS; -+#endif - dcheck(!strncmp(ptyPath, "/dev/pts", 8)); -+#ifdef __linux__ - strncat(&utmp->utmpx.ut_line[0], ptyPath + 5, sizeof(utmp->utmpx.ut_line)); - strncat(&utmp->utmpx.ut_id[0], ptyPath + 8, sizeof(utmp->utmpx.ut_id)); - strncat(&utmp->utmpx.ut_user[0], "SHELLINABOX", sizeof(utmp->utmpx.ut_user)); - strncat(&utmp->utmpx.ut_host[0], peerName, sizeof(utmp->utmpx.ut_host)); -+#endif - struct timeval tv; - check(!gettimeofday(&tv, NULL)); -+#ifdef __linux__ - utmp->utmpx.ut_tv.tv_sec = tv.tv_sec; - utmp->utmpx.ut_tv.tv_usec = tv.tv_usec; -+#endif - } - - struct Utmp *newUtmp(int useLogin, const char *ptyPath, -@@ -259,6 +270,7 @@ - } - - void destroyUtmp(struct Utmp *utmp) { -+#ifdef __linux__ - if (utmp) { - if (utmp->pty >= 0) { - utmp->utmpx.ut_type = DEAD_PROCESS; -@@ -291,6 +303,7 @@ - NOINTR(close(utmp->pty)); - } - } -+#endif - } - - void deleteUtmp(struct Utmp *utmp) { -@@ -359,11 +372,23 @@ - static int forkPty(int *pty, int useLogin, struct Utmp **utmp, - const char *peerName) { - int slave; -+#ifdef __linux__ - char ptyPath[PATH_MAX]; -+#else -+ char *ptyPath; -+#endif -+#ifdef __linux__ - if ((*pty = getpt()) < 0 || -+#else -+ if ((*pty = posix_openpt(O_RDWR)) < 0 || -+#endif - grantpt(*pty) < 0 || - unlockpt(*pty) < 0 || -+#ifdef __linux__ - ptsname_r(*pty, ptyPath, sizeof(ptyPath)) < 0 || -+#else -+ (ptyPath = ptsname(*pty)) == NULL || -+#endif - (slave = NOINTR(open(ptyPath, O_RDWR|O_NOCTTY))) < 0) { - if (*pty >= 0) { - NOINTR(close(*pty)); -@@ -388,8 +413,10 @@ - } else if (pid == 0) { - pid = getpid(); - snprintf((char *)&(*utmp)->pid[0], sizeof((*utmp)->pid), "%d", pid); -+#ifdef __linux__ - (*utmp)->utmpx.ut_pid = pid; - (*utmp)->pty = slave; -+#endif - - closeAllFds((int []){ slave }, 1); - -@@ -411,9 +438,11 @@ - - return 0; - } else { -+#ifdef __linux__ - snprintf((char *)&(*utmp)->pid[0], sizeof((*utmp)->pid), "%d", pid); - (*utmp)->utmpx.ut_pid = pid; - (*utmp)->pty = *pty; -+#endif - fcntl(*pty, F_SETFL, O_NONBLOCK|O_RDWR); - NOINTR(close(slave)); - return pid; -@@ -608,12 +637,14 @@ - free((void *)pw); - - // Update utmp/wtmp entries -+#ifdef __linux__ - memset(&utmp->utmpx.ut_user, 0, sizeof(utmp->utmpx.ut_user)); - strncat(&utmp->utmpx.ut_user[0], service->user, sizeof(utmp->utmpx.ut_user)); - setutxent(); - pututxline(&utmp->utmpx); - endutxent(); - updwtmpx("/var/log/wtmp", &utmp->utmpx); -+#endif - - alarm(0); - return pam; -@@ -849,6 +880,7 @@ - // Assert root privileges in order to update utmp entry. - setresuid(0, 0, 0); - setresgid(0, 0, 0); -+#ifdef __linux__ - setutxent(); - struct utmpx utmpx = utmp->utmpx; - if (service->useLogin || service->authUser) { -@@ -862,6 +894,7 @@ - strncat(&utmpx.ut_user[0], "LOGIN", sizeof(utmpx.ut_user)); - updwtmpx("/var/log/wtmp", &utmpx); - } -+#endif - - // Create session. We might have to fork another process as PAM wants us - // to close the session when the child terminates. And we must retain -Index: shellinabox/shellinaboxd.c ---- shellinabox/shellinaboxd.c.orig 2009-01-22 03:38:22 +0100 -+++ shellinabox/shellinaboxd.c 2009-01-31 19:56:48 +0100 -@@ -54,7 +54,9 @@ - #include <stdio.h> - #include <stdlib.h> - #include <string.h> -+#ifdef __linux__ - #include <sys/prctl.h> -+#endif - #include <sys/resource.h> - #include <sys/types.h> - #include <sys/stat.h> -@@ -853,7 +855,11 @@ - setsid(); - if (pidfile) { - int fd = NOINTR(open(pidfile, -+#ifdef O_LARGEFILE - O_WRONLY|O_TRUNC|O_LARGEFILE|O_CREAT, -+#else -+ O_WRONLY|O_TRUNC|O_CREAT, -+#endif - 0644)); - if (fd >= 0) { - char buf[40]; -@@ -906,7 +912,9 @@ - - int main(int argc, char * const argv[]) { - // Disable core files -+#ifdef __linux__ - prctl(PR_SET_DUMPABLE, 0, 0, 0, 0); -+#endif - removeLimits(); - - // Parse command line arguments @@ . patch -p0 <<'@@ .' Index: openpkg-src/shellinabox/shellinabox.spec ============================================================================ $ cvs diff -u -r1.2 -r1.3 shellinabox.spec --- openpkg-src/shellinabox/shellinabox.spec 2 Feb 2009 07:23:14 -0000 1.2 +++ openpkg-src/shellinabox/shellinabox.spec 13 Feb 2009 23:12:24 -0000 1.3 @@ -31,8 +31,8 @@ Class: EVAL Group: Terminal License: GPL -Version: 2.3 -Release: 20090202 +Version: 2.4 +Release: 20090214 # list of sources Source0: http://shellinabox.googlecode.com/files/shellinabox-%{version}.tar.gz @@ . ______________________________________________________________________ OpenPKG http://openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org