platform_external_selinux/policycoreutils/setfiles
Baichuan Kong ad2208ec22 restorecond: Fix redundant console log output error
When starting restorecond without any option the following redundant
console log is outputed:

/dev/log 100.0%
/var/volatile/run/syslogd.pid 100.0%
...

This is caused by two global variables of same name r_opts. When
executes r_opts = opts in restore_init(), it originally intends
to assign the address of struct r_opts in "restorecond.c" to the
pointer *r_opts in "restore.c".

However, the address is assigned to the struct r_opts and covers
the value of low eight bytes in it. That causes unexpected value
of member varibale 'nochange' and 'verbose' in struct r_opts, thus
affects value of 'restorecon_flags' and executes unexpected operations
when restorecon the files such as the redundant console log output or
file label nochange.

Cause restorecond/restore.c is copied from policycoreutils/setfiles,
which share the same pattern. It also has potential risk to generate
same problems, So fix it in case.

Signed-off-by: Baichuan Kong <kongbaichuan@huawei.com>
2019-11-15 08:12:16 -05:00
..
ru Add man pages translation by Olesya Gerasimenko 2019-01-28 12:03:57 +01:00
.gitignore setfiles: Fix setfiles progress indicator 2017-01-27 09:39:22 -05:00
Makefile Allow installing translated man pages 2019-01-28 12:03:57 +01:00
restore.c restorecond: Fix redundant console log output error 2019-11-15 08:12:16 -05:00
restore.h setfiles: Fix setfiles progress indicator 2017-01-27 09:39:22 -05:00
restorecon.8 setfiles: Update utilities for the new digest scheme 2019-07-27 10:39:24 +02:00
restorecon_xattr.8 setfiles: Update utilities for the new digest scheme 2019-07-27 10:39:24 +02:00
restorecon_xattr.c setfiles: Update utilities for the new digest scheme 2019-07-27 10:39:24 +02:00
setfiles.8 setfiles: Update utilities for the new digest scheme 2019-07-27 10:39:24 +02:00
setfiles.c policycoreutils/setfiles: don't scramble stdout and stderr together 2017-03-28 13:41:18 -04:00