frob-control-change.c 587 Bytes
Newer Older
1 2

#include "control/gkd-control.h"
3 4

#include "egg/egg-secure-memory.h"
5 6 7 8

#include <pwd.h>
#include <unistd.h>

9 10 11 12
EGG_SECURE_GLIB_DEFINITIONS ();

int
main (int argc, char *argv[])
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
{
	gchar *original;
	const char *password;
	const char *directory;

	directory = g_getenv ("GNOME_KEYRING_CONTROL");
	g_return_val_if_fail (directory, 1);

	original = g_strdup (getpass ("Original: "));
	g_return_val_if_fail (original, 1);

	password = getpass ("New Password: ");
	g_return_val_if_fail (password, 1);

	gkd_control_change_lock (directory, original, password);

	g_free (original);
	return 0;
}