Преглед изворни кода

Load timezone info before chroot

Fixes #13
tags/1.2
Timo Röhling пре 9 година
родитељ
комит
f430c83b82
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4
    0
      postsrsd.c

+ 4
- 0
postsrsd.c Прегледај датотеку

@@ -234,6 +234,7 @@ int main (int argc, char **argv)
234 234
   struct passwd *pwd = NULL;
235 235
   char secretbuf[1024], *secret = NULL;
236 236
   char *tmp;
237
+  time_t now;
237 238
   srs_t *srs;
238 239
   struct pollfd fds[3];
239 240
   const char **excludes;
@@ -356,6 +357,9 @@ int main (int argc, char **argv)
356 357
 
357 358
   /* Open syslog now (NDELAY), because it may no longer reachable from chroot */
358 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 363
   /* We also have to lookup the uid of the unprivileged user for the same reason. */
360 364
   if (user) {
361 365
     errno = 0;

Loading…
Откажи
Сачувај