MCPcopy Create free account
hub / github.com/apache/httpd / set_bind_password

Function set_bind_password

modules/aaa/mod_authnz_ldap.c:1765–1804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1763}
1764
1765static 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
1806static const command_rec authnz_ldap_cmds[] =
1807{

Callers

nothing calls this directly

Calls 2

ap_server_root_relativeFunction · 0.85
ap_get_exec_lineFunction · 0.85

Tested by

no test coverage detected