Skip to content

Commit

Permalink
handle broken symlinks, Closes: #985303
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrfai committed May 26, 2022
1 parent 56d5ca4 commit e0d7b49
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/fcopy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# fcopy -- copy files using FAI classes and preserve directory structure
#
# This script is part of FAI (Fully Automatic Installation)
# Copyright (C) 2000-2020 Thomas Lange, lange@informatik.uni-koeln.de
# Copyright (C) 2000-2022 Thomas Lange, lange@informatik.uni-koeln.de
# Universitaet zu Koeln
# Copyright (C) 2001-2005 Henning Glawe, glaweh@physik.fu-berlin.de
# Freie Univeritaet Berlin
Expand Down Expand Up @@ -137,6 +137,12 @@ sub copy_one {
}
}

# handle broken symlink
unless (stat($sourcefile)) {
ewarn "$sourcefile is a broken symlink\n";
return;
}

# do we need a tmpfile
if ($substitute or -f "$ps/_substitute" or -x "$ps/preinst") {
($tmpfh,$tmpfile)=tempfile("fcopy.XXXXXX",DIR=>File::Spec->tmpdir());
Expand Down

0 comments on commit e0d7b49

Please sign in to comment.