gksu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Improving gksu: lib, server, basic client


From: Gustavo Noronha Silva
Subject: Improving gksu: lib, server, basic client
Date: Tue, 21 Oct 2003 16:22:48 -0200

Hello all,

I've been thinking about gksu today and this is what I thought:

For the lib, we could have the following API:

        gboolean gksu_init (); /* initializes the basic data structures, etc */

        gchar* gksu_get_xauth_token ();


The xauth function is only there to get the token, if it is needed
in the program (and it will be, as I'll show, in some cases).

The options could use stuff like:

        void gksu_set_grab (gboolean value);

        gboolean gksu_get_grab ();

The password/run process:

        gchar* gksu_ask_passwd (char *title, char *message);

        gint gksu_run (char *command, char *user);

        gint gksu_run_with_passwd (char *command, char *user, char *pass);

The gksu_ask_pass function would be used to ask the password. gksu_run
would call it automatically, but those who want to show a custom message
could call this function and then gksu_run_with_passwd.

        void gksu_secure_free (char *str);
        void gksu_clean ();

Utility functions. The first one is free_pass, from the original gksu.
It writes 0's over the password string and then g_free's it.

What do you people think?

Now, the basic client, gksu, would be written more or less like this:

gksu_init (); /* this is responsible for making the xauth stuff, too */
pass = gksu_ask_passwd (title, message);
gksu_run_with_passwd (command, user, pass);
gksu_secure_free (pass); /* this could be called inside gksu_run_with_passwd */
gksu_clean ();

I've thought about a gksud, also, which would run with the desktop,
and would serve the purpose of having an icon into the system tray,
like redhat's stuff. It could have a simple network interface, like:

GET <user> <XAUTH_token>
SET <user> <XAUTH_token> passwd
FORGET <user> <XAUTH_token>
FORGETALL <XAUTH_token>

The server would keep the password for, say, 20 seconds. This means
that gksu_init would try to connect to this server when running, and
would get the password from it, and use it, renewing the timeout
of the server.

The gksu_init call could run the server if it is not up. That's
my idea. What do you think? =)

See ya!

-- 
address@hidden: Gustavo Noronha <http://people.debian.org/~kov>
Debian:  <http://www.debian.org>  *  <http://www.debian-br.org>
  "Não deixe para amanhã, o WML que você pode traduzir hoje!"
        http://debian-br.alioth.debian.org/?id=WebWML




reply via email to

[Prev in Thread] Current Thread [Next in Thread]