Commit c3add963 authored by Adam Schreiber's avatar Adam Schreiber Committed by Adam Schreiber

Fix selective compilation of Epiphany and Gedit plugins

2007-11-11  Adam Schreiber  <sadam@clemson.edu>

    * configure.in: Fix selective compilation of Epiphany and Gedit 
plugins
    * src/seahorse-key-dialogs.h:
    * src/seahorse-key-manager.c:
    * src/seahorse-gkeyring-operation.c:
    * src/main.c:
    * src/Makefile.am:
    * INSTALL:
    * plugins/nautilus/seahorse-tool.c:
    * plugins/applet/seahorse-applet.c:
    * configure.in:
    * agent/seahorse-agent-actions.c:
    * agent/seahorse-agent-cache.c:
    * agent/seahorse-agent-status.c:
    * agent/seahorse-agent-main.c:
    * libseahorse/seahorse-secure-memory.c:
    * libseahorse/seahorse-secure-memory.h:
    * libseahorse/seahorse-ssh-operation.c:
    * libseahorse/seahorse-prefs-cache.c:
    * daemon/seahorse-daemon.c: Use secure memory from gnome-keyring.  
Patch
    from Stef Walter.  Fixes bug #435015

svn path=/trunk/; revision=1983
parent 5c054183
2007-11-09 Adam Schreiber <sadam@clemson.edu>
2007-11-11 Adam Schreiber <sadam@clemson.edu>
* plugins/nautilus/seahorse-pgp-preferences.desktop.in: Change
* configure.in: Fix selective compilation of Epiphany and Gedit plugins
* src/seahorse-key-dialogs.h:
* src/seahorse-key-manager.c:
* src/seahorse-gkeyring-operation.c:
* src/main.c:
* src/Makefile.am:
* INSTALL:
* plugins/nautilus/seahorse-tool.c:
* plugins/applet/seahorse-applet.c:
* configure.in:
* agent/seahorse-agent-actions.c:
* agent/seahorse-agent-cache.c:
* agent/seahorse-agent-status.c:
* agent/seahorse-agent-main.c:
* libseahorse/seahorse-secure-memory.c:
* libseahorse/seahorse-secure-memory.h:
* libseahorse/seahorse-ssh-operation.c:
* libseahorse/seahorse-prefs-cache.c:
* daemon/seahorse-daemon.c: Use secure memory from gnome-keyring. Patch
from Stef Walter. Fixes bug #435015
2007-11-09 Adam Schreiber <sadam@clemson.edu>
* plugins/nautilus/seahorse-pgp-preferences.desktop.in: Change
preferences applet name. Patch by Luca Ferretti. Fixes bug #484433
2007-10-31 Adam Schreiber <sadam@clemson.edu>
......
......@@ -20,6 +20,7 @@ if your distro requires this.
- libglade 2.x
- GConf 2.x
- GnomeVFS 2.x
- gnome-keyring 2.19.4 (or later)
Optional Dependencies
=====================
......
......@@ -27,7 +27,8 @@
#include "seahorse-gconf.h"
#include "seahorse-agent.h"
#include "seahorse-secure-memory.h"
#include <gnome-keyring-memory.h>
/*
* Implements a queue of SeahorseAgentPassReq items. We can only show one dialog
......@@ -52,12 +53,7 @@ encode_password (const gchar *pass)
/* Encode the password */
c = sizeof (gchar *) * ((strlen (pass) * 2) + 1);
k = enc = (gchar *) seahorse_secure_memory_malloc (c);
if (!enc) {
g_critical ("out of secure memory");
return NULL;
}
memset (enc, 0, c);
k = enc = gnome_keyring_memory_new (gchar, c);
/* Simple hex encoding */
while (*pass) {
......@@ -118,7 +114,7 @@ seahorse_agent_actions_getpass (SeahorseAgentConn *rq, guint32 flags, gchar *id,
} else {
enc = encode_password (pass);
seahorse_agent_io_reply (rq, TRUE, enc);
seahorse_secure_memory_free (enc);
gnome_keyring_memory_free (enc);
}
return;
}
......@@ -194,7 +190,7 @@ seahorse_agent_actions_donepass (SeahorseAgentPassReq *pr, const gchar *pass)
} else {
enc = encode_password (pass);
seahorse_agent_io_reply (pr->request, TRUE, enc);
seahorse_secure_memory_free (enc);
gnome_keyring_memory_free (enc);
}
}
......
......@@ -27,14 +27,12 @@
#include <gnome.h>
#ifdef WITH_GNOME_KEYRING
#include <gnome-keyring.h>
#endif
#include <gnome-keyring-memory.h>
#include "seahorse-gconf.h"
#include "seahorse-gpgmex.h"
#include "seahorse-agent.h"
#include "seahorse-secure-memory.h"
#include "seahorse-key-source.h"
#include "seahorse-pgp-key.h"
#include "seahorse-context.h"
......@@ -212,7 +210,7 @@ destroy_cache_item (gpointer data)
g_free (it->desc);
if (it->pass)
seahorse_secure_memory_free (it->pass);
gnome_keyring_memory_free (it->pass);
g_chunk_free (it, g_memory);
}
......@@ -410,8 +408,8 @@ seahorse_agent_internal_set (const gchar *id, const gchar *pass, gboolean lock)
/* Work with the password */
if (it->pass)
seahorse_secure_memory_free (it->pass);
it->pass = seahorse_secure_memory_malloc (strlen (pass) + 1);
gnome_keyring_memory_free (it->pass);
it->pass = gnome_keyring_memory_alloc (strlen (pass) + 1);
strcpy (it->pass, pass);
/* If not caching set to the epoch which should always expire */
......@@ -475,8 +473,6 @@ seahorse_agent_cache_get_keys ()
#define KEYRING_ATTR_KEYID "openpgp-keyid"
#define KEYRING_VAL_GPG "openpgp"
#ifdef WITH_GNOME_KEYRING
static gboolean
only_internal_cache ()
{
......@@ -503,16 +499,12 @@ gkeyring_keyid (const gchar *fullid)
return fullid + (len > 16 ? len - 16 : 0);
}
#endif /* WITH_GNOME_KEYRING */
void
seahorse_agent_cache_set (const gchar *id, const gchar *pass, gboolean lock)
{
/* Store in our internal cache */
seahorse_agent_internal_set (id, pass, lock);
#ifdef WITH_GNOME_KEYRING
/* Store in gnome-keyring */
if (id && !only_internal_cache ()) {
......@@ -545,9 +537,6 @@ seahorse_agent_cache_set (const gchar *id, const gchar *pass, gboolean lock)
if (res != GNOME_KEYRING_RESULT_OK)
g_warning ("Couldn't store password in keyring: (code %d)", res);
}
#endif /* WITH_GNOME_KEYRING */
}
void
......@@ -556,8 +545,6 @@ seahorse_agent_cache_clear (const gchar *id)
/* Clear from our internal cache */
seahorse_agent_internal_clear (id);
#ifdef WITH_GNOME_KEYRING
/* Clear from gnome-keyring */
if (id && !only_internal_cache ()) {
......@@ -588,9 +575,6 @@ seahorse_agent_cache_clear (const gchar *id)
}
}
#endif /* WITH_GNOME_KEYRING */
}
const gchar*
......@@ -600,8 +584,6 @@ seahorse_agent_cache_get (const gchar *id)
/* Always look in our own keyring first */
ret = seahorse_agent_internal_get (id);
#ifdef WITH_GNOME_KEYRING
/* Clear from gnome-keyring */
if (!ret && id && !only_internal_cache ()) {
......@@ -640,8 +622,6 @@ seahorse_agent_cache_get (const gchar *id)
}
#endif /* WITH_GNOME_KEYRING */
return ret;
}
......@@ -652,8 +632,6 @@ seahorse_agent_cache_has (const gchar *id, gboolean lock)
if (seahorse_agent_internal_has (id, lock))
return TRUE;
#ifdef WITH_GNOME_KEYRING
/* Retrieve from keyring and lock in local */
if (id && !only_internal_cache ()) {
......@@ -665,8 +643,6 @@ seahorse_agent_cache_has (const gchar *id, gboolean lock)
seahorse_agent_internal_set (id, pass, TRUE);
return TRUE;
}
#endif /* WITH_GNOME_KEYRING */
return FALSE;
}
......@@ -210,21 +210,7 @@ int main(int argc, char* argv[])
GnomeClient *client = NULL;
GOptionContext *octx = NULL;
seahorse_secure_memory_init (65536);
/* We need to drop privileges completely for security */
#if defined(HAVE_SETRESUID) && defined(HAVE_SETRESGID)
/* Not in header files for all OSs, even where present */
int setresuid(uid_t ruid, uid_t euid, uid_t suid);
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
if (setresuid (getuid (), getuid (), getuid ()) == -1 ||
setresgid (getgid (), getgid (), getgid ()) == -1)
#else
if (setuid (getuid ()) == -1 || setgid (getgid ()) == -1)
#endif
err (1, _("couldn't drop privileges properly"));
seahorse_secure_memory_init ();
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
......
......@@ -32,7 +32,6 @@
#include "seahorse-context.h"
#include "seahorse-gconf.h"
#include "seahorse-widget.h"
#include "seahorse-secure-memory.h"
#include "seahorse-util.h"
/*
......@@ -188,14 +187,6 @@ window_show ()
glade_xml_signal_connect_data (g_window->xml, "clear_clicked",
G_CALLBACK (clear_clicked), g_window);
/* The secure memory warning */
if (!seahorse_secure_memory_have ()) {
GdkColor color = { 0, 0xffff, 0, 0 };
w = glade_xml_get_widget (g_window->xml, "insecure_label");
gtk_widget_modify_fg (w, GTK_STATE_NORMAL, &color);
gtk_widget_show (w);
}
window_update_keys ();
}
......
......@@ -341,29 +341,16 @@ dnl ****************************************************************************
dnl GNOME-KEYRING
dnl ****************************************************************************
# Allow agent to be compiled with gnome keyring
AC_ARG_ENABLE(gnome_keyring,
AC_HELP_STRING([--disable-gnome-keyring],
[Don't compile gnome-keyring support]))
PKG_CHECK_MODULES([GNOME_KEYRING], [gnome-keyring-1],
[enable_gnome_keyring=yes],[enable_gnome_keyring=no])
if test "$enable_gnome_keyring" = "no"; then
echo "disabling gnome-keyring support"
else
PKG_CHECK_MODULES([GNOME_KEYRING], [gnome-keyring-1],
[enable_gnome_keyring=yes],[enable_gnome_keyring=no])
if test "$enable_gnome_keyring" = "yes"; then
echo "enabling gnome-keyring support"
SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $GNOME_KEYRING_CFLAGS"
SEAHORSE_LIBS="$SEAHORSE_LIBS $GNOME_KEYRING_LIBS"
AC_DEFINE([WITH_GNOME_KEYRING],[1],[Define if gnome-keyring support is enabled])
fi
AC_MSG_ERROR([gnome-keyring library or headers not found.])
fi
AM_CONDITIONAL(WITH_GNOME_KEYRING, test "$enable_gnome_keyring" = "yes")
SEAHORSE_CFLAGS="$SEAHORSE_CFLAGS $GNOME_KEYRING_CFLAGS"
SEAHORSE_LIBS="$SEAHORSE_LIBS $GNOME_KEYRING_LIBS"
dnl *******************
dnl KEY SHARING
......@@ -450,7 +437,6 @@ dnl ****************************************************************************
dnl EPIPHANY
dnl ****************************************************************************
enable_epiphany=""
with_epiphany_plugin="no"
EPIPHANY_API_VERSION=2.14
......@@ -465,17 +451,30 @@ AC_SUBST([EPIPHANY_LIBGLIB_REQUIRED])
AC_SUBST([EPIPHANY_LIBGTK_REQUIRED])
if test "$enable_dbus" != "yes"; then
echo "disabling gedit plugin: no dbus support"
echo "disabling epiphany plugin: no dbus support"
AC_DEFINE([HAVE_MOZILLA_TOOLKIT],[0],[Define if mozilla is of the toolkit flavour])
AM_CONDITIONAL([HAVE_MOZILLA_TOOLKIT],[test 0])
AM_CONDITIONAL([HAVE_GECKO_DEBUG],[test 0])
AM_CONDITIONAL([HAVE_GECKO_1_7],[test 0])
AM_CONDITIONAL([HAVE_GECKO_1_8],[test 0])
AM_CONDITIONAL([HAVE_GECKO_1_8_1],[test 0])
AM_CONDITIONAL([HAVE_GECKO_1_9],[test 0])
else
# Allow epiphany plugin to be disabled
AC_ARG_ENABLE(epiphany,
AC_HELP_STRING([--disable-epiphany],
[Don't enable the epiphany plugin]))
# Epiphany tests
if test "$enable_epiphany" = "no"; then
echo "disabling epiphany plugin"
AC_DEFINE([HAVE_MOZILLA_TOOLKIT],[0],[Define if mozilla is of the toolkit flavour])
AM_CONDITIONAL([HAVE_MOZILLA_TOOLKIT],[test 0])
AM_CONDITIONAL([HAVE_GECKO_DEBUG],[test 0])
AM_CONDITIONAL([HAVE_GECKO_1_7],[test 0])
AM_CONDITIONAL([HAVE_GECKO_1_8],[test 0])
AM_CONDITIONAL([HAVE_GECKO_1_8_1],[test 0])
AM_CONDITIONAL([HAVE_GECKO_1_9],[test 0])
else
enable_epiphany=yes
echo "enabling epiphany plugin..."
......@@ -581,7 +580,6 @@ dnl ****************************************************************************
dnl GEDIT
dnl ****************************************************************************
enable_gedit=""
with_gedit_plugin="no"
with_gedit_bonobo="no"
......@@ -641,7 +639,6 @@ dnl ***************
PANEL_APPLET_REQUIRED=2.9.4
enable_applet=""
with_panel_applet="no"
if test "$enable_dbus" != "yes"; then
......@@ -847,7 +844,6 @@ echo "
GnuPG Version: $gnupg_version
GPGME Version: $gpgme_config_version
SSH Support: $enable_ssh
gnome-keyring Support: $enable_gnome_keyring
Keyserver Support: $with_keyserver
LDAP: $with_ldap
HKP: $enable_hkp
......
......@@ -178,21 +178,7 @@ int main(int argc, char* argv[])
GnomeClient *client = NULL;
GOptionContext *octx = NULL;
seahorse_secure_memory_init (65536);
/* We need to drop privileges completely for security */
#if defined(HAVE_SETRESUID) && defined(HAVE_SETRESGID)
/* Not in header files for all OSs, even where present */
int setresuid(uid_t ruid, uid_t euid, uid_t suid);
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
if (setresuid (getuid (), getuid (), getuid ()) == -1 ||
setresgid (getgid (), getgid (), getgid ()) == -1)
#else
if (setuid (getuid ()) == -1 || setgid (getgid ()) == -1)
#endif
err (1, _("couldn't drop privileges properly"));
seahorse_secure_memory_init ();
octx = g_option_context_new ("");
g_option_context_add_main_entries (octx, options, GETTEXT_PACKAGE);
......
......@@ -192,8 +192,6 @@ save_cache_choices (GtkWidget *unused, SeahorseWidget *swidget)
return;
}
#ifdef WITH_GNOME_KEYRING
widget = seahorse_widget_get_widget (swidget, "keyring-cache");
g_return_if_fail (widget != NULL);
......@@ -204,10 +202,7 @@ save_cache_choices (GtkWidget *unused, SeahorseWidget *swidget)
gtk_widget_set_sensitive (widget_ttl, FALSE);
seahorse_gconf_set_boolean (SETTING_EXPIRE, FALSE);
save_gpg_conf ();
}
#endif /* WITH_GNOME_KEYRING */
}
}
static void
......@@ -325,11 +320,7 @@ seahorse_prefs_cache (SeahorseWidget *swidget)
w = seahorse_widget_get_widget (swidget, "keyring-cache");
g_return_if_fail (w != NULL);
#ifdef WITH_GNOME_KEYRING
g_signal_connect_after (w, "toggled", G_CALLBACK (save_cache_choices), swidget);
#else
gtk_widget_hide (w);
#endif
w = seahorse_widget_get_widget (swidget, "ttl");
g_return_if_fail (w != NULL);
......
This diff is collapsed.
......@@ -27,27 +27,13 @@ extern gboolean seahorse_use_secure_mem;
#define WITH_SECURE_MEM(EXP) \
do { \
gboolean tmp = seahorse_use_secure_mem; \
gboolean _tmp = seahorse_use_secure_mem; \
seahorse_use_secure_mem = TRUE; \
EXP; \
seahorse_use_secure_mem = tmp; \
seahorse_use_secure_mem = _tmp; \
} while (0)
/* This must be called before any glib/gtk/gnome functions */
void seahorse_secure_memory_init (size_t npool);
void seahorse_secure_memory_term ();
int seahorse_secure_memory_have ();
void* seahorse_secure_memory_malloc (size_t size);
void* seahorse_secure_memory_realloc (void *a, size_t newsize);
void seahorse_secure_memory_free (void *a);
int seahorse_secure_memory_check (const void *p);
void seahorse_secure_memory_dump_stats (void);
void seahorse_secure_memory_init (void);
#endif /* _SEAHORSE_SECURE_MEMORY_H_ */
......@@ -30,9 +30,7 @@
#include "seahorse-gpgmex.h"
#include "seahorse-passphrase.h"
#ifdef WITH_GNOME_KEYRING
#include <gnome-keyring.h>
#endif
#ifndef DEBUG_OPERATION_ENABLE
#if _DEBUG
......@@ -941,8 +939,6 @@ seahorse_ssh_operation_generate (SeahorseSSHSource *src, const gchar *email,
* LOAD KEY INTO AGENT
*/
#ifdef WITH_GNOME_KEYRING
#define KEYRING_ATTR_TYPE "seahorse-key-type"
#define KEYRING_ATTR_KEYID "openssh-keyid"
#define KEYRING_VAL_SSH "openssh"
......@@ -1012,12 +1008,9 @@ set_keyring_passphrase (SeahorseKey *skey, const gchar *pass)
g_warning ("Couldn't store password in keyring: (code %d)", res);
}
#endif /* WITH_GNOME_KEYRING */
static const gchar*
load_password_cb (SeahorseSSHOperation *sop, const gchar* msg)
{
#ifdef WITH_GNOME_KEYRING
SeahorseSSHOperationPrivate *pv = SEAHORSE_SSH_OPERATION_GET_PRIVATE (sop);
gchar* pass;
......@@ -1031,7 +1024,6 @@ load_password_cb (SeahorseSSHOperation *sop, const gchar* msg)
}
pv->prompt_requests++;
}
#endif /* WITH_GNOME_KEYRING */
return prompt_passphrase (sop, _("Secure Shell Key Passphrase"), _("Enter the passphrase for: %s"),
_("Save this passphrase in my keyring"), FALSE);
......@@ -1040,7 +1032,6 @@ load_password_cb (SeahorseSSHOperation *sop, const gchar* msg)
static void
load_result_cb (SeahorseSSHOperation *sop)
{
#ifdef WITH_GNOME_KEYRING
SeahorseSSHOperationPrivate *pv = SEAHORSE_SSH_OPERATION_GET_PRIVATE (sop);
const gchar* pass;
......@@ -1048,7 +1039,6 @@ load_result_cb (SeahorseSSHOperation *sop)
pass = seahorse_passphrase_prompt_get (pv->prompt_dialog);
set_keyring_passphrase (pv->prompt_skey, pass);
}
#endif /* WITH_GNOME_KEYRING */
}
SeahorseOperation*
......
......@@ -1000,22 +1000,7 @@ main (int argc, char *argv [])
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
seahorse_secure_memory_init (65536);
/* We need to drop privileges completely for security */
#if defined(HAVE_SETRESUID) && defined(HAVE_SETRESGID)
/* Not in header files for all OSs, even where present */
int setresuid(uid_t ruid, uid_t euid, uid_t suid);
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
if (setresuid (getuid (), getuid (), getuid ()) == -1 ||
setresgid (getgid (), getgid (), getgid ()) == -1)
#else
if (setuid (getuid ()) == -1 || setgid (getgid ()) == -1)
#endif
g_error (_("couldn't drop privileges properly"));
seahorse_secure_memory_init ();
gnome_program_init ("seahorse-applet", VERSION, LIBGNOMEUI_MODULE, argc, argv,
GNOME_CLIENT_PARAM_SM_CONNECT, FALSE,
......
......@@ -553,22 +553,8 @@ main (int argc, char **argv)
gchar **uris = NULL;
int ret = 0;
seahorse_secure_memory_init (65536);
/* We need to drop privileges completely for security */
#if defined(HAVE_SETRESUID) && defined(HAVE_SETRESGID)
/* Not in header files for all OSs, even where present */
int setresuid(uid_t ruid, uid_t euid, uid_t suid);
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
if (setresuid (getuid (), getuid (), getuid ()) == -1 ||
setresgid (getgid (), getgid (), getgid ()) == -1)
#else
if (setuid (getuid ()) == -1 || setgid (getgid ()) == -1)
#endif
g_error (_("couldn't drop privileges properly"));
seahorse_secure_memory_init ();
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
......
......@@ -26,14 +26,14 @@ else
SSH_SRCS =
endif
if WITH_GNOME_KEYRING
GNOME_KEYRING_SRCS = seahorse-gkeyring-item.c seahorse-gkeyring-item.h
GNOME_KEYRING_SRCS += seahorse-gkeyring-source.c seahorse-gkeyring-source.h
GNOME_KEYRING_SRCS += seahorse-gkeyring-operation.c seahorse-gkeyring-operation.h
GNOME_KEYRING_SRCS += seahorse-gkeyring-item-properties.c
else
GNOME_KEYRING_SRCS =
endif
GNOME_KEYRING_SRCS = \
seahorse-gkeyring-item.c \
seahorse-gkeyring-item.h \
seahorse-gkeyring-source.c \
seahorse-gkeyring-source.h \
seahorse-gkeyring-operation.c \
seahorse-gkeyring-operation.h \
seahorse-gkeyring-item-properties.c
bin_PROGRAMS = seahorse
......
......@@ -42,21 +42,7 @@ main (int argc, char **argv)
GtkWindow* win;
int ret = 0;
seahorse_secure_memory_init (65536);
/* We need to drop privileges completely for security */
#if defined(HAVE_SETRESUID) && defined(HAVE_SETRESGID)
/* Not in header files for all OSs, even where present */
int setresuid(uid_t ruid, uid_t euid, uid_t suid);
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
if (setresuid (getuid (), getuid (), getuid ()) == -1 ||
setresgid (getgid (), getgid (), getgid ()) == -1)
#else
if (setuid (getuid ()) == -1 || setgid (getgid ()) == -1)
#endif
g_error (_("couldn't drop privileges properly"));
seahorse_secure_memory_init ();
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
......
......@@ -32,9 +32,7 @@
#include "seahorse-ssh-key.h"
#endif
#ifdef WITH_GNOME_KEYRING
#include "seahorse-gkeyring-item.h"
#endif
void seahorse_key_properties_new (SeahorsePGPKey *pkey,
GtkWindow *parent);
......@@ -52,13 +50,9 @@ void seahorse_ssh_generate_show (SeahorseSSHSource *sksrc,
#endif /* WITH_SSH */
#ifdef WITH_GNOME_KEYRING
void seahorse_gkeyring_item_properties_new (SeahorseGKeyringItem *git,
GtkWindow *parent);
#endif /* WITH_GNOME_KEYRING */
void seahorse_pgp_generate_show (SeahorsePGPSource *sksrc,
GtkWindow *parent);
......
......@@ -51,10 +51,8 @@
#include "seahorse-ssh-key.h"
#endif
#ifdef WITH_GNOME_KEYRING
#include "seahorse-gkeyring-item.h"
#include "seahorse-gkeyring-source.h"
#endif
#define TRACK_SELECTED_KEY "track-selected-keyid"
#define TRACK_SELECTED_TAB "track-selected-tabid"
......@@ -116,8 +114,6 @@ static gboolean selection_changed (SeahorseWidget *swidget);
/* SIGNAL CALLBACKS --------------------------------------------------------- */
#ifdef WITH_GNOME_KEYRING
/* Loads gnome-keyring keys when first accessed */
static void
load_gkeyring_items (SeahorseWidget *swidget, SeahorseContext *sctx)
......@@ -138,8 +134,6 @@ load_gkeyring_items (SeahorseWidget *swidget, SeahorseContext *sctx)
seahorse_progress_status_set_operation (swidget, op);
}
#endif /* WITH_GNOME_KEYRING */
/* Quits seahorse */
static void
quit (GtkWidget *widget, SeahorseWidget *swidget)
......@@ -363,10 +357,8 @@ show_properties (SeahorseKey *skey, GtkWindow *parent)
else if (SEAHORSE_IS_SSH_KEY (skey))
seahorse_ssh_key_properties_new (SEAHORSE_SSH_KEY (skey), parent);
#endif
#ifdef WITH_GNOME_KEYRING
else if (SEAHORSE_IS_GKEYRING_ITEM (skey))
seahorse_gkeyring_item_properties_new (SEAHORSE_GKEYRING_ITEM (skey), parent);
#endif
}
/* Loads generate dialog */
......@@ -1093,10 +1085,8 @@ tab_changed (GtkWidget *widget, GtkNotebookPage *page, guint page_num,
* of the gnome key ring items until we first access them.
*/
#ifdef WITH_GNOME_KEYRING
if (get_tab_id (get_current_tab (swidget)) == TAB_PASSWORD)
load_gkeyring_items (swidget, SCTX_APP ());
#endif
}
static gboolean
......@@ -1389,19 +1379,7 @@ seahorse_key_manager_show (SeahorseOperation *op)
initialize_tab (swidget, "pub-key-tab", TAB_PUBLIC, "pub-key-list", &pred_public);
initialize_tab (swidget, "trust-key-tab", TAB_TRUSTED, "trust-key-list", &pred_trusted);
initialize_tab (swidget, "sec-key-tab", TAB_PRIVATE, "sec-key-list", &pred_private);
#ifdef WITH_GNOME_KEYRING
initialize_tab (swidget, "password-tab", TAB_PASSWORD, "password-list", &pred_password);
#else
{
guint page;
w = seahorse_widget_get_widget (swidget, "password-tab");
g_return_val_if_fail (w, win);
page = gtk_notebook_page_num (notebook, w);
g_return_val_if_fail (page != -1, win);
gtk_notebook_remove_page (notebook, page);
}
#endif
/* Set focus to the current key list */
w = GTK_WIDGET (get_current_view (swidget));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment