policycoreutils: setfiles: do not syslog if no changes

Basically this change stops sysloging if the change did not actually
happen.

By default we do not modify a label if the type of the SELinug context
was unchanged, but we were sending a syslog message as if something had
changed.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
Dan Walsh 2012-01-30 16:21:32 -05:00 committed by Eric Paris
parent 69d418551e
commit 687ff489e6

View file

@ -221,7 +221,7 @@ static int restore(FTSENT *ftsent)
r_opts->progname, my_file, curcon ?: "", newcon);
}
if (r_opts->logging) {
if (r_opts->logging && r_opts->change) {
if (curcon)
syslog(LOG_INFO, "relabeling %s from %s to %s\n",
my_file, curcon, newcon);