From 06466de5e9636dc2934c8f52f20d71ed0f4e6da0 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 4 Apr 2008 13:21:03 +0200 Subject: net_registry: split utility function of common interest out into util module. Michael (This used to be commit 3bf890783fadd245c59280173627a6caca2dbefe) --- source3/utils/net_registry_util.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 source3/utils/net_registry_util.h (limited to 'source3/utils/net_registry_util.h') diff --git a/source3/utils/net_registry_util.h b/source3/utils/net_registry_util.h new file mode 100644 index 0000000000..5438f39946 --- /dev/null +++ b/source3/utils/net_registry_util.h @@ -0,0 +1,39 @@ +/* + * Samba Unix/Linux SMB client library + * Distributed SMB/CIFS Server Management Utility + * registry utility functions + * + * Copyright (C) Michael Adam 2008 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __NET_REGISTRY_UTIL_H__ +#define __NET_REGISTRY_UTIL_H__ + +void print_registry_key(const char *keyname, NTTIME *modtime); + +void print_registry_value(const char *valname, + const struct registry_value *valvalue); + +/** + * Split path into hive name and subkeyname + * normalizations performed: + * - convert '/' to '\\' + * - strip trailing '\\' chars + */ +WERROR split_hive_key(TALLOC_CTX *ctx, const char *path, char **hivename, + const char **subkeyname); + +#endif -- cgit From ae790f9b89779a0fa1ba4ecfb5b99df160d222fd Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 4 Apr 2008 17:24:53 +0200 Subject: net: change split_hive_key() to properly allocate subkeyname instead of returning a pointer into another string. Michael (This used to be commit 68d08ecf92be3444b759300237b2b7cf5238d022) --- source3/utils/net_registry_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/utils/net_registry_util.h') diff --git a/source3/utils/net_registry_util.h b/source3/utils/net_registry_util.h index 5438f39946..13ec6ebfcd 100644 --- a/source3/utils/net_registry_util.h +++ b/source3/utils/net_registry_util.h @@ -34,6 +34,6 @@ void print_registry_value(const char *valname, * - strip trailing '\\' chars */ WERROR split_hive_key(TALLOC_CTX *ctx, const char *path, char **hivename, - const char **subkeyname); + char **subkeyname); #endif -- cgit From d3dcaac176212a20c2bb71a08b4ac39ea2689047 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 9 Apr 2008 12:29:34 +0200 Subject: net (registry util): refactor printing of value without name out. This renames print_registry_value() to print_registry_value_with_name(). The new function is called print_registry_value(). Michael (This used to be commit 88c4851ad7240bc4f72a5ef92e21629e6a4c99c6) --- source3/utils/net_registry_util.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/utils/net_registry_util.h') diff --git a/source3/utils/net_registry_util.h b/source3/utils/net_registry_util.h index 13ec6ebfcd..09aaa8394b 100644 --- a/source3/utils/net_registry_util.h +++ b/source3/utils/net_registry_util.h @@ -24,8 +24,10 @@ void print_registry_key(const char *keyname, NTTIME *modtime); -void print_registry_value(const char *valname, - const struct registry_value *valvalue); +void print_registry_value(const struct registry_value *valvalue); + +void print_registry_value_with_name(const char *valname, + const struct registry_value *valvalue); /** * Split path into hive name and subkeyname -- cgit From 49835c6d9e5b838484e6e806b80d8acb7ef2ef5a Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 15 May 2008 12:55:54 +0200 Subject: net_registry: add raw output of value to print_registry_value(). Michael (This used to be commit 340a706422cbca45cc63fa94d36c88f6751f4f31) --- source3/utils/net_registry_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/utils/net_registry_util.h') diff --git a/source3/utils/net_registry_util.h b/source3/utils/net_registry_util.h index 09aaa8394b..61fd834a3c 100644 --- a/source3/utils/net_registry_util.h +++ b/source3/utils/net_registry_util.h @@ -24,7 +24,7 @@ void print_registry_key(const char *keyname, NTTIME *modtime); -void print_registry_value(const struct registry_value *valvalue); +void print_registry_value(const struct registry_value *valvalue, bool raw); void print_registry_value_with_name(const char *valname, const struct registry_value *valvalue); -- cgit