Patch Comments! - After much delay

Mark Lee mplee at shaw.ca
Tue Jan 21 17:48:31 PST 2003


After way too many distractions I have finally managed to get some work done 
on the patch comments. I apologize for the very long delay. The comments are 
below. I was not able to come up with a comment for the vim patch, the 
sh-utils (non-hostname) patch, the procps patch, or the glibc-libnss patch. I 
couldn't figure out the exact purpose of thes patches. If you need anything 
else from me don't hesitate to ask.

Ed patch:
-----------------
Ed uses mktemp to create temporary files in /tmp, but this function has a 
security vulnerability (see section on Temporary Files in 
http://en.tldp.org/HOWTO/Secure-Programs-HOWTO/avoid-race.html). This patch 
makes Ed use mkstemp instead, which is the recommended way to create 
temporary files.
----------------------

Fileutils patch:
-----------------
There is a documented (see 
http://mail.gnu.org/pipermail/bug-glibc/2001-May/003149.html) bug with the 
atexit() function in glibc-2.2.3 when it is compiled with gcc-2.95.3. This 
bug only occurs on some systems (primarily AMD, but not exclusively). This 
bug causes segmentation faults in fileutils-4.1 when it is compiled 
statically. This patch causes on_exit() to be called instead of atexit().

This patch will only work on systems whose host has glibc-2.2.3 and even then, 
it might cause the fileutils compilation to fail. If this patch breaks the 
compilation than do not use it.
---------------

Findutils patch:
----------------
Findutils declares a function called basename, but this function name is 
already used by the C standard libraries. This patch changes the Findutils 
version of basename function so that it is called basename2 instead.

Findutils uses an incorrect way to use library files. It declares library 
functions, to tell the compiler what the name of the function will be when 
the libraries are linked in. This syntax is invalid and causes compiler 
warnings/errors. This patch removes this improper syntax.

Every GNU package is supposed use a macro called _GNU_SOURCE. This macro 
enables declarations of GNU library extension functions and so the compiler 
will be able to detect name conflicts between functions more easily. This 
patch adds this macro to the source code.
------------

Findutils Segfault patch:
--------------
Must be applied in addition to Findutils patch.

There is a bug in locate.c of Findutils that causes a segmentation fault to 
occur on very long path names. The problem is caused by the get_short() 
function calculating negative numbers incorrectly. This patch corrects this 
bug.
-------------

Gawk patch:
-------------
Gawk's default location for libexecdir is $prefix/libexecdir/awk. This 
location doesn't comply with FHS (FHS never mentions a directory called 
libexecdir).

The patch allows us to pass --libexecdir to the configure script (without gawk 
tacking on /awk to the end), so that we can use a more appropriate location 
for gawk's libexecdir (/usr/bin in the book).

On a make uninstall, gawk's default action is to delete everything in its 
libexecdir, but since we have changed gawk's libexecdir to /usr/bin, this 
would delete everything in /usr/bin (not a desirable action). The patch 
ensures that only the files created by the gawk install are removed on a make 
uninstall.

Also, the default data directory for gawk is $prefix/share/awk. A package 
specific directory should be named after the package and the version 
(gawk-3.1.1 instead of awk) because there may be more than one awk 
interpreter on a system (and more than one version of gawk).The patch changes 
this to $prefix/share/gawk-3.1.1 to be more correct.

Finally, the patch ensures that this directory ($prefix/share/gawk-3.1.1) is 
removed along with its contents on a make uninstall (by default make 
uninstall did not delete this directory).
-------------

glibc root perl patch:
----------------
This patch replaces all occurences of root with 0. This is done because Glibc 
itself isn't installed yet and therefore username to userid resolving isn't 
working yet, so a chown root file will fail, however it'll work fine if you 
use the numeric IDs (such as chown 0 file).

This patch also replaces $(PERL) with /usr/bin/perl. This is done because 
Glibc can't autodetect the location of perl because the Perl package hasn't 
been installed yet. The program mtrace is written in perl. mtrace will not 
work until perl is installed.
----------------

gzip patch:
----------------
This patch fixes a buffer overflow that occurs when a filename is longer than 
1020 characters. It does this by inserting a check that the buffer is large 
enough for the given filename. The program exits with the message "Filename 
too long" the buffer is not large enough.
--------------

kbd patch:
-------------
There are 8 programs included in the kbd package, but not installed by default 
(screendump, setlogcons, setvesablank, spawn_console, spawn_login, getunimap, 
clrunimap, and outpsfheader). 5 of these programs are either dangerous, 
deprecated, or just not meant to be used, but the other 3 (setlogcons, 
setvesablank, getunimap) are quite useful. This patch changes the 
src/Makefile.in to install these 3 programs by default.
---------------

man 80 cols patch:
---------------
groff-1.18 uses a new commang to set the line length of a man page. The old 
command is .ll, but the new command is LL. If the old command is used, than 
only 80 columns will be displayed on a screen with more than 80 columns. This 
patch causes Man to use the new line length command. Do not apply this patch 
if you intend to use a version of groff lower than 1.18.
---------------

man manpath patch:
-----------------
We use a symlink from /usr/man to /usr/share/man. This causes programs like 
whatis to find man pages twice. This patch removes /usr/man from the MANPATH, 
because for us it is redundant.
-----------------

man pager patch:
----------------
This patch causes the -R option to be passed to the PAGER so that special 
escape sequences, like color, are displayed properly. For more information on 
the -R option see man less.
------------------

sh-utils hostname patch:
-----------------
Edits Makefile.in so that the hostname program is not built or installed. This 
patch suppresses the build of the hostname program which will be installed 
later with the net-tools package. The hostname program from the net-tools 
package is a much better version (and in some cases even required since it 
supports options that are needed by some programs such as XFree86).
----------------------

tar patch:
-------------------
Adds -j,--bunzip2, -- bzip2 options to tar to extract .tar.bz2 files with 
bzip2 much like the -z option extracts .tar.gz files with gzip.
--------------------

Mark Lee
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list