summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/charset/charset.h4
-rw-r--r--source4/lib/charset/util_unistr.c2
-rw-r--r--source4/lib/cmdline/credentials.c1
-rw-r--r--source4/lib/cmdline/popt_common.h2
-rw-r--r--source4/lib/events/events_util.c1
-rw-r--r--source4/lib/ldb/include/ldb_private.h7
-rw-r--r--source4/lib/ldb/ldb_map/ldb_map_private.h2
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c2
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c4
-rw-r--r--source4/lib/ldb/modules/paged_results.c2
-rw-r--r--source4/lib/registry/ldb.c222
-rw-r--r--source4/lib/registry/registry.h12
-rw-r--r--source4/lib/registry/rpc.c4
-rw-r--r--source4/lib/samba3/smbpasswd.c3
-rw-r--r--source4/lib/smbreadline/smbreadline.c2
-rw-r--r--source4/lib/tls/tls.c1
-rw-r--r--source4/lib/tls/tlscert.c4
-rw-r--r--source4/lib/torture/torture.c13
18 files changed, 206 insertions, 82 deletions
diff --git a/source4/lib/charset/charset.h b/source4/lib/charset/charset.h
index d4dae4cdad..041eaeace7 100644
--- a/source4/lib/charset/charset.h
+++ b/source4/lib/charset/charset.h
@@ -147,4 +147,8 @@ struct smb_iconv_convenience *smb_iconv_convenience_init(TALLOC_CTX *mem_ctx,
const char *dos_charset,
const char *unix_charset,
bool native_iconv);
+
+void load_case_tables(void);
+bool charset_register_backend(const void *_funcs);
+
#endif /* __CHARSET_H__ */
diff --git a/source4/lib/charset/util_unistr.c b/source4/lib/charset/util_unistr.c
index 5f3b2c53f1..e4f4bb551a 100644
--- a/source4/lib/charset/util_unistr.c
+++ b/source4/lib/charset/util_unistr.c
@@ -37,7 +37,7 @@ static void *lowcase_table;
/*******************************************************************
load the case handling tables
********************************************************************/
-static void load_case_tables(void)
+void load_case_tables(void)
{
TALLOC_CTX *mem_ctx;
diff --git a/source4/lib/cmdline/credentials.c b/source4/lib/cmdline/credentials.c
index 2e5c6fd94a..f919842e6a 100644
--- a/source4/lib/cmdline/credentials.c
+++ b/source4/lib/cmdline/credentials.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "auth/credentials/credentials.h"
+#include "lib/cmdline/credentials.h"
static const char *cmdline_get_userpassword(struct cli_credentials *credentials)
{
diff --git a/source4/lib/cmdline/popt_common.h b/source4/lib/cmdline/popt_common.h
index df432bb475..733d12a443 100644
--- a/source4/lib/cmdline/popt_common.h
+++ b/source4/lib/cmdline/popt_common.h
@@ -36,4 +36,6 @@ extern struct poptOption popt_common_credentials[];
extern struct cli_credentials *cmdline_credentials;
extern struct loadparm_context *cmdline_lp_ctx;
+void popt_common_dont_ask(void);
+
#endif /* _POPT_COMMON_H */
diff --git a/source4/lib/events/events_util.c b/source4/lib/events/events_util.c
index 93f6492560..9e7d758405 100644
--- a/source4/lib/events/events_util.c
+++ b/source4/lib/events/events_util.c
@@ -22,6 +22,7 @@
#include "talloc.h"
#include "events.h"
#include "events_internal.h"
+#include "events_util.h"
#include <fcntl.h>
/**
diff --git a/source4/lib/ldb/include/ldb_private.h b/source4/lib/ldb/include/ldb_private.h
index a92549d9ce..8f7e010bee 100644
--- a/source4/lib/ldb/include/ldb_private.h
+++ b/source4/lib/ldb/include/ldb_private.h
@@ -211,6 +211,10 @@ char *ldb_casefold_default(void *context, void *mem_ctx, const char *s, size_t n
void ldb_msg_remove_element(struct ldb_message *msg, struct ldb_message_element *el);
+int ldb_msg_element_compare_name(struct ldb_message_element *el1,
+ struct ldb_message_element *el2);
+void ldb_dump_results(struct ldb_context *ldb, struct ldb_result *result, FILE *f);
+
/**
Obtain current/next database sequence number
*/
@@ -273,4 +277,7 @@ int ldb_module_done(struct ldb_request *req,
int ldb_mod_register_control(struct ldb_module *module, const char *oid);
+
+struct ldb_val ldb_binary_decode(void *mem_ctx, const char *str);
+
#endif
diff --git a/source4/lib/ldb/ldb_map/ldb_map_private.h b/source4/lib/ldb/ldb_map/ldb_map_private.h
index 5522125344..0543ba71b9 100644
--- a/source4/lib/ldb/ldb_map/ldb_map_private.h
+++ b/source4/lib/ldb/ldb_map/ldb_map_private.h
@@ -86,3 +86,5 @@ int map_return_fatal_error(struct ldb_request *req,
int map_return_normal_error(struct ldb_request *req,
struct ldb_reply *ares,
int error);
+
+int map_return_entry(struct map_context *ac, struct ldb_reply *ares);
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index 1c76411db2..6ab06c4e48 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -205,7 +205,7 @@ static struct ldb_message *ltdb_pull_attrs(struct ldb_module *module,
return LDB_ERR_NO_SUCH_OBJECT on record-not-found
and LDB_SUCCESS on success
*/
-int ltdb_search_base(struct ldb_module *module, struct ldb_dn *dn)
+static int ltdb_search_base(struct ldb_module *module, struct ldb_dn *dn)
{
struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
TDB_DATA tdb_key, tdb_data;
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index 2282f61d47..34a4e03965 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -161,7 +161,7 @@ failed:
check special dn's have valid attributes
currently only @ATTRIBUTES is checked
*/
-int ltdb_check_special_dn(struct ldb_module *module,
+static int ltdb_check_special_dn(struct ldb_module *module,
const struct ldb_message *msg)
{
int i, j;
@@ -968,7 +968,7 @@ done:
return ret;
}
-void ltdb_request_done(struct ldb_request *req, int error)
+static void ltdb_request_done(struct ldb_request *req, int error)
{
struct ldb_reply *ares;
diff --git a/source4/lib/ldb/modules/paged_results.c b/source4/lib/ldb/modules/paged_results.c
index d3bb83bbcd..1a242f1be0 100644
--- a/source4/lib/ldb/modules/paged_results.c
+++ b/source4/lib/ldb/modules/paged_results.c
@@ -70,7 +70,7 @@ struct private_data {
};
-int store_destructor(struct results_store *del)
+static int store_destructor(struct results_store *del)
{
struct private_data *priv = del->priv;
struct results_store *loop;
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c
index 25b8c583ed..7d78ba1a8f 100644
--- a/source4/lib/registry/ldb.c
+++ b/source4/lib/registry/ldb.c
@@ -1,7 +1,8 @@
/*
Unix SMB/CIFS implementation.
Registry interface
- Copyright (C) Jelmer Vernooij 2004-2007.
+ Copyright (C) 2004-2007, Jelmer Vernooij, jelmer@samba.org
+ Copyright (C) 2008 Matthias Dieter Wallnöfer, mwallnoefer@yahoo.de
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
@@ -51,17 +52,31 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx,
NULL));
value_type = ldb_msg_find_attr_as_uint(msg, "type", 0);
- if (type != NULL)
- *type = value_type;
+ *type = value_type;
+
val = ldb_msg_find_ldb_val(msg, "data");
switch (value_type)
{
case REG_SZ:
case REG_EXPAND_SZ:
- data->length = convert_string_talloc(mem_ctx, iconv_convenience, CH_UTF8, CH_UTF16,
+ if (val != NULL)
+ data->length = convert_string_talloc(mem_ctx, iconv_convenience, CH_UTF8, CH_UTF16,
val->data, val->length,
(void **)&data->data);
+ else {
+ data->data = NULL;
+ data->length = 0;
+ }
+ break;
+
+ case REG_BINARY:
+ if (val != NULL)
+ *data = data_blob_talloc(mem_ctx, val->data, val->length);
+ else {
+ data->data = NULL;
+ data->length = 0;
+ }
break;
case REG_DWORD: {
@@ -90,11 +105,22 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx,
switch (type) {
case REG_SZ:
case REG_EXPAND_SZ:
- val.length = convert_string_talloc(mem_ctx, lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UNIX,
+ if (data.data[0] != '\0') {
+ val.length = convert_string_talloc(mem_ctx, lp_iconv_convenience(global_loadparm), CH_UTF16, CH_UTF8,
(void *)data.data,
data.length,
(void **)&val.data);
- ldb_msg_add_value(msg, "data", &val, NULL);
+ ldb_msg_add_value(msg, "data", &val, NULL);
+ } else {
+ ldb_msg_add_empty(msg, "data", LDB_FLAG_MOD_DELETE, NULL);
+ }
+ break;
+
+ case REG_BINARY:
+ if (data.length > 0)
+ ldb_msg_add_value(msg, "data", &data, NULL);
+ else
+ ldb_msg_add_empty(msg, "data", LDB_FLAG_MOD_DELETE, NULL);
break;
case REG_DWORD:
@@ -228,9 +254,11 @@ static WERROR cache_values(struct ldb_key_data *kd)
ldb_dn_get_linearized(kd->dn), ldb_errstring(c)));
return WERR_FOOBAR;
}
+
kd->value_count = res->count;
kd->values = talloc_steal(kd, res->msgs);
talloc_free(res);
+
return WERR_OK;
}
@@ -243,6 +271,15 @@ static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx,
{
struct ldb_message_element *el;
struct ldb_key_data *kd = talloc_get_type(k, struct ldb_key_data);
+
+ /* Initialization */
+ if (name != NULL)
+ *name = NULL;
+ if (classname != NULL)
+ *classname = NULL; /* TODO: Store properly */
+ if (last_mod_time != NULL)
+ *last_mod_time = 0; /* TODO: we need to add this to the
+ ldb backend properly */
/* Do a search if necessary */
if (kd->subkeys == NULL) {
@@ -259,12 +296,34 @@ static WERROR ldb_get_subkey_by_id(TALLOC_CTX *mem_ctx,
if (name != NULL)
*name = talloc_strdup(mem_ctx, (char *)el->values[0].data);
- if (classname != NULL)
- *classname = NULL; /* TODO: Store properly */
+ return WERR_OK;
+}
- if (last_mod_time != NULL)
- *last_mod_time = 0; /* TODO: we need to add this to the
- ldb backend properly */
+static WERROR ldb_get_default_value(TALLOC_CTX *mem_ctx, struct hive_key *k,
+ const char **name, uint32_t *data_type,
+ DATA_BLOB *data)
+{
+ struct ldb_key_data *kd = talloc_get_type(k, struct ldb_key_data);
+ struct ldb_context *c = kd->ldb;
+ const char* attrs[] = { "data", "type", NULL };
+ struct ldb_result *res;
+ int ret;
+
+ ret = ldb_search(c, mem_ctx, &res, kd->dn, LDB_SCOPE_BASE, attrs, "%s", "");
+
+ if (ret != LDB_SUCCESS) {
+ DEBUG(0, ("Error getting default value for '%s': %s\n",
+ ldb_dn_get_linearized(kd->dn), ldb_errstring(c)));
+ return WERR_FOOBAR;
+ }
+
+ if (res->count == 0 || res->msgs[0]->num_elements == 0)
+ return WERR_BADFILE;
+
+ reg_ldb_unpack_value(mem_ctx, lp_iconv_convenience(global_loadparm),
+ res->msgs[0], name, data_type, data);
+
+ talloc_free(res);
return WERR_OK;
}
@@ -275,6 +334,15 @@ static WERROR ldb_get_value_by_id(TALLOC_CTX *mem_ctx, struct hive_key *k,
{
struct ldb_key_data *kd = talloc_get_type(k, struct ldb_key_data);
+ /* if default value exists, give it back */
+ if (W_ERROR_IS_OK(ldb_get_default_value(mem_ctx, k, name, data_type,
+ data))) {
+ if (idx == 0)
+ return WERR_OK;
+ else
+ --idx;
+ }
+
/* Do the search if necessary */
if (kd->values == NULL) {
W_ERROR_NOT_OK_RETURN(cache_values(kd));
@@ -283,8 +351,8 @@ static WERROR ldb_get_value_by_id(TALLOC_CTX *mem_ctx, struct hive_key *k,
if (idx >= kd->value_count)
return WERR_NO_MORE_ITEMS;
- reg_ldb_unpack_value(mem_ctx, lp_iconv_convenience(global_loadparm), kd->values[idx],
- name, data_type, data);
+ reg_ldb_unpack_value(mem_ctx, lp_iconv_convenience(global_loadparm),
+ kd->values[idx], name, data_type, data);
return WERR_OK;
}
@@ -297,27 +365,32 @@ static WERROR ldb_get_value(TALLOC_CTX *mem_ctx, struct hive_key *k,
struct ldb_context *c = kd->ldb;
struct ldb_result *res;
int ret;
- char *query = talloc_asprintf(mem_ctx, "(value=%s)", name);
+ char *query;
- ret = ldb_search(c, mem_ctx, &res, kd->dn, LDB_SCOPE_ONELEVEL, NULL, "%s", query);
+ if (strlen(name) == 0) {
+ /* default value */
+ return ldb_get_default_value(mem_ctx, k, NULL, data_type, data);
+ } else {
+ /* normal value */
+ query = talloc_asprintf(mem_ctx, "(value=%s)", name);
+ ret = ldb_search(c, mem_ctx, &res, kd->dn, LDB_SCOPE_ONELEVEL, NULL, "%s", query);
+ talloc_free(query);
+
+ if (ret != LDB_SUCCESS) {
+ DEBUG(0, ("Error getting values for '%s': %s\n",
+ ldb_dn_get_linearized(kd->dn), ldb_errstring(c)));
+ return WERR_FOOBAR;
+ }
- talloc_free(query);
+ if (res->count == 0)
+ return WERR_BADFILE;
- if (ret != LDB_SUCCESS) {
- DEBUG(0, ("Error getting values for '%s': %s\n",
- ldb_dn_get_linearized(kd->dn), ldb_errstring(c)));
- talloc_free(res);
- return WERR_FOOBAR;
- }
+ reg_ldb_unpack_value(mem_ctx, lp_iconv_convenience(global_loadparm),
+ res->msgs[0], NULL, data_type, data);
- if (res->count == 0) {
talloc_free(res);
- return WERR_BADFILE;
}
- reg_ldb_unpack_value(mem_ctx, lp_iconv_convenience(global_loadparm), res->msgs[0], NULL, data_type, data);
-
- talloc_free(res);
return WERR_OK;
}
@@ -353,8 +426,6 @@ static WERROR ldb_open_key(TALLOC_CTX *mem_ctx, const struct hive_key *h,
*key = (struct hive_key *)newkd;
- talloc_free(res);
-
return WERR_OK;
}
@@ -451,25 +522,47 @@ static WERROR ldb_del_value (struct hive_key *key, const char *child)
{
int ret;
struct ldb_key_data *kd = talloc_get_type(key, struct ldb_key_data);
+ TALLOC_CTX *mem_ctx;
+ struct ldb_message *msg;
struct ldb_dn *childdn;
- childdn = ldb_dn_copy(kd->ldb, kd->dn);
- if (!ldb_dn_add_child_fmt(childdn, "value=%s",
+ if (strlen(child) == 0) {
+ /* default value */
+ mem_ctx = talloc_init("ldb_del_value");
+
+ msg = talloc_zero(mem_ctx, struct ldb_message);
+ msg->dn = ldb_dn_copy(msg, kd->dn);
+ ldb_msg_add_empty(msg, "data", LDB_FLAG_MOD_DELETE, NULL);
+ ldb_msg_add_empty(msg, "type", LDB_FLAG_MOD_DELETE, NULL);
+
+ ret = ldb_modify(kd->ldb, msg);
+ if (ret != LDB_SUCCESS) {
+ DEBUG(1, ("ldb_del_value: %s\n", ldb_errstring(kd->ldb)));
+ talloc_free(mem_ctx);
+ return WERR_FOOBAR;
+ }
+
+ talloc_free(mem_ctx);
+ } else {
+ /* normal value */
+ childdn = ldb_dn_copy(kd->ldb, kd->dn);
+ if (!ldb_dn_add_child_fmt(childdn, "value=%s",
reg_ldb_escape(childdn, child)))
- {
- talloc_free(childdn);
- return WERR_FOOBAR;
- }
+ {
+ talloc_free(childdn);
+ return WERR_FOOBAR;
+ }
- ret = ldb_delete(kd->ldb, childdn);
+ ret = ldb_delete(kd->ldb, childdn);
- talloc_free(childdn);
+ talloc_free(childdn);
- if (ret == LDB_ERR_NO_SUCH_OBJECT) {
- return WERR_BADFILE;
- } else if (ret != LDB_SUCCESS) {
- DEBUG(1, ("ldb_del_value: %s\n", ldb_errstring(kd->ldb)));
- return WERR_FOOBAR;
+ if (ret == LDB_ERR_NO_SUCH_OBJECT) {
+ return WERR_BADFILE;
+ } else if (ret != LDB_SUCCESS) {
+ DEBUG(1, ("ldb_del_value: %s\n", ldb_errstring(kd->ldb)));
+ return WERR_FOOBAR;
+ }
}
/* reset cache */
@@ -605,26 +698,31 @@ static WERROR ldb_set_value(struct hive_key *parent,
TALLOC_CTX *mem_ctx = talloc_init("ldb_set_value");
msg = reg_ldb_pack_value(kd->ldb, mem_ctx, name, type, data);
-
msg->dn = ldb_dn_copy(msg, kd->dn);
- if (!ldb_dn_add_child_fmt(msg->dn, "value=%s",
+
+ if (strlen(name) > 0) {
+ /* For a default value, we add/overwrite the attributes to/of the hive.
+ For a normal value, we create new childs. */
+ if (!ldb_dn_add_child_fmt(msg->dn, "value=%s",
reg_ldb_escape(mem_ctx, name)))
- {
- talloc_free(mem_ctx);
- return WERR_FOOBAR;
+ {
+ talloc_free(mem_ctx);
+ return WERR_FOOBAR;
+ }
}
ret = ldb_add(kd->ldb, msg);
if (ret == LDB_ERR_ENTRY_ALREADY_EXISTS) {
int i;
for (i = 0; i < msg->num_elements; i++) {
- msg->elements[i].flags = LDB_FLAG_MOD_REPLACE;
+ if (msg->elements[i].flags != LDB_FLAG_MOD_DELETE)
+ msg->elements[i].flags = LDB_FLAG_MOD_REPLACE;
}
ret = ldb_modify(kd->ldb, msg);
}
if (ret != LDB_SUCCESS) {
- DEBUG(1, ("ldb_msg_add: %s\n", ldb_errstring(kd->ldb)));
+ DEBUG(1, ("ldb_set_value: %s\n", ldb_errstring(kd->ldb)));
talloc_free(mem_ctx);
return WERR_FOOBAR;
}
@@ -649,6 +747,22 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx,
{
struct ldb_key_data *kd = talloc_get_type(key, struct ldb_key_data);
+ /* Initialization */
+ if (classname != NULL)
+ *classname = NULL;
+ if (num_subkeys != NULL)
+ *num_subkeys = 0;
+ if (num_values != NULL)
+ *num_values = 0;
+ if (last_change_time != NULL)
+ *last_change_time = 0;
+ if (max_subkeynamelen != NULL)
+ *max_subkeynamelen = 0;
+ if (max_valnamelen != NULL)
+ *max_valnamelen = 0;
+ if (max_valbufsize != NULL)
+ *max_valbufsize = 0;
+
if (kd->subkeys == NULL) {
W_ERROR_NOT_OK_RETURN(cache_subkeys(kd));
}
@@ -657,20 +771,13 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx,
W_ERROR_NOT_OK_RETURN(cache_values(kd));
}
- /* FIXME */
- if (classname != NULL)
- *classname = NULL;
-
if (num_subkeys != NULL) {
*num_subkeys = kd->subkey_count;
}
-
if (num_values != NULL) {
*num_values = kd->value_count;
}
- if (last_change_time != NULL)
- *last_change_time = 0;
if (max_subkeynamelen != NULL) {
int i;
@@ -702,11 +809,12 @@ static WERROR ldb_get_key_info(TALLOC_CTX *mem_ctx,
}
if (max_valbufsize != NULL) {
+ uint32_t data_type;
DATA_BLOB data;
reg_ldb_unpack_value(mem_ctx,
lp_iconv_convenience(global_loadparm),
kd->values[i], NULL,
- NULL, &data);
+ &data_type, &data);
*max_valbufsize = MAX(*max_valbufsize, data.length);
talloc_free(data.data);
}
diff --git a/source4/lib/registry/registry.h b/source4/lib/registry/registry.h
index fe2091dde8..e89d6fd55c 100644
--- a/source4/lib/registry/registry.h
+++ b/source4/lib/registry/registry.h
@@ -508,6 +508,18 @@ WERROR reg_diff_load(const char *filename,
const struct reg_diff_callbacks *callbacks,
void *callback_data);
+WERROR reg_dotreg_diff_load(int fd,
+ struct smb_iconv_convenience *iconv_convenience,
+ const struct reg_diff_callbacks *callbacks,
+ void *callback_data);
+
+WERROR reg_preg_diff_load(int fd,
+ struct smb_iconv_convenience *iconv_convenience,
+ const struct reg_diff_callbacks *callbacks,
+ void *callback_data);
+
+WERROR local_get_predefined_key(struct registry_context *ctx,
+ uint32_t key_id, struct registry_key **key);
#endif /* _REGISTRY_H */
diff --git a/source4/lib/registry/rpc.c b/source4/lib/registry/rpc.c
index bcf5c8dad4..3a16ae1db5 100644
--- a/source4/lib/registry/rpc.c
+++ b/source4/lib/registry/rpc.c
@@ -32,7 +32,7 @@ struct rpc_key {
const char* classname;
uint32_t num_subkeys;
uint32_t max_subkeylen;
- uint32_t max_subkeysize;
+ uint32_t max_classlen;
uint32_t num_values;
uint32_t max_valnamelen;
uint32_t max_valbufsize;
@@ -380,7 +380,7 @@ static WERROR rpc_query_key(TALLOC_CTX *mem_ctx, const struct registry_key *k)
r.out.classname = &classname;
r.out.num_subkeys = &mykeydata->num_subkeys;
r.out.max_subkeylen = &mykeydata->max_subkeylen;
- r.out.max_subkeysize = &mykeydata->max_subkeysize;
+ r.out.max_classlen = &mykeydata->max_classlen;
r.out.num_values = &mykeydata->num_values;
r.out.max_valnamelen = &mykeydata->max_valnamelen;
r.out.max_valbufsize = &mykeydata->max_valbufsize;
diff --git a/source4/lib/samba3/smbpasswd.c b/source4/lib/samba3/smbpasswd.c
index 47c826f9df..502f13febc 100644
--- a/source4/lib/samba3/smbpasswd.c
+++ b/source4/lib/samba3/smbpasswd.c
@@ -89,9 +89,6 @@ struct samr_Password *smbpasswd_gethexpwd(TALLOC_CTX *mem_ctx, const char *p)
}
/*! Convert a 16-byte array into 32 hex characters. */
- struct samr_Password *lm_hash_p = NULL;
- struct samr_Password *nt_hash_p = NULL;
-
char *smbpasswd_sethexpwd(TALLOC_CTX *mem_ctx, struct samr_Password *pwd, uint16_t acb_info)
{
char *p;
diff --git a/source4/lib/smbreadline/smbreadline.c b/source4/lib/smbreadline/smbreadline.c
index 314fe13471..5fb3bf4fae 100644
--- a/source4/lib/smbreadline/smbreadline.c
+++ b/source4/lib/smbreadline/smbreadline.c
@@ -29,7 +29,7 @@
This is what sys_select() used to do in Samba.
********************************************************************/
-int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *tval)
+static int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *tval)
{
int ret;
fd_set *readfds2, readfds_buf, *writefds2, writefds_buf, *errorfds2, errorfds_buf;
diff --git a/source4/lib/tls/tls.c b/source4/lib/tls/tls.c
index 046c2b9036..f72aafe542 100644
--- a/source4/lib/tls/tls.c
+++ b/source4/lib/tls/tls.c
@@ -363,7 +363,6 @@ struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx, struct loadparm_context *
const char *crlfile = private_path(tmp_ctx, lp_ctx, lp_tls_crlfile(lp_ctx));
const char *dhpfile = private_path(tmp_ctx, lp_ctx, lp_tls_dhpfile(lp_ctx));
void tls_cert_generate(TALLOC_CTX *, const char *, const char *, const char *);
-
params = talloc(mem_ctx, struct tls_params);
if (params == NULL) {
talloc_free(tmp_ctx);
diff --git a/source4/lib/tls/tlscert.c b/source4/lib/tls/tlscert.c
index 240ae056c1..f2e79f2a89 100644
--- a/source4/lib/tls/tlscert.c
+++ b/source4/lib/tls/tlscert.c
@@ -31,6 +31,10 @@
#define LIFETIME 700*24*60*60
#define DH_BITS 1024
+void tls_cert_generate(TALLOC_CTX *mem_ctx,
+ const char *keyfile, const char *certfile,
+ const char *cafile);
+
/*
auto-generate a set of self signed certificates
*/
diff --git a/source4/lib/torture/torture.c b/source4/lib/torture/torture.c
index 166bb7eb84..ba7168f3fe 100644
--- a/source4/lib/torture/torture.c
+++ b/source4/lib/torture/torture.c
@@ -235,19 +235,6 @@ void torture_ui_test_start(struct torture_context *context,
context->ui_ops->test_start(context, tcase, test);
}
-int str_list_match(const char *name, char **list)
-{
- int i, ret = 0;
- if (list == NULL)
- return 0;
-
- for (i = 0; list[i]; i++) {
- if (gen_fnmatch(list[i], name) == 0)
- ret++;
- }
- return ret;
-}
-
void torture_ui_test_result(struct torture_context *context,
enum torture_result result,
const char *comment)