summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-04-04 16:48:23 +0000
committerJim McDonough <jmcd@samba.org>2002-04-04 16:48:23 +0000
commit773040a50fefdc6e75662333204d4784753450db (patch)
treeb37da43190bd70c7460aed62474f00f751f76c89
parente2745e88e508b261ce57eac0a252283542404849 (diff)
downloadsamba-773040a50fefdc6e75662333204d4784753450db.tar.gz
samba-773040a50fefdc6e75662333204d4784753450db.tar.bz2
samba-773040a50fefdc6e75662333204d4784753450db.zip
Cleanups to make auto-detection of method on net user smoother.
(This used to be commit 84ab1042a65e3c41a76f4726914140d505ef4625)
-rw-r--r--source3/utils/net_rap.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/utils/net_rap.c b/source3/utils/net_rap.c
index f9bb7300d8..13180c47c5 100644
--- a/source3/utils/net_rap.c
+++ b/source3/utils/net_rap.c
@@ -708,6 +708,7 @@ static int rap_user_info(int argc, const char **argv)
int net_rap_user(int argc, const char **argv)
{
+ int ret = -1;
struct functable func[] = {
{"ADD", rap_user_add},
{"INFO", rap_user_info},
@@ -717,22 +718,26 @@ int net_rap_user(int argc, const char **argv)
if (argc == 0) {
struct cli_state *cli;
- int ret;
if (!(cli = net_make_ipc_connection(0)))
- return -1;
+ goto done;
if (opt_long_list_entries) {
d_printf("\nUser name Comment"\
"\n-----------------------------\n");
ret = cli_RNetUserEnum(cli, long_user_fn, NULL);
cli_shutdown(cli);
- return ret;
+ goto done;
}
ret = cli_RNetUserEnum(cli, user_fn, NULL);
cli_shutdown(cli);
- return ret;
+ goto done;
}
- return net_run_function(argc, argv, func, net_rap_user_usage);
+ ret = net_run_function(argc, argv, func, net_rap_user_usage);
+ done:
+ if (ret != 0) {
+ DEBUG(1, ("Net user returned: %d\n", ret));
+ }
+ return ret;
}