samba-bugs@samba.org
2009-Apr-20 20:47 UTC
DO NOT REPLY [Bug 6280] New: (Bug incl. PATCH) Linux mknod does not work when syncing fifos and sockets from Solaris
https://bugzilla.samba.org/show_bug.cgi?id=6280
Summary: (Bug incl. PATCH) Linux mknod does not work when syncing
fifos and sockets from Solaris
Product: rsync
Version: 3.0.6
Platform: x64
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P3
Component: core
AssignedTo: wayned@samba.org
ReportedBy: sebastian_kapfer@gmx.net
QAContact: rsync-qa@samba.org
When syncing specials, namely pipes and sockets from a Solaris host, rsync -a
prints error 22. Remote version is 2.6.3pre1.
sk@noether(~/rsnyc/rsync-3.0.6pre1)> ./rsync -a klein:/tmp/xhyjxhy .
rsync: mknod "/home/sk/rsnyc/rsync-3.0.6pre1/xhyjxhy" failed: Invalid
argument
(22)
rsync error: some files/attrs were not transferred (see previous errors) (code
23) at main.c(1505) [generator=3.0.6pre1]
Reason: rsync calls mknod ("filename", ..., 0xffffffff), which Linux
rejects,
as allowed by POSIX.
rsync should clear the third parameter before calling mknod.
Suggested patch in syscall.c, do_mknod:
111 #ifdef HAVE_MKNOD
112 if (S_ISSOCK (mode) || S_ISFIFO(mode)) {
113 /* this variable is not ignored by Linux 2.6. */
114 dev = 0;
115 }
116 >-------return mknod(pathname, mode, dev);
117 #else
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2009-Apr-20 21:00 UTC
DO NOT REPLY [Bug 6280] (Bug incl. PATCH) Linux mknod does not work when syncing fifos and sockets from Solaris
https://bugzilla.samba.org/show_bug.cgi?id=6280
------- Comment #1 from sebastian_kapfer@gmx.net 2009-04-20 16:00 CST -------
Three additional comments:
1. Updating the Solaris side of things to rsync-3.06 does not help.
2. Pushing to instead of pulling from Linux does not help.
3. Reproduce the behaviour with this code#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main () {
if (mknod ("test_fifo_fifi", 0777 | S_IFIFO, (dev_t)-1)) {
perror ("mknod");
return 1;
}
unlink ("test_fifo_fifi");
return 0;
}
This works on Solaris, and does not work on Linux. The Linux docs are not
completely clear as to if this should work.
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2009-Apr-24 14:07 UTC
DO NOT REPLY [Bug 6280] (Bug incl. PATCH) Linux mknod does not work when syncing fifos and sockets from Solaris
https://bugzilla.samba.org/show_bug.cgi?id=6280
wayned@samba.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
------- Comment #2 from wayned@samba.org 2009-04-24 09:08 CST -------
Does Solaris allow mknod("test_fifo_fifi", 0777 | S_IFIFO, (dev_t)0)
to work?
If so, the fix I'm contemplating is setting rdev to 0 down in flist.c's
make_file():
#ifdef HAVE_STRUCT_STAT_ST_RDEV
if (IS_DEVICE(st.st_mode)) {
tmp_rdev = st.st_rdev;
st.st_size = 0;
} else if (IS_SPECIAL(st.st_mode)) {
tmp_rdev = 0;
st.st_size = 0;
}
#endif
I wonder if that would break any OS? Perhaps a safer change would be for that
final tmp_rdev assignment to be:
tmp_rdev = st.st_rdev == (dev_t)-1 ? 0 : st.st_rdev;
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2009-Apr-25 08:45 UTC
DO NOT REPLY [Bug 6280] (Bug incl. PATCH) Linux mknod does not work when syncing fifos and sockets from Solaris
https://bugzilla.samba.org/show_bug.cgi?id=6280
------- Comment #3 from sebastian_kapfer@gmx.net 2009-04-25 03:45 CST -------
Hi.
from Solaris mknod(2):
If mode does not indicate a
block special or character special device, dev is ignored.
Similar prose is in Linux mknod(2), but in the case of Solaris, it is actually
true :-)
In short, dev=0 works on Linux and Solaris.
I'd prefer the fix being in the receiving end of rsync, that is, the one
that
does the actual mknod. This would maintain compatibility work legacy rsyncs on
the remove host. Is make_file on the receiving end?
Greetings, Sebastian
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2009-Apr-25 17:06 UTC
DO NOT REPLY [Bug 6280] (Bug incl. PATCH) Linux mknod does not work when syncing fifos and sockets from Solaris
https://bugzilla.samba.org/show_bug.cgi?id=6280 ------- Comment #4 from wayned@samba.org 2009-04-25 12:07 CST ------- Created an attachment (id=4082) --> (https://bugzilla.samba.org/attachment.cgi?id=4082&action=view) Changes to excise rdev use with special files Here's the patch I came up with. It has the following features: - Should avoid the error when talking to an older rsync version, regardless of the direction of transfer. - Makes the transmission of special files a little more efficient (and will be made even more efficient in protocol 31, which is being created for 3.1.0). - Saves memory by not remembering a useless rdev value for special files. I looked at the Linux kernel code, and all the file systems I saw validate that the dev value is a valid device number before figuring out what kind of device/special-file is being created. So, the code above ensures that mknod() should always see a valid device number. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2009-Apr-26 15:06 UTC
DO NOT REPLY [Bug 6280] Linux mknod does not work when syncing fifos and sockets from Solaris
https://bugzilla.samba.org/show_bug.cgi?id=6280
wayned@samba.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Summary|(Bug incl. PATCH) Linux |Linux mknod does not work
|mknod does not work when |when syncing fifos and
|syncing fifos and sockets |sockets from Solaris
|from Solaris |
------- Comment #5 from wayned@samba.org 2009-04-26 10:07 CST -------
Fix checked into git.
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2009-Apr-26 18:49 UTC
DO NOT REPLY [Bug 6280] Linux mknod does not work when syncing fifos and sockets from Solaris
https://bugzilla.samba.org/show_bug.cgi?id=6280 ------- Comment #6 from sebastian_kapfer@gmx.net 2009-04-26 13:49 CST ------- I tried the Git version in all combinations of patched/unpatched and Solaris/Linux. It works beautifully, tough I don't quite see the reason for a protocol change. Thank you very much for your help! -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
Apparently Analagous Threads
- [Bug 1804] FreeBSD's mknod can't create FIFOs and sockets
- FreeBSD mknod refuses to create pipes and fifos
- rsyncing fifos and sockets on FreeBSD
- [Bug 8265] New: Long paths, hardlinks, 'special' files [was: Regression: sockets for 3.0.9pre1]
- [PATCH] mknod: filter modes in mkfifo, mknod_b, mknod_c (RHBZ#1182463).