From b1ab2b9ac1cfc15d2a8f5850145dd69043cc3ef7 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sat, 30 Aug 2008 08:24:52 +0200 Subject: LCR now runs as a user. You may change the path of socket and lock files. LCR admin socket's flags can now be altered to allow access to other users. Lock and socket files will now be removed when terminating LCR. modified: Makefile modified: chan_lcr.c modified: default/options.conf modified: lcradmin.c modified: lcrsocket.h modified: main.c modified: options.c modified: options.h modified: socket_server.c --- lcradmin.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lcradmin.c') diff --git a/lcradmin.c b/lcradmin.c index 1df16c5..042a4b0 100644 --- a/lcradmin.c +++ b/lcradmin.c @@ -23,6 +23,7 @@ #include #include #include "macro.h" +#include "options.h" #include "join.h" #include "joinpbx.h" #include "extension.h" @@ -1630,7 +1631,6 @@ next: int main(int argc, char *argv[]) { int mode; - char *socket_name = SOCKET_NAME; int sock, conn; struct sockaddr_un sock_address; char *ret; @@ -1717,6 +1717,10 @@ int main(int argc, char *argv[]) goto usage; } + if (read_options() == 0) { + exit(EXIT_FAILURE); + } + //pipeagain: /* open socket */ if ((sock = socket(PF_UNIX, SOCK_STREAM, 0)) < 0) @@ -1725,8 +1729,8 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } memset(&sock_address, 0, sizeof(sock_address)); + SPRINT(sock_address.sun_path, SOCKET_NAME, options.lock); sock_address.sun_family = PF_UNIX; - UCPY(sock_address.sun_path, socket_name); if ((conn = connect(sock, (struct sockaddr *)&sock_address, SUN_LEN(&sock_address))) < 0) { close(sock); -- cgit v1.2.3-55-g7522