kdc: Preserve error code from Pre Authentication .validate hook
This is required to ensure the client still gets errors like KRB5KDC_ERR_PREAUTH_FAILED, rather than KRB5KDC_ERR_PREAUTH_REQUIRED, which become a confusing KRB5_GET_IN_TKT_LOOP. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Garming Sam <garming@catalyst.net.nz>
This commit is contained in:
		 Andrew Bartlett
					Andrew Bartlett
				
			
				
					committed by
					
						 Nicolas Williams
						Nicolas Williams
					
				
			
			
				
	
			
			
			 Nicolas Williams
						Nicolas Williams
					
				
			
						parent
						
							960fa481be
						
					
				
				
					commit
					95256a6129
				
			| @@ -1782,13 +1782,14 @@ _kdc_as_rep(kdc_request_t r, | ||||
| 	    pa = _kdc_find_padata(req, &i, pat[n].type); | ||||
| 	    if (pa) { | ||||
| 		ret = pat[n].validate(r, pa); | ||||
| 		if (ret == 0) { | ||||
| 		    kdc_log(context, config, 0, | ||||
| 			    "%s pre-authentication succeeded -- %s", | ||||
| 			    pat[n].name, r->client_name); | ||||
| 		    found_pa = 1; | ||||
| 		    r->et.flags.pre_authent = 1; | ||||
| 		if (ret != 0) { | ||||
| 		    goto out; | ||||
| 		} | ||||
| 		kdc_log(context, config, 0, | ||||
| 			"%s pre-authentication succeeded -- %s", | ||||
| 			pat[n].name, r->client_name); | ||||
| 		found_pa = 1; | ||||
| 		r->et.flags.pre_authent = 1; | ||||
| 	    } | ||||
| 	} | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user