projects
/
debian
/
tar
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 1.24
[debian/tar]
/
gnu
/
save-cwd.c
diff --git
a/gnu/save-cwd.c
b/gnu/save-cwd.c
index 6cb3c36bbe8dc7b71d01d42f8ade5652b93f59af..c6b6342999119818cdd84ccc43294f81039193f3 100644
(file)
--- a/
gnu/save-cwd.c
+++ b/
gnu/save-cwd.c
@@
-33,6
+33,7
@@
#include "chdir-long.h"
#include "unistd--.h"
#include "xgetcwd.h"
#include "chdir-long.h"
#include "unistd--.h"
#include "xgetcwd.h"
+#include "cloexec.h"
#if GNULIB_FCNTL_SAFER
# include "fcntl--.h"
#if GNULIB_FCNTL_SAFER
# include "fcntl--.h"
@@
-77,7
+78,7
@@
save_cwd (struct saved_cwd *cwd)
{
cwd->name = NULL;
{
cwd->name = NULL;
- cwd->desc = open (".", O_
RDONLY
);
+ cwd->desc = open (".", O_
SEARCH
);
if (!GNULIB_FCNTL_SAFER)
cwd->desc = fd_safer (cwd->desc);
if (cwd->desc < 0)
if (!GNULIB_FCNTL_SAFER)
cwd->desc = fd_safer (cwd->desc);
if (cwd->desc < 0)
@@
-86,6
+87,7
@@
save_cwd (struct saved_cwd *cwd)
return cwd->name ? 0 : -1;
}
return cwd->name ? 0 : -1;
}
+ set_cloexec_flag (cwd->desc, true);
return 0;
}
return 0;
}