2 * Samba Unix/Linux SMB client library
3 * Distributed SMB/CIFS Server Management Utility
4 * Local registry interface
6 * Copyright (C) Michael Adam 2008
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 3 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, see <http://www.gnu.org/licenses/>.
23 #include "utils/net.h"
24 #include "utils/net_registry_util.h"
25 #include "include/g_lock.h"
26 #include "registry/reg_import.h"
27 #include "registry/reg_format.h"
36 * split given path into hive and remaining path and open the hive key
38 static WERROR open_hive(TALLOC_CTX *ctx, const char *path,
39 uint32 desired_access,
40 struct registry_key **hive,
44 NT_USER_TOKEN *token = NULL;
45 char *hivename = NULL;
46 char *tmp_subkeyname = NULL;
47 TALLOC_CTX *tmp_ctx = talloc_stackframe();
49 if ((hive == NULL) || (subkeyname == NULL)) {
50 werr = WERR_INVALID_PARAM;
54 werr = split_hive_key(tmp_ctx, path, &hivename, &tmp_subkeyname);
55 if (!W_ERROR_IS_OK(werr)) {
58 *subkeyname = talloc_strdup(ctx, tmp_subkeyname);
59 if (*subkeyname == NULL) {
64 werr = ntstatus_to_werror(registry_create_admin_token(tmp_ctx, &token));
65 if (!W_ERROR_IS_OK(werr)) {
69 werr = reg_openhive(ctx, hivename, desired_access, token, hive);
70 if (!W_ERROR_IS_OK(werr)) {
81 static WERROR open_key(TALLOC_CTX *ctx, const char *path,
82 uint32 desired_access,
83 struct registry_key **key)
86 char *subkey_name = NULL;
87 struct registry_key *hive = NULL;
88 TALLOC_CTX *tmp_ctx = talloc_stackframe();
90 if ((path == NULL) || (key == NULL)) {
91 return WERR_INVALID_PARAM;
94 werr = open_hive(tmp_ctx, path, desired_access, &hive, &subkey_name);
95 if (!W_ERROR_IS_OK(werr)) {
96 d_fprintf(stderr, "open_hive failed: %s\n", win_errstr(werr));
100 werr = reg_openkey(ctx, hive, subkey_name, desired_access, key);
101 if (!W_ERROR_IS_OK(werr)) {
102 d_fprintf(stderr, "reg_openkey failed: %s\n",
110 TALLOC_FREE(tmp_ctx);
116 * the main "net registry" function implementations
120 static int net_registry_enumerate(struct net_context *c, int argc,
124 struct registry_key *key = NULL;
125 TALLOC_CTX *ctx = talloc_stackframe();
129 char *valname = NULL;
130 struct registry_value *valvalue = NULL;
133 if (argc != 1 || c->display_usage) {
134 d_printf("Usage: net registry enumerate <path>\n");
135 d_printf("Example: net registry enumerate "
136 "'HKLM\\Software\\Samba'\n");
140 werr = open_key(ctx, argv[0], REG_KEY_READ, &key);
141 if (!W_ERROR_IS_OK(werr)) {
142 d_fprintf(stderr, "open_key failed: %s\n", win_errstr(werr));
147 werr = reg_enumkey(ctx, key, count, &subkey_name, &modtime),
151 print_registry_key(subkey_name, &modtime);
153 if (!W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, werr)) {
158 werr = reg_enumvalue(ctx, key, count, &valname, &valvalue),
162 print_registry_value_with_name(valname, valvalue);
164 if (!W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, werr)) {
174 static int net_registry_createkey(struct net_context *c, int argc,
178 enum winreg_CreateAction action;
180 struct registry_key *hivekey = NULL;
181 struct registry_key *subkey = NULL;
182 TALLOC_CTX *ctx = talloc_stackframe();
185 if (argc != 1 || c->display_usage) {
186 d_printf("Usage: net registry createkey <path>\n");
187 d_printf("Example: net registry createkey "
188 "'HKLM\\Software\\Samba\\smbconf.127.0.0.1'\n");
191 if (strlen(argv[0]) == 0) {
192 d_fprintf(stderr, "error: zero length key name given\n");
196 werr = open_hive(ctx, argv[0], REG_KEY_WRITE, &hivekey, &subkeyname);
197 if (!W_ERROR_IS_OK(werr)) {
198 d_fprintf(stderr, "open_hive failed: %s\n", win_errstr(werr));
202 werr = reg_createkey(ctx, hivekey, subkeyname, REG_KEY_WRITE,
204 if (!W_ERROR_IS_OK(werr)) {
205 d_fprintf(stderr, "reg_createkey failed: %s\n",
210 case REG_ACTION_NONE:
211 d_printf("createkey did nothing -- huh?\n");
213 case REG_CREATED_NEW_KEY:
214 d_printf("createkey created %s\n", argv[0]);
216 case REG_OPENED_EXISTING_KEY:
217 d_printf("createkey opened existing %s\n", argv[0]);
228 static int net_registry_deletekey(struct net_context *c, int argc,
233 struct registry_key *hivekey = NULL;
234 TALLOC_CTX *ctx = talloc_stackframe();
237 if (argc != 1 || c->display_usage) {
238 d_printf("Usage: net registry deletekey <path>\n");
239 d_printf("Example: net registry deletekey "
240 "'HKLM\\Software\\Samba\\smbconf.127.0.0.1'\n");
243 if (strlen(argv[0]) == 0) {
244 d_fprintf(stderr, "error: zero length key name given\n");
248 werr = open_hive(ctx, argv[0], REG_KEY_WRITE, &hivekey, &subkeyname);
249 if (!W_ERROR_IS_OK(werr)) {
250 d_fprintf(stderr, "open_hive failed: %s\n", win_errstr(werr));
254 werr = reg_deletekey(hivekey, subkeyname);
255 if (!W_ERROR_IS_OK(werr)) {
256 d_fprintf(stderr, "reg_deletekey failed: %s\n",
268 static int net_registry_getvalue_internal(struct net_context *c, int argc,
269 const char **argv, bool raw)
273 struct registry_key *key = NULL;
274 struct registry_value *value = NULL;
275 TALLOC_CTX *ctx = talloc_stackframe();
277 if (argc != 2 || c->display_usage) {
278 d_fprintf(stderr, "usage: net rpc registry getvalue <key> "
283 werr = open_key(ctx, argv[0], REG_KEY_READ, &key);
284 if (!W_ERROR_IS_OK(werr)) {
285 d_fprintf(stderr, "open_key failed: %s\n", win_errstr(werr));
289 werr = reg_queryvalue(ctx, key, argv[1], &value);
290 if (!W_ERROR_IS_OK(werr)) {
291 d_fprintf(stderr, "reg_queryvalue failed: %s\n",
296 print_registry_value(value, raw);
305 static int net_registry_getvalue(struct net_context *c, int argc,
308 return net_registry_getvalue_internal(c, argc, argv, false);
311 static int net_registry_getvalueraw(struct net_context *c, int argc,
314 return net_registry_getvalue_internal(c, argc, argv, true);
317 static int net_registry_getvaluesraw(struct net_context *c, int argc,
322 struct registry_key *key = NULL;
323 TALLOC_CTX *ctx = talloc_stackframe();
326 if (argc != 1 || c->display_usage) {
327 d_fprintf(stderr, "usage: net rpc registry getvaluesraw "
332 werr = open_key(ctx, argv[0], REG_KEY_READ, &key);
333 if (!W_ERROR_IS_OK(werr)) {
334 d_fprintf(stderr, "open_key failed: %s\n", win_errstr(werr));
340 struct registry_value *val;
342 werr = reg_enumvalue(talloc_tos(), key, idx, NULL, &val);
344 if (W_ERROR_EQUAL(werr, WERR_NO_MORE_ITEMS)) {
348 if (!W_ERROR_IS_OK(werr)) {
351 print_registry_value(val, true);
360 static int net_registry_setvalue(struct net_context *c, int argc,
364 struct registry_value value;
365 struct registry_key *key = NULL;
367 TALLOC_CTX *ctx = talloc_stackframe();
369 if (argc < 4 || c->display_usage) {
370 d_fprintf(stderr, "usage: net rpc registry setvalue <key> "
371 "<valuename> <type> [<val>]+\n");
375 if (!strequal(argv[2], "multi_sz") && (argc != 4)) {
376 d_fprintf(stderr, "Too many args for type %s\n", argv[2]);
380 if (strequal(argv[2], "dword")) {
381 value.type = REG_DWORD;
382 value.v.dword = strtoul(argv[3], NULL, 10);
383 } else if (strequal(argv[2], "sz")) {
385 value.v.sz.len = strlen(argv[3])+1;
386 value.v.sz.str = CONST_DISCARD(char *, argv[3]);
387 } else if (strequal(argv[2], "multi_sz")) {
388 value.type = REG_MULTI_SZ;
389 value.v.multi_sz.num_strings = argc - 3;
390 value.v.multi_sz.strings = (char **)(argv + 3);
392 d_fprintf(stderr, "type \"%s\" not implemented\n", argv[2]);
396 werr = open_key(ctx, argv[0], REG_KEY_WRITE, &key);
397 if (!W_ERROR_IS_OK(werr)) {
398 d_fprintf(stderr, "open_key failed: %s\n", win_errstr(werr));
402 werr = reg_setvalue(key, argv[1], &value);
403 if (!W_ERROR_IS_OK(werr)) {
404 d_fprintf(stderr, "reg_setvalue failed: %s\n",
416 struct net_registry_increment_state {
418 const char *valuename;
424 static void net_registry_increment_fn(void *private_data)
426 struct net_registry_increment_state *state =
427 (struct net_registry_increment_state *)private_data;
428 struct registry_value *value;
429 struct registry_key *key = NULL;
431 state->werr = open_key(talloc_tos(), state->keyname,
432 REG_KEY_READ|REG_KEY_WRITE, &key);
433 if (!W_ERROR_IS_OK(state->werr)) {
434 d_fprintf(stderr, "open_key failed: %s\n",
435 win_errstr(state->werr));
439 state->werr = reg_queryvalue(key, key, state->valuename, &value);
440 if (!W_ERROR_IS_OK(state->werr)) {
441 d_fprintf(stderr, "reg_queryvalue failed: %s\n",
442 win_errstr(state->werr));
446 if (value->type != REG_DWORD) {
447 d_fprintf(stderr, "value not a DWORD: %s\n",
448 reg_type_lookup(value->type));
452 value->v.dword += state->increment;
453 state->newvalue = value->v.dword;
455 state->werr = reg_setvalue(key, state->valuename, value);
456 if (!W_ERROR_IS_OK(state->werr)) {
457 d_fprintf(stderr, "reg_setvalue failed: %s\n",
458 win_errstr(state->werr));
467 static int net_registry_increment(struct net_context *c, int argc,
470 struct net_registry_increment_state state;
474 if (argc < 2 || c->display_usage) {
475 d_fprintf(stderr, "%s\n%s",
477 "net registry increment <key> <valuename> "
482 state.keyname = argv[0];
483 state.valuename = argv[1];
487 state.increment = strtoul(argv[2], NULL, 10);
490 status = g_lock_do("registry_increment_lock", G_LOCK_WRITE,
492 net_registry_increment_fn, &state);
493 if (!NT_STATUS_IS_OK(status)) {
494 d_fprintf(stderr, "g_lock_do failed: %s\n",
498 if (!W_ERROR_IS_OK(state.werr)) {
499 d_fprintf(stderr, "increment failed: %s\n",
500 win_errstr(state.werr));
504 d_printf("new value: %u\n", (unsigned)state.newvalue);
512 static int net_registry_deletevalue(struct net_context *c, int argc,
516 struct registry_key *key = NULL;
517 TALLOC_CTX *ctx = talloc_stackframe();
520 if (argc != 2 || c->display_usage) {
521 d_fprintf(stderr, "usage: net rpc registry deletevalue <key> "
526 werr = open_key(ctx, argv[0], REG_KEY_WRITE, &key);
527 if (!W_ERROR_IS_OK(werr)) {
528 d_fprintf(stderr, "open_key failed: %s\n", win_errstr(werr));
532 werr = reg_deletevalue(key, argv[1]);
533 if (!W_ERROR_IS_OK(werr)) {
534 d_fprintf(stderr, "reg_deletekey failed: %s\n",
546 static WERROR net_registry_getsd_internal(struct net_context *c,
549 struct security_descriptor **sd)
552 struct registry_key *key = NULL;
553 TALLOC_CTX *ctx = talloc_stackframe();
554 uint32_t access_mask = REG_KEY_READ |
555 SEC_FLAG_MAXIMUM_ALLOWED |
556 SEC_FLAG_SYSTEM_SECURITY;
559 * net_rpc_regsitry uses SEC_FLAG_SYSTEM_SECURITY, but access
560 * is denied with these perms right now...
562 access_mask = REG_KEY_READ;
565 d_fprintf(stderr, "internal error: invalid argument\n");
566 werr = WERR_INVALID_PARAM;
570 if (strlen(keyname) == 0) {
571 d_fprintf(stderr, "error: zero length key name given\n");
572 werr = WERR_INVALID_PARAM;
576 werr = open_key(ctx, keyname, access_mask, &key);
577 if (!W_ERROR_IS_OK(werr)) {
578 d_fprintf(stderr, "open_key failed: %s\n", win_errstr(werr));
582 werr = reg_getkeysecurity(mem_ctx, key, sd);
583 if (!W_ERROR_IS_OK(werr)) {
584 d_fprintf(stderr, "reg_getkeysecurity failed: %s\n",
596 static int net_registry_getsd(struct net_context *c, int argc,
601 struct security_descriptor *secdesc = NULL;
602 TALLOC_CTX *ctx = talloc_stackframe();
604 if (argc != 1 || c->display_usage) {
605 d_printf("Usage: net registry getsd <path>\n");
606 d_printf("Example: net registry getsd "
607 "'HKLM\\Software\\Samba'\n");
611 werr = net_registry_getsd_internal(c, ctx, argv[0], &secdesc);
612 if (!W_ERROR_IS_OK(werr)) {
616 display_sec_desc(secdesc);
625 static int net_registry_getsd_sddl(struct net_context *c,
626 int argc, const char **argv)
630 struct security_descriptor *secdesc = NULL;
631 TALLOC_CTX *ctx = talloc_stackframe();
633 if (argc != 1 || c->display_usage) {
634 d_printf("Usage: net registry getsd_sddl <path>\n");
635 d_printf("Example: net registry getsd_sddl 'HKLM\\Software\\Samba'\n");
639 werr = net_registry_getsd_internal(c, ctx, argv[0], &secdesc);
640 if (!W_ERROR_IS_OK(werr)) {
644 d_printf("%s\n", sddl_encode(ctx, secdesc, get_global_sam_sid()));
653 static WERROR net_registry_setsd_internal(struct net_context *c,
656 struct security_descriptor *sd)
659 struct registry_key *key = NULL;
660 TALLOC_CTX *ctx = talloc_stackframe();
661 uint32_t access_mask = REG_KEY_WRITE |
662 SEC_FLAG_MAXIMUM_ALLOWED |
663 SEC_FLAG_SYSTEM_SECURITY;
666 * net_rpc_regsitry uses SEC_FLAG_SYSTEM_SECURITY, but access
667 * is denied with these perms right now...
669 access_mask = REG_KEY_WRITE;
671 if (strlen(keyname) == 0) {
672 d_fprintf(stderr, "error: zero length key name given\n");
673 werr = WERR_INVALID_PARAM;
677 werr = open_key(ctx, keyname, access_mask, &key);
678 if (!W_ERROR_IS_OK(werr)) {
679 d_fprintf(stderr, "open_key failed: %s\n", win_errstr(werr));
683 werr = reg_setkeysecurity(key, sd);
684 if (!W_ERROR_IS_OK(werr)) {
685 d_fprintf(stderr, "reg_setkeysecurity failed: %s\n",
697 static int net_registry_setsd_sddl(struct net_context *c,
698 int argc, const char **argv)
702 struct security_descriptor *secdesc = NULL;
703 TALLOC_CTX *ctx = talloc_stackframe();
705 if (argc != 2 || c->display_usage) {
706 d_printf("Usage: net registry setsd_sddl <path> <security_descriptor>\n");
707 d_printf("Example:\n"
708 "net registry setsd_sddl 'HKLM\\Software\\Samba'\n");
712 secdesc = sddl_decode(ctx, argv[1], get_global_sam_sid());
713 if (secdesc == NULL) {
717 werr = net_registry_setsd_internal(c, ctx, argv[0], secdesc);
718 if (!W_ERROR_IS_OK(werr)) {
729 /******************************************************************************/
731 * @defgroup net_registry net registry
735 * @defgroup net_registry_import Import
736 * @ingroup net_registry
745 static WERROR import_create_key(struct import_ctx* ctx,
746 struct registry_key* parent,
747 const char* name, void** pkey, bool* existing)
750 void* mem_ctx = talloc_new(ctx->mem_ctx);
752 struct registry_key* key = NULL;
753 enum winreg_CreateAction action;
755 if (parent == NULL) {
756 char* subkeyname = NULL;
757 werr = open_hive(mem_ctx, name, REG_KEY_WRITE,
758 &parent, &subkeyname);
759 if (!W_ERROR_IS_OK(werr)) {
760 d_fprintf(stderr, "open_hive failed: %s\n",
767 action = REG_ACTION_NONE;
768 werr = reg_createkey(mem_ctx, parent, name, REG_KEY_WRITE,
770 if (!W_ERROR_IS_OK(werr)) {
771 d_fprintf(stderr, "reg_createkey failed: %s\n",
776 if (action == REG_ACTION_NONE) {
777 d_fprintf(stderr, "createkey did nothing -- huh?\n");
782 if (existing != NULL) {
783 *existing = (action == REG_OPENED_EXISTING_KEY);
787 *pkey = talloc_steal(ctx->mem_ctx, key);
791 talloc_free(mem_ctx);
795 static WERROR import_close_key(struct import_ctx* ctx,
796 struct registry_key* key)
801 static WERROR import_delete_key(struct import_ctx* ctx,
802 struct registry_key* parent, const char* name)
805 void* mem_ctx = talloc_new(talloc_tos());
807 if (parent == NULL) {
808 char* subkeyname = NULL;
809 werr = open_hive(mem_ctx, name, REG_KEY_WRITE,
810 &parent, &subkeyname);
811 if (!W_ERROR_IS_OK(werr)) {
812 d_fprintf(stderr, "open_hive failed: %s\n",
819 werr = reg_deletekey_recursive(mem_ctx, parent, name);
820 if (!W_ERROR_IS_OK(werr)) {
821 d_fprintf(stderr, "reg_deletekey_recursive %s: %s\n", "failed",
827 talloc_free(mem_ctx);
831 static WERROR import_create_val (struct import_ctx* ctx,
832 struct registry_key* parent, const char* name,
833 const struct registry_value* value)
837 if (parent == NULL) {
838 return WERR_INVALID_PARAM;
841 werr = reg_setvalue(parent, name, value);
842 if (!W_ERROR_IS_OK(werr)) {
843 d_fprintf(stderr, "reg_setvalue failed: %s\n",
849 static WERROR import_delete_val (struct import_ctx* ctx, struct registry_key* parent, const char* name) {
852 if (parent == NULL) {
853 return WERR_INVALID_PARAM;
856 werr = reg_deletevalue(parent, name);
857 if (!W_ERROR_IS_OK(werr)) {
858 d_fprintf(stderr, "reg_deletekey failed: %s\n",
866 static int net_registry_import(struct net_context *c, int argc,
869 struct import_ctx import_ctx;
870 struct reg_import_callback import_callback = {
872 .closekey = (reg_import_callback_closekey_t)&import_close_key,
873 .createkey = (reg_import_callback_createkey_t)&import_create_key,
874 .deletekey = (reg_import_callback_deletekey_t)&import_delete_key,
875 .deleteval = (reg_import_callback_deleteval_t)&import_delete_val,
876 .setval.registry_value = (reg_import_callback_setval_registry_value_t)
878 .setval_type = REGISTRY_VALUE,
884 if (argc < 1 || argc > 2 || c->display_usage) {
887 "net registry import <reg> [options]\n");
890 "net registry import file.reg enc=CP1252\n");
894 ZERO_STRUCT(import_ctx);
895 import_ctx.mem_ctx = talloc_stackframe();
898 regdb_transaction_start();
900 ret = reg_parse_file(argv[0],
901 reg_import_adapter(import_ctx.mem_ctx,
903 (argc > 1) ? argv[1] : NULL
906 d_printf("reg_parse_file failed: transaction canceled\n");
907 regdb_transaction_cancel();
909 regdb_transaction_commit();
913 talloc_free(import_ctx.mem_ctx);
919 /******************************************************************************/
922 * @defgroup net_registry_export Export
923 * @ingroup net_registry
927 static int registry_export(TALLOC_CTX *ctx, /*const*/ struct registry_key* key,
928 struct reg_format* f)
934 struct registry_value *valvalue = NULL;
935 char *valname = NULL;
937 struct registry_key* subkey = NULL;
938 char *subkey_name = NULL;
941 reg_format_registry_key(f, key, false);
945 werr = reg_enumvalue(ctx, key, count, &valname, &valvalue),
949 reg_format_registry_value(f, valname, valvalue);
951 if (!W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, werr)) {
952 d_fprintf(stderr, "reg_enumvalue failed: %s\n",
957 /* recurse on subkeys */
959 werr = reg_enumkey(ctx, key, count, &subkey_name, &modtime),
963 werr = reg_openkey(ctx, key, subkey_name, REG_KEY_READ,
965 if (!W_ERROR_IS_OK(werr)) {
966 d_fprintf(stderr, "reg_openkey failed: %s\n",
971 registry_export(ctx, subkey, f);
973 if (!W_ERROR_EQUAL(WERR_NO_MORE_ITEMS, werr)) {
974 d_fprintf(stderr, "reg_enumkey failed: %s\n",
983 static int net_registry_export(struct net_context *c, int argc,
988 struct registry_key *key = NULL;
989 TALLOC_CTX *ctx = talloc_stackframe();
990 struct reg_format* f=NULL;
992 if (argc < 2 || argc > 3 || c->display_usage) {
995 "net registry export <path> <file> [opt]\n");
998 "net registry export 'HKLM\\Software\\Samba' "
999 "samba.reg regedit5\n");
1003 werr = open_key(ctx, argv[0], REG_KEY_READ, &key);
1004 if (!W_ERROR_IS_OK(werr)) {
1005 d_fprintf(stderr, "open_key failed: %s\n", win_errstr(werr));
1009 f = reg_format_file(ctx, argv[1], (argc > 2) ? argv[2] : NULL);
1011 d_fprintf(stderr, "open file failed: %s\n", strerror(errno));
1015 ret = registry_export(ctx, key, f);
1023 /******************************************************************************/
1024 int net_registry(struct net_context *c, int argc, const char **argv)
1028 struct functable func[] = {
1031 net_registry_enumerate,
1032 NET_TRANSPORT_LOCAL,
1033 "Enumerate registry keys and values",
1034 "net registry enumerate\n"
1035 " Enumerate registry keys and values"
1039 net_registry_createkey,
1040 NET_TRANSPORT_LOCAL,
1041 "Create a new registry key",
1042 "net registry createkey\n"
1043 " Create a new registry key"
1047 net_registry_deletekey,
1048 NET_TRANSPORT_LOCAL,
1049 "Delete a registry key",
1050 "net registry deletekey\n"
1051 " Delete a registry key"
1055 net_registry_getvalue,
1056 NET_TRANSPORT_LOCAL,
1057 "Print a registry value",
1058 "net registry getvalue\n"
1059 " Print a registry value"
1063 net_registry_getvalueraw,
1064 NET_TRANSPORT_LOCAL,
1065 "Print a registry value (raw format)",
1066 "net registry getvalueraw\n"
1067 " Print a registry value (raw format)"
1071 net_registry_getvaluesraw,
1072 NET_TRANSPORT_LOCAL,
1073 "Print all values of a key in raw format",
1074 "net registry getvaluesraw <key>\n"
1075 " Print a registry value (raw format)"
1079 net_registry_setvalue,
1080 NET_TRANSPORT_LOCAL,
1081 "Set a new registry value",
1082 "net registry setvalue\n"
1083 " Set a new registry value"
1087 net_registry_increment,
1088 NET_TRANSPORT_LOCAL,
1089 "Increment a DWORD registry value under a lock",
1090 "net registry increment\n"
1091 " Increment a DWORD registry value under a lock"
1095 net_registry_deletevalue,
1096 NET_TRANSPORT_LOCAL,
1097 "Delete a registry value",
1098 "net registry deletevalue\n"
1099 " Delete a registry value"
1104 NET_TRANSPORT_LOCAL,
1105 "Get security descriptor",
1106 "net registry getsd\n"
1107 " Get security descriptor"
1111 net_registry_getsd_sddl,
1112 NET_TRANSPORT_LOCAL,
1113 "Get security descriptor in sddl format",
1114 "net registry getsd_sddl\n"
1115 " Get security descriptor in sddl format"
1119 net_registry_setsd_sddl,
1120 NET_TRANSPORT_LOCAL,
1121 "Set security descriptor from sddl format string",
1122 "net registry setsd_sddl\n"
1123 " Set security descriptor from sddl format string"
1127 net_registry_import,
1128 NET_TRANSPORT_LOCAL,
1130 "net registry import\n"
1135 net_registry_export,
1136 NET_TRANSPORT_LOCAL,
1138 "net registry export\n"
1141 { NULL, NULL, 0, NULL, NULL }
1144 if (!W_ERROR_IS_OK(registry_init_basic())) {
1148 ret = net_run_function(c, argc, argv, "net registry", func);