commit d5c2503150f2b65d666b93240346a5a3ba6901ff
parent cafb33d5f0b5eedac444e410fa2ae1e500e7c6ea
Author: Daniel Barlow <dan@telent.net>
Date: Tue, 19 May 2026 21:26:30 +0100
note the (unfulfilled) requirement for fds_from_msg
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/luad.c b/luad.c
@@ -52,6 +52,11 @@ int open_socket(char * pathname) {
int * fds_from_msg(struct msghdr *msg, size_t peer_fds_count) {
int *peer_fds = (int *) calloc(peer_fds_count, sizeof(int));
+ // * there may be multiple SCM_RIGHTS messages
+ // * we expect three fds
+ // * if we get some number other than three, we should
+ // close them and return NULL
+
for (struct cmsghdr* cmsg = CMSG_FIRSTHDR(msg);
cmsg != NULL;
cmsg = CMSG_NXTHDR(msg, cmsg)) {