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