Bug 847102
| Summary: | source command fails with single-line if-statement | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Bob Arendt <rda> | ||||||
| Component: | tcsh | Assignee: | Roman Kollár <rkollar> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Iveta Wiedermann <isenfeld> | ||||||
| Severity: | urgent | Docs Contact: | |||||||
| Priority: | unspecified | ||||||||
| Version: | 6.3 | CC: | amy.murtha, angelotech, isenfeld, kekelley, kvolny, mtmiller, ngalvin, ovasik, pasteur, praiskup, todoleza | ||||||
| Target Milestone: | rc | Keywords: | Regression | ||||||
| Target Release: | --- | ||||||||
| Hardware: | i686 | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | |||||||||
| : | 858281 (view as bug list) | Environment: | |||||||
| Last Closed: | 2013-02-21 10:44:29 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Bug Depends On: | |||||||||
| Bug Blocks: | 858281 | ||||||||
| Attachments: |
|
||||||||
|
Description
Bob Arendt
2012-08-09 17:42:44 UTC
Here's a quick patch to the spec file that removes the problem patch. When a fixed version is released via RHN, please bump the release number past 20 so we'll be sure to pick up the updated package. We've got to push this internal release to stay in production.
--- rpmbuild/SPECS/tcsh.spec_orig 2012-05-10 06:19:18.000000000 -0700
+++ rpmbuild/SPECS/tcsh.spec_revert 2012-08-09 16:41:21.000000000 -0700
@@ -3,7 +3,7 @@
Summary: An enhanced version of csh, the C shell
Name: tcsh
Version: 6.17
-Release: 19%{?dist}
+Release: 20%{?dist}
License: BSD
Group: System Environment/Shells
Source: ftp://ftp.astron.com/pub/tcsh/%{name}-%{version}.00.tar.gz
@@ -28,7 +28,7 @@
Patch25: tcsh-6.17.00-child-kill-hang.patch
Patch26: tcsh-6.17.00-variable-names.patch
Patch30: tcsh-6.17.00-handle-signals-before-flush.patch
-Patch31: tcsh-6.17.00-history-file-locking.patch
+#Patch31: tcsh-6.17.00-history-file-locking.patch
Patch32: tcsh-6.17.00-posix-exit-status-value.patch
Provides: csh = %{version}
@@ -69,7 +69,7 @@
%patch25 -p1 -b .child-kill-hang
%patch26 -p1 -b .variable-names
%patch30 -p1 -b .handle-signals-before-flush
-%patch31 -p1 -b .history-file-locking
+#%patch31 -p1 -b .history-file-locking
%patch32 -p1 -b .posix-exit-status-value
for i in Fixes WishList; do
@@ -144,6 +144,10 @@
%{_mandir}/man1/*.1*
%changelog
+* Thu Aug 09 2012 Bob Arendt <rda> - 6.17-20
+- Remove history-file-locking.patch
+ Breaks single line "if (..) source <somefile>" tcsh logic (#847102)
+
* Thu May 10 2012 Vojtech Vitek (V-Teq) <vvitek> - 6.17-19
- Revert srcfile behaviour to return backward-compatible error codes (#658074)
---------------------------------
*** Bug 826140 has been marked as a duplicate of this bug. *** Created attachment 606312 [details]
Proposed patch to fix the source command
The problem is caused by calling dosource() through a function pointer which doesn't have the flg argument. Other builtins don't need it, so I added an exception for dosource so it's now called directly.
Created attachment 606398 [details] Alternate patch for dosource() (In reply to comment #8) > Created attachment 606312 [details] > Proposed patch to fix the source command Good find - that K&R style code looks like it has declaration prototypes disabled. It makes it easy to supply the wrong argument count. The only issue with this and the previous history patch is that they break builds on some other platforms which *do* use prototypes: From sh.h: 942 #if defined(hpux) && defined(__STDC__) && !defined(__GNUC__) 943 /* Avoid hpux ansi mode spurious warnings */ 944 typedef void (*bfunc_t) (); 945 #else 946 typedef void (*bfunc_t) (Char **, struct command *); 947 #endif /* hpux && __STDC__ && !__GNUC__ */ Some non-__GNUC__ plaforms will get prototypes. So all the commands should only have 2 args. Although these platforms may be unsupported by RedHat, it's unlikely that upstream would accept patches that broke other architectures. Also it might be nice if prototypes were enabled for gcc; It would certainly make maintanence easier. Looking through the source, it looks like the thing to do is rename dosource to dosource_lck(), using the 3-arg dosource_lck() for all the direct calls in the code. Then make a dosource() wrapper for dosource_lck() with flg=0. So all source file reads are not locked - historically true, and should be pretty safe. I've attached a patch that implements this. I've built a rpm and hope to get some testing in on it. Unfortunately we don't have a rigorous test suite .. we just seem to get bitten by bugs. *** Bug 828772 has been marked as a duplicate of this bug. *** *** Bug 857019 has been marked as a duplicate of this bug. *** Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0446.html |