selinux/restorecond
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 restorecond: Add gitignore 2016-11-16 11:20:05 -05:00
COPYING Add COPYING files for new subdirs. 2016-11-16 11:19:51 -05:00
Makefile restorecond: Do not link against libpcre 2019-03-26 22:21:31 +01:00
VERSION Update VERSIONs to 3.0-rc1 for release. 2019-10-28 13:06:11 +01:00
org.selinux.Restorecond.service Move policycoreutils/restorecond to restorecond. 2016-11-16 11:19:50 -05:00
restore.c restorecond: Fix redundant console log output error 2019-11-15 08:12:16 -05:00
restore.h restorecond: break source dependency on policycoreutils/setfiles 2016-11-16 11:19:51 -05:00
restorecond.8 Move policycoreutils/restorecond to restorecond. 2016-11-16 11:19:50 -05:00
restorecond.c restorecond: use /run instead of /var/run 2019-03-18 22:07:08 +01:00
restorecond.conf restorecond: use /run instead of /var/run 2019-03-18 22:07:08 +01:00
restorecond.desktop Move policycoreutils/restorecond to restorecond. 2016-11-16 11:19:50 -05:00
restorecond.h restorecond: add noreturn attribute to exitApp() 2017-03-07 14:00:16 -05:00
restorecond.init restorecond: use /run instead of /var/run 2019-03-18 22:07:08 +01:00
restorecond.service Add documentation key in systemd .service files 2019-07-18 09:51:43 -05:00
restorecond_user.conf Move policycoreutils/restorecond to restorecond. 2016-11-16 11:19:50 -05:00
stringslist.c Move policycoreutils/restorecond to restorecond. 2016-11-16 11:19:50 -05:00
stringslist.h Move policycoreutils/restorecond to restorecond. 2016-11-16 11:19:50 -05:00
user.c Fix many misspellings 2019-09-18 22:47:35 +02:00
utmpwatcher.c restorecond: use /run instead of /var/run 2019-03-18 22:07:08 +01:00
utmpwatcher.h Move policycoreutils/restorecond to restorecond. 2016-11-16 11:19:50 -05:00
watch.c restorecond: Musl compatibility for GLOB_BRACE and GLOB_TILDE 2018-05-17 13:08:34 +08:00