Re: openrsync errors using -x or --exclude

Thomas Kupper <[email protected]>
Newsgroups gmane.os.openbsd.misc
Message-ID <[email protected]>
Maxim wrote on 03.06.2026 22:40:
> Thomas Kupper, 2026-06-03 18:39 +0200:
>> Mine Fedora is older, version 41 vs yours 44 (latest) but it's the same
>> rsync version 3.4.1 protocol 32. I'll give it a go with Fedora 44.
>>
>> But for me it doesn't work at all when I add '--delete', no combination
>> works.
> 
> I've localised the problem with option -x down to openrsync alone:
> 
>      $ mkdir /tmp/sync-from
>      $ touch /tmp/sync-from/foo.txt
>      $ openrsync --rsync-path=openrsync -r -x --delete /tmp/sync-from/ localhost:/tmp/sync-to
>      $ openrsync --rsync-path=openrsync -r -x --delete /tmp/sync-from/ localhost:/tmp/sync-to
>      openrsync: error: .: stat: No such file or directory
>      openrsync: error: poll: hangup
> 
> I haven't looked into --exclude yet.

It's an issue with unveil(2) not set for '.' in receiver.c. But I don't 
know yet how to solve it properly; either the below or remove '.' from 
the file list or maybe something else.

Temporary the below works _but_ really it's only for testing. Maybe it's 
the worst way to handle it.

---
Index: receiver.c
===================================================================
RCS file: /cvs/src/usr.bin/rsync/receiver.c,v
diff -u -p -r1.34 receiver.c
--- receiver.c  29 May 2025 17:03:43 -0000      1.34
+++ receiver.c  4 Jun 2026 12:38:00 -0000
@@ -201,6 +201,12 @@ rsync_receiver(struct sess *sess, int fd
                 if (dfd == -1)
                         err(ERR_IPC, "%s: unveil", 
sess->opts->basedir_abs[i]);
         }
+       /* TEMP: manually unveil '.'
+          TODO: '.' is always added it seems but not in the 
basedir_abs[] array,
+                either remove it or unveil() it */
+       dfd = unveil(".", "r");
+       if (dfd == -1)
+               err(ERR_IPC, "%s: unveil", ".");

         if (unveil(root, "rwc") == -1)
                 err(ERR_IPC, "%s: unveil", root);
---

> 
>> What OpenBSD version are you running it on?
> 
> OpenBSD 7.9-current (GENERIC.MP) #527: Fri May 29 02:10:56 MDT 2026
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.