gksu-devel
[Top][All Lists]
Advanced

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

Re: Improving gksu: lib, server, basic client


From: Agney Lopes Roth Ferraz
Subject: Re: Improving gksu: lib, server, basic client
Date: Wed, 22 Oct 2003 02:35:47 -0200

On Tue, 21 Oct 2003 16:22:48 -0200
Gustavo Noronha Silva <address@hidden> wrote:

> 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!

hi friend,
I understood the idea, but I have to read the source code of the current
version before understand better what you say. I think that is important to
me to talk with you a few about this lib too. 
I have one doubt:
we can have more than one user using the xauth at the same time, how gksu
will handle this ?
I was thinking about daemon and I have an idea:
how about we start the daemon only during the 20 seconds, I mean.
when you ask gksu to run a program it checks if a daemon is already running,
if no he ask password and start one daemon (the daemon dies after 20
seconds).
if yes, gksu only use the daemon to run the program.
it's all that I can suggest on at the moment.
Now that we have an idea about what we have to do, how about we discuss a
few about the project on freenode. maybe we (devels) can meet to know
exactly what tasks we have to do.

> -- 
> 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
> 
> 
> _______________________________________________
> Gksu-devel mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/gksu-devel
> 


-- 
-------------------------------
Agney Lopes Roth Ferraz
address@hidden





reply via email to

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