summaryrefslogtreecommitdiff
path: root/rhnop-server
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2011-03-30 13:03:03 (GMT)
committerChristian Pointner <equinox@helsinki.at>2011-03-30 13:03:03 (GMT)
commit5afb26bcce943bfaf40bbdc59251f152aa8602c1 (patch)
tree764839ea66cec348e45d12f9ec075b9d3cc9da61 /rhnop-server
parent6035ed149c9f8fa272a92a65ca20bab06c474b2a (diff)
fixed permission problems with posix message queues
Diffstat (limited to 'rhnop-server')
-rw-r--r--rhnop-server/debian/control2
-rwxr-xr-xrhnop-server/debian/rules2
-rwxr-xr-xrhnop-server/noprml4
-rw-r--r--rhnop-server/qlistener.lua4
4 files changed, 8 insertions, 4 deletions
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)