comparison mncc/mtsock.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 660126bd5f59
children
comparison
equal deleted inserted replaced
34:7dae2bae56a1 35:db7ed6a55ba4
3 * to which other ThemWi system sw components connect 3 * to which other ThemWi system sw components connect
4 * in order to send MT calls toward the GSM network. 4 * in order to send MT calls toward the GSM network.
5 */ 5 */
6 6
7 #include <sys/types.h> 7 #include <sys/types.h>
8 #include <sys/stat.h>
8 #include <sys/socket.h> 9 #include <sys/socket.h>
9 #include <sys/un.h> 10 #include <sys/un.h>
10 #include <stdio.h> 11 #include <stdio.h>
11 #include <stdint.h> 12 #include <stdint.h>
12 #include <stdlib.h> 13 #include <stdlib.h>
13 #include <string.h> 14 #include <string.h>
14 #include <strings.h> 15 #include <strings.h>
15 #include <syslog.h> 16 #include <syslog.h>
17 #include <unistd.h>
16 #include "../include/mncc.h" 18 #include "../include/mncc.h"
17 #include "struct.h" 19 #include "struct.h"
18 20
19 static char mtcall_socket_pathname[] = "/var/gsm/mtcall_socket"; 21 static char mtcall_socket_pathname[] = "/var/gsm/mtcall_socket";
20 22
42 rc = listen(mtcall_listener, 3); 44 rc = listen(mtcall_listener, 3);
43 if (rc < 0) { 45 if (rc < 0) {
44 syslog(LOG_CRIT, "listen on UNIX socket: %m"); 46 syslog(LOG_CRIT, "listen on UNIX socket: %m");
45 return(-1); 47 return(-1);
46 } 48 }
49 chmod(mtcall_socket_pathname, 0775);
47 update_max_fd(mtcall_listener); 50 update_max_fd(mtcall_listener);
48 return(0); 51 return(0);
49 } 52 }
50 53
51 void 54 void