Print this page
1575 untangle libmlrpc ... pre2:
 Get rid of ndr_rpc_server_{info,os}

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/smbsrv/libmlsvc/common/srvsvc_clnt.c
          +++ new/usr/src/lib/smbsrv/libmlsvc/common/srvsvc_clnt.c
↓ open down ↓ 342 lines elided ↑ open up ↑
 343  343          default:
 344  344                  smb_tracef("srvsvc: unknown level");
 345  345                  break;
 346  346          }
 347  347  
 348  348          srvsvc_close(&handle);
 349  349          return (0);
 350  350  }
 351  351  
 352  352  /*
 353      - * Windows 95+ and Windows NT4.0 both report the version as 4.0.
 354      - * Windows 2000+ reports the version as 5.x.
 355      - */
 356      -int
 357      -srvsvc_net_server_getinfo(char *server, char *domain,
 358      -    srvsvc_server_info_t *svinfo)
 359      -{
 360      -        mlsvc_handle_t handle;
 361      -        struct mslm_NetServerGetInfo arg;
 362      -        struct mslm_SERVER_INFO_101 *sv101;
 363      -        int len, opnum, rc;
 364      -        char user[SMB_USERNAME_MAXLEN];
 365      -
 366      -        smb_ipc_get_user(user, SMB_USERNAME_MAXLEN);
 367      -
 368      -        if (srvsvc_open(server, domain, user, &handle) != 0)
 369      -                return (-1);
 370      -
 371      -        opnum = SRVSVC_OPNUM_NetServerGetInfo;
 372      -        bzero(&arg, sizeof (arg));
 373      -
 374      -        len = strlen(server) + 4;
 375      -        arg.servername = ndr_rpc_malloc(&handle, len);
 376      -        if (arg.servername == NULL)
 377      -                return (-1);
 378      -
 379      -        (void) snprintf((char *)arg.servername, len, "\\\\%s", server);
 380      -        arg.level = 101;
 381      -
 382      -        rc = ndr_rpc_call(&handle, opnum, &arg);
 383      -        if ((rc != 0) || (arg.status != 0)) {
 384      -                srvsvc_close(&handle);
 385      -                return (-1);
 386      -        }
 387      -
 388      -        sv101 = arg.result.bufptr.bufptr101;
 389      -
 390      -        bzero(svinfo, sizeof (srvsvc_server_info_t));
 391      -        svinfo->sv_platform_id = sv101->sv101_platform_id;
 392      -        svinfo->sv_version_major = sv101->sv101_version_major;
 393      -        svinfo->sv_version_minor = sv101->sv101_version_minor;
 394      -        svinfo->sv_type = sv101->sv101_type;
 395      -        if (sv101->sv101_name)
 396      -                svinfo->sv_name = strdup((char *)sv101->sv101_name);
 397      -        if (sv101->sv101_comment)
 398      -                svinfo->sv_comment = strdup((char *)sv101->sv101_comment);
 399      -
 400      -        if (svinfo->sv_type & SV_TYPE_WFW)
 401      -                svinfo->sv_os = NATIVE_OS_WIN95;
 402      -        if (svinfo->sv_type & SV_TYPE_WINDOWS)
 403      -                svinfo->sv_os = NATIVE_OS_WIN95;
 404      -        if ((svinfo->sv_type & SV_TYPE_NT) ||
 405      -            (svinfo->sv_type & SV_TYPE_SERVER_NT))
 406      -                svinfo->sv_os = NATIVE_OS_WINNT;
 407      -        if (svinfo->sv_version_major > 4)
 408      -                svinfo->sv_os = NATIVE_OS_WIN2000;
 409      -
 410      -        srvsvc_close(&handle);
 411      -        return (0);
 412      -}
 413      -
 414      -/*
 415  353   * Compare the time here with the remote time on the server
 416  354   * and report clock skew.
 417  355   */
 418  356  void
 419  357  srvsvc_timecheck(char *server, char *domain)
 420  358  {
 421  359          char                    hostname[MAXHOSTNAMELEN];
 422  360          struct timeval          dc_tv;
 423  361          struct tm               dc_tm;
 424  362          struct tm               *tm;
↓ open down ↓ 155 lines elided ↑ open up ↑
 580  518                  tm->tm_min = tod->tod_mins;
 581  519                  tm->tm_hour = tod->tod_hours;
 582  520                  tm->tm_mday = tod->tod_day;
 583  521                  tm->tm_mon = tod->tod_month - 1;
 584  522                  tm->tm_year = tod->tod_year - 1900;
 585  523                  tm->tm_wday = tod->tod_weekday;
 586  524          }
 587  525  
 588  526          srvsvc_close(&handle);
 589  527          return (0);
 590      -}
 591      -
 592      -void
 593      -srvsvc_net_test(char *server, char *domain, char *netname)
 594      -{
 595      -        smb_domainex_t di;
 596      -        srvsvc_server_info_t svinfo;
 597      -
 598      -        (void) smb_tracef("%s %s %s", server, domain, netname);
 599      -
 600      -        if (smb_domain_getinfo(&di)) {
 601      -                server = di.d_dci.dc_name;
 602      -                domain = di.d_primary.di_nbname;
 603      -        }
 604      -
 605      -        if (srvsvc_net_server_getinfo(server, domain, &svinfo) == 0) {
 606      -                smb_tracef("NetServerGetInfo: %s %s (%d.%d) id=%d type=0x%08x",
 607      -                    svinfo.sv_name ? svinfo.sv_name : "NULL",
 608      -                    svinfo.sv_comment ? svinfo.sv_comment : "NULL",
 609      -                    svinfo.sv_version_major, svinfo.sv_version_minor,
 610      -                    svinfo.sv_platform_id, svinfo.sv_type);
 611      -
 612      -                free(svinfo.sv_name);
 613      -                free(svinfo.sv_comment);
 614      -        }
 615      -
 616      -        (void) srvsvc_net_share_get_info(server, domain, netname);
 617      -#if 0
 618      -        /*
 619      -         * The NetSessionEnum server-side definition was updated.
 620      -         * Disabled until the client-side has been updated.
 621      -         */
 622      -        (void) srvsvc_net_session_enum(server, domain, netname);
 623      -#endif
 624      -        (void) srvsvc_net_connect_enum(server, domain, netname, 0);
 625      -        (void) srvsvc_net_connect_enum(server, domain, netname, 1);
 626  528  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX