mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-28 20:11:00 +01:00
If "-l" is given, make sure the target of the link exist.
This commit is contained in:
parent
a344274dcf
commit
00ef31d9b5
@ -26,7 +26,7 @@
|
||||
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: file.c,v 1.1 1997/01/30 21:43:39 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -40,6 +40,8 @@
|
||||
#include <sysexits.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include "fetch.h"
|
||||
@ -104,8 +106,10 @@ file_retrieve(struct fetch_state *fs)
|
||||
}
|
||||
|
||||
if (fs->fs_linkfile) {
|
||||
struct stat sb;
|
||||
fs->fs_status = "symlink";
|
||||
if (symlink(fs->fs_proto, fs->fs_outputfile) == -1) {
|
||||
if (stat(fs->fs_proto, &sb) == -1
|
||||
|| symlink(fs->fs_proto, fs->fs_outputfile) == -1) {
|
||||
warn("symlink");
|
||||
return EX_OSERR;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user