freedomboneeee/tests/check-libs-owner.sh

43 lines
750 B
Bash
Raw Normal View History

#!/bin/bash
if [ -d "/lib" ];then
2018-01-07 12:22:47 +01:00
COUNT=$(find -L /lib \! -user root -exec ls -l {} \; | grep -v '> /dev/null' | wc -l)
if [ $COUNT -eq 0 ];then
:
else
exit 1
fi
fi
if [ -d "/lib64" ];then
2018-01-07 12:22:47 +01:00
COUNT=$(find -L /lib64 \! -user root -exec ls -l {} \; |wc -l)
2018-01-07 12:22:47 +01:00
if [ $COUNT -eq 0 ];then
:
else
exit 1
fi
fi
if [ -d "/usr/lib" ];then
2018-01-25 11:56:30 +01:00
COUNT=$(find -L /usr/lib -path /usr/lib/prosody -prune -o \! -user root -exec ls -l {} \; |wc -l)
2018-01-07 12:22:47 +01:00
if [ $COUNT -eq 0 ];then
:
else
exit 1
fi
fi
if [ -d "/usr/lib64" ];then
2018-01-07 12:22:47 +01:00
COUNT=$(find -L /usr/lib64 \! -user root -exec ls -l {} \; |wc -l)
2018-01-07 12:22:47 +01:00
if [ $COUNT -eq 0 ];then
:
else
exit 1
fi
fi