From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.19 i686; en-US; rv:0.9.1) Gecko/20010607 Description of problem: diff -r blindly follows symlinks, namely directory symlinks. When the compared directories accidentaly contain link cycles, strange things happen. It's not possible to use diff -r at such directory structures at all. How reproducible: Always Steps to Reproduce: 1. Create two identical directory structures with link cycles using following commands: mkdir 1 2 cd 1 mkdir a b cd a ln -s ../b b cd ../b ln -s ../a a cd ../../2 mkdir a b cd a ln -s ../b b cd ../b ln -s ../a a cd ../.. 2. run diff -r 1 2 Actual Results: For a good while it seems nothing is happening, then diff prints two messages like (several hundreds of `a/b/'s omitted in the place of `...') diff: 1/a/b/a/b/a/b/a/b/a/b/a/b/.../a/b/a/b/a/b: File name too long and after a while it ends. Expected Results: diff realizes the directories are identical, realizes it pretty fast and doesn't print any error messages. Additional info: It is arguable what diff should do in similar situations. I don't see why it should follow symlinks at all, namely directory symlinks. Maybe it could be made optional, at least.
This behaviour is fixed in our rawhide tree. diffutils-2.7.2-1 gives this: diff: 1/a/b/a: recursive directory loop diff: 1/b/a/b: recursive directory loop