lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.1k stars 161 forks source link

Mirroring deletes local parent directory #586

Closed Traumflug closed 4 years ago

Traumflug commented 4 years ago

Due to some scripting error I ended up with about this:

mkdir -p backup
(
  cd backup
  lftp -e "mirror --delete --delete-excluded --exclude=; quit;"
)

Right, that's --exclude=<nothing>.

Expected behavior

Lftp aborting and complaining about the missing parameter or Lftp excluding nothing.

Actual behavior

Lftp deleted all local files, including . and .., which means the parent directory of the current working directory including all content of this parent directory.

This is pretty dangerous behavior and very unlikely to do what the user wants it to do.

Diagnosis

lftp --version
LFTP | Version 4.8.4 | Copyright (c) 1996-2017 Alexander V. Lukyanov
[...]

This is the version coming with Ubuntu 19.10, the currently latest Ubuntu release.