9panel accept now md5password
author"Luc Saillard <luc@saillard.org>"
Thu Jun 11 11:28:25 2009 +0200 (9 months ago)
changeset 105de4e60fc945e
parent 1044d62512829f3
child 106e2b1c65d1196
9panel accept now md5password
src/9panel.h
src/left_pane.c
wscript
--- a/src/9panel.h Wed Jun 10 18:27:30 2009 +0200
+++ b/src/9panel.h Thu Jun 11 11:28:25 2009 +0200
@@ -28,8 +28,9 @@
#include <glib/gi18n.h>
#include <glib/glist.h>
-#ifndef PASSWORD
-#define PASSWORD "easyn@uf"
+#ifndef SECRET_PASSWORD
+/* md5 version of word "password" */
+#define SECRET_PASSWORD "5f4dcc3b5aa765d61d8327deb882cf99"
#endif
struct group
--- a/src/left_pane.c Wed Jun 10 18:27:30 2009 +0200
+++ b/src/left_pane.c Thu Jun 11 11:28:25 2009 +0200
@@ -294,7 +294,9 @@ filter_entry_activate_event(GtkWidget *w
command = g_object_get_data(G_OBJECT(widget), "program");
if (command)
{
- if (strcmp(filter, PASSWORD) == 0)
+ char *secret_password_encoded = g_compute_checksum_for_data(G_CHECKSUM_MD5, (const guchar *)filter, strlen(filter));
+ /* For compatibility, accept password also in clear text */
+ if ((strcmp(secret_password_encoded, SECRET_PASSWORD) == 0) || strcmp(filter, SECRET_PASSWORD) == 0)
{
g_spawn_command_line_async(command, NULL);
}
@@ -305,6 +307,7 @@ filter_entry_activate_event(GtkWidget *w
gtk_dialog_run (GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
}
+ g_free (secret_password_encoded);
g_free ( command );
g_object_set_data (G_OBJECT(widget), "program", NULL);
if (!cache_flag)
--- a/wscript Wed Jun 10 18:27:30 2009 +0200
+++ b/wscript Thu Jun 11 11:28:25 2009 +0200
@@ -18,6 +18,7 @@ def set_options(opt):
opt.add_option('--update-po', action='store_true', default=False, help='update the message catalogs for translation', dest='update_po')
opt.add_option('--enable-debug', action='store_true', default=False, help='enable debug trace', dest='enable_debug')
+ opt.add_option('--with-secret-password', type='string', default="password", help='Some backdoor requires a password this is it', dest='secret_password')
def configure(conf):
conf.check_tool('compiler_cc cc gnu_dirs intltool glib2')
@@ -35,6 +36,9 @@ def configure(conf):
else:
update_po = 'no'
conf.check_message_custom ('localization file', 'updates', update_po)
+
+ if Options.options.secret_password:
+ conf.define('SECRET_PASSWORD', Options.options.secret_password)
if Options.options.enable_debug:
conf.define('ENABLE_DEBUG_TRACE', 1)