010-Run-as-user-group-radicale-radicale.patch 679 B

123456789101112131415161718192021222324252627282930
  1. Subject: [PATCH] Run as user radicale and group radicale
  2. Patch to run Radicale service as radicale:radicale non root user
  3. Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
  4. ---
  5. bin/radicale | 7 +++++++
  6. 1 file changed, 7 insertions(+)
  7. diff --git a/bin/radicale b/bin/radicale
  8. index 619aca5..7466020 100755
  9. --- a/bin/radicale
  10. +++ b/bin/radicale
  11. @@ -26,6 +26,13 @@ Launch the server according to configuration and command-line options.
  12. """
  13. +# inserted to run as user radicale
  14. +import pwd, grp, os
  15. +uid = pwd.getpwnam('radicale').pw_uid
  16. +gid = grp.getgrnam('radicale').gr_gid
  17. +os.setegid(gid)
  18. +os.seteuid(uid)
  19. +
  20. import radicale.__main__
  21. --
  22. 2.1.0