2017-03-11 18:43:42 +03:00
Summary : An app that has non-root files and caps
2017-01-06 17:52:57 +03:00
Name : nonrootcap
Version : 1.0
Release : 1
License : GPL+
Group : Development/Tools
URL : http://foo.bar.com
BuildArch : x86_64
%description
%{summary}
%prep
%build
cat > tmp << EOF
#!/bin/sh
echo " H e l l o ! "
EOF
chmod a+x tmp
2017-03-11 18:43:42 +03:00
echo nrc.conf > nrc.conf
2017-01-06 17:52:57 +03:00
cp tmp nrc-none.sh
cp tmp nrc-user.sh
cp tmp nrc-group.sh
cp tmp nrc-caps.sh
cp tmp nrc-caps-setuid.sh
cp tmp nrc-usergroup.sh
cp tmp nrc-usergroupcaps.sh
cp tmp nrc-usergroupcaps-setuid.sh
rm tmp
%pre
groupadd -r nrcgroup
useradd -r nrcuser -g nrcgroup -s /sbin/nologin
%install
2017-03-11 18:43:42 +03:00
install -D nrc.conf %{buildroot} /etc/nrc.conf
2017-03-17 16:46:13 +03:00
ln -sr %{buildroot} /etc/nrc.conf %{buildroot} /etc/nrc-link.conf
2017-01-06 17:52:57 +03:00
mkdir -p %{buildroot} /usr/bin
install *.sh %{buildroot} /usr/bin
2017-03-17 16:46:13 +03:00
ln -sr %{buildroot} /usr/bin/{nrc-user.sh,nrc-user-link.sh}
2017-01-06 17:52:57 +03:00
mkdir -p %{buildroot} /var/lib/nonrootcap
mkdir -p %{buildroot} /run/nonrootcap
2017-02-13 19:32:19 +03:00
mkdir -p %{buildroot} /var/lib/nonrootcap-rootowned
mkdir -p %{buildroot} /run/nonrootcap-rootowned
2017-01-06 17:52:57 +03:00
%clean
rm -rf %{buildroot}
%files
/usr/bin/nrc-none.sh
2017-03-11 18:43:42 +03:00
%attr (-, nrcuser, -) /etc/nrc.conf
2017-03-17 16:46:13 +03:00
%attr (-, nrcuser, -) /etc/nrc-link.conf
2017-01-06 17:52:57 +03:00
%attr (-, nrcuser, -) /usr/bin/nrc-user.sh
2017-03-17 16:46:13 +03:00
%attr (-, nrcuser, -) /usr/bin/nrc-user-link.sh
2017-01-06 17:52:57 +03:00
%attr (-, -, nrcgroup) /usr/bin/nrc-group.sh
%caps(cap_net_bind_service=ep) /usr/bin/nrc-caps.sh
%attr (4775, -, -) %caps(cap_net_bind_service=ep) /usr/bin/nrc-caps-setuid.sh
%attr (-, nrcuser, nrcgroup) /usr/bin/nrc-usergroup.sh
%attr (-, nrcuser, nrcgroup) %caps(cap_net_bind_service=ep) /usr/bin/nrc-usergroupcaps.sh
%attr (4775, nrcuser, nrcgroup) %caps(cap_net_bind_service=ep) /usr/bin/nrc-usergroupcaps-setuid.sh
%attr (-, nrcuser, nrcgroup) /var/lib/nonrootcap
%attr (-, nrcuser, nrcgroup) /run/nonrootcap
2017-02-13 19:32:19 +03:00
/var/lib/nonrootcap-rootowned
/run/nonrootcap-rootowned
2017-01-06 17:52:57 +03:00
%changelog
* Wed Jan 05 2017 Jonathan Lebon <jlebon@redhat.com> 1.0-1
- First Build