Another iteration of changes intended to deal with MacOS X specific build

problems. Unfortunately, without access to a MacOS X build environment, some
of these have to be mere educated guesses...


git-svn-id: https://shellinabox.googlecode.com/svn/trunk@232 0da03de8-d603-11dd-86c2-0f8696b7b6f9
This commit is contained in:
zodiac@gmail.com 2010-09-29 16:46:51 +00:00
parent 301823036a
commit 925c2385e7
13 changed files with 91 additions and 64 deletions

View file

@ -261,40 +261,44 @@ clean-local:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
.gif.h: .gif.h:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
.png.h: .png.h:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
.html.h: .html.h:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
@ -302,10 +306,11 @@ clean-local:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
.jspp.js: .jspp.js:
@ -322,10 +327,11 @@ clean-local:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
@ -333,9 +339,10 @@ clean-local:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"

View file

@ -1234,50 +1234,55 @@ clean-local:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
.gif.h: .gif.h:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
.png.h: .png.h:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
.html.h: .html.h:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
.ico.h: .ico.h:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
.jspp.js: .jspp.js:
@ -1294,20 +1299,22 @@ clean-local:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
.wav.h: .wav.h:
@echo od "$<" '>'"$@" @echo od "$<" '>'"$@"
@mkdir -p "`dirname "$@"`" @mkdir -p "`dirname "$@"`"
@{ sym="`echo "$<" | $(symbolname)`"; \ @{ sym="`echo "$<" | $(symbolname)`"; \
echo "static const char $${sym}Start[]="; \ echo "static const char $${sym}Start[] ="; \
od -vb "$<" | sed 's/[0-7]*/"/;s/ /\\/g;s/$$/"/'; \ od -vb "$<" | sed 's/[0-7]*/"/;s/ *$$/"/;/^""$$/d;s/ */\\/g'; \
echo ';'; \ echo ';'; \
echo "static const int $${sym}Size=(int)sizeof($${sym}Start);"; \ echo "static const int $${sym}Size ATTR_UNUSED =" \
"(int)sizeof($${sym}Start);"; \
} >"$@" } >"$@"
# Tell versions [3.59,3.63) of GNU make to not export all variables. # Tell versions [3.59,3.63) of GNU make to not export all variables.

View file

@ -171,7 +171,7 @@
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Most recent revision number in the version control system */ /* Most recent revision number in the version control system */
#define VCS_REVISION "231" #define VCS_REVISION "232"
/* Version number of package */ /* Version number of package */
#define VERSION "2.10" #define VERSION "2.10"

2
configure vendored
View file

@ -2328,7 +2328,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
VCS_REVISION=231 VCS_REVISION=232
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF

View file

@ -2,7 +2,7 @@ AC_PREREQ(2.57)
dnl This is the one location where the authoritative version number is stored dnl This is the one location where the authoritative version number is stored
AC_INIT(shellinabox, 2.10, markus@shellinabox.com) AC_INIT(shellinabox, 2.10, markus@shellinabox.com)
VCS_REVISION=231 VCS_REVISION=232
AC_SUBST(VCS_REVISION) AC_SUBST(VCS_REVISION)
AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}", AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}",
[Most recent revision number in the version control system]) [Most recent revision number in the version control system])

View file

@ -2402,7 +2402,7 @@ VT100.prototype.toggleCursorBlinking = function() {
}; };
VT100.prototype.about = function() { VT100.prototype.about = function() {
alert("VT100 Terminal Emulator " + "2.10 (revision 231)" + alert("VT100 Terminal Emulator " + "2.10 (revision 232)" +
"\nCopyright 2008-2010 by Markus Gutschke\n" + "\nCopyright 2008-2010 by Markus Gutschke\n" +
"For more information check http://shellinabox.com"); "For more information check http://shellinabox.com");
}; };

View file

@ -167,6 +167,17 @@ static int (*x_misc_conv)(int, const struct pam_message **,
#define misc_conv x_misc_conv #define misc_conv x_misc_conv
#endif #endif
// MacOS X has a somewhat unusual definition of getgrouplist() which can
// trigger a compile warning. Unfortunately, there is no good feature test
// for this particular problem.
#if defined(__APPLE__) && defined(__MACH__)
static int x_getgrouplist(const char *user, gid_t group,
gid_t *groups, int *ngroups) {
return getgrouplist(user, (int)group, (int *)groups, ngroups);
}
#define getgrouplist x_getgrouplist
#endif
static int launcher = -1; static int launcher = -1;
static uid_t restricted; static uid_t restricted;

View file

@ -274,7 +274,7 @@ uid_t getUserId(const char *name) {
return uid; return uid;
} }
uid_t parseUser(const char *arg, const char **name) { uid_t parseUserArg(const char *arg, const char **name) {
char *end; char *end;
errno = 0; errno = 0;
unsigned long l = strtoul(arg, &end, 10); unsigned long l = strtoul(arg, &end, 10);
@ -404,7 +404,7 @@ gid_t getGroupId(const char *name) {
return gid; return gid;
} }
gid_t parseGroup(const char *arg, const char **name) { gid_t parseGroupArg(const char *arg, const char **name) {
char *end; char *end;
errno = 0; errno = 0;
unsigned long l = strtoul(arg, &end, 10); unsigned long l = strtoul(arg, &end, 10);

View file

@ -55,10 +55,10 @@ void lowerPrivileges(void);
void dropPrivileges(void); void dropPrivileges(void);
const char *getUserName(uid_t uid); const char *getUserName(uid_t uid);
uid_t getUserId(const char *name); uid_t getUserId(const char *name);
uid_t parseUser(const char *arg, const char **name); uid_t parseUserArg(const char *arg, const char **name);
const char *getGroupName(gid_t gid); const char *getGroupName(gid_t gid);
gid_t getGroupId(const char *name); gid_t getGroupId(const char *name);
gid_t parseGroup(const char *arg, const char **name); gid_t parseGroupArg(const char *arg, const char **name);
#ifndef HAVE_GETRESUID #ifndef HAVE_GETRESUID
int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);

View file

@ -180,7 +180,8 @@ void initService(struct Service *service, const char *arg) {
service->authUser = 0; service->authUser = 0;
// Numeric or symbolic user id // Numeric or symbolic user id
service->uid = parseUser(arg, &service->user); service->uid = parseUserArg(arg,
&service->user);
*ptr = ':'; *ptr = ':';
arg = ptr + 1; arg = ptr + 1;
@ -189,7 +190,8 @@ void initService(struct Service *service, const char *arg) {
goto error; goto error;
} }
*ptr = '\000'; *ptr = '\000';
service->gid = parseGroup(arg, &service->group); service->gid = parseGroupArg(arg,
&service->group);
} }
*ptr = ':'; *ptr = ':';
arg = ptr + 1; arg = ptr + 1;

View file

@ -358,7 +358,7 @@ ShellInABox.prototype.extendContextMenu = function(entries, actions) {
}; };
ShellInABox.prototype.about = function() { ShellInABox.prototype.about = function() {
alert("Shell In A Box version " + "2.10 (revision 231)" + alert("Shell In A Box version " + "2.10 (revision 232)" +
"\nCopyright 2008-2010 by Markus Gutschke\n" + "\nCopyright 2008-2010 by Markus Gutschke\n" +
"For more information check http://shellinabox.com" + "For more information check http://shellinabox.com" +
(typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ? (typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ?

View file

@ -76,6 +76,14 @@
#include "shellinabox/session.h" #include "shellinabox/session.h"
#include "shellinabox/usercss.h" #include "shellinabox/usercss.h"
#ifdef HAVE_UNUSED
#defined ATTR_UNUSED __attribute__((unused))
#defined UNUSED(x) do { } while (0)
#else
#define ATTR_UNUSED
#define UNUSED(x) do { (void)(x); } while (0)
#endif
// Embedded resources // Embedded resources
#include "shellinabox/beep.h" #include "shellinabox/beep.h"
#include "shellinabox/cgi_root.h" #include "shellinabox/cgi_root.h"
@ -89,14 +97,6 @@
#include "shellinabox/styles.h" #include "shellinabox/styles.h"
#include "shellinabox/vt100.h" #include "shellinabox/vt100.h"
#ifdef HAVE_UNUSED
#defined ATTR_UNUSED __attribute__((unused))
#defined UNUSED(x) do { } while (0)
#else
#define ATTR_UNUSED
#define UNUSED(x) do { (void)(x); } while (0)
#endif
#define PORTNUM 4200 #define PORTNUM 4200
#define MAX_RESPONSE 2048 #define MAX_RESPONSE 2048
@ -1013,7 +1013,7 @@ static void parseArgs(int argc, char * const argv[]) {
if (!optarg || !*optarg) { if (!optarg || !*optarg) {
fatal("\"--group\" expects a group name."); fatal("\"--group\" expects a group name.");
} }
runAsGroup = parseGroup(optarg, NULL); runAsGroup = parseGroupArg(optarg, NULL);
} else if (!idx--) { } else if (!idx--) {
// Linkify // Linkify
if (!strcmp(optarg, "none")) { if (!strcmp(optarg, "none")) {
@ -1095,7 +1095,7 @@ static void parseArgs(int argc, char * const argv[]) {
if (!optarg || !*optarg) { if (!optarg || !*optarg) {
fatal("\"--user\" expects a user name."); fatal("\"--user\" expects a user name.");
} }
runAsUser = parseUser(optarg, NULL); runAsUser = parseUserArg(optarg, NULL);
} else if (!idx--) { } else if (!idx--) {
// User CSS // User CSS
if (!optarg || !*optarg) { if (!optarg || !*optarg) {

View file

@ -2402,7 +2402,7 @@ VT100.prototype.toggleCursorBlinking = function() {
}; };
VT100.prototype.about = function() { VT100.prototype.about = function() {
alert("VT100 Terminal Emulator " + "2.10 (revision 231)" + alert("VT100 Terminal Emulator " + "2.10 (revision 232)" +
"\nCopyright 2008-2010 by Markus Gutschke\n" + "\nCopyright 2008-2010 by Markus Gutschke\n" +
"For more information check http://shellinabox.com"); "For more information check http://shellinabox.com");
}; };