[packages/rsync] - downgrade to 3.1.2 due to server segfault

Elan Ruusamäe glen at delfi.ee
Tue Dec 4 00:19:03 CET 2018



On 04/12/2018 00:51, Marcin Krol wrote:
>>> diff --git a/rsync.spec b/rsync.spec
>>> index d663909..a257e2d 100644
>>> --- a/rsync.spec
>>> +++ b/rsync.spec
>>> @@ -1,3 +1,4 @@
>>> +# TODO: 3.1.3 rsyncd segfaults very early in server rsync:// mode
>>> (both inetd and standalone)
>
>
> FYI...
>
> https://www.mail-archive.com/rsync@lists.samba.org/msg32342.html
>
> https://git.tld-linux.org/?p=packages/rsync.git;a=blob_plain;f=rsync-popt-segv-fix.patch;hb=2f9fbda0b06f6f40cd54b3b79aa8b2aeeb1eab55 
>
>
> Maybe you'll think of better fix. Upstream probably ignored my report :)
i guessed it might be something to do with std fds.

however, rc-scripts no longer closes fd0,1,2, but redirects, but redirects.

also there's --redirfds or --closefds option for daemon() to use if the 
initlog still does some fd closing.

you may also try playing with RC_LOGGING=yes vs RC_LOGGING=no to skip 
initlog completely.

....
actually. now i'm looking, and can't find the commit that redirects fds 
to /dev/null by default.

maybe i asked mailing list, and received no response and the forgot the 
idea/patch.

all i found is 2014 commit. which is similar, but something else:
http://git.pld-linux.org/?p=projects/rc-scripts.git;a=commitdiff;h=289e29826cf1ce827e69ad3b6af8d2d9933bc875


```
[~/rpm/packages/rc-scripts/rc-scripts (master)★] ➔ g show 
289e29826cf1ce827e69ad3b6af8d2d9933bc875
commit 289e29826cf1ce827e69ad3b6af8d2d9933bc875
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Mar 2 02:40:52 2014 +0200

     daemon: always close stdin, avoids weird program deaths; redirect 
stdin "in", not "out"

diff --git a/lib/functions b/lib/functions
index 56cab80..e75f61d 100644
--- a/lib/functions
+++ b/lib/functions
@@ -726,13 +726,14 @@ daemon() {
                 if [ "$closefds" = 1 ]; then
                         exec 1>&-
                         exec 2>&-
-                       exec 0>&-
+                       exec 0<&-
                 elif [ "$redirfds" = 1 ]; then
                         exec 1>/dev/null
                         exec 2>/dev/null
-                       exec 0>/dev/null
+                       exec 0</dev/null
                 else
                         exec 2>&1
+                       exec 0</dev/null
                 fi

                 if is_no "$RC_LOGGING"; then
```


More information about the pld-devel-en mailing list