[Bug 143] Add reference to "rsync" in FAQ and documentation.

Sturle Sunde sturle.sunde at usit.uio.no
Thu Apr 18 18:47:09 EST 2002


Yuliy Minchev <yuliy at mobiltel.bg> writes:

> rsync -av -e ssh /home/joe/stuff joeuser at joe.com:/home/joeuser/stuff

There is a bug if you depend on ssh-rand-helper and possibly external
programs to collect random data:

  [sturles at hpsan]~ $ rsync -ave ssh file sturle at anotherhost:/tmp/file
  Couldn't wait for child 'ls -alni /var/log' completion: No child processes
  Couldn't wait for child 'ls -alni /var/adm' completion: No child processes
  [... for all commands in /etc/ssh/ssh_prng_cmds ...]
  Not enough entropy in RNG
  ssh-rand-helper child produced insufficient data
  unexpected EOF in read_timeout

The reason for this is of course that rsync ignores SIGCHLD, and ssh
inherits this.

Here is a patch against 3.1p2 that fixes the problem.  I hope it
doesn't break anything else..:


--- entropy.c.orig      Sun Mar 10 20:42:07 2002
+++ entropy.c   Thu Apr 18 07:04:10 2002
@@ -61,6 +61,7 @@
        pid_t pid;
        int ret;
        unsigned char buf[RANDOM_SEED_SIZE];
+       mysig_t old_sigchld;
 
        if (RAND_status() == 1) {
                debug3("RNG is ready, skipping seeding");
@@ -74,6 +75,7 @@
        if (pipe(p) == -1)
                fatal("pipe: %s", strerror(errno));
 
+       old_sigchld = mysignal(SIGCHLD, SIG_DFL);
        if ((pid = fork()) == -1)
                fatal("Couldn't fork: %s", strerror(errno));
        if (pid == 0) {
@@ -121,6 +123,7 @@
        if (WEXITSTATUS(ret) != 0)
                fatal("ssh-rand-helper exit with exit status %d", ret);
 
+       mysignal(SIGCHLD, old_sigchld);
        RAND_add(buf, sizeof(buf), sizeof(buf));
        memset(buf, '\0', sizeof(buf));



-- 
Sturle        Before a mad scientist goes mad, there's probably a time
~~~~~~        when he's only partially mad.  And this is the time when 
              he's going to throw his best parties.     -- Jack Handey



More information about the openssh-unix-dev mailing list