[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Thu Oct 17 09:22:03 UTC 2019


The branch, master has been updated
       via  aacbd383b9e samba-tool: Update 'samba-tool gpo list <>' description
       via  6bd2f0e9c4d docs: modifies 'net ads dns gethostbyname -h' Changes server to nameserver and name to hostname.
       via  dd43bb96fda docs: Add 'ads dns command' text in man net
      from  aed4d063767 libcli smb smb1cli_trans: fix ubsan warning

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit aacbd383b9e843b5d36b91ef75f6f2d2724a438b
Author: Amit Kumar <amitkuma at redhat.com>
Date:   Fri Jun 28 04:51:57 2019 +0530

    samba-tool: Update 'samba-tool gpo list <>' description
    
    We have a command to get gpo listing from Active Directory.
    samba-tool gpo list <username>
    
    This command can list GPOs for both username and machinename,
    But command help only shows 'username'.
    
    This PR
    - Updates the option presented in help.
    - Updates name of variable used to retrieve GPO so that it's
     not misleading if someone reads code later on
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14016
    
    Signed-off-by: Amit Kumar <amitkuma at redhat.com>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Thu Oct 17 09:21:20 UTC 2019 on sn-devel-184

commit 6bd2f0e9c4da1cad10a778da0c86e14d69ad5036
Author: Amit Kumar <amitkuma at redhat.com>
Date:   Fri Sep 27 01:42:20 2019 -0500

    docs: modifies 'net ads dns gethostbyname -h' Changes server to nameserver and name to hostname.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14009
    
    Signed-off-by: Amit Kumar amitkuma at redhat.com
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>

commit dd43bb96fda3c030662b810fd82bafb03ac93aa2
Author: Amit Kumar <amitkuma at redhat.com>
Date:   Wed Jun 26 01:18:52 2019 +0530

    docs: Add 'ads dns command' text in man net
    
    This change adds contents to man net for 'ads dns' command set.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14009
    
    Signed-off-by: Amit Kumar <amitkuma at redhat.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Alexander Bokovoy <ab at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/manpages/net.8.xml | 21 +++++++++++++++++++++
 python/samba/netcmd/gpo.py  | 14 +++++++-------
 source3/utils/net_ads.c     |  4 ++--
 3 files changed, 30 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/net.8.xml b/docs-xml/manpages/net.8.xml
index e585f247728..37dd30b7864 100644
--- a/docs-xml/manpages/net.8.xml
+++ b/docs-xml/manpages/net.8.xml
@@ -1374,6 +1374,27 @@ against an NT4 Domain Controller.
 
 </refsect2>
 
+<refsect2>
+
+<title>ADS DNS</title>
+
+<refsect3>
+<title>ADS DNS REGISTER [HOSTNAME [IP [IP.....]]]</title>
+<para>Add host dns entry to Active Directory.</para>
+</refsect3>
+
+<refsect3>
+<title>ADS DNS UNREGISTER <HOSTNAME></title>
+<para>Remove host dns entry from Active Directory.</para>
+</refsect3>
+
+<refsect3>
+<title>ADS DNS GETHOSTBYNAME <NAMESERVER|HOSTNAME></title>
+<para>Look up the hostname from Active Directory. You can either provide nameserver ie IPv4|IPv6 address or the hostname. Only one should be provided at a time.</para>
+</refsect3>
+
+</refsect2>
+
 <refsect2>
 <title>ADS LEAVE [--keep-account]</title>
 
diff --git a/python/samba/netcmd/gpo.py b/python/samba/netcmd/gpo.py
index 047f91951e8..106c5cf2d56 100644
--- a/python/samba/netcmd/gpo.py
+++ b/python/samba/netcmd/gpo.py
@@ -478,9 +478,9 @@ class cmd_listall(GPOCommand):
 class cmd_list(GPOCommand):
     """List GPOs for an account."""
 
-    synopsis = "%prog <username> [options]"
+    synopsis = "%prog <username|machinename> [options]"
 
-    takes_args = ['username']
+    takes_args = ['accountname']
     takes_optiongroups = {
         "sambaopts": options.SambaOptions,
         "versionopts": options.VersionOptions,
@@ -492,7 +492,7 @@ class cmd_list(GPOCommand):
                type=str, metavar="URL", dest="H")
     ]
 
-    def run(self, username, H=None, sambaopts=None, credopts=None, versionopts=None):
+    def run(self, accountname, H=None, sambaopts=None, credopts=None, versionopts=None):
 
         self.lp = sambaopts.get_loadparm()
         self.creds = credopts.get_credentials(self.lp, fallback_machine=True)
@@ -503,17 +503,17 @@ class cmd_list(GPOCommand):
 
         try:
             msg = self.samdb.search(expression='(&(|(samAccountName=%s)(samAccountName=%s$))(objectClass=User))' %
-                                    (ldb.binary_encode(username), ldb.binary_encode(username)))
+                                    (ldb.binary_encode(accountname), ldb.binary_encode(accountname)))
             user_dn = msg[0].dn
         except Exception:
-            raise CommandError("Failed to find account %s" % username)
+            raise CommandError("Failed to find account %s" % accountname)
 
         # check if its a computer account
         try:
             msg = self.samdb.search(base=user_dn, scope=ldb.SCOPE_BASE, attrs=['objectClass'])[0]
             is_computer = 'computer' in msg['objectClass']
         except Exception:
-            raise CommandError("Failed to find objectClass for user %s" % username)
+            raise CommandError("Failed to find objectClass for %s" % accountname)
 
         session_info_flags = (AUTH_SESSION_INFO_DEFAULT_GROUPS |
                               AUTH_SESSION_INFO_AUTHENTICATED)
@@ -587,7 +587,7 @@ class cmd_list(GPOCommand):
         else:
             msg_str = 'user'
 
-        self.outf.write("GPOs for %s %s\n" % (msg_str, username))
+        self.outf.write("GPOs for %s %s\n" % (msg_str, accountname))
         for g in gpos:
             self.outf.write("    %s %s\n" % (g[0], g[1]))
 
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index b7b221ddafa..95a6ed74b78 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -2197,8 +2197,8 @@ static int net_ads_dns_gethostbyname(struct net_context *c, int argc, const char
 			 _("Usage:"),
 			 _("net ads dns gethostbyname <server> <name>\n"),
 			 _("  Look up hostname from the AD\n"
-			   "    server\tName server to use\n"
-			   "    name\tName to look up\n"));
+			   "    nameserver\tName server to use\n"
+			   "    hostname\tName to look up\n"));
 		return -1;
 	}
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list