diff options
author | Daniel Ruggeri <druggeri@apache.org> | 2013-09-17 14:53:21 +0000 |
---|---|---|
committer | Daniel Ruggeri <druggeri@apache.org> | 2013-09-17 14:53:21 +0000 |
commit | 90f9939cee61b46a74e9827ad68ddbf13fe6a704 (patch) | |
tree | f1a2d1f7af8b9a03833b289b8ac1a71f6246c182 /modules/session | |
parent | 619866c1982df4c04d41e269ecb62e5e137d893c (diff) | |
download | httpd-90f9939cee61b46a74e9827ad68ddbf13fe6a704.tar.gz |
Add exec: callout support for mod_session_crypto
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1524079 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/session')
-rw-r--r-- | modules/session/mod_session_crypto.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/modules/session/mod_session_crypto.c b/modules/session/mod_session_crypto.c index 03dbba61d6..984a048762 100644 --- a/modules/session/mod_session_crypto.c +++ b/modules/session/mod_session_crypto.c @@ -534,11 +534,41 @@ static const char *set_crypto_driver(cmd_parms * cmd, void *config, const char * static const char *set_crypto_passphrase(cmd_parms * cmd, void *config, const char *arg) { + int arglen = strlen(arg); + char **argv; + char *result; const char **passphrase; session_crypto_dir_conf *dconf = (session_crypto_dir_conf *) config; passphrase = apr_array_push(dconf->passphrases); - *passphrase = arg; + + if ((arglen > 5) && strncmp(arg, "exec:", 5) == 0) { + if (apr_tokenize_to_argv(arg+5, &argv, cmd->temp_pool) != APR_SUCCESS) { + return apr_pstrcat(cmd->pool, + "Unable to parse exec arguments from ", + arg+5, NULL); + } + argv[0] = ap_server_root_relative(cmd->temp_pool, argv[0]); + + if (!argv[0]) { + return apr_pstrcat(cmd->pool, + "Invalid SessionCryptoPassphrase exec location:", + arg+5, NULL); + } + result = ap_get_exec_line(cmd->pool, + (const char*)argv[0], (const char * const *)argv); + + if(!result) { + return apr_pstrcat(cmd->pool, + "Unable to get bind password from exec of ", + arg+5, NULL); + } + *passphrase = result; + } + else { + *passphrase = arg; + } + dconf->passphrases_set = 1; return NULL; |