From b73a05e4e184238614d73c1519f2880cd946908d Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Sat, 23 Oct 2010 19:27:26 -0700 Subject: [PATCH] s4 net: rename to samba-tool in order to not clash with s3 net Autobuild-User: Kai Blin Autobuild-Date: Thu Oct 28 07:25:16 UTC 2010 on sn-devel-104 --- selftest/target/Samba4.pm | 22 +-- .../net/drs/net_drs.c => samba_tool/drs/drs.c} | 14 +- .../net/drs/net_drs.h => samba_tool/drs/drs.h} | 8 +- .../net_drs_bind.c => samba_tool/drs/drs_bind.c} | 6 +- .../drs/net_drs_kcc.c => samba_tool/drs/drs_kcc.c} | 10 +- .../drs/drs_replicate.c} | 10 +- .../drs/drs_showrepl.c} | 10 +- source4/{utils/net/net_gpo.c => samba_tool/gpo.c} | 50 +++---- .../net/net_password.c => samba_tool/password.c} | 32 ++--- .../{utils/net/net.c => samba_tool/samba_tool.c} | 34 ++--- .../{utils/net/net.h => samba_tool/samba_tool.h} | 18 +-- .../net/net_vampire.c => samba_tool/vampire.c} | 34 ++--- source4/samba_tool/wscript_build | 17 +++ source4/selftest/skip | 2 +- source4/selftest/tests.py | 2 +- source4/setup/tests/blackbox_group.sh | 148 ++++++++++----------- source4/setup/tests/blackbox_newuser.sh | 84 ++++++------ source4/setup/tests/blackbox_setpassword.sh | 10 +- source4/setup/tests/blackbox_spn.sh | 66 ++++----- source4/torture/drs/python/delete_object.py | 8 +- source4/torture/drs/python/fsmo.py | 6 +- source4/utils/net/config.mk | 50 ------- source4/utils/net/wscript_build | 18 --- .../tests/{test_net.sh => test_samba_tool.sh} | 8 +- source4/wscript_build | 2 +- testprogs/blackbox/test_export_keytab.sh | 10 +- testprogs/blackbox/test_kinit.sh | 18 +-- testprogs/blackbox/test_ktpass.sh | 4 +- testprogs/blackbox/test_passwords.sh | 36 ++--- testprogs/blackbox/test_pkinit.sh | 4 +- 30 files changed, 345 insertions(+), 396 deletions(-) rename source4/{utils/net/drs/net_drs.c => samba_tool/drs/drs.c} (97%) rename source4/{utils/net/drs/net_drs.h => samba_tool/drs/drs.h} (94%) rename source4/{utils/net/drs/net_drs_bind.c => samba_tool/drs/drs_bind.c} (98%) rename source4/{utils/net/drs/net_drs_kcc.c => samba_tool/drs/drs_kcc.c} (96%) rename source4/{utils/net/drs/net_drs_replicate.c => samba_tool/drs/drs_replicate.c} (96%) rename source4/{utils/net/drs/net_drs_showrepl.c => samba_tool/drs/drs_showrepl.c} (98%) rename source4/{utils/net/net_gpo.c => samba_tool/gpo.c} (89%) rename source4/{utils/net/net_password.c => samba_tool/password.c} (92%) rename source4/{utils/net/net.c => samba_tool/samba_tool.c} (95%) rename source4/{utils/net/net.h => samba_tool/samba_tool.h} (83%) rename source4/{utils/net/net_vampire.c => samba_tool/vampire.c} (89%) create mode 100644 source4/samba_tool/wscript_build rewrite source4/setup/tests/blackbox_group.sh (83%) rewrite source4/setup/tests/blackbox_newuser.sh (69%) rewrite source4/setup/tests/blackbox_spn.sh (74%) delete mode 100644 source4/utils/net/config.mk delete mode 100644 source4/utils/net/wscript_build rename source4/utils/tests/{test_net.sh => test_samba_tool.sh} (70%) diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index ba96f08d0d1..168fe426203 100644 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -880,11 +880,11 @@ sub provision_member($$$) return undef; } - my $net = $self->bindir_path("net"); + my $samba_tool = $self->bindir_path("samba-tool"); my $cmd = ""; $cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$ret->{SOCKET_WRAPPER_DEFAULT_IFACE}\" "; $cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" "; - $cmd .= "$net join $ret->{CONFIGURATION} $dcvars->{REALM} member"; + $cmd .= "$samba_tool join $ret->{CONFIGURATION} $dcvars->{REALM} member"; $cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD}"; unless (system($cmd) == 0) { @@ -935,11 +935,11 @@ sub provision_rpc_proxy($$$) return undef; } - my $net = $self->bindir_path("net"); + my $samba_tool = $self->bindir_path("samba-tool"); my $cmd = ""; $cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$ret->{SOCKET_WRAPPER_DEFAULT_IFACE}\" "; $cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" "; - $cmd .= "$net join $ret->{CONFIGURATION} $dcvars->{REALM} member"; + $cmd .= "$samba_tool join $ret->{CONFIGURATION} $dcvars->{REALM} member"; $cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD}"; unless (system($cmd) == 0) { @@ -991,11 +991,11 @@ sub provision_vampire_dc($$$) return undef; } - my $net = $self->bindir_path("net"); + my $samba_tool = $self->bindir_path("samba-tool"); my $cmd = ""; $cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$ret->{SOCKET_WRAPPER_DEFAULT_IFACE}\" "; $cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" "; - $cmd .= "$net vampire $ret->{CONFIGURATION} $dcvars->{REALM} --realm=$dcvars->{REALM}"; + $cmd .= "$samba_tool vampire $ret->{CONFIGURATION} $dcvars->{REALM} --realm=$dcvars->{REALM}"; $cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD}"; unless (system($cmd) == 0) { @@ -1169,11 +1169,11 @@ sub provision_rodc($$$) return undef; } - my $net = $self->bindir_path("net"); + my $samba_tool = $self->bindir_path("samba-tool"); my $cmd = ""; $cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$ret->{SOCKET_WRAPPER_DEFAULT_IFACE}\" "; $cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" "; - $cmd .= "$net join $ret->{CONFIGURATION} $dcvars->{REALM} RODC"; + $cmd .= "$samba_tool join $ret->{CONFIGURATION} $dcvars->{REALM} RODC"; $cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD}"; $cmd .= " --server=$dcvars->{DC_SERVER}"; @@ -1461,11 +1461,11 @@ sub setup_vampire_dc($$$) # force replicated DC to update repsTo/repsFrom # for vampired partitions - my $net = $self->bindir_path("net"); + my $samba_tool = $self->bindir_path("samba-tool"); my $cmd = ""; $cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\""; $cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\""; - $cmd .= " $net drs kcc $env->{DC_SERVER}"; + $cmd .= " $samba_tool drs kcc $env->{DC_SERVER}"; $cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}"; unless (system($cmd) == 0) { warn("Failed to exec kcc\n$cmd"); @@ -1477,7 +1477,7 @@ sub setup_vampire_dc($$$) my $base_dn = "DC=".join(",DC=", split(/\./, $dc_vars->{REALM})); $cmd = "SOCKET_WRAPPER_DEFAULT_IFACE=\"$env->{SOCKET_WRAPPER_DEFAULT_IFACE}\""; $cmd .= " KRB5_CONFIG=\"$env->{KRB5_CONFIG}\""; - $cmd .= " $net drs replicate $env->{DC_SERVER} $env->{VAMPIRE_DC_SERVER}"; + $cmd .= " $samba_tool drs replicate $env->{DC_SERVER} $env->{VAMPIRE_DC_SERVER}"; $cmd .= " -U$dc_vars->{DC_USERNAME}\%$dc_vars->{DC_PASSWORD}"; # replicate Configuration NC my $cmd_repl = "$cmd \"CN=Configuration,$base_dn\""; diff --git a/source4/utils/net/drs/net_drs.c b/source4/samba_tool/drs/drs.c similarity index 97% rename from source4/utils/net/drs/net_drs.c rename to source4/samba_tool/drs/drs.c index 578b6f2fc30..78f8c144c28 100644 --- a/source4/utils/net/drs/net_drs.c +++ b/source4/samba_tool/drs/drs.c @@ -20,16 +20,16 @@ */ #include "includes.h" -#include "utils/net/net.h" +#include "samba_tool/samba_tool.h" #include "librpc/gen_ndr/ndr_drsuapi_c.h" -#include "utils/net/drs/net_drs.h" +#include "samba_tool/drs/drs.h" #include "lib/ldb/include/ldb.h" #include "ldb_wrap.h" #include "system/filesys.h" /** - * 'net drs' supported sub-commands + * 'samba-tool drs' supported sub-commands */ static const struct net_functable net_drs_functable[] = { { "bind", "Display replication features for a domain controller\n", net_drs_bind_cmd, net_drs_bind_usage }, @@ -43,7 +43,7 @@ static const struct net_functable net_drs_functable[] = { }; /** - * 'net drs' entry point + * 'samba-tool drs' entry point */ int net_drs(struct net_context *ctx, int argc, const char **argv) { @@ -51,11 +51,11 @@ int net_drs(struct net_context *ctx, int argc, const char **argv) } /** - * 'net drs' usage message + * 'samba-tool drs' usage message */ int net_drs_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("net drs [options]\n"); + d_printf("samba-tool drs [options]\n"); d_printf("\n"); d_printf("Currently implemented commands:\n"); d_printf(" bind - Display DC replication features\n"); @@ -309,7 +309,7 @@ static int net_drs_context_destructor(struct net_drs_context *drs_ctx) /** * Create net_drs_context context to be used - * by 'net drs' sub-commands + * by 'samba-tool drs' sub-commands */ bool net_drs_create_context(struct net_context *net_ctx, const char *dc_binding, diff --git a/source4/utils/net/drs/net_drs.h b/source4/samba_tool/drs/drs.h similarity index 94% rename from source4/utils/net/drs/net_drs.h rename to source4/samba_tool/drs/drs.h index 310bb06cdef..1e4cccc5385 100644 --- a/source4/utils/net/drs/net_drs.h +++ b/source4/samba_tool/drs/drs.h @@ -19,8 +19,8 @@ along with this program. If not, see . */ -#ifndef NET_DRS_H_ -#define NET_DRS_H_ +#ifndef SAMBA_TOOL_DRS_H_ +#define SAMBA_TOOL_DRS_H_ #include "librpc/gen_ndr/ndr_drsuapi_c.h" @@ -82,6 +82,6 @@ struct net_drs_context { }; -#include "utils/net/drs/net_drs_proto.h" +#include "samba_tool/drs/drs_proto.h" -#endif /* NET_DRS_H_ */ +#endif /* SAMBA_TOOL_DRS_H_ */ diff --git a/source4/utils/net/drs/net_drs_bind.c b/source4/samba_tool/drs/drs_bind.c similarity index 98% rename from source4/utils/net/drs/net_drs_bind.c rename to source4/samba_tool/drs/drs_bind.c index 6daac7a60d8..cc2ad87df4b 100644 --- a/source4/utils/net/drs/net_drs_bind.c +++ b/source4/samba_tool/drs/drs_bind.c @@ -20,8 +20,8 @@ */ #include "includes.h" -#include "utils/net/net.h" -#include "utils/net/drs/net_drs.h" +#include "samba_tool/samba_tool.h" +#include "samba_tool/drs/drs.h" #define DEFINE_FLAG(_flag, _win_name) {_flag, #_flag, _win_name} @@ -131,6 +131,6 @@ int net_drs_bind_cmd(struct net_context *ctx, int argc, const char **argv) int net_drs_bind_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("net drs bind \n"); + d_printf("samba-tool drs bind \n"); return 0; } diff --git a/source4/utils/net/drs/net_drs_kcc.c b/source4/samba_tool/drs/drs_kcc.c similarity index 96% rename from source4/utils/net/drs/net_drs_kcc.c rename to source4/samba_tool/drs/drs_kcc.c index eaf550e64d9..fa8ea407dff 100644 --- a/source4/utils/net/drs/net_drs_kcc.c +++ b/source4/samba_tool/drs/drs_kcc.c @@ -20,8 +20,8 @@ */ #include "includes.h" -#include "utils/net/net.h" -#include "utils/net/drs/net_drs.h" +#include "samba_tool/samba_tool.h" +#include "samba_tool/drs/drs.h" #include "lib/ldb/include/ldb.h" @@ -91,7 +91,7 @@ failed: } /** - * 'net drs kcc' command entry point + * 'samba-tool drs kcc' command entry point */ int net_drs_kcc_cmd(struct net_context *ctx, int argc, const char **argv) { @@ -161,10 +161,10 @@ failed: } /** - * 'net drs kcc' usage + * 'samba-tool drs kcc' usage */ int net_drs_kcc_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("net drs kcc \n"); + d_printf("samba-tool drs kcc \n"); return 0; } diff --git a/source4/utils/net/drs/net_drs_replicate.c b/source4/samba_tool/drs/drs_replicate.c similarity index 96% rename from source4/utils/net/drs/net_drs_replicate.c rename to source4/samba_tool/drs/drs_replicate.c index a661d2b70e4..36e0792e958 100644 --- a/source4/utils/net/drs/net_drs_replicate.c +++ b/source4/samba_tool/drs/drs_replicate.c @@ -20,8 +20,8 @@ */ #include "includes.h" -#include "utils/net/net.h" -#include "net_drs.h" +#include "samba_tool/samba_tool.h" +#include "samba_tool/drs/drs.h" #include "lib/ldb/include/ldb.h" #include "dsdb/samdb/samdb.h" @@ -193,7 +193,7 @@ static bool net_drs_replicate_sync_nc(struct net_drs_context *drs_ctx, } /** - * 'net drs replicate' command entry point + * 'samba-tool drs replicate' command entry point */ int net_drs_replicate_cmd(struct net_context *ctx, int argc, const char **argv) { @@ -243,10 +243,10 @@ failed: } /** - * 'net drs replicate' usage + * 'samba-tool drs replicate' usage */ int net_drs_replicate_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("net drs replicate \n"); + d_printf("samba-tool drs replicate \n"); return 0; } diff --git a/source4/utils/net/drs/net_drs_showrepl.c b/source4/samba_tool/drs/drs_showrepl.c similarity index 98% rename from source4/utils/net/drs/net_drs_showrepl.c rename to source4/samba_tool/drs/drs_showrepl.c index 584c2947078..f399097008a 100644 --- a/source4/utils/net/drs/net_drs_showrepl.c +++ b/source4/samba_tool/drs/drs_showrepl.c @@ -20,8 +20,8 @@ */ #include "includes.h" -#include "utils/net/net.h" -#include "net_drs.h" +#include "samba_tool/samba_tool.h" +#include "samba_tool/drs/drs.h" #include "lib/ldb/include/ldb.h" #include "dsdb/samdb/samdb.h" #include "lib/util/util_ldb.h" @@ -539,7 +539,7 @@ static bool net_drs_showrepl_print_link_failures(struct net_drs_context *drs_ctx } /** - * 'net drs showrepl' command entry point + * 'samba-tool drs showrepl' command entry point */ int net_drs_showrepl_cmd(struct net_context *ctx, int argc, const char **argv) { @@ -596,10 +596,10 @@ failed: } /** - * 'net drs showrepl' usage + * 'samba-tool drs showrepl' usage */ int net_drs_showrepl_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("net drs showrepl \n"); + d_printf("samba-tool drs showrepl \n"); return 0; } diff --git a/source4/utils/net/net_gpo.c b/source4/samba_tool/gpo.c similarity index 89% rename from source4/utils/net/net_gpo.c rename to source4/samba_tool/gpo.c index 6cddd975088..65838d07123 100644 --- a/source4/utils/net/net_gpo.c +++ b/source4/samba_tool/gpo.c @@ -22,7 +22,7 @@ */ #include "includes.h" -#include "utils/net/net.h" +#include "samba_tool/samba_tool.h" #include "lib/ldb/include/ldb.h" #include "auth/auth.h" #include "param/param.h" @@ -33,8 +33,8 @@ static int net_gpo_list_all_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syntax: net gpo listall [options]\n"); - d_printf("For a list of available options, please type net gpo listall --help\n"); + d_printf("Syntax: samba-tool gpo listall [options]\n"); + d_printf("For a list of available options, please type samba-tool gpo listall --help\n"); return 0; } @@ -85,8 +85,8 @@ static int net_gpo_list_all(struct net_context *ctx, int argc, const char **argv static int net_gpo_get_gpo_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syntax: net gpo show [options]\n"); - d_printf("For a list of available options, please type net gpo show --help\n"); + d_printf("Syntax: samba-tool gpo show [options]\n"); + d_printf("For a list of available options, please type samba-tool gpo show --help\n"); return 0; } @@ -145,8 +145,8 @@ static int net_gpo_get_gpo(struct net_context *ctx, int argc, const char **argv) static int net_gpo_link_get_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syntax: net gpo getlink [options]\n"); - d_printf("For a list of available options, please type net gpo getlink --help\n"); + d_printf("Syntax: samba-tool gpo getlink [options]\n"); + d_printf("For a list of available options, please type samba-tool gpo getlink --help\n"); return 0; } @@ -199,8 +199,8 @@ static int net_gpo_link_get(struct net_context *ctx, int argc, const char **argv static int net_gpo_list_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syntax: net gpo list [options]\n"); - d_printf("For a list of available options, please type net gpo list --help\n"); + d_printf("Syntax: samba-tool gpo list [options]\n"); + d_printf("For a list of available options, please type samba-tool gpo list --help\n"); return 0; } @@ -302,8 +302,8 @@ static int net_gpo_list(struct net_context *ctx, int argc, const char **argv) static int net_gpo_link_set_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syntax: net gpo setlink ['disable'] ['enforce'] [options]\n"); - d_printf("For a list of available options, please type net gpo setlink --help\n"); + d_printf("Syntax: samba-tool gpo setlink ['disable'] ['enforce'] [options]\n"); + d_printf("For a list of available options, please type samba-tool gpo setlink --help\n"); return 0; } @@ -352,8 +352,8 @@ static int net_gpo_link_set(struct net_context *ctx, int argc, const char **argv static int net_gpo_link_del_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syntax: net gpo dellink [options]\n"); - d_printf("For a list of available options, please type net gpo dellink --help\n"); + d_printf("Syntax: samba-tool gpo dellink [options]\n"); + d_printf("For a list of available options, please type samba-tool gpo dellink --help\n"); return 0; } @@ -389,8 +389,8 @@ static int net_gpo_link_del(struct net_context *ctx, int argc, const char **argv static int net_gpo_inheritance_get_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syntax: net gpo getinheritance [options]\n"); - d_printf("For a list of available options, please type net gpo getinheritance --help\n"); + d_printf("Syntax: samba-tool gpo getinheritance [options]\n"); + d_printf("For a list of available options, please type samba-tool gpo getinheritance --help\n"); return 0; } @@ -429,8 +429,8 @@ static int net_gpo_inheritance_get(struct net_context *ctx, int argc, const char static int net_gpo_inheritance_set_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syntax: net gpo setinheritance <\"block\"|\"inherit\"> [options]\n"); - d_printf("For a list of available options, please type net gpo setinheritance --help\n"); + d_printf("Syntax: samba-tool gpo setinheritance <\"block\"|\"inherit\"> [options]\n"); + d_printf("For a list of available options, please type samba-tool gpo setinheritance --help\n"); return 0; } @@ -473,8 +473,8 @@ static int net_gpo_inheritance_set(struct net_context *ctx, int argc, const char static int net_gpo_fetch_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syntax: net gpo fetch [options]\n"); - d_printf("For a list of available options, please type net gpo fetch --help\n"); + d_printf("Syntax: samba-tool gpo fetch [options]\n"); + d_printf("For a list of available options, please type samba-tool gpo fetch --help\n"); return 0; } @@ -514,8 +514,8 @@ static int net_gpo_fetch(struct net_context *ctx, int argc, const char **argv) } static int net_gpo_create_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syntax: net gpo create [options]\n"); - d_printf("For a list of available options, please type net gpo create --help\n"); + d_printf("Syntax: samba-tool gpo create [options]\n"); + d_printf("For a list of available options, please type samba-tool gpo create --help\n"); return 0; } @@ -548,8 +548,8 @@ static int net_gpo_create(struct net_context *ctx, int argc, const char **argv) static int net_gpo_set_acl_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syntax: net gpo setacl [options]\n"); - d_printf("For a list of available options, please type net gpo setacl --help\n"); + d_printf("Syntax: samba-tool gpo setacl [options]\n"); + d_printf("For a list of available options, please type samba-tool gpo setacl --help\n"); return 0; } @@ -607,8 +607,8 @@ static const struct net_functable net_gpo_functable[] = { int net_gpo_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("Syntax: net gpo [options]\n"); - d_printf("For available commands, please type net gpo help\n"); + d_printf("Syntax: samba-tool gpo [options]\n"); + d_printf("For available commands, please type samba-tool gpo help\n"); return 0; } diff --git a/source4/utils/net/net_password.c b/source4/samba_tool/password.c similarity index 92% rename from source4/utils/net/net_password.c rename to source4/samba_tool/password.c index 55f7c3c31d6..96b845b69d1 100644 --- a/source4/utils/net/net_password.c +++ b/source4/samba_tool/password.c @@ -1,6 +1,6 @@ -/* - Samba Unix/Linux SMB client library - Distributed SMB/CIFS Server Management Utility +/* + Samba Unix/Linux SMB client library + Distributed SMB/CIFS Server Management Utility Copyright (C) 2004 Stefan Metzmacher (metze@samba.org) @@ -8,18 +8,18 @@ it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "includes.h" -#include "utils/net/net.h" +#include "samba_tool/samba_tool.h" #include "libnet/libnet.h" #include "system/filesys.h" #include "lib/events/events.h" @@ -32,7 +32,7 @@ static int net_password_change_usage(struct net_context *ctx, int argc, const char **argv) { d_printf("net_password_change_usage: TODO\n"); - return 0; + return 0; } @@ -47,15 +47,15 @@ static int net_password_change(struct net_context *ctx, int argc, const char **a if (argc > 0 && argv[0]) { new_password = argv[0]; } else { - password_prompt = talloc_asprintf(ctx, "Enter new password for account [%s\\%s]:", - cli_credentials_get_domain(ctx->credentials), + password_prompt = talloc_asprintf(ctx, "Enter new password for account [%s\\%s]:", + cli_credentials_get_domain(ctx->credentials), cli_credentials_get_username(ctx->credentials)); new_password = getpass(password_prompt); } libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx); if (!libnetctx) { - return -1; + return -1; } libnetctx->cred = ctx->credentials; @@ -82,7 +82,7 @@ static int net_password_change(struct net_context *ctx, int argc, const char **a static int net_password_set_usage(struct net_context *ctx, int argc, const char **argv) { d_printf("net_password_set_usage: TODO\n"); - return 0; + return 0; } @@ -123,14 +123,14 @@ static int net_password_set(struct net_context *ctx, int argc, const char **argv } if (!new_password) { - password_prompt = talloc_asprintf(ctx, "Enter new password for account [%s\\%s]:", + password_prompt = talloc_asprintf(ctx, "Enter new password for account [%s\\%s]:", domain_name, account_name); new_password = getpass(password_prompt); } libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx); if (!libnetctx) { - return -1; + return -1; } libnetctx->cred = ctx->credentials; @@ -159,13 +159,13 @@ static const struct net_functable net_password_functable[] = { {NULL, NULL} }; -int net_password(struct net_context *ctx, int argc, const char **argv) +int net_password(struct net_context *ctx, int argc, const char **argv) { return net_run_function(ctx, argc, argv, net_password_functable, net_password_usage); } int net_password_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("net password [options]\n"); - return 0; + d_printf("samba-tool password [options]\n"); + return 0; } diff --git a/source4/utils/net/net.c b/source4/samba_tool/samba_tool.c similarity index 95% rename from source4/utils/net/net.c rename to source4/samba_tool/samba_tool.c index 95b70ef01d2..fd9e0e51d37 100644 --- a/source4/utils/net/net.c +++ b/source4/samba_tool/samba_tool.c @@ -1,6 +1,6 @@ -/* - Samba Unix/Linux SMB client library - Distributed SMB/CIFS Server Management Utility +/* + Samba Unix/Linux SMB client library + Distributed SMB/CIFS Server Management Utility Copyright (C) 2001 Steve French (sfrench@us.ibm.com) Copyright (C) 2001 Jim McDonough (jmcd@us.ibm.com) Copyright (C) 2001 Andrew Tridgell (tridge@samba.org) @@ -19,16 +19,16 @@ it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ - + /*****************************************************/ /* */ /* Distributed SMB/CIFS Server Management Utility */ @@ -43,7 +43,7 @@ #include #include "includes.h" -#include "utils/net/net.h" +#include "samba_tool/samba_tool.h" #include "lib/cmdline/popt_common.h" #include "lib/ldb/include/ldb.h" #include "librpc/rpc/dcerpc.h" @@ -51,7 +51,7 @@ #include "lib/events/events.h" #include "auth/credentials/credentials.h" #include "scripting/python/modules.h" -#include "utils/net/drs/net_drs.h" +#include "samba_tool/drs/drs.h" /* There's no Py_ssize_t in 2.4, apparently */ #if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5 @@ -89,7 +89,7 @@ static int py_call_with_string_args(PyObject *self, const char *method, int argc if (py_method == NULL) { PyErr_Print(); return 1; - } + } ret = PyObject_CallObject(py_method, args); @@ -117,7 +117,7 @@ static PyObject *py_commands(void) if (netcmd_module == NULL) { PyErr_Print(); return NULL; - } + } py_cmds = PyObject_GetAttrString(netcmd_module, "commands"); if (py_cmds == NULL) { @@ -135,11 +135,11 @@ static PyObject *py_commands(void) /* run a function from a function table. If not found then - call the specified usage function + call the specified usage function */ int net_run_function(struct net_context *ctx, int argc, const char **argv, - const struct net_functable *functable, + const struct net_functable *functable, int (*usage_fn)(struct net_context *ctx, int argc, const char **argv)) { int i; @@ -184,7 +184,7 @@ int net_run_usage(struct net_context *ctx, py_cmd = PyDict_GetItemString(py_cmds, argv[0]); if (py_cmd != NULL) { - return py_call_with_string_args(py_cmd, "usage", argc-1, + return py_call_with_string_args(py_cmd, "usage", argc-1, argv+1); } @@ -247,7 +247,7 @@ static int net_help_python(void) return 1; } if (!PyString_Check(py_desc)) { - d_printf("Command description for %s not a string\n", + d_printf("Command description for %s not a string\n", name); return 1; } @@ -272,7 +272,7 @@ int net_help(struct net_context *ctx, const struct net_functable *ftable) static int net_usage(struct net_context *ctx, int argc, const char **argv) { d_printf("Usage:\n"); - d_printf("net [options]\n"); + d_printf("samba-tool [options]\n"); net_help(ctx, net_functable); return -1; } @@ -329,13 +329,13 @@ static int binary_net(int argc, const char **argv) } } - pc = poptGetContext("net", argc, (const char **) argv, long_options, + pc = poptGetContext("net", argc, (const char **) argv, long_options, POPT_CONTEXT_KEEP_FIRST); while((opt = poptGetNextOpt(pc)) != -1) { switch (opt) { default: - d_printf("Invalid option %s: %s\n", + d_printf("Invalid option %s: %s\n", poptBadOption(pc, 0), poptStrerror(opt)); net_usage(ctx, argc, argv); exit(1); diff --git a/source4/utils/net/net.h b/source4/samba_tool/samba_tool.h similarity index 83% rename from source4/utils/net/net.h rename to source4/samba_tool/samba_tool.h index 16223a15bb9..c8492e613bd 100644 --- a/source4/utils/net/net.h +++ b/source4/samba_tool/samba_tool.h @@ -1,6 +1,6 @@ -/* - Samba Unix/Linux SMB client library - Distributed SMB/CIFS Server Management Utility +/* + Samba Unix/Linux SMB client library + Distributed SMB/CIFS Server Management Utility Copyright (C) Stefan Metzmacher 2004 @@ -8,18 +8,18 @@ it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _UTIL_NET_H -#define _UTIL_NET_H +#ifndef _SAMBA_TOOL_H +#define _SAMBA_TOOL_H struct net_context { struct cli_credentials *credentials; @@ -34,6 +34,6 @@ struct net_functable { int (*usage)(struct net_context *ctx, int argc, const char **argv); }; -#include "utils/net/net_proto.h" +#include "samba_tool/proto.h" -#endif /* _UTIL_NET_H */ +#endif /* _SAMBA_TOOL_H */ diff --git a/source4/utils/net/net_vampire.c b/source4/samba_tool/vampire.c similarity index 89% rename from source4/utils/net/net_vampire.c rename to source4/samba_tool/vampire.c index c113ad70019..7f16c82668b 100644 --- a/source4/utils/net/net_vampire.c +++ b/source4/samba_tool/vampire.c @@ -1,6 +1,6 @@ -/* - Samba Unix/Linux SMB client library - Distributed SMB/CIFS Server Management Utility +/* + Samba Unix/Linux SMB client library + Distributed SMB/CIFS Server Management Utility Copyright (C) 2004 Stefan Metzmacher Copyright (C) 2005 Andrew Bartlett @@ -9,18 +9,18 @@ it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "includes.h" -#include "utils/net/net.h" +#include "samba_tool/samba_tool.h" #include "libnet/libnet.h" #include "librpc/gen_ndr/samr.h" #include "auth/auth.h" @@ -33,7 +33,7 @@ static const struct net_functable net_samdump_functable[] = { {NULL, NULL, NULL, NULL} }; -int net_samdump(struct net_context *ctx, int argc, const char **argv) +int net_samdump(struct net_context *ctx, int argc, const char **argv) { NTSTATUS status; struct libnet_context *libnetctx; @@ -45,14 +45,14 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) break; case 1: default: - rc = net_run_function(ctx, argc, argv, net_samdump_functable, + rc = net_run_function(ctx, argc, argv, net_samdump_functable, net_samdump_usage); return rc; } libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx); if (!libnetctx) { - return -1; + return -1; } libnetctx->cred = ctx->credentials; @@ -75,17 +75,17 @@ int net_samdump(struct net_context *ctx, int argc, const char **argv) int net_samdump_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("net samdump\n"); - return 0; + d_printf("samba-tool samdump\n"); + return 0; } int net_samdump_help(struct net_context *ctx, int argc, const char **argv) { d_printf("Dumps the sam of the domain we are joined to.\n"); - return 0; + return 0; } -int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) +int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) { NTSTATUS status; struct libnet_context *libnetctx; @@ -93,7 +93,7 @@ int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) libnetctx = libnet_context_init(ctx->event_ctx, ctx->lp_ctx); if (!libnetctx) { - return -1; + return -1; } libnetctx->cred = ctx->credentials; @@ -119,12 +119,12 @@ int net_samsync_ldb(struct net_context *ctx, int argc, const char **argv) int net_samsync_ldb_usage(struct net_context *ctx, int argc, const char **argv) { - d_printf("net samsync\n"); - return 0; + d_printf("samba-tool samsync\n"); + return 0; } int net_samsync_ldb_help(struct net_context *ctx, int argc, const char **argv) { d_printf("Synchronise into the local ldb the SAM of a domain.\n"); - return 0; + return 0; } diff --git a/source4/samba_tool/wscript_build b/source4/samba_tool/wscript_build new file mode 100644 index 00000000000..df4d2de58f1 --- /dev/null +++ b/source4/samba_tool/wscript_build @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +bld.SAMBA_MODULE('samba_tool_drs', + source='drs/drs.c drs/drs_bind.c drs/drs_kcc.c drs/drs_replicate.c drs/drs_showrepl.c', + autoproto='drs/drs_proto.h', + subsystem='samba-tool', + deps='LIBCLI_DRSUAPI ldb LDBSAMBA', + internal_module=True + ) + + +bld.SAMBA_BINARY('samba-tool', + source='samba_tool.c password.c vampire.c gpo.c', + autoproto='proto.h', + deps='samba-hostconfig samba-util samba-net popt POPT_SAMBA POPT_CREDENTIALS samba_tool_drs policy auth', + pyembed=True + ) diff --git a/source4/selftest/skip b/source4/selftest/skip index e43fefebdad..e03234b3ca0 100644 --- a/source4/selftest/skip +++ b/source4/selftest/skip @@ -62,7 +62,7 @@ rpc.lsa.forest # Not provided by Samba 4 ^samba4.ntvfs.cifs.raw.samba3.* # Samba3-specific test samba4.ntvfs.cifs.raw. ^samba4.rpc..*samba3.* # Samba3-specific test -^samba4.net.domopen.*$ # Hangs for some reason +^samba4.samba-tool.domopen.*$ # Hangs for some reason nss.test # Fails raw.offline # Samba 4 doesn't have much offline support yet rpc.autoidl # this one just generates a lot of noise, and is no longer useful diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index 5877f4f02cb..a252a87d081 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -355,7 +355,7 @@ planperltestsuite("selftest.samba4", os.path.normpath(os.path.join(samba4srcdir, # work correctly. planpythontestsuite("none", "samba.tests.blackbox.ndrdump") -plantestsuite("samba4.blackbox.net(dc:local)", "dc:local", [os.path.join(samba4srcdir, "utils/tests/test_net.sh"), '$SERVER', "$USERNAME", "$PASSWORD", "$DOMAIN"]) +plantestsuite("samba4.blackbox.samba_tool(dc:local)", "dc:local", [os.path.join(samba4srcdir, "utils/tests/test_net.sh"), '$SERVER', "$USERNAME", "$PASSWORD", "$DOMAIN"]) plantestsuite("samba4.blackbox.pkinit(dc:local)", "dc:local", [os.path.join(bbdir, "test_pkinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", configuration]) plantestsuite("samba4.blackbox.kinit(dc:local)", "dc:local", [os.path.join(bbdir, "test_kinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "aes256-cts-hmac-sha1-96", configuration]) plantestsuite("samba4.blackbox.kinit(fl2000dc:local)", "fl2000dc:local", [os.path.join(bbdir, "test_kinit.sh"), '$SERVER', '$USERNAME', '$PASSWORD', '$REALM', '$DOMAIN', '$PREFIX', "arcfour-hmac-md5", configuration]) diff --git a/source4/setup/tests/blackbox_group.sh b/source4/setup/tests/blackbox_group.sh dissimilarity index 83% index adffad1cc72..451ae9d6418 100755 --- a/source4/setup/tests/blackbox_group.sh +++ b/source4/setup/tests/blackbox_group.sh @@ -1,74 +1,74 @@ -#!/bin/sh - -if [ $# -lt 1 ]; then -cat < - cmd_line = "%s drs replicate %s %s %s %s" % (net_cmd, DC, fromDC, + # bin/samba-tool drs replicate + cmd_line = "%s drs replicate %s %s %s %s" % (samba_tool_cmd, DC, fromDC, self.domain_dn, cmd_line_auth) ret = os.system(cmd_line) self.assertEquals(ret, 0, "Replicating %s from %s has failed!" % (DC, fromDC)) diff --git a/source4/torture/drs/python/fsmo.py b/source4/torture/drs/python/fsmo.py index 251507413d3..067ee2accb8 100644 --- a/source4/torture/drs/python/fsmo.py +++ b/source4/torture/drs/python/fsmo.py @@ -91,13 +91,13 @@ class DrsFsmoTestCase(samba.tests.TestCase): super(DrsFsmoTestCase, self).tearDown() def _net_fsmo_role_transfer(self, DC, role): - # find out where is net command - net_cmd = os.path.abspath("./bin/net") + # find out where is samba-tool command + net_cmd = os.path.abspath("./bin/samba-tool") # make command line credentials string creds = samba.tests.cmdline_credentials cmd_line_auth = "-U%s/%s%%%s" % (creds.get_domain(), creds.get_username(), creds.get_password()) - # bin/net fsmo transfer --role=role --host=ldap://DC:389 + # bin/samba-tool fsmo transfer --role=role --host=ldap://DC:389 cmd_line = "%s fsmo transfer --role=%s --host=ldap://%s:389 %s" % (net_cmd, role, DC, cmd_line_auth) ret = os.system(cmd_line) diff --git a/source4/utils/net/config.mk b/source4/utils/net/config.mk deleted file mode 100644 index 032f68555a8..00000000000 --- a/source4/utils/net/config.mk +++ /dev/null @@ -1,50 +0,0 @@ -# $(utilssrcdir)/net subsystem - - -################################# -# Start MODULE net_drs -[MODULE::net_drs] -SUBSYSTEM = net -OUTPUT_TYPE = MERGED_OBJ -PRIVATE_DEPENDENCIES = \ - LIBCLI_DRSUAPI \ - LIBLDB -# End MODULE net_drs -################################# - -net_drs_OBJ_FILES = $(addprefix $(utilssrcdir)/net/drs/, \ - net_drs.o \ - net_drs_bind.o \ - net_drs_kcc.o \ - net_drs_replicate.o \ - net_drs_showrepl.o) - -$(eval $(call proto_header_template,$(utilssrcdir)/net/drs/net_drs_proto.h,$(net_drs_OBJ_FILES:.o=.c))) - - -################################# -# Start BINARY net -[BINARY::net] -INSTALLDIR = BINDIR -PRIVATE_DEPENDENCIES = \ - LIBSAMBA-HOSTCONFIG \ - LIBSAMBA-UTIL \ - LIBSAMBA-NET \ - LIBPOPT \ - POPT_SAMBA \ - POPT_CREDENTIALS \ - policy \ - net_drs -# End BINARY net -################################# - -net_OBJ_FILES = $(addprefix $(utilssrcdir)/net/, \ - net.o \ - net_password.o \ - net_join.o \ - net_vampire.o \ - net_gpo.o) - - -$(eval $(call proto_header_template,$(utilssrcdir)/net/net_proto.h,$(net_OBJ_FILES:.o=.c))) - diff --git a/source4/utils/net/wscript_build b/source4/utils/net/wscript_build deleted file mode 100644 index 48c766336dd..00000000000 --- a/source4/utils/net/wscript_build +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python - -bld.SAMBA_MODULE('net_drs', - source='drs/net_drs.c drs/net_drs_bind.c drs/net_drs_kcc.c drs/net_drs_replicate.c drs/net_drs_showrepl.c', - autoproto='drs/net_drs_proto.h', - subsystem='net', - deps='LIBCLI_DRSUAPI ldb LDBSAMBA', - internal_module=True - ) - - -bld.SAMBA_BINARY('net', - source='net.c net_password.c net_vampire.c net_gpo.c', - autoproto='net_proto.h', - deps='samba-hostconfig samba-util samba-net popt POPT_SAMBA POPT_CREDENTIALS net_drs policy auth', - pyembed=True - ) - diff --git a/source4/utils/tests/test_net.sh b/source4/utils/tests/test_samba_tool.sh similarity index 70% rename from source4/utils/tests/test_net.sh rename to source4/utils/tests/test_samba_tool.sh index 09394f41be7..0fb4c2afa85 100755 --- a/source4/utils/tests/test_net.sh +++ b/source4/utils/tests/test_samba_tool.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Blackbox tests for net +# Blackbox tests for samba-tool SERVER=$1 USERNAME=$2 @@ -11,7 +11,7 @@ failed=0 samba4bindir="$BUILDDIR/bin" smbclient="$samba4bindir/smbclient$EXEEXT" -net="$samba4bindir/net$EXEEXT" +samba_tool="$samba4bindir/samba-tool$EXEEXT" testit() { name="$1" @@ -33,8 +33,8 @@ testit "Test login with --machine-pass without kerberos" $VALGRIND $smbclient -c testit "Test login with --machine-pass and kerberos" $VALGRIND $smbclient -c 'ls' $CONFIGURATION //$SERVER/tmp --machine-pass -k yes -testit "time" $VALGRIND $net time $SERVER $CONFIGURATION -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ +testit "time" $VALGRIND $samba_tool time $SERVER $CONFIGURATION -W "$DOMAIN" -U"$USERNAME%$PASSWORD" $@ -# FIXME: testit "domainlevel.show" $VALGRIND $net domainlevel show $CONFIGURATION +# FIXME: testit "domainlevel.show" $VALGRIND $samba_tool domainlevel show $CONFIGURATION exit $failed diff --git a/source4/wscript_build b/source4/wscript_build index 80675c9895b..9b22132940c 100644 --- a/source4/wscript_build +++ b/source4/wscript_build @@ -64,7 +64,7 @@ bld.RECURSE('nbt_server') bld.RECURSE('wrepl_server') bld.RECURSE('cldap_server') bld.RECURSE('ntp_signd') -bld.RECURSE('utils/net') +bld.RECURSE('samba_tool') bld.RECURSE('utils') bld.RECURSE('ntvfs') bld.RECURSE('ntptr') diff --git a/testprogs/blackbox/test_export_keytab.sh b/testprogs/blackbox/test_export_keytab.sh index 6f2abab694b..3982563a7d8 100755 --- a/testprogs/blackbox/test_export_keytab.sh +++ b/testprogs/blackbox/test_export_keytab.sh @@ -21,8 +21,8 @@ failed=0 samba4bindir="$BUILDDIR/bin" smbclient="$samba4bindir/smbclient$EXEEXT" samba4kinit="$samba4bindir/samba4kinit$EXEEXT" -net="$samba4bindir/net$EXEEXT" -newuser="$net newuser" +samba_tool="$samba4bindir/samba-tool$EXEEXT" +newuser="$samba_tool newuser" . `dirname $0`/subunit.sh @@ -46,8 +46,8 @@ USERPASS=testPaSS@01% testit "create user locally" $VALGRIND $newuser nettestuser $USERPASS $@ || failed=`expr $failed + 1` -testit "export keytab from domain" $VALGRIND $net export keytab $PREFIX/tmpkeytab $@ || failed=`expr $failed + 1` -testit "export keytab from domain (2nd time)" $VALGRIND $net export keytab $PREFIX/tmpkeytab $@ || failed=`expr $failed + 1` +testit "export keytab from domain" $VALGRIND $samba_tool export keytab $PREFIX/tmpkeytab $@ || failed=`expr $failed + 1` +testit "export keytab from domain (2nd time)" $VALGRIND $samba_tool export keytab $PREFIX/tmpkeytab $@ || failed=`expr $failed + 1` KRB5CCNAME="$PREFIX/tmpuserccache" export KRB5CCNAME @@ -61,7 +61,7 @@ export KRB5CCNAME testit "kinit with keytab as $USERNAME" $VALGRIND $samba4kinit --keytab=$PREFIX/tmpkeytab --request-pac $USERNAME@$REALM || failed=`expr $failed + 1` -testit "del user" $VALGRIND $net user delete nettestuser -k yes $@ || failed=`expr $failed + 1` +testit "del user" $VALGRIND $samba_tool user delete nettestuser -k yes $@ || failed=`expr $failed + 1` rm -f $PREFIX/tmpadminccache $PREFIX/tmpuserccache $PREFIX/tmpkeytab exit $failed diff --git a/testprogs/blackbox/test_kinit.sh b/testprogs/blackbox/test_kinit.sh index 2e65fe0088e..3eb2343e884 100755 --- a/testprogs/blackbox/test_kinit.sh +++ b/testprogs/blackbox/test_kinit.sh @@ -23,12 +23,12 @@ failed=0 samba4bindir="$BUILDDIR/bin" smbclient="$samba4bindir/smbclient$EXEEXT" samba4kinit="$samba4bindir/samba4kinit$EXEEXT" -net="$samba4bindir/net$EXEEXT" +samba_tool="$samba4bindir/samba-tool$EXEEXT" ldbmodify="$samba4bindir/ldbmodify$EXEEXT" ldbsearch="$samba4bindir/ldbsearch$EXEEXT" rkpty="$samba4bindir/rkpty$EXEEXT" samba4kpasswd="$samba4bindir/samba4kpasswd$EXEEXT" -enableaccount="$samba4bindir/net enableaccount" +enableaccount="$samba_tool enableaccount" machineaccountccache="$BUILDDIR/scripting/bin/machineaccountccache" . `dirname $0`/subunit.sh @@ -57,7 +57,7 @@ export PWSETCONFIG KRB5CCNAME="$PREFIX/tmpccache" export KRB5CCNAME -testit "reset password policies beside of minimum password age of 0 days" $VALGRIND $net pwsettings $PWSETCONFIG set --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=0 --max-pwd-age=default || failed=`expr $failed + 1` +testit "reset password policies beside of minimum password age of 0 days" $VALGRIND $samba_tool pwsettings $PWSETCONFIG set --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=0 --max-pwd-age=default || failed=`expr $failed + 1` echo $PASSWORD > ./tmppassfile #testit "kinit with keytab" $samba4kinit $enctype --keytab=$PREFIX/dc/private/secrets.keytab $SERVER\$@$REALM || failed=`expr $failed + 1` @@ -68,11 +68,11 @@ testit "kinit renew ticket" $samba4kinit $enctype --request-pac -R test_smbclient "Test login with kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1` -testit "check time with kerberos ccache" $VALGRIND $net $CONFIGURATION -k yes $@ time $SERVER || failed=`expr $failed + 1` +testit "check time with kerberos ccache" $VALGRIND $samba_tool $CONFIGURATION -k yes $@ time $SERVER || failed=`expr $failed + 1` USERPASS=testPass@12% echo $USERPASS > ./tmpuserpassfile -testit "add user with kerberos ccache" $VALGRIND $net user add nettestuser $USERPASS $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` +testit "add user with kerberos ccache" $VALGRIND $samba_tool user add nettestuser $USERPASS $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` echo "Getting defaultNamingContext" BASEDN=`$ldbsearch $options --basedn='' -H ldap://$SERVER -s base DUMMY=x defaultNamingContext | grep defaultNamingContext | awk '{print $2}'` @@ -86,7 +86,7 @@ EOF testit "modify servicePrincipalName" $VALGRIND $ldbmodify -H ldap://$SERVER ./tmpldbmodify -k yes $@ || failed=`expr $failed + 1` -testit "set user password with kerberos ccache" $VALGRIND $net password set $DOMAIN\\nettestuser $USERPASS $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` +testit "set user password with kerberos ccache" $VALGRIND $samba_tool password set $DOMAIN\\nettestuser $USERPASS $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` testit "enable user with kerberos cache" $VALGRIND $enableaccount nettestuser -H ldap://$SERVER -k yes $@ || failed=`expr $failed + 1` @@ -98,7 +98,7 @@ testit "kinit with user password" $samba4kinit $enctype --password-file=./tmpuse test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1` NEWUSERPASS=testPaSS@34% -testit "change user password with 'net password change' (rpc)" $VALGRIND $net password change -W$DOMAIN -U$DOMAIN\\nettestuser%$USERPASS $CONFIGURATION -k no $NEWUSERPASS $@ || failed=`expr $failed + 1` +testit "change user password with 'samba-tool password change' (rpc)" $VALGRIND $samba_tool password change -W$DOMAIN -U$DOMAIN\\nettestuser%$USERPASS $CONFIGURATION -k no $NEWUSERPASS $@ || failed=`expr $failed + 1` echo $NEWUSERPASS > ./tmpuserpassfile testit "kinit with user password" $samba4kinit $enctype --password-file=./tmpuserpassfile --request-pac nettestuser@$REALM || failed=`expr $failed + 1` @@ -163,13 +163,13 @@ test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`exp KRB5CCNAME="$PREFIX/tmpccache" export KRB5CCNAME -testit "del user with kerberos ccache" $VALGRIND $net user delete nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` +testit "del user with kerberos ccache" $VALGRIND $samba_tool user delete nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1` rm -f $KRB5CCNAME testit "kinit with machineaccountccache script" $machineaccountccache $CONFIGURATION $KRB5CCNAME || failed=`expr $failed + 1` test_smbclient "Test machine account login with kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1` -testit "reset password policies" $VALGRIND $net pwsettings $PWSETCONFIG set --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=default --max-pwd-age=default || failed=`expr $failed + 1` +testit "reset password policies" $VALGRIND $samba_tool pwsettings $PWSETCONFIG set --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=default --max-pwd-age=default || failed=`expr $failed + 1` rm -f $PREFIX/tmpccache tmpccfile tmppassfile tmpuserpassfile tmpuserccache tmpkpasswdscript exit $failed diff --git a/testprogs/blackbox/test_ktpass.sh b/testprogs/blackbox/test_ktpass.sh index ccbbcb99390..579389f97ea 100755 --- a/testprogs/blackbox/test_ktpass.sh +++ b/testprogs/blackbox/test_ktpass.sh @@ -13,14 +13,14 @@ shift 1 . `dirname $0`/subunit.sh -net="$BUILDDIR/bin/net" +samba_tool="$BUILDDIR/bin/samba-tool" samba4bindir="$BUILDDIR/bin" samba4kinit="$samba4bindir/samba4kinit$EXEEXT" CONFIG="--configfile=$PREFIX/dc/etc/smb.conf" TESTUSER="ktpassUser" -testit "newuser" $net newuser $CONFIG $TESTUSER testp@ssw0Rd || failed=`expr $failed + 1` +testit "newuser" $samba_tool newuser $CONFIG $TESTUSER testp@ssw0Rd || failed=`expr $failed + 1` KRB5CCNAME="$PREFIX/tmpccache" export KRB5CCNAME diff --git a/testprogs/blackbox/test_passwords.sh b/testprogs/blackbox/test_passwords.sh index de7e31ea77c..eb7cbf087b4 100755 --- a/testprogs/blackbox/test_passwords.sh +++ b/testprogs/blackbox/test_passwords.sh @@ -22,10 +22,10 @@ failed=0 samba4bindir="$BUILDDIR/bin" smbclient="$samba4bindir/smbclient$EXEEXT" samba4kinit="$samba4bindir/samba4kinit$EXEEXT" -net="$samba4bindir/net$EXEEXT" +samba_tool="$samba4bindir/samba-tool$EXEEXT" rkpty="$samba4bindir/rkpty$EXEEXT" samba4kpasswd="$samba4bindir/samba4kpasswd$EXEEXT" -newuser="$net newuser" +newuser="$samba_tool newuser" . `dirname $0`/subunit.sh @@ -48,7 +48,7 @@ test_smbclient() { CONFIG="--configfile=$PREFIX/dc/etc/smb.conf" export CONFIG -testit "reset password policies beside of minimum password age of 0 days" $VALGRIND $net pwsettings $CONFIG set --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=0 --max-pwd-age=default || failed=`expr $failed + 1` +testit "reset password policies beside of minimum password age of 0 days" $VALGRIND $samba_tool pwsettings $CONFIG set --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=0 --max-pwd-age=default || failed=`expr $failed + 1` USERPASS=testPaSS@01% @@ -64,7 +64,7 @@ testit "kinit with user password" $samba4kinit --password-file=$PREFIX/tmpuserpa test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1` NEWUSERPASS=testPaSS@02% -testit "change user password with 'net password change' (unforced)" $VALGRIND $net password change -W$DOMAIN -U$DOMAIN/nettestuser%$USERPASS -k no $NEWUSERPASS $@ || failed=`expr $failed + 1` +testit "change user password with 'samba-tool password change' (unforced)" $VALGRIND $samba_tool password change -W$DOMAIN -U$DOMAIN/nettestuser%$USERPASS -k no $NEWUSERPASS $@ || failed=`expr $failed + 1` echo $NEWUSERPASS > ./tmpuserpassfile testit "kinit with user password" $samba4kinit --password-file=./tmpuserpassfile --request-pac nettestuser@$REALM || failed=`expr $failed + 1` @@ -135,15 +135,15 @@ test_smbclient "Test login with user kerberos (unforced)" 'ls' -k yes -Unettestu NEWUSERPASS=testPaSS@04% -testit "set password on user locally" $VALGRIND $net setpassword $CONFIG nettestuser --newpassword=$NEWUSERPASS --must-change-at-next-login $@ || failed=`expr $failed + 1` +testit "set password on user locally" $VALGRIND $samba_tool setpassword $CONFIG nettestuser --newpassword=$NEWUSERPASS --must-change-at-next-login $@ || failed=`expr $failed + 1` USERPASS=$NEWUSERPASS NEWUSERPASS=testPaSS@05% -testit "change user password with 'net password change' (after must change flag set)" $VALGRIND $net password change -W$DOMAIN -U$DOMAIN/nettestuser%$USERPASS -k no $NEWUSERPASS $@ || failed=`expr $failed + 1` +testit "change user password with 'samba-tool password change' (after must change flag set)" $VALGRIND $samba_tool password change -W$DOMAIN -U$DOMAIN/nettestuser%$USERPASS -k no $NEWUSERPASS $@ || failed=`expr $failed + 1` USERPASS=$NEWUSERPASS NEWUSERPASS=testPaSS@06% -testit "set password on user locally" $VALGRIND $net setpassword $CONFIG nettestuser --newpassword=$NEWUSERPASS --must-change-at-next-login $@ || failed=`expr $failed + 1` +testit "set password on user locally" $VALGRIND $samba_tool setpassword $CONFIG nettestuser --newpassword=$NEWUSERPASS --must-change-at-next-login $@ || failed=`expr $failed + 1` USERPASS=$NEWUSERPASS NEWUSERPASS=testPaSS@07% @@ -164,33 +164,33 @@ USERPASS=$NEWUSERPASS test_smbclient "Test login with user kerberos" 'ls' -k yes -Unettestuser@$REALM%$NEWUSERPASS || failed=`expr $failed + 1` NEWUSERPASS=abcdefg -testit_expect_failure "try to set a non-complex password (command should not succeed)" $VALGRIND $net password change -W$DOMAIN "-U$DOMAIN/nettestuser%$USERPASS" -k no "$NEWUSERPASS" $@ && failed=`expr $failed + 1` +testit_expect_failure "try to set a non-complex password (command should not succeed)" $VALGRIND $samba_tool password change -W$DOMAIN "-U$DOMAIN/nettestuser%$USERPASS" -k no "$NEWUSERPASS" $@ && failed=`expr $failed + 1` -testit "allow non-complex passwords" $VALGRIND $net pwsettings set $CONFIG --complexity=off || failed=`expr $failed + 1` +testit "allow non-complex passwords" $VALGRIND $samba_tool pwsettings set $CONFIG --complexity=off || failed=`expr $failed + 1` -testit "try to set a non-complex password (command should succeed)" $VALGRIND $net password change -W$DOMAIN "-U$DOMAIN/nettestuser%$USERPASS" -k no "$NEWUSERPASS" $@ || failed=`expr $failed + 1` +testit "try to set a non-complex password (command should succeed)" $VALGRIND $samba_tool password change -W$DOMAIN "-U$DOMAIN/nettestuser%$USERPASS" -k no "$NEWUSERPASS" $@ || failed=`expr $failed + 1` USERPASS=$NEWUSERPASS test_smbclient "test login with non-complex password" 'ls' -k no -Unettestuser@$REALM%$USERPASS || failed=`expr $failed + 1` NEWUSERPASS=abc -testit_expect_failure "try to set a short password (command should not succeed)" $VALGRIND $net password change -W$DOMAIN "-U$DOMAIN/nettestuser%$USERPASS" -k no "$NEWUSERPASS" $@ && failed=`expr $failed + 1` +testit_expect_failure "try to set a short password (command should not succeed)" $VALGRIND $samba_tool password change -W$DOMAIN "-U$DOMAIN/nettestuser%$USERPASS" -k no "$NEWUSERPASS" $@ && failed=`expr $failed + 1` -testit "allow short passwords (length 1)" $VALGRIND $net pwsettings $CONFIG set --min-pwd-length=1 || failed=`expr $failed + 1` +testit "allow short passwords (length 1)" $VALGRIND $samba_tool pwsettings $CONFIG set --min-pwd-length=1 || failed=`expr $failed + 1` -testit "try to set a short password (command should succeed)" $VALGRIND $net password change -W$DOMAIN "-U$DOMAIN/nettestuser%$USERPASS" -k no "$NEWUSERPASS" $@ || failed=`expr $failed + 1` +testit "try to set a short password (command should succeed)" $VALGRIND $samba_tool password change -W$DOMAIN "-U$DOMAIN/nettestuser%$USERPASS" -k no "$NEWUSERPASS" $@ || failed=`expr $failed + 1` USERPASS="$NEWUSERPASS" -testit "require minimum password age of 1 day" $VALGRIND $net pwsettings $CONFIG set --min-pwd-age=1 || failed=`expr $failed + 1` +testit "require minimum password age of 1 day" $VALGRIND $samba_tool pwsettings $CONFIG set --min-pwd-age=1 || failed=`expr $failed + 1` -testit "show password settings" $VALGRIND $net pwsettings $CONFIG show || failed=`expr $failed + 1` +testit "show password settings" $VALGRIND $samba_tool pwsettings $CONFIG show || failed=`expr $failed + 1` NEWUSERPASS="testPaSS@08%" -testit_expect_failure "try to change password too quickly (command should not succeed)" $VALGRIND $net password change -W$DOMAIN "-U$DOMAIN/nettestuser%$USERPASS" -k no "$NEWUSERPASS" $@ && failed=`expr $failed + 1` +testit_expect_failure "try to change password too quickly (command should not succeed)" $VALGRIND $samba_tool password change -W$DOMAIN "-U$DOMAIN/nettestuser%$USERPASS" -k no "$NEWUSERPASS" $@ && failed=`expr $failed + 1` -testit "reset password policies" $VALGRIND $net pwsettings $CONFIG set --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=default --max-pwd-age=default || failed=`expr $failed + 1` +testit "reset password policies" $VALGRIND $samba_tool pwsettings $CONFIG set --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=default --max-pwd-age=default || failed=`expr $failed + 1` -testit "del user" $VALGRIND $net user delete nettestuser -U"$USERNAME%$PASSWORD" -k no $@ || failed=`expr $failed + 1` +testit "del user" $VALGRIND $samba_tool user delete nettestuser -U"$USERNAME%$PASSWORD" -k no $@ || failed=`expr $failed + 1` rm -f tmpccfile tmppassfile tmpuserpassfile tmpuserccache tmpkpasswdscript exit $failed diff --git a/testprogs/blackbox/test_pkinit.sh b/testprogs/blackbox/test_pkinit.sh index e901f0f0db8..9a5741b16b9 100755 --- a/testprogs/blackbox/test_pkinit.sh +++ b/testprogs/blackbox/test_pkinit.sh @@ -23,12 +23,12 @@ failed=0 samba4bindir="$BUILDDIR/bin" smbclient="$samba4bindir/smbclient$EXEEXT" samba4kinit="$samba4bindir/samba4kinit$EXEEXT" -net="$samba4bindir/net$EXEEXT" +samba_tool="$samba4bindir/samba-tool$EXEEXT" ldbmodify="$samba4bindir/ldbmodify$EXEEXT" ldbsearch="$samba4bindir/ldbsearch$EXEEXT" rkpty="$samba4bindir/rkpty$EXEEXT" samba4kpasswd="$samba4bindir/samba4kpasswd$EXEEXT" -enableaccount="$samba4bindir/net enableaccount" +enableaccount="$samba_tool enableaccount" machineaccountccache="$BUILDDIR/scripting/bin/machineaccountccache" . `dirname $0`/subunit.sh -- 2.11.4.GIT