New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to access IPC sockets created by another user account #48
Comments
This solution may only work on Linux |
Yes. Any idea how to solve it in general manner? |
I think the only option is to go with the approach where zmq creates a directory with the appropriate permissions, so that all unix domain sockets can be created with a path in that directory and with all users having permission to access them - I believe someone else posted a partial solution along those lines. Its not neat but its the only solution I can see |
wouldn't 0mq need permission to create a directory same way as it needs permissions to open a unix domain socket? |
True, so could go with creating all the sockets in /tmp and chmod them to 777 on creation ? |
In fact I think thats what was proposed by the original poster on the list |
There's no point in 0mq implementing workarounds around OS behaviour. Users can either pre-create the file with adequate permissions or use tcp transport. Closing the issue. |
Fix Build Regression zeromq#449: Move socket_base.hpp and err.hpp after poll.h include
first working draft of java zyre
Workarounds have been suggested to have zmq create the files used for the UDS sockets in the file system with the appropriate permissions. My suggestion is to instead use anonymous sockets, created by ensuring the first character of the char* path passed in is zero. Example below, possibly could be added to zmq::resolve_local_path in ipc.cpp
struct sockaddr_un address;
bzero(&address, sizeof(address));
address.sun_family = AF_UNIX;
strncpy(address.sun_path, localSocketName.c_str(), sizeof(address.sun_path));
int length = sizeof(address.sun_family) + strlen(address.sun_path);
// make sure we use an abstract name for the socket
address.sun_path[0] = 0;
// call bind / connect as normal
The text was updated successfully, but these errors were encountered: