]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
samba-tool gpo: clean up tmpdir after create
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 24 Mar 2022 05:39:55 +0000 (18:39 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Sat, 6 Aug 2022 01:42:09 +0000 (01:42 +0000)
'fetch' and 'backup' might also leave files in /tmp, but in those cases
we want the files.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15006

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: David Mulder <dmulder@suse.com>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Sat Aug  6 01:42:09 UTC 2022 on sn-devel-184

python/samba/netcmd/gpo.py

index 3b21dc6128c6559ab9a0bc86192df006ba1f8564..fe8afa7d9a0d3ffba8ade4b75127a1792040b921 100644 (file)
@@ -1296,6 +1296,10 @@ class cmd_create(GPOCommand):
         else:
             self.samdb.transaction_commit()
 
+        if tmpdir is None:
+            # Without --tmpdir, we created one in /tmp/. It must go.
+            shutil.rmtree(self.tmpdir)
+
         self.outf.write("GPO '%s' created as %s\n" % (displayname, gpo))