Discussion:
[Bug 161] New: etags munges relative filenames (any path containing "..") in TAGS files
i***@sxemacs.org
2013-08-25 05:34:24 UTC
Permalink
http://issues.sxemacs.org/show_bug.cgi?id=161

Bug ID: 161
Summary: etags munges relative filenames (any path containing
"..") in TAGS files
Classification: Unclassified
Product: SXEmacs
Version: 22.1.15
Hardware: PC
OS: Linux
Status: NEW
Severity: major
Priority: P3
Component: General
Assignee: ***@sxemacs.org
Reporter: ***@sxemacs.org
QA Contact: sxemacs-***@sxemacs.org

So I made a TAGS file with...

etags ../../src/*.c

(on our src directory in case you're wondering)

Lets look at the filenames in the TAGS file now...

grep ../ TAGS|head -n15

../../rev.cbbrev,1312
../../src/alloc,23362
../../oca.clloca,3153
../../src/bloom,1599
../../fer.cuffer,9144
../../ecodeytecode,8806
../../lint.allint,2168
../../lprocallproc,1157
../../src/casefiddle,1222
../../etab.asetab,1536
../../egoryategory,171
../../rtab.hartab,5161
../../loop.mdloop,1786
../../src/cmds,1369
../../src/data,11951


etags --version
etags (SXEmacs v22.1.15-93-gadc5b24)
@(#) pot revision number is 17.38.1.4
Copyright (C) 2008 Free Software Foundation, Inc.
This program is distributed under the terms in ETAGS.README

Nelson, is it possible that those coverity fixes you made in etags.c could have
anything to do with this?
--
You are receiving this mail because:
You are the QA Contact for the bug.
i***@sxemacs.org
2013-08-25 16:48:57 UTC
Permalink
http://issues.sxemacs.org/show_bug.cgi?id=161

Nelson Ferreira <***@sxemacs.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED

--- Comment #1 from Nelson Ferreira <***@sxemacs.org> ---
Yes, it is very possible. I'll take a look.

Mine is a little saner though:


$ grep ../ TAGS | head -15
../src/abbrev.,1312
../src/alloca.,3153
../src/alloc.,23362
../src/bloom.,1599
../src/buffer.,9144
../src/bytecode.,8806
../src/callint.,2168
../src/callproc.,1157
../src/casefiddle.,1222
../src/casetab.,1536
../src/category.,171
../src/chartab.,5161
../src/cmdloop.,1786
../src/cmds.,1369
../src/data.,11951


$ lib-src/etags --version
etags (SXEmacs v22.1.15-91-g9901a2f)
@(#) pot revision number is 17.38.1.4
Copyright (C) 2008 Free Software Foundation, Inc.
This program is distributed under the terms in ETAGS.README
--
You are receiving this mail because:
You are the QA Contact for the bug.
i***@sxemacs.org
2013-08-25 18:34:30 UTC
Permalink
http://issues.sxemacs.org/show_bug.cgi?id=161

Nelson Ferreira <***@sxemacs.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED

--- Comment #2 from Nelson Ferreira <***@sxemacs.org> ---
commit 289b9d856af2c306368a38cb4771d42063a63894
Author: Nelson Ferreira <***@ieee.org>
Date: Sun Aug 25 14:33:44 2013 -0400

Bug fix: 161 etags munges relative filenames (any path containing "..") in
TAGS files

Two bugs fixed here. One was Coverity induced, but another one,
the strcpy -> memmove change is a real issue regarding copying in
overlapping memory.

* lib-src/etags.c (relative_filename): Correct off-by-1 error in
counting down remaining bytes.

* lib-src/etags.c (absoulte_filename): Change strcpy to memmove
since this is a guaranteed overlapping memory copy, and strcpy is
not guaranteed by POSIX to handle it properly.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/stpcpy.html

"If copying takes place between objects that overlap, the behavior is
undefined."

Signed-off-by: Nelson Ferreira <***@ieee.org>
--
You are receiving this mail because:
You are the QA Contact for the bug.
i***@sxemacs.org
2013-08-25 18:35:55 UTC
Permalink
http://issues.sxemacs.org/show_bug.cgi?id=161

--- Comment #3 from Nelson Ferreira <***@sxemacs.org> ---
Just in case it interests you I now get this:


$ grep ../ TAGS | head -15
../src/abbrev.c,1312
../src/alloca.c,3153
../src/alloc.c,23362
../src/bloom.c,1599
../src/buffer.c,9144
../src/bytecode.c,8806
../src/callint.c,2168
../src/callproc.c,1157
../src/casefiddle.c,1222
../src/casetab.c,1536
../src/category.c,171
../src/chartab.c,5161
../src/cmdloop.c,1786
../src/cmds.c,1369
../src/data.c,11951
--
You are receiving this mail because:
You are the QA Contact for the bug.
i***@sxemacs.org
2013-08-29 12:55:25 UTC
Permalink
http://issues.sxemacs.org/show_bug.cgi?id=161

--- Comment #4 from Nelson Ferreira <***@sxemacs.org> ---
commit 0e3b827564e68c4d94277db9755decc7f6677195
Author: Nelson Ferreira <***@ieee.org>
Date: Thu Aug 29 07:54:46 2013 -0400

Bug fix: Fix for bug 161 broke -nw

sxemacs -nw would quit right after startup

* src/lread.c (locate_file_in_directory_mapper): Only close
closure->fd if non-zero, which would be the result of the attempt
to check the file using access.

Signed-off-by: Nelson Ferreira <***@ieee.org>
--
You are receiving this mail because:
You are the QA Contact for the bug.
i***@sxemacs.org
2013-08-29 13:14:29 UTC
Permalink
http://issues.sxemacs.org/show_bug.cgi?id=161

--- Comment #5 from Nelson Ferreira <***@sxemacs.org> ---
Sorry this was an off-by-one on the bug number :)
--
You are receiving this mail because:
You are the QA Contact for the bug.
i***@sxemacs.org
2016-05-06 08:07:01 UTC
Permalink
http://issues.sxemacs.org/show_bug.cgi?id=161

Steve Youngs <***@sxemacs.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--
You are receiving this mail because:
You are the QA Contact for the bug.
Loading...