ref: refs/heads/master
commit f532a1964bfb867fdaf8332b1dae720c3f3a7023
Author: Josef Reidinger
Date: Mon Nov 30 10:53:35 2009 +0100
don't pass if granting permissions fail (bnc#554946)
---
.../package/yast2-webservice-administrator.spec | 4 ++--
.../package/yast2-webservice-language.spec | 2 +-
.../package/yast2-webservice-mailsettings.spec | 4 ++--
.../network/package/yast2-webservice-network.spec | 4 ++--
plugins/ntp/package/yast2-webservice-ntp.spec | 3 +++
.../patches/package/yast2-webservice-patches.spec | 2 +-
.../package/yast2-webservice-registration.spec | 2 +-
.../package/yast2-webservice-samba-server.spec | 12 ++----------
.../package/yast2-webservice-security.spec | 2 +-
.../package/yast2-webservice-services.spec | 6 +++---
.../status/package/yast2-webservice-status.spec | 2 +-
.../system/package/yast2-webservice-system.spec | 1 +
plugins/time/package/yast2-webservice-time.spec | 4 ++--
plugins/users/package/yast2-webservice-users.spec | 2 +-
14 files changed, 23 insertions(+), 27 deletions(-)
diff --git a/plugins/administrator/package/yast2-webservice-administrator.spec b/plugins/administrator/package/yast2-webservice-administrator.spec
index 9a67356..e264cda 100644
--- a/plugins/administrator/package/yast2-webservice-administrator.spec
+++ b/plugins/administrator/package/yast2-webservice-administrator.spec
@@ -75,8 +75,8 @@ rm -rf $RPM_BUILD_ROOT
%post
# granting all permissions for the web user
-/usr/sbin/grantwebyastrights --user root --action grant >& /dev/null || :
-/usr/sbin/grantwebyastrights --user yastws --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
+/usr/sbin/grantwebyastrights --user yastws --action grant > /dev/null
%postun
diff --git a/plugins/language/package/yast2-webservice-language.spec b/plugins/language/package/yast2-webservice-language.spec
index bdcaafe..9ed6491 100644
--- a/plugins/language/package/yast2-webservice-language.spec
+++ b/plugins/language/package/yast2-webservice-language.spec
@@ -73,7 +73,7 @@ rm -rf $RPM_BUILD_ROOT
#
# granting all permissions for root
#
-/usr/sbin/grantwebyastrights --user root --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
%files
%defattr(-,root,root)
diff --git a/plugins/mail_settings/package/yast2-webservice-mailsettings.spec b/plugins/mail_settings/package/yast2-webservice-mailsettings.spec
index 09492f2..66bbf02 100644
--- a/plugins/mail_settings/package/yast2-webservice-mailsettings.spec
+++ b/plugins/mail_settings/package/yast2-webservice-mailsettings.spec
@@ -89,8 +89,8 @@ rm -rf $RPM_BUILD_ROOT
%post
# granting all permissions for the web user
-/usr/sbin/grantwebyastrights --user root --action grant >& /dev/null || :
-/usr/sbin/grantwebyastrights --user yastws --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
+/usr/sbin/grantwebyastrights --user yastws --action grant > /dev/null
%postun
diff --git a/plugins/network/package/yast2-webservice-network.spec b/plugins/network/package/yast2-webservice-network.spec
index 3f705d8..c698f45 100644
--- a/plugins/network/package/yast2-webservice-network.spec
+++ b/plugins/network/package/yast2-webservice-network.spec
@@ -74,9 +74,9 @@ rm -rf $RPM_BUILD_ROOT
#
# granting all permissions for root
#
-/usr/sbin/grantwebyastrights --user root --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
# and for yastws
-/usr/sbin/grantwebyastrights --user %{pkg_user} --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user %{pkg_user} --action grant > /dev/null
%files
%defattr(-,root,root)
diff --git a/plugins/ntp/package/yast2-webservice-ntp.spec b/plugins/ntp/package/yast2-webservice-ntp.spec
index c1920fe..ba25c72 100644
--- a/plugins/ntp/package/yast2-webservice-ntp.spec
+++ b/plugins/ntp/package/yast2-webservice-ntp.spec
@@ -71,6 +71,9 @@ cp %{SOURCE2} $RPM_BUILD_ROOT/usr/share/PolicyKit/policy/
rm -rf $RPM_BUILD_ROOT
%post
+# granting all permissions for the web user
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
+/usr/sbin/grantwebyastrights --user yastws --action grant > /dev/null
%postun
diff --git a/plugins/patches/package/yast2-webservice-patches.spec b/plugins/patches/package/yast2-webservice-patches.spec
index 96912b4..e41c3bb 100644
--- a/plugins/patches/package/yast2-webservice-patches.spec
+++ b/plugins/patches/package/yast2-webservice-patches.spec
@@ -64,7 +64,7 @@ rm -rf $RPM_BUILD_ROOT
#
# granting all permissions for root
#
-/usr/sbin/grantwebyastrights --user root --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
%files
%defattr(-,root,root)
diff --git a/plugins/registration/package/yast2-webservice-registration.spec b/plugins/registration/package/yast2-webservice-registration.spec
index 6e320aa..1d46400 100644
--- a/plugins/registration/package/yast2-webservice-registration.spec
+++ b/plugins/registration/package/yast2-webservice-registration.spec
@@ -66,7 +66,7 @@ rm -rf $RPM_BUILD_ROOT
#
# granting all permissions for root
#
-/usr/sbin/grantwebyastrights --user root --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
%files
%defattr(-,root,root)
diff --git a/plugins/samba_server/package/yast2-webservice-samba-server.spec b/plugins/samba_server/package/yast2-webservice-samba-server.spec
index 874eacf..78bbd9a 100644
--- a/plugins/samba_server/package/yast2-webservice-samba-server.spec
+++ b/plugins/samba_server/package/yast2-webservice-samba-server.spec
@@ -57,18 +57,10 @@ rm -rf $RPM_BUILD_ROOT
%post
# grant the needed privileges to the server user
-/usr/bin/polkit-auth --user %{pkg_user} --grant org.opensuse.yast.modules.yapi.samba.getalldirectories >& /dev/null || :
-/usr/bin/polkit-auth --user %{pkg_user} --grant org.opensuse.yast.modules.yapi.samba.addshare >& /dev/null || :
-/usr/bin/polkit-auth --user %{pkg_user} --grant org.opensuse.yast.modules.yapi.samba.editshare >& /dev/null || :
-/usr/bin/polkit-auth --user %{pkg_user} --grant org.opensuse.yast.modules.yapi.samba.deleteshare >& /dev/null || :
-/usr/bin/polkit-auth --user %{pkg_user} --grant org.opensuse.yast.modules.yapi.samba.getshare >& /dev/null || :
+/usr/sbin/grantwebyastrights --user yastws --action grant > /dev/null
# grant the needed privileges to root
-/usr/bin/polkit-auth --user root --grant org.opensuse.yast.modules.yapi.samba.getalldirectories >& /dev/null || :
-/usr/bin/polkit-auth --user root --grant org.opensuse.yast.modules.yapi.samba.addshare >& /dev/null || :
-/usr/bin/polkit-auth --user root --grant org.opensuse.yast.modules.yapi.samba.editshare >& /dev/null || :
-/usr/bin/polkit-auth --user root --grant org.opensuse.yast.modules.yapi.samba.deleteshare >& /dev/null || :
-/usr/bin/polkit-auth --user root --grant org.opensuse.yast.modules.yapi.samba.getshare >& /dev/null || :
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
%files
%defattr(-,root,root)
diff --git a/plugins/securities/package/yast2-webservice-security.spec b/plugins/securities/package/yast2-webservice-security.spec
index c2627f9..7876f00 100644
--- a/plugins/securities/package/yast2-webservice-security.spec
+++ b/plugins/securities/package/yast2-webservice-security.spec
@@ -60,7 +60,7 @@ rm -rf $RPM_BUILD_ROOT
#
# granting all permissions for root
#
-/usr/sbin/grantwebyastrights --user root --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
%files
%defattr(-,root,root)
diff --git a/plugins/services/package/yast2-webservice-services.spec b/plugins/services/package/yast2-webservice-services.spec
index 3af420c..403c7bc 100644
--- a/plugins/services/package/yast2-webservice-services.spec
+++ b/plugins/services/package/yast2-webservice-services.spec
@@ -19,7 +19,7 @@ Release: 0
Summary: YaST2 - Webservice - Services
Source: www.tar.bz2
Source1: org.opensuse.yast.modules.yapi.services.policy
-Source2: YML.rb
+Source2: YML.rb
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
BuildRequires: rubygem-yast2-webservice-tasks rubygem-restility
@@ -88,8 +88,8 @@ rm -rf $RPM_BUILD_ROOT
#
# granting all permissions for root
#
-/usr/sbin/grantwebyastrights --user root --action grant >& /dev/null || :
-/usr/sbin/grantwebyastrights --user yastws --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
+/usr/sbin/grantwebyastrights --user yastws --action grant > /dev/null
%files
%defattr(-,root,root)
diff --git a/plugins/status/package/yast2-webservice-status.spec b/plugins/status/package/yast2-webservice-status.spec
index a78e8d2..fb1e1dc 100644
--- a/plugins/status/package/yast2-webservice-status.spec
+++ b/plugins/status/package/yast2-webservice-status.spec
@@ -76,7 +76,7 @@ rm -rf $RPM_BUILD_ROOT
#
# granting all permissions for root
#
-/usr/sbin/grantwebyastrights --user root --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
#
# nslookup of static hostnames can result to an error. Due this error collectd
diff --git a/plugins/system/package/yast2-webservice-system.spec b/plugins/system/package/yast2-webservice-system.spec
index eb83c11..d1b31c6 100644
--- a/plugins/system/package/yast2-webservice-system.spec
+++ b/plugins/system/package/yast2-webservice-system.spec
@@ -65,6 +65,7 @@ rm -rf $RPM_BUILD_ROOT
%post
# granting all permissions for the web user
+#FIXME don't silently fail
polkit-auth --user %{pkg_user} --grant org.freedesktop.hal.power-management.shutdown >& /dev/null || true
polkit-auth --user %{pkg_user} --grant org.freedesktop.hal.power-management.shutdown-multiple-sessions >& /dev/null || true
polkit-auth --user %{pkg_user} --grant org.freedesktop.hal.power-management.reboot >& /dev/null || true
diff --git a/plugins/time/package/yast2-webservice-time.spec b/plugins/time/package/yast2-webservice-time.spec
index 2738aa8..dca7790 100644
--- a/plugins/time/package/yast2-webservice-time.spec
+++ b/plugins/time/package/yast2-webservice-time.spec
@@ -66,9 +66,9 @@ rm -rf $RPM_BUILD_ROOT
#
# granting all permissions for root
#
-/usr/sbin/grantwebyastrights --user root --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
# XXX not nice to get yastws all permissions, but now not better solution
-/usr/sbin/grantwebyastrights --user yastws --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user yastws --action grant > /dev/null
%files
%defattr(-,root,root)
diff --git a/plugins/users/package/yast2-webservice-users.spec b/plugins/users/package/yast2-webservice-users.spec
index 6231d57..d494b2f 100644
--- a/plugins/users/package/yast2-webservice-users.spec
+++ b/plugins/users/package/yast2-webservice-users.spec
@@ -59,7 +59,7 @@ rm -rf $RPM_BUILD_ROOT
#
# granting all permissions for root
#
-/usr/sbin/grantwebyastrights --user root --action grant >& /dev/null || :
+/usr/sbin/grantwebyastrights --user root --action grant > /dev/null
%files
%defattr(-,root,root)
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org