Bug 545398

Summary: etags messes up filenames
Product: [Fedora] Fedora Reporter: Sjoerd Mullender <sjoerd>
Component: emacsAssignee: Karel Klíč <kklic>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: jonathan.underwood, kklic, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: emacs-23.1-13.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-04-20 13:09:35 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
Patch for the problem described, replacing strcpy with memmove. none

Description Sjoerd Mullender 2009-12-08 13:26:05 UTC
Created attachment 376898 [details]
Patch for the problem described, replacing strcpy with memmove.

Description of problem:
This is a bug against etags.emacs which is packaged in emacs-common, but there is no separate component called emacs-common.  This same bug exists in etags.xemacs, packaged in xemacs-common.

When etags is run with filenames starting with "./", it normalizes them to start without "./", but does so incorrectly, messing up the result.


Version-Release number of selected component (if applicable):
emacs-common-23.1-13.fc12.x86_64
xemacs-common-21.5.29-8.fc12.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create a file with a C function and path e.g. src/gdk/gdk_atoms.c
2. Run /usr/bin/etags.emacs ./src/gdk/gdk_atoms.c
3. Observe the filename in TAGS
  
Actual results:
The filename recorded in the TAGS file is src/gdk/gdk_otoms.c (note "o" after underscore).

Expected results:
The filename should be src/gdk/gdk_atoms.c

Additional info:
The problem is a call to strcpy on overlapping buffers.  In Fedora 11 and before that seems to have worked, but in Fedora 12 it often does not work, at least not for slightly longer filenames.

The attached patch should also work for etags.xemacs in xemacs-common, except for differing line numbers.

Comment 1 Sjoerd Mullender 2009-12-08 13:31:25 UTC
Also see bug 545399 for the XEmacs version of the bug.

Comment 2 Karel Klíč 2009-12-08 16:52:30 UTC
I cannot reproduce it on 32-bit Fedora, but the usage of strcpy in the code is clearly wrong. Moreover, this bug is already fixed in the upstream CVS.

Comment 3 Karel Klíč 2009-12-08 17:29:57 UTC
http://koji.fedoraproject.org/koji/taskinfo?taskID=1863033

The fix will be a part of next update.

Thanks for nicely detailed bug report.

Comment 4 Fedora Update System 2010-03-30 23:18:05 UTC
emacs-23.1-11.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/emacs-23.1-11.fc11

Comment 5 Fedora Update System 2010-04-01 01:41:57 UTC
emacs-23.1-11.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update emacs'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/emacs-23.1-11.fc11

Comment 6 Fedora Update System 2010-04-01 16:10:06 UTC
emacs-23.1-13.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/emacs-23.1-13.fc11

Comment 7 Fedora Update System 2010-04-09 01:45:18 UTC
emacs-23.1-13.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update emacs'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/emacs-23.1-13.fc11

Comment 8 Fedora Update System 2010-04-20 13:08:50 UTC
emacs-23.1-13.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.