Browse Source

Load timezone info before chroot

Fixes #13
tags/1.2
Timo Röhling 10 years ago
parent
commit
f430c83b82
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      postsrsd.c

+ 4
- 0
postsrsd.c View File

234
   struct passwd *pwd = NULL;
234
   struct passwd *pwd = NULL;
235
   char secretbuf[1024], *secret = NULL;
235
   char secretbuf[1024], *secret = NULL;
236
   char *tmp;
236
   char *tmp;
237
+  time_t now;
237
   srs_t *srs;
238
   srs_t *srs;
238
   struct pollfd fds[3];
239
   struct pollfd fds[3];
239
   const char **excludes;
240
   const char **excludes;
356
 
357
 
357
   /* Open syslog now (NDELAY), because it may no longer reachable from chroot */
358
   /* Open syslog now (NDELAY), because it may no longer reachable from chroot */
358
   openlog (self, LOG_PID | LOG_NDELAY, LOG_MAIL);
359
   openlog (self, LOG_PID | LOG_NDELAY, LOG_MAIL);
360
+  /* Force loading of timezone info (suggested by patrickdk77) */
361
+  now = time(NULL);
362
+  localtime (&now);
359
   /* We also have to lookup the uid of the unprivileged user for the same reason. */
363
   /* We also have to lookup the uid of the unprivileged user for the same reason. */
360
   if (user) {
364
   if (user) {
361
     errno = 0;
365
     errno = 0;

Loading…
Cancel
Save