2 * Unix SMB/Netbios implementation.
4 * RPC Pipe client / server routines
5 * Copyright (C) Andrew Tridgell 1992-1997,
6 * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
7 * Copyright (C) Paul Ashton 1997.
8 * Copyright (C) Jeremy Allison 2001.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 /* This is the implementation of the srvsvc pipe. */
29 extern int DEBUGLEVEL
;
30 extern pstring global_myname
;
32 /*******************************************************************
33 Fill in a share info level 1 structure.
34 ********************************************************************/
36 static void init_srv_share_info_1(SRV_SHARE_INFO_1
*sh1
, int snum
)
43 pstrcpy(net_name
, lp_servicename(snum
));
44 pstrcpy(remark
, lp_comment(snum
));
45 pstring_sub(remark
,"%S",lp_servicename(snum
));
46 len_net_name
= strlen(net_name
);
48 /* work out the share type */
49 type
= STYPE_DISKTREE
;
51 if (lp_print_ok(snum
))
53 if (strequal("IPC", lp_fstype(snum
)))
55 if (net_name
[len_net_name
] == '$')
58 init_srv_share_info1(&sh1
->info_1
, net_name
, type
, remark
);
59 init_srv_share_info1_str(&sh1
->info_1_str
, net_name
, remark
);
62 /*******************************************************************
63 Fill in a share info level 2 structure.
64 ********************************************************************/
66 static void init_srv_share_info_2(SRV_SHARE_INFO_2
*sh2
, int snum
)
75 pstrcpy(net_name
, lp_servicename(snum
));
76 pstrcpy(remark
, lp_comment(snum
));
77 pstring_sub(remark
,"%S",lp_servicename(snum
));
78 pstrcpy(path
, lp_pathname(snum
));
80 len_net_name
= strlen(net_name
);
82 /* work out the share type */
83 type
= STYPE_DISKTREE
;
85 if (lp_print_ok(snum
))
87 if (strequal("IPC", lp_fstype(snum
)))
89 if (net_name
[len_net_name
] == '$')
92 init_srv_share_info2(&sh2
->info_2
, net_name
, type
, remark
, 0, 0xffffffff, 1, path
, passwd
);
93 init_srv_share_info2_str(&sh2
->info_2_str
, net_name
, remark
, path
, passwd
);
96 /***************************************************************************
97 Fill in a share info level 1005 structure.
98 ***************************************************************************/
100 static void init_srv_share_info_1005(SRV_SHARE_INFO_1005
* sh1005
, int snum
)
102 sh1005
->dfs_root_flag
= 0;
105 if(lp_host_msdfs() && lp_msdfs_root(snum
))
106 sh1005
->dfs_root_flag
= 3;
111 /*******************************************************************
112 Fill in a share info structure.
113 ********************************************************************/
115 static BOOL
init_srv_share_info_ctr(TALLOC_CTX
*ctx
, SRV_SHARE_INFO_CTR
*ctr
,
116 uint32 info_level
, uint32
*resume_hnd
, uint32
*total_entries
)
119 int num_services
= lp_numservices();
122 DEBUG(5,("init_srv_share_info_ctr\n"));
126 ctr
->info_level
= ctr
->switch_value
= info_level
;
129 /* Count the number of entries. */
130 for (snum
= 0; snum
< num_services
; snum
++) {
131 if (lp_browseable(snum
) && lp_snum_ok(snum
))
135 *total_entries
= num_entries
;
136 ctr
->num_entries2
= ctr
->num_entries
= num_entries
;
137 ctr
->ptr_share_info
= ctr
->ptr_entries
= 1;
142 switch (info_level
) {
145 SRV_SHARE_INFO_1
*info1
;
148 info1
= talloc(ctx
, num_entries
* sizeof(SRV_SHARE_INFO_1
));
150 for (snum
= *resume_hnd
; snum
< num_services
; snum
++) {
151 if (lp_browseable(snum
) && lp_snum_ok(snum
)) {
152 init_srv_share_info_1(&info1
[i
++], snum
);
156 ctr
->share
.info1
= info1
;
162 SRV_SHARE_INFO_2
*info2
;
165 info2
= talloc(ctx
, num_entries
* sizeof(SRV_SHARE_INFO_2
));
167 for (snum
= *resume_hnd
; snum
< num_services
; snum
++) {
168 if (lp_browseable(snum
) && lp_snum_ok(snum
)) {
169 init_srv_share_info_2(&info2
[i
++], snum
);
173 ctr
->share
.info2
= info2
;
178 DEBUG(5,("init_srv_share_info_ctr: unsupported switch value %d\n", info_level
));
185 /*******************************************************************
186 Inits a SRV_R_NET_SHARE_ENUM structure.
187 ********************************************************************/
189 static void init_srv_r_net_share_enum(TALLOC_CTX
*ctx
, SRV_R_NET_SHARE_ENUM
*r_n
,
190 uint32 info_level
, uint32 resume_hnd
)
192 DEBUG(5,("init_srv_r_net_share_enum: %d\n", __LINE__
));
194 if (init_srv_share_info_ctr(ctx
, &r_n
->ctr
, info_level
,
195 &resume_hnd
, &r_n
->total_entries
)) {
196 r_n
->status
= NT_STATUS_NOPROBLEMO
;
198 r_n
->status
= NT_STATUS_INVALID_INFO_CLASS
;
201 init_enum_hnd(&r_n
->enum_hnd
, resume_hnd
);
204 /*******************************************************************
205 Inits a SRV_R_NET_SHARE_GET_INFO structure.
206 ********************************************************************/
208 static void init_srv_r_net_share_get_info(SRV_R_NET_SHARE_GET_INFO
*r_n
,
209 char *share_name
, uint32 info_level
)
211 uint32 status
= NT_STATUS_NOPROBLEMO
;
214 DEBUG(5,("init_srv_r_net_share_get_info: %d\n", __LINE__
));
216 r_n
->switch_value
= info_level
;
218 snum
= find_service(share_name
);
221 switch (info_level
) {
223 init_srv_share_info_1(&r_n
->share
.info1
, snum
);
226 init_srv_share_info_2(&r_n
->share
.info2
, snum
);
229 init_srv_share_info_1005(&r_n
->share
.info1005
, snum
);
232 DEBUG(5,("init_srv_net_share_get_info: unsupported switch value %d\n", info_level
));
233 status
= NT_STATUS_INVALID_INFO_CLASS
;
237 status
= NT_STATUS_BAD_NETWORK_NAME
;
240 r_n
->ptr_share_ctr
= (status
== NT_STATUS_NOPROBLEMO
) ? 1 : 0;
241 r_n
->status
= status
;
244 /*******************************************************************
245 fill in a sess info level 1 structure.
246 ********************************************************************/
248 static void init_srv_sess_0_info(SESS_INFO_0
*se0
, SESS_INFO_0_STR
*str0
, char *name
)
250 init_srv_sess_info0(se0
, name
);
251 init_srv_sess_info0_str(str0
, name
);
254 /*******************************************************************
255 fill in a sess info level 0 structure.
256 ********************************************************************/
258 static void init_srv_sess_info_0(SRV_SESS_INFO_0
*ss0
, uint32
*snum
, uint32
*stot
)
260 uint32 num_entries
= 0;
268 DEBUG(5,("init_srv_sess_0_ss0\n"));
271 for (; (*snum
) < (*stot
) && num_entries
< MAX_SESS_ENTRIES
; (*snum
)++) {
272 init_srv_sess_0_info(&ss0
->info_0
[num_entries
],
273 &ss0
->info_0_str
[num_entries
], "MACHINE");
275 /* move on to creating next session */
276 /* move on to creating next sess */
280 ss0
->num_entries_read
= num_entries
;
281 ss0
->ptr_sess_info
= num_entries
> 0 ? 1 : 0;
282 ss0
->num_entries_read2
= num_entries
;
284 if ((*snum
) >= (*stot
)) {
289 ss0
->num_entries_read
= 0;
290 ss0
->ptr_sess_info
= 0;
291 ss0
->num_entries_read2
= 0;
295 /*******************************************************************
296 fill in a sess info level 1 structure.
297 ********************************************************************/
299 static void init_srv_sess_1_info(SESS_INFO_1
*se1
, SESS_INFO_1_STR
*str1
,
300 char *name
, char *user
,
302 uint32 open_time
, uint32 idle_time
,
305 init_srv_sess_info1(se1
, name
, user
, num_opens
, open_time
, idle_time
, usr_flgs
);
306 init_srv_sess_info1_str(str1
, name
, user
);
309 /*******************************************************************
310 fill in a sess info level 1 structure.
311 ********************************************************************/
313 static void init_srv_sess_info_1(SRV_SESS_INFO_1
*ss1
, uint32
*snum
, uint32
*stot
)
315 uint32 num_entries
= 0;
323 DEBUG(5,("init_srv_sess_1_ss1\n"));
326 for (; (*snum
) < (*stot
) && num_entries
< MAX_SESS_ENTRIES
; (*snum
)++) {
327 init_srv_sess_1_info(&ss1
->info_1
[num_entries
],
328 &ss1
->info_1_str
[num_entries
],
329 "MACHINE", "dummy_user", 1, 10, 5, 0);
331 /* move on to creating next session */
332 /* move on to creating next sess */
336 ss1
->num_entries_read
= num_entries
;
337 ss1
->ptr_sess_info
= num_entries
> 0 ? 1 : 0;
338 ss1
->num_entries_read2
= num_entries
;
340 if ((*snum
) >= (*stot
)) {
345 ss1
->num_entries_read
= 0;
346 ss1
->ptr_sess_info
= 0;
347 ss1
->num_entries_read2
= 0;
353 /*******************************************************************
354 makes a SRV_R_NET_SESS_ENUM structure.
355 ********************************************************************/
357 static uint32
init_srv_sess_info_ctr(SRV_SESS_INFO_CTR
*ctr
,
358 int switch_value
, uint32
*resume_hnd
, uint32
*total_entries
)
360 uint32 status
= NT_STATUS_NOPROBLEMO
;
361 DEBUG(5,("init_srv_sess_info_ctr: %d\n", __LINE__
));
363 ctr
->switch_value
= switch_value
;
365 switch (switch_value
) {
367 init_srv_sess_info_0(&(ctr
->sess
.info0
), resume_hnd
, total_entries
);
368 ctr
->ptr_sess_ctr
= 1;
371 init_srv_sess_info_1(&(ctr
->sess
.info1
), resume_hnd
, total_entries
);
372 ctr
->ptr_sess_ctr
= 1;
375 DEBUG(5,("init_srv_sess_info_ctr: unsupported switch value %d\n", switch_value
));
377 (*total_entries
) = 0;
378 ctr
->ptr_sess_ctr
= 0;
379 status
= NT_STATUS_INVALID_INFO_CLASS
;
386 /*******************************************************************
387 makes a SRV_R_NET_SESS_ENUM structure.
388 ********************************************************************/
390 static void init_srv_r_net_sess_enum(SRV_R_NET_SESS_ENUM
*r_n
,
391 uint32 resume_hnd
, int sess_level
, int switch_value
)
393 DEBUG(5,("init_srv_r_net_sess_enum: %d\n", __LINE__
));
395 r_n
->sess_level
= sess_level
;
397 if (sess_level
== -1)
398 r_n
->status
= NT_STATUS_INVALID_INFO_CLASS
;
400 r_n
->status
= init_srv_sess_info_ctr(r_n
->ctr
, switch_value
, &resume_hnd
, &r_n
->total_entries
);
402 if (r_n
->status
!= NT_STATUS_NOPROBLEMO
)
405 init_enum_hnd(&r_n
->enum_hnd
, resume_hnd
);
408 /*******************************************************************
409 fill in a conn info level 0 structure.
410 ********************************************************************/
412 static void init_srv_conn_info_0(SRV_CONN_INFO_0
*ss0
, uint32
*snum
, uint32
*stot
)
414 uint32 num_entries
= 0;
422 DEBUG(5,("init_srv_conn_0_ss0\n"));
425 for (; (*snum
) < (*stot
) && num_entries
< MAX_CONN_ENTRIES
; (*snum
)++) {
427 init_srv_conn_info0(&ss0
->info_0
[num_entries
], (*stot
));
429 /* move on to creating next connection */
430 /* move on to creating next conn */
434 ss0
->num_entries_read
= num_entries
;
435 ss0
->ptr_conn_info
= num_entries
> 0 ? 1 : 0;
436 ss0
->num_entries_read2
= num_entries
;
438 if ((*snum
) >= (*stot
)) {
443 ss0
->num_entries_read
= 0;
444 ss0
->ptr_conn_info
= 0;
445 ss0
->num_entries_read2
= 0;
451 /*******************************************************************
452 fill in a conn info level 1 structure.
453 ********************************************************************/
455 static void init_srv_conn_1_info(CONN_INFO_1
*se1
, CONN_INFO_1_STR
*str1
,
456 uint32 id
, uint32 type
,
457 uint32 num_opens
, uint32 num_users
, uint32 open_time
,
458 char *usr_name
, char *net_name
)
460 init_srv_conn_info1(se1
, id
, type
, num_opens
, num_users
, open_time
, usr_name
, net_name
);
461 init_srv_conn_info1_str(str1
, usr_name
, net_name
);
464 /*******************************************************************
465 fill in a conn info level 1 structure.
466 ********************************************************************/
468 static void init_srv_conn_info_1(SRV_CONN_INFO_1
*ss1
, uint32
*snum
, uint32
*stot
)
470 uint32 num_entries
= 0;
478 DEBUG(5,("init_srv_conn_1_ss1\n"));
481 for (; (*snum
) < (*stot
) && num_entries
< MAX_CONN_ENTRIES
; (*snum
)++) {
482 init_srv_conn_1_info(&ss1
->info_1
[num_entries
],
483 &ss1
->info_1_str
[num_entries
],
484 (*stot
), 0x3, 1, 1, 3,"dummy_user", "IPC$");
486 /* move on to creating next connection */
487 /* move on to creating next conn */
491 ss1
->num_entries_read
= num_entries
;
492 ss1
->ptr_conn_info
= num_entries
> 0 ? 1 : 0;
493 ss1
->num_entries_read2
= num_entries
;
496 if ((*snum
) >= (*stot
)) {
501 ss1
->num_entries_read
= 0;
502 ss1
->ptr_conn_info
= 0;
503 ss1
->num_entries_read2
= 0;
509 /*******************************************************************
510 makes a SRV_R_NET_CONN_ENUM structure.
511 ********************************************************************/
513 static uint32
init_srv_conn_info_ctr(SRV_CONN_INFO_CTR
*ctr
,
514 int switch_value
, uint32
*resume_hnd
, uint32
*total_entries
)
516 uint32 status
= NT_STATUS_NOPROBLEMO
;
517 DEBUG(5,("init_srv_conn_info_ctr: %d\n", __LINE__
));
519 ctr
->switch_value
= switch_value
;
521 switch (switch_value
) {
523 init_srv_conn_info_0(&ctr
->conn
.info0
, resume_hnd
, total_entries
);
524 ctr
->ptr_conn_ctr
= 1;
527 init_srv_conn_info_1(&ctr
->conn
.info1
, resume_hnd
, total_entries
);
528 ctr
->ptr_conn_ctr
= 1;
531 DEBUG(5,("init_srv_conn_info_ctr: unsupported switch value %d\n", switch_value
));
533 (*total_entries
) = 0;
534 ctr
->ptr_conn_ctr
= 0;
535 status
= NT_STATUS_INVALID_INFO_CLASS
;
542 /*******************************************************************
543 makes a SRV_R_NET_CONN_ENUM structure.
544 ********************************************************************/
546 static void init_srv_r_net_conn_enum(SRV_R_NET_CONN_ENUM
*r_n
,
547 uint32 resume_hnd
, int conn_level
, int switch_value
)
549 DEBUG(5,("init_srv_r_net_conn_enum: %d\n", __LINE__
));
551 r_n
->conn_level
= conn_level
;
552 if (conn_level
== -1)
553 r_n
->status
= NT_STATUS_INVALID_INFO_CLASS
;
555 r_n
->status
= init_srv_conn_info_ctr(r_n
->ctr
, switch_value
, &resume_hnd
, &r_n
->total_entries
);
557 if (r_n
->status
!= NT_STATUS_NOPROBLEMO
)
560 init_enum_hnd(&r_n
->enum_hnd
, resume_hnd
);
563 /*******************************************************************
564 fill in a file info level 3 structure.
565 ********************************************************************/
567 static void init_srv_file_3_info(FILE_INFO_3
*fl3
, FILE_INFO_3_STR
*str3
,
568 uint32 fnum
, uint32 perms
, uint32 num_locks
,
569 char *path_name
, char *user_name
)
571 init_srv_file_info3(fl3
, fnum
, perms
, num_locks
, path_name
, user_name
);
572 init_srv_file_info3_str(str3
, path_name
, user_name
);
575 /*******************************************************************
576 fill in a file info level 3 structure.
577 ********************************************************************/
579 static void init_srv_file_info_3(SRV_FILE_INFO_3
*fl3
, uint32
*fnum
, uint32
*ftot
)
581 uint32 num_entries
= 0;
589 DEBUG(5,("init_srv_file_3_fl3\n"));
591 for (; (*fnum
) < (*ftot
) && num_entries
< MAX_FILE_ENTRIES
; (*fnum
)++) {
592 init_srv_file_3_info(&fl3
->info_3
[num_entries
],
593 &fl3
->info_3_str
[num_entries
],
594 (*fnum
), 0x35, 0, "\\PIPE\\samr", "dummy user");
596 /* move on to creating next file */
600 fl3
->num_entries_read
= num_entries
;
601 fl3
->ptr_file_info
= num_entries
> 0 ? 1 : 0;
602 fl3
->num_entries_read2
= num_entries
;
604 if ((*fnum
) >= (*ftot
)) {
609 /*******************************************************************
610 makes a SRV_R_NET_FILE_ENUM structure.
611 ********************************************************************/
613 static uint32
init_srv_file_info_ctr(SRV_FILE_INFO_CTR
*ctr
,
614 int switch_value
, uint32
*resume_hnd
, uint32
*total_entries
)
616 uint32 status
= NT_STATUS_NOPROBLEMO
;
617 DEBUG(5,("init_srv_file_info_ctr: %d\n", __LINE__
));
619 ctr
->switch_value
= switch_value
;
621 switch (switch_value
) {
623 init_srv_file_info_3(&ctr
->file
.info3
, resume_hnd
, total_entries
);
624 ctr
->ptr_file_ctr
= 1;
627 DEBUG(5,("init_srv_file_info_ctr: unsupported switch value %d\n", switch_value
));
629 (*total_entries
) = 0;
630 ctr
->ptr_file_ctr
= 0;
631 status
= NT_STATUS_INVALID_INFO_CLASS
;
638 /*******************************************************************
639 makes a SRV_R_NET_FILE_ENUM structure.
640 ********************************************************************/
642 static void init_srv_r_net_file_enum(SRV_R_NET_FILE_ENUM
*r_n
,
643 uint32 resume_hnd
, int file_level
, int switch_value
)
645 DEBUG(5,("init_srv_r_net_file_enum: %d\n", __LINE__
));
647 r_n
->file_level
= file_level
;
649 r_n
->status
= NT_STATUS_INVALID_INFO_CLASS
;
651 r_n
->status
= init_srv_file_info_ctr(r_n
->ctr
, switch_value
, &resume_hnd
, &(r_n
->total_entries
));
653 if (r_n
->status
!= NT_STATUS_NOPROBLEMO
)
656 init_enum_hnd(&r_n
->enum_hnd
, resume_hnd
);
659 /*******************************************************************
661 ********************************************************************/
663 uint32
_srv_net_srv_get_info(pipes_struct
*p
, SRV_Q_NET_SRV_GET_INFO
*q_u
, SRV_R_NET_SRV_GET_INFO
*r_u
)
665 uint32 status
= NT_STATUS_NOPROBLEMO
;
666 SRV_INFO_CTR
*ctr
= (SRV_INFO_CTR
*)talloc(p
->mem_ctx
, sizeof(SRV_INFO_CTR
));
669 return NT_STATUS_NO_MEMORY
;
673 DEBUG(5,("srv_net_srv_get_info: %d\n", __LINE__
));
675 switch (q_u
->switch_value
) {
677 init_srv_info_102(&ctr
->srv
.sv102
,
679 string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH
),
680 lp_major_announce_version(), lp_minor_announce_version(),
681 lp_default_server_announce(),
682 0xffffffff, /* users */
686 3000, /* announce delta */
687 100000, /* licenses */
688 "c:\\"); /* user path */
691 init_srv_info_101(&ctr
->srv
.sv101
,
693 lp_major_announce_version(), lp_minor_announce_version(),
694 lp_default_server_announce(),
695 string_truncate(lp_serverstring(), MAX_SERVER_STRING_LENGTH
));
698 init_srv_info_100(&ctr
->srv
.sv100
, 500, global_myname
);
701 status
= NT_STATUS_INVALID_INFO_CLASS
;
705 /* set up the net server get info structure */
706 init_srv_r_net_srv_get_info(r_u
, q_u
->switch_value
, ctr
, status
);
708 DEBUG(5,("srv_net_srv_get_info: %d\n", __LINE__
));
713 /*******************************************************************
715 ********************************************************************/
717 uint32
_srv_net_file_enum(pipes_struct
*p
, SRV_Q_NET_FILE_ENUM
*q_u
, SRV_R_NET_FILE_ENUM
*r_u
)
719 r_u
->ctr
= (SRV_FILE_INFO_CTR
*)talloc(p
->mem_ctx
, sizeof(SRV_FILE_INFO_CTR
));
721 return NT_STATUS_NO_MEMORY
;
723 ZERO_STRUCTP(r_u
->ctr
);
725 DEBUG(5,("srv_net_file_enum: %d\n", __LINE__
));
728 init_srv_r_net_file_enum(r_u
,
729 get_enum_hnd(&q_u
->enum_hnd
),
731 q_u
->ctr
->switch_value
);
733 DEBUG(5,("srv_net_file_enum: %d\n", __LINE__
));
738 /*******************************************************************
740 ********************************************************************/
742 uint32
_srv_net_conn_enum(pipes_struct
*p
, SRV_Q_NET_CONN_ENUM
*q_u
, SRV_R_NET_CONN_ENUM
*r_u
)
744 DEBUG(5,("srv_net_conn_enum: %d\n", __LINE__
));
746 r_u
->ctr
= (SRV_CONN_INFO_CTR
*)talloc(p
->mem_ctx
, sizeof(SRV_CONN_INFO_CTR
));
748 return NT_STATUS_NO_MEMORY
;
750 ZERO_STRUCTP(r_u
->ctr
);
753 init_srv_r_net_conn_enum(r_u
,
754 get_enum_hnd(&q_u
->enum_hnd
),
756 q_u
->ctr
->switch_value
);
758 DEBUG(5,("srv_net_conn_enum: %d\n", __LINE__
));
763 /*******************************************************************
765 ********************************************************************/
767 uint32
_srv_net_sess_enum(pipes_struct
*p
, SRV_Q_NET_SESS_ENUM
*q_u
, SRV_R_NET_SESS_ENUM
*r_u
)
769 DEBUG(5,("_srv_net_sess_enum: %d\n", __LINE__
));
771 r_u
->ctr
= (SRV_SESS_INFO_CTR
*)talloc(p
->mem_ctx
, sizeof(SRV_SESS_INFO_CTR
));
773 return NT_STATUS_NO_MEMORY
;
775 ZERO_STRUCTP(r_u
->ctr
);
778 init_srv_r_net_sess_enum(r_u
,
779 get_enum_hnd(&q_u
->enum_hnd
),
781 q_u
->ctr
->switch_value
);
783 DEBUG(5,("_srv_net_sess_enum: %d\n", __LINE__
));
788 /*******************************************************************
790 ********************************************************************/
792 uint32
_srv_net_share_enum(pipes_struct
*p
, SRV_Q_NET_SHARE_ENUM
*q_u
, SRV_R_NET_SHARE_ENUM
*r_u
)
794 DEBUG(5,("_srv_net_share_enum: %d\n", __LINE__
));
796 /* Create the list of shares for the response. */
797 init_srv_r_net_share_enum(p
->mem_ctx
, r_u
,
799 get_enum_hnd(&q_u
->enum_hnd
));
801 DEBUG(5,("_srv_net_share_enum: %d\n", __LINE__
));
806 /*******************************************************************
808 ********************************************************************/
810 uint32
_srv_net_share_get_info(pipes_struct
*p
, SRV_Q_NET_SHARE_GET_INFO
*q_u
, SRV_R_NET_SHARE_GET_INFO
*r_u
)
814 DEBUG(5,("_srv_net_share_get_info: %d\n", __LINE__
));
816 /* Create the list of shares for the response. */
817 share_name
= dos_unistr2_to_str(&q_u
->uni_share_name
);
818 init_srv_r_net_share_get_info(r_u
, share_name
, q_u
->info_level
);
820 DEBUG(5,("_srv_net_share_get_info: %d\n", __LINE__
));
825 /*******************************************************************
827 ********************************************************************/
829 uint32
_srv_net_remote_tod(pipes_struct
*p
, SRV_Q_NET_REMOTE_TOD
*q_u
, SRV_R_NET_REMOTE_TOD
*r_u
)
831 TIME_OF_DAY_INFO
*tod
;
833 time_t unixdate
= time(NULL
);
835 tod
= (TIME_OF_DAY_INFO
*)talloc(p
->mem_ctx
, sizeof(TIME_OF_DAY_INFO
));
837 return NT_STATUS_NO_MEMORY
;
842 r_u
->ptr_srv_tod
= 0x1;
843 r_u
->status
= NT_STATUS_NOPROBLEMO
;
845 DEBUG(5,("_srv_net_remote_tod: %d\n", __LINE__
));
847 t
= gmtime(&unixdate
);
850 init_time_of_day_info(tod
,
857 TimeDiff(unixdate
)/60,
864 DEBUG(5,("_srv_net_remote_tod: %d\n", __LINE__
));