character devices

2020-06-26 Thread Michal Ruprich via rsync
Hi,

I was running a couple of tests on the latest rsync and noticed a
different behavior when it comes to character devices. The test creates
a character device on the client side and a simple text file on the
server side. When copying from server to the client, previously the
character device would get changed to a regular text file after the
transaction but with new rsync, the character device is still a
character device.

Before:

# ls -l /var/tmp/client

crw-rw-rw-. 1 root root 1, 0 Jun 26 05:41
character.device

# ls -l /home/rsynctestuser/rsyncdata

-rw-r--r--. 1 root root   12 Jun 26 05:41
character.device

# rsync --perms --owner --group --times --update --recursive
::my_data /var/tmp/client

# ls -l /var/tmp/client

-rw-r--r--. 1 root root   12 Jun 26 05:46
character.device   <--- the file has changed to a text file


After:

# ls -l /var/tmp/client/

crw-rw-rw-. 1 root root 1, 0 Jun 26 05:46
character.device

# ls -l /home/rsynctestuser/rsyncdata

-rw-r--r--. 1 root root   12 Jun 26 05:46
character.device

#rsync --perms --owner --group --times --update --recursive
::my_data /var/tmp/client

# ls -l /var/tmp/client

crw-rw-rw-. 1 root root 1, 0 Jun 26 05:46
character.device <--- no change in the type of file


I tried to run the newer version with --write-devices but manpage says:
"This option is refused by an rsync daemon.". I am trying to find out
what is the correct behavior in this case. Was the assumption that the
character device would change with the older version wrong? Is there a
way how to let the server rewrite the file? I tried the 'refuse options'
statement in the rsyncd.conf but no luck.

I would truly appreciate any ideas about this.

Thanks and regards,

Michal Ruprich


-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


[Bug 2389] block/character devices on Solaris yield wacky rsync stats

2005-02-24 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=2389





--- Additional Comments From [EMAIL PROTECTED]  2005-02-24 16:43 ---
Created an attachment (id=979)
 --> (https://bugzilla.samba.org/attachment.cgi?id=979&action=view)
Proposed syscall.c patch


-- 
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.
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


[Bug 2389] block/character devices on Solaris yield wacky rsync stats

2005-02-24 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=2389





--- Additional Comments From [EMAIL PROTECTED]  2005-02-24 19:35 ---
Created an attachment (id=982)
 --> (https://bugzilla.samba.org/attachment.cgi?id=982&action=view)
A simpler fix

I think a better/simpler fix is to tweak the code in flist.c where it adds up
the size of the transfer.  Currently it adds in the size of any non-directory. 
This should be changed to ignore devices at the very least.  However, since the
stat is the file size of the transfer, I think it might be best to ignore
symlinks too.  Here is a patch that ignores everything that is not a regular
file.

Please let me know if this fixes the problem.

-- 
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.
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


[Bug 2389] block/character devices on Solaris yield wacky rsync stats

2005-02-25 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=2389


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2005-02-25 16:10 ---
I've checked in a change to CVS that is similar to the one I attched to this bug
report, but still counts symlinks in the total file size (i.e. it should just
omit devices).  I think this should fix this bug.

-- 
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.
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


[Bug 2389] block/character devices on Solaris yield wacky rsync stats

2005-02-27 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=2389





--- Additional Comments From [EMAIL PROTECTED]  2005-02-27 16:19 ---
Odd, my reply never made it through.  I'll paste my reply in "manually".  David

-Original Message-
From: Wood, David 
Sent: Friday, February 25, 2005 4:52 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [Bug 2389] block/character devices on Solaris yield wacky rsync 
stats


> Please let me know if this fixes the problem.

Hi Wayne,

The patch works just fine - thanks!  I had originally used the same patch;
however, I went with the stat wrapper because:

1) I thought including symlink (pipe, etc) sizes in statistics was intentional

2) I figured a purist would be upset if bogus data lingered in the stat 
structure

3) I'm not familiar enough with rsync internals to ensure that I would find all
possible "bad" uses of st_size.  You're certainly well versed in rsync internals
and can make such a determination ;-).

Anyway, much obliged for the fix.  David


-- 
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.
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


[Bug 2389] New: block/character devices on Solaris yield wacky rsync stats

2005-02-24 Thread samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=2389

   Summary: block/character devices on Solaris yield wacky rsync
stats
   Product: rsync
   Version: 2.6.4
  Platform: All
OS/Version: Solaris
Status: NEW
  Severity: normal
  Priority: P3
 Component: core
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
 QAContact: [EMAIL PROTECTED]


The problem is easy to re-produce:

bsqa1.nyc:/tmp/rsync/test # ls -al foo
crw-r-   1 root sys   85,16554 Oct  6  2003 foo
bsqa1.nyc:/tmp/rsync/test # /tmp/rsync/bin/rsync --archive -v /tmp/rsync/test/
master:/tmp/rsync/test/
building file list ... done
./
foo

sent 89 bytes  received 32 bytes  80.67 bytes/sec
total size is 2147483647  speedup is 17747798.74

Notice the absurdly large "total size".  According to the Solaris stat() man 
page:

 st_size
   For regular files, this is the address of the  end  of
   the file. For block special or character special, this
   is not defined. See also pipe(2).

I'll attach a patch I've been using for a while now; basically, I wrap stat()
and set st_size to zero for block/character devices.  David

-- 
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.
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html