+ Use setreu/gid if seteu/gid is not avaiable
+ Don't declare tzname extern for cygwin
This commit is contained in:
parent
a8fa33646a
commit
06ce3e41e6
10
acconfig.h
10
acconfig.h
|
@ -48,6 +48,16 @@
|
||||||
|
|
||||||
#undef _XOPEN_SOURCE_EXTENDED
|
#undef _XOPEN_SOURCE_EXTENDED
|
||||||
|
|
||||||
|
#undef CYGWIN
|
||||||
|
|
||||||
|
#undef HAVE_SETEGID
|
||||||
|
|
||||||
|
#undef HAVE_SETREGID
|
||||||
|
|
||||||
|
#undef HAVE_SETEUID
|
||||||
|
|
||||||
|
#undef HAVE_SETREUID
|
||||||
|
|
||||||
#undef socklen_t
|
#undef socklen_t
|
||||||
|
|
||||||
#undef HAVE_HARRIS
|
#undef HAVE_HARRIS
|
||||||
|
|
11
configure.in
11
configure.in
|
@ -311,6 +311,7 @@ AC_INIT(c/scheme48vm.c)
|
||||||
|
|
||||||
## NT - cygwin32
|
## NT - cygwin32
|
||||||
*-*-cygwin* )
|
*-*-cygwin* )
|
||||||
|
AC_DEFINE(CYGWIN)
|
||||||
dir=cygwin32
|
dir=cygwin32
|
||||||
EXEEXT=".exe"
|
EXEEXT=".exe"
|
||||||
;;
|
;;
|
||||||
|
@ -352,6 +353,16 @@ esac
|
||||||
AC_CHECK_FUNCS(socket chroot)
|
AC_CHECK_FUNCS(socket chroot)
|
||||||
AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR),
|
AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR),
|
||||||
[LIBOBJS="$LIBOBJS c/fake/strerror.o"])
|
[LIBOBJS="$LIBOBJS c/fake/strerror.o"])
|
||||||
|
|
||||||
|
AC_CHECK_FUNC(seteuid, AC_DEFINE(HAVE_SETEUID),
|
||||||
|
AC_CHECK_FUNC(setreuid, AC_DEFINE(HAVE_SETREUID),
|
||||||
|
AC_MSG_ERROR("Neither setegid nor setregid defined. Cannot continue.")))
|
||||||
|
|
||||||
|
AC_CHECK_FUNC(setegid, AC_DEFINE(HAVE_SETEGID),
|
||||||
|
AC_CHECK_FUNC(setregid, AC_DEFINE(HAVE_SETREGID),
|
||||||
|
AC_MSG_ERROR("Neither setegid nor setregid defined. Cannot continue.")))
|
||||||
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([n_name])
|
AC_MSG_CHECKING([n_name])
|
||||||
AC_TRY_LINK([#include <nlist.h>],
|
AC_TRY_LINK([#include <nlist.h>],
|
||||||
[struct nlist name_list;
|
[struct nlist name_list;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* OS-dependent support for what is supposed to be the standard ANSI C Library.
|
/* OS-dependent support for what is supposed to be the standard ANSI C Library.
|
||||||
** Copyright (c) 1999 by Brian D. Carlstrom.
|
** Copyright (c) 1999 by Brian D. Carlstrom.
|
||||||
*/
|
*/
|
||||||
struct netent *getnetbyaddr (long x, int y) {return NULL;}
|
struct netent *getnetbyaddr (long x, int y) {return 0;}
|
||||||
struct netent *getnetbyname (const char *x) {return NULL;}
|
struct netent *getnetbyname (const char *x) {return 0;}
|
||||||
|
|
|
@ -622,7 +622,11 @@ s48_value scsh_setgid(s48_value gid)
|
||||||
|
|
||||||
s48_value scsh_setegid(s48_value gid)
|
s48_value scsh_setegid(s48_value gid)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_SETEGID
|
||||||
int retval = setegid (s48_extract_integer (gid));
|
int retval = setegid (s48_extract_integer (gid));
|
||||||
|
#else
|
||||||
|
int retval = setregid (-1, s48_extract_integer (gid));
|
||||||
|
#endif
|
||||||
if (retval == -1)
|
if (retval == -1)
|
||||||
s48_raise_os_error_1(errno, gid);
|
s48_raise_os_error_1(errno, gid);
|
||||||
return S48_UNSPECIFIC;
|
return S48_UNSPECIFIC;
|
||||||
|
@ -680,7 +684,11 @@ s48_value scsh_setuid(s48_value uid)
|
||||||
|
|
||||||
s48_value scsh_seteuid(s48_value uid)
|
s48_value scsh_seteuid(s48_value uid)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_SETEUID
|
||||||
int retval = seteuid (s48_extract_integer (uid));
|
int retval = seteuid (s48_extract_integer (uid));
|
||||||
|
#else
|
||||||
|
int retval = setreuid (-1, s48_extract_integer (uid));
|
||||||
|
#endif
|
||||||
if (retval == -1)
|
if (retval == -1)
|
||||||
s48_raise_os_error_1(errno, uid);
|
s48_raise_os_error_1(errno, uid);
|
||||||
return S48_UNSPECIFIC;
|
return S48_UNSPECIFIC;
|
||||||
|
|
|
@ -53,7 +53,7 @@ extern char **environ;
|
||||||
/* To work in the UTC time zone, do "environ = utc_env;". */
|
/* To work in the UTC time zone, do "environ = utc_env;". */
|
||||||
static char *utc_env[] = {"TZ=UCT0", 0};
|
static char *utc_env[] = {"TZ=UCT0", 0};
|
||||||
|
|
||||||
#ifdef HAVE_TZNAME
|
#if defined(HAVE_TZNAME) && !defined(CYGWIN)
|
||||||
extern char *tzname[]; /* Why isn't this defined in time.h? */
|
extern char *tzname[]; /* Why isn't this defined in time.h? */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue