* updated kmbox (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / package / gnome / gnomesu / features.patch
bloba04b693a4737b0fde56b035f2fa749a288090832
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../gnomesu/features.patch
5 # Copyright (C) 2004 - 2007 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
17 This feature patch was primarily developed for the Archivista Scan Server Box,
18 however it should be useful for others as well.
20 First we do not want to let the joe user see cryptic commands to be executed
21 when asked for authentication (always done when a command was supplied now)
23 Second for some special cases (like setting passwords) we want to retrieve the
24 current password to injet into e.g. MySQL and co (-p).
26 - Rene Rebe <rene@exactcode.de>
28 diff -u gnomesu-0.3.1/src/xsu.c gnomesu-0.3.1-fixed/src/xsu.c
29 --- gnomesu-0.3.1/src/xsu.c 2003-04-10 14:03:14.000000000 +0000
30 +++ gnomesu-0.3.1-fixed/src/xsu.c 2005-09-05 22:58:12.000000000 +0000
31 @@ -126,7 +126,10 @@
32 buffer = g_strdup_printf("%s%s;%s", SET_DISPL_ENV, displ_host, command);
33 g_free(displ_host);
35 - else
36 + else if (show_password) {
37 + buffer = g_strdup_printf("PASSWD=\"%s\" %s", password, command);
38 + }
39 + else
41 buffer = g_strdup_printf("%s", command);
43 @@ -371,13 +377,16 @@
44 if(g_strdup(argv[1])) // there was a first argument
46 /* As long as the first item is not a switch set the first item as the command */
47 - if ((strcmp(argv[1], "-u")) && (strcmp(argv[1], "--username")) && (strcmp(argv[1], "-m")) && (strcmp (argv[1], "-c")) && (strcmp (argv[1], "--command")) && (strcmp(argv[1], "--message")) && (strcmp(argv[1], "-t")) && (strcmp(argv[1], "--title")))
48 + if ((strcmp(argv[1], "-u")) && (strcmp(argv[1], "--username")) && (strcmp(argv[1], "-m")) && (strcmp (argv[1], "-c")) && (strcmp (argv[1], "--command")) && (strcmp(argv[1], "--message")) && (strcmp(argv[1], "-t")) && (strcmp(argv[1], "--title")) && (strcmp(argv[1], "-p")))
50 arg_command = g_strdup(argv[1]);
51 command_in=TRUE;
55 + if (!strcmp (argv[x], "-p"))
56 + show_password=TRUE;
58 // -c switch for backwards compatibility with xsu
59 if ((!strcmp (argv[x], "-c")) || (!strcmp (argv[x], "--command")))
61 @@ -542,7 +554,9 @@
62 if (command_in)
64 gtk_entry_set_text(GTK_ENTRY(gtk_command_textbox),arg_command);
65 - //gtk_entry_set_editable(GTK_ENTRY(gtk_command_textbox), FALSE);
66 + gtk_entry_set_editable(GTK_ENTRY(gtk_command_textbox), FALSE);
67 + gtk_widget_hide (gtk_commandtxt_label);
68 + gtk_widget_hide (gtk_command_textbox);
69 gtk_widget_grab_focus (gtk_password_textbox);
70 } else {
71 gtk_widget_grab_focus (gtk_command_textbox);
72 diff -u gnomesu-0.3.1/src/xsu.h gnomesu-0.3.1-fixed/src/xsu.h
73 --- gnomesu-0.3.1/src/xsu.h 2003-01-07 21:01:09.000000000 +0000
74 +++ gnomesu-0.3.1-fixed/src/xsu.h 2005-09-05 22:27:38.000000000 +0000
75 @@ -77,6 +77,7 @@
76 GtkTooltips *tooltips;
78 gchar *arg_message, *arg_title, *displ_host;
79 +gboolean show_password=FALSE;
81 gboolean message_in=FALSE,
82 title_in=FALSE,