Hi,

Here is a patch for e_desklock to add a binding on Ctrl-U to flush
input password as the common way on Unix system to flush an input.

-- 
Beber
--- src/bin/e_desklock.c.ori	2008-05-13 21:14:52.000000000 +0200
+++ src/bin/e_desklock.c	2008-05-13 22:56:39.000000000 +0200
@@ -72,6 +72,7 @@
 static int _e_desklock_cb_custom_desklock_exit(void *data, int type, void *event);
 static int _e_desklock_cb_idle_poller(void *data);
 
+static void _e_desklock_null(void);
 static void _e_desklock_passwd_update(void);
 static void _e_desklock_backspace(void);
 static void _e_desklock_delete(void);
@@ -423,6 +424,8 @@
      _e_desklock_backspace();
    else if (!strcmp(ev->keysymbol, "Delete"))
      _e_desklock_delete();
+   else if (!strcmp(ev->keysymbol, "u") && (ev->modifiers & ECORE_X_MODIFIER_CTRL))
+     _e_desklock_null();
    else
      {
 	/* here we have to grab a password */
@@ -506,6 +509,13 @@
 }
 
 static void
+_e_desklock_null(void)
+{
+   memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN);
+   _e_desklock_passwd_update();
+}
+
+static void
 _e_desklock_backspace(void)
 {
    int len, val, pos;
@@ -578,8 +588,7 @@
 #endif
    /* password is definitely wrong */
    _e_desklock_state_set(E_DESKLOCK_STATE_INVALID);
-   memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN);
-   _e_desklock_passwd_update();
+   _e_desklock_null();
    return 0;
 }
 
@@ -647,8 +656,7 @@
 	  {
 	     _e_desklock_state_set(E_DESKLOCK_STATE_INVALID);
 	     /* security - null out passwd string once we are done with it */
-	     memset(edd->passwd, 0, sizeof(char) * PASSWD_LEN);
-	     _e_desklock_passwd_update();
+	     _e_desklock_null();
 	  }
 	ecore_event_handler_del(_e_desklock_exit_handler);
 	_e_desklock_exit_handler = NULL;

Attachment: signature.asc
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to