This repository was archived by the owner on Mar 1, 2026. It is now read-only.
Commit b941c5e
committed
Bug#34679835 authentication_ldap_sasl_client infinite loop on error
When authentication via sasl fails (the user can't be found in a
kerberos server), the sasl_authenticate() function enters an infinite
loop.
Enabling debugging via AUTHENTICATION_LDAP_CLIENT_LOG=5 shows that
[DBG] : Sasl_client::SaslStart sasl output: ...
[DBG] : Sasl_client::SendSaslRequestToServer length:570 request: ...
[Error] : Sasl_client::SendSaslRequestToServer: sasl response read
failed
but that "read failed" doesn't abort the loop.
Instead, the same message is sent again and now the write fails:
[DBG] : Sasl_client::SaslStart sasl output: ...
[DBG] : Sasl_client::SendSaslRequestToServer length:570 request: ...
[Error] : Sasl_client::SendSaslRequestToServer: sasl response write
failed
It loops in sasl_authenticate() as the function checks for 'rc_auth < 0',
if it shall leave the loop, but send_sasl_to_server returns 0 for
success and 1 for error.
Change
------
- leave the loop if 1 (error) is returned, instead of "rc_auth < 0"
- added doc-comments
Change-Id: I74ed37ea916ff8bea92cddd59638551080a077b11 parent c4eeb59 commit b941c5e
1 file changed
Lines changed: 35 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
232 | 250 | | |
233 | 251 | | |
234 | 252 | | |
235 | 253 | | |
236 | | - | |
| 254 | + | |
237 | 255 | | |
238 | 256 | | |
239 | 257 | | |
| |||
364 | 382 | | |
365 | 383 | | |
366 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
367 | 395 | | |
368 | 396 | | |
369 | 397 | | |
| |||
424 | 452 | | |
425 | 453 | | |
426 | 454 | | |
427 | | - | |
| 455 | + | |
428 | 456 | | |
429 | 457 | | |
430 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
431 | 461 | | |
432 | 462 | | |
433 | 463 | | |
| |||
442 | 472 | | |
443 | 473 | | |
444 | 474 | | |
| 475 | + | |
445 | 476 | | |
446 | 477 | | |
447 | 478 | | |
| |||
451 | 482 | | |
452 | 483 | | |
453 | 484 | | |
454 | | - | |
| 485 | + | |
455 | 486 | | |
456 | 487 | | |
457 | 488 | | |
| |||
0 commit comments