[debian-edu-commits] debian-edu/ 110/183: Added fixes for the 'ssh -X' bug for csh, tcsh, zsh, and fish only psh and slsh left :)
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 3371da3926c2490381095eef35bee05e4c464968
Author: Bart Cornelis <cobaco at linux.be>
Date: Wed Feb 1 11:15:22 2006 +0000
Added fixes for the 'ssh -X' bug for csh, tcsh, zsh, and fish
only psh and slsh left :)
---
README | 13 +++++++++++++
csh.login-snippet | 22 ++++++++++++++++++++++
debian/changelog | 4 +++-
debian/rules | 5 +++--
desktop-profiles.fish | 21 +++++++++++++++++++++
get_desktop-profiles_variables | 26 ++++++++++++++++++++++++++
zlogin-snippet | 21 +++++++++++++++++++++
7 files changed, 109 insertions(+), 3 deletions(-)
diff --git a/README b/README
index 05e77a8..6f37024 100644
--- a/README
+++ b/README
@@ -27,6 +27,19 @@ KNOWN BUGS
necessary snippet, adding it at the end of /etc/profile will fix this bug for
all bourne-compatible shells.
+ 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 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.
+
+ Users of the fish shell don't need to do anything, for them the workaround is
+ installed automatically with the packge.
+
GETTING GCONF PROFILES TO WORK
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Gconf profiles don't work out-of-the box. The reason for this is that the
diff --git a/csh.login-snippet b/csh.login-snippet
new file mode 100755
index 0000000..eb63e78
--- /dev/null
+++ b/csh.login-snippet
@@ -0,0 +1,22 @@
+#!/bin/csh
+
+# 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).
+set DESKTOP_PROFILES_SNIPPET="/usr/share/desktop-profiles/get_desktop-profiles_variables"
+if (-e $DESKTOP_PROFILES_SNIPPET) then
+ # initialization
+ set 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
+
+ # convert to csh format and source to set the required environment variables
+ sed -i 's/^\(.*\)=\(.*\)$/setenv \1 \2/' $TEMP_FILE
+ source $TEMP_FILE
+
+ # cleanup
+ rm $TEMP_FILE
+endif
diff --git a/debian/changelog b/debian/changelog
index 907c91d..c5c6dc0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,8 +3,10 @@ desktop-profiles (1.4.10) UNRELEASED; 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.
- -- Bart Cornelis (cobaco) <cobaco at linux.be> Wed, 18 Jan 2006 09:09:01 +0100
+ -- Bart Cornelis (cobaco) <cobaco at linux.be> Tue, 31 Jan 2006 20:45:02 +0100
desktop-profiles (1.4.9) unstable; urgency=low
diff --git a/debian/rules b/debian/rules
index 567cdb7..b6893c8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -39,12 +39,13 @@ binary-indep: build install
dh_installmenu
dh_installman desktop-profiles.7 list-desktop-profiles.1 dh_installlisting.1 profile-manager.1 path2listing.1
dh_install dh_installlisting profile-manager usr/bin
- dh_install listingmodule path usr/share/desktop-profiles/
+ 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 usr/share/doc/desktop-profiles/examples
+ dh_install profile-snippet csh.login-snippet zlogin-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
+ dh_install desktop-profiles.fish etc/fish.d/
dh_install 20desktop-profiles_activateDesktopProfiles etc/X11/Xsession.d/
dh_install path2listing usr/sbin
./dh_installlisting
diff --git a/desktop-profiles.fish b/desktop-profiles.fish
new file mode 100755
index 0000000..407f93f
--- /dev/null
+++ b/desktop-profiles.fish
@@ -0,0 +1,21 @@
+#!/usr/bin/fish
+
+# 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).
+set -l DESKTOP_PROFILES_SNIPPET "/usr/share/desktop-profiles/get_desktop-profiles_variables"
+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
+ bash $DESKTOP_PROFILES_SNIPPET $TEMP_FILE
+
+ # convert to zsh format and source to set the required environment variables
+ sed -i 's/^\(.*\)=\(.*\)$/set -g -x \1 \2/' $TEMP_FILE
+ . $TEMP_FILE
+
+ # cleanup
+ rm $TEMP_FILE
+end
diff --git a/get_desktop-profiles_variables b/get_desktop-profiles_variables
new file mode 100755
index 0000000..ed19eb2
--- /dev/null
+++ b/get_desktop-profiles_variables
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# This script is used by desktop-profiles to solve the corner-case of starting X
+# programs over an ssh connection with non-bourne compatible bugs. It's not meant
+# to be executed directly.
+#
+# it writes the necessary environment variables in VARIABLE=VALUE format to a
+# file that can then be sourced by non-bourne-compatible shells.
+#
+# $1 = file to write environment variable settings to
+###############################################################################
+
+# testing SSH_CLIENT as the woody ssh doesn't set SSH_CONNECTION
+# also testing SSH_CONNECTION as the current ssh manpage no longer mentions
+# SSH_CLIENT, so it appears that variable is being phased out.
+if ( ( (test -n "${SSH_CLIENT}") || (test -n "${SSH_CONNECTION}") ) && \
+ (test -n "${DISPLAY}") || true); then
+ # get the variables
+ . /etc/X11/Xsession.d/20desktop-profiles_activateDesktopProfiles;
+
+ # write them to a file
+ env | grep 'KDEDIRS\|XDG_CONFIG_DIRS\|XDG_DATA_DIRS\|CHOICESPATH\|UDEdir\|GNUSTEP_PATHLIST\|MANDATORY_PATH\|DEFAULTS_PATH' > "$1";
+else
+ # make sure the file is there
+ touch "$1"
+fi;
diff --git a/zlogin-snippet b/zlogin-snippet
new file mode 100755
index 0000000..4b226c1
--- /dev/null
+++ b/zlogin-snippet
@@ -0,0 +1,21 @@
+#!/bin/zsh
+
+# 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 (test -f $DESKTOP_PROFILES_SNIPPET) then
+ 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
+
+ # convert to zsh format and source to set the required environment variables
+ sed -i 's/^\(.*=.*\)$/export \1/' $TEMP_FILE
+ source $TEMP_FILE
+
+ # cleanup
+ rm $TEMP_FILE
+fi
--
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