[projects/pld-builder.new] request_handler: reject notifications without the notify privilege

arekm arekm at pld-linux.org
Mon Oct 26 17:15:09 CET 2026


commit 4305e7cc3cfb30ed72af6cc4c0547dec18235906
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Oct 24 11:03:14 2026 +0200

    request_handler: reject notifications without the notify privilege
    
    A missing notify:<builder> privilege was only logged, so any acl user
    could mark batches as built.

 PLD_Builder/request_handler.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/PLD_Builder/request_handler.py b/PLD_Builder/request_handler.py
index 7f91f51..8a3381d 100644
--- a/PLD_Builder/request_handler.py
+++ b/PLD_Builder/request_handler.py
@@ -145,7 +145,9 @@ def handle_group(r, user):
 
 def handle_notification(r, user):
     if not user.can_do("notify", r.builder):
+        # fail the request: the sender keeps retrying and mails about it
         log.alert("user %s is not allowed to notify:%s" % (user.login, r.builder))
+        return False
     q = B_Queue(path.req_queue_file)
     q.lock(0)
     q.read()
@@ -170,6 +172,7 @@ def handle_notification(r, user):
     q.dump_html(path.queue_html_stats_file)
     q.write_signed(path.req_queue_signed_file)
     q.unlock()
+    return True
 
 def handle_request(req, filename = None):
     if req == '':
@@ -190,10 +193,11 @@ def handle_request(req, filename = None):
     acl.set_current_user(user)
     status.push("request from %s" % user.login)
     r = request.parse_request(body)
+    ok = True
     if r.kind == 'group':
         handle_group(r, user)
     elif r.kind == 'notification':
-        handle_notification(r, user)
+        ok = handle_notification(r, user)
     else:
         msg = "%s: don't know how to handle requests of this kind '%s'" \
                         % (user.get_login(), r.kind)
@@ -203,7 +207,7 @@ def handle_request(req, filename = None):
         m.write_line(msg)
         m.send()
     status.pop()
-    return True
+    return ok
 
 def handle_request_main(req, filename = None):
     acl.try_reload()
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/ce9feb3c796ed049b6dd260a50d94d80feb1656d



More information about the pld-cvs-commit mailing list