From: Rafal Krypa Date: Mon, 3 Apr 2017 15:10:02 +0000 (+0200) Subject: Fix receiving sockets from systemd in libaskuser-notification X-Git-Tag: submit/tizen/20170405.143506~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=353cbed25a503c86706e19db7f78f9e5084ae497;p=platform%2Fcore%2Fsecurity%2Faskuser.git Fix receiving sockets from systemd in libaskuser-notification The error was in setting listening=1 argument in sd_is_socket_unix(). We are serving both stream and datagram socket and listening is valind only for stream sockets. This lead to not catching the datagram socket. Change-Id: Ie10b289870e12a895a3d8799788f2da4379da06f Signed-off-by: Rafal Krypa --- diff --git a/src/common/protocol/sock.cpp b/src/common/protocol/sock.cpp index afceddd..2f72433 100644 --- a/src/common/protocol/sock.cpp +++ b/src/common/protocol/sock.cpp @@ -85,7 +85,7 @@ int Sock::getSocketFromSystemD() { return -1; for (int fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START+n; ++fd) - if (0 < sd_is_socket_unix(fd, getUnixSockType(), 1, m_path.c_str(), 0)) + if (0 < sd_is_socket_unix(fd, getUnixSockType(), -1, m_path.c_str(), 0)) return fd; #endif // BUILD_WITH_SYSTEMD_DAEMON return -1;