From 44ee31c0258b0afb3d3f2ce17942cc86e308a690 Mon Sep 17 00:00:00 2001 From: Aleksandr Sharov Date: Fri, 4 Jul 2025 15:32:28 +0200 Subject: [PATCH] Add check for the GPO link to have at least two attributes separated by semicolumn. Allows to handle empty links. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15877 RN: Fix handling of empty GPO link Singed-off-by: Alex Sharov (kororland@gmail.com) Reviewed-by: Douglas Bagnall Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Thu Jul 10 18:55:33 UTC 2025 on atb-devel-224 --- python/samba/gp/gpclass.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/samba/gp/gpclass.py b/python/samba/gp/gpclass.py index d86aacec138..07b4fb3e7bd 100644 --- a/python/samba/gp/gpclass.py +++ b/python/samba/gp/gpclass.py @@ -673,8 +673,10 @@ class GP_LINK: self.gp_opts = int(gPOptions) def gpo_parse_gplink(self, gPLink): + # normally formed link looks like [LDAP://host/path;options] + # empty link looks like [ ] for p in gPLink.decode().split(']'): - if not p: + if not p or ';' not in p: continue log.debug('gpo_parse_gplink: processing link') p = p.lstrip('[') -- 2.39.5