Skip to content

Commit fff85e2

Browse files
committed
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.
1 parent 469c788 commit fff85e2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

roundup/scripts/roundup_server.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,15 @@ class ThreadingServer(socketserver.ThreadingMixIn,
792792
if e.args[0] == errno.EADDRINUSE:
793793
raise socket.error(_("Unable to bind to port %s, "
794794
"port already in use.") % self["PORT"])
795+
if e.args[0] == errno.EACCES:
796+
raise socket.error(_("Unable to bind to port %(port)s, "
797+
"access not allowed, "
798+
"errno: %(errno)s %(msg)s" % {
799+
"port": self["PORT"],
800+
"errno": e.args[0],
801+
"msg": e.args[1] }
802+
))
803+
795804
raise
796805
# change user and/or group
797806
setgid(self["GROUP"])

0 commit comments

Comments
 (0)