Blame SOURCES/sed-selinux.patch

9512b1
diff --git a/NEWS b/NEWS
9512b1
index e9335f0..e762b2d 100644
9512b1
--- a/NEWS
9512b1
+++ b/NEWS
9512b1
@@ -1,4 +1,9 @@ GNU sed NEWS                                    -*- outline -*-
9512b1
 GNU sed NEWS                                    -*- outline -*-
9512b1
+ 
9512b1
+  sed -i now creates selinux context based on the context of the symlink
9512b1
+  instead of the symlink target. [Bug present since at least sed-4.2]
9512b1
+  sed -i --follow-symlinks remains unchanged.
9512b1
+
9512b1
 
9512b1
 * Noteworthy changes in release 4.4 (2017-02-03) [stable]
9512b1
 
9512b1
diff --git a/sed/execute.c b/sed/execute.c
9512b1
index 1843392..453886e 100644
9512b1
--- a/sed/execute.c
9512b1
+++ b/sed/execute.c
9512b1
@@ -607,7 +607,7 @@ open_next_file(const char *name, struct input *input)
9512b1
       if (is_selinux_enabled () > 0)
9512b1
         {
9512b1
           security_context_t con;
9512b1
-          if (getfilecon (input->in_file_name, &con) != -1)
9512b1
+          if (lgetfilecon (input->in_file_name, &con) != -1)
9512b1
             {
9512b1
               /* Save and restore the old context for the sake of w and W
9512b1
                  commands.  */
9512b1
2.9.5
9512b1