s3: Use cli_connect_nb in cli_servertime
authorVolker Lendecke <vl@samba.org>
Sat, 28 May 2011 18:52:06 +0000 (20:52 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 28 May 2011 18:50:10 +0000 (20:50 +0200)
source3/utils/net_time.c

index 0edb58c14a1dac795c3598e43edb5a9d8ab830fb..46ce558d89ece5a34eaba7142470f03e704c1ba5 100644 (file)
 */
 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"),