diff options
author | Milan Crha <mcrha@redhat.com> | 2008-05-27 02:02:30 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-05-27 02:02:30 +0800 |
commit | c9d8512b2e3a29263935bef58ae1c01469dee0c4 (patch) | |
tree | b322095bf80e1075b72cf6cac6be13057e18dae4 /mail/mail-config.c | |
parent | f4db10997283c2455a81e4d6342492aa902ad27b (diff) | |
download | gsoc2013-evolution-c9d8512b2e3a29263935bef58ae1c01469dee0c4.tar.gz gsoc2013-evolution-c9d8512b2e3a29263935bef58ae1c01469dee0c4.tar.zst gsoc2013-evolution-c9d8512b2e3a29263935bef58ae1c01469dee0c4.zip |
** Fix for bug #322553
2008-05-26 Milan Crha <mcrha@redhat.com>
** Fix for bug #322553
* mail-config.h: (mail_config_scripts_disabled):
* mail-config.c: (struct MailConfig), (mail_config_init),
(mail_config_scripts_disabled): New helper function.
* em-composer-prefs.c: (sig_load_preview):
Write to html stream at least one character.
* em-composer-prefs.c: (em_composer_prefs_construct): Disable
signature's Add Script button when not approved running scripts.
* mail-config.c: (mail_config_get_gconf_client): Ensure init.
* mail-config.c: (mail_config_signature_run_script): Do not run
script when disabled in /desktop/gnome/lockdown/disable_command_line.
svn path=/trunk/; revision=35551
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r-- | mail/mail-config.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c index 43a0e8b65b..f966fff0f3 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -103,6 +103,7 @@ typedef struct { gboolean jh_check; gboolean book_lookup; gboolean book_lookup_local_only; + gboolean scripts_disabled; } MailConfig; static MailConfig *config = NULL; @@ -507,6 +508,14 @@ mail_config_init (void) config->book_lookup_local_only = gconf_client_get_bool (config->gconf, key, NULL); + key = "/desktop/gnome/lockdown/disable_command_line"; + func = (GConfClientNotifyFunc) gconf_bool_value_changed; + gconf_client_notify_add ( + config->gconf, key, func, + &config->scripts_disabled, NULL, NULL); + config->scripts_disabled = + gconf_client_get_bool (config->gconf, key, NULL); + gconf_jh_check_changed (config->gconf, 0, NULL, config); } @@ -616,6 +625,9 @@ mail_config_write_on_exit (void) GConfClient * mail_config_get_gconf_client (void) { + if (!config) + mail_config_init (); + return config->gconf; } @@ -1186,6 +1198,15 @@ mail_config_get_lookup_book_local_only (void) return config->book_lookup_local_only; } +gboolean +mail_config_scripts_disabled (void) +{ + if (config == NULL) + mail_config_init (); + + return config->scripts_disabled; +} + char * mail_config_signature_run_script (const char *script) { @@ -1194,6 +1215,9 @@ mail_config_signature_run_script (const char *script) int in_fds[2]; pid_t pid; + if (mail_config_scripts_disabled ()) + return NULL; + if (pipe (in_fds) == -1) { g_warning ("Failed to create pipe to '%s': %s", script, g_strerror (errno)); return NULL; |