From 2a4baf9fe8cd0e7d7ba626c12c42f3afedc59e1b Mon Sep 17 00:00:00 2001 From: Patrick Mooney Date: Fri, 31 Jul 2015 19:45:26 +0000 Subject: OS-4586 lxbrand cannot bind to /dev/log with namelen of 0xA Reviewed by: Jerry Jelinek --- usr/src/uts/common/brand/lx/syscall/lx_socket.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/src/uts/common/brand/lx/syscall/lx_socket.c b/usr/src/uts/common/brand/lx/syscall/lx_socket.c index 15a7bebbda..57d2b8ec4c 100644 --- a/usr/src/uts/common/brand/lx/syscall/lx_socket.c +++ b/usr/src/uts/common/brand/lx/syscall/lx_socket.c @@ -362,8 +362,10 @@ ltos_sockaddr_ux(const struct sockaddr *inaddr, const socklen_t inlen, if (sun_type != NULL) { *sun_type = LX_SUN_ABSTRACT; } - } else if (len > LX_DEV_LOG_LEN && - strcmp(inaddr->sa_data, LX_DEV_LOG) == 0) { + } else if ((len == LX_DEV_LOG_LEN && + strncmp(inaddr->sa_data, LX_DEV_LOG, LX_DEV_LOG_LEN) == 0) || + (len > LX_DEV_LOG_LEN && + strcmp(inaddr->sa_data, LX_DEV_LOG) == 0)) { /* * In order to support /dev/log -- a Unix domain socket used * for logging that has had its path hard-coded far and wide -- -- cgit v1.2.3