diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-09-24 23:52:19 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-09-24 23:58:36 +0200 |
commit | b39c390280d1f268e2550c731057aec550a3f086 (patch) | |
tree | 6c996eb3abda195a5bd507849bbc6865ff57a2b6 /source3 | |
parent | 918b5a7e057bd91289ec06b3ef8d95da43a50ede (diff) | |
download | samba-b39c390280d1f268e2550c731057aec550a3f086.tar.gz samba-b39c390280d1f268e2550c731057aec550a3f086.tar.bz2 samba-b39c390280d1f268e2550c731057aec550a3f086.zip |
s3: Fix up various string "const" warnings
My changed introduced some warnings. Fix them.
Diffstat (limited to 'source3')
-rw-r--r-- | source3/auth/auth.c | 18 | ||||
-rw-r--r-- | source3/param/loadparm.c | 6 | ||||
-rw-r--r-- | source3/smbd/map_username.c | 2 | ||||
-rw-r--r-- | source3/smbd/password.c | 24 |
4 files changed, 25 insertions, 25 deletions
diff --git a/source3/auth/auth.c b/source3/auth/auth.c index ce8722a1b4..b445987ee2 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 = str_list_copy(talloc_tos(), + && !(auth_method_list = (char **) 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 = str_list_make_v3( + auth_method_list = (char **) 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 = str_list_make_v3( + auth_method_list = (char **) 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 = str_list_make_v3( + auth_method_list = (char **) 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 = str_list_make_v3( + auth_method_list = (char **) 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 = str_list_make_v3( + auth_method_list = (char **) 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 = str_list_make_v3( + auth_method_list = (char **) 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 = str_list_make_v3( + auth_method_list = (char **) 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 = str_list_make_v3( + auth_method_list = (char **) str_list_make_v3( talloc_tos(), "guest sam winbind:ntdomain", NULL); break; diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index b278b9616d..c93787e638 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)); - *((char ***)dest_ptr) = str_list_copy(NULL, + *((const 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 = str_list_copy( - NULL, *(const char ***)parm_table[i].ptr); + parm_table[i].def.lvalue = (char **) + 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 24b4ddd271..e9ef74cf25 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,'='); - char **dosuserlist; + const char **dosuserlist; bool return_if_mapped = False; if (!dosname) diff --git a/source3/smbd/password.c b/source3/smbd/password.c index 4c1cef45cc..d6a84470e1 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -551,14 +551,13 @@ 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)) { - invalid = str_list_copy(talloc_tos(), lp_invalid_users(snum)); + char **invalid = (char **) str_list_copy(talloc_tos(), + lp_invalid_users(snum)); if (invalid && str_list_substitute(invalid, "%S", lp_servicename(snum))) { @@ -567,36 +566,37 @@ 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)) { - valid = str_list_copy(talloc_tos(), lp_valid_users(snum)); - if ( valid && - str_list_substitute(valid, "%S", lp_servicename(snum)) ) { + char **valid = (char **) 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 = str_list_make_v3( + char **user_list = (char **) 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); } |