Introduced SCM_CREDENTIALS / SCM_CREDS in the socket control msgs.

This commit is contained in:
Tiago Natel de Moura
2021-11-09 15:48:44 +03:00
parent e878f6d543
commit ff6a7053f5
16 changed files with 578 additions and 349 deletions

View File

@@ -59,6 +59,7 @@ $echo >> $NXT_MAKEFILE
$echo "NXT_LIB_UNIT_OBJS = \\" >> $NXT_MAKEFILE
$echo " $NXT_BUILD_DIR/src/nxt_lvlhsh.o \\" >> $NXT_MAKEFILE
$echo " $NXT_BUILD_DIR/src/nxt_murmur_hash.o \\" >> $NXT_MAKEFILE
$echo " $NXT_BUILD_DIR/src/nxt_socket_msg.o \\" >> $NXT_MAKEFILE
$echo " $NXT_BUILD_DIR/src/nxt_websocket.o \\" >> $NXT_MAKEFILE
for nxt_src in $NXT_LIB_UNIT_SRCS

View File

@@ -158,6 +158,58 @@ nxt_feature_test="#include <stdio.h>
}"
. auto/feature
if [ $nxt_found = no ]; then
$echo
$echo $0: error: no msghdr.msg_control struct member.
$echo
exit 1;
fi
nxt_feature="sockopt SO_PASSCRED"
nxt_feature_name=NXT_HAVE_SOCKOPT_SO_PASSCRED
nxt_feature_run=
nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#define _GNU_SOURCE
#include <sys/socket.h>
int main() {
return SO_PASSCRED == 0;
}"
. auto/feature
if [ $nxt_found = yes ]; then
nxt_feature="struct ucred"
nxt_feature_name=NXT_HAVE_UCRED
nxt_feature_run=
nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#define _GNU_SOURCE
#include <sys/socket.h>
#include <sys/un.h>
int main() {
return sizeof(struct ucred);
}"
. auto/feature
fi
nxt_feature="struct cmsgcred"
nxt_feature_name=NXT_HAVE_MSGHDR_CMSGCRED
nxt_feature_run=
nxt_feature_incs=
nxt_feature_libs=
nxt_feature_test="#define _GNU_SOURCE
#include <sys/socket.h>
int main() {
return sizeof(struct cmsgcred);
}"
. auto/feature
nxt_feature="sys/filio.h"
nxt_feature_name=NXT_HAVE_SYS_FILIO_H

View File

@@ -13,6 +13,7 @@ NXT_LIB_SRCS=" \
src/nxt_mem_map.c \
src/nxt_socket.c \
src/nxt_socketpair.c \
src/nxt_socket_msg.c \
src/nxt_credential.c \
src/nxt_isolation.c \
src/nxt_process.c \