diff options
author | Kai Blin <kai@samba.org> | 2010-10-23 19:27:26 -0700 |
---|---|---|
committer | Kai Blin <kai@samba.org> | 2010-10-28 07:25:16 +0000 |
commit | b73a05e4e184238614d73c1519f2880cd946908d (patch) | |
tree | 5405be11f54e857eeb9b74ca46121ea0b2aea34e | |
parent | 5634f55cc8d9eb0cca01f621939cee724271ecb0 (diff) | |
download | samba-b73a05e4e184238614d73c1519f2880cd946908d.tar.gz samba-b73a05e4e184238614d73c1519f2880cd946908d.tar.bz2 samba-b73a05e4e184238614d73c1519f2880cd946908d.zip |
s4 net: rename to samba-tool in order to not clash with s3 net
Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Thu Oct 28 07:25:16 UTC 2010 on sn-devel-104
30 files changed, 258 insertions, 309 deletions
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index ba96f08d0d..168fe42620 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 index 578b6f2fc3..78f8c144c2 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 <command> [options]\n"); + d_printf("samba-tool drs <command> [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 index 310bb06cde..1e4cccc538 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 <http://www.gnu.org/licenses/>. */ -#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 index 6daac7a60d..cc2ad87df4 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 <DC_NAME>\n"); + d_printf("samba-tool drs bind <DC_NAME>\n"); return 0; } diff --git a/source4/utils/net/drs/net_drs_kcc.c b/source4/samba_tool/drs/drs_kcc.c index eaf550e64d..fa8ea407df 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 <DC_NAME>\n"); + d_printf("samba-tool drs kcc <DC_NAME>\n"); return 0; } diff --git a/source4/utils/net/drs/net_drs_replicate.c b/source4/samba_tool/drs/drs_replicate.c index a661d2b70e..36e0792e95 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 <Dest_DC_NAME> <Src_DC_NAME> <Naming Context>\n"); + d_printf("samba-tool drs replicate <Dest_DC_NAME> <Src_DC_NAME> <Naming Context>\n"); return 0; } diff --git a/source4/utils/net/drs/net_drs_showrepl.c b/source4/samba_tool/drs/drs_showrepl.c index 584c294707..f399097008 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 <DC_NAME>\n"); + d_printf("samba-tool drs showrepl <DC_NAME>\n"); return 0; } diff --git a/source4/utils/net/net_gpo.c b/source4/samba_tool/gpo.c index 6cddd97508..65838d0712 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 <dn> [options]\n"); - d_printf("For a list of available options, please type net gpo show --help\n"); + d_printf("Syntax: samba-tool gpo show <dn> [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 <dn> [options]\n"); - d_printf("For a list of available options, please type net gpo getlink --help\n"); + d_printf("Syntax: samba-tool gpo getlink <dn> [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 <username> [options]\n"); - d_printf("For a list of available options, please type net gpo list --help\n"); + d_printf("Syntax: samba-tool gpo list <username> [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 <container> <gpo> ['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 <container> <gpo> ['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 <container> <gpo> [options]\n"); - d_printf("For a list of available options, please type net gpo dellink --help\n"); + d_printf("Syntax: samba-tool gpo dellink <container> <gpo> [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 <container> [options]\n"); - d_printf("For a list of available options, please type net gpo getinheritance --help\n"); + d_printf("Syntax: samba-tool gpo getinheritance <container> [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 <container> <\"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 <container> <\"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 <container> [options]\n"); - d_printf("For a list of available options, please type net gpo fetch --help\n"); + d_printf("Syntax: samba-tool gpo fetch <container> [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 <displayname> [options]\n"); - d_printf("For a list of available options, please type net gpo create --help\n"); + d_printf("Syntax: samba-tool gpo create <displayname> [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 <dn> <sddl> [options]\n"); - d_printf("For a list of available options, please type net gpo setacl --help\n"); + d_printf("Syntax: samba-tool gpo setacl <dn> <sddl> [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 <command> [options]\n"); - d_printf("For available commands, please type net gpo help\n"); + d_printf("Syntax: samba-tool gpo <command> [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 index 55f7c3c31d..96b845b69d 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 <http://www.gnu.org/licenses/>. */ #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 <command> [options]\n"); - return 0; + d_printf("samba-tool password <command> [options]\n"); + return 0; } diff --git a/source4/utils/net/net.c b/source4/samba_tool/samba_tool.c index 95b70ef01d..fd9e0e51d3 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 <http://www.gnu.org/licenses/>. */ - + /*****************************************************/ /* */ /* Distributed SMB/CIFS Server Management Utility */ @@ -43,7 +43,7 @@ #include <Python.h> #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 <command> [options]\n"); + d_printf("samba-tool <command> [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 index 16223a15bb..c8492e613b 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 <http://www.gnu.org/licenses/>. */ -#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 index c113ad7001..7f16c82668 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 <metze@samba.org> Copyright (C) 2005 Andrew Bartlett <abartlet@samba.org> @@ -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 <http://www.gnu.org/licenses/>. */ #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 0000000000..df4d2de58f --- /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 e43fefebda..e03234b3ca 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 5877f4f02c..a252a87d08 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 index adffad1cc7..451ae9d641 100755 --- a/source4/setup/tests/blackbox_group.sh +++ b/source4/setup/tests/blackbox_group.sh @@ -15,60 +15,60 @@ shift 1 rm -rf $PREFIX/simple-dc testit "simple-dc" $PYTHON ./setup/provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc -net="./bin/net" +samba_tool="./bin/samba-tool" CONFIG="--configfile=$PREFIX/simple-dc/etc/smb.conf" #creation of two test subjects -testit "newuser" $net newuser $CONFIG --given-name="User" --surname="Tester" --initial="UT" testuser testp@ssw0Rd -testit "newuser" $net newuser $CONFIG --given-name="User1" --surname="Tester" --initial="UT" testuser1 testp@ssw0Rd +testit "newuser" $samba_tool newuser $CONFIG --given-name="User" --surname="Tester" --initial="UT" testuser testp@ssw0Rd +testit "newuser" $samba_tool newuser $CONFIG --given-name="User1" --surname="Tester" --initial="UT" testuser1 testp@ssw0Rd #test creation of six different groups -testit "group add" $net group add $CONFIG --group-scope='Domain' --group-type='Security' --description='DomainSecurityGroup' --mail-address='dsg@samba.org' --notes='Notes' dsg -testit "group add" $net group add $CONFIG --group-scope='Global' --group-type='Security' --description='GlobalSecurityGroup' --mail-address='gsg@samba.org' --notes='Notes' gsg -testit "group add" $net group add $CONFIG --group-scope='Universal' --group-type='Security' --description='UniversalSecurityGroup' --mail-address='usg@samba.org' --notes='Notes' usg -testit "group add" $net group add $CONFIG --group-scope='Domain' --group-type='Distribution' --description='DomainDistributionGroup' --mail-address='ddg@samba.org' --notes='Notes' ddg -testit "group add" $net group add $CONFIG --group-scope='Global' --group-type='Distribution' --description='GlobalDistributionGroup' --mail-address='gdg@samba.org' --notes='Notes' gdg -testit "group add" $net group add $CONFIG --group-scope='Universal' --group-type='Distribution' --description='UniversalDistributionGroup' --mail-address='udg@samba.org' --notes='Notes' udg +testit "group add" $samba_tool group add $CONFIG --group-scope='Domain' --group-type='Security' --description='DomainSecurityGroup' --mail-address='dsg@samba.org' --notes='Notes' dsg +testit "group add" $samba_tool group add $CONFIG --group-scope='Global' --group-type='Security' --description='GlobalSecurityGroup' --mail-address='gsg@samba.org' --notes='Notes' gsg +testit "group add" $samba_tool group add $CONFIG --group-scope='Universal' --group-type='Security' --description='UniversalSecurityGroup' --mail-address='usg@samba.org' --notes='Notes' usg +testit "group add" $samba_tool group add $CONFIG --group-scope='Domain' --group-type='Distribution' --description='DomainDistributionGroup' --mail-address='ddg@samba.org' --notes='Notes' ddg +testit "group add" $samba_tool group add $CONFIG --group-scope='Global' --group-type='Distribution' --description='GlobalDistributionGroup' --mail-address='gdg@samba.org' --notes='Notes' gdg +testit "group add" $samba_tool group add $CONFIG --group-scope='Universal' --group-type='Distribution' --description='UniversalDistributionGroup' --mail-address='udg@samba.org' --notes='Notes' udg #test adding test users to all groups by their username -testit "group addmembers" $net group addmembers $CONFIG dsg newuser,newuser1 -testit "group addmembers" $net group addmembers $CONFIG gsg newuser,newuser1 -testit "group addmembers" $net group addmembers $CONFIG usg newuser,newuser1 -testit "group addmembers" $net group addmembers $CONFIG ddg newuser,newuser1 -testit "group addmembers" $net group addmembers $CONFIG gdg newuser,newuser1 -testit "group addmembers" $net group addmembers $CONFIG udg newuser,newuser1 +testit "group addmembers" $samba_tool group addmembers $CONFIG dsg newuser,newuser1 +testit "group addmembers" $samba_tool group addmembers $CONFIG gsg newuser,newuser1 +testit "group addmembers" $samba_tool group addmembers $CONFIG usg newuser,newuser1 +testit "group addmembers" $samba_tool group addmembers $CONFIG ddg newuser,newuser1 +testit "group addmembers" $samba_tool group addmembers $CONFIG gdg newuser,newuser1 +testit "group addmembers" $samba_tool group addmembers $CONFIG udg newuser,newuser1 #test removing test users from all groups by their username -testit "group removemembers" $net group removemembers $CONFIG dsg newuser,newuser1 -testit "group removemembers" $net group removemembers $CONFIG gsg newuser,newuser1 -testit "group removemembers" $net group removemembers $CONFIG usg newuser,newuser1 -testit "group removemembers" $net group removemembers $CONFIG ddg newuser,newuser1 -testit "group removemembers" $net group removemembers $CONFIG gdg newuser,newuser1 -testit "group removemembers" $net group removemembers $CONFIG udg newuser,newuser1 +testit "group removemembers" $samba_tool group removemembers $CONFIG dsg newuser,newuser1 +testit "group removemembers" $samba_tool group removemembers $CONFIG gsg newuser,newuser1 +testit "group removemembers" $samba_tool group removemembers $CONFIG usg newuser,newuser1 +testit "group removemembers" $samba_tool group removemembers $CONFIG ddg newuser,newuser1 +testit "group removemembers" $samba_tool group removemembers $CONFIG gdg newuser,newuser1 +testit "group removemembers" $samba_tool group removemembers $CONFIG udg newuser,newuser1 #test adding test users to all groups by their cn -#testit "group addmembers" $net group addmembers $CONFIG dsg "User UT. Tester,User1 UT. Tester" -#testit "group addmembers" $net group addmembers $CONFIG gsg "User UT. Tester,User1 UT. Tester" -#testit "group addmembers" $net group addmembers $CONFIG usg "User UT. Tester,User1 UT. Tester" -#testit "group addmembers" $net group addmembers $CONFIG ddg "User UT. Tester,User1 UT. Tester" -#testit "group addmembers" $net group addmembers $CONFIG gdg "User UT. Tester,User1 UT. Tester" -#testit "group addmembers" $net group addmembers $CONFIG udg "User UT. Tester,User1 UT. Tester" +#testit "group addmembers" $samba_tool group addmembers $CONFIG dsg "User UT. Tester,User1 UT. Tester" +#testit "group addmembers" $samba_tool group addmembers $CONFIG gsg "User UT. Tester,User1 UT. Tester" +#testit "group addmembers" $samba_tool group addmembers $CONFIG usg "User UT. Tester,User1 UT. Tester" +#testit "group addmembers" $samba_tool group addmembers $CONFIG ddg "User UT. Tester,User1 UT. Tester" +#testit "group addmembers" $samba_tool group addmembers $CONFIG gdg "User UT. Tester,User1 UT. Tester" +#testit "group addmembers" $samba_tool group addmembers $CONFIG udg "User UT. Tester,User1 UT. Tester" #test removing test users from all groups by their cn -#testit "group removemembers" $net group removemembers $CONFIG dsg "User UT. Tester,User1 UT. Tester" -#testit "group removemembers" $net group removemembers $CONFIG gsg "User UT. Tester,User1 UT. Tester" -#testit "group removemembers" $net group removemembers $CONFIG usg "User UT. Tester,User1 UT. Tester" -#testit "group removemembers" $net group removemembers $CONFIG ddg "User UT. Tester,User1 UT. Tester" -#testit "group removemembers" $net group removemembers $CONFIG gdg "User UT. Tester,User1 UT. Tester" -#testit "group removemembers" $net group removemembers $CONFIG ugg "User UT. Tester,User1 UT. Tester" +#testit "group removemembers" $samba_tool group removemembers $CONFIG dsg "User UT. Tester,User1 UT. Tester" +#testit "group removemembers" $samba_tool group removemembers $CONFIG gsg "User UT. Tester,User1 UT. Tester" +#testit "group removemembers" $samba_tool group removemembers $CONFIG usg "User UT. Tester,User1 UT. Tester" +#testit "group removemembers" $samba_tool group removemembers $CONFIG ddg "User UT. Tester,User1 UT. Tester" +#testit "group removemembers" $samba_tool group removemembers $CONFIG gdg "User UT. Tester,User1 UT. Tester" +#testit "group removemembers" $samba_tool group removemembers $CONFIG ugg "User UT. Tester,User1 UT. Tester" #test deletion of the groups -testit "group delete" $net group delete $CONFIG dsg -testit "group delete" $net group delete $CONFIG gsg -testit "group delete" $net group delete $CONFIG usg -testit "group delete" $net group delete $CONFIG ddg -testit "group delete" $net group delete $CONFIG gdg -testit "group delete" $net group delete $CONFIG udg +testit "group delete" $samba_tool group delete $CONFIG dsg +testit "group delete" $samba_tool group delete $CONFIG gsg +testit "group delete" $samba_tool group delete $CONFIG usg +testit "group delete" $samba_tool group delete $CONFIG ddg +testit "group delete" $samba_tool group delete $CONFIG gdg +testit "group delete" $samba_tool group delete $CONFIG udg exit $failed diff --git a/source4/setup/tests/blackbox_newuser.sh b/source4/setup/tests/blackbox_newuser.sh index e74950d25d..aa45964f00 100755 --- a/source4/setup/tests/blackbox_newuser.sh +++ b/source4/setup/tests/blackbox_newuser.sh @@ -15,28 +15,28 @@ shift 1 rm -rf $PREFIX/simple-dc testit "simple-dc" $PYTHON ./setup/provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc -net="./bin/net" +samba_tool="./bin/samba-tool" CONFIG="--configfile=$PREFIX/simple-dc/etc/smb.conf" #two test for creating new user #newuser account is created with cn=Given Name Initials. Surname #newuser1 account is created using cn=username -testit "newuser" $net newuser $CONFIG --given-name="User" --surname="Tester" --initials="T" --profile-path="\\\\myserver\\my\\profile" --script-path="\\\\myserver\\my\\script" --home-directory="\\\\myserver\\my\\homedir" --job-title="Tester" --department="Testing" --company="Samba.org" --description="Description" --mail-address="tester@samba.org" --internet-address="http://samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" NewUser testp@ssw0Rd -testit "newuser" $net newuser $CONFIG --use-username-as-cn --given-name="User1" --surname="Tester1" --initials="UT1" --profile-path="\\\\myserver\\my\\profile" --script-path="\\\\myserver\\my\\script" --home-directory="\\\\myserver\\my\\homedir" --job-title="Tester" --department="Testing" --company="Samba.org" --description="Description" --mail-address="tester@samba.org" --internet-address="http://samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" NewUser1 testp@ssw0Rd +testit "newuser" $samba_tool newuser $CONFIG --given-name="User" --surname="Tester" --initials="T" --profile-path="\\\\myserver\\my\\profile" --script-path="\\\\myserver\\my\\script" --home-directory="\\\\myserver\\my\\homedir" --job-title="Tester" --department="Testing" --company="Samba.org" --description="Description" --mail-address="tester@samba.org" --internet-address="http://samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" NewUser testp@ssw0Rd +testit "newuser" $samba_tool newuser $CONFIG --use-username-as-cn --given-name="User1" --surname="Tester1" --initials="UT1" --profile-path="\\\\myserver\\my\\profile" --script-path="\\\\myserver\\my\\script" --home-directory="\\\\myserver\\my\\homedir" --job-title="Tester" --department="Testing" --company="Samba.org" --description="Description" --mail-address="tester@samba.org" --internet-address="http://samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" NewUser1 testp@ssw0Rd # check the enable account script -testit "enableaccount" $net enableaccount $CONFIG NewUser -testit "enableaccount" $net enableaccount $CONFIG NewUser1 +testit "enableaccount" $samba_tool enableaccount $CONFIG NewUser +testit "enableaccount" $samba_tool enableaccount $CONFIG NewUser1 # check the enable account script -testit "setpassword" $net setpassword $CONFIG NewUser --newpassword=testp@ssw0Rd2 -testit "setpassword" $net setpassword $CONFIG NewUser1 --newpassword=testp@ssw0Rd2 +testit "setpassword" $samba_tool setpassword $CONFIG NewUser --newpassword=testp@ssw0Rd2 +testit "setpassword" $samba_tool setpassword $CONFIG NewUser1 --newpassword=testp@ssw0Rd2 # check the setexpiry script -testit "noexpiry" $net setexpiry $CONFIG NewUser --noexpiry -testit "noexpiry" $net setexpiry $CONFIG NewUser1 --noexpiry -testit "expiry" $net setexpiry $CONFIG NewUser --days=7 -testit "expiry" $net setexpiry $CONFIG NewUser1 --days=7 +testit "noexpiry" $samba_tool setexpiry $CONFIG NewUser --noexpiry +testit "noexpiry" $samba_tool setexpiry $CONFIG NewUser1 --noexpiry +testit "expiry" $samba_tool setexpiry $CONFIG NewUser --days=7 +testit "expiry" $samba_tool setexpiry $CONFIG NewUser1 --days=7 exit $failed diff --git a/source4/setup/tests/blackbox_setpassword.sh b/source4/setup/tests/blackbox_setpassword.sh index da81553179..6c405674c1 100755 --- a/source4/setup/tests/blackbox_setpassword.sh +++ b/source4/setup/tests/blackbox_setpassword.sh @@ -12,17 +12,17 @@ shift 1 . `dirname $0`/../../../testprogs/blackbox/subunit.sh -net="./bin/net" +samba_tool="./bin/samba-tool" rm -rf $PREFIX/simple-dc testit "simple-dc" $PYTHON ./setup/provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc -testit "newuser" $net newuser --configfile=$PREFIX/simple-dc/etc/smb.conf testuser testp@ssw0Rd +testit "newuser" $samba_tool newuser --configfile=$PREFIX/simple-dc/etc/smb.conf testuser testp@ssw0Rd -testit "setpassword" $net setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testp@ssw0Rd +testit "setpassword" $samba_tool setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testp@ssw0Rd -testit "setpassword" $net setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testp@ssw0Rd --must-change-at-next-login +testit "setpassword" $samba_tool setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testp@ssw0Rd --must-change-at-next-login -testit "pwsettings" $net pwsettings --quiet set --configfile=$PREFIX/simple-dc/etc/smb.conf --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=default --max-pwd-age=default +testit "pwsettings" $samba_tool pwsettings --quiet set --configfile=$PREFIX/simple-dc/etc/smb.conf --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=default --max-pwd-age=default exit $failed diff --git a/source4/setup/tests/blackbox_spn.sh b/source4/setup/tests/blackbox_spn.sh index f2fd8acfbb..515a06e437 100755 --- a/source4/setup/tests/blackbox_spn.sh +++ b/source4/setup/tests/blackbox_spn.sh @@ -13,21 +13,21 @@ shift 1 . `dirname $0`/../../../testprogs/blackbox/subunit.sh -net="./bin/net" +samba_tool="./bin/samba-tool" CONFIG="--configfile=$PREFIX/etc/smb.conf" #creation of two test subjects -testit "addspn" $net spn add FOO/bar Administrator $CONFIG -testit "delspn" $net spn delete FOO/bar $CONFIG -testit "readdspn" $net spn add FOO/bar Administrator $CONFIG -testit_expect_failure "failexistingspn" $net spn add FOO/bar Guest $CONFIG -testit "existingspnforce" $net spn add --force FOO/bar Guest $CONFIG -testit_expect_failure "faildelspnnotgooduser" $net spn delete FOO/bar krbtgt $CONFIG -testit_expect_failure "faildelspnmoreoneuser" $net spn delete FOO/bar $CONFIG -testit "deluserspn" $net spn delete FOO/bar Guest $CONFIG -testit "dellastuserspn" $net spn delete FOO/bar $CONFIG -testit_expect_failure "faildelspn" $net spn delete FOO/bar $CONFIG -testit_expect_failure "failaddspn" $net spn add FOO/bar nonexistinguser $CONFIG +testit "addspn" $samba_tool spn add FOO/bar Administrator $CONFIG +testit "delspn" $samba_tool spn delete FOO/bar $CONFIG +testit "readdspn" $samba_tool spn add FOO/bar Administrator $CONFIG +testit_expect_failure "failexistingspn" $samba_tool spn add FOO/bar Guest $CONFIG +testit "existingspnforce" $samba_tool spn add --force FOO/bar Guest $CONFIG +testit_expect_failure "faildelspnnotgooduser" $samba_tool spn delete FOO/bar krbtgt $CONFIG +testit_expect_failure "faildelspnmoreoneuser" $samba_tool spn delete FOO/bar $CONFIG +testit "deluserspn" $samba_tool spn delete FOO/bar Guest $CONFIG +testit "dellastuserspn" $samba_tool spn delete FOO/bar $CONFIG +testit_expect_failure "faildelspn" $samba_tool spn delete FOO/bar $CONFIG +testit_expect_failure "failaddspn" $samba_tool spn add FOO/bar nonexistinguser $CONFIG exit $failed diff --git a/source4/torture/drs/python/delete_object.py b/source4/torture/drs/python/delete_object.py index 0cf648f5a0..2936a5717f 100644 --- a/source4/torture/drs/python/delete_object.py +++ b/source4/torture/drs/python/delete_object.py @@ -77,7 +77,7 @@ class DrsDeleteObjectTestCase(samba.tests.TestCase): self.config_dn = self.info_dc1["configurationNamingContext"][0] self.forest_level = int(self.info_dc1["forestFunctionality"][0]) - # we will need DCs DNS names for 'net drs' command + # we will need DCs DNS names for 'samba-tool drs' command self.dnsname_dc1 = self.info_dc1["dnsHostName"][0] self.dnsname_dc2 = self.info_dc2["dnsHostName"][0] @@ -127,13 +127,13 @@ class DrsDeleteObjectTestCase(samba.tests.TestCase): def _net_drs_replicate(self, DC, fromDC): # find out where is net command - net_cmd = os.path.abspath("./bin/net") + samba_tool_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 drs replicate <Dest_DC_NAME> <Src_DC_NAME> <Naming Context> - cmd_line = "%s drs replicate %s %s %s %s" % (net_cmd, DC, fromDC, + # bin/samba-tool drs replicate <Dest_DC_NAME> <Src_DC_NAME> <Naming Context> + 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 251507413d..067ee2accb 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 032f68555a..0000000000 --- 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 48c766336d..0000000000 --- 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 index 09394f41be..0fb4c2afa8 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 80675c9895..9b22132940 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 6f2abab694..3982563a7d 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 2e65fe0088..3eb2343e88 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 ccbbcb9939..579389f97e 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 de7e31ea77..eb7cbf087b 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 e901f0f0db..9a5741b16b 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 |