Don't call getsockopt with SO_PEERCRED and SO_PEERSEC parameters on FreeBSD.

This commit is contained in:
Gleb Popov 2019-11-10 12:36:31 +04:00 committed by Wim Taymans
parent 33df224254
commit 6ea24a7db5

View file

@ -335,6 +335,7 @@ static struct pw_client *client_new(struct server *s, int fd)
if (props == NULL)
goto exit;
#ifndef __FreeBSD__
len = sizeof(ucred);
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &ucred, &len) < 0) {
pw_log_error("server %p: no peercred: %m", s);
@ -350,6 +351,7 @@ static struct pw_client *client_new(struct server *s, int fd)
} else {
pw_properties_setf(props, PW_KEY_SEC_LABEL, "%s", buffer);
}
#endif
pw_properties_setf(props, PW_KEY_MODULE_ID, "%d", d->module->global->id);