[debian-edu-commits] debian-edu/ 111/183: Documented 'ssh -X' bugfix for zoidberg and fish shells

Alexander Alemayhu ccscanf-guest at moszumanska.debian.org
Wed Jun 11 16:48:38 UTC 2014


This is an automated email from the git hooks/post-receive script.

ccscanf-guest pushed a commit to branch master
in repository desktop-profiles.

commit 7c92560370176927ec5e5c9a34a65e873ee72c3a
Author: Bart Cornelis <cobaco at linux.be>
Date:   Fri Feb 3 08:09:42 2006 +0000

    Documented 'ssh -X' bugfix for zoidberg and fish
    shells
---
 README                | 50 +++++++++++++++++++++++++++++---------------------
 debian/changelog      |  6 +++---
 debian/rules          |  2 +-
 desktop-profiles.fish |  4 ++--
 zoidrc-snippet        | 26 ++++++++++++++++++++++++++
 5 files changed, 61 insertions(+), 27 deletions(-)

diff --git a/README b/README
index 6f37024..079ec07 100644
--- a/README
+++ b/README
@@ -14,31 +14,39 @@ KNOWN BUGS
   is because the Xsession.d script isn't run.
   
   A general shell-independ solution seems to be impossible (neither ssh itself
-  nor PAM provides a way to source shell scripts) so the only possible solution
-  would seem to be to adding a shell snippet to the system-wide on-login script
-  for each shell-variant, and have that snippet run the profile activation
-  script when it detects an 'ssh -X' login.
+  nor PAM provides a way to source shell scripts, if you have any ideas please
+  contact me). 
+  Shell-variant specific solutions are possible by having the system-wide 
+  on-logon script of each shell run the profile activation script when an 
+  'ssh-X' login is detected. 
+  This package currently documents the necessary bits of code for the following
+  shells: bash, dash, ksh, pdksh, mksh, csh, tcsh, zsh, zoidberg, and fish. 
+  Only the fish on-logon script allows is currently modularized, thus allowing 
+  the fix to applied automatically, users of other shells need to add in the 
+  required code by hand.
+  Fixes for psh and slsh are currently missing (if anybody is able to lend a
+  hand please do as I'm not familiar with either).
 
-  For bourne-compatible shells (bash, dash, ksh, pdksh, mksh) this means adding
-  a snippet to /etc/profile which in the absence of a /etc/profile.d directory
-  can't be done. Since the base-file maintainer refuses to add such a mechanism
-  (For more info see /usr/share/doc/base-files/FAQ and bug #345921) we're stuck.
-  The file /usr/share/doc/desktop-profiles/examples/profile-snippet contains the 
-  necessary snippet, adding it at the end of /etc/profile will fix this bug for
-  all bourne-compatible shells.
+  For bourne-compatible shells (bash, dash, ksh, pdksh, mksh) the system-wide 
+  on-logon script is /etc/profile. The file 
+  /usr/share/doc/desktop-profiles/examples/profile-snippet contains the code
+  that needs to be added to it in order to fix this bug.
 
-  For csh or tcsh this means adding a snippet to /etc/csh.login. The file 
-  /usr/share/doc/desktop-profiles/examples/csh.login-snippet contains the 
-  necessary snippet, adding it at the end of /etc/csh.login will fix this bug 
-  for csh and tcsh.
+  For csh or tcsh shells the system-wide on-logon script is /etc/csh.login. The
+  file /usr/share/doc/desktop-profiles/examples/csh.login-snippet contains the 
+  code-snippet that needs to be added to it in order to fix this bug. 
 
-  For zsh this means adding a snippet to /etc/csh.login. The file 
-  /usr/share/doc/desktop-profiles/examples/zlogin-snippet contains the 
-  necessary snippet, adding it at the end of /etc/zsh/zlogin will fix this bug
-  for zsh.
+  For the zsh shell the system-wide on-logon script is /etc/zsh/zlogin. The file 
+  /usr/share/doc/desktop-profiles/examples/zlogin-snippet contains the
+  code-snippet that needs to be added to it in order to fix this bug.
 
-  Users of the fish shell don't need to do anything, for them the workaround is
-  installed automatically with the packge.
+  For the zoidberg shell the system-wide on-logon script is /etc/zoidrc. The 
+  file /usr/share/doc/desktop-profiles/examples/zoidrc-snippet contains the 
+  code-snippet that needs to be added to it in order to fix this bug.
+
+  Users of the fish shell don't need to do anything as the system-wide on-logon
+  script of fish is modularized. The required code-snippet is dropped into place
+  automatically by the package.
   
 GETTING GCONF PROFILES TO WORK
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
diff --git a/debian/changelog b/debian/changelog
index c5c6dc0..cf90783 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,12 +1,12 @@
-desktop-profiles (1.4.10) UNRELEASED; urgency=low
+desktop-profiles (1.4.10) unstable; urgency=low
 
   * Translations:
     - Added Brazilian Portuguese translation by Felipe Augusto van de Wiel
     (Closes: #348623)
   * Added shell-specific fixes for the 'ssh -X'-bug for for csh, tcsh, zsh,
-    and fish shells, plus related note in README.
+    fish, and zoidberg shells, plus related note in README.
 
- -- Bart Cornelis (cobaco) <cobaco at linux.be>  Tue, 31 Jan 2006 20:45:02 +0100
+ -- Bart Cornelis (cobaco) <cobaco at linux.be>  Thu,  2 Feb 2006 18:10:23 +0100
 
 desktop-profiles (1.4.9) unstable; urgency=low
 
diff --git a/debian/rules b/debian/rules
index b6893c8..e6875bd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -41,7 +41,7 @@ binary-indep: build install
 	dh_install dh_installlisting profile-manager usr/bin
 	dh_install listingmodule get_desktop-profiles_variables path usr/share/desktop-profiles/
 	dh_link usr/share/desktop-profiles/path usr/share/doc/desktop-profiles/examples/path
-	dh_install profile-snippet csh.login-snippet zlogin-snippet usr/share/doc/desktop-profiles/examples
+	dh_install profile-snippet csh.login-snippet zlogin-snippet zoidrc-snippet usr/share/doc/desktop-profiles/examples
 	dh_install list-desktop-profiles usr/bin/
 	dh_install profile-manager.kmdr usr/share/desktop-profiles/kommander-scripts/
 	dh_install desktop-profiles etc/default
diff --git a/desktop-profiles.fish b/desktop-profiles.fish
index 407f93f..429e1aa 100755
--- a/desktop-profiles.fish
+++ b/desktop-profiles.fish
@@ -9,10 +9,10 @@ if test -f $DESKTOP_PROFILES_SNIPPET
   set -l TEMP_FILE (tempfile)
 
   # use bash to write the required environment settings to a tempfile
-  # this file has a VARIABLE=VALUE format
+  # this file has a 'VARIABLE=VALUE' format
   bash $DESKTOP_PROFILES_SNIPPET $TEMP_FILE
 
-  # convert to zsh format and source to set the required environment variables
+  # convert to fish format and source to set the required environment variables
   sed -i 's/^\(.*\)=\(.*\)$/set -g -x \1 \2/' $TEMP_FILE
   . $TEMP_FILE
 
diff --git a/zoidrc-snippet b/zoidrc-snippet
new file mode 100755
index 0000000..817a82f
--- /dev/null
+++ b/zoidrc-snippet
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+# This fixes the desktop-profiles corner-case where a graphical client is 
+# started through an ssh -X session (in which the Xsession.d scripts aren't 
+# run, so we need to make sure the profiles are activated according to the 
+# specified settings at login).
+$DESKTOP_PROFILES_SNIPPET = '/usr/share/desktop-profiles/get_desktop-profiles_variables';
+
+if ( -e $DESKTOP_PROFILES_SNIPPET ) {
+  $TEMP_FILE = `tempfile`;
+
+  # use bash to write the required environment settings to a tempfile
+  # this file has a 'VARIABLE=VALUE' format
+  `bash $DESKTOP_PROFILES_SNIPPET $TEMP_FILE`;
+
+  # source to set the required environment variables
+  open(input, $TEMP_FILE);
+  while($env_var = <input>) {
+    # needs to become: $ENV{'VARIABLE'} = 'VALUE'; 
+    $env_var =~ s/^(.*)=(.*)$/\$ENV{'\1'} = '\2'/;
+    eval $env_var;
+  }
+
+  # cleanup
+  `rm $TEMP_FILE`;
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/desktop-profiles.git



More information about the debian-edu-commits mailing list