diff options
author | Havoc Pennington <hp@redhat.com> | 2003-04-13 08:33:10 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-04-13 08:33:10 +0000 |
commit | 8aabca8dd28a113712389be51e75ea8c2fd17838 (patch) | |
tree | bd16d89beab87b7c20354b47e0698e9be06176fe /bus/policy.h | |
parent | b09b7ca33cbaa7eae4f56b9cd699c8d0283dd754 (diff) | |
download | dbus-8aabca8dd28a113712389be51e75ea8c2fd17838.tar.gz |
2003-04-13 Havoc Pennington <hp@pobox.com>
* bus/config-parser.c: Load up the BusPolicy and BusPolicyRules
* dbus/dbus-sysdeps.c (_dbus_get_user_id): new function
* bus/policy.c (bus_policy_append_mandatory_rule)
(bus_policy_append_default_rule, bus_policy_append_user_rule)
(bus_policy_append_group_rule): new functions
Diffstat (limited to 'bus/policy.h')
-rw-r--r-- | bus/policy.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/bus/policy.h b/bus/policy.h index 194bd001..986cfe07 100644 --- a/bus/policy.h +++ b/bus/policy.h @@ -26,6 +26,7 @@ #include <dbus/dbus.h> #include <dbus/dbus-string.h> +#include <dbus/dbus-sysdeps.h> #include "bus.h" typedef enum @@ -37,6 +38,10 @@ typedef enum BUS_POLICY_RULE_GROUP } BusPolicyRuleType; +/** determines whether the rule affects a connection, or some global item */ +#define BUS_POLICY_RULE_IS_PER_CLIENT(rule) (!((rule)->type == BUS_POLICY_RULE_USER || \ + (rule)->type == BUS_POLICY_RULE_GROUP)) + struct BusPolicyRule { int refcount; @@ -70,13 +75,13 @@ struct BusPolicyRule struct { char *user; - unsigned long uid; + dbus_uid_t uid; } user; struct { char *group; - unsigned long gid; + dbus_gid_t gid; } group; } d; @@ -87,13 +92,23 @@ BusPolicyRule* bus_policy_rule_new (BusPolicyRuleType type, void bus_policy_rule_ref (BusPolicyRule *rule); void bus_policy_rule_unref (BusPolicyRule *rule); -BusPolicy* bus_policy_new (void); -void bus_policy_ref (BusPolicy *policy); -void bus_policy_unref (BusPolicy *policy); -BusClientPolicy* bus_policy_create_client_policy (BusPolicy *policy, - DBusConnection *connection); -dbus_bool_t bus_policy_allow_user (BusPolicy *policy, - unsigned long uid); +BusPolicy* bus_policy_new (void); +void bus_policy_ref (BusPolicy *policy); +void bus_policy_unref (BusPolicy *policy); +BusClientPolicy* bus_policy_create_client_policy (BusPolicy *policy, + DBusConnection *connection); +dbus_bool_t bus_policy_allow_user (BusPolicy *policy, + unsigned long uid); +dbus_bool_t bus_policy_append_default_rule (BusPolicy *policy, + BusPolicyRule *rule); +dbus_bool_t bus_policy_append_mandatory_rule (BusPolicy *policy, + BusPolicyRule *rule); +dbus_bool_t bus_policy_append_user_rule (BusPolicy *policy, + dbus_uid_t uid, + BusPolicyRule *rule); +dbus_bool_t bus_policy_append_group_rule (BusPolicy *policy, + dbus_gid_t gid, + BusPolicyRule *rule); BusClientPolicy* bus_client_policy_new (void); void bus_client_policy_ref (BusClientPolicy *policy); |