summaryrefslogtreecommitdiff
path: root/third_party/heimdal/lib/ipc/server.c
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2023-03-09 09:00:02 +1300
committerAndrew Bartlett <abartlet@samba.org>2023-03-31 01:48:30 +0000
commita87aae5292d1c43b987dcfa77a51b6aa5aa3e004 (patch)
treec1af6a7ddb6a196d4af09cd086815be51a709365 /third_party/heimdal/lib/ipc/server.c
parentf448a1649cf4af11f1ceba55ec62e9b2a3db24f1 (diff)
downloadsamba-a87aae5292d1c43b987dcfa77a51b6aa5aa3e004.tar.gz
third_party/heimdal: Import lorikeet-heimdal-202303200103 (commit 2ee541b5e963f7cffb1ec4acd1a8cc45426a9f28)
NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN! Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'third_party/heimdal/lib/ipc/server.c')
-rw-r--r--third_party/heimdal/lib/ipc/server.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/third_party/heimdal/lib/ipc/server.c b/third_party/heimdal/lib/ipc/server.c
index b0b2fa1cb66..5ada75af7d1 100644
--- a/third_party/heimdal/lib/ipc/server.c
+++ b/third_party/heimdal/lib/ipc/server.c
@@ -606,7 +606,6 @@ add_new_socket(int fd,
void *userctx)
{
struct client *c;
- int fileflags;
c = calloc(1, sizeof(*c));
if (c == NULL)
@@ -628,8 +627,7 @@ add_new_socket(int fd,
c->callback = callback;
c->userctx = userctx;
- fileflags = fcntl(c->fd, F_GETFL, 0);
- fcntl(c->fd, F_SETFL, fileflags | O_NONBLOCK);
+ socket_set_nonblocking(fd, 1);
#ifdef HAVE_GCD
init_globals();
@@ -1085,6 +1083,9 @@ heim_sipc_service_unix(const char *service,
const char *d = secure_getenv("HEIM_IPC_DIR");
int fd, ret;
+ if (strncasecmp(service, "UNIX:", sizeof("UNIX:") - 1) == 0)
+ service += sizeof("UNIX:") - 1;
+
un.sun_family = AF_UNIX;
if (snprintf(un.sun_path, sizeof(un.sun_path),
@@ -1115,7 +1116,7 @@ heim_sipc_service_unix(const char *service,
return errno;
}
- chmod(un.sun_path, 0666);
+ (void) chmod(un.sun_path, 0666);
ret = heim_sipc_stream_listener(fd, HEIM_SIPC_TYPE_IPC,
callback, user, ctx);
@@ -1284,7 +1285,7 @@ heim_sipc_service_door(const char *service,
ret = errno;
goto cleanup;
}
- fchmod(dfd, 0666); /* XXX */
+ (void) fchmod(dfd, 0666); /* XXX */
if (fattach(fd, path) < 0) {
ret = errno;