From: Doug MacEachern Date: Thu, 10 Jan 2002 00:09:04 +0000 (+0000) Subject: get SSLRandomSeed exec: working by passing the proper arguments to apr_proc_create() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=958cfc976ce95109468db894f2cc715209bf0478;p=thirdparty%2Fapache%2Fhttpd.git get SSLRandomSeed exec: working by passing the proper arguments to apr_proc_create() git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/ssl@92789 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/ssl_engine_rand.c b/ssl_engine_rand.c index 0aa74dbe3bb..0655ce1f077 100644 --- a/ssl_engine_rand.c +++ b/ssl_engine_rand.c @@ -102,11 +102,16 @@ int ssl_rand_seed(server_rec *s, apr_pool_t *p, ssl_rsctx_t nCtx, char *prefix) apr_file_close(fp); } else if (pRandSeed->nSrc == SSL_RSSRC_EXEC) { + const char *cmd = pRandSeed->cpPath; + const char **argv = apr_palloc(p, sizeof(char *) * 3); /* * seed in contents generated by an external program */ - if ((fp = ssl_util_ppopen(s, p, apr_psprintf(p, "%s %d", - pRandSeed->cpPath, pRandSeed->nBytes))) == NULL) + argv[0] = cmd; + argv[1] = apr_itoa(p, pRandSeed->nBytes); + argv[2] = NULL; + + if ((fp = ssl_util_ppopen(s, p, cmd, argv)) == NULL) continue; nDone += ssl_rand_feedfp(p, fp, pRandSeed->nBytes); ssl_util_ppclose(s, p, fp);