Bug 314431

Summary: keychain.sh not ksh compatible
Product: [Fedora] Fedora Reporter: Daniel Qarras <dqarras>
Component: keychainAssignee: Alexander Dalloz <alex>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 10CC: jschauma, ville.skytta
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.6.8-6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-13 20:48:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
proposed patch
none
Drop zsh special case none

Description Daniel Qarras 2007-10-01 18:32:59 UTC
/etc/profile.d/*.sh init scripts are sourced for all Bourne compatible shells
including bash, zsh, and ksh. However, /etc/profile.d/keychain.sh contains a
line that causes ksh-20070111-1 from Fedora 7 to puke at line 19 when a user is
logging in:

/etc/profile[49]: .: syntax error: `=' unexpected

I think keychain.sh should be fixed to be also ksh compatible.

Comment 1 Daniel Qarras 2007-12-29 16:13:08 UTC
This issue seems to present also with Fedora 8.

Comment 2 Daniel Qarras 2008-10-04 08:57:15 UTC
This issue seems to present also with Fedora 10 Beta.

Comment 3 John Poelstra 2008-10-10 22:13:34 UTC
This bug has been triaged

Comment 4 Bug Zapper 2008-11-26 02:00:13 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Watanabe, Yuki 2008-12-22 15:48:59 UTC
Created attachment 327665 [details]
proposed patch

The problem is that the parameter expansions ${=KCHOPTS} ${=SSHKEYS} ${=GPGKEYS}
are only executed by zsh but parsed by all shells.
I'm using the eval command to make the expansions to be parsed only when
they are executed.

Comment 6 Daniel Qarras 2008-12-22 22:16:08 UTC
Thanks for the patch, I'm happy to confirm that it fixes the issue.

Comment 7 Ville Skyttä 2009-02-16 23:29:29 UTC
*** Bug 485725 has been marked as a duplicate of this bug. ***

Comment 8 Ville Skyttä 2009-02-16 23:45:12 UTC
Created attachment 332154 [details]
Drop zsh special case

Hmm... with zsh >= 4.3.4-7 sourcing profile.d snippets in ksh emulation mode, is the zsh special case in /etc/profile.d/keychain.sh needed any more at all?  Wouldn't this patch work for both ksh and zsh?

Comment 9 Daniel Qarras 2009-04-03 15:10:47 UTC
There has been discussion that zsh should emulate sh instead of ksh:

https://bugzilla.redhat.com/show_bug.cgi?id=430665
https://bugzilla.redhat.com/show_bug.cgi?id=460741

IMVHO it would be safer to keep keychain.sh as-is: the code may look a bit cleaner and be slightly more optimal but given the potential risk of keychain.sh breaking as a side effect of other changes it seems best to leave this intact.

Thanks.

Comment 10 Ville Skyttä 2009-04-13 20:48:39 UTC
The change proposed in comment 8 was already applied in keychain 2.6.8-6 (F-11+ at the moment) some 6 weeks ago.  If actual problems arise out of it, please open a new keychain/zsh specific bug for it (this one's against keychain.sh not working with ksh).

Comment 11 Daniel Qarras 2009-04-14 16:23:31 UTC
Ah, ok, I was probably asleep when I made my previous commment, the current keychain.sh from Rawhide looks perfect to me. Thanks!