Without details on what is failing, who knows, as some of the verifications will always fail and can never be fixed, if for example /etc/aliases
has been modified to point root
mail elsewhere:
% rpm -qf /etc/aliases
setup-2.8.14-20.el6_4.1.noarch
% rpm -V setup
S.5....T. c /etc/aliases
%
In this case the file size differs (which a --setperms
would do nothing to fix), the digest differs (again, --setperms
is unrelated), and the mtime differs, which yet again --setperms
will not do anything for.
However, permissions certainly can be broken and fixed with --setperms
.
% sudo chmod 7001 /etc/aliases
% ls -l /etc/aliases
---S--S--t. 1 root root 1542 Aug 1 2014 /etc/aliases
% rpm -V setup
SM?....T. c /etc/aliases
% sudo rpm --setperms setup
% rpm -V setup
S.5....T. c /etc/aliases
% ls -l /etc/aliases
-rw-r--r--. 1 root root 1542 Aug 1 2014 /etc/aliases
%
Note the second column for "mode", and how the digest check failed given that the permissions were pooched.
(A wrapper around rpm -V
might be handy, to verbosify this quite cryptic output...)