]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/fork-safe-prng'
authorAndre Noll <maan@systemlinux.org>
Sun, 13 Oct 2013 14:01:40 +0000 (16:01 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 13 Oct 2013 14:01:40 +0000 (16:01 +0200)
Was cooking for two weeks.

a496f5 crypt: Add workaround for non-fork-safe PRGs.

server.c

index 36af088ec64e0b4fd2baac06cd773653858853f0..70d9137e7073cf7e7c7e9d3e598c742a26657560 100644 (file)
--- a/server.c
+++ b/server.c
@@ -388,6 +388,9 @@ static int command_post_select(struct sched *s, struct task *t)
                goto out;
        }
        if (child_pid) {
+               /* avoid problems with non-fork-safe PRNGs */
+               unsigned char buf[16];
+               get_random_bytes_or_die(buf, sizeof(buf));
                close(new_fd);
                /* parent keeps accepting connections */
                return 0;