1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-19 12:23:49 +03:00

samba-tool: gpo load add Registry ext by default

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Tested-by: Kees van Vloten <keesvanvloten@gmail.com>
This commit is contained in:
David Mulder
2022-02-15 14:45:41 -07:00
committed by Andrew Bartlett
parent a345214712
commit e7737d6bb2
2 changed files with 25 additions and 3 deletions

View File

@@ -1583,6 +1583,20 @@ class GpoCmdTestCase(SambaToolCmdTest):
(os.environ["USERNAME"],
os.environ["PASSWORD"]))
self.assertCmdSuccess(result, out, err, 'Loading policy failed')
# Write the default registry extension
with NamedTemporaryFile() as f:
f.write(b'[]') # Intentionally empty policy
f.flush()
# Load an empty policy, taking the default client extension
(result, out, err) = self.runsubcmd("gpo", "load",
self.gpo_guid,
"--content=%s" % f.name,
"-H", "ldap://%s" %
os.environ["SERVER"],
"-U%s%%%s" %
(os.environ["USERNAME"],
os.environ["PASSWORD"]))
self.assertCmdSuccess(result, out, err, 'Loading policy failed')
(result, out, err) = self.runsubcmd("gpo", "show", self.gpo_guid, "-H",
"ldap://%s" % os.environ["SERVER"])
@@ -1591,6 +1605,8 @@ class GpoCmdTestCase(SambaToolCmdTest):
self.assertIn('samba.org', out, 'Homepage policy not loaded')
self.assertIn(ext_guids[0], out, 'Machine extension not loaded')
self.assertIn(ext_guids[1], out, 'User extension not loaded')
self.assertIn('{35378eac-683f-11d2-a89a-00c04fbbcfa2}', out,
'Default extension not loaded')
toolbar_data = '"valuename": "IEToolbar",\n "class": "USER",' + \
'\n "type": "REG_BINARY",' + \
'\n "data": [\n 0\n ]'