diff options
author | Jeremy Allison <jra@samba.org> | 2002-11-12 23:20:50 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-11-12 23:20:50 +0000 |
commit | 2f194322d419350f35a48dff750066894d68eccf (patch) | |
tree | b0501eaf874ca8e740a51a8e0f29d261e32e0093 /source3/auth | |
parent | f2b669b37fecda2687860eba4a15801dc89855dc (diff) | |
download | samba-2f194322d419350f35a48dff750066894d68eccf.tar.gz samba-2f194322d419350f35a48dff750066894d68eccf.tar.bz2 samba-2f194322d419350f35a48dff750066894d68eccf.zip |
Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
(This used to be commit f755711df8f74f9b8e8c1a2b0d07d02a931eeb89)
Diffstat (limited to 'source3/auth')
-rw-r--r-- | source3/auth/auth.c | 2 | ||||
-rw-r--r-- | source3/auth/auth_domain.c | 15 | ||||
-rw-r--r-- | source3/auth/auth_sam.c | 4 | ||||
-rw-r--r-- | source3/auth/auth_server.c | 10 | ||||
-rw-r--r-- | source3/auth/auth_util.c | 1 |
5 files changed, 15 insertions, 17 deletions
diff --git a/source3/auth/auth.c b/source3/auth/auth.c index d43afc71e1..232d401a24 100644 --- a/source3/auth/auth.c +++ b/source3/auth/auth.c @@ -137,7 +137,7 @@ static BOOL check_domain_match(const char *user, const char *domain) if (!lp_allow_trusted_domains() && !(strequal("", domain) || strequal(lp_workgroup(), domain) || - is_netbios_alias_or_name(domain))) { + is_myname(domain))) { DEBUG(1, ("check_domain_match: Attempt to connect as user %s from domain %s denied.\n", user, domain)); return False; } else { diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c index 9d4824fbc7..2a6614e28e 100644 --- a/source3/auth/auth_domain.c +++ b/source3/auth/auth_domain.c @@ -26,7 +26,6 @@ BOOL global_machine_password_needs_changing = False; -extern pstring global_myname; extern userdom_struct current_user_info; @@ -172,7 +171,7 @@ static NTSTATUS connect_to_domain_password_server(struct cli_state **cli, return NT_STATUS_NO_LOGON_SERVERS; /* Attempt connection */ - result = cli_full_connection(cli, global_myname, remote_machine, + result = cli_full_connection(cli, global_myname(), remote_machine, &dest_ip, 0, "IPC$", "IPC", "", "", "",0, retry); if (!NT_STATUS_IS_OK(result)) { @@ -250,7 +249,7 @@ static NTSTATUS attempt_connect_to_dc(struct cli_state **cli, if (is_zero_ip(*ip)) return NT_STATUS_NO_LOGON_SERVERS; - if (!lookup_dc_name(global_myname, domain, ip, dc_name)) + if (!lookup_dc_name(global_myname(), domain, ip, dc_name)) return NT_STATUS_NO_LOGON_SERVERS; for (i = 0; (!NT_STATUS_IS_OK(ret)) && retry && (i < 3); i++) @@ -372,7 +371,7 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx, const char *domain, uchar chal[8], auth_serversupplied_info **server_info, - char *server, char *setup_creds_as, + const char *server, const char *setup_creds_as, uint16 sec_chan, unsigned char trust_passwd[16], time_t last_change_time) @@ -481,7 +480,7 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context, char *password_server; unsigned char trust_passwd[16]; time_t last_change_time; - char *domain = lp_workgroup(); + const char *domain = lp_workgroup(); if (!user_info || !server_info || !auth_context) { DEBUG(1,("check_ntdomain_security: Critical variables not present. Failing.\n")); @@ -494,7 +493,7 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context, * password file. */ - if(is_netbios_alias_or_name(user_info->domain.str)) { + if(is_myname(user_info->domain.str)) { DEBUG(3,("check_ntdomain_security: Requested domain was for this machine.\n")); return NT_STATUS_LOGON_FAILURE; } @@ -528,7 +527,7 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context, nt_status = domain_client_validate(mem_ctx, user_info, domain, (uchar *)auth_context->challenge.data, server_info, - password_server, global_myname, SEC_CHAN_WKSTA, trust_passwd, last_change_time); + password_server, global_myname(), SEC_CHAN_WKSTA, trust_passwd, last_change_time); return nt_status; } @@ -572,7 +571,7 @@ static NTSTATUS check_trustdomain_security(const struct auth_context *auth_conte * password file. */ - if(is_netbios_alias_or_name(user_info->domain.str)) { + if(is_myname(user_info->domain.str)) { DEBUG(3,("check_trustdomain_security: Requested domain was for this machine.\n")); return NT_STATUS_LOGON_FAILURE; } diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c index 7252193c9a..9fa33dccf6 100644 --- a/source3/auth/auth_sam.c +++ b/source3/auth/auth_sam.c @@ -316,7 +316,7 @@ static NTSTATUS sam_account_ok(TALLOC_CTX *mem_ctx, if (*workstation_list) { BOOL invalid_ws = True; - char *s = workstation_list; + const char *s = workstation_list; fstring tok; @@ -454,7 +454,7 @@ static NTSTATUS check_samstrict_security(const struct auth_context *auth_context attempt to check the password locally, unless it is one of our aliases. */ - if (!is_netbios_alias_or_name(user_info->domain.str)) { + if (!is_myname(user_info->domain.str)) { return NT_STATUS_NO_SUCH_USER; } diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c index 0ed905e79c..5144852d3b 100644 --- a/source3/auth/auth_server.c +++ b/source3/auth/auth_server.c @@ -24,7 +24,6 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_AUTH -extern pstring global_myname; extern userdom_struct current_user_info; /**************************************************************************** @@ -36,7 +35,8 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx) struct cli_state *cli = NULL; fstring desthost; struct in_addr dest_ip; - char *p, *pserver; + const char *p; + char *pserver; BOOL connected_ok = False; if (!(cli = cli_initialise(cli))) @@ -85,7 +85,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx) return NULL; } - if (!attempt_netbios_session_request(cli, global_myname, + if (!attempt_netbios_session_request(cli, global_myname(), desthost, &dest_ip)) { release_server_mutex(); DEBUG(1,("password server fails session request\n")); @@ -231,7 +231,7 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context * password file. */ - if(is_netbios_alias_or_name(user_info->domain.str)) { + if(is_myname(user_info->domain.str)) { DEBUG(3,("check_smbserver_security: Requested domain was for this machine.\n")); return NT_STATUS_LOGON_FAILURE; } @@ -275,7 +275,7 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context if(baduser[0] == 0) { fstrcpy(baduser, INVALID_USER_PREFIX); - fstrcat(baduser, global_myname); + fstrcat(baduser, global_myname()); } /* diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index b14344ef50..98b15f3fb6 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -26,7 +26,6 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_AUTH -extern pstring global_myname; extern DOM_SID global_sid_World; extern DOM_SID global_sid_Network; extern DOM_SID global_sid_Builtin_Guests; |