summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/net_time.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c
index 0edb58c14a..46ce558d89 100644
--- a/source3/utils/net_time.c
+++ b/source3/utils/net_time.c
@@ -26,34 +26,18 @@
*/
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, global_myname(),
+ 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"),