Commit Graph

83 Commits

Author SHA1 Message Date
Nicolas Williams
ec858b3a46 ipc: Get socket dir via secure_getenv()
Using /var/run means needing privilege to run.
2019-11-02 18:49:42 -05:00
Nicolas Williams
c838abdf1a ipc: fix warning 2019-10-09 20:53:30 -05:00
Nicolas Williams
06773bba48 Fix warning in lib/ipc/tc.c 2018-12-28 01:09:38 -06:00
Jeffrey Altman
60b25dd9c5 lib/ipc: client double close of socket file descriptor #431
When connect() fails in connect_unix() the path_ctx.fd is not
set to -1 after close().  When common_release() is executed due
to the error return from connect_unix() it calls close() a second
time.

There is no need to call close() from connect_unix(). Remove the
duplicate request.

This issue was reported by YASUOKA Masahiko.

Change-Id: I825e274cc7f12e50a8779a2b62ddb756817cdb52
2018-12-26 15:13:28 -05:00
Luke Howard
927185e732 IPC: Solaris doors backend: avoid using TLS where possible
Optimistically delay using thread-local storage for the door reply
buffer until we actually need to allocate from the heap.
2018-05-14 12:14:59 +10:00
Luke Howard
c5db6e691a IPC: Solaris doors backend: fix uninitialized variables
When replying to a door call, if allocating the buffer using malloc()
fails, we return EAGAIN to the client to avoid it hanging, using a
variable on the stack. However in this case the code did not reset the
reply length, which would result in it reading past the end of the stack.
At the expense of a goto, this patch uses the same path for returning an
error as if it was generating by the application.

Also, ensure that reply->length is set to zero when returning an error;
it shouldn't affect the client as it will not read this in the event of
a non-zero return code, but it avoids leaking uninitialized memory.
2018-05-13 21:15:21 +10:00
Luke Howard
defde8be68 IPC: do not use alloca() in Solaris doors backend 2018-05-13 17:50:30 +10:00
Luke Howard
73fde33757 KCM: restore support for Solaris doors IPC mechanism (#379)
This patch restores support for the Solaris doors IPC mechanism, removed
from KCM when lib/ipc was added.
2018-05-13 15:31:13 +10:00
Luke Howard
fef64ade9f IPC: fail gracefully in heim_ipc_cred_get_XXX if cred is NULL (#382) 2018-05-12 14:42:25 +10:00
Luke Howard
0c51e7c6ab IPC: use getpeerucred() API correctly (#382)
The ucred_t argument must be initialized to zero otherwise it is assumed to
point to allocated memory. Also, the logic is inverted: getpeerucred()
returns zero on success, not failure.
2018-05-12 14:40:56 +10:00
David Mulder
3f36b4ad68 On hpux, pthread_cond_t is undefined when pthread is disabled 2017-03-09 14:11:19 -05:00
Nicolas Williams
4a9d1782de More missing dist files 2016-12-15 12:40:23 -06:00
Nicolas Williams
f38089257b Misc fixes (coverity) 2016-11-20 17:43:51 -06:00
Love Hörnquist Åstrand
37afa01be3 rename roken base64, fixes #107 2014-08-22 20:57:24 -07:00
Love Hornquist Astrand
060474df16 quel 64bit warnings, fixup implicit encoding for template, fix spelling 2013-06-03 21:46:20 -07:00
Love Hörnquist Åstrand
6294c36526 avoid -Wshadow 2012-11-22 17:27:21 -08:00
Love Hörnquist Åstrand
25e533421a wrap SOL_SOCKET, SO_PEERCRED in ifdef __linux__ 2012-03-11 10:18:43 -07:00
Roland C. Dowdeswell
e8779d5d4a Add -Wshadow and deal with the warnings. 2012-02-21 11:17:55 +00:00
Roland C. Dowdeswell
cc47c8fa7b Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer.  Note that we get different
warnings on different machines and so this will be a work in
progress.  So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).

Notably, we fixed

	1.  a lot of missing structure initialisers,

	2.  unchecked return values for functions that glibc
	    marks as __attribute__((warn-unused-result)),

	3.  made minor modifications to slc and asn1_compile
	    which can generate code which generates warnings,
	    and

	4.  a few stragglers here and there.

We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g.  rsh, rcp,
popper, ftp and telnet.

Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.

We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
2012-02-20 19:45:41 +00:00
Love Hörnquist Åstrand
5829bfe476 add LIB_heimbase 2011-05-22 17:28:24 -07:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
f5f9014c90 Warning fixes from Christos Zoulas
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
Love Hornquist Astrand
46444695f6 include <sys/socket.h> and fix ifdef wrapping for <sys/un.h> 2011-03-21 22:23:21 -07:00
Love Hornquist Astrand
ef045438c9 no support for semaphores w/o pthreads 2011-03-12 11:37:13 -08:00
Love Hornquist Astrand
cb2aa28c7d Include <heimbase.h> 2011-03-12 11:37:12 -08:00
Love Hornquist Astrand
b50919b853 Include <ucred.h> if we have getpeerucred() 2010-11-26 11:37:17 -08:00
Love Hornquist Astrand
88d0a76209 wrap older mach code with __MAC_OS_X_VERSION_MIN_REQUIRED 2010-11-25 10:29:32 -08:00
Love Hornquist Astrand
3789b1111e stop if there is not enough data 2010-10-07 00:01:06 -07:00
Love Hornquist Astrand
a3746c9f07 handle unix credentials 2010-10-06 23:32:36 -07:00
Love Hornquist Astrand
b5bc5c1d84 add PTHREAD_LIBADD 2010-09-19 00:55:36 -07:00
Love Hornquist Astrand
1205b35297 remove extra b 2010-09-12 23:22:41 -07:00
Love Hornquist Astrand
3af3dd2673 add heim_ipc_types.h 2010-09-12 23:18:02 -07:00
Love Hornquist Astrand
e80ef86fe4 include hi_locl.h 2010-09-12 23:11:47 -07:00
Love Hornquist Astrand
da24828d50 add heim_ipc_reply.defs 2010-09-12 23:05:51 -07:00
Love Hornquist Astrand
615257472b add heim_ipc_async.defs 2010-09-12 23:02:01 -07:00
Love Hornquist Astrand
d1943f6860 add heim_ipc.defs 2010-09-12 22:53:33 -07:00
Love Hornquist Astrand
63b6dd1943 make work w/o gcd 2010-09-08 09:49:03 -07:00
Love Hornquist Astrand
bac0598ce6 cancel sources 2010-09-08 09:45:40 -07:00
Love Hornquist Astrand
d615f77834 condition gcd on HAVE_GCD 2010-09-08 09:18:03 -07:00
Love Hornquist Astrand
e297702f78 split dist and nodisk source for heim_ipc[cs]
So that the generated files doesn't have to be built on host w/o mig,
reported by Jelmer Vernooij on heimdal-discuss
2010-02-20 11:22:07 -08:00
Love Hornquist Astrand
3cc8e8bfc7 listen for http requests 2010-01-06 12:54:54 +01:00
Love Hornquist Astrand
8857c285e8 build ts-http 2010-01-06 12:54:27 +01:00
Love Hornquist Astrand
dad3296f64 expose SIPC_TYPE flags 2010-01-06 12:54:09 +01:00
Love Hornquist Astrand
0f5267b97f Make http connections work 2010-01-06 12:53:52 +01:00
Love Hornquist Astrand
1354b6650b clean up http support 2010-01-06 10:42:28 +01:00
Love Hornquist Astrand
68d2f52ad4 fixup prototype 2010-01-06 10:42:16 +01:00
Love Hornquist Astrand
6847593406 Include <base64.h>. 2010-01-06 10:40:53 +01:00
Love Hornquist Astrand
eab88ad791 Include <ctype.h>. 2010-01-06 10:36:12 +01:00
Love Hornquist Astrand
2711882f3f Add bits to support HTTP in server 2010-01-04 16:11:18 +01:00
Love Hornquist Astrand
b0feb58f32 remove invalid $Id$ 2009-12-13 15:43:02 -08:00