The branch, v3-6-test has been updated via 330d16f Improve documentation for net rpc trust from 91447e8 s3: Use the correct guest_login field in auth_server
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log ----------------------------------------------------------------- commit 330d16f39097208c807526ccdc4ff7ab4e7d9c48 Author: Sumit Bose <sb...@redhat.com> Date: Mon May 30 11:14:47 2011 +0200 Improve documentation for net rpc trust Add man pages entries and fix usage output. Signed-off-by: Günther Deschner <g...@samba.org> Autobuild-User: Günther Deschner <g...@samba.org> Autobuild-Date: Mon May 30 20:05:34 CEST 2011 on sn-devel-104 (cherry picked from commit e10f27d5759b2d21c82fdb20f5641e1f6feab158) ----------------------------------------------------------------------- Summary of changes: docs-xml/manpages-3/net.8.xml | 120 +++++++++++++++++++++++++++++++++++++++++ source3/utils/net_rpc_trust.c | 29 ++++++----- 2 files changed, 136 insertions(+), 13 deletions(-) Changeset truncated at 500 lines: diff --git a/docs-xml/manpages-3/net.8.xml b/docs-xml/manpages-3/net.8.xml index d69a3b7..18c74ef 100644 --- a/docs-xml/manpages-3/net.8.xml +++ b/docs-xml/manpages-3/net.8.xml @@ -795,7 +795,127 @@ appear in your system. <para>List all interdomain trust relationships.</para> </refsect3> +<refsect3> +<title>RPC TRUSTDOM LIST</title> + +<para>List all interdomain trust relationships.</para> + +</refsect3> +</refsect2> + +<refsect2> +<title>RPC TRUST</title> + +<refsect3> +<title>RPC TRUST CREATE</title> + +<para>Create a trust trust object by calling lsaCreateTrustedDomainEx2. +The can be done on a single server or on two servers at once with the +possibility to use a random trust password.</para> + +<variablelist><title>Options:</title> +<varlistentry> +<term>otherserver</term> +<listitem><para>Domain controller of the second domain</para></listitem> +</varlistentry> + +<varlistentry> +<term>otheruser</term> +<listitem><para>Admin user in the second domain</para></listitem> +</varlistentry> + +<varlistentry> +<term>otherdomainsid</term> +<listitem><para>SID of the second domain</para></listitem> +</varlistentry> + +<varlistentry> +<term>other_netbios_domain</term> +<listitem><para>NetBIOS (short) name of the second domain</para></listitem> +</varlistentry> + +<varlistentry> +<term>otherdomain</term> +<listitem><para>DNS (full) name of the second domain</para></listitem> +</varlistentry> + +<varlistentry> +<term>trustpw</term> +<listitem><para>Trust password</para></listitem> +</varlistentry> +</variablelist> +<variablelist><title>Examples:</title> +<varlistentry> +<term>Create a trust object on srv1.dom1.dom for the domain dom2</term> +<listitem><literallayout> +net rpc trust create \ + otherdomainsid=S-x-x-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx \ + other_netbios_domain=dom2 \ + otherdomain=dom2.dom \ + trustpw=12345678 \ + -S srv1.dom1.dom +</literallayout></listitem> +</varlistentry> +<varlistentry> +<term>Create a trust relationship between dom1 and dom2</term> +<listitem><literallayout> +net rpc trust create \ + otherserver=srv2.dom2.test \ + otheruser=dom2adm \ + -S srv1.dom1.dom +</literallayout></listitem> +</varlistentry> +</variablelist> +</refsect3> + +<refsect3> +<title>RPC TRUST DELETE</title> + +<para>Delete a trust trust object by calling lsaDeleteTrustedDomain. +The can be done on a single server or on two servers at once.</para> + +<variablelist><title>Options:</title> +<varlistentry> +<term>otherserver</term> +<listitem><para>Domain controller of the second domain</para></listitem> +</varlistentry> + +<varlistentry> +<term>otheruser</term> +<listitem><para>Admin user in the second domain</para></listitem> +</varlistentry> + +<varlistentry> +<term>otherdomainsid</term> +<listitem><para>SID of the second domain</para></listitem> +</varlistentry> +</variablelist> + +<variablelist><title>Examples:</title> +<varlistentry> +<term>Delete a trust object on srv1.dom1.dom for the domain dom2</term> +<listitem><literallayout> +net rpc trust delete \ + otherdomainsid=S-x-x-xx-xxxxxxxxxx-xxxxxxxxxx-xxxxxxxxx \ + -S srv1.dom1.dom +</literallayout></listitem> +</varlistentry> +<varlistentry> +<term>Delete a trust relationship between dom1 and dom2</term> +<listitem><literallayout> +net rpc trust delete \ + otherserver=srv2.dom2.test \ + otheruser=dom2adm \ + -S srv1.dom1.dom +</literallayout></listitem> +</varlistentry> +</variablelist> +</refsect3> + +</refsect2> + +<refsect2> <refsect3> <title>RPC RIGHTS</title> diff --git a/source3/utils/net_rpc_trust.c b/source3/utils/net_rpc_trust.c index eee68d0..b099d52 100644 --- a/source3/utils/net_rpc_trust.c +++ b/source3/utils/net_rpc_trust.c @@ -419,19 +419,22 @@ static int rpc_trust_common(struct net_context *net_ctx, int argc, struct other_dom_data *other_dom_data; struct net_context *other_net_ctx = NULL; struct dom_data dom_data[2]; + void (*usage)(void); + + switch (op) { + case TRUST_CREATE: + usage = print_trust_usage; + break; + case TRUST_DELETE: + usage = print_trust_delete_usage; + break; + default: + DEBUG(0, ("Unsupported trust operation.\n")); + return -1; + } if (net_ctx->display_usage) { - switch (op) { - case TRUST_CREATE: - print_trust_usage(); - break; - case TRUST_DELETE: - print_trust_delete_usage(); - break; - default: - DEBUG(0, ("Unsupported trust operation.\n")); - return -1; - } + usage(); return 0; } @@ -444,7 +447,7 @@ static int rpc_trust_common(struct net_context *net_ctx, int argc, ret = parse_trust_args(mem_ctx, argc, argv, &other_dom_data, &trust_pw); if (ret != 0) { if (ret == EINVAL) { - print_trust_usage(); + usage(); } else { DEBUG(0, ("Failed to parse arguments.\n")); } @@ -471,7 +474,7 @@ static int rpc_trust_common(struct net_context *net_ctx, int argc, (dom_data[1].domain_name == NULL || dom_data[1].dns_domain_name == NULL))) { DEBUG(0, ("Missing required argument.\n")); - print_trust_usage(); + usage(); goto done; } } -- Samba Shared Repository