0
0
mirror of https://github.com/openwrt/packages.git synced 2025-03-15 02:08:36 +00:00
packages/net/radicale/patches/010-Run-as-user-group-radicale-radicale.patch
Ilya Lipnitskiy 5d8d4fbbcb treewide: Run refresh on all packages
The crude loop I wrote to come up with this changeset:

  find -L package/feeds/packages/ -name patches | \
  sed 's/patches$/refresh/' | sort | xargs make

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-02-20 16:02:15 -08:00

26 lines
567 B
Diff

Subject: [PATCH] Run as user radicale and group radicale
Patch to run Radicale service as radicale:radicale non root user
Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
---
bin/radicale | 7 +++++++
1 file changed, 7 insertions(+)
--- a/bin/radicale
+++ b/bin/radicale
@@ -26,6 +26,13 @@ Launch the server according to configura
"""
+# inserted to run as user radicale
+import pwd, grp, os
+uid = pwd.getpwnam('radicale').pw_uid
+gid = grp.getgrnam('radicale').gr_gid
+os.setegid(gid)
+os.seteuid(uid)
+
import radicale.__main__