summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-09-24 15:44:28 -0700
committerJeremy Allison <jra@samba.org>2009-09-24 15:44:28 -0700
commit536c4dd2d69f9a35547c0ce77b47c4f0b03aa5ac (patch)
tree97c6fdb2c4ecb7bee1b77accd6411fc679c1b046
parent4f10aa59730b44fc4328daca3e2e43693fc1b69f (diff)
downloadsamba-536c4dd2d69f9a35547c0ce77b47c4f0b03aa5ac.tar.gz
samba-536c4dd2d69f9a35547c0ce77b47c4f0b03aa5ac.tar.bz2
samba-536c4dd2d69f9a35547c0ce77b47c4f0b03aa5ac.zip
Revert b39c390280d1f268e2550c731057aec550a3f086 - casts should not
be here. Jeremy.
-rw-r--r--source3/auth/auth.c18
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/param/loadparm.c6
-rw-r--r--source3/smbd/map_username.c2
-rw-r--r--source3/smbd/password.c24
5 files changed, 26 insertions, 26 deletions
diff --git a/source3/auth/auth.c b/source3/auth/auth.c
index b445987ee2..ce8722a1b4 100644
--- a/source3/auth/auth.c
+++ b/source3/auth/auth.c
@@ -455,7 +455,7 @@ NTSTATUS make_auth_context_subsystem(struct auth_context **auth_context)
NTSTATUS nt_status;
if (lp_auth_methods()
- && !(auth_method_list = (char **) str_list_copy(talloc_tos(),
+ && !(auth_method_list = str_list_copy(talloc_tos(),
lp_auth_methods()))) {
return NT_STATUS_NO_MEMORY;
}
@@ -465,13 +465,13 @@ NTSTATUS make_auth_context_subsystem(struct auth_context **auth_context)
{
case SEC_DOMAIN:
DEBUG(5,("Making default auth method list for security=domain\n"));
- auth_method_list = (char **) str_list_make_v3(
+ auth_method_list = str_list_make_v3(
talloc_tos(), "guest sam winbind:ntdomain",
NULL);
break;
case SEC_SERVER:
DEBUG(5,("Making default auth method list for security=server\n"));
- auth_method_list = (char **) str_list_make_v3(
+ auth_method_list = str_list_make_v3(
talloc_tos(), "guest sam smbserver",
NULL);
break;
@@ -479,36 +479,36 @@ NTSTATUS make_auth_context_subsystem(struct auth_context **auth_context)
if (lp_encrypted_passwords()) {
if ((lp_server_role() == ROLE_DOMAIN_PDC) || (lp_server_role() == ROLE_DOMAIN_BDC)) {
DEBUG(5,("Making default auth method list for DC, security=user, encrypt passwords = yes\n"));
- auth_method_list = (char **) str_list_make_v3(
+ auth_method_list = str_list_make_v3(
talloc_tos(),
"guest sam winbind:trustdomain",
NULL);
} else {
DEBUG(5,("Making default auth method list for standalone security=user, encrypt passwords = yes\n"));
- auth_method_list = (char **) str_list_make_v3(
+ auth_method_list = str_list_make_v3(
talloc_tos(), "guest sam",
NULL);
}
} else {
DEBUG(5,("Making default auth method list for security=user, encrypt passwords = no\n"));
- auth_method_list = (char **) str_list_make_v3(
+ auth_method_list = str_list_make_v3(
talloc_tos(), "guest unix", NULL);
}
break;
case SEC_SHARE:
if (lp_encrypted_passwords()) {
DEBUG(5,("Making default auth method list for security=share, encrypt passwords = yes\n"));
- auth_method_list = (char **) str_list_make_v3(
+ auth_method_list = str_list_make_v3(
talloc_tos(), "guest sam", NULL);
} else {
DEBUG(5,("Making default auth method list for security=share, encrypt passwords = no\n"));
- auth_method_list = (char **) str_list_make_v3(
+ auth_method_list = str_list_make_v3(
talloc_tos(), "guest unix", NULL);
}
break;
case SEC_ADS:
DEBUG(5,("Making default auth method list for security=ADS\n"));
- auth_method_list = (char **) str_list_make_v3(
+ auth_method_list = str_list_make_v3(
talloc_tos(), "guest sam winbind:ntdomain",
NULL);
break;
diff --git a/source3/include/proto.h b/source3/include/proto.h
index e17486b7fc..d664a26949 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1563,7 +1563,7 @@ bool validate_net_name( const char *name,
const char *invalid_chars,
int max_len);
char *escape_shell_string(const char *src);
-const char **str_list_make_v3(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
+char **str_list_make_v3(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
/* The following definitions come from lib/util_unistr.c */
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index c93787e638..b278b9616d 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -6745,7 +6745,7 @@ static void copy_service(struct service *pserviceDest, struct service *pserviceS
break;
case P_LIST:
TALLOC_FREE(*((char ***)dest_ptr));
- *((const char ***)dest_ptr) = str_list_copy(NULL,
+ *((char ***)dest_ptr) = str_list_copy(NULL,
*(const char ***)src_ptr);
break;
default:
@@ -8218,8 +8218,8 @@ static void lp_save_defaults(void)
continue;
switch (parm_table[i].type) {
case P_LIST:
- parm_table[i].def.lvalue = (char **)
- str_list_copy(NULL, *(const char ***)parm_table[i].ptr);
+ parm_table[i].def.lvalue = str_list_copy(
+ NULL, *(const char ***)parm_table[i].ptr);
break;
case P_STRING:
case P_USTRING:
diff --git a/source3/smbd/map_username.c b/source3/smbd/map_username.c
index e9ef74cf25..24b4ddd271 100644
--- a/source3/smbd/map_username.c
+++ b/source3/smbd/map_username.c
@@ -146,7 +146,7 @@ bool map_username(struct smbd_server_connection *sconn, fstring user)
while((s=fgets_slash(buf,sizeof(buf),f))!=NULL) {
char *unixname = s;
char *dosname = strchr_m(unixname,'=');
- const char **dosuserlist;
+ char **dosuserlist;
bool return_if_mapped = False;
if (!dosname)
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index d6a84470e1..4c1cef45cc 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -551,13 +551,14 @@ bool user_in_list(struct smbd_server_connection *sconn,
static bool user_ok(struct smbd_server_connection *sconn,
const char *user, int snum)
{
+ char **valid, **invalid;
bool ret;
+ valid = invalid = NULL;
ret = True;
if (lp_invalid_users(snum)) {
- char **invalid = (char **) str_list_copy(talloc_tos(),
- lp_invalid_users(snum));
+ invalid = str_list_copy(talloc_tos(), lp_invalid_users(snum));
if (invalid &&
str_list_substitute(invalid, "%S", lp_servicename(snum))) {
@@ -566,37 +567,36 @@ static bool user_ok(struct smbd_server_connection *sconn,
if ( invalid && str_list_sub_basic(invalid, "", "") ) {
ret = !user_in_list(sconn, user,
- (const char **)invalid);
+ (const char **)invalid);
}
}
- TALLOC_FREE(invalid);
}
+ TALLOC_FREE(invalid);
if (ret && lp_valid_users(snum)) {
- char **valid = (char **) str_list_copy(talloc_tos(),
- lp_valid_users(snum));
- if (valid &&
- str_list_substitute(valid, "%S", lp_servicename(snum))) {
+ valid = str_list_copy(talloc_tos(), lp_valid_users(snum));
+ if ( valid &&
+ str_list_substitute(valid, "%S", lp_servicename(snum)) ) {
/* This is used in sec=share only, so no current user
* around to pass to str_list_sub_basic() */
if ( valid && str_list_sub_basic(valid, "", "") ) {
ret = user_in_list(sconn, user,
- (const char **)valid);
+ (const char **)valid);
}
}
- TALLOC_FREE(valid);
}
+ TALLOC_FREE(valid);
if (ret && lp_onlyuser(snum)) {
- char **user_list = (char **) str_list_make_v3(
+ char **user_list = str_list_make_v3(
talloc_tos(), lp_username(snum), NULL);
if (user_list &&
str_list_substitute(user_list, "%S",
lp_servicename(snum))) {
ret = user_in_list(sconn, user,
- (const char **)user_list);
+ (const char **)user_list);
}
TALLOC_FREE(user_list);
}