First they do not need to be "static" any longer since we have abandoned
asynchronous result handling (where global variables have been important).
In addition add some "const" in order to protect us from unwanted writes.
Reviewed-by: Andrew Bartlett
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Mon Apr 30 16:46:20 CEST 2012 on sn-devel-104
const char *name;
int ret;
struct ldb_result *res;
const char *name;
int ret;
struct ldb_result *res;
- const char *noattrs[] = { NULL };
+ const char * const noattrs[] = { NULL };
if (ldb_msg_find_element(ac->msg, "sAMAccountName") == NULL) {
ret = samldb_generate_sAMAccountName(ldb, ac->msg);
if (ldb_msg_find_element(ac->msg, "sAMAccountName") == NULL) {
ret = samldb_generate_sAMAccountName(ldb, ac->msg);
{
TALLOC_CTX *tmp_ctx = talloc_new(ac);
struct ldb_result *res;
{
TALLOC_CTX *tmp_ctx = talloc_new(ac);
struct ldb_result *res;
- const char *no_attrs[] = { NULL };
+ const char * const no_attrs[] = { NULL };
int ret;
ret = dsdb_module_search(ac->module, tmp_ctx, &res,
int ret;
ret = dsdb_module_search(ac->module, tmp_ctx, &res,
{
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
struct ldb_result *res;
{
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
struct ldb_result *res;
- const char *no_attrs[] = { NULL };
+ const char * const no_attrs[] = { NULL };
int ret;
ac->res_dn = NULL;
int ret;
ac->res_dn = NULL;
struct dom_sid *sid;
struct ldb_result *res;
int ret;
struct dom_sid *sid;
struct ldb_result *res;
int ret;
- const char *noattrs[] = { NULL };
+ const char * const noattrs[] = { NULL };
sid = dom_sid_add_rid(ac, samdb_domain_sid(ldb), rid);
if (sid == NULL) {
sid = dom_sid_add_rid(ac, samdb_domain_sid(ldb), rid);
if (sid == NULL) {
static int samldb_prim_group_change(struct samldb_ctx *ac)
{
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
static int samldb_prim_group_change(struct samldb_ctx *ac)
{
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
- const char * attrs[] = { "primaryGroupID", "memberOf", NULL };
+ const char * const attrs[] = { "primaryGroupID", "memberOf", NULL };
struct ldb_result *res, *group_res;
struct ldb_message_element *el;
struct ldb_message *msg;
struct ldb_result *res, *group_res;
struct ldb_message_element *el;
struct ldb_message *msg;
struct dom_sid *prev_sid, *new_sid;
struct ldb_dn *prev_prim_group_dn, *new_prim_group_dn;
int ret;
struct dom_sid *prev_sid, *new_sid;
struct ldb_dn *prev_prim_group_dn, *new_prim_group_dn;
int ret;
- const char *noattrs[] = { NULL };
+ const char * const noattrs[] = { NULL };
el = dsdb_get_single_valued_attr(ac->msg, "primaryGroupID",
ac->req->operation);
el = dsdb_get_single_valued_attr(ac->msg, "primaryGroupID",
ac->req->operation);
struct ldb_message *tmp_msg;
int ret;
struct ldb_result *res;
struct ldb_message *tmp_msg;
int ret;
struct ldb_result *res;
- const char *attrs[] = { "userAccountControl", "objectClass", NULL };
+ const char * const attrs[] = { "userAccountControl", "objectClass", NULL };
unsigned int i;
bool is_computer = false;
unsigned int i;
bool is_computer = false;
struct ldb_message *tmp_msg;
int ret;
struct ldb_result *res;
struct ldb_message *tmp_msg;
int ret;
struct ldb_result *res;
- const char *attrs[] = { "groupType", NULL };
+ const char * const attrs[] = { "groupType", NULL };
el = dsdb_get_single_valued_attr(ac->msg, "groupType",
ac->req->operation);
el = dsdb_get_single_valued_attr(ac->msg, "groupType",
ac->req->operation);
static int samldb_sam_accountname_check(struct samldb_ctx *ac)
{
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
static int samldb_sam_accountname_check(struct samldb_ctx *ac)
{
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
- const char *no_attrs[] = { NULL };
+ const char * const no_attrs[] = { NULL };
struct ldb_result *res;
const char *sam_accountname, *enc_str;
struct ldb_message_element *el;
struct ldb_result *res;
const char *sam_accountname, *enc_str;
struct ldb_message_element *el;
static int samldb_member_check(struct samldb_ctx *ac)
{
static int samldb_member_check(struct samldb_ctx *ac)
{
- static const char * const attrs[] = { "objectSid", "member", NULL };
+ const char * const attrs[] = { "objectSid", "member", NULL };
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
struct ldb_message_element *el;
struct ldb_dn *member_dn;
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
struct ldb_message_element *el;
struct ldb_dn *member_dn;
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
struct ldb_message_element *el = NULL, *el2 = NULL;
struct ldb_message *msg;
struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
struct ldb_message_element *el = NULL, *el2 = NULL;
struct ldb_message *msg;
- const char *attrs[] = { "servicePrincipalName", NULL };
+ const char * const attrs[] = { "servicePrincipalName", NULL };
struct ldb_result *res;
const char *dns_hostname = NULL, *old_dns_hostname = NULL,
*sam_accountname = NULL, *old_sam_accountname = NULL;
struct ldb_result *res;
const char *dns_hostname = NULL, *old_dns_hostname = NULL,
*sam_accountname = NULL, *old_sam_accountname = NULL;
NTSTATUS status;
int ret;
struct ldb_result *res;
NTSTATUS status;
int ret;
struct ldb_result *res;
- const char *attrs[] = { "objectSid", "isDeleted", NULL };
- const char *noattrs[] = { NULL };
+ const char * const attrs[] = { "objectSid", "isDeleted", NULL };
+ const char * const noattrs[] = { NULL };
ldb = ldb_module_get_ctx(ac->module);
ldb = ldb_module_get_ctx(ac->module);