Messages in this thread | | | Date | Sun, 12 Mar 2000 21:21:15 +0000 | From | Chris Buchanan <> | Subject | Users unable to create file sockets as of 2.3.50 |
| |
The following code, when run as a non-root user, stopped working as of 2.3.50 (at least for me).
#include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/un.h>
int main(void) { struct sockaddr_un sock_struct = {AF_UNIX, "/tmp/blah.socket"}; int sd;
if ((sd = socket(PF_UNIX, SOCK_STREAM, 0)) == -1) { printf ("Failed to create socket\n"); return -1; }
unlink (sock_struct.sun_path); if (bind(sd, &sock_struct, SUN_LEN(&sock_struct))) { printf ("Failed to bind to socket\n"); return -1; }
printf ("All successful\n"); unlink (sock_struct.sun_path);
return 0; } -- Chris Buchanan Intermediate Software Developer Navtech Inc., Waterloo, Ontario, Canada
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |