xref: /openbmc/openbmc/meta-security/recipes-security/redhat-security/files/lib-bin-check.sh (revision eb8dc40360f0cfef56fb6947cc817a547d6d9bc6)
1#!/bin/sh
2
3# This software may be freely redistributed under the terms of the GNU
4# public license.
5#
6# You should have received a copy of the GNU General Public License
7# along with this program; if not, write to the Free Software
8# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
9
10found=0
11list=`rpm -qa --queryformat "%{NAME}-%{VERSION}.%{ARCH}\n" | grep '^lib' | egrep -v '\-utils\-|\-bin\-|\-tools\-|\-client\-|libreoffice|\-plugin\-'`
12for p in $list
13do
14	bin=`rpm -ql $p  | egrep '^/bin|^/sbin|^/usr/bin|^/usr/sbin' | grep -v '\-config'`
15	if [ "x$bin" != "x" ]; then
16		testf=`echo $bin | /usr/bin/file -n -f - 2>/dev/null | grep ELF`
17		if [ x"$testf" != "x" ] ; then
18			found=1
19			echo "$p could be split into a utils package"
20		fi
21	fi
22done
23
24if [ $found = 0 ]; then
25	echo "No problems found"
26	exit 0
27fi
28
29exit 1
30
31
32