diff options
author | Stefan Fritsch <sf@sfritsch.de> | 2011-12-27 19:43:04 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@sfritsch.de> | 2011-12-27 19:43:04 +0100 |
commit | 498ea95018b369e62646a98c7d7d5413b56e170c (patch) | |
tree | b7c4798010bbb18d4d2c07f722d7fb0d38efd24c /support | |
parent | e8bb7adda7f73e53cdab823e9cab2a49ccbdf188 (diff) | |
download | apache2-498ea95018b369e62646a98c7d7d5413b56e170c.tar.gz |
Upstream tarball 2.2.17upstream/2.2.17
Diffstat (limited to 'support')
-rw-r--r-- | support/ab.c | 2 | ||||
-rw-r--r-- | support/htdigest.c | 16 | ||||
-rw-r--r-- | support/rotatelogs.c | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/support/ab.c b/support/ab.c index 8a120879..ce8b2099 100644 --- a/support/ab.c +++ b/support/ab.c @@ -1697,7 +1697,9 @@ static void test(void) const apr_pollfd_t *pollresults; n = concurrency; + do { status = apr_pollset_poll(readbits, aprtimeout, &n, &pollresults); + } while (APR_STATUS_IS_EINTR(status)); if (status != APR_SUCCESS) apr_err("apr_poll", status); diff --git a/support/htdigest.c b/support/htdigest.c index 4f99d3eb..6a0e26f1 100644 --- a/support/htdigest.c +++ b/support/htdigest.c @@ -124,7 +124,7 @@ static void add_password(const char *user, const char *realm, apr_file_t *f) char *pw; apr_md5_ctx_t context; unsigned char digest[16]; - char string[MAX_STRING_LEN]; + char string[3 * MAX_STRING_LEN]; /* this includes room for 2 * ':' + '\0' */ char pwin[MAX_STRING_LEN]; char pwv[MAX_STRING_LEN]; unsigned int i; @@ -144,7 +144,7 @@ static void add_password(const char *user, const char *realm, apr_file_t *f) apr_file_printf(f, "%s:%s:", user, realm); /* Do MD5 stuff */ - sprintf(string, "%s:%s:%s", user, realm, pw); + apr_snprintf(string, sizeof(string), "%s:%s:%s", user, realm, pw); apr_md5_init(&context); #if APR_CHARSET_EBCDIC @@ -188,8 +188,8 @@ int main(int argc, const char * const argv[]) char *dirname; char user[MAX_STRING_LEN]; char realm[MAX_STRING_LEN]; - char line[MAX_STRING_LEN]; - char l[MAX_STRING_LEN]; + char line[3 * MAX_STRING_LEN]; + char l[3 * MAX_STRING_LEN]; char w[MAX_STRING_LEN]; char x[MAX_STRING_LEN]; int found; @@ -222,9 +222,11 @@ int main(int argc, const char * const argv[]) apr_strerror(rv, errmsg, sizeof errmsg)); exit(1); } + apr_cpystrn(user, argv[4], sizeof(user)); + apr_cpystrn(realm, argv[3], sizeof(realm)); apr_file_printf(errfile, "Adding password for %s in realm %s.\n", - argv[4], argv[3]); - add_password(argv[4], argv[3], f); + user, realm); + add_password(user, realm, f); apr_file_close(f); exit(0); } @@ -253,7 +255,7 @@ int main(int argc, const char * const argv[]) apr_cpystrn(realm, argv[2], sizeof(realm)); found = 0; - while (!(get_line(line, MAX_STRING_LEN, f))) { + while (!(get_line(line, sizeof(line), f))) { if (found || (line[0] == '#') || (!line[0])) { putline(tfp, line); continue; diff --git a/support/rotatelogs.c b/support/rotatelogs.c index 8fd99dc7..1e7218f1 100644 --- a/support/rotatelogs.c +++ b/support/rotatelogs.c @@ -248,7 +248,7 @@ int main (int argc, const char * const argv[]) apr_strftime(buf2, &rs, sizeof(buf2), szLogRoot, &e); } else { - sprintf(buf2, "%s.%010d", szLogRoot, tLogStart); + apr_snprintf(buf2, sizeof(buf2), "%s.%010d", szLogRoot, tLogStart); } tLogEnd = tLogStart + tRotation; pfile_prev = pfile; |