clemens fischer
2003-Aug-25 00:44 UTC
rsync silently changes special files to regular ones!
rsync version 2.5.6 protocol version 26 on FreeBSD 4.8-STABLE i386 "promotes" character special files to regular files: --8<---cut here:--start--->8-- # ll /dev/stdout 8282 crw-rw-rw- 1 root wheel - 22, 1 Aug 23 17:30 /dev/stdout # rsync localhost::rsync/readme /dev/stdout $Id: readme,v 1.2 2003/08/05 02:38:25 root Exp root $ ... # ll /dev/stdout 7527 -rw-r--r-- 1 root wheel - 136 Aug 24 11:49 /dev/stdout # ./MAKEDEV std # ll /dev/stdout 7527 crw-rw-rw- 1 root wheel - 22, 1 Aug 24 11:49 /dev/stdout --8<---cut here:---end---->8-- i know that this (displaying a text file on the console) is not what rsync is meant to do, but since it didn't give any messages or exit- codes, i didn't think of checking /dev/stdout. since then i chased a phantom bug in freebsds update procedure for two weeks, never suspecting an rsync bug. rsync should error exit or message the user when used on special files! regards, clemens
On Sun, 24 Aug 2003 16:44:15 +0200 clemens fischer <ino-qc@spotteswoode.de.eu.org> wrote:> rsync version 2.5.6 protocol version 26 on FreeBSD 4.8-STABLE i386 > "promotes" character special files to regular files: > > --8<---cut here:--start--->8-- > # ll /dev/stdout > 8282 crw-rw-rw- 1 root wheel - 22, 1 Aug 23 17:30 /dev/stdout > > # rsync localhost::rsync/readme /dev/stdout > $Id: readme,v 1.2 2003/08/05 02:38:25 root Exp root $ > ... > > # ll /dev/stdout > 7527 -rw-r--r-- 1 root wheel - 136 Aug 24 11:49 /dev/stdout > > # ./MAKEDEV std > > # ll /dev/stdout > 7527 crw-rw-rw- 1 root wheel - 22, 1 Aug 24 11:49 /dev/stdout > --8<---cut here:---end---->8-- > > i know that this (displaying a text file on the console) is not what > rsync is meant to do, but since it didn't give any messages or exit- > codes, i didn't think of checking /dev/stdout. since then i chased a > phantom bug in freebsds update procedure for two weeks, never > suspecting an rsync bug.It is not "used on" special files. rsync replaces the destination with the source. It is just the same behaviour as mv. It is not like 'cat >dest'. root@vexed:/tmp# mknod pts5 c 136 5 root@vexed:/tmp# date>hello root@vexed:/tmp# ls -l hello pts5 -rw-r--r-- 1 root root 29 Aug 25 17:20 hello crw-r--r-- 1 root root 136, 5 Aug 25 17:20 pts5 root@vexed:/tmp# mv hello pts5 root@vexed:/tmp# ls -l hello pts5 ls: hello: No such file or directory -rw-r--r-- 1 root root 29 Aug 25 17:20 pts5 I can see how it would be confusing, but it is not a bug.> rsync should error exit or message the user when used on special > files!No, I don't think so. At the most I could stretch to giving a warning when replacing a special file, but even then I'm not sure. Unix is "you asked for it, you got it." Cheerio, -- Martin -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.samba.org/archive/rsync/attachments/20030825/6616a5e2/attachment.bin