| 1763 | } |
| 1764 | |
| 1765 | static const char *set_bind_password(cmd_parms *cmd, void *_cfg, const char *arg) |
| 1766 | { |
| 1767 | authn_ldap_config_t *sec = _cfg; |
| 1768 | int arglen = strlen(arg); |
| 1769 | char **argv; |
| 1770 | char *result; |
| 1771 | |
| 1772 | if ((arglen > 5) && strncmp(arg, "exec:", 5) == 0) { |
| 1773 | if (apr_tokenize_to_argv(arg+5, &argv, cmd->temp_pool) != APR_SUCCESS) { |
| 1774 | return apr_pstrcat(cmd->pool, |
| 1775 | "Unable to parse exec arguments from ", |
| 1776 | arg+5, NULL); |
| 1777 | } |
| 1778 | argv[0] = ap_server_root_relative(cmd->temp_pool, argv[0]); |
| 1779 | |
| 1780 | if (!argv[0]) { |
| 1781 | return apr_pstrcat(cmd->pool, |
| 1782 | "Invalid AuthLDAPBindPassword exec location:", |
| 1783 | arg+5, NULL); |
| 1784 | } |
| 1785 | result = ap_get_exec_line(cmd->pool, |
| 1786 | (const char*)argv[0], (const char * const *)argv); |
| 1787 | |
| 1788 | if (!result) { |
| 1789 | return apr_pstrcat(cmd->pool, |
| 1790 | "Unable to get bind password from exec of ", |
| 1791 | arg+5, NULL); |
| 1792 | } |
| 1793 | sec->bindpw = result; |
| 1794 | } |
| 1795 | else { |
| 1796 | sec->bindpw = (char *)arg; |
| 1797 | } |
| 1798 | |
| 1799 | if (!(*sec->bindpw)) { |
| 1800 | return "Empty passwords are invalid for AuthLDAPBindPassword"; |
| 1801 | } |
| 1802 | |
| 1803 | return NULL; |
| 1804 | } |
| 1805 | |
| 1806 | static const command_rec authnz_ldap_cmds[] = |
| 1807 | { |
nothing calls this directly
no test coverage detected