Bug 108486 - rdist deletes destination directory tree when only one source file is specified
rdist deletes destination directory tree when only one source file is specified
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: rdist (Show other bugs)
9
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Phil Knirsch
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-29 18:19 EST by Stefan Hudson
Modified: 2015-03-04 20:13 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-18 11:16:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Stefan Hudson 2003-10-29 18:19:02 EST
Description of problem:
When a single source file is specified for an install, rdist will delete the
entire remote directory tree specified and attempt to replace it with the source
file.

Version-Release number of selected component (if applicable):
rdist-6.1.5-26

How reproducible:
100% using this example distfile:
----- BOF -----
TESTFILE = ( filea )
${TESTFILE} -> mytarget
install /root/testdir/ ;
----- EOF -----

Steps to Reproduce:
1. Place above distfile in current directory on source system.
2. Create target directory tree /root/testdir/ on remote system with any files
in it "filea", "fileb", "filec".
3. Create a file "filea" on source system.
4. Run rdist in directory containing "distfile" and "filea".

Actual results:
[root@mysource]# rdist -P /usr/bin/ssh
mytarget: updating host mytarget
mytarget: filea: updating
mytarget: /root/testdir//filea: removed
mytarget: /root/testdir//fileb: removed
mytarget: /root/testdir//filec: removed
mytarget: /root/testdir//rdistjCQXPO: removed
mytarget: /root/testdir/: removed
mytarget: REMOTE ERROR: /root/testdir/rdistjCQXPO -> /root/testdir/: rename
failed: No such file or directory
mytarget: updating of mytarget finished

Expected results:
[root@mysource]# rdist -P /usr/bin/ssh
mytarget: updating host mytarget
mytarget: filea: updating
mytarget: updating of mytarget finished

Additional info:
If more than one source file is specified, behavior is correct:
Example distfile:
----- BOF -----
TESTFILE = ( filea fileb )
${TESTFILE} -> mytarget
install /root/testdir/ ;
----- EOF -----

[root@mysource]# rdist -P /usr/bin/ssh
mytarget: updating host mytarget
mytarget: filea: updating
mytarget: fileb: updating
mytarget: updating of mytarget finished

This is a good way to wipe out /etc on important machines.
rdist should never remove any files unless remove option is specified.
Comment 1 Phil Knirsch 2003-12-17 07:50:25 EST
Reproduced locally here, investigating.

Read ya, Phil
Comment 2 Phil Knirsch 2003-12-17 07:51:31 EST
PS: This sounds a little like #210, one of the oldest bugs in
bugzilla. Just a nice little piece of history. :-)
Comment 3 Phil Knirsch 2004-01-12 10:25:09 EST
Another note now after my vacation:

It seems like this could be similar to the behaviour of 'cp' where if
you only specify 1 source and 1 target the source file will be copied
over as a file to the target. But of course if the target already
exists as a directory then cp copies the file into that directory
which is the expected behaviour of rdist, too.

I'll see if i can work out a fix.

Read ya, Phil
Comment 4 Phil Knirsch 2004-10-18 11:16:48 EDT
Package has been fixed for AS2.1 and RHEL3 as well as latest Fedora
Core  releases.

Read ya, Phil

Note You need to log in before you can comment on or make changes to this bug.