summaryrefslogtreecommitdiff
path: root/source3/utils/net_time.c
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2008-05-19 00:33:02 +0200
committerKai Blin <kai@samba.org>2008-06-10 09:46:03 +0200
commit6e8d46d40df86a8f6c5820852eb1eab95049be41 (patch)
tree1b6a159b072da93ecd42fbd02f67c4251a346e0b /source3/utils/net_time.c
parent8efc535a4a5d02fe8e887d916213f1a0f0dda0af (diff)
downloadsamba-6e8d46d40df86a8f6c5820852eb1eab95049be41.tar.gz
samba-6e8d46d40df86a8f6c5820852eb1eab95049be41.tar.bz2
samba-6e8d46d40df86a8f6c5820852eb1eab95049be41.zip
net: Don't try to look up a server if net time is called with a command.
(This used to be commit 37ef7c28163a5c538f325729855ec47ef6fac6bd)
Diffstat (limited to 'source3/utils/net_time.c')
-rw-r--r--source3/utils/net_time.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c
index 73f0315b1d..f8eb2b45a0 100644
--- a/source3/utils/net_time.c
+++ b/source3/utils/net_time.c
@@ -19,7 +19,6 @@
#include "includes.h"
#include "utils/net.h"
-
/*
return the time on a server. This does not require any authentication
*/
@@ -169,9 +168,14 @@ int net_time(struct net_context *c, int argc, const char **argv)
{"SYSTEM", net_time_system},
{"SET", net_time_set},
{"ZONE", net_time_zone},
+ {"HELP", net_time_usage},
{NULL, NULL}
};
+ if (argc != 0) {
+ return net_run_function(c, argc, argv, func, net_time_usage);
+ }
+
if (!c->opt_host && !c->opt_have_ip &&
!find_master_ip(c->opt_target_workgroup, &c->opt_dest_ip)) {
d_fprintf(stderr, "Could not locate a time server. Try "\
@@ -180,10 +184,6 @@ int net_time(struct net_context *c, int argc, const char **argv)
return -1;
}
- if (argc != 0) {
- return net_run_function(c, argc, argv, func, net_time_usage);
- }
-
/* default - print the time */
t = cli_servertime(c->opt_host, c->opt_have_ip? &c->opt_dest_ip : NULL,
NULL);