changeset 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 7dae2bae56a1
children e8e82a4bf12b
files mgw/ctrl_sock.c mncc/mtsock.c
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mgw/ctrl_sock.c	Sat Jul 09 23:17:15 2022 -0800
+++ b/mgw/ctrl_sock.c	Sat Jul 09 23:29:54 2022 -0800
@@ -4,6 +4,7 @@
  */
 
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <netinet/in.h>
@@ -71,6 +72,7 @@
 		syslog(LOG_CRIT, "listen on UNIX socket: %m");
 		return(-1);
 	}
+	chmod(ctrl_socket_pathname, 0775);
 	update_max_fd(fd);
 	FD_SET(fd, &select_for_read);
 	select_handlers[fd] = ctrlsock_accept_handler;
--- a/mncc/mtsock.c	Sat Jul 09 23:17:15 2022 -0800
+++ b/mncc/mtsock.c	Sat Jul 09 23:29:54 2022 -0800
@@ -5,6 +5,7 @@
  */
 
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <stdio.h>
@@ -13,6 +14,7 @@
 #include <string.h>
 #include <strings.h>
 #include <syslog.h>
+#include <unistd.h>
 #include "../include/mncc.h"
 #include "struct.h"
 
@@ -44,6 +46,7 @@
 		syslog(LOG_CRIT, "listen on UNIX socket: %m");
 		return(-1);
 	}
+	chmod(mtcall_socket_pathname, 0775);
 	update_max_fd(mtcall_listener);
 	return(0);
 }