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 2 of the License, or
+ 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,
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, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "includes.h"
#include "utils/net.h"
else if (strnequal(fullname, "HKU", len) ||
strnequal(fullname, "HKEY_USERS", len))
(*reg_type) = HKEY_USERS;
+ else if (strnequal(fullname, "HKCU", len) ||
+ strnequal(fullname, "HKEY_CURRENT_USER", len))
+ (*reg_type) = HKEY_CURRENT_USER;
else if (strnequal(fullname, "HKPD", len) ||
strnequal(fullname, "HKEY_PERFORMANCE_DATA", len))
(*reg_type) = HKEY_PERFORMANCE_DATA;
NTSTATUS status;
struct winreg_String key;
+ ZERO_STRUCT(key);
+
if (!reg_hive_key(name, &hive, &key.name)) {
return NT_STATUS_INVALID_PARAMETER;
}
name_buf.size = max_valnamelen + 2;
data_size = max_valbufsize;
- data = TALLOC(mem_ctx, data_size);
+ data = (uint8 *)TALLOC(mem_ctx, data_size);
value_length = 0;
status = rpccli_winreg_EnumValue(pipe_hnd, mem_ctx, key_hnd,
return werror_to_ntstatus(err);
}
+ ZERO_STRUCT(name_string);
+
name_string.name = name;
result = rpccli_winreg_SetValue(pipe_hnd, blob.data, key_hnd,
name_string, value->type,
NTSTATUS status;
struct registry_value value;
- status = registry_openkey(mem_ctx, pipe_hnd, argv[0], REG_KEY_WRITE,
+ status = registry_openkey(mem_ctx, pipe_hnd, argv[0],
+ SEC_RIGHTS_MAXIMUM_ALLOWED,
&hive_hnd, &key_hnd);
if (!NT_STATUS_IS_OK(status)) {
d_fprintf(stderr, "registry_openkey failed: %s\n",
NTSTATUS status;
struct winreg_String valuename;
- status = registry_openkey(mem_ctx, pipe_hnd, argv[0], REG_KEY_WRITE,
+ ZERO_STRUCT(valuename);
+
+ status = registry_openkey(mem_ctx, pipe_hnd, argv[0],
+ SEC_RIGHTS_MAXIMUM_ALLOWED,
&hive_hnd, &key_hnd);
if (!NT_STATUS_IS_OK(status)) {
d_fprintf(stderr, "registry_openkey failed: %s\n",
enum winreg_CreateAction action;
NTSTATUS status;
+ ZERO_STRUCT(key);
+ ZERO_STRUCT(keyclass);
+
if (!reg_hive_key(argv[0], &hive, &key.name)) {
return NT_STATUS_INVALID_PARAMETER;
}
status = rpccli_winreg_Connect(pipe_hnd, mem_ctx, hive,
- REG_KEY_READ|REG_KEY_WRITE,
+ SEC_RIGHTS_MAXIMUM_ALLOWED,
&hive_hnd);
if (!(NT_STATUS_IS_OK(status))) {
return status;
struct winreg_String key;
NTSTATUS status;
+ ZERO_STRUCT(key);
+
if (!reg_hive_key(argv[0], &hive, &key.name)) {
return NT_STATUS_INVALID_PARAMETER;
}
- status = rpccli_winreg_Connect(pipe_hnd, mem_ctx, hive, REG_KEY_WRITE,
+ status = rpccli_winreg_Connect(pipe_hnd, mem_ctx, hive,
+ SEC_RIGHTS_MAXIMUM_ALLOWED,
&hive_hnd);
if (!(NT_STATUS_IS_OK(status))) {
return status;