Commit Graph

245 Commits

Author SHA1 Message Date
Jeffrey Altman
e5bc391f2e roken: declare IN_LOOPBACKNET if necessary
Not all platforms provide a definition of
IN_LOOPBACKNET.  Let roken define it if it is otherwise
undeclared.

Change-Id: Ibbac2fc4045671237fae23119746b37afb3b83fb
2011-05-17 12:02:09 -04:00
Love Hornquist Astrand
b1909b2daa Fixes from NetBSD via Thomas Klausner and Roland C. Dowdeswell 2011-05-04 21:31:10 -07:00
Derrick Brashear
2a32bf67f0 Add tsearch and friends, and a test program
tsearch is missing from windows. use the netbsd version as it's
license-compatible.
2011-04-08 15:15:36 +01:00
Simon Wilkinson
a597ccdde6 roken: Rename gettimeofday replacement
All replacement roken functions are named rk_blah to avoid symbol
collisions. gettimeofday wasn't being renamed in the header, so fix
that.

This doesn't change the soname of the resulting library, as gettimeofday
isn't currently exported.
2011-04-05 19:44:11 +01:00
Asanka C. Herath
e4d2d78a21 Condition roken's ssize_t definition for compatibility
If SSIZE_T_DEFINED macro is defined, assume we already have ssize_t.
2010-12-03 01:12:32 -05:00
Love Hornquist Astrand
987faedb80 add random abstraction 2010-11-29 09:31:07 -08:00
Asanka C. Herath
d11917211b Windows: Older Windows SDKs need <winsock2.h>
Older SDKs need <winsock2.h> to be included before <ws2tcpip.h>
2010-11-24 15:33:06 -05:00
Simon Wilkinson
9fc90e01b5 roken: Remove multiple prototype for hstrerror
hsterror had two prototypes, one with the Windows magic, and one
without. Remove the one without so Windows can build again.
2010-11-24 10:32:55 +00:00
Jeffrey Altman
f317b91b1b roken: Prototype getopt
Add a prototype for getopt to the roken.h header, and fix the function
definition in getopt.c to be ANSI, rather than K&Rs style.
2010-11-24 09:43:04 +00:00
Asanka C. Herath
e266044cc4 Declarations for getopt externs 2010-11-23 02:25:24 -05:00
Asanka C. Herath
904d779d06 Windows: Support building roken as a DLL 2010-11-23 02:25:17 -05:00
Jeffrey Altman
bd78baf668 Windows: Include winsock2.h before ws2tcpip.h
Before we can include ws2tcpip.h, we must have already included
winsock2.h. The latest SDK does this by including winsock2 within
the ws2tcpip header, but the older SDKs do not, and fail to build.
2010-11-22 23:09:07 +00:00
Andrew Bartlett
0225db7152 Don't redefine socket() if socket_wrapper is already in use
In Samba, we may have already included socket_wrapper.h at this point

Andrew Bartlett

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-10-02 20:46:16 -07:00
Love Hornquist Astrand
736a08059a spelling 2010-09-14 10:44:33 -07:00
Love Hornquist Astrand
64a2e57029 add arguments to rk_rename to move it into the macro/function namespace 2010-09-14 10:18:08 -07:00
Asanka Herath
4b36b36e0b Add roken/rename.c to fix non-standard rename()
roken/rename.c is for platforms where the native rename()
implementation does not replace the target if it already exists.  This
implementation isn't atomic, but should be close enough for most
purposes.

For correct behavior, rk_rename() should be used instead of rename().
rk_rename() is #defined to be rename() on platforms where this fix is
not necessary.
2010-09-14 08:03:34 -04:00
Asanka Herath
745d9bcae7 Windows: Pull required declarations into roken.h.in 2010-08-20 13:09:50 -04:00
Asanka Herath
f456b70013 Relocate roken WinSock declarations 2010-08-20 13:03:41 -04:00
Asanka Herath
04a7eaa170 Call ioctlsocket() indirectly
We were calling ioctlsocket() through a macro.  However, due to type
safety issues, we have to call it indirectly through rk_SOCK_IOCTL().
2010-08-20 13:03:40 -04:00
Love Hornquist Astrand
eec74bd2fe Wrap SOCK_CLOEXEC in ifdef, from Harald Barth 2010-04-30 15:15:58 +02:00
Love Hornquist Astrand
32d148b2f8 Check for dd_fd in DIR not struct dirent
Pointed out by Ragnnar Sundblad in private mail
2010-03-21 09:08:46 -07:00
Love Hornquist Astrand
7d9335ce69 in the STRERROR_R_PROTO_COMPATIBLE case, only provide a rk_strerror_r function if there is a broken prototype
From harald barth.
2010-03-11 18:40:47 -08:00
Love Hornquist Astrand
a46bc97443 Windows code never calls dirfd, avoid warning 2010-02-27 19:23:08 -08:00
Love Hornquist Astrand
94a8d9c5e5 autoconf test for dirfd and dd_fd 2010-02-25 22:18:32 -08:00
Love Hornquist Astrand
560fc640bb Lowercase linux, from Harald Barth 2010-01-26 22:14:59 -08:00
Love Hornquist Astrand
908ece3604 Adapt for Linux with SOCK_CLOEXEC, patch from Harald Barth 2010-01-26 10:46:51 -08:00
Love Hornquist Astrand
2fbdb6a514 rewrite socket to rk_socket of there is SOCK_CLOEXEC and there is linux, prompted by Harald Barth 2010-01-25 23:01:18 -08:00
Love Hornquist Astrand
f6e0d19cc0 make rk_SOCK_EXIT a statment to avoid warnings 2010-01-08 13:08:24 +01:00
Asanka Herath
68cfbb7e19 Add rk_cloexec_dir() to lib/roken 2009-12-22 14:03:39 -05:00
Asanka Herath
a0ae9f5a0e Merge remote branch 'h-github/master' into win32-port2
* h-github/master: (64 commits)
  refix socket wrappers with rk_
  Patch from Secure Endpoints/Asanka Herath for windows support
  unset KRB5CCNAME
  its really just LIBADD more most of them
  correct quoting
  Use -lpthread for modern freebsd instead
  clean KRB5CCNAME and KRB5_CONFIG, require test to reset them
  more up ${env_setup}
  use PTHREADS_LIBADD for freebsd6 and newer
  add PTHREAD_LIBADD
  add PTHREAD_LIBADD
  add PTHREAD_LIBADD
  switch to PTHREADS_LIBADD
  log what the error string say too
  More debug logging
  sprinkle more 'echo "test failed"'
  sprinkle 'echo "test failed"'
  use calloc(), indent more prettier
  in sh, equal compare is really = for strings, not ==
  Check for duplicates, already loaded mechs
  ...

Conflicts (resolved):
	lib/krb5/auth_context.c
	lib/krb5/changepw.c
	lib/krb5/context.c
	lib/krb5/error_string.c
	lib/krb5/kuserok.c
	lib/krb5/libkrb5-exports.def.in
	lib/krb5/net_write.c
	lib/krb5/store_fd.c
	lib/krb5/test_cc.c
	lib/roken/strerror_r.c
2009-12-21 13:44:00 -05:00
Love Hornquist Astrand
2f07a7d29d Try handle strerror_r more correct 2009-12-13 12:02:28 -08:00
Asanka Herath
e5ee3e7d60 Merge commit 'lha/master' into win32-port2
* commit 'lha/master':
  glue for strsvisx
  add Allan McRae and Victor Guerra, sort
  Version Heimdal 1.3.2
  Remove fd caching since we don't have unload (deconstructor) support
2009-12-01 16:58:05 -05:00
Brian May
87d30c0e23 glue for strsvisx 2009-11-29 21:47:29 -08:00
Asanka Herath
62454211c0 (lib/roken) Add strerror_r() along with some missing symbols 2009-11-26 01:58:21 -05:00
Love Hornquist Astrand
86f4c66efd Merge branch 'master' into wip/win32-port2 2009-11-25 05:41:14 -08:00
Love Hornquist Astrand
2204b852a7 Merge branch 'master' into wip/win32-port2 2009-11-24 21:46:10 -08:00
Asanka Herath
d00f9984a5 Make roken build on windows
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2009-11-24 21:42:02 -08:00
Love Hornquist Astrand
f1c0c1bba3 prefix SOCKET symbols with rk_ 2009-11-25 05:29:18 +01:00
Asanka Herath
8e785a5750 Formatting changes and new mini_inetd() function signatures 2009-11-24 10:20:18 -08:00
Asanka Herath
418dd986e5 Add bit-types to roken.h so that we don't need to include krb5-types.h everywhere 2009-11-24 10:17:18 -08:00
Asanka Herath
59a4c6b369 Missing roken.h declarations for Visual C and Windows 2009-11-24 10:11:15 -08:00
Asanka Herath
b1063ea8fc Initial Windows port 2009-11-24 10:11:14 -08:00
Love Hornquist Astrand
fb35ca4026 detect strerror_r and if not there, provide it 2009-10-12 09:01:55 -07:00
Love Hornquist Astrand
1e9ec73bbc [HEIMDAL-646] aix
AIX qsort() is unstable and might change the order of the elements
if they are equal, libwind require them to be in the same order as they were
on the input, pull in FreeBSD qsort and use that instead of AIX version.
2009-10-11 15:08:58 -07:00
Love Hornquist Astrand
f7bde058ee Include dirfd for AIX too
From Anton Lundin
2009-09-29 08:56:07 -07:00
Love Hornquist Astrand
3e2a2de537 Maybe include <ws2tcpip.h>. 2009-09-19 17:55:04 -07:00
Love Hornquist Astrand
7b83dfbe72 Fix #if _DECL_ definitions 2009-09-19 16:32:23 -07:00
Love Hornquist Astrand
b59d869489 have HAVE_DECL_ if special and is set to 0 on failure 2009-09-19 10:48:49 -07:00
Love Hornquist Astrand
ac8444c77f More #if -> #ifdef 2009-09-16 20:21:08 -07:00
Love Hornquist Astrand
9da5a02331 More #if -> #ifdef 2009-09-16 20:18:56 -07:00