~clint-fewbar/ubuntu/maverick/apache2/maverick-passphrase-plymouth-change

« back to all changes in this revision

Viewing changes to support/rotatelogs.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Fritsch, Stefan Fritsch, Peter Samuelson
  • Date: 2007-07-01 19:57:51 UTC
  • mfrom: (0.8.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070701195751-kcags6dpm5up3li5
Tags: 2.2.4-1
[ Stefan Fritsch ]
* Urgency medium for security fix
* Fix CVE-2007-1863: DoS in mod_cache
* New upstream version (Closes: #427050)
  - Fixes "proxy: error reading status line from remote server"
    (Closes: #410331)
* Fix CVE-2007-1862: mod_mem_cache DoS (introduced in 2.2.4)
* Change logrotate script to use reload instead of restart.
  (Closes: #298689)
* chmod o-rx /var/log/apache2 (Closes: #291841)
* chmod o-x suexec (Closes: #431048)
* Update patch for truncated mod_cgi 500 responses from upstream SVN
  (Closes: #412580)
* Don't use AddDefaultCharset for our docs (Closes: #414429)
* fix options syntax in sites-available/default (Closes: #419539)
* Move conf.d include to the end of apache2.conf (Closes: #305933)
* Remove log, cache, and lock files on purge (Closes: #428887)
* Ship /usr/lib/cgi-bin (Closes: #415698)
* Add note to README.Debian how to read docs (Closes: #350822)
* Document pid file name (Closes: #350286)
* Update Standards-Version (no changes needed)
* Fix some lintian warnings, add some overrides
* Start apache when doing a "restart" even if it was not running
  (Closes: #384682)
* reload config in apache2-doc postinst (Closes: #289289)
* don't fail in prerm if apache is not running (Closes: #418536)
* Suggest apache2-doc and www-browser (Closes: #399056)
* Make init script always display a warning if NO_START=1 since
  VERBOSE=yes is not the default anymore (Closes: #430116)
* Replace apache2(8) man page with a more current version
* Add httxt2dbm(8) man page
* Show -X option in help message (Closes: #391817)
* remove sick-hack-to-update-modules
* don't depend on procps on hurd (Closes: #431125)

[ Peter Samuelson ]
* Add shlibs:Depends to apache2.2-common.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
#endif
55
55
 
56
56
#define BUFSIZE         65536
57
 
#define ERRMSGSZ        82
 
57
#define ERRMSGSZ        128
58
58
 
59
59
#ifndef MAX_PATH
60
60
#define MAX_PATH        1024
188
188
 
189
189
        if (nLogFD == NULL) {
190
190
            int tLogStart;
 
191
            apr_status_t rv;
191
192
 
192
193
            if (tRotation) {
193
194
                tLogStart = (now / tRotation) * tRotation;
208
209
                sprintf(buf2, "%s.%010d", szLogRoot, tLogStart);
209
210
            }
210
211
            tLogEnd = tLogStart + tRotation;
211
 
            apr_file_open(&nLogFD, buf2, APR_READ | APR_WRITE | APR_CREATE | APR_APPEND,
212
 
                          APR_OS_DEFAULT, pool);
213
 
            if (nLogFD == NULL) {
 
212
            rv = apr_file_open(&nLogFD, buf2, APR_WRITE | APR_CREATE | APR_APPEND,
 
213
                               APR_OS_DEFAULT, pool);
 
214
            if (rv != APR_SUCCESS) {
 
215
                char error[120];
 
216
 
 
217
                apr_strerror(rv, error, sizeof error);
 
218
 
214
219
                /* Uh-oh. Failed to open the new log file. Try to clear
215
220
                 * the previous log file, note the lost log entries,
216
221
                 * and keep on truckin'. */
217
222
                if (nLogFDprev == NULL) {
218
 
                    fprintf(stderr, "1 Previous file handle doesn't exists %s\n", buf2);
 
223
                    fprintf(stderr, "Could not open log file '%s' (%s)\n", buf2, error);
219
224
                    exit(2);
220
225
                }
221
226
                else {
222
227
                    nLogFD = nLogFDprev;
223
 
                    sprintf(errbuf,
224
 
                            "Resetting log file due to error opening "
225
 
                            "new log file. %10d messages lost.\n",
226
 
                            nMessCount);
 
228
                    /* Try to keep this error message constant length
 
229
                     * in case it occurs several times. */
 
230
                    apr_snprintf(errbuf, sizeof errbuf,
 
231
                                 "Resetting log file due to error opening "
 
232
                                 "new log file, %10d messages lost: %-25.25s\n",
 
233
                                 nMessCount, error);
227
234
                    nWrite = strlen(errbuf);
228
235
                    apr_file_trunc(nLogFD, 0);
229
236
                    if (apr_file_write(nLogFD, errbuf, &nWrite) != APR_SUCCESS) {