summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-04-11 20:06:34 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-04-11 20:06:34 +0000
commit0b8c662cf29f330c8e05f6919b85bbd6d9907695 (patch)
tree5b6446251d9575214b2f562108a6e6a558642c90 /src
parentfd48557688887639cadfa7cc7c2fa06451b0ca48 (diff)
downloadcoreutils-0b8c662cf29f330c8e05f6919b85bbd6d9907695.tar.xz
Include unistd-safer.h.
(copy_reg): Use fd_safer.
Diffstat (limited to 'src')
-rw-r--r--src/copy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/copy.c b/src/copy.c
index 77bc69aa8..9f9856aa9 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -41,6 +41,7 @@
#include "quote.h"
#include "same.h"
#include "savedir.h"
+#include "unistd-safer.h"
#include "utimecmp.h"
#include "utimens.h"
#include "xreadlink.h"
@@ -216,6 +217,7 @@ copy_reg (const char *src_path, const char *dst_path,
bool make_holes = false;
source_desc = open (src_path, O_RDONLY);
+ source_desc = fd_safer (source_desc);
if (source_desc < 0)
{
error (0, errno, _("cannot open %s for reading"), quote (src_path));
@@ -267,6 +269,7 @@ copy_reg (const char *src_path, const char *dst_path,
}
}
+ dest_desc = fd_safer (dest_desc);
if (dest_desc < 0)
{
error (0, errno, _("cannot create regular file %s"), quote (dst_path));