[PackageKit-commit] packagekit: Branch 'master' - 3 commits

Richard Hughes hughsient at kemper.freedesktop.org
Mon Jun 22 12:07:56 PDT 2009


 src/pk-transaction.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 3297f4684d68eb7f16caebac883808a03150644c
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Jun 22 12:19:30 2009 +0100

    If the allow_untrusted role is not known, fall back to the trusted role

diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 18bd73b..8286544 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -1657,7 +1657,7 @@ pk_transaction_role_to_action_allow_untrusted (PkRoleEnum role)
 			policy = "org.freedesktop.packagekit.package-install-untrusted";
 			break;
 		default:
-			break;
+			policy = pk_transaction_role_to_action_only_trusted (role);
 	}
 	return policy;
 }
commit 18c29041e9b598cad51b70c2bac811e5bf879838
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Jun 22 12:18:04 2009 +0100

    Trivially rename a couple of functions to make the trusted stuff clearer

diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 2d1877e..18bd73b 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -1595,10 +1595,10 @@ out:
 }
 
 /**
- * pk_transaction_role_to_action:
+ * pk_transaction_role_to_action_only_trusted:
  **/
 static const gchar *
-pk_transaction_role_to_action (PkRoleEnum role)
+pk_transaction_role_to_action_only_trusted (PkRoleEnum role)
 {
 	const gchar *policy = NULL;
 
@@ -1642,10 +1642,10 @@ pk_transaction_role_to_action (PkRoleEnum role)
 }
 
 /**
- * pk_transaction_role_to_action_untrusted:
+ * pk_transaction_role_to_action_allow_untrusted:
  **/
 static const gchar *
-pk_transaction_role_to_action_untrusted (PkRoleEnum role)
+pk_transaction_role_to_action_allow_untrusted (PkRoleEnum role)
 {
 	const gchar *policy = NULL;
 
@@ -1690,9 +1690,9 @@ pk_transaction_obtain_authorization (PkTransaction *transaction, gboolean only_t
 
 	/* map the roles to policykit rules */
 	if (only_trusted)
-		action_id = pk_transaction_role_to_action (role);
+		action_id = pk_transaction_role_to_action_only_trusted (role);
 	else
-		action_id = pk_transaction_role_to_action_untrusted (role);
+		action_id = pk_transaction_role_to_action_allow_untrusted (role);
 	if (action_id == NULL) {
 		*error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_REFUSED_BY_POLICY, "policykit type required for '%s'", pk_role_enum_to_text (role));
 		goto out;
commit 62d2f529d087ad77b2562597d761f258d1913042
Author: Richard Hughes <richard at hughsie.com>
Date:   Mon Jun 22 11:53:39 2009 +0100

    Add a missing role for an untrusted action

diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 584a8ba..2d1877e 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -1650,9 +1650,10 @@ pk_transaction_role_to_action_untrusted (PkRoleEnum role)
 	const gchar *policy = NULL;
 
 	switch (role) {
+		case PK_ROLE_ENUM_INSTALL_PACKAGES:
+		case PK_ROLE_ENUM_INSTALL_FILES:
 		case PK_ROLE_ENUM_UPDATE_PACKAGES:
 		case PK_ROLE_ENUM_UPDATE_SYSTEM:
-		case PK_ROLE_ENUM_INSTALL_FILES:
 			policy = "org.freedesktop.packagekit.package-install-untrusted";
 			break;
 		default:


More information about the PackageKit-commit mailing list