mirror of
				https://github.com/samba-team/samba.git
				synced 2025-10-31 12:23:52 +03:00 
			
		
		
		
	r8700: Propmted by tridge's need to do plaintext auth in ejs, rework the
user_info strcture in auth/ This moves it to a pattern much like that found in ntvfs, with functions to migrate between PAIN, HASH and RESPONSE passwords. Instead of make_user_info*() functions, we simply fill in the control block in the callers, per recent dicussions on the lists. This removed a lot of data copies as well as error paths, as we can grab much of it with talloc. Andrew Bartlett
This commit is contained in:
		
				
					committed by
					
						 Gerald (Jerry) Carter
						Gerald (Jerry) Carter
					
				
			
			
				
	
			
			
			
						parent
						
							f5910ceef5
						
					
				
				
					commit
					ecbd2235a3
				
			| @@ -47,16 +47,31 @@ static int ejs_doauth(TALLOC_CTX *tmp_ctx, struct MprVar *auth, const char *user | ||||
| 		goto done; | ||||
| 	} | ||||
|  | ||||
| 	pw_blob = data_blob(password, strlen(password)+1), | ||||
| 	make_user_info(tmp_ctx, username, username, | ||||
| 				domain, domain, | ||||
| 				remote_host, remote_host, | ||||
| 				NULL, NULL, | ||||
| 				NULL, NULL, | ||||
| 				&pw_blob, False, | ||||
| 				USER_INFO_CASE_INSENSITIVE_USERNAME | | ||||
| 				USER_INFO_DONT_CHECK_UNIX_ACCOUNT, | ||||
| 				&user_info); | ||||
| 	pw_blob = data_blob(password, strlen(password)+1); | ||||
| 	 | ||||
| 	user_info = talloc(tmp_ctx, struct auth_usersupplied_info); | ||||
| 	if (!user_info) { | ||||
| 		mprSetPropertyValue(auth, "result", mprCreateBoolVar(False)); | ||||
| 		mprSetPropertyValue(auth, "report", mprString("talloc failed")); | ||||
| 		goto done; | ||||
| 	} | ||||
|  | ||||
| 	user_info->mapped_state = True; | ||||
| 	user_info->client.account_name = username; | ||||
| 	user_info->mapped.account_name = username; | ||||
| 	user_info->client.domain_name = domain; | ||||
| 	user_info->mapped.domain_name = domain; | ||||
|  | ||||
| 	user_info->workstation_name = remote_host; | ||||
|  | ||||
| 	user_info->remote_host = remote_host; | ||||
|  | ||||
| 	user_info->password_state = AUTH_PASSWORD_PLAIN; | ||||
| 	user_info->password.plaintext = talloc_strdup(user_info, password); | ||||
|  | ||||
| 	user_info->flags = USER_INFO_CASE_INSENSITIVE_USERNAME | | ||||
| 		USER_INFO_DONT_CHECK_UNIX_ACCOUNT; | ||||
|  | ||||
| 	nt_status = auth_check_password(auth_context, tmp_ctx, user_info, &server_info); | ||||
| 	if (!NT_STATUS_IS_OK(nt_status)) { | ||||
| 		mprSetPropertyValue(auth, "result", mprCreateBoolVar(False)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user