]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samba-tool: Fix for inability to delete GPOs containing GPWL policies
authorKacper Boström <kacper@kacper.se>
Tue, 10 Sep 2024 16:40:24 +0000 (18:40 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 24 Sep 2024 17:11:52 +0000 (17:11 +0000)
GPOs containing GPWL (Wireless/Wired Protocol Extension) policies could not be deleted with samba-tool
as those policies were stored as subentries of the GPO and only the main root was deleted.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15387
RN: Fix for inability to delete GPOs containing GPWL policies using samba-tool

Signed-off-by: Kacper Boström <kacper@kacper.se>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Sep 24 17:11:53 UTC 2024 on atb-devel-224

python/samba/netcmd/gpo.py

index ba55b2ec7a772224c0679032894c982a2fca56a2..96fce917f0f80d06a31127a9ea22983515bdf577 100644 (file)
@@ -1770,8 +1770,8 @@ class cmd_del(GPOCommand):
 
             # Remove LDAP entries
             gpo_dn = get_gpo_dn(self.samdb, gpo)
-            self.samdb.delete(ldb.Dn(self.samdb, "CN=User,%s" % str(gpo_dn)))
-            self.samdb.delete(ldb.Dn(self.samdb, "CN=Machine,%s" % str(gpo_dn)))
+            self.samdb.delete(ldb.Dn(self.samdb, "CN=User,%s" % str(gpo_dn)), ["tree_delete:1"])
+            self.samdb.delete(ldb.Dn(self.samdb, "CN=Machine,%s" % str(gpo_dn)), ["tree_delete:1"])
             self.samdb.delete(gpo_dn)
 
             # Remove GPO files