]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
gp: get_gpo() should re-raise the Exception, not return
authorDavid Mulder <dmulder@samba.org>
Fri, 28 Apr 2023 13:37:31 +0000 (07:37 -0600)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 9 May 2023 01:59:32 +0000 (01:59 +0000)
If we return from this failure, then `new_gpo` is
set to `None` and we will fail in some obscure
way within a CSE later (since we append `None` to
the GPO list). Instead, re-raise the Exception so
we see that an error happened when fetching the
GPO.

Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/gp/gpclass.py

index 4992f17eeac40ecdbd375d5ca08532ce9c97b312..6083a0f8029dfb1dacdd2172b17c8ac5dc569aa8 100644 (file)
@@ -618,7 +618,7 @@ def get_gpo(samdb, gpo_dn):
                            controls=['sd_flags:1:%d' % sd_flags])
     except Exception:
         log.error('Failed to fetch gpo object with nTSecurityDescriptor')
-        return
+        raise
     if res.count != 1:
         raise ldb.LdbError(ldb.ERR_NO_SUCH_OBJECT,
                            'get_gpo: search failed')