From 5afb26bcce943bfaf40bbdc59251f152aa8602c1 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 30 Mar 2011 13:03:03 +0000 Subject: fixed permission problems with posix message queues diff --git a/rhnop-server/debian/control b/rhnop-server/debian/control index eafbd92..2e99c2e 100644 --- a/rhnop-server/debian/control +++ b/rhnop-server/debian/control @@ -8,7 +8,7 @@ Homepage: http://www.helsinki.at/ Package: rhnop-server Architecture: any -Depends: ${shlibs:Depends}, adduser, liblua5.1-mq, liblua5.1-socket2, liblua5.1-sql-mysql-2 +Depends: ${shlibs:Depends}, adduser, liblua5.1-mq, liblua5.1-socket2, liblua5.1-sql-mysql-2, liblua5.1-posix1 Description: Radio Helsinki now playing information system - server The Radio Helsinki now playing information system gathers the now playing info into an mysql database for further processing. diff --git a/rhnop-server/debian/rules b/rhnop-server/debian/rules index 83983e1..d24a35f 100755 --- a/rhnop-server/debian/rules +++ b/rhnop-server/debian/rules @@ -26,7 +26,7 @@ clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp - $(MAKE) clean + $(MAKE) distclean dh_clean install: build diff --git a/rhnop-server/noprml b/rhnop-server/noprml index 31e8ab7..9c572b2 100755 --- a/rhnop-server/noprml +++ b/rhnop-server/noprml @@ -27,6 +27,7 @@ local queue_name = "/rhnop" +require "posix" mq = require "mq" -- reading timestamp (milliseconds since epoch) @@ -43,7 +44,8 @@ if #arg < 4 then end -- open message queue -local q, err = mq.create(queue_name, "wo") +posix.umask("rwxrwxr-x") +local q, err = mq.create(queue_name, "wo", "rw-rw----") if q == nil then io.stderr:write("creation of message queue failed: " .. err .. "\n") os.exit(1) diff --git a/rhnop-server/qlistener.lua b/rhnop-server/qlistener.lua index 4e96649..783db5e 100644 --- a/rhnop-server/qlistener.lua +++ b/rhnop-server/qlistener.lua @@ -21,6 +21,7 @@ local last_cart = nil +require "posix" mq = require "mq" package.path = package.path .. ";" .. rhnoplibdir .. "/?.lua" @@ -58,7 +59,8 @@ function handle_message(msg) end function main_loop() - local q, err = mq.create(conf.queue_name, "ro") + posix.umask("rwxrwxr-x") + local q, err = mq.create(conf.queue_name, "ro", "rw-rw----") if q == nil then io.stderr:write("creation of message queue failed: " .. err .. "\n") os.exit(1) -- cgit v0.10.2