summaryrefslogtreecommitdiffstats
path: root/lcradmin.c
diff options
context:
space:
mode:
authorAndreas Eversberg2008-08-30 08:24:52 +0200
committerAndreas Eversberg2008-08-30 08:24:52 +0200
commitb1ab2b9ac1cfc15d2a8f5850145dd69043cc3ef7 (patch)
tree3c243a71fbb464557fe7b349dd0803bec0c33de3 /lcradmin.c
parentFix conversion string warnings, there are lot more like these. (diff)
downloadlcr-b1ab2b9ac1cfc15d2a8f5850145dd69043cc3ef7.tar.gz
lcr-b1ab2b9ac1cfc15d2a8f5850145dd69043cc3ef7.tar.xz
lcr-b1ab2b9ac1cfc15d2a8f5850145dd69043cc3ef7.zip
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
Diffstat (limited to 'lcradmin.c')
-rw-r--r--lcradmin.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lcradmin.c b/lcradmin.c
index 1df16c5..042a4b0 100644
--- a/lcradmin.c
+++ b/lcradmin.c
@@ -23,6 +23,7 @@
#include <errno.h>
#include <curses.h>
#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);