From: David Mulder Date: Mon, 7 May 2018 15:48:32 +0000 (-0600) Subject: samba-gpupdate: Change machine option to target X-Git-Tag: tevent-0.9.37~138 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a958dc35bbeea61fa1344a10602e7d40c8339764;p=thirdparty%2Fsamba.git 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 Reviewed-by: Andreas Schneider Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Wed Jul 4 13:23:09 CEST 2018 on sn-devel-144 --- diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 2d887e183bc..58fbe27e6fe 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -641,7 +641,7 @@ sub provision_raw_step1($$) rndc command = true dns update command = $ctx->{samba_dnsupdate} 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 dsdb:schema update allowed = yes diff --git a/source3/winbindd/winbindd_gpupdate.c b/source3/winbindd/winbindd_gpupdate.c index c86c007be12..75772ea4feb 100644 --- a/source3/winbindd/winbindd_gpupdate.c +++ b/source3/winbindd/winbindd_gpupdate.c @@ -62,7 +62,7 @@ static void gpupdate_callback(struct tevent_context *ev, gpupdate_cmd, "-s", smbconf, - "--machine", + "--target=Computer", "--machine-pass", NULL); if (req == NULL) { diff --git a/source4/scripting/bin/samba-gpupdate b/source4/scripting/bin/samba-gpupdate index 1a95d03c8ad..647acd9ada1 100755 --- a/source4/scripting/bin/samba-gpupdate +++ b/source4/scripting/bin/samba-gpupdate @@ -49,8 +49,8 @@ if __name__ == "__main__": parser.add_option('-H', '--url', dest='url', help='URL for the samdb') parser.add_option('-X', '--unapply', help='Unapply Group Policy', action='store_true') - parser.add_option('-M', '--machine', help='Apply machine policy', - action='store_true', default=False) + parser.add_option('--target', default='Computer', help='{Computer | User}', + choices=['Computer', 'User']) parser.add_option_group(credopts) # Set the options and the arguments @@ -85,10 +85,10 @@ if __name__ == "__main__": store = GPOStorage(os.path.join(cache_dir, 'gpo.tdb')) gp_extensions = [] - if opts.machine: + if opts.target == 'Computer': if lp.get('server role') == 'active directory domain controller': gp_extensions.append(gp_sec_ext(logger)) - else: + elif opts.target == 'User': pass # User extensions # Get a live instance of Samba diff --git a/source4/scripting/man/samba-gpupdate.8.xml b/source4/scripting/man/samba-gpupdate.8.xml index 23b191c21b9..95f17bdd936 100644 --- a/source4/scripting/man/samba-gpupdate.8.xml +++ b/source4/scripting/man/samba-gpupdate.8.xml @@ -59,6 +59,9 @@ , Unapply Group Policy + + {Computer | User} + Samba Common Options: FILE, =FILE