samba-gpupdate: Change machine option to target
authorDavid Mulder <dmulder@suse.com>
Mon, 7 May 2018 15:48:32 +0000 (09:48 -0600)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 4 Jul 2018 11:23:09 +0000 (13:23 +0200)
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

selftest/target/Samba4.pm
source3/winbindd/winbindd_gpupdate.c
source4/scripting/bin/samba-gpupdate
source4/scripting/man/samba-gpupdate.8.xml

index 2d887e183bcb4ddbb43cc14ac644cf4fc9ed183d..58fbe27e6fe4fd48c02c2084b6b02e5648dc42b2 100755 (executable)
@@ -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
 
index c86c007be12e280d7afecb54b123757724ddc9af..75772ea4feb89ac43a149dabfcaf03e332367fc5 100644 (file)
@@ -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) {
index 1a95d03c8adace893c54481addbf544ae93bf6b2..647acd9ada15368e7a6b551546baaa9a22ed47a7 100755 (executable)
@@ -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
index 23b191c21b9f9cee286d7cb85b2952ffa2ed0e39..95f17bdd93616be12075a3c49bfd59e482aba128 100644 (file)
@@ -59,6 +59,9 @@
 <para><option>-X</option>, <option>--unapply</option>
        Unapply Group Policy</para>
 
+<para><option>--target</option>
+       {Computer | User}</para>
+
 <para>Samba Common Options:</para>
 
 <para><option>-s </option>FILE, <option>--configfile</option>=<emphasis remap="I">FILE</emphasis>