From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,5678706ce9d07199,start X-Google-Attributes: gidfee84,public From: Mark Sirota Subject: Bug in mv in Digital Unix 3.x Date: 1996/04/25 Message-ID: <317FD8A9.794B@isc.upenn.edu>#1/1 X-Deja-AN: 151427172 content-type: text/plain; charset=us-ascii organization: University of Pennsylvania DCCS mime-version: 1.0 newsgroups: comp.unix.osf.osf1 x-mailer: Mozilla 3.0b2 (X11; I; OSF1 V3.2 alpha) I seem to have discovered an annoying bug in /usr/bin/mv, the hard way. Summary: mv removes files sometimes when it shouldn't. To recreate: % cd /tmp % mkdir a % touch a/a % ls -la a -- total 16 drwxr-xr-x 2 msirota system 8192 Apr 25 15:51 . drwxrwxrwt 4 root system 8192 Apr 25 15:35 .. -rw-r--r-- 1 msirota system 0 Apr 25 15:51 a % mv a a mv: rename a to a/a: Invalid argument % ls -la a drwxr-xr-x 2 msirota system 8192 Apr 25 15:52 ./ drwxrwxrwt 4 root system 8192 Apr 25 15:35 ../ In short, if you have a directory and a file within it by the same name, and move the directory to itself, the file is removed. I have tried this under Digital Unix 3.x, Ultrix, Solaris 2.5, and some version of HP/UX. The only one with the problem is Digital Unix. Has anyone else encountered this? Is this a known bug? Is there a patch? I do intend to submit this right now to Digital, too, but I thought I'd ask for your experience. -- Mark Sirota, Network Systems Engineer University of Pennsylvania, Data Communications and Computing Services msirota@isc.upenn.edu, 215/573-7214 mv: rename a to a/a: Invalid argument