The following issue occurs in Microsoft Windows 7 Qt 4.8.1 deployment:
A QLocalServer (named pipe) expects client connections and works as a server application that works with administrator rights (for example, a system service).
How can I allow a non-privileged QLocalSocket client to connect to this server? The connection attempt is always denied with error code 3 (QLocalSocket :: SocketAccessError). Is there a solution?
Change . As I found out, the solution is to change the channel security by allowing full access to each SID. The only problem is that the call SetSecurityInfoalways fails with the access denied error . First we need to get a pipe handle. Since the pipe has already been created by Qt, we will open it with CreateNamedPipe.
HANDLE hPipe = CreateNamedPipe(
(const wchar_t *)_Server->fullServerName().utf16(),
PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED,
PIPE_TYPE_BYTE |
PIPE_READMODE_BYTE |
PIPE_WAIT,
PIPE_UNLIMITED_INSTANCES,
0,
0,
3000,
0
);
if (SetSecurityInfo(hPipe, SE_KERNEL_OBJECT, DACL_SECURITY_INFORMATION,
0, 0, NewAcl, 0) == ERROR_SUCCESS) {
}
Even if the parameter is NewAclset to NULL, the call fails. So, what could result in a "denied access" error?
source
share