Minor clean ups. Came up with a feature test for the function signature used
by getgrouplist(). Added a few more UNUSED() macros. git-svn-id: https://shellinabox.googlecode.com/svn/trunk@233 0da03de8-d603-11dd-86c2-0f8696b7b6f9
This commit is contained in:
parent
925c2385e7
commit
04607ee245
9 changed files with 46 additions and 9 deletions
5
config.h
5
config.h
|
@ -22,6 +22,9 @@
|
||||||
/* Define to 1 if you have the `getgrnam_r' function. */
|
/* Define to 1 if you have the `getgrnam_r' function. */
|
||||||
#define HAVE_GETGRNAM_R 1
|
#define HAVE_GETGRNAM_R 1
|
||||||
|
|
||||||
|
/* Define to 1 if getgrouplist() takes ints as arguments */
|
||||||
|
/* #undef HAVE_GETGROUPLIST_TAKES_INTS */
|
||||||
|
|
||||||
/* Define to 1 if you have the `gethostbyname_r' function. */
|
/* Define to 1 if you have the `gethostbyname_r' function. */
|
||||||
#define HAVE_GETHOSTBYNAME_R 1
|
#define HAVE_GETHOSTBYNAME_R 1
|
||||||
|
|
||||||
|
@ -171,7 +174,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 "232"
|
#define VCS_REVISION "233"
|
||||||
|
|
||||||
/* Version number of package */
|
/* Version number of package */
|
||||||
#define VERSION "2.10"
|
#define VERSION "2.10"
|
||||||
|
|
|
@ -21,6 +21,9 @@
|
||||||
/* Define to 1 if you have the `getgrnam_r' function. */
|
/* Define to 1 if you have the `getgrnam_r' function. */
|
||||||
#undef HAVE_GETGRNAM_R
|
#undef HAVE_GETGRNAM_R
|
||||||
|
|
||||||
|
/* Define to 1 if getgrouplist() takes ints as arguments */
|
||||||
|
#undef HAVE_GETGROUPLIST_TAKES_INTS
|
||||||
|
|
||||||
/* Define to 1 if you have the `gethostbyname_r' function. */
|
/* Define to 1 if you have the `gethostbyname_r' function. */
|
||||||
#undef HAVE_GETHOSTBYNAME_R
|
#undef HAVE_GETHOSTBYNAME_R
|
||||||
|
|
||||||
|
|
23
configure
vendored
23
configure
vendored
|
@ -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=232
|
VCS_REVISION=233
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
|
@ -10805,6 +10805,27 @@ if ac_fn_c_try_link "$LINENO"; then :
|
||||||
|
|
||||||
$as_echo "#define HAVE_ATTRIBUTE_UNUSED 1" >>confdefs.h
|
$as_echo "#define HAVE_ATTRIBUTE_UNUSED 1" >>confdefs.h
|
||||||
|
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
#define _BSD_SOURCE
|
||||||
|
#include <grp.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
int (*f)(const char *, int, int *, int *) = getgrouplist;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_link "$LINENO"; then :
|
||||||
|
|
||||||
|
$as_echo "#define HAVE_GETGROUPLIST_TAKES_INTS 1" >>confdefs.h
|
||||||
|
|
||||||
fi
|
fi
|
||||||
rm -f core conftest.err conftest.$ac_objext \
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
conftest$ac_exeext conftest.$ac_ext
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
|
10
configure.ac
10
configure.ac
|
@ -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=232
|
VCS_REVISION=233
|
||||||
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])
|
||||||
|
@ -84,6 +84,14 @@ AC_TRY_LINK([void x(int i __attribute__((unused))) __attribute__((unused));],
|
||||||
[AC_DEFINE(HAVE_ATTRIBUTE_UNUSED, 1,
|
[AC_DEFINE(HAVE_ATTRIBUTE_UNUSED, 1,
|
||||||
Define to 1 if you have support for the "unused" attribute)])
|
Define to 1 if you have support for the "unused" attribute)])
|
||||||
|
|
||||||
|
dnl Check the function signature of getgrouplist()
|
||||||
|
AC_TRY_LINK([#define _BSD_SOURCE
|
||||||
|
#include <grp.h>
|
||||||
|
#include <unistd.h>],
|
||||||
|
[int (*f)(const char *, int, int *, int *) = getgrouplist;],
|
||||||
|
[AC_DEFINE(HAVE_GETGROUPLIST_TAKES_INTS, 1,
|
||||||
|
Define to 1 if getgrouplist() takes ints as arguments)])
|
||||||
|
|
||||||
dnl On some systems, calling /bin/login does not work. Disable the LOGIN
|
dnl On some systems, calling /bin/login does not work. Disable the LOGIN
|
||||||
dnl feature, if the user tells us that it does not do the right thing.
|
dnl feature, if the user tells us that it does not do the right thing.
|
||||||
AC_ARG_ENABLE(login,
|
AC_ARG_ENABLE(login,
|
||||||
|
|
|
@ -2402,7 +2402,7 @@ VT100.prototype.toggleCursorBlinking = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
VT100.prototype.about = function() {
|
VT100.prototype.about = function() {
|
||||||
alert("VT100 Terminal Emulator " + "2.10 (revision 232)" +
|
alert("VT100 Terminal Emulator " + "2.10 (revision 233)" +
|
||||||
"\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");
|
||||||
};
|
};
|
||||||
|
|
|
@ -168,9 +168,8 @@ static int (*x_misc_conv)(int, const struct pam_message **,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// MacOS X has a somewhat unusual definition of getgrouplist() which can
|
// MacOS X has a somewhat unusual definition of getgrouplist() which can
|
||||||
// trigger a compile warning. Unfortunately, there is no good feature test
|
// trigger a compile warning.
|
||||||
// for this particular problem.
|
#if defined(HAVE_GETGROUPLIST_TAKES_INTS)
|
||||||
#if defined(__APPLE__) && defined(__MACH__)
|
|
||||||
static int x_getgrouplist(const char *user, gid_t group,
|
static int x_getgrouplist(const char *user, gid_t group,
|
||||||
gid_t *groups, int *ngroups) {
|
gid_t *groups, int *ngroups) {
|
||||||
return getgrouplist(user, (int)group, (int *)groups, ngroups);
|
return getgrouplist(user, (int)group, (int *)groups, ngroups);
|
||||||
|
|
|
@ -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 232)" +
|
alert("Shell In A Box version " + "2.10 (revision 233)" +
|
||||||
"\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 ?
|
||||||
|
|
|
@ -634,6 +634,7 @@ static int shellInABoxHttpHandler(HttpConnection *http, void *arg,
|
||||||
// client session.
|
// client session.
|
||||||
return dataHandler(http, arg, buf, len, url);
|
return dataHandler(http, arg, buf, len, url);
|
||||||
}
|
}
|
||||||
|
UNUSED(rootPageSize);
|
||||||
char *html = stringPrintf(NULL, rootPageStart,
|
char *html = stringPrintf(NULL, rootPageStart,
|
||||||
enableSSL ? "true" : "false");
|
enableSSL ? "true" : "false");
|
||||||
serveStaticFile(http, "text/html", html, strrchr(html, '\000'));
|
serveStaticFile(http, "text/html", html, strrchr(html, '\000'));
|
||||||
|
@ -846,6 +847,7 @@ static void parseArgs(int argc, char * const argv[]) {
|
||||||
int verbosity = MSG_DEFAULT;
|
int verbosity = MSG_DEFAULT;
|
||||||
externalFiles = newHashMap(destroyExternalFileHashEntry, NULL);
|
externalFiles = newHashMap(destroyExternalFileHashEntry, NULL);
|
||||||
HashMap *serviceTable = newHashMap(destroyServiceHashEntry, NULL);
|
HashMap *serviceTable = newHashMap(destroyServiceHashEntry, NULL);
|
||||||
|
UNUSED(stylesSize);
|
||||||
check(cssStyleSheet = strdup(stylesStart));
|
check(cssStyleSheet = strdup(stylesStart));
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
@ -1274,6 +1276,7 @@ int main(int argc, char * const argv[]) {
|
||||||
"X-ShellInABox-Pid: %d\r\n"
|
"X-ShellInABox-Pid: %d\r\n"
|
||||||
"Content-type: text/html; charset=utf-8\r\n\r\n",
|
"Content-type: text/html; charset=utf-8\r\n\r\n",
|
||||||
port, getpid());
|
port, getpid());
|
||||||
|
UNUSED(cgiRootSize);
|
||||||
printfUnchecked(cgiRootStart, port, cgiSessionKey);
|
printfUnchecked(cgiRootStart, port, cgiSessionKey);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
check(!NOINTR(close(fds[1])));
|
check(!NOINTR(close(fds[1])));
|
||||||
|
|
|
@ -2402,7 +2402,7 @@ VT100.prototype.toggleCursorBlinking = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
VT100.prototype.about = function() {
|
VT100.prototype.about = function() {
|
||||||
alert("VT100 Terminal Emulator " + "2.10 (revision 232)" +
|
alert("VT100 Terminal Emulator " + "2.10 (revision 233)" +
|
||||||
"\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");
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue