summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--src/install.c2
-rw-r--r--src/mkdir.c2
3 files changed, 6 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 6f7505f82..e88e93214 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,10 @@ GNU coreutils NEWS -*- outline -*-
factor again outputs immediately when numbers are input interactively.
[bug introduced in coreutils-8.24]
+ install -DZ and mkdir -pZ now set default SELinux context correctly even if
+ two or more directories nested in each other are created and each of them
+ defaults to a different SELinux context.
+
ls --time-style no longer mishandles '%%b' in formats.
[bug introduced in coreutils-7.2]
diff --git a/src/install.c b/src/install.c
index 414d645cc..d79d59789 100644
--- a/src/install.c
+++ b/src/install.c
@@ -427,7 +427,7 @@ static int
make_ancestor (char const *dir, char const *component, void *options)
{
struct cp_options const *x = options;
- if (x->set_security_context && defaultcon (dir, S_IFDIR) < 0
+ if (x->set_security_context && defaultcon (component, S_IFDIR) < 0
&& ! ignorable_ctx_err (errno))
error (0, errno, _("failed to set default creation context for %s"),
quoteaf (dir));
diff --git a/src/mkdir.c b/src/mkdir.c
index ccd923b1c..6b51292fa 100644
--- a/src/mkdir.c
+++ b/src/mkdir.c
@@ -123,7 +123,7 @@ make_ancestor (char const *dir, char const *component, void *options)
{
struct mkdir_options const *o = options;
- if (o->set_security_context && defaultcon (dir, S_IFDIR) < 0
+ if (o->set_security_context && defaultcon (component, S_IFDIR) < 0
&& ! ignorable_ctx_err (errno))
error (0, errno, _("failed to set default creation context for %s"),
quoteaf (dir));