Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Zbigniew Jędrzejewski-Szmek
polkit
Commits
dccf2be2
Commit
dccf2be2
authored
Oct 28, 2007
by
David Zeuthen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
let authdb backends synthesize policy file entries
parent
f0962520
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
1 deletion
+47
-1
polkit/polkit-authorization-db-dummy.c
polkit/polkit-authorization-db-dummy.c
+14
-0
polkit/polkit-authorization-db.c
polkit/polkit-authorization-db.c
+15
-0
polkit/polkit-policy-cache.c
polkit/polkit-policy-cache.c
+10
-1
polkit/polkit-private.h
polkit/polkit-private.h
+8
-0
No files found.
polkit/polkit-authorization-db-dummy.c
View file @
dccf2be2
...
...
@@ -67,6 +67,20 @@ _polkit_authorization_db_new (void)
return
authdb
;
}
void
_polkit_authorization_db_pfe_foreach
(
PolKitPolicyCache
*
policy_cache
,
PolKitPolicyCacheForeachFunc
callback
,
void
*
user_data
)
{
}
PolKitPolicyFileEntry
*
_polkit_authorization_db_pfe_get_by_id
(
PolKitPolicyCache
*
policy_cache
,
const
char
*
action_id
)
{
return
NULL
;
}
PolKitAuthorizationDB
*
polkit_authorization_db_ref
(
PolKitAuthorizationDB
*
authdb
)
{
...
...
polkit/polkit-authorization-db.c
View file @
dccf2be2
...
...
@@ -118,6 +118,21 @@ _polkit_authorization_db_new (void)
return
authdb
;
}
void
_polkit_authorization_db_pfe_foreach
(
PolKitPolicyCache
*
policy_cache
,
PolKitPolicyCacheForeachFunc
callback
,
void
*
user_data
)
{
}
PolKitPolicyFileEntry
*
_polkit_authorization_db_pfe_get_by_id
(
PolKitPolicyCache
*
policy_cache
,
const
char
*
action_id
)
{
return
NULL
;
}
/**
* polkit_authorization_db_ref:
* @authdb: the object
...
...
polkit/polkit-policy-cache.c
View file @
dccf2be2
...
...
@@ -235,7 +235,10 @@ polkit_policy_cache_get_entry_by_id (PolKitPolicyCache *policy_cache, const char
}
}
pfe
=
NULL
;
if
(
pfe
==
NULL
)
{
/* the authdb backend may want to synthesize pfe's */
pfe
=
_polkit_authorization_db_pfe_get_by_id
(
policy_cache
,
action_id
);
}
out:
return
pfe
;
...
...
@@ -272,6 +275,7 @@ polkit_policy_cache_get_entry (PolKitPolicyCache *policy_cache,
goto
out
;
pfe
=
polkit_policy_cache_get_entry_by_id
(
policy_cache
,
action_id
);
out:
return
pfe
;
}
...
...
@@ -299,6 +303,11 @@ polkit_policy_cache_foreach (PolKitPolicyCache *policy_cache,
pfe
=
i
->
data
;
callback
(
policy_cache
,
pfe
,
user_data
);
}
/* the authdb backend may also want to return synthesized pfe's */
_polkit_authorization_db_pfe_foreach
(
policy_cache
,
callback
,
user_data
);
}
/**
...
...
polkit/polkit-private.h
View file @
dccf2be2
...
...
@@ -52,6 +52,14 @@ const char *_polkit_authorization_get_authfile_entry (PolKitAuthorization *auth)
PolKitAuthorizationDB
*
_polkit_authorization_db_new
(
void
);
void
_polkit_authorization_db_invalidate_cache
(
PolKitAuthorizationDB
*
authdb
);
void
_polkit_authorization_db_pfe_foreach
(
PolKitPolicyCache
*
policy_cache
,
PolKitPolicyCacheForeachFunc
callback
,
void
*
user_data
);
PolKitPolicyFileEntry
*
_polkit_authorization_db_pfe_get_by_id
(
PolKitPolicyCache
*
policy_cache
,
const
char
*
action_id
);
PolKitPolicyCache
*
_polkit_policy_cache_new
(
const
char
*
dirname
,
polkit_bool_t
load_descriptions
,
PolKitError
**
error
);
PolKitPolicyCache
*
_polkit_policy_cache_new
(
const
char
*
dirname
,
polkit_bool_t
load_descriptions
,
PolKitError
**
error
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment