Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
polkit
polkit
Commits
b39bfb80
Commit
b39bfb80
authored
Jul 25, 2007
by
David Zeuthen
Browse files
actually reload config and policy files when they change
parent
2e003e3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
NEWS
View file @
b39bfb80
...
...
@@ -12,7 +12,7 @@ be audited.
Changes from PolicyKit 0.3 "No Man's Land"
David Zeuthen (1
6
):
David Zeuthen (1
8
):
post-release version bump
remove the notion of modules
replace configuration reload mechanism
...
...
@@ -29,6 +29,8 @@ David Zeuthen (16):
fix docs
fix up proper naming of some methods on the PolKitPolicyFileEntry class
for PolKitContext, mention that a mechanism need to provide .policy files
update NEWS
actually reload config and policy files when they change
Requirements for PolicyKit 0.4 ""
...
...
polkit/polkit-context.c
View file @
b39bfb80
...
...
@@ -297,7 +297,29 @@ again:
event
->
wd
,
event
->
mask
,
event
->
cookie
,
event
->
len
);
if
(
event
->
wd
==
pk_context
->
inotify_reload_wd
)
{
PolKitConfig
*
new_config
;
_pk_debug
(
"config changed!"
);
/* purge existing policy files */
_pk_debug
(
"purging policy files"
);
if
(
pk_context
->
priv_cache
==
NULL
)
{
polkit_policy_cache_unref
(
pk_context
->
priv_cache
);
pk_context
->
priv_cache
=
NULL
;
}
/* Reload configuration file */
_pk_debug
(
"reload configuration file"
);
new_config
=
polkit_config_new
(
NULL
);
if
(
pk_context
->
config
==
NULL
)
{
_pk_debug
(
"failed to reload configuration file: %s"
,
strerror
(
errno
));
/* TODO: set error. TODO: should we error out if the config file is bad?!? Or recover and go without a config file? */
}
else
{
if
(
pk_context
->
config
!=
NULL
)
polkit_config_unref
(
pk_context
->
config
);
pk_context
->
config
=
new_config
;
}
if
(
pk_context
->
config_changed_cb
!=
NULL
)
{
pk_context
->
config_changed_cb
(
pk_context
,
pk_context
->
config_changed_user_data
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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