]> andersk Git - openssh.git/blobdiff - ssh-rand-helper.c
- (tim) [configure.ac] Move CHECK_HEADERS test before platform specific
[openssh.git] / ssh-rand-helper.c
index d88a246eba180d77b7292d77ca5442c5d9fdb8d3..8520c3a62ee573396ddf36ee86bfb925a7f259f2 100644 (file)
 #include <sys/resource.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
+#include <sys/socket.h>
+
+#include <stdarg.h>
+#include <stddef.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
 
 #ifdef HAVE_SYS_UN_H
 # include <sys/un.h>
 #endif
 
+#include <errno.h>
+#include <fcntl.h>
+#include <pwd.h>
 #include <signal.h>
+#include <time.h>
+#include <unistd.h>
 
 #include <openssl/rand.h>
 #include <openssl/sha.h>
@@ -573,8 +585,8 @@ prng_write_seedfile(void)
        /* Try to ensure that the parent directory is there */
        snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir,
            _PATH_SSH_USER_DIR);
-       if (mkdir(filename, 0700) < 0)
-               fatal("mkdir: %s", strerror(errno));
+       if (mkdir(filename, 0700) < 0 && errno != EEXIST)
+               fatal("mkdir %.200s: %s", filename, strerror(errno));
 
        snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir,
            SSH_PRNG_SEED_FILE);
This page took 0.06216 seconds and 4 git commands to generate.