changeset 6743:d659cfa8439c

Make roundup-server EACCES errors clearer If roundup-server is run on a priv port without privs (i.e. non root) it just returns: [Errno 13] Permission denied make this case clearer by reporting: Unable to bind to port 70, access not allowed, errno: 13 Permission denied so it points to the port bind operation as failing.
author John Rouillard <rouilj@ieee.org>
date Thu, 30 Jun 2022 16:26:53 -0400
parents dcf34cc31438
children 13abb143df48
files roundup/scripts/roundup_server.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/scripts/roundup_server.py	Wed Jun 29 15:40:49 2022 -0400
+++ b/roundup/scripts/roundup_server.py	Thu Jun 30 16:26:53 2022 -0400
@@ -792,6 +792,15 @@
             if e.args[0] == errno.EADDRINUSE:
                 raise socket.error(_("Unable to bind to port %s, "
                                      "port already in use.") % self["PORT"])
+            if e.args[0] == errno.EACCES:
+                raise socket.error(_("Unable to bind to port %(port)s, "
+                                     "access not allowed, "
+                                     "errno: %(errno)s %(msg)s" % {
+                                         "port": self["PORT"],
+                                         "errno": e.args[0],
+                                         "msg": e.args[1] }
+                ))
+                                     
             raise
         # change user and/or group
         setgid(self["GROUP"])

Roundup Issue Tracker: http://roundup-tracker.org/