Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Mark Sirota <msirota@isc.upenn.edu>
Subject: Bug in mv in Digital Unix 3.x
Date: 1996/04/25	[thread overview]
Message-ID: <317FD8A9.794B@isc.upenn.edu> (raw)

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



                 reply	other threads:[~1996-04-25  4:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox