From d8104265f229ababd5a68a46eeccbccc07e72cdc Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 28 Nov 2016 16:21:42 +0100 Subject: install,mkdir: fix handling of -DZ and -pZ, respectively ... in the case where two or more directories nested in each other are created and each of them defaults to a different SELinux context. * src/install.c (make_ancestor): When calling defaultcon(), give it the same path that is given to mkdir(). The other path is not always valid wrt. current working directory. * src/mkdir.c (make_ancestor): Likewise. * NEWS: Mention the bug fix. Reported at https://bugzilla.redhat.com/1398913 --- src/install.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/install.c') 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)); -- cgit v1.2.3-70-g09d2