From 52f11fa9cddd6734c1c6119782466ccd7d334571 Mon Sep 17 00:00:00 2001 From: smanojna Date: Tue, 7 Mar 2006 09:40:28 +0000 Subject: [PATCH] - Fix for writing secrets into the default Wallet instead of writing into CASAWallet. - Changed the port attribute in Keyring from string to unit32. --- CASA.changes | 7 ++++ c_adlib/ad_gk/native/ad_gk.c | 24 ++++++++++--- c_adlib/ad_kw/native/kwallets_rw.cpp | 54 ++++++++++++++++++++++++++-- 3 files changed, 78 insertions(+), 7 deletions(-) diff --git a/CASA.changes b/CASA.changes index 567d8794..db80d8ab 100644 --- a/CASA.changes +++ b/CASA.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Mar 7 15:08:26 IST 2006 - smanojna@novell.com + +- Fix for writing secrets into the default Wallet instead of + writing into CASAWallet. +- Changed the port attribute in Keyring from string to unit32. + ------------------------------------------------------------------- Mon Mar 6 16:30::00 IST 2006 - mmanohar@novell.com diff --git a/c_adlib/ad_gk/native/ad_gk.c b/c_adlib/ad_gk/native/ad_gk.c index 35ea6784..0f705b88 100644 --- a/c_adlib/ad_gk/native/ad_gk.c +++ b/c_adlib/ad_gk/native/ad_gk.c @@ -631,8 +631,16 @@ CreateItemInKeyring(char *keyring, int32_t itemType, char *display_name, char *s { //printf("as.gk.c : CreateItemInKeyring : In key %s \n", attrs[i]->key); attribute.name = g_strdup (attrs[i]->key); - attribute.type = GNOME_KEYRING_ATTRIBUTE_TYPE_STRING; - attribute.value.string = g_strdup (attrs[i]->value); + if( !strcmp(attrs[i]->key, "port")) + { + attribute.type = GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32; + attribute.value.integer = atoi(attrs[i]->value); + } + else + { + attribute.type = GNOME_KEYRING_ATTRIBUTE_TYPE_STRING; + attribute.value.string = g_strdup(attrs[i]->value); + } g_array_append_val (attributes, attribute); } @@ -908,8 +916,16 @@ SetItemAttributes (char *keyring, guint32 itemid, Attribute **attrs, int length) { //printf("ad_gk.c : In key %s \n", attrs[i]->key); attribute.name = g_strdup (attrs[i]->key); - attribute.type = GNOME_KEYRING_ATTRIBUTE_TYPE_STRING; - attribute.value.string = g_strdup (attrs[i]->value); + if( !strcmp(attrs[i]->key, "port")) + { + attribute.type = GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32; + attribute.value.integer = atoi(attrs[i]->value); + } + else + { + attribute.type = GNOME_KEYRING_ATTRIBUTE_TYPE_STRING; + attribute.value.string = g_strdup(attrs[i]->value); + } g_array_append_val (attributes, attribute); } gnome_keyring_item_set_attributes (keyring, itemid, attributes, diff --git a/c_adlib/ad_kw/native/kwallets_rw.cpp b/c_adlib/ad_kw/native/kwallets_rw.cpp index c1b5d269..c06526e6 100644 --- a/c_adlib/ad_kw/native/kwallets_rw.cpp +++ b/c_adlib/ad_kw/native/kwallets_rw.cpp @@ -25,9 +25,10 @@ #include #include #include - +#include using namespace KWallet; +using namespace std; #include "kwallets_rw.h" #include "kwallets_rw.moc" @@ -252,6 +253,49 @@ extern "C" } +void GetDefaultWallet(char dwallet[100]) + { + char *ptr = NULL; + char homedir[100]; + char defaultwallet[100]; + strcpy(homedir, getenv("HOME")); + FILE *fs; + char str[100]; + int i; + //cout<<"kwallets_rw.cpp : Home Directory =" << homedir; + strcat(homedir, "/.kde/share/config/kwalletrc"); + fs = fopen(homedir,"r"); + //fs = fopen("/root/.kde/share/config/kwalletrc","r"); + while(!feof(fs)) + { + fgets(str,80,fs); + //cout<