2 Copyright (C) 2011 Giuseppe Borzi <gborzi@ieee.org>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
11 #include <gnome-keyring.h>
13 gchar
* cleanurl( const gchar
*url
)
18 if ( ( id
= g_strstr_len(url
+ 8,il
,"/") ) != NULL
)
21 cleaned
= g_strndup(url
,lprt
);
24 cleaned
= g_strdup(url
);
28 int main( int argc
, char **argv
) {
31 g_print("Usage: %s url user password\n",argv
[0]);
35 if ( gnome_keyring_is_available() ) {
36 guint32 item_id
; gchar
*cleaned
= cleanurl(argv
[1]);
37 gnome_keyring_set_network_password_sync(NULL
,
48 g_print("Created Gnome Keyring entry # %d\n",item_id
);
50 g_print("Gnome Keyring not available!\n");