In case of 'net rpc trustdom add' without domain name we were silently
authorRafal Szczesniak <mimir@samba.org>
Fri, 15 Aug 2003 21:57:59 +0000 (21:57 +0000)
committerRafal Szczesniak <mimir@samba.org>
Fri, 15 Aug 2003 21:57:59 +0000 (21:57 +0000)
asking for password without a piece of error message or explanation.

rafal
(This used to be commit d46793b33577f7e77b7632b016918e3ce175c238)

source3/utils/net_rpc.c

index 2f8743a1383db24531cc87dbee46a135b0538617..fefc5af3653d93e2efc9067020d3b8ed15e4ab76 100644 (file)
@@ -1707,8 +1707,13 @@ static NTSTATUS rpc_trustdom_add_internals(const DOM_SID *domain_sid, struct cli
 
 static int rpc_trustdom_add(int argc, const char **argv)
 {
-       return run_rpc_command(NULL, PI_SAMR, 0, rpc_trustdom_add_internals,
-                              argc, argv);
+       if (argc > 0) {
+               return run_rpc_command(NULL, PI_SAMR, 0, rpc_trustdom_add_internals,
+                                      argc, argv);
+       } else {
+               d_printf("Usage: net rpc trustdom add <domain>\n");
+               return -1;
+       }
 }