mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
o print the context along with the path when setting selinux context
This commit is contained in:
parent
30202196f0
commit
c71d140252
@ -22,7 +22,6 @@ int set_selinux_context(const char *path)
|
||||
{
|
||||
security_context_t scontext;
|
||||
|
||||
log_very_verbose("Setting SELinux context for %s", path);
|
||||
if (is_selinux_enabled() <= 0)
|
||||
return 1;
|
||||
|
||||
@ -31,6 +30,9 @@ int set_selinux_context(const char *path)
|
||||
return 0;
|
||||
}
|
||||
|
||||
log_very_verbose("Setting SELinux context for %s to %s",
|
||||
path, scontext);
|
||||
|
||||
if ((lsetfilecon(path, scontext) < 0) && (errno != ENOTSUP)) {
|
||||
log_sys_error("lsetfilecon", path);
|
||||
free(scontext);
|
||||
|
@ -204,7 +204,6 @@ int set_selinux_context(const char *path)
|
||||
{
|
||||
security_context_t scontext;
|
||||
|
||||
log_debug("Setting SELinux context for %s", path);
|
||||
if (is_selinux_enabled() <= 0)
|
||||
return 1;
|
||||
|
||||
@ -213,6 +212,8 @@ int set_selinux_context(const char *path)
|
||||
return 0;
|
||||
}
|
||||
|
||||
log_debug("Setting SELinux context for %s to %s", path, scontext);
|
||||
|
||||
if ((lsetfilecon(path, scontext) < 0) && (errno != ENOTSUP)) {
|
||||
log_error("%s: lsetfilecon failed: %s", path, strerror(errno));
|
||||
free(scontext);
|
||||
|
Loading…
Reference in New Issue
Block a user