summaryrefslogtreecommitdiff
path: root/source4/utils/net/net_password.c
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2005-02-15 01:11:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:10:41 -0500
commit530d46f6748a17ca8500a861f53c0d4f451b2005 (patch)
tree2d48faf15fff2866be9eec548802ef5f28114b0d /source4/utils/net/net_password.c
parente428eee91b3506c0c02a35dbf01e55da2c73b547 (diff)
downloadsamba-530d46f6748a17ca8500a861f53c0d4f451b2005.tar.gz
samba-530d46f6748a17ca8500a861f53c0d4f451b2005.tar.bz2
samba-530d46f6748a17ca8500a861f53c0d4f451b2005.zip
r5400: Slightly better handling of help messages in net tool.
rafal (This used to be commit 5cebb4feedf7d6542c497fe55763d66f51b1c989)
Diffstat (limited to 'source4/utils/net/net_password.c')
-rw-r--r--source4/utils/net/net_password.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source4/utils/net/net_password.c b/source4/utils/net/net_password.c
index 773e18d661..fdc1a2e9a0 100644
--- a/source4/utils/net/net_password.c
+++ b/source4/utils/net/net_password.c
@@ -29,7 +29,6 @@
* Code for Changing and setting a password
*/
-
static int net_password_change(struct net_context *ctx, int argc, const char **argv)
{
NTSTATUS status;
@@ -99,8 +98,7 @@ static int net_password_set(struct net_context *ctx, int argc, const char **argv
switch (argc) {
case 0: /* no args -> fail */
- DEBUG(0,("net_password_set: no args\n"));
- return -1;
+ return net_password_usage(ctx, argc, argv);
case 1: /* only DOM\\user; prompt for password */
tmp = talloc_strdup(ctx->mem_ctx, argv[0]);
break;
@@ -110,7 +108,7 @@ static int net_password_set(struct net_context *ctx, int argc, const char **argv
break;
default: /* too mayn args -> fail */
DEBUG(0,("net_password_set: too many args [%d]\n",argc));
- return -1;
+ return net_password_usage(ctx, argc, argv);
}
if ((p = strchr_m(tmp,'\\'))) {
@@ -169,6 +167,7 @@ static int net_password_set_help(struct net_context *ctx, int argc, const char *
static const struct net_functable net_password_functable[] = {
{"change", net_password_change, net_password_change_usage, net_password_change_help},
{"set", net_password_set, net_password_set_usage, net_password_set_help},
+ {"help", net_password_help, net_password_help, net_password_help},
{NULL, NULL}
};
@@ -179,12 +178,14 @@ int net_password(struct net_context *ctx, int argc, const char **argv)
int net_password_usage(struct net_context *ctx, int argc, const char **argv)
{
- d_printf("net_password_usage: TODO\n");
+ d_printf("net password <command> [options]\n");
return 0;
}
int net_password_help(struct net_context *ctx, int argc, const char **argv)
{
- d_printf("net_password_help: TODO\n");
+ d_printf("Account password handling:\n");
+ d_printf("\tchange\t\tchanges password (old password required)\n");
+ d_printf("\tset\t\tsets password\n");
return 0;
}