From 9d5844ce6663842f728feb9c9dc72f1705a3ae3f Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Tue, 21 Oct 2008 17:16:49 +0000 Subject: [PATCH] fix #467025 - Ksh fails to initialise environment when login from graphic console --- dotkshrc | 8 ++++++++ ksh.spec | 12 +++++++++++- kshrc.rhs | 25 +++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 dotkshrc create mode 100644 kshrc.rhs diff --git a/dotkshrc b/dotkshrc new file mode 100644 index 0000000..3175df7 --- /dev/null +++ b/dotkshrc @@ -0,0 +1,8 @@ +# .kshrc + +# Source global definitions +if [ -f /etc/kshrc ]; then + . /etc/kshrc +fi + +# User specific aliases and functions diff --git a/ksh.spec b/ksh.spec index 487d5a5..9530e28 100644 --- a/ksh.spec +++ b/ksh.spec @@ -8,10 +8,12 @@ URL: http://www.kornshell.com/ Group: System Environment/Shells License: CPL Version: 20080725 -Release: 3%{?dist} +Release: 4%{?dist} Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.tgz Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{releasedate}.tgz Source2: http://www.research.att.com/~gsf/download/tgz/ast-ksh-locale.%{releasedate}.tgz +Source3: kshrc.rhs +Source4: dotkshrc #Patch0: ksh-20041225-gcc4.patch Patch1: ksh-20070328-uname.patch Patch2: ksh-20070328-useex.patch @@ -67,6 +69,9 @@ install -m 644 share/lib/locale/$i/LC_MESSAGES/* \ $RPM_BUILD_ROOT%{_datadir}/locale/$i/LC_MESSAGES/ done ln -sf /bin/ksh $RPM_BUILD_ROOT/usr/bin/ksh +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/skel +install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.kshrc +install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/kshrc %post if [ ! -f /etc/shells ]; then @@ -100,11 +105,16 @@ fi /usr//bin/ksh %{_datadir}/locale/*/LC_MESSAGES/* %{_mandir}/man1/* +%config(noreplace) %{_sysconfdir}/skel/.kshrc +%config(noreplace) %{_sysconfdir}/kshrc %clean rm -rf $RPM_BUILD_ROOT %changelog +* Tue Oct 21 2008 Michal Hlavinka 20080202-4 +- fix #467025 - Ksh fails to initialise environment when login from graphic console + * Wed Aug 06 2008 Tomas Smetana 20080725-3 - fix BuildRequires, rebuild diff --git a/kshrc.rhs b/kshrc.rhs new file mode 100644 index 0000000..b143224 --- /dev/null +++ b/kshrc.rhs @@ -0,0 +1,25 @@ +# +# /etc/kshrc is sourced in interactive shells. It +# should contain commands to set up aliases, functions, +# options, key bindings, etc. +# + +# Set prompts +#PROMPT='[%n@%m]%~%# ' # default prompt +#RPROMPT=' %~' # prompt for right side of screen + +_src_etc_profile_d() +{ + # from zshrc, with ksh fixes + if [[ ! -o login ]]; then # We're not a login shell + for i in /etc/profile.d/*.sh; do + if [ -r "$i" ]; then + . $i + fi + done + unset i + fi +} +_src_etc_profile_d + +unset -f _src_etc_profile_d