* Return true if the password_required is defined and false for this user * mapping, otherwise false. The mapping has been pre-validated. */
| 470 | * mapping, otherwise false. The mapping has been pre-validated. |
| 471 | */ |
| 472 | static bool |
| 473 | UserMappingPasswordRequired(UserMapping *user) |
| 474 | { |
| 475 | ListCell *cell; |
| 476 | |
| 477 | foreach(cell, user->options) |
| 478 | { |
| 479 | DefElem *def = (DefElem *) lfirst(cell); |
| 480 | |
| 481 | if (strcmp(def->defname, "password_required") == 0) |
| 482 | return defGetBoolean(def); |
| 483 | } |
| 484 | |
| 485 | return true; |
| 486 | } |
| 487 | |
| 488 | /* |
| 489 | * For non-superusers, insist that the connstr specify a password. This |
no test coverage detected