2 Unix SMB/Netbios implementation.
4 NT Domain Authentication SMB / MSRPC client
5 Copyright (C) Andrew Tridgell 1994-1999
6 Copyright (C) Luke Kenneth Casson Leighton 1996-1999
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include "rpc_parse.h"
32 extern int DEBUGLEVEL
;
40 * [HKLM]|[HKU]|[HKCR]\[parent_keyname]\[subkey]|[value]
42 * reg_getsubkey() splits this down into:
43 * [HKLM]|[HKU]|[HKCR]\[parent_keyname_components] and [subkey]|[value]
45 * reg_connect() splits the left side down further into:
46 * [HKLM]|[HKU]|[HKCR] and [parent_keyname_components].
48 * HKLM is short for HKEY_LOCAL_MACHINE
49 * HKCR is short for HKEY_CLASSES_ROOT
50 * HKU is short for HKEY_USERS
52 * oh, and HKEY stands for "Hive Key".
56 static void reg_display_key(int val
, const char *full_keyname
, int num
)
63 report(out_hnd
, "Key Name:\t%s\n", full_keyname
);
68 /* subkeys initialisation */
71 report(out_hnd
,"Subkeys\n");
72 report(out_hnd
,"-------\n");
78 /* values initialisation */
81 report(out_hnd
,"Key Values\n");
82 report(out_hnd
,"----------\n");
98 void split_server_keyname(char *srv_name
, char *key
, const char* arg
)
102 if (strnequal("\\\\", key
, 2))
104 char *p
= strchr(&key
[2], '\\');
113 fstrcpy(srv_name
, key
);
114 pstrcpy(key
, &arg
[strlen(srv_name
)+1]);
118 /****************************************************************************
120 ****************************************************************************/
121 BOOL
msrpc_reg_enum_key(const char* srv_name
, const char* full_keyname
,
123 REG_KEY_FN(reg_key_fn
),
124 REG_VAL_FN(reg_val_fn
))
140 uint32 max_class_len
= 0;
142 uint32 max_subkeylen
;
143 uint32 max_subkeysize
;
145 uint32 max_valnamelen
;
146 uint32 max_valbufsize
;
151 * unknown 0x1a request
154 uint32 unk_1a_response
;
156 DEBUG(5, ("reg_enum_key: %s\n", full_keyname
));
158 /* open registry receive a policy handle */
159 res
= res
? reg_connect(srv_name
, full_keyname
, key_name
, 0x02000000,
162 if ((*key_name
) != 0)
165 res1
= res
? reg_open_entry(&pol_con
,
166 key_name
, 0x02000000, &key_pol
) : False
;
170 memcpy(&key_pol
, &pol_con
, sizeof(key_pol
));
173 res1
= res1
? reg_query_key(&key_pol
,
174 key_class
, &max_class_len
,
175 &num_subkeys
, &max_subkeylen
, &max_subkeysize
,
176 &num_values
, &max_valnamelen
, &max_valbufsize
,
177 &sec_desc
, &mod_time
) : False
;
179 if (res1
&& reg_fn
!= NULL
)
181 reg_fn(0, full_keyname
, 0);
182 reg_fn(1, full_keyname
, num_subkeys
);
185 for (i
= 0; i
< num_subkeys
&& reg_key_fn
!= NULL
; i
++)
197 res2
= res1
? reg_unknown_1a(&key_pol
,
198 &unk_1a_response
) : False
;
200 if (res2
&& unk_1a_response
!= 5)
202 report(out_hnd
,"Unknown 1a response: %x\n", unk_1a_response
);
206 res2
= res2
? reg_enum_key(&key_pol
,
208 &enum_unk1
, &enum_unk2
,
209 &key_mod_time
) : False
;
213 reg_key_fn(full_keyname
, enum_name
, key_mod_time
);
220 reg_fn(2, full_keyname
, num_values
);
223 for (i
= 0; i
< num_values
&& reg_val_fn
!= NULL
; i
++)
234 res2
= res1
? reg_unknown_1a(&key_pol
,
235 &unk_1a_response
) : False
;
237 if (res2
&& unk_1a_response
!= 5)
239 report(out_hnd
,"Unknown 1a response: %x\n", unk_1a_response
);
243 res2
= res2
? reg_enum_val(&key_pol
,
244 i
, max_valnamelen
, max_valbufsize
,
245 val_name
, &val_type
, &value
) : False
;
249 reg_val_fn(full_keyname
, val_name
, val_type
, &value
);
253 if (res1
&& reg_fn
!= NULL
)
255 reg_fn(3, full_keyname
, 0);
258 /* close the handles */
259 if ((*key_name
) != 0)
261 res1
= res1
? reg_close(&key_pol
) : False
;
263 res
= res
? reg_close(&pol_con
) : False
;
265 if (res
&& res1
&& res2
)
267 DEBUG(5,("msrpc_reg_enum_key: query succeeded\n"));
271 DEBUG(5,("msrpc_reg_enum_key: query failed\n"));
277 static void reg_display_key_info(const char *full_name
,
278 const char *name
, time_t key_mod_time
)
280 display_reg_key_info(out_hnd
, ACTION_HEADER
, name
, key_mod_time
);
281 display_reg_key_info(out_hnd
, ACTION_ENUMERATE
, name
, key_mod_time
);
282 display_reg_key_info(out_hnd
, ACTION_FOOTER
, name
, key_mod_time
);
285 static void reg_display_val_info(const char *full_name
,
288 const BUFFER2
*const value
)
290 display_reg_value_info(out_hnd
, ACTION_HEADER
, name
, type
, value
);
291 display_reg_value_info(out_hnd
, ACTION_ENUMERATE
, name
, type
, value
);
292 display_reg_value_info(out_hnd
, ACTION_FOOTER
, name
, type
, value
);
295 /****************************************************************************
297 ****************************************************************************/
298 void cmd_reg_enum(struct client_info
*info
, int argc
, char *argv
[])
300 pstring full_keyname
;
304 fstrcpy(srv_name
, "\\\\");
305 fstrcat(srv_name
, info
->dest_host
);
310 report(out_hnd
, "regenum <key_name>\n");
314 split_server_keyname(srv_name
, full_keyname
, argv
[1]);
316 (void)(msrpc_reg_enum_key(srv_name
, full_keyname
,
318 reg_display_key_info
,
319 reg_display_val_info
));
322 /****************************************************************************
323 nt registry query value info
324 ****************************************************************************/
325 void cmd_reg_query_info(struct client_info
*info
, int argc
, char *argv
[])
333 pstring full_keyname
;
347 fstrcpy(srv_name
, "\\\\");
348 fstrcat(srv_name
, info
->dest_host
);
353 report(out_hnd
, "regvalinfo value_name\n");
357 split_server_keyname(srv_name
, full_keyname
, argv
[1]);
359 reg_get_subkey(full_keyname
, keyname
, val_name
);
361 if (keyname
[0] == 0 || val_name
[0] == 0)
363 report(out_hnd
, "invalid value name\n");
367 /* open registry receive a policy handle */
368 res
= res
? reg_connect(srv_name
, keyname
, key_name
, 0x02000000,
371 if ((*key_name
) != 0)
374 res1
= res
? reg_open_entry(&pol_con
,
375 key_name
, 0x02000000, &key_pol
) : False
;
379 memcpy(&key_pol
, &pol_con
, sizeof(key_pol
));
383 res2
= res1
? reg_query_info(&key_pol
,
384 val_name
, &type
, &buf
) : False
;
388 reg_display_val_info(full_keyname
, val_name
, type
, &buf
);
391 /* close the handles */
392 if ((*key_name
) != 0)
394 res1
= res1
? reg_close(&key_pol
) : False
;
396 res
= res
? reg_close(&pol_con
) : False
;
400 DEBUG(5,("cmd_reg_query: query succeeded\n"));
404 DEBUG(5,("cmd_reg_query: query failed\n"));
408 /****************************************************************************
409 nt registry query key
410 ****************************************************************************/
411 void cmd_reg_query_key(struct client_info
*info
, int argc
, char *argv
[])
418 pstring full_keyname
;
426 uint32 key_class_len
= 0;
428 uint32 max_subkeylen
;
429 uint32 max_subkeysize
;
431 uint32 max_valnamelen
;
432 uint32 max_valbufsize
;
438 fstrcpy(srv_name
, "\\\\");
439 fstrcat(srv_name
, info
->dest_host
);
444 report(out_hnd
, "regquery key_name\n");
448 split_server_keyname(srv_name
, full_keyname
, argv
[1]);
450 /* open registry receive a policy handle */
451 res
= res
? reg_connect(srv_name
, full_keyname
, key_name
, 0x02000000,
454 if ((*key_name
) != 0)
457 res1
= res
? reg_open_entry(&pol_con
,
458 key_name
, 0x02000000, &key_pol
) : False
;
462 memcpy(&key_pol
, &pol_con
, sizeof(key_pol
));
465 res1
= res1
? reg_query_key(&key_pol
,
466 key_class
, &key_class_len
,
467 &num_subkeys
, &max_subkeylen
, &max_subkeysize
,
468 &num_values
, &max_valnamelen
, &max_valbufsize
,
469 &sec_desc
, &mod_time
) : False
;
471 if (res1
&& key_class_len
!= 0)
473 res1
= res1
? reg_query_key(&key_pol
,
474 key_class
, &key_class_len
,
475 &num_subkeys
, &max_subkeylen
, &max_subkeysize
,
476 &num_values
, &max_valnamelen
, &max_valbufsize
,
477 &sec_desc
, &mod_time
) : False
;
482 report(out_hnd
,"Registry Query Info Key\n");
483 report(out_hnd
,"key class: %s\n", key_class
);
484 report(out_hnd
,"subkeys, max_len, max_size: %d %d %d\n", num_subkeys
, max_subkeylen
, max_subkeysize
);
485 report(out_hnd
,"vals, max_len, max_size: 0x%x 0x%x 0x%x\n", num_values
, max_valnamelen
, max_valbufsize
);
486 report(out_hnd
,"sec desc: 0x%x\n", sec_desc
);
487 report(out_hnd
,"mod time: %s\n", http_timestring(nt_time_to_unix(&mod_time
)));
490 /* close the handles */
491 if ((*key_name
) != 0)
493 res1
= res1
? reg_close(&key_pol
) : False
;
495 res
= res
? reg_close(&pol_con
) : False
;
499 DEBUG(5,("cmd_reg_query: query succeeded\n"));
503 DEBUG(5,("cmd_reg_query: query failed\n"));
507 /****************************************************************************
508 nt registry create value
509 ****************************************************************************/
510 void cmd_reg_create_val(struct client_info
*info
, int argc
, char *argv
[])
516 POLICY_HND parent_pol
;
518 pstring full_keyname
;
529 res1
= res1
? reg_query_info(&val_pol
,
530 type
, &unk_0
, &unk_1
) : False
;
535 fstrcpy(srv_name
, "\\\\");
536 fstrcat(srv_name
, info
->dest_host
);
541 report(out_hnd
, "regcreate <val_name> <val_type (1|3|4)> <val>\n");
542 report(out_hnd
, "(val_type 1=UNISTR, 3=BYTES, 4=DWORD supported\n");
546 split_server_keyname(srv_name
, full_keyname
, argv
[1]);
548 reg_get_subkey(full_keyname
, keyname
, val_name
);
553 if (keyname
[0] == 0 || val_name
[0] == 0)
555 report(out_hnd
, "invalid key name\n");
567 val_type
= atoi(argv
[0]);
569 if (val_type
!= 1 && val_type
!= 3 && val_type
!= 4)
571 report(out_hnd
, "val_type 1=UNISTR, 3=BYTES, 4=DWORD supported\n");
580 case 0x01: /* UNISTR */
582 make_buffer3_str(&value
, argv
[0], strlen(argv
[0])+1);
585 case 0x03: /* BYTES */
587 make_buffer3_hex(&value
, argv
[0]);
590 case 0x04: /* DWORD */
592 make_buffer3_uint32(&value
, get_number(argv
[0]));
597 report(out_hnd
, "i told you i only deal with UNISTR, DWORD and BYTES!\n");
602 DEBUG(10,("key data:\n"));
603 dump_data(10, (char *)value
.buffer
, value
.buf_len
);
605 /* open registry receive a policy handle */
606 res
= res
? reg_connect(srv_name
, keyname
, parent_name
, 0x02000000,
609 if ((*val_name
) != 0)
612 res3
= res
? reg_open_entry(&pol_con
,
613 parent_name
, 0x02000000, &parent_pol
) : False
;
617 memcpy(&parent_pol
, &pol_con
, sizeof(parent_pol
));
620 /* create an entry */
621 res4
= res3
? reg_create_val(&parent_pol
,
622 val_name
, val_type
, &value
) : False
;
624 /* flush the modified key */
625 res4
= res4
? reg_flush_key(&parent_pol
) : False
;
627 /* close the val handle */
628 if ((*val_name
) != 0)
630 res3
= res3
? reg_close(&parent_pol
) : False
;
633 /* close the registry handles */
634 res
= res
? reg_close(&pol_con
) : False
;
636 if (res
&& res3
&& res4
)
638 DEBUG(5,("cmd_reg_create_val: query succeeded\n"));
639 report(out_hnd
,"OK\n");
643 DEBUG(5,("cmd_reg_create_val: query failed\n"));
647 /****************************************************************************
648 nt registry delete value
649 ****************************************************************************/
650 void cmd_reg_delete_val(struct client_info
*info
, int argc
, char *argv
[])
656 POLICY_HND parent_pol
;
658 pstring full_keyname
;
665 fstrcpy(srv_name
, "\\\\");
666 fstrcat(srv_name
, info
->dest_host
);
671 report(out_hnd
, "regdelete <val_name>\n");
675 split_server_keyname(srv_name
, full_keyname
, argv
[1]);
677 reg_get_subkey(full_keyname
, keyname
, val_name
);
679 if (keyname
[0] == 0 || val_name
[0] == 0)
681 report(out_hnd
, "invalid key name\n");
685 /* open registry receive a policy handle */
686 res
= res
? reg_connect(srv_name
, keyname
, parent_name
, 0x02000000,
689 if ((*val_name
) != 0)
692 res3
= res
? reg_open_entry(&pol_con
,
693 parent_name
, 0x02000000, &parent_pol
) : False
;
697 memcpy(&parent_pol
, &pol_con
, sizeof(parent_pol
));
700 /* delete an entry */
701 res4
= res3
? reg_delete_val(&parent_pol
, val_name
) : False
;
703 /* flush the modified key */
704 res4
= res4
? reg_flush_key(&parent_pol
) : False
;
706 /* close the key handle */
707 res3
= res3
? reg_close(&parent_pol
) : False
;
709 /* close the registry handles */
710 res
= res
? reg_close(&pol_con
) : False
;
712 if (res
&& res3
&& res4
)
714 DEBUG(5,("cmd_reg_delete_val: query succeeded\n"));
715 report(out_hnd
,"OK\n");
719 DEBUG(5,("cmd_reg_delete_val: query failed\n"));
723 /****************************************************************************
724 nt registry delete key
725 ****************************************************************************/
726 void cmd_reg_delete_key(struct client_info
*info
, int argc
, char *argv
[])
732 POLICY_HND parent_pol
;
734 pstring full_keyname
;
741 fstrcpy(srv_name
, "\\\\");
742 fstrcat(srv_name
, info
->dest_host
);
747 report(out_hnd
, "regdeletekey <key_name>\n");
751 split_server_keyname(srv_name
, full_keyname
, argv
[1]);
753 reg_get_subkey(full_keyname
, parent_name
, subkey_name
);
755 if (parent_name
[0] == 0 || subkey_name
[0] == 0)
757 report(out_hnd
, "invalid key name\n");
761 /* open registry receive a policy handle */
762 res
= res
? reg_connect(srv_name
, parent_name
, key_name
, 0x02000000,
765 if ((*key_name
) != 0)
768 res3
= res
? reg_open_entry(&pol_con
,
769 key_name
, 0x02000000, &parent_pol
) : False
;
773 memcpy(&parent_pol
, &pol_con
, sizeof(parent_pol
));
776 /* create an entry */
777 res4
= res3
? reg_delete_key(&parent_pol
, subkey_name
) : False
;
779 /* flush the modified key */
780 res4
= res4
? reg_flush_key(&parent_pol
) : False
;
782 /* close the key handle */
783 if ((*key_name
) != 0)
785 res3
= res3
? reg_close(&parent_pol
) : False
;
788 /* close the registry handles */
789 res
= res
? reg_close(&pol_con
) : False
;
791 if (res
&& res3
&& res4
)
793 DEBUG(5,("cmd_reg_delete_key: query succeeded\n"));
794 report(out_hnd
,"OK\n");
798 DEBUG(5,("cmd_reg_delete_key: query failed\n"));
802 /****************************************************************************
803 nt registry create key
804 ****************************************************************************/
805 void cmd_reg_create_key(struct client_info
*info
, int argc
, char *argv
[])
811 POLICY_HND parent_pol
;
814 pstring full_keyname
;
819 SEC_ACCESS sam_access
;
823 fstrcpy(srv_name
, "\\\\");
824 fstrcat(srv_name
, info
->dest_host
);
829 report(out_hnd
, "regcreate <key_name> [key_class]\n");
833 split_server_keyname(srv_name
, full_keyname
, argv
[1]);
835 reg_get_subkey(full_keyname
, parent_key
, key_name
);
837 if (parent_key
[0] == 0 || key_name
[0] == 0)
839 report(out_hnd
, "invalid key name\n");
845 fstrcpy(key_class
, argv
[2]);
849 memset(key_class
, 0, sizeof(key_class
));
852 /* set access permissions */
853 sam_access
.mask
= SEC_RIGHTS_READ
;
855 /* open registry receive a policy handle */
856 res
= res
? reg_connect(srv_name
, parent_key
, parent_name
, 0x02000000,
859 if ((*parent_name
) != 0)
862 res3
= res
? reg_open_entry(&pol_con
,
863 parent_name
, 0x02000000, &parent_pol
) : False
;
867 memcpy(&parent_pol
, &pol_con
, sizeof(parent_pol
));
870 /* create an entry */
871 res4
= res3
? reg_create_key(&parent_pol
,
872 key_name
, key_class
, &sam_access
, &key_pol
) : False
;
874 /* flush the modified key */
875 res4
= res4
? reg_flush_key(&parent_pol
) : False
;
877 /* close the key handle */
878 res4
= res4
? reg_close(&key_pol
) : False
;
880 /* close the key handle */
881 if ((*parent_name
) != 0)
883 res3
= res3
? reg_close(&parent_pol
) : False
;
886 /* close the registry handles */
887 res
= res
? reg_close(&pol_con
) : False
;
889 if (res
&& res3
&& res4
)
891 DEBUG(5,("cmd_reg_create_key: query succeeded\n"));
892 report(out_hnd
,"OK\n");
896 DEBUG(5,("cmd_reg_create_key: query failed\n"));
900 /****************************************************************************
901 nt registry security info
902 ****************************************************************************/
903 void cmd_reg_test_key_sec(struct client_info
*info
, int argc
, char *argv
[])
911 pstring full_keyname
;
919 SEC_DESC_BUF sec_buf
;
920 uint32 sec_info
= 0x7;
924 fstrcpy(srv_name
, "\\\\");
925 fstrcat(srv_name
, info
->dest_host
);
930 report(out_hnd
, "regtestkeysec <key_name>\n");
934 split_server_keyname(srv_name
, full_keyname
, argv
[1]);
936 /* open registry receive a policy handle */
937 res
= res
? reg_connect(srv_name
, full_keyname
, key_name
, 0x02000000,
940 if ((*key_name
) != 0)
943 res3
= res
? reg_open_entry(&pol_con
,
944 key_name
, 0x02000000, &key_pol
) : False
;
948 memcpy(&key_pol
, &pol_con
, sizeof(key_pol
));
952 res3
= res
? reg_open_entry(&pol_con
,
953 key_name
, 0x02000000, &key_pol
) : False
;
955 /* query key sec info. first call sets sec_buf_size. */
957 ZERO_STRUCT(sec_buf
);
959 res4
= res3
? reg_get_key_sec(&key_pol
,
961 &sec_buf_size
, &sec_buf
) : False
;
965 free_sec_desc_buf(&sec_buf
);
968 res4
= res4
? reg_get_key_sec(&key_pol
,
970 &sec_buf_size
, &sec_buf
) : False
;
972 if (res4
&& sec_buf
.len
> 0 && sec_buf
.sec
!= NULL
)
974 display_sec_desc(out_hnd
, ACTION_HEADER
, sec_buf
.sec
);
975 display_sec_desc(out_hnd
, ACTION_ENUMERATE
, sec_buf
.sec
);
976 display_sec_desc(out_hnd
, ACTION_FOOTER
, sec_buf
.sec
);
978 res4
= res4
? reg_set_key_sec(&key_pol
,
979 sec_info
, sec_buf_size
, sec_buf
.sec
) : False
;
981 free_sec_desc_buf(&sec_buf
);
984 /* close the key handle */
985 if ((*key_name
) != 0)
987 res3
= res3
? reg_close(&key_pol
) : False
;
990 /* close the registry handles */
991 res
= res
? reg_close(&pol_con
) : False
;
993 if (res
&& res3
&& res4
)
995 DEBUG(5,("cmd_reg_test2: query succeeded\n"));
996 report(out_hnd
,"Registry Test2\n");
1000 DEBUG(5,("cmd_reg_test2: query failed\n"));
1004 /****************************************************************************
1005 nt registry security info
1006 ****************************************************************************/
1007 void cmd_reg_get_key_sec(struct client_info
*info
, int argc
, char *argv
[])
1015 pstring full_keyname
;
1022 uint32 sec_buf_size
;
1023 SEC_DESC_BUF sec_buf
;
1024 uint32 sec_info
= 0x7;
1028 fstrcpy(srv_name
, "\\\\");
1029 fstrcat(srv_name
, info
->dest_host
);
1034 report(out_hnd
, "reggetsec <key_name>\n");
1038 split_server_keyname(srv_name
, full_keyname
, argv
[1]);
1040 /* open registry receive a policy handle */
1041 res
= res
? reg_connect(srv_name
, full_keyname
, key_name
, 0x02000000,
1044 if ((*key_name
) != 0)
1047 res3
= res
? reg_open_entry(&pol_con
,
1048 key_name
, 0x02000000, &key_pol
) : False
;
1052 memcpy(&key_pol
, &pol_con
, sizeof(key_pol
));
1056 res3
= res
? reg_open_entry(&pol_con
,
1057 key_name
, 0x02000000, &key_pol
) : False
;
1059 /* query key sec info. first call sets sec_buf_size. */
1061 ZERO_STRUCT(sec_buf
);
1063 res4
= res3
? reg_get_key_sec(&key_pol
,
1065 &sec_buf_size
, &sec_buf
) : False
;
1069 free_sec_desc_buf(&sec_buf
);
1072 res4
= res4
? reg_get_key_sec(&key_pol
,
1074 &sec_buf_size
, &sec_buf
) : False
;
1076 if (res4
&& sec_buf
.len
> 0 && sec_buf
.sec
!= NULL
)
1078 display_sec_desc(out_hnd
, ACTION_HEADER
, sec_buf
.sec
);
1079 display_sec_desc(out_hnd
, ACTION_ENUMERATE
, sec_buf
.sec
);
1080 display_sec_desc(out_hnd
, ACTION_FOOTER
, sec_buf
.sec
);
1085 /* close the key handle */
1086 if ((*key_name
) != 0)
1088 res3
= res3
? reg_close(&key_pol
) : False
;
1091 /* close the registry handles */
1092 res
= res
? reg_close(&pol_con
) : False
;
1094 if (res
&& res3
&& res4
)
1096 DEBUG(5,("cmd_reg_get_key_sec: query succeeded\n"));
1100 DEBUG(5,("cmd_reg_get_key_sec: query failed\n"));
1104 /****************************************************************************
1105 nt registry shutdown
1106 ****************************************************************************/
1107 void cmd_reg_shutdown(struct client_info
*info
, int argc
, char *argv
[])
1112 uint32 timeout
= 20;
1118 fstrcpy(srv_name
, "\\\\");
1119 fstrcat(srv_name
, info
->dest_host
);
1122 while ((opt
= getopt(argc
, argv
,"fim:t:r-")) != EOF
)
1128 safe_strcpy(msg
, optarg
, sizeof(msg
)-1);
1133 timeout
= atoi(optarg
);
1148 if (strequal(optarg
, "-reboot"))
1152 if (strequal(optarg
, "-force-close"))
1161 /* create an entry */
1162 res
= res
? reg_shutdown(srv_name
, msg
, timeout
, flgs
) : False
;
1166 DEBUG(5,("cmd_reg_shutdown: query succeeded\n"));
1167 report(out_hnd
,"OK\n");
1171 DEBUG(5,("cmd_reg_shutdown: query failed\n"));
1172 report(out_hnd
,"Failed\n");