1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-30 17:49:30 +03:00

samba-gpupdate: Change machine option to target

On a Windows client, you designate machine/user
apply with a 'target' parameter. This change
makes gpupdate work more like that command.

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jul  4 13:23:09 CEST 2018 on sn-devel-144
This commit is contained in:
David Mulder
2018-05-07 09:48:32 -06:00
committed by Andrew Bartlett
parent c8621948f6
commit a958dc35bb
4 changed files with 9 additions and 6 deletions

View File

@ -641,7 +641,7 @@ sub provision_raw_step1($$)
rndc command = true rndc command = true
dns update command = $ctx->{samba_dnsupdate} dns update command = $ctx->{samba_dnsupdate}
spn update command = $ENV{SRCDIR_ABS}/source4/scripting/bin/samba_spnupdate -s $ctx->{smb_conf} spn update command = $ENV{SRCDIR_ABS}/source4/scripting/bin/samba_spnupdate -s $ctx->{smb_conf}
gpo update command = $ENV{SRCDIR_ABS}/source4/scripting/bin/samba-gpupdate -s $ctx->{smb_conf} -H $ctx->{privatedir}/sam.ldb --machine gpo update command = $ENV{SRCDIR_ABS}/source4/scripting/bin/samba-gpupdate -s $ctx->{smb_conf} -H $ctx->{privatedir}/sam.ldb --target=Computer
dreplsrv:periodic_startup_interval = 0 dreplsrv:periodic_startup_interval = 0
dsdb:schema update allowed = yes dsdb:schema update allowed = yes

View File

@ -62,7 +62,7 @@ static void gpupdate_callback(struct tevent_context *ev,
gpupdate_cmd, gpupdate_cmd,
"-s", "-s",
smbconf, smbconf,
"--machine", "--target=Computer",
"--machine-pass", "--machine-pass",
NULL); NULL);
if (req == NULL) { if (req == NULL) {

View File

@ -49,8 +49,8 @@ if __name__ == "__main__":
parser.add_option('-H', '--url', dest='url', help='URL for the samdb') parser.add_option('-H', '--url', dest='url', help='URL for the samdb')
parser.add_option('-X', '--unapply', help='Unapply Group Policy', parser.add_option('-X', '--unapply', help='Unapply Group Policy',
action='store_true') action='store_true')
parser.add_option('-M', '--machine', help='Apply machine policy', parser.add_option('--target', default='Computer', help='{Computer | User}',
action='store_true', default=False) choices=['Computer', 'User'])
parser.add_option_group(credopts) parser.add_option_group(credopts)
# Set the options and the arguments # Set the options and the arguments
@ -85,10 +85,10 @@ if __name__ == "__main__":
store = GPOStorage(os.path.join(cache_dir, 'gpo.tdb')) store = GPOStorage(os.path.join(cache_dir, 'gpo.tdb'))
gp_extensions = [] gp_extensions = []
if opts.machine: if opts.target == 'Computer':
if lp.get('server role') == 'active directory domain controller': if lp.get('server role') == 'active directory domain controller':
gp_extensions.append(gp_sec_ext(logger)) gp_extensions.append(gp_sec_ext(logger))
else: elif opts.target == 'User':
pass # User extensions pass # User extensions
# Get a live instance of Samba # Get a live instance of Samba

View File

@ -59,6 +59,9 @@
<para><option>-X</option>, <option>--unapply</option> <para><option>-X</option>, <option>--unapply</option>
Unapply Group Policy</para> Unapply Group Policy</para>
<para><option>--target</option>
{Computer | User}</para>
<para>Samba Common Options:</para> <para>Samba Common Options:</para>
<para><option>-s </option>FILE, <option>--configfile</option>=<emphasis remap="I">FILE</emphasis> <para><option>-s </option>FILE, <option>--configfile</option>=<emphasis remap="I">FILE</emphasis>