7b79ae
#! /bin/bash -f
7b79ae
7b79ae
## A counterpart of brp-kmod-set-exec-bits that restores original kmod
7b79ae
## file permissions
7b79ae
7b79ae
# If using normal root, avoid changing anything.
7b79ae
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] || exit 0
7b79ae
7b79ae
# Checking for required programs
7b79ae
which chmod >/dev/null || exit 0
7b79ae
7b79ae
[ -r "$RPM_BUILD_ROOT/kmod-permissions.list" ] || exit 0
7b79ae
7b79ae
while read perm path; do
7b79ae
	[ -n "$perm" ] || continue
7b79ae
7b79ae
	chmod "$perm" "$RPM_BUILD_ROOT/$path"
7b79ae
done < "$RPM_BUILD_ROOT/kmod-permissions.list"
7b79ae
7b79ae
rm -f "$RPM_BUILD_ROOT/kmod-permissions.list"