summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--bootstrap.conf1
-rw-r--r--lib/.gitignore1
-rw-r--r--sed/execute.c5
4 files changed, 7 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 276baed..cf150a8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,7 +2,7 @@
*.exe
*.o
*/.deps/
-*~
+**~
+*
/gnulib-tests/*
!/gnulib-tests/Makefile.am
diff --git a/bootstrap.conf b/bootstrap.conf
index 5253703..3da90f4 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -33,6 +33,7 @@ getopt
gettext-h
git-version-gen
gitlog-to-changelog
+ignore-value
localcharset
manywarnings
mbrlen
diff --git a/lib/.gitignore b/lib/.gitignore
index 95015bc..5920eb0 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -208,3 +208,4 @@ xstrndup.c
xstrndup.h
/progname.c
/progname.h
+/ignore-value.h
diff --git a/sed/execute.c b/sed/execute.c
index 7fe8bab..fa6fe1d 100644
--- a/sed/execute.c
+++ b/sed/execute.c
@@ -37,6 +37,7 @@
#include <selinux/selinux.h>
#include <selinux/context.h>
#include "acl.h"
+#include "ignore-value.h"
#ifdef __GNUC__
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__-0 >= 7)
@@ -645,8 +646,10 @@ closedown(struct input *input)
input_fd = fileno (input->fp);
output_fd = fileno (output_file.fp);
#ifdef HAVE_FCHOWN
+ /* Try to set both UID and GID, but if that fails,
+ try to set only the GID. Ignore failure. */
if (fchown (output_fd, input->st.st_uid, input->st.st_gid) == -1)
- fchown (output_fd, -1, input->st.st_gid);
+ ignore_value (fchown (output_fd, -1, input->st.st_gid));
#endif
copy_acl (input->in_file_name, input_fd,
input->out_file_name, output_fd,