summaryrefslogtreecommitdiff
path: root/source3/utils/net_time.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-06-24 16:26:23 +1000
commit6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch)
tree850c71039563c16a5d563c47e7ba2ab645baf198 /source3/utils/net_time.c
parent6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff)
parent2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff)
downloadsamba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz
samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2
samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/utils/net_time.c')
-rw-r--r--source3/utils/net_time.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c
index fdb46dbba5..9b6293ed49 100644
--- a/source3/utils/net_time.c
+++ b/source3/utils/net_time.c
@@ -19,40 +19,25 @@
#include "includes.h"
#include "utils/net.h"
#include "libsmb/nmblib.h"
+#include "libsmb/libsmb.h"
/*
return the time on a server. This does not require any authentication
*/
static time_t cli_servertime(const char *host, struct sockaddr_storage *pss, int *zone)
{
- struct nmb_name calling, called;
time_t ret = 0;
struct cli_state *cli = NULL;
NTSTATUS status;
- cli = cli_initialise();
- if (!cli) {
- goto done;
- }
-
- status = cli_connect(cli, host, pss);
+ status = cli_connect_nb(host, pss, 0, 0x20, lp_netbios_name(),
+ Undefined, &cli);
if (!NT_STATUS_IS_OK(status)) {
fprintf(stderr, _("Can't contact server %s. Error %s\n"),
host, nt_errstr(status));
goto done;
}
- make_nmb_name(&calling, global_myname(), 0x0);
- if (host) {
- make_nmb_name(&called, host, 0x20);
- } else {
- make_nmb_name(&called, "*SMBSERVER", 0x20);
- }
-
- if (!cli_session_request(cli, &calling, &called)) {
- fprintf(stderr, _("Session request failed\n"));
- goto done;
- }
status = cli_negprot(cli);
if (!NT_STATUS_IS_OK(status)) {
fprintf(stderr, _("Protocol negotiation failed: %s\n"),