Print this page
1575 untangle libmlrpc ... pre1:
Move srvsvc_timecheck where it belongs
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
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
25 25 */
26 26
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
27 27 /*
28 28 * Server Service (srvsvc) client side RPC library interface. The
29 29 * srvsvc interface allows a client to query a server for information
30 30 * on shares, sessions, connections and files on the server. Some
31 31 * functions are available via anonymous IPC while others require
32 32 * administrator privilege. Also, some functions return NT status
33 33 * values while others return Win32 errors codes.
34 34 */
35 35
36 36 #include <sys/errno.h>
37 +#include <sys/tzfile.h>
37 38 #include <stdio.h>
38 39 #include <time.h>
39 40 #include <strings.h>
41 +#include <unistd.h>
40 42
41 43 #include <smbsrv/libsmb.h>
42 44 #include <smbsrv/libmlsvc.h>
43 45 #include <smbsrv/smbinfo.h>
44 46 #include <smbsrv/ndl/srvsvc.ndl>
45 47
46 48 /*
47 49 * Information level for NetShareGetInfo.
48 50 */
49 51 DWORD srvsvc_info_level = 1;
50 52
51 53 /*
52 54 * Bind to the the SRVSVC.
53 55 *
54 56 * If username argument is NULL, an anonymous connection will be established.
55 57 * Otherwise, an authenticated connection will be established.
56 58 */
57 59 static int
58 60 srvsvc_open(char *server, char *domain, char *username, mlsvc_handle_t *handle)
59 61 {
60 62 smb_domainex_t di;
61 63
62 64 if (server == NULL || domain == NULL) {
63 65 if (!smb_domain_getinfo(&di))
64 66 return (-1);
65 67
66 68 server = di.d_dci.dc_name;
67 69 domain = di.d_primary.di_nbname;
68 70 }
69 71
70 72 if (username == NULL)
71 73 username = MLSVC_ANON_USER;
72 74
73 75 if (ndr_rpc_bind(handle, server, domain, username, "SRVSVC") != 0)
74 76 return (-1);
75 77
76 78 return (0);
77 79 }
78 80
79 81 /*
80 82 * Unbind the SRVSVC connection.
81 83 */
82 84 static void
83 85 srvsvc_close(mlsvc_handle_t *handle)
84 86 {
85 87 ndr_rpc_unbind(handle);
86 88 }
87 89
88 90 /*
89 91 * This is a client side routine for NetShareGetInfo.
90 92 * Levels 0 and 1 work with an anonymous connection but
91 93 * level 2 requires administrator access.
92 94 */
93 95 int
94 96 srvsvc_net_share_get_info(char *server, char *domain, char *netname)
95 97 {
96 98 struct mlsm_NetShareGetInfo arg;
97 99 mlsvc_handle_t handle;
98 100 int rc;
99 101 int opnum;
100 102 struct mslm_NetShareInfo_0 *info0;
101 103 struct mslm_NetShareInfo_1 *info1;
102 104 struct mslm_NetShareInfo_2 *info2;
103 105 int len;
104 106 char user[SMB_USERNAME_MAXLEN];
105 107
106 108 if (netname == NULL)
107 109 return (-1);
108 110
109 111 if (srvsvc_info_level == 2)
110 112 smb_ipc_get_user(user, SMB_USERNAME_MAXLEN);
111 113
112 114 if (srvsvc_open(server, domain, user, &handle) != 0)
113 115 return (-1);
114 116
115 117 opnum = SRVSVC_OPNUM_NetShareGetInfo;
116 118 bzero(&arg, sizeof (struct mlsm_NetShareGetInfo));
117 119
118 120 len = strlen(server) + 4;
119 121 arg.servername = ndr_rpc_malloc(&handle, len);
120 122 if (arg.servername == NULL) {
121 123 srvsvc_close(&handle);
122 124 return (-1);
123 125 }
124 126
125 127 (void) snprintf((char *)arg.servername, len, "\\\\%s", server);
126 128 arg.netname = (LPTSTR)netname;
127 129 arg.level = srvsvc_info_level; /* share information level */
128 130
129 131 rc = ndr_rpc_call(&handle, opnum, &arg);
130 132 if ((rc != 0) || (arg.status != 0)) {
131 133 srvsvc_close(&handle);
132 134 return (-1);
133 135 }
134 136
135 137 switch (arg.result.switch_value) {
136 138 case 0:
137 139 info0 = arg.result.ru.info0;
138 140 smb_tracef("srvsvc shi0_netname=%s", info0->shi0_netname);
139 141 break;
140 142
141 143 case 1:
142 144 info1 = arg.result.ru.info1;
143 145 smb_tracef("srvsvc shi1_netname=%s", info1->shi1_netname);
144 146 smb_tracef("srvsvc shi1_type=%u", info1->shi1_type);
145 147
146 148 if (info1->shi1_comment)
147 149 smb_tracef("srvsvc shi1_comment=%s",
148 150 info1->shi1_comment);
149 151 break;
150 152
151 153 case 2:
152 154 info2 = arg.result.ru.info2;
153 155 smb_tracef("srvsvc shi2_netname=%s", info2->shi2_netname);
154 156 smb_tracef("srvsvc shi2_type=%u", info2->shi2_type);
155 157
156 158 if (info2->shi2_comment)
157 159 smb_tracef("srvsvc shi2_comment=%s",
158 160 info2->shi2_comment);
159 161
160 162 smb_tracef("srvsvc shi2_perms=%d", info2->shi2_permissions);
161 163 smb_tracef("srvsvc shi2_max_use=%d", info2->shi2_max_uses);
162 164 smb_tracef("srvsvc shi2_cur_use=%d", info2->shi2_current_uses);
163 165
164 166 if (info2->shi2_path)
165 167 smb_tracef("srvsvc shi2_path=%s", info2->shi2_path);
166 168
167 169 if (info2->shi2_passwd)
168 170 smb_tracef("srvsvc shi2_passwd=%s", info2->shi2_passwd);
169 171 break;
170 172
171 173 default:
172 174 smb_tracef("srvsvc: unknown level");
173 175 break;
174 176 }
175 177
176 178 srvsvc_close(&handle);
177 179 return (0);
178 180 }
179 181
180 182 /*
181 183 * This is a client side routine for NetSessionEnum.
182 184 * NetSessionEnum requires administrator rights.
183 185 */
184 186 int
185 187 srvsvc_net_session_enum(char *server, char *domain, char *netname)
186 188 {
187 189 struct mslm_NetSessionEnum arg;
188 190 mlsvc_handle_t handle;
189 191 int rc;
190 192 int opnum;
191 193 struct mslm_infonres infonres;
192 194 struct mslm_SESSION_INFO_1 *nsi1;
193 195 int len;
194 196 char user[SMB_USERNAME_MAXLEN];
195 197
196 198 if (netname == NULL)
197 199 return (-1);
198 200
199 201 smb_ipc_get_user(user, SMB_USERNAME_MAXLEN);
200 202
201 203 rc = srvsvc_open(server, domain, user, &handle);
202 204 if (rc != 0)
203 205 return (-1);
204 206
205 207 opnum = SRVSVC_OPNUM_NetSessionEnum;
206 208 bzero(&arg, sizeof (struct mslm_NetSessionEnum));
207 209
208 210 len = strlen(server) + 4;
209 211 arg.servername = ndr_rpc_malloc(&handle, len);
210 212 if (arg.servername == NULL) {
211 213 srvsvc_close(&handle);
212 214 return (-1);
213 215 }
214 216
215 217 (void) snprintf((char *)arg.servername, len, "\\\\%s", server);
216 218 infonres.entriesread = 0;
217 219 infonres.entries = 0;
218 220 arg.level = 1;
219 221 arg.result.level = 1;
220 222 arg.result.bufptr.p = &infonres;
221 223 arg.resume_handle = 0;
222 224 arg.pref_max_len = 0xFFFFFFFF;
223 225
224 226 rc = ndr_rpc_call(&handle, opnum, &arg);
225 227 if ((rc != 0) || (arg.status != 0)) {
226 228 srvsvc_close(&handle);
227 229 return (-1);
228 230 }
229 231
230 232 /* Only the first session info is dereferenced. */
231 233 nsi1 = ((struct mslm_infonres *)arg.result.bufptr.p)->entries;
232 234
233 235 smb_tracef("srvsvc switch_value=%d", arg.level);
234 236 smb_tracef("srvsvc sesi1_cname=%s", nsi1->sesi1_cname);
235 237 smb_tracef("srvsvc sesi1_uname=%s", nsi1->sesi1_uname);
236 238 smb_tracef("srvsvc sesi1_nopens=%u", nsi1->sesi1_nopens);
237 239 smb_tracef("srvsvc sesi1_time=%u", nsi1->sesi1_time);
238 240 smb_tracef("srvsvc sesi1_itime=%u", nsi1->sesi1_itime);
239 241 smb_tracef("srvsvc sesi1_uflags=%u", nsi1->sesi1_uflags);
240 242
241 243 srvsvc_close(&handle);
242 244 return (0);
243 245 }
244 246
245 247 /*
246 248 * This is a client side routine for NetConnectEnum.
247 249 * NetConnectEnum requires administrator rights.
248 250 * Level 0 and level 1 requests are supported.
249 251 */
250 252 int
251 253 srvsvc_net_connect_enum(char *server, char *domain, char *netname, int level)
252 254 {
253 255 struct mslm_NetConnectEnum arg;
254 256 mlsvc_handle_t handle;
255 257 int rc;
256 258 int opnum;
257 259 struct mslm_NetConnectInfo1 info1;
258 260 struct mslm_NetConnectInfo0 info0;
259 261 struct mslm_NetConnectInfoBuf1 *cib1;
260 262 int len;
261 263 char user[SMB_USERNAME_MAXLEN];
262 264
263 265 if (netname == NULL)
264 266 return (-1);
265 267
266 268 smb_ipc_get_user(user, SMB_USERNAME_MAXLEN);
267 269
268 270 rc = srvsvc_open(server, domain, user, &handle);
269 271 if (rc != 0)
270 272 return (-1);
271 273
272 274 opnum = SRVSVC_OPNUM_NetConnectEnum;
273 275 bzero(&arg, sizeof (struct mslm_NetConnectEnum));
274 276
275 277 len = strlen(server) + 4;
276 278 arg.servername = ndr_rpc_malloc(&handle, len);
277 279 if (arg.servername == NULL) {
278 280 srvsvc_close(&handle);
279 281 return (-1);
280 282 }
281 283
282 284 (void) snprintf((char *)arg.servername, len, "\\\\%s", server);
283 285 arg.qualifier = (LPTSTR)netname;
284 286
285 287 switch (level) {
286 288 case 0:
287 289 arg.info.level = 0;
288 290 arg.info.switch_value = 0;
289 291 arg.info.ru.info0 = &info0;
290 292 info0.entries_read = 0;
291 293 info0.ci0 = 0;
292 294 break;
293 295 case 1:
294 296 arg.info.level = 1;
295 297 arg.info.switch_value = 1;
296 298 arg.info.ru.info1 = &info1;
297 299 info1.entries_read = 0;
298 300 info1.ci1 = 0;
299 301 break;
300 302 default:
301 303 srvsvc_close(&handle);
302 304 return (-1);
303 305 }
304 306
305 307 arg.resume_handle = 0;
306 308 arg.pref_max_len = 0xFFFFFFFF;
307 309
308 310 rc = ndr_rpc_call(&handle, opnum, &arg);
309 311 if ((rc != 0) || (arg.status != 0)) {
310 312 srvsvc_close(&handle);
311 313 return (-1);
312 314 }
313 315
314 316 smb_tracef("srvsvc switch_value=%d", arg.info.switch_value);
315 317
316 318 switch (level) {
317 319 case 0:
318 320 if (arg.info.ru.info0 && arg.info.ru.info0->ci0) {
319 321 smb_tracef("srvsvc coni0_id=%x",
320 322 arg.info.ru.info0->ci0->coni0_id);
321 323 }
322 324 break;
323 325 case 1:
324 326 if (arg.info.ru.info1 && arg.info.ru.info1->ci1) {
325 327 cib1 = arg.info.ru.info1->ci1;
326 328
327 329 smb_tracef("srvsvc coni_uname=%s",
328 330 cib1->coni1_username ?
329 331 (char *)cib1->coni1_username : "(null)");
330 332 smb_tracef("srvsvc coni1_netname=%s",
331 333 cib1->coni1_netname ?
332 334 (char *)cib1->coni1_netname : "(null)");
333 335 smb_tracef("srvsvc coni1_nopens=%u",
334 336 cib1->coni1_num_opens);
335 337 smb_tracef("srvsvc coni1_time=%u", cib1->coni1_time);
336 338 smb_tracef("srvsvc coni1_num_users=%u",
337 339 cib1->coni1_num_users);
338 340 }
339 341 break;
340 342
341 343 default:
342 344 smb_tracef("srvsvc: unknown level");
343 345 break;
344 346 }
345 347
346 348 srvsvc_close(&handle);
347 349 return (0);
348 350 }
349 351
350 352 /*
351 353 * Windows 95+ and Windows NT4.0 both report the version as 4.0.
352 354 * Windows 2000+ reports the version as 5.x.
353 355 */
354 356 int
355 357 srvsvc_net_server_getinfo(char *server, char *domain,
356 358 srvsvc_server_info_t *svinfo)
357 359 {
358 360 mlsvc_handle_t handle;
359 361 struct mslm_NetServerGetInfo arg;
360 362 struct mslm_SERVER_INFO_101 *sv101;
361 363 int len, opnum, rc;
362 364 char user[SMB_USERNAME_MAXLEN];
363 365
364 366 smb_ipc_get_user(user, SMB_USERNAME_MAXLEN);
365 367
366 368 if (srvsvc_open(server, domain, user, &handle) != 0)
367 369 return (-1);
368 370
369 371 opnum = SRVSVC_OPNUM_NetServerGetInfo;
370 372 bzero(&arg, sizeof (arg));
371 373
372 374 len = strlen(server) + 4;
373 375 arg.servername = ndr_rpc_malloc(&handle, len);
374 376 if (arg.servername == NULL)
375 377 return (-1);
376 378
377 379 (void) snprintf((char *)arg.servername, len, "\\\\%s", server);
378 380 arg.level = 101;
379 381
380 382 rc = ndr_rpc_call(&handle, opnum, &arg);
381 383 if ((rc != 0) || (arg.status != 0)) {
382 384 srvsvc_close(&handle);
383 385 return (-1);
384 386 }
385 387
386 388 sv101 = arg.result.bufptr.bufptr101;
387 389
388 390 bzero(svinfo, sizeof (srvsvc_server_info_t));
389 391 svinfo->sv_platform_id = sv101->sv101_platform_id;
390 392 svinfo->sv_version_major = sv101->sv101_version_major;
391 393 svinfo->sv_version_minor = sv101->sv101_version_minor;
392 394 svinfo->sv_type = sv101->sv101_type;
393 395 if (sv101->sv101_name)
394 396 svinfo->sv_name = strdup((char *)sv101->sv101_name);
395 397 if (sv101->sv101_comment)
396 398 svinfo->sv_comment = strdup((char *)sv101->sv101_comment);
397 399
398 400 if (svinfo->sv_type & SV_TYPE_WFW)
399 401 svinfo->sv_os = NATIVE_OS_WIN95;
400 402 if (svinfo->sv_type & SV_TYPE_WINDOWS)
401 403 svinfo->sv_os = NATIVE_OS_WIN95;
↓ open down ↓ |
352 lines elided |
↑ open up ↑ |
402 404 if ((svinfo->sv_type & SV_TYPE_NT) ||
403 405 (svinfo->sv_type & SV_TYPE_SERVER_NT))
404 406 svinfo->sv_os = NATIVE_OS_WINNT;
405 407 if (svinfo->sv_version_major > 4)
406 408 svinfo->sv_os = NATIVE_OS_WIN2000;
407 409
408 410 srvsvc_close(&handle);
409 411 return (0);
410 412 }
411 413
414 +/*
415 + * Compare the time here with the remote time on the server
416 + * and report clock skew.
417 + */
418 +void
419 +srvsvc_timecheck(char *server, char *domain)
420 +{
421 + char hostname[MAXHOSTNAMELEN];
422 + struct timeval dc_tv;
423 + struct tm dc_tm;
424 + struct tm *tm;
425 + time_t tnow;
426 + time_t tdiff;
427 + int priority;
428 +
429 + if (srvsvc_net_remote_tod(server, domain, &dc_tv, &dc_tm) < 0) {
430 + syslog(LOG_DEBUG, "srvsvc_net_remote_tod failed");
431 + return;
432 + }
433 +
434 + tnow = time(NULL);
435 +
436 + if (tnow > dc_tv.tv_sec)
437 + tdiff = (tnow - dc_tv.tv_sec) / SECSPERMIN;
438 + else
439 + tdiff = (dc_tv.tv_sec - tnow) / SECSPERMIN;
440 +
441 + if (tdiff != 0) {
442 + (void) strlcpy(hostname, "localhost", MAXHOSTNAMELEN);
443 + (void) gethostname(hostname, MAXHOSTNAMELEN);
444 +
445 + priority = (tdiff > 2) ? LOG_NOTICE : LOG_DEBUG;
446 + syslog(priority, "DC [%s] clock skew detected: %u minutes",
447 + server, tdiff);
448 +
449 + tm = gmtime(&dc_tv.tv_sec);
450 + syslog(priority, "%-8s UTC: %s", server, asctime(tm));
451 + tm = gmtime(&tnow);
452 + syslog(priority, "%-8s UTC: %s", hostname, asctime(tm));
453 + }
454 +}
455 +
412 456 /*
413 457 * Synchronize the local system clock with the domain controller.
414 458 */
415 459 void
416 460 srvsvc_timesync(void)
417 461 {
418 462 smb_domainex_t di;
419 463 struct timeval tv;
420 464 struct tm tm;
421 465 time_t tsecs;
422 466
423 467 if (!smb_domain_getinfo(&di))
424 468 return;
425 469
426 470 if (srvsvc_net_remote_tod(di.d_dci.dc_name, di.d_primary.di_nbname,
427 471 &tv, &tm) != 0)
428 472 return;
429 473
430 474 if (settimeofday(&tv, 0))
431 475 smb_tracef("unable to set system time");
432 476
433 477 tsecs = time(0);
434 478 (void) localtime_r(&tsecs, &tm);
435 479 smb_tracef("SrvsvcTimeSync %s", ctime((time_t *)&tv.tv_sec));
436 480 }
437 481
438 482 /*
439 483 * NetRemoteTOD to get the current GMT time from a Windows NT server.
440 484 */
441 485 int
442 486 srvsvc_gettime(unsigned long *t)
443 487 {
444 488 smb_domainex_t di;
445 489 struct timeval tv;
446 490 struct tm tm;
447 491
448 492 if (!smb_domain_getinfo(&di))
449 493 return (-1);
450 494
451 495 if (srvsvc_net_remote_tod(di.d_dci.dc_name, di.d_primary.di_nbname,
452 496 &tv, &tm) != 0)
453 497 return (-1);
454 498
455 499 *t = tv.tv_sec;
456 500 return (0);
457 501 }
458 502
459 503 /*
460 504 * This is a client side routine for NetRemoteTOD, which gets the time
461 505 * and date from a remote system. The time information is returned in
462 506 * the timeval and tm.
463 507 *
464 508 * typedef struct _TIME_OF_DAY_INFO {
465 509 * DWORD tod_elapsedt; // seconds since 00:00:00 January 1 1970 GMT
466 510 * DWORD tod_msecs; // arbitrary milliseconds (since reset)
467 511 * DWORD tod_hours; // current hour [0-23]
468 512 * DWORD tod_mins; // current minute [0-59]
469 513 * DWORD tod_secs; // current second [0-59]
470 514 * DWORD tod_hunds; // current hundredth (0.01) second [0-99]
471 515 * LONG tod_timezone; // time zone of the server
472 516 * DWORD tod_tinterval; // clock tick time interval
473 517 * DWORD tod_day; // day of the month [1-31]
474 518 * DWORD tod_month; // month of the year [1-12]
475 519 * DWORD tod_year; // current year
476 520 * DWORD tod_weekday; // day of the week since sunday [0-6]
477 521 * } TIME_OF_DAY_INFO;
478 522 *
479 523 * The time zone of the server is calculated in minutes from Greenwich
480 524 * Mean Time (GMT). For time zones west of Greenwich, the value is
481 525 * positive; for time zones east of Greenwich, the value is negative.
482 526 * A value of -1 indicates that the time zone is undefined.
483 527 *
484 528 * The clock tick value represents a resolution of one ten-thousandth
485 529 * (0.0001) second.
486 530 */
487 531 int
488 532 srvsvc_net_remote_tod(char *server, char *domain, struct timeval *tv,
489 533 struct tm *tm)
490 534 {
491 535 struct mslm_NetRemoteTOD arg;
492 536 struct mslm_TIME_OF_DAY_INFO *tod;
493 537 mlsvc_handle_t handle;
494 538 int rc;
495 539 int opnum;
496 540 int len;
497 541 char user[SMB_USERNAME_MAXLEN];
498 542
499 543 smb_ipc_get_user(user, SMB_USERNAME_MAXLEN);
500 544
501 545 rc = srvsvc_open(server, domain, user, &handle);
502 546 if (rc != 0)
503 547 return (-1);
504 548
505 549 opnum = SRVSVC_OPNUM_NetRemoteTOD;
506 550 bzero(&arg, sizeof (struct mslm_NetRemoteTOD));
507 551
508 552 len = strlen(server) + 4;
509 553 arg.servername = ndr_rpc_malloc(&handle, len);
510 554 if (arg.servername == NULL) {
511 555 srvsvc_close(&handle);
512 556 return (-1);
513 557 }
514 558
515 559 (void) snprintf((char *)arg.servername, len, "\\\\%s", server);
516 560
517 561 rc = ndr_rpc_call(&handle, opnum, &arg);
518 562 if ((rc != 0) || (arg.status != 0)) {
519 563 srvsvc_close(&handle);
520 564 return (-1);
521 565 }
522 566
523 567 /*
524 568 * We're assigning milliseconds to microseconds
525 569 * here but the value's not really relevant.
526 570 */
527 571 tod = arg.bufptr;
528 572
529 573 if (tv) {
530 574 tv->tv_sec = tod->tod_elapsedt;
531 575 tv->tv_usec = tod->tod_msecs;
532 576 }
533 577
534 578 if (tm) {
535 579 tm->tm_sec = tod->tod_secs;
536 580 tm->tm_min = tod->tod_mins;
537 581 tm->tm_hour = tod->tod_hours;
538 582 tm->tm_mday = tod->tod_day;
539 583 tm->tm_mon = tod->tod_month - 1;
540 584 tm->tm_year = tod->tod_year - 1900;
541 585 tm->tm_wday = tod->tod_weekday;
542 586 }
543 587
544 588 srvsvc_close(&handle);
545 589 return (0);
546 590 }
547 591
548 592 void
549 593 srvsvc_net_test(char *server, char *domain, char *netname)
550 594 {
551 595 smb_domainex_t di;
552 596 srvsvc_server_info_t svinfo;
553 597
554 598 (void) smb_tracef("%s %s %s", server, domain, netname);
555 599
556 600 if (smb_domain_getinfo(&di)) {
557 601 server = di.d_dci.dc_name;
558 602 domain = di.d_primary.di_nbname;
559 603 }
560 604
561 605 if (srvsvc_net_server_getinfo(server, domain, &svinfo) == 0) {
562 606 smb_tracef("NetServerGetInfo: %s %s (%d.%d) id=%d type=0x%08x",
563 607 svinfo.sv_name ? svinfo.sv_name : "NULL",
564 608 svinfo.sv_comment ? svinfo.sv_comment : "NULL",
565 609 svinfo.sv_version_major, svinfo.sv_version_minor,
566 610 svinfo.sv_platform_id, svinfo.sv_type);
567 611
568 612 free(svinfo.sv_name);
569 613 free(svinfo.sv_comment);
570 614 }
571 615
572 616 (void) srvsvc_net_share_get_info(server, domain, netname);
573 617 #if 0
574 618 /*
575 619 * The NetSessionEnum server-side definition was updated.
576 620 * Disabled until the client-side has been updated.
577 621 */
578 622 (void) srvsvc_net_session_enum(server, domain, netname);
579 623 #endif
580 624 (void) srvsvc_net_connect_enum(server, domain, netname, 0);
581 625 (void) srvsvc_net_connect_enum(server, domain, netname, 1);
582 626 }
↓ open down ↓ |
161 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX