diff --git a/cups-pdf.spec b/cups-pdf.spec index 5dd2a39..93117de 100644 --- a/cups-pdf.spec +++ b/cups-pdf.spec @@ -1,5 +1,6 @@ # Module SElinux -%define module cups_pdf +%define semodule cups_pdf +%define seversion %{version}.1 %if %{?fedora}%{?rhel} >= 5 %define usesel 1 @@ -12,12 +13,12 @@ Summary: Extension for creating pdf-Files with CUPS Summary(fr): Extension de CUPS pour créer des fichiers PDF Name: cups-pdf Version: 2.4.6 -Release: 5%{?dist} +Release: 6%{?dist} Group: Applications/Publishing Source0: http://www.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/src/%{name}_%{version}.tar.gz Source1: INSTALL.cups-pdf Source2: INSTALL.fedora.cups-pdf -Source3: %{module}.te +Source3: %{semodule}.te Patch1: cups-pdf-conf.patch Patch2: cups-pdf-desktop.patch URL: http://cip.physik.uni-wuerzburg.de/~vrbehr/cups-pdf/ @@ -92,9 +93,9 @@ popd # SElinux %{__mkdir} selinux pushd selinux -%{__sed} -e s/CUPSVERSION/%{version}/ %{SOURCE3} >%{module}.te -echo "%{CPOUT} system_u:object_r:print_spool_t:s0" >%{module}.fc -echo "%{CPSPOOL} system_u:object_r:print_spool_t:s0" >>%{module}.fc +%{__sed} -e s/CUPSVERSION/%{seversion}/ %{SOURCE3} >%{semodule}.te +echo "%{CPOUT} system_u:object_r:print_spool_t:s0" >%{semodule}.fc +echo "%{CPSPOOL} system_u:object_r:print_spool_t:s0" >>%{semodule}.fc make -f %{_datadir}/selinux/devel/Makefile popd %endif @@ -122,7 +123,7 @@ rm -rf %{buildroot} %if %{usesel} # SElinux %{__mkdir_p} %{buildroot}%{_datadir}/selinux/packages/%{name} -%{__install} -m644 selinux/%{module}.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/%{module}.pp +%{__install} -m644 selinux/%{semodule}.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/%{semodule}.pp %endif @@ -130,23 +131,10 @@ rm -rf %{buildroot} rm -rf %{buildroot} -%files -%defattr(-,root,root) -%doc ChangeLog COPYING README INSTALL INSTALL.fedora contrib/ -%dir %{CPSPOOL} -%dir %{CPOUT} -%attr(700, root, root) %{CPBACKEND}/cups-pdf -%config(noreplace) %{ETCCUPS}/cups-pdf.conf -%{_datadir}/cups/model/PostscriptColor.ppd -%if %{usesel} -%{_datadir}/selinux/packages/%{name}/%{module}.pp -%endif - - %post %if %{usesel} # Install/update Selinux policy -semodule -i %{_datadir}/selinux/packages/%{name}/%{module}.pp || : +semodule -i %{_datadir}/selinux/packages/%{name}/%{semodule}.pp || : fixfiles -R %{name} restore %endif @@ -173,12 +161,28 @@ if [ "$1" -eq "0" ]; then %if %{usesel} # Remove the SElinux policy. - semodule -r %{module} || : + semodule -r %{semodule} || : %endif fi +%files +%defattr(-,root,root) +%doc ChangeLog COPYING README INSTALL INSTALL.fedora contrib/ +%dir %{CPSPOOL} +%dir %{CPOUT} +%attr(700, root, root) %{CPBACKEND}/cups-pdf +%config(noreplace) %{ETCCUPS}/cups-pdf.conf +%{_datadir}/cups/model/PostscriptColor.ppd +%if %{usesel} +%{_datadir}/selinux/packages/%{name}/%{semodule}.pp +%endif + + %changelog +* Tue Dec 04 2007 Remi Collet 2.4.6-6 +- handle unconfined_home_dir_t and unconfined_home_t + * Thu Nov 29 2007 Remi Collet 2.4.6-5 - update default conf: use ${DESKTOP} diff --git a/cups_pdf.te b/cups_pdf.te index 47a7109..3f13c2f 100644 --- a/cups_pdf.te +++ b/cups_pdf.te @@ -9,9 +9,17 @@ require { type user_home_dir_t; type user_home_t; type print_spool_t; + type unconfined_home_dir_t; + type unconfined_home_t; } allow cupsd_t home_root_t:dir { getattr search }; + allow cupsd_t user_home_dir_t:dir { getattr search }; allow cupsd_t user_home_t:dir { add_name create getattr remove_name search setattr write }; allow cupsd_t user_home_t:file { create getattr read setattr unlink write }; + +allow cupsd_t unconfined_home_dir_t:dir { getattr search }; +allow cupsd_t unconfined_home_t:dir { add_name create getattr remove_name search setattr write }; +allow cupsd_t unconfined_home_t:file { create getattr read setattr unlink write }; +