diff 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
line wrap: on
line diff
--- 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);
 }