~ubuntu-branches/ubuntu/lucid/curl/lucid-security

« back to all changes in this revision

Viewing changes to tests/server/util.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2009-04-29 11:10:29 UTC
  • mfrom: (3.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090429111029-2j5eiyokfw2bw049
Tags: 7.19.4-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop build dependencies: stunnel, libdb4.6-dev, libssh2-1-dev
  - Add build-dependency on openssh-server
  - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.
  - Call automake-1.9 with --add-missing --copy --force
* drop debian/patches/security_CVE-2009-0037.patch 
  - this patch is part of 7.19.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: util.c,v 1.24 2008-04-23 23:55:34 yangtse Exp $
 
21
 * $Id: util.c,v 1.27 2008-10-01 17:34:25 danf Exp $
22
22
 ***************************************************************************/
23
23
#include "setup.h" /* portability help from the lib directory */
24
24
 
59
59
const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }};
60
60
#endif
61
61
 
62
 
/* someone else must set this properly */
63
 
extern const char *serverlogfile;
64
 
 
65
62
void logmsg(const char *msg, ...)
66
63
{
67
64
  va_list ap;
68
 
  char buffer[512]; /* possible overflow if you pass in a huge string */
 
65
  char buffer[2048 + 1];
69
66
  FILE *logfp;
70
67
  int error;
71
68
  struct timeval tv;
83
80
  now = localtime(&sec); /* not multithread safe but we don't care */
84
81
 
85
82
  snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld",
86
 
           now->tm_hour, now->tm_min, now->tm_sec, tv.tv_usec);
 
83
    (int)now->tm_hour, (int)now->tm_min, (int)now->tm_sec, (long)tv.tv_usec);
87
84
 
88
85
  va_start(ap, msg);
89
 
  vsprintf(buffer, msg, ap);
 
86
  vsnprintf(buffer, sizeof(buffer), msg, ap);
90
87
  va_end(ap);
91
88
 
92
89
  logfp = fopen(serverlogfile, "a");
238
235
void set_advisor_read_lock(const char *filename)
239
236
{
240
237
  FILE *lockfile;
241
 
  int error;
 
238
  int error = 0;
242
239
  int res;
243
240
 
244
241
  do {
260
257
 
261
258
void clear_advisor_read_lock(const char *filename)
262
259
{
263
 
  int error;
 
260
  int error = 0;
264
261
  int res;
265
262
 
266
263
  do {