comparison mgw/ctrl_sock.c @ 35:db7ed6a55ba4

themwi-{mgw,mncc}: chmod connection-accepting sockets to 775 I am making this change in order to be able to run themwi-test-mtc as my regular user, without having to su or sudo to gsmserv.
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 09 Jul 2022 23:29:54 -0800
parents b3f74df7b808
children f280328e7e2e
comparison
equal deleted inserted replaced
34:7dae2bae56a1 35:db7ed6a55ba4
2 * In this module we implement the logic of listening on the 2 * In this module we implement the logic of listening on the
3 * TMGW control socket and accepting control connections. 3 * TMGW control socket and accepting control connections.
4 */ 4 */
5 5
6 #include <sys/types.h> 6 #include <sys/types.h>
7 #include <sys/stat.h>
7 #include <sys/socket.h> 8 #include <sys/socket.h>
8 #include <sys/un.h> 9 #include <sys/un.h>
9 #include <netinet/in.h> 10 #include <netinet/in.h>
10 #include <stdio.h> 11 #include <stdio.h>
11 #include <stdlib.h> 12 #include <stdlib.h>
69 rc = listen(fd, 3); 70 rc = listen(fd, 3);
70 if (rc < 0) { 71 if (rc < 0) {
71 syslog(LOG_CRIT, "listen on UNIX socket: %m"); 72 syslog(LOG_CRIT, "listen on UNIX socket: %m");
72 return(-1); 73 return(-1);
73 } 74 }
75 chmod(ctrl_socket_pathname, 0775);
74 update_max_fd(fd); 76 update_max_fd(fd);
75 FD_SET(fd, &select_for_read); 77 FD_SET(fd, &select_for_read);
76 select_handlers[fd] = ctrlsock_accept_handler; 78 select_handlers[fd] = ctrlsock_accept_handler;
77 return(0); 79 return(0);
78 } 80 }