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

Function ssl_util_path_check

modules/ssl/ssl_util.c:175–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175BOOL ssl_util_path_check(ssl_pathcheck_t pcm, const char *path, apr_pool_t *p)
176{
177 apr_finfo_t finfo;
178
179 if (path == NULL)
180 return FALSE;
181 if (pcm & SSL_PCM_EXISTS && apr_stat(&finfo, path,
182 APR_FINFO_TYPE|APR_FINFO_SIZE, p) != 0)
183 return FALSE;
184 AP_DEBUG_ASSERT((pcm & SSL_PCM_EXISTS) ||
185 !(pcm & (SSL_PCM_ISREG|SSL_PCM_ISDIR|SSL_PCM_ISNONZERO)));
186 if (pcm & SSL_PCM_ISREG && finfo.filetype != APR_REG)
187 return FALSE;
188 if (pcm & SSL_PCM_ISDIR && finfo.filetype != APR_DIR)
189 return FALSE;
190 if (pcm & SSL_PCM_ISNONZERO && finfo.size <= 0)
191 return FALSE;
192 return TRUE;
193}
194
195/* Decrypted private keys are cached to survive restarts. The cached
196 * data must have lifetime of the process (hence malloc/free rather

Callers 4

ssl_cmd_SSLRandomSeedFunction · 0.85
ssl_cmd_check_fileFunction · 0.85
ssl_cmd_check_dirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected