You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
4.2 KiB
113 lines
4.2 KiB
Index: Makefile.in |
|
--- Makefile.in.orig 2011-08-06 10:18:07.000000000 +0200 |
|
+++ Makefile.in 2011-10-10 21:14:58.000000000 +0200 |
|
@@ -1208,8 +1208,6 @@ |
|
sed -e '/^#ifdef *DPKGBUILD$$/,/^#endif$$/d'; \ |
|
fi | \ |
|
sed -e '/^#/d' >"$@" |
|
- @out=`echo "$@" 2>/dev/null|sed -e 's/\.[^.]*$$/.ps/'`; \ |
|
- man -Tps "./$@" >"$${out}" 2>/dev/null || rm -f "$${out}" |
|
|
|
clean-local: |
|
-rm -rf shellinaboxd.1 \ |
|
Index: libhttp/httpconnection.c |
|
--- libhttp/httpconnection.c.orig 2011-08-06 10:18:07.000000000 +0200 |
|
+++ libhttp/httpconnection.c 2011-10-10 21:14:58.000000000 +0200 |
|
@@ -51,6 +51,7 @@ |
|
#include <math.h> |
|
#include <netdb.h> |
|
#include <netinet/in.h> |
|
+#include <sys/socket.h> |
|
#include <stdio.h> |
|
#include <stdlib.h> |
|
#include <string.h> |
|
Index: libhttp/server.c |
|
--- libhttp/server.c.orig 2011-08-06 10:18:07.000000000 +0200 |
|
+++ libhttp/server.c 2011-10-10 21:14:58.000000000 +0200 |
|
@@ -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> |
|
Index: shellinabox/launcher.c |
|
--- shellinabox/launcher.c.orig 2011-08-06 10:18:07.000000000 +0200 |
|
+++ shellinabox/launcher.c 2011-10-10 21:14:58.000000000 +0200 |
|
@@ -500,6 +500,7 @@ |
|
#endif |
|
|
|
int launchChild(int service, struct Session *session, const char *url) { |
|
+ const char *header; |
|
if (launcher < 0) { |
|
errno = EINVAL; |
|
return -1; |
|
@@ -522,6 +523,10 @@ |
|
request->service = service; |
|
request->width = session->width; |
|
request->height = session->height; |
|
+ if ((header = getFromHashMap(httpGetHeaders(session->http), "x-shellinabox-preauthuser")) != NULL) |
|
+ strncat(request->preAuthUser, header, sizeof(request->preAuthUser) - 1); |
|
+ else |
|
+ strncat(request->preAuthUser, "unknown", sizeof(request->preAuthUser) - 1); |
|
strncat(request->peerName, httpGetPeerName(session->http), |
|
sizeof(request->peerName) - 1); |
|
request->urlLength = strlen(u); |
|
@@ -1189,7 +1194,7 @@ |
|
} |
|
|
|
static void execService(int width ATTR_UNUSED, int height ATTR_UNUSED, |
|
- struct Service *service, const char *peerName, |
|
+ struct Service *service, const char *peerName, const char *preAuthUser, |
|
char **environment, const char *url) { |
|
UNUSED(width); |
|
UNUSED(height); |
|
@@ -1227,6 +1232,9 @@ |
|
check(key = strdup("peer")); |
|
check(value = strdup(peerName)); |
|
addToHashMap(vars, key, value); |
|
+ check(key = strdup("preauthuser")); |
|
+ check(value = strdup(preAuthUser)); |
|
+ addToHashMap(vars, key, value); |
|
check(key = strdup("uid")); |
|
addToHashMap(vars, key, stringPrintf(NULL, "%d", service->uid)); |
|
check(key = strdup("url")); |
|
@@ -1416,7 +1424,7 @@ |
|
} |
|
|
|
static void childProcess(struct Service *service, int width, int height, |
|
- struct Utmp *utmp, const char *peerName, |
|
+ struct Utmp *utmp, const char *peerName, const char *preAuthUser, |
|
const char *url) { |
|
// Set initial window size |
|
setWindowSize(0, width, height); |
|
@@ -1548,7 +1556,7 @@ |
|
execle("/usr/bin/login", "login", "-p", "-h", peerName, |
|
(void *)0, environment); |
|
} else { |
|
- execService(width, height, service, peerName, environment, url); |
|
+ execService(width, height, service, peerName, preAuthUser, environment, url); |
|
} |
|
_exit(1); |
|
} |
|
@@ -1638,7 +1646,7 @@ |
|
services[request.service]->useLogin, |
|
&utmp, request.peerName)) == 0) { |
|
childProcess(services[request.service], request.width, request.height, |
|
- utmp, request.peerName, url); |
|
+ utmp, request.peerName, request.preAuthUser, url); |
|
free(url); |
|
_exit(1); |
|
} else { |
|
Index: shellinabox/launcher.h |
|
--- shellinabox/launcher.h.orig 2011-08-06 10:18:07.000000000 +0200 |
|
+++ shellinabox/launcher.h 2011-10-10 21:14:58.000000000 +0200 |
|
@@ -55,6 +55,7 @@ |
|
int service; |
|
int width, height; |
|
char peerName[128]; |
|
+ char preAuthUser[32]; |
|
int urlLength; |
|
char url[0]; |
|
};
|
|
|