OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
3.4 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../gnomesu/features.patch
  5. # Copyright (C) 2004 - 2006 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. # --- SDE-COPYRIGHT-NOTE-END ---
  16. This feature patch was primarily developed for the Archivista Scan Server Box,
  17. however it should be useful for others as well.
  18. First we do not want to let the joe user see cryptic commands to be executed
  19. when asked for authentication (always done when a command was supplied now)
  20. Second for some special cases (like setting passwords) we want to retrieve the
  21. current password to injet into e.g. MySQL and co (-p).
  22. - Rene Rebe <rene@exactcode.de>
  23. diff -u gnomesu-0.3.1/src/xsu.c gnomesu-0.3.1-fixed/src/xsu.c
  24. --- gnomesu-0.3.1/src/xsu.c 2003-04-10 14:03:14.000000000 +0000
  25. +++ gnomesu-0.3.1-fixed/src/xsu.c 2005-09-05 22:58:12.000000000 +0000
  26. @@ -126,7 +126,10 @@
  27. buffer = g_strdup_printf("%s%s;%s", SET_DISPL_ENV, displ_host, command);
  28. g_free(displ_host);
  29. }
  30. - else
  31. + else if (show_password) {
  32. + buffer = g_strdup_printf("PASSWD=\"%s\" %s", password, command);
  33. + }
  34. + else
  35. {
  36. buffer = g_strdup_printf("%s", command);
  37. }
  38. @@ -371,13 +377,16 @@
  39. if(g_strdup(argv[1])) // there was a first argument
  40. {
  41. /* As long as the first item is not a switch set the first item as the command */
  42. - 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")))
  43. + 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")))
  44. {
  45. arg_command = g_strdup(argv[1]);
  46. command_in=TRUE;
  47. }
  48. }
  49. + if (!strcmp (argv[x], "-p"))
  50. + show_password=TRUE;
  51. +
  52. // -c switch for backwards compatibility with xsu
  53. if ((!strcmp (argv[x], "-c")) || (!strcmp (argv[x], "--command")))
  54. {
  55. @@ -542,7 +554,9 @@
  56. if (command_in)
  57. {
  58. gtk_entry_set_text(GTK_ENTRY(gtk_command_textbox),arg_command);
  59. - //gtk_entry_set_editable(GTK_ENTRY(gtk_command_textbox), FALSE);
  60. + gtk_entry_set_editable(GTK_ENTRY(gtk_command_textbox), FALSE);
  61. + gtk_widget_hide (gtk_commandtxt_label);
  62. + gtk_widget_hide (gtk_command_textbox);
  63. gtk_widget_grab_focus (gtk_password_textbox);
  64. } else {
  65. gtk_widget_grab_focus (gtk_command_textbox);
  66. diff -u gnomesu-0.3.1/src/xsu.h gnomesu-0.3.1-fixed/src/xsu.h
  67. --- gnomesu-0.3.1/src/xsu.h 2003-01-07 21:01:09.000000000 +0000
  68. +++ gnomesu-0.3.1-fixed/src/xsu.h 2005-09-05 22:27:38.000000000 +0000
  69. @@ -77,6 +77,7 @@
  70. GtkTooltips *tooltips;
  71. gchar *arg_message, *arg_title, *displ_host;
  72. +gboolean show_password=FALSE;
  73. gboolean message_in=FALSE,
  74. title_in=FALSE,