Habe IPFire auf LFS 6.2 gebracht.

Das hier ist der erste Teil.
Nur Toolchain bisher.


git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@297 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2006-09-30 16:33:03 +00:00
parent f522e3076b
commit dd714b8aad
52 changed files with 9252 additions and 466 deletions

View File

@@ -0,0 +1,723 @@
Submitted By: Jeremy Huntwork (jhuntwork at linuxfromscratch dot org)
Date: 2006-04-11
Initial Package Version: 3.1
Origin: http://ftp.gnu.org/gnu/bash/bash-3.1-patches/
Upstream Status: From Upstream
Description: Contains patches 001-017 from upstream
diff -Naur bash-3.1.orig/arrayfunc.c bash-3.1/arrayfunc.c
--- bash-3.1.orig/arrayfunc.c 2005-07-04 17:25:58.000000000 -0700
+++ bash-3.1/arrayfunc.c 2006-04-19 15:59:29.000000000 -0700
@@ -592,11 +592,7 @@
exp = (char *)xmalloc (len);
strncpy (exp, s, len - 1);
exp[len - 1] = '\0';
-#if 0
- t = expand_string_to_string (exp, 0);
-#else
- t = expand_string_to_string (exp, Q_DOUBLE_QUOTES);
-#endif
+ t = expand_arith_string (exp, 0);
this_command_name = (char *)NULL;
val = evalexp (t, &expok);
free (t);
diff -Naur bash-3.1.orig/doc/bash.1 bash-3.1/doc/bash.1
--- bash-3.1.orig/doc/bash.1 2005-10-12 08:40:52.000000000 -0700
+++ bash-3.1/doc/bash.1 2006-04-19 15:58:34.000000000 -0700
@@ -6,12 +6,12 @@
.\" Case Western Reserve University
.\" chet@po.cwru.edu
.\"
-.\" Last Change: Sat Aug 27 13:28:44 EDT 2005
+.\" Last Change: Wed Dec 28 19:58:45 EST 2005
.\"
.\" bash_builtins, strip all but Built-Ins section
.if \n(zZ=1 .ig zZ
.if \n(zY=1 .ig zY
-.TH BASH 1 "2005 Aug 27" "GNU Bash-3.1-beta1"
+.TH BASH 1 "2005 Dec 28" "GNU Bash-3.1"
.\"
.\" There's some problem with having a `@'
.\" in a tagged paragraph with the BSD man macros.
@@ -677,8 +677,8 @@
.B nocasematch
is enabled, the match is performed without regard to the case
of alphabetic characters.
-The return value is 0 if the string matches or does not match
-the pattern, respectively, and 1 otherwise.
+The return value is 0 if the string matches (\fB==\fP) or does not match
+(\fB!=\fP) the pattern, and 1 otherwise.
Any part of the pattern may be quoted to force it to be matched as a
string.
.if t .sp 0.5
@@ -807,6 +807,12 @@
as for pathname expansion (see
.B Pathname Expansion
below).
+The \fIword\fP is expanded using tilde
+expansion, parameter and variable expansion, arithmetic substituion,
+command substitution, process substitution and quote removal.
+Each \fIpattern\fP examined is expanded using tilde
+expansion, parameter and variable expansion, arithmetic substituion,
+command substitution, and process substitution.
If the shell option
.B nocasematch
is enabled, the match is performed without regard to the case
@@ -8484,7 +8490,7 @@
returns true if any of the arguments are found, false if
none are found.
.TP
-\fBulimit\fP [\fB\-SHacdflmnpstuv\fP [\fIlimit\fP]]
+\fBulimit\fP [\fB\-SHacdfilmnpqstuvx\fP [\fIlimit\fP]]
Provides control over the resources available to the shell and to
processes started by it, on systems that allow such control.
The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is
@@ -8523,6 +8529,9 @@
.B \-f
The maximum size of files created by the shell
.TP
+.B \-i
+The maximum number of pending signals
+.TP
.B \-l
The maximum size that may be locked into memory
.TP
@@ -8536,6 +8545,9 @@
.B \-p
The pipe size in 512-byte blocks (this may not be set)
.TP
+.B \-q
+The maximum number of bytes in POSIX message queues
+.TP
.B \-s
The maximum stack size
.TP
@@ -8547,6 +8559,9 @@
.TP
.B \-v
The maximum amount of virtual memory available to the shell
+.TP
+.B \-x
+The maximum number of file locks
.PD
.PP
If
diff -Naur bash-3.1.orig/doc/bashref.texi bash-3.1/doc/bashref.texi
--- bash-3.1.orig/doc/bashref.texi 2005-10-03 12:07:21.000000000 -0700
+++ bash-3.1/doc/bashref.texi 2006-04-19 15:58:34.000000000 -0700
@@ -961,8 +961,8 @@
(see the description of @code{shopt} in @ref{Bash Builtins})
is enabled, the match is performed without regard to the case
of alphabetic characters.
-The return value is 0 if the string matches or does not match
-the pattern, respectively, and 1 otherwise.
+The return value is 0 if the string matches (@samp{==}) or does not
+match (@samp{!=})the pattern, and 1 otherwise.
Any part of the pattern may be quoted to force it to be matched as a
string.
@@ -2598,7 +2598,7 @@
Builtin commands are necessary to implement functionality impossible
or inconvenient to obtain with separate utilities.
-This section briefly the builtins which Bash inherits from
+This section briefly describes the builtins which Bash inherits from
the Bourne Shell, as well as the builtin commands which are unique
to or have been extended in Bash.
@@ -3833,7 +3833,7 @@
@item ulimit
@btindex ulimit
@example
-ulimit [-acdflmnpstuvSH] [@var{limit}]
+ulimit [-acdfilmnpqstuvxSH] [@var{limit}]
@end example
@code{ulimit} provides control over the resources available to processes
started by the shell, on systems that allow such control. If an
@@ -3857,6 +3857,9 @@
@item -f
The maximum size of files created by the shell.
+@item -i
+The maximum number of pending signals.
+
@item -l
The maximum size that may be locked into memory.
@@ -3869,6 +3872,9 @@
@item -p
The pipe buffer size.
+@item -q
+The maximum number of bytes in POSIX message queues.
+
@item -s
The maximum stack size.
@@ -3881,6 +3887,9 @@
@item -v
The maximum amount of virtual memory available to the process.
+@item -x
+The maximum number of file locks.
+
@end table
If @var{limit} is given, it is the new value of the specified resource;
@@ -4089,8 +4098,8 @@
Print shell input lines as they are read.
@item -x
-Print a trace of simple commands, \fBfor\fP commands, \fBcase\fP
-commands, \fBselect\fP commands, and arithmetic \fBfor\fP commands
+Print a trace of simple commands, @code{for} commands, @code{case}
+commands, @code{select} commands, and arithmetic @code{for} commands
and their arguments or associated word lists after they are
expanded and before they are executed. The value of the @env{PS4}
variable is expanded and the resultant value is printed before
diff -Naur bash-3.1.orig/doc/version.texi bash-3.1/doc/version.texi
--- bash-3.1.orig/doc/version.texi 2005-09-20 11:52:56.000000000 -0700
+++ bash-3.1/doc/version.texi 2006-04-19 15:58:34.000000000 -0700
@@ -2,9 +2,9 @@
Copyright (C) 1988-2005 Free Software Foundation, Inc.
@end ignore
-@set LASTCHANGE Mon Sep 5 11:47:04 EDT 2005
+@set LASTCHANGE Fri Dec 30 10:50:51 EST 2005
-@set EDITION 3.1-beta1
-@set VERSION 3.1-beta1
-@set UPDATED 5 September 2005
-@set UPDATED-MONTH September 2005
+@set EDITION 3.1
+@set VERSION 3.1
+@set UPDATED 30 December 2005
+@set UPDATED-MONTH December 2005
diff -Naur bash-3.1.orig/jobs.c bash-3.1/jobs.c
--- bash-3.1.orig/jobs.c 2005-11-11 20:13:27.000000000 -0800
+++ bash-3.1/jobs.c 2006-04-19 15:58:34.000000000 -0700
@@ -619,8 +619,11 @@
* once in the parent and once in each child. This is where
* the parent gives it away.
*
+ * Don't give the terminal away if this shell is an asynchronous
+ * subshell.
+ *
*/
- if (job_control && newjob->pgrp)
+ if (job_control && newjob->pgrp && (subshell_environment&SUBSHELL_ASYNC) == 0)
give_terminal_to (newjob->pgrp, 0);
}
}
@@ -844,9 +847,10 @@
realloc_jobs_list ()
{
sigset_t set, oset;
- int nsize, i, j;
+ int nsize, i, j, ncur, nprev;
JOB **nlist;
+ ncur = nprev = NO_JOB;
nsize = ((js.j_njobs + JOB_SLOTS - 1) / JOB_SLOTS);
nsize *= JOB_SLOTS;
i = js.j_njobs % JOB_SLOTS;
@@ -854,17 +858,51 @@
nsize += JOB_SLOTS;
BLOCK_CHILD (set, oset);
- nlist = (JOB **) xmalloc (nsize * sizeof (JOB *));
+ nlist = (js.j_jobslots == nsize) ? jobs : (JOB **) xmalloc (nsize * sizeof (JOB *));
+
for (i = j = 0; i < js.j_jobslots; i++)
if (jobs[i])
- nlist[j++] = jobs[i];
+ {
+ if (i == js.j_current)
+ ncur = j;
+ if (i == js.j_previous)
+ nprev = j;
+ nlist[j++] = jobs[i];
+ }
+
+#if defined (DEBUG)
+ itrace ("realloc_jobs_list: resize jobs list from %d to %d", js.j_jobslots, nsize);
+ itrace ("realloc_jobs_list: j_lastj changed from %d to %d", js.j_lastj, (j > 0) ? j - 1 : 0);
+ itrace ("realloc_jobs_list: j_njobs changed from %d to %d", js.j_njobs, (j > 0) ? j - 1 : 0);
+#endif
js.j_firstj = 0;
- js.j_lastj = (j > 0) ? j - 1: 0;
+ js.j_lastj = (j > 0) ? j - 1 : 0;
+ js.j_njobs = j;
js.j_jobslots = nsize;
- free (jobs);
- jobs = nlist;
+ /* Zero out remaining slots in new jobs list */
+ for ( ; j < nsize; j++)
+ nlist[j] = (JOB *)NULL;
+
+ if (jobs != nlist)
+ {
+ free (jobs);
+ jobs = nlist;
+ }
+
+ if (ncur != NO_JOB)
+ js.j_current = ncur;
+ if (nprev != NO_JOB)
+ js.j_previous = nprev;
+
+ /* Need to reset these */
+ if (js.j_current == NO_JOB || js.j_previous == NO_JOB || js.j_current > js.j_lastj || js.j_previous > js.j_lastj)
+ reset_current ();
+
+#ifdef DEBUG
+ itrace ("realloc_jobs_list: reset js.j_current (%d) and js.j_previous (%d)", js.j_current, js.j_previous);
+#endif
UNBLOCK_CHILD (oset);
}
@@ -1655,7 +1693,7 @@
In this case, we don't want to give the terminal to the
shell's process group (we could be in the middle of a
pipeline, for example). */
- if (async_p == 0 && pipeline_pgrp != shell_pgrp)
+ if (async_p == 0 && pipeline_pgrp != shell_pgrp && ((subshell_environment&SUBSHELL_ASYNC) == 0))
give_terminal_to (pipeline_pgrp, 0);
#if defined (PGRP_PIPE)
@@ -2198,7 +2236,11 @@
/* This is possibly a race condition -- should it go in stop_pipeline? */
wait_sigint_received = 0;
if (job_control == 0)
- old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
+ {
+ old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler);
+ if (old_sigint_handler == SIG_IGN)
+ set_signal_handler (SIGINT, old_sigint_handler);
+ }
termination_state = last_command_exit_value;
diff -Naur bash-3.1.orig/lib/glob/glob.c bash-3.1/lib/glob/glob.c
--- bash-3.1.orig/lib/glob/glob.c 2005-03-24 09:42:27.000000000 -0800
+++ bash-3.1/lib/glob/glob.c 2006-04-19 15:58:34.000000000 -0700
@@ -360,6 +360,7 @@
count = lose = skip = 0;
firstmalloc = 0;
+ nalloca = 0;
/* If PAT is empty, skip the loop, but return one (empty) filename. */
if (pat == 0 || *pat == '\0')
@@ -546,6 +547,8 @@
firstmalloc = 0;
tmplink = lastlink;
}
+ else
+ tmplink = 0;
free (lastlink->name);
lastlink = lastlink->next;
FREE (tmplink);
diff -Naur bash-3.1.orig/lib/glob/sm_loop.c bash-3.1/lib/glob/sm_loop.c
--- bash-3.1.orig/lib/glob/sm_loop.c 2005-10-16 18:21:04.000000000 -0700
+++ bash-3.1/lib/glob/sm_loop.c 2006-04-19 15:58:34.000000000 -0700
@@ -638,12 +638,13 @@
CHAR *psub; /* pointer to sub-pattern */
CHAR *pnext; /* pointer to next sub-pattern */
CHAR *srest; /* pointer to rest of string */
- int m1, m2;
+ int m1, m2, xflags; /* xflags = flags passed to recursive matches */
#if DEBUG_MATCHING
fprintf(stderr, "extmatch: xc = %c\n", xc);
fprintf(stderr, "extmatch: s = %s; se = %s\n", s, se);
fprintf(stderr, "extmatch: p = %s; pe = %s\n", p, pe);
+fprintf(stderr, "extmatch: flags = %d\n", flags);
#endif
prest = PATSCAN (p + (*p == L('(')), pe, 0); /* ) */
@@ -677,8 +678,12 @@
string matches the rest of the pattern. Also handle
multiple matches of the pattern. */
if (m1)
- m2 = (GMATCH (srest, se, prest, pe, flags) == 0) ||
- (s != srest && GMATCH (srest, se, p - 1, pe, flags) == 0);
+ {
+ /* if srest > s, we are not at start of string */
+ xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags;
+ m2 = (GMATCH (srest, se, prest, pe, xflags) == 0) ||
+ (s != srest && GMATCH (srest, se, p - 1, pe, xflags) == 0);
+ }
if (m1 && m2)
return (0);
}
@@ -704,8 +709,10 @@
srest = (prest == pe) ? se : s;
for ( ; srest <= se; srest++)
{
+ /* if srest > s, we are not at start of string */
+ xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags;
if (GMATCH (s, srest, psub, pnext - 1, flags) == 0 &&
- GMATCH (srest, se, prest, pe, flags) == 0)
+ GMATCH (srest, se, prest, pe, xflags) == 0)
return (0);
}
if (pnext == prest)
@@ -726,7 +733,9 @@
if (pnext == prest)
break;
}
- if (m1 == 0 && GMATCH (srest, se, prest, pe, flags) == 0)
+ /* if srest > s, we are not at start of string */
+ xflags = (srest > s) ? (flags & ~FNM_PERIOD) : flags;
+ if (m1 == 0 && GMATCH (srest, se, prest, pe, xflags) == 0)
return (0);
}
return (FNM_NOMATCH);
diff -Naur bash-3.1.orig/lib/readline/display.c bash-3.1/lib/readline/display.c
--- bash-3.1.orig/lib/readline/display.c 2005-11-30 11:05:02.000000000 -0800
+++ bash-3.1/lib/readline/display.c 2006-04-19 15:58:34.000000000 -0700
@@ -1983,11 +1983,15 @@
int pchar;
{
int len;
- char *pmt;
+ char *pmt, *p;
rl_save_prompt ();
- if (saved_local_prompt == 0)
+ /* We've saved the prompt, and can do anything with the various prompt
+ strings we need before they're restored. We want the unexpanded
+ portion of the prompt string after any final newline. */
+ p = rl_prompt ? strrchr (rl_prompt, '\n') : 0;
+ if (p == 0)
{
len = (rl_prompt && *rl_prompt) ? strlen (rl_prompt) : 0;
pmt = (char *)xmalloc (len + 2);
@@ -1998,19 +2002,17 @@
}
else
{
- len = *saved_local_prompt ? strlen (saved_local_prompt) : 0;
+ p++;
+ len = strlen (p);
pmt = (char *)xmalloc (len + 2);
if (len)
- strcpy (pmt, saved_local_prompt);
+ strcpy (pmt, p);
pmt[len] = pchar;
pmt[len+1] = '\0';
- local_prompt = savestring (pmt);
- prompt_last_invisible = saved_last_invisible;
- prompt_visible_length = saved_visible_length + 1;
- }
+ }
+ /* will be overwritten by expand_prompt, called from rl_message */
prompt_physical_chars = saved_physical_chars + 1;
-
return pmt;
}
diff -Naur bash-3.1.orig/lib/readline/readline.c bash-3.1/lib/readline/readline.c
--- bash-3.1.orig/lib/readline/readline.c 2005-07-04 19:29:35.000000000 -0700
+++ bash-3.1/lib/readline/readline.c 2006-04-19 15:58:34.000000000 -0700
@@ -282,6 +282,7 @@
{
FREE (rl_prompt);
rl_prompt = prompt ? savestring (prompt) : (char *)NULL;
+ rl_display_prompt = rl_prompt ? rl_prompt : "";
rl_visible_prompt_length = rl_expand_prompt (rl_prompt);
return 0;
diff -Naur bash-3.1.orig/lib/readline/terminal.c bash-3.1/lib/readline/terminal.c
--- bash-3.1.orig/lib/readline/terminal.c 2005-11-12 17:46:54.000000000 -0800
+++ bash-3.1/lib/readline/terminal.c 2006-04-19 15:58:34.000000000 -0700
@@ -122,7 +122,7 @@
static char *_rl_visible_bell;
/* Non-zero means the terminal can auto-wrap lines. */
-int _rl_term_autowrap;
+int _rl_term_autowrap = -1;
/* Non-zero means that this terminal has a meta key. */
static int term_has_meta;
@@ -274,6 +274,9 @@
_rl_set_screen_size (rows, cols)
int rows, cols;
{
+ if (_rl_term_autowrap == -1)
+ _rl_init_terminal_io (rl_terminal_name);
+
if (rows > 0)
_rl_screenheight = rows;
if (cols > 0)
diff -Naur bash-3.1.orig/parse.y bash-3.1/parse.y
--- bash-3.1.orig/parse.y 2005-11-11 20:14:18.000000000 -0800
+++ bash-3.1/parse.y 2006-04-19 15:58:34.000000000 -0700
@@ -2716,6 +2716,7 @@
#define P_ALLOWESC 0x02
#define P_DQUOTE 0x04
#define P_COMMAND 0x08 /* parsing a command, so look for comments */
+#define P_BACKQUOTE 0x10 /* parsing a backquoted command substitution */
static char matched_pair_error;
static char *
@@ -2725,12 +2726,12 @@
int *lenp, flags;
{
int count, ch, was_dollar, in_comment, check_comment;
- int pass_next_character, nestlen, ttranslen, start_lineno;
+ int pass_next_character, backq_backslash, nestlen, ttranslen, start_lineno;
char *ret, *nestret, *ttrans;
int retind, retsize, rflags;
count = 1;
- pass_next_character = was_dollar = in_comment = 0;
+ pass_next_character = backq_backslash = was_dollar = in_comment = 0;
check_comment = (flags & P_COMMAND) && qc != '\'' && qc != '"' && (flags & P_DQUOTE) == 0;
/* RFLAGS is the set of flags we want to pass to recursive calls. */
@@ -2742,11 +2743,8 @@
start_lineno = line_number;
while (count)
{
-#if 0
- ch = shell_getc ((qc != '\'' || (flags & P_ALLOWESC)) && pass_next_character == 0);
-#else
- ch = shell_getc (qc != '\'' && pass_next_character == 0);
-#endif
+ ch = shell_getc (qc != '\'' && pass_next_character == 0 && backq_backslash == 0);
+
if (ch == EOF)
{
free (ret);
@@ -2771,9 +2769,16 @@
continue;
}
/* Not exactly right yet */
- else if (check_comment && in_comment == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || whitespace (ret[retind -1])))
+ else if MBTEST(check_comment && in_comment == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || whitespace (ret[retind - 1])))
in_comment = 1;
+ /* last char was backslash inside backquoted command substitution */
+ if (backq_backslash)
+ {
+ backq_backslash = 0;
+ /* Placeholder for adding special characters */
+ }
+
if (pass_next_character) /* last char was backslash */
{
pass_next_character = 0;
@@ -2814,6 +2819,8 @@
{
if MBTEST((flags & P_ALLOWESC) && ch == '\\')
pass_next_character++;
+ else if MBTEST((flags & P_BACKQUOTE) && ch == '\\')
+ backq_backslash++;
continue;
}
@@ -2898,7 +2905,11 @@
}
else if MBTEST(qc == '`' && (ch == '"' || ch == '\'') && in_comment == 0)
{
- nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags);
+ /* Add P_BACKQUOTE so backslash quotes the next character and
+ shell_getc does the right thing with \<newline>. We do this for
+ a measure of backwards compatibility -- it's not strictly the
+ right POSIX thing. */
+ nestret = parse_matched_pair (0, ch, ch, &nestlen, rflags|P_BACKQUOTE);
goto add_nestret;
}
else if MBTEST(was_dollar && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */
@@ -2907,7 +2918,7 @@
if (open == ch) /* undo previous increment */
count--;
if (ch == '(') /* ) */
- nestret = parse_matched_pair (0, '(', ')', &nestlen, rflags);
+ nestret = parse_matched_pair (0, '(', ')', &nestlen, rflags & ~P_DQUOTE);
else if (ch == '{') /* } */
nestret = parse_matched_pair (0, '{', '}', &nestlen, P_FIRSTCLOSE|rflags);
else if (ch == '[') /* ] */
@@ -3578,7 +3589,7 @@
FREE (ttok);
all_digit_token = 0;
compound_assignment = 1;
-#if 0
+#if 1
goto next_character;
#else
goto got_token; /* ksh93 seems to do this */
@@ -3695,7 +3706,9 @@
struct builtin *b;
b = builtin_address_internal (token, 0);
if (b && (b->flags & ASSIGNMENT_BUILTIN))
- parser_state |= PST_ASSIGNOK;
+ parser_state |= PST_ASSIGNOK;
+ else if (STREQ (token, "eval") || STREQ (token, "let"))
+ parser_state |= PST_ASSIGNOK;
}
yylval.word = the_word;
@@ -4686,18 +4699,21 @@
int *retlenp;
{
WORD_LIST *wl, *rl;
- int tok, orig_line_number, orig_token_size;
+ int tok, orig_line_number, orig_token_size, orig_last_token, assignok;
char *saved_token, *ret;
saved_token = token;
orig_token_size = token_buffer_size;
orig_line_number = line_number;
+ orig_last_token = last_read_token;
last_read_token = WORD; /* WORD to allow reserved words here */
token = (char *)NULL;
token_buffer_size = 0;
+ assignok = parser_state&PST_ASSIGNOK; /* XXX */
+
wl = (WORD_LIST *)NULL; /* ( */
parser_state |= PST_COMPASSIGN;
@@ -4740,7 +4756,7 @@
jump_to_top_level (DISCARD);
}
- last_read_token = WORD;
+ last_read_token = orig_last_token; /* XXX - was WORD? */
if (wl)
{
rl = REVERSE_LIST (wl, WORD_LIST *);
@@ -4752,6 +4768,10 @@
if (retlenp)
*retlenp = (ret && *ret) ? strlen (ret) : 0;
+
+ if (assignok)
+ parser_state |= PST_ASSIGNOK;
+
return ret;
}
diff -Naur bash-3.1.orig/patchlevel.h bash-3.1/patchlevel.h
--- bash-3.1.orig/patchlevel.h 2005-07-20 10:58:20.000000000 -0700
+++ bash-3.1/patchlevel.h 2006-04-19 15:59:29.000000000 -0700
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
-#define PATCHLEVEL 0
+#define PATCHLEVEL 17
#endif /* _PATCHLEVEL_H_ */
diff -Naur bash-3.1.orig/subst.c bash-3.1/subst.c
--- bash-3.1.orig/subst.c 2005-10-24 06:51:13.000000000 -0700
+++ bash-3.1/subst.c 2006-04-19 15:59:29.000000000 -0700
@@ -2187,7 +2187,7 @@
if (mklocal && variable_context)
{
v = find_variable (name);
- if (v == 0 || array_p (v) == 0)
+ if (v == 0 || array_p (v) == 0 || v->context != variable_context)
v = make_local_array_variable (name);
v = assign_array_var_from_string (v, value, flags);
}
@@ -2575,6 +2575,13 @@
return (expand_string_to_string_internal (string, quoted, expand_string_assignment));
}
+char *
+expand_arith_string (string, quoted)
+ char *string;
+{
+ return (expand_string_if_necessary (string, quoted, expand_string));
+}
+
#if defined (COND_COMMAND)
/* Just remove backslashes in STRING. Returns a new string. */
char *
@@ -5248,7 +5255,7 @@
else
t = (char *)0;
- temp1 = expand_string_if_necessary (substr, Q_DOUBLE_QUOTES, expand_string);
+ temp1 = expand_arith_string (substr, Q_DOUBLE_QUOTES);
*e1p = evalexp (temp1, &expok);
free (temp1);
if (expok == 0)
@@ -5293,7 +5300,7 @@
{
t++;
temp2 = savestring (t);
- temp1 = expand_string_if_necessary (temp2, Q_DOUBLE_QUOTES, expand_string);
+ temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES);
free (temp2);
t[-1] = ':';
*e2p = evalexp (temp1, &expok);
@@ -6435,7 +6442,7 @@
temp2[t_index] = '\0';
/* Expand variables found inside the expression. */
- temp1 = expand_string_if_necessary (temp2, Q_DOUBLE_QUOTES, expand_string);
+ temp1 = expand_arith_string (temp2, Q_DOUBLE_QUOTES);
free (temp2);
arithsub:
@@ -6477,7 +6484,7 @@
zindex = t_index;
/* Do initial variable expansion. */
- temp1 = expand_string_if_necessary (temp, Q_DOUBLE_QUOTES, expand_string);
+ temp1 = expand_arith_string (temp, Q_DOUBLE_QUOTES);
goto arithsub;
@@ -6795,6 +6802,12 @@
if (temp && *temp && t_index > 0)
{
temp1 = bash_tilde_expand (temp, tflag);
+ if (temp1 && *temp1 == '~' && STREQ (temp, temp1))
+ {
+ FREE (temp);
+ FREE (temp1);
+ goto add_character; /* tilde expansion failed */
+ }
free (temp);
temp = temp1;
sindex += t_index;
diff -Naur bash-3.1.orig/subst.h bash-3.1/subst.h
--- bash-3.1.orig/subst.h 2004-11-07 12:12:28.000000000 -0800
+++ bash-3.1/subst.h 2006-04-19 15:59:29.000000000 -0700
@@ -151,6 +151,9 @@
extern char *expand_string_unsplit_to_string __P((char *, int));
extern char *expand_assignment_string_to_string __P((char *, int));
+/* Expand an arithmetic expression string */
+extern char *expand_arith_string __P((char *, int));
+
/* De-quoted quoted characters in STRING. */
extern char *dequote_string __P((char *));
diff -Naur bash-3.1.orig/variables.c bash-3.1/variables.c
--- bash-3.1.orig/variables.c 2005-11-12 18:22:37.000000000 -0800
+++ bash-3.1/variables.c 2006-04-19 15:58:34.000000000 -0700
@@ -860,9 +860,11 @@
{
char val[INT_STRLEN_BOUND(int) + 1], *v;
+#if defined (READLINE)
/* If we are currently assigning to LINES or COLUMNS, don't do anything. */
if (winsize_assignment)
return;
+#endif
v = inttostr (lines, val, sizeof (val));
bind_variable ("LINES", v, 0);

View File

@@ -0,0 +1,35 @@
Submitted By: Ken Moffat <ken@kenmoffat.uklinux.net>
Date: 2005-08-09
Initial Package Version: 1.0.3
Upstream Status: Unknown.
Origin: Jyri Ryska (RedHat) for fedora3
Description: Fixes filename sanitisation in bzgrep.
This fixes CAN-2005-0758 (if a user can be tricked into running
bzgrep in an untrusted directory containing files with carefully
crafted filenames, arbitrary commands could be executed as the user
running bzgrep). Risk is reported as low. I've modified it to force
the interpreter to be bash, some of the other shells in use won't
like the bash syntax.
diff -Naur bzip2-1.0.3/bzgrep bzip2-1.0.3-new/bzgrep
--- bzip2-1.0.3/bzgrep 2004-10-09 12:29:32.000000000 +0100
+++ bzip2-1.0.3-new/bzgrep 2005-08-09 21:36:37.000000000 +0100
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Bzgrep wrapped for bzip2,
# adapted from zgrep by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
@@ -63,7 +63,11 @@
bzip2 -cdfq "$i" | $grep $opt "$pat"
r=$?
else
- bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${i}:|"
+ j=${i//\\/\\\\}
+ j=${j//|/\\|}
+ j=${j//&/\\&}
+ j=`printf "%s" "$j" | tr '\n' ' '`
+ bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
r=$?
fi
test "$r" -ne 0 && res="$r"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,272 @@
Submitted By: Matthew Burgess <matthew at linuxfromscratch dot org>
Date: 2006-03-15
Initial Package Version: 5.94
Origin: original suppress_hotname_uptame_kill_su patch (Robert Connolly)
Upstream Status: N/A
Description: This patch supresses the building of uptime, and kill. The su
command is built so the testsuite can run, use './src/su', but it will not
be installed. Also see:
http://www.linuxfromscratch.org/patches/downloads/coreutils/
coreutils-5.0-dupes-2.patch
diff -Naur coreutils-5.94.orig/AUTHORS coreutils-5.94/AUTHORS
--- coreutils-5.94.orig/AUTHORS 2004-11-03 23:10:50.000000000 +0000
+++ coreutils-5.94/AUTHORS 2006-03-15 22:20:49.000000000 +0000
@@ -34,7 +34,6 @@
hostname: Jim Meyering
id: Arnold Robbins, David MacKenzie
join: Mike Haertel
-kill: Paul Eggert
link: Michael Stone
ln: Mike Parker, David MacKenzie
logname: FIXME: unknown
@@ -83,7 +82,6 @@
unexpand: David MacKenzie
uniq: Richard Stallman, David MacKenzie
unlink: Michael Stone
-uptime: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi
users: Joseph Arceneaux, David MacKenzie
vdir: Richard Stallman, David MacKenzie
wc: Paul Rubin, David MacKenzie
diff -Naur coreutils-5.94.orig/Makefile.in coreutils-5.94/Makefile.in
--- coreutils-5.94.orig/Makefile.in 2006-02-13 12:52:03.000000000 +0000
+++ coreutils-5.94/Makefile.in 2006-03-15 22:20:49.000000000 +0000
@@ -148,7 +148,7 @@
$(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \
$(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \
$(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \
- $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \
+ $(top_srcdir)/m4/unlocked-io.m4 \
$(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \
$(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \
$(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \
diff -Naur coreutils-5.94.orig/README coreutils-5.94/README
--- coreutils-5.94.orig/README 2005-09-28 18:34:26.000000000 +0000
+++ coreutils-5.94/README 2006-03-15 22:20:49.000000000 +0000
@@ -9,11 +9,11 @@
[ basename cat chgrp chmod chown chroot cksum comm cp csplit cut date dd
df dir dircolors dirname du echo env expand expr factor false fmt fold
- ginstall groups head hostid hostname id join kill link ln logname ls
+ ginstall groups head hostid hostname id join link ln logname ls
md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr
printenv printf ptx pwd readlink rm rmdir seq sha1sum shred sleep sort
split stat stty su sum sync tac tail tee test touch tr true tsort tty
- uname unexpand uniq unlink uptime users vdir wc who whoami yes
+ uname unexpand uniq unlink users vdir wc who whoami yes
See the file NEWS for a list of major changes in the current release.
diff -Naur coreutils-5.94.orig/configure coreutils-5.94/configure
--- coreutils-5.94.orig/configure 2006-02-13 12:52:04.000000000 +0000
+++ coreutils-5.94/configure 2006-03-15 22:20:49.000000000 +0000
@@ -50418,8 +50418,7 @@
{ echo "$as_me:$LINENO: result: $gnulib_cv_have_boot_time" >&5
echo "${ECHO_T}$gnulib_cv_have_boot_time" >&6; }
if test $gnulib_cv_have_boot_time = yes; then
- OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uptime\$(EXEEXT)"
- MAN="$MAN uptime.1"
+echo "uptime is suppressed"
fi
diff -Naur coreutils-5.94.orig/man/Makefile.in coreutils-5.94/man/Makefile.in
--- coreutils-5.94.orig/man/Makefile.in 2006-02-13 12:51:58.000000000 +0000
+++ coreutils-5.94/man/Makefile.in 2006-03-15 22:20:50.000000000 +0000
@@ -142,7 +142,7 @@
$(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \
$(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \
$(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \
- $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \
+ $(top_srcdir)/m4/unlocked-io.m4 \
$(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \
$(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \
$(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \
@@ -303,13 +303,13 @@
basename.1 cat.1 chgrp.1 chmod.1 chown.1 chroot.1 cksum.1 comm.1 \
cp.1 csplit.1 cut.1 date.1 dd.1 df.1 dir.1 dircolors.1 dirname.1 du.1 \
echo.1 env.1 expand.1 expr.1 factor.1 false.1 fmt.1 fold.1 groups.1 \
- head.1 hostid.1 hostname.1 id.1 install.1 join.1 kill.1 \
+ head.1 hostid.1 hostname.1 id.1 install.1 join.1 \
link.1 ln.1 logname.1 \
ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nice.1 nl.1 nohup.1 od.1 \
paste.1 pathchk.1 pinky.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \
rm.1 rmdir.1 seq.1 sha1sum.1 shred.1 sleep.1 sort.1 split.1 stat.1 stty.1 \
- su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
- tty.1 uname.1 unexpand.1 uniq.1 unlink.1 uptime.1 users.1 vdir.1 wc.1 \
+ sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
+ tty.1 uname.1 unexpand.1 uniq.1 unlink.1 users.1 vdir.1 wc.1 \
who.1 whoami.1 yes.1
man_aux = $(dist_man_MANS:.1=.x)
@@ -575,7 +575,6 @@
id.1: $(common_dep) $(srcdir)/id.x ../src/id.c
install.1: $(common_dep) $(srcdir)/install.x ../src/install.c
join.1: $(common_dep) $(srcdir)/join.x ../src/join.c
-kill.1: $(common_dep) $(srcdir)/kill.x ../src/kill.c
link.1: $(common_dep) $(srcdir)/link.x ../src/link.c
ln.1: $(common_dep) $(srcdir)/ln.x ../src/ln.c
logname.1: $(common_dep) $(srcdir)/logname.x ../src/logname.c
@@ -608,7 +607,6 @@
split.1: $(common_dep) $(srcdir)/split.x ../src/split.c
stat.1: $(common_dep) $(srcdir)/stat.x ../src/stat.c
stty.1: $(common_dep) $(srcdir)/stty.x ../src/stty.c
-su.1: $(common_dep) $(srcdir)/su.x ../src/su.c
sum.1: $(common_dep) $(srcdir)/sum.x ../src/sum.c
sync.1: $(common_dep) $(srcdir)/sync.x ../src/sync.c
tac.1: $(common_dep) $(srcdir)/tac.x ../src/tac.c
@@ -624,7 +622,6 @@
unexpand.1: $(common_dep) $(srcdir)/unexpand.x ../src/unexpand.c
uniq.1: $(common_dep) $(srcdir)/uniq.x ../src/uniq.c
unlink.1: $(common_dep) $(srcdir)/unlink.x ../src/unlink.c
-uptime.1: $(common_dep) $(srcdir)/uptime.x ../src/uptime.c
users.1: $(common_dep) $(srcdir)/users.x ../src/users.c
vdir.1: $(common_dep) $(srcdir)/vdir.x ../src/ls.c
wc.1: $(common_dep) $(srcdir)/wc.x ../src/wc.c
@@ -656,7 +653,7 @@
check-x-vs-1:
PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \
t=ls-files.$$$$; \
- (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\
+ (cd $(srcdir) && ls -1 *.x) | grep -v -e 'kill.x' -e 'su.x' -e 'uptime.x' | sed 's/\.x$$//' | $(ASSORT) > $$t;\
echo $(dist_man_MANS) | tr -s ' ' '\n' | sed 's/\.1$$//' \
| $(ASSORT) | diff - $$t || { rm $$t; exit 1; }; \
rm $$t
diff -Naur coreutils-5.94.orig/src/Makefile.in coreutils-5.94/src/Makefile.in
--- coreutils-5.94.orig/src/Makefile.in 2006-02-13 13:08:11.000000000 +0000
+++ coreutils-5.94/src/Makefile.in 2006-03-15 22:20:50.000000000 +0000
@@ -39,7 +39,7 @@
host_triplet = @host@
EXTRA_PROGRAMS = chroot$(EXEEXT) df$(EXEEXT) hostid$(EXEEXT) \
nice$(EXEEXT) pinky$(EXEEXT) stty$(EXEEXT) su$(EXEEXT) \
- uname$(EXEEXT) uptime$(EXEEXT) users$(EXEEXT) who$(EXEEXT)
+ uname$(EXEEXT) users$(EXEEXT) who$(EXEEXT)
bin_PROGRAMS = [$(EXEEXT) chgrp$(EXEEXT) chown$(EXEEXT) chmod$(EXEEXT) \
cp$(EXEEXT) dd$(EXEEXT) dircolors$(EXEEXT) du$(EXEEXT) \
ginstall$(EXEEXT) link$(EXEEXT) ln$(EXEEXT) dir$(EXEEXT) \
@@ -56,7 +56,7 @@
uniq$(EXEEXT) wc$(EXEEXT) basename$(EXEEXT) date$(EXEEXT) \
dirname$(EXEEXT) echo$(EXEEXT) env$(EXEEXT) expr$(EXEEXT) \
factor$(EXEEXT) false$(EXEEXT) hostname$(EXEEXT) id$(EXEEXT) \
- kill$(EXEEXT) logname$(EXEEXT) pathchk$(EXEEXT) \
+ logname$(EXEEXT) pathchk$(EXEEXT) \
printenv$(EXEEXT) printf$(EXEEXT) pwd$(EXEEXT) seq$(EXEEXT) \
sleep$(EXEEXT) tee$(EXEEXT) test$(EXEEXT) true$(EXEEXT) \
tty$(EXEEXT) whoami$(EXEEXT) yes$(EXEEXT) $(am__EXEEXT_1) \
@@ -169,7 +169,7 @@
$(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \
$(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \
$(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \
- $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \
+ $(top_srcdir)/m4/unlocked-io.m4 \
$(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \
$(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \
$(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \
@@ -350,11 +350,6 @@
join_LDADD = $(LDADD)
join_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \
../lib/libcoreutils.a
-kill_SOURCES = kill.c
-kill_OBJECTS = kill.$(OBJEXT)
-kill_LDADD = $(LDADD)
-kill_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \
- ../lib/libcoreutils.a
link_SOURCES = link.c
link_OBJECTS = link.$(OBJEXT)
link_LDADD = $(LDADD)
@@ -577,9 +572,6 @@
unlink_LDADD = $(LDADD)
unlink_DEPENDENCIES = ../lib/libcoreutils.a $(am__DEPENDENCIES_1) \
../lib/libcoreutils.a
-uptime_SOURCES = uptime.c
-uptime_OBJECTS = uptime.$(OBJEXT)
-uptime_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
users_SOURCES = users.c
users_OBJECTS = users.$(OBJEXT)
users_LDADD = $(LDADD)
@@ -622,28 +614,28 @@
csplit.c cut.c date.c dd.c df.c $(dir_SOURCES) dircolors.c \
dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c \
fmt.c fold.c $(ginstall_SOURCES) head.c hostid.c hostname.c \
- id.c join.c kill.c link.c ln.c logname.c $(ls_SOURCES) \
+ id.c join.c link.c ln.c logname.c $(ls_SOURCES) \
$(md5sum_SOURCES) mkdir.c mkfifo.c mknod.c $(mv_SOURCES) \
nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c \
printenv.c printf.c ptx.c pwd.c readlink.c $(rm_SOURCES) \
rmdir.c seq.c setuidgid.c $(sha1sum_SOURCES) shred.c sleep.c \
sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c tail.c \
tee.c test.c touch.c tr.c true.c tsort.c tty.c uname.c \
- unexpand.c uniq.c unlink.c uptime.c users.c $(vdir_SOURCES) \
+ unexpand.c uniq.c unlink.c users.c $(vdir_SOURCES) \
wc.c who.c whoami.c yes.c
DIST_SOURCES = $(__SOURCES) basename.c cat.c $(chgrp_SOURCES) chmod.c \
$(chown_SOURCES) chroot.c cksum.c comm.c $(cp_SOURCES) \
csplit.c cut.c date.c dd.c df.c $(dir_SOURCES) dircolors.c \
dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c \
fmt.c fold.c $(ginstall_SOURCES) head.c hostid.c hostname.c \
- id.c join.c kill.c link.c ln.c logname.c $(ls_SOURCES) \
+ id.c join.c link.c ln.c logname.c $(ls_SOURCES) \
$(md5sum_SOURCES) mkdir.c mkfifo.c mknod.c $(mv_SOURCES) \
nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c \
printenv.c printf.c ptx.c pwd.c readlink.c $(rm_SOURCES) \
rmdir.c seq.c setuidgid.c $(sha1sum_SOURCES) shred.c sleep.c \
sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c tail.c \
tee.c test.c touch.c tr.c true.c tsort.c tty.c uname.c \
- unexpand.c uniq.c unlink.c uptime.c users.c $(vdir_SOURCES) \
+ unexpand.c uniq.c unlink.c users.c $(vdir_SOURCES) \
wc.c who.c whoami.c yes.c
HEADERS = $(noinst_HEADERS)
ETAGS = etags
@@ -840,7 +832,6 @@
nanosec_libs = $(LDADD) $(POW_LIB) $(LIB_NANOSLEEP)
sleep_LDADD = $(nanosec_libs)
tail_LDADD = $(nanosec_libs)
-uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS)
su_LDADD = $(LDADD) $(LIB_CRYPT)
SUFFIXES = .sh
installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
@@ -1076,9 +1067,6 @@
join$(EXEEXT): $(join_OBJECTS) $(join_DEPENDENCIES)
@rm -f join$(EXEEXT)
$(LINK) $(join_LDFLAGS) $(join_OBJECTS) $(join_LDADD) $(LIBS)
-kill$(EXEEXT): $(kill_OBJECTS) $(kill_DEPENDENCIES)
- @rm -f kill$(EXEEXT)
- $(LINK) $(kill_LDFLAGS) $(kill_OBJECTS) $(kill_LDADD) $(LIBS)
link$(EXEEXT): $(link_OBJECTS) $(link_DEPENDENCIES)
@rm -f link$(EXEEXT)
$(LINK) $(link_LDFLAGS) $(link_OBJECTS) $(link_LDADD) $(LIBS)
@@ -1226,9 +1214,6 @@
unlink$(EXEEXT): $(unlink_OBJECTS) $(unlink_DEPENDENCIES)
@rm -f unlink$(EXEEXT)
$(LINK) $(unlink_LDFLAGS) $(unlink_OBJECTS) $(unlink_LDADD) $(LIBS)
-uptime$(EXEEXT): $(uptime_OBJECTS) $(uptime_DEPENDENCIES)
- @rm -f uptime$(EXEEXT)
- $(LINK) $(uptime_LDFLAGS) $(uptime_OBJECTS) $(uptime_LDADD) $(LIBS)
users$(EXEEXT): $(users_OBJECTS) $(users_DEPENDENCIES)
@rm -f users$(EXEEXT)
$(LINK) $(users_LDFLAGS) $(users_OBJECTS) $(users_LDADD) $(LIBS)
@@ -1322,7 +1307,6 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/install.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/join.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbracket.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ln.Po@am__quote@
@@ -1378,7 +1362,6 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unexpand.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uniq.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/users.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/who.Po@am__quote@
@@ -1606,7 +1589,7 @@
&& can_create_suid_root_executable=yes; \
rm -f $$TMPFILE; \
if test $$can_create_suid_root_executable = yes; then \
- $(INSTALL_SU); \
+ echo "Installation of su is suppressed"; \
else \
echo "WARNING: insufficient access; not installing su"; \
echo "NOTE: to install su, run 'make install-root' as root"; \

View File

@@ -0,0 +1,182 @@
Submitted By: Matthew Burgess <matthew at linuxfromscratch dot org>
Date: 2005-10-23
Initial Package Version: 5.92
Upstream Status: pending
Origin: Scot McPherson
Description: Fix the output of uname once and for all.
$ uname -m # This always worked.
i686
$ uname -i # Used to report 'unknown'.
i386
$ uname -p # Likewise.
athlon-4
diff -Naur coreutils-5.92.orig/src/uname.c coreutils-5.92/src/uname.c
--- coreutils-5.92.orig/src/uname.c 2005-09-15 20:34:42.000000000 +0000
+++ coreutils-5.92/src/uname.c 2005-10-23 10:14:06.000000000 +0000
@@ -29,6 +29,12 @@
# include <sys/systeminfo.h>
#endif
+#ifdef linux
+#define cpuid(in,a,b,c,d)\
+ asm("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in));
+int has_sse( void );
+#endif
+
#if HAVE_SYS_SYSCTL_H
# if HAVE_SYS_PARAM_H
# include <sys/param.h> /* needed for OpenBSD 3.0 */
@@ -256,6 +262,96 @@
if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
element = processor;
}
+#else
+ {
+ struct utsname u;
+ uname (&u);
+ element = u.machine;
+#ifdef linux
+/******************************************************************************
+ *
+ * Hello, major hack. I shouldn't have to do this. struct utsname should
+ * have another element with this info in it. There's probably a struct
+ * somewhere that has this info, I just don't know where it is.
+ *
+ *****************************************************************************/
+
+ if( !strcmp( element, "i586" ) || !strcmp( element, "i686" ) ) {
+ int eax, ebx, ecx, edx, unused;
+ int model, family, sse;
+
+ cpuid(0,unused,ebx,ecx,edx);
+ cpuid(1,eax,unused,unused,unused);
+ model = (eax >> 4) & 0xf;
+ family = (eax >> 8) & 0xf;
+
+ switch(ebx) {
+ case 0x756e6547: // Intel
+ switch( family ) {
+ case 5: // Pentium
+ if( model <= 3 )
+ element="pentium";
+ if( model > 3 )
+ element="pentium-mmx";
+ break;
+ case 6: // PentiumPro - Pentium III
+ if( model == 1 ) // Pentium Pro
+ element="pentiumpro";
+ if( ( model == 3 ) || ( model == 5 ) ||
+ ( model == 6 ) ) // Pentium II
+ element="pentium2";
+ if( ( model == 7 ) || ( model == 8 ) ||
+ ( model == 10 ) || ( model == 11 ) ) // These are all Pentium III
+ element="pentium3";
+ break;
+ case 15: // Pentium4
+ element="pentium4";
+ break;
+ default:
+ break;
+ } // end switch( family )
+ break;
+ case 0x68747541: // AMD
+ switch(family) {
+ case 5:
+ if( ( model == 0 ) || ( model == 1 ) ||
+ ( model == 2 ) || ( model == 3 ) ) // K5
+ element="i586";
+ if( ( model == 6 ) || ( model == 7 ) ) // K6
+ element="k6";
+ if( model == 8 ) // K6-2
+ element="k6-2";
+ if( model == 9 ) // K6-3
+ element="k6-3";
+ break;
+ case 6:
+ if( model <= 4 )
+ element="athlon";
+ if( model > 4 ) {
+ sse = has_sse();
+ if( sse == 0 )
+ element="athlon";
+ if( sse == 1 )
+ element="athlon-4";
+ }
+ break;
+ case 15:
+ element="athlon-4";
+ break;
+ default:
+ break;
+ } // end switch( family )
+ break;
+ case 0x69727943: // Cyrix
+ element="i386"; // who knows what cyrix supports, lets be safe
+ break;
+ default:
+ break;
+ } // end switch(ebx)
+ }
+
+#endif
+ }
#endif
#ifdef UNAME_PROCESSOR
if (element == unknown)
@@ -293,7 +389,7 @@
if (toprint & PRINT_HARDWARE_PLATFORM)
{
- char const *element = unknown;
+ char *element = unknown;
#if HAVE_SYSINFO && defined SI_PLATFORM
{
static char hardware_platform[257];
@@ -301,6 +397,15 @@
hardware_platform, sizeof hardware_platform))
element = hardware_platform;
}
+#else
+ {
+ struct utsname u;
+ uname (&u);
+ element = u.machine;
+ if (strlen (element) == 4 && element[0] == 'i' && element[2] == '8'
+ && element[3] == '6')
+ element[1] = '3';
+ }
#endif
#ifdef UNAME_HARDWARE_PLATFORM
if (element == unknown)
@@ -323,3 +428,29 @@
exit (EXIT_SUCCESS);
}
+
+#ifdef linux
+
+/******************************************************************************
+ *
+ * int has_sse( void )
+ * Checks Athlon CPU's to see if they support SSE.
+ *
+ *****************************************************************************/
+
+int has_sse( void )
+{
+ unsigned long edx, unused;
+ int sse;
+ cpuid(1,unused,unused,unused,edx);
+ // I think, I need this tested on a Duron with SSE
+ // and one without it.
+ sse = edx & 0x2000000;
+ if( sse == 0 ) {
+ return 0;
+ } else {
+ return 1;
+ }
+
+}
+#endif

View File

@@ -0,0 +1,217 @@
Submitted By: LFS Book <lfs-book@linuxfromscratch.org>
Date: 2003-10-05
Initial Package Version: 5.38
Origin: Redhat RPM (Patch by HJ Lu)
Description: NA
diff -uNr expect-5.38.orig/exp_chan.c expect-5.38/exp_chan.c
--- expect-5.38.orig/exp_chan.c 2002-02-12 13:00:55.000000000 +1100
+++ expect-5.38/exp_chan.c 2003-03-01 10:36:18.000000000 +1100
@@ -519,6 +519,7 @@
esPtr->buffer = Tcl_NewStringObj("",0);
Tcl_IncrRefCount(esPtr->buffer);
esPtr->umsize = exp_default_match_max;
+ esPtr->umsize_changed = exp_default_match_max_changed;
/* this will reallocate object with an appropriate sized buffer */
expAdjust(esPtr);
diff -uNr expect-5.38.orig/exp_command.h expect-5.38/exp_command.h
--- expect-5.38.orig/exp_command.h 2002-04-08 08:57:20.000000000 +1000
+++ expect-5.38/exp_command.h 2003-03-01 10:36:18.000000000 +1100
@@ -25,6 +25,7 @@
EXTERN char * exp_get_var _ANSI_ARGS_((Tcl_Interp *,char *));
EXTERN int exp_default_match_max;
+EXTERN int exp_default_match_max_changed;
EXTERN int exp_default_parity;
EXTERN int exp_default_rm_nulls;
@@ -97,6 +98,7 @@
int msize; /* # of bytes that buffer can hold (max) */
int umsize; /* # of bytes (min) that is guaranteed to match */
/* this comes from match_max command */
+ int umsize_changed; /* is umsize changed by user? */
int printed; /* # of bytes written to stdout (if logging on) */
/* but not actually returned via a match yet */
int echoed; /* additional # of bytes (beyond "printed" above) */
diff -uNr expect-5.38.orig/expect.c expect-5.38/expect.c
--- expect-5.38.orig/expect.c 2002-04-08 09:00:33.000000000 +1000
+++ expect-5.38/expect.c 2003-03-01 10:36:18.000000000 +1100
@@ -41,8 +41,17 @@
#include "tcldbg.h"
#endif
+/* The initial length is 2000. We increment it by 2000. The maximum
+ is 8MB (0x800000). */
+#define EXP_MATCH_MAX 2000
+#define EXP_MATCH_INC 2000
+#define EXP_MATCH_STEP_LIMIT 0x700000
+#define EXP_MATCH_LIMIT 0x800000
+#define EXP_MATCH_LIMIT_QUOTE "0x800000"
+
/* initial length of strings that we can guarantee patterns can match */
-int exp_default_match_max = 2000;
+int exp_default_match_max = EXP_MATCH_MAX;
+int exp_default_match_max_changed = 0;
#define INIT_EXPECT_TIMEOUT_LIT "10" /* seconds */
#define INIT_EXPECT_TIMEOUT 10 /* seconds */
int exp_default_parity = TRUE;
@@ -1618,6 +1627,76 @@
return newsize;
}
+/* returns # of bytes until we see a newline at the end or EOF. */
+/*ARGSUSED*/
+static int
+expReadNewLine(interp,esPtr,save_flags) /* INTL */
+Tcl_Interp *interp;
+ExpState *esPtr;
+int save_flags;
+{
+ int size;
+ int exp_size;
+ int full_size;
+ int count;
+ char *str;
+
+ count = 0;
+ for (;;) {
+ exp_size = expSizeGet(esPtr);
+
+ /* When we reach the limit, we will only read one char at a
+ time. */
+ if (esPtr->umsize >= EXP_MATCH_STEP_LIMIT)
+ size = TCL_UTF_MAX;
+ else
+ size = exp_size;
+
+ if (exp_size + TCL_UTF_MAX >= esPtr->msize) {
+ if (esPtr->umsize >= EXP_MATCH_LIMIT) {
+ expDiagLogU("WARNING: interact buffer is full. probably your program\r\n");
+ expDiagLogU("is not interactive or has a very long output line. The\r\n");
+ expDiagLogU("current limit is " EXP_MATCH_LIMIT_QUOTE ".\r\n");
+ expDiagLogU("Dumping first half of buffer in order to continue\r\n");
+ expDiagLogU("Recommend you enlarge the buffer.\r\n");
+ exp_buffer_shuffle(interp,esPtr,save_flags,EXPECT_OUT,"expect");
+ return count;
+ }
+ else {
+ esPtr->umsize += EXP_MATCH_INC;
+ expAdjust(esPtr);
+ }
+ }
+
+ full_size = esPtr->msize - (size / TCL_UTF_MAX);
+ size = Tcl_ReadChars(esPtr->channel,
+ esPtr->buffer,
+ full_size,
+ 1 /* append */);
+ if (size > 0) {
+ count += size;
+ /* We try again if there are more to read and we haven't
+ seen a newline at the end. */
+ if (size == full_size) {
+ str = Tcl_GetStringFromObj(esPtr->buffer, &size);
+ if (str[size - 1] != '\n')
+ continue;
+ }
+ }
+ else {
+ /* It is even trickier. We got an error from read. We have
+ to recover from it. Let's make sure the size of
+ buffer is correct. It can be corrupted. */
+ str = Tcl_GetString(esPtr->buffer);
+ Tcl_SetObjLength(esPtr->buffer, strlen(str));
+ }
+
+ break;
+ }
+
+ return count;
+}
+
/* returns # of bytes read or (non-positive) error of form EXP_XXX */
/* returns 0 for end of file */
/* If timeout is non-zero, set an alarm before doing the read, else assume */
@@ -1632,6 +1711,8 @@
{
int cc = EXP_TIMEOUT;
int size = expSizeGet(esPtr);
+ int full_size;
+ int count;
if (size + TCL_UTF_MAX >= esPtr->msize)
exp_buffer_shuffle(interp,esPtr,save_flags,EXPECT_OUT,"expect");
@@ -1648,11 +1729,43 @@
}
#endif
-
+ /* FIXME: If we ask less than what is available in the tcl buffer
+ when tcl has seen EOF, we will throw away the remaining data
+ since the next read will get EOF. Since expect is line-oriented,
+ we exand our buffer to get EOF or the next newline at the end of
+ the input buffer. I don't know if it is the right fix. H.J. */
+ count = 0;
+ full_size = esPtr->msize - (size / TCL_UTF_MAX);
cc = Tcl_ReadChars(esPtr->channel,
- esPtr->buffer,
- esPtr->msize - (size / TCL_UTF_MAX),
- 1 /* append */);
+ esPtr->buffer,
+ full_size,
+ 1 /* append */);
+ if (cc > 0) {
+ count += cc;
+ /* It gets very tricky. There are more to read. We will expand
+ our buffer and get EOF or a newline at the end unless the
+ buffer length has been changed. */
+ if (cc == full_size) {
+ char *str;
+ str = Tcl_GetStringFromObj(esPtr->buffer, &size);
+ if (str[size - 1] != '\n') {
+ if (esPtr->umsize_changed) {
+ char buf[20]; /* big enough for 64bit int in hex. */
+ snprintf(buf,sizeof(buf),"0x%x", esPtr->umsize);
+ expDiagLogU("WARNING: interact buffer is not large enough to hold\r\n");
+ expDiagLogU("all output. probably your program is not interactive or\r\n");
+ expDiagLogU("has a very long output line. The current limit is ");
+ expDiagLogU(buf);
+ expDiagLogU(".\r\n");
+ }
+ else {
+ cc = expReadNewLine(interp,esPtr,save_flags);
+ if (cc > 0)
+ count += cc;
+ }
+ }
+ }
+ }
i_read_errno = errno;
#ifdef SIMPLE_EVENT
@@ -1673,7 +1786,7 @@
}
}
#endif
- return cc;
+ return count > 0 ? count : cc;
}
/*
@@ -2746,8 +2859,14 @@
return(TCL_ERROR);
}
- if (Default) exp_default_match_max = size;
- else esPtr->umsize = size;
+ if (Default) {
+ exp_default_match_max = size;
+ exp_default_match_max_changed = 1;
+ }
+ else {
+ esPtr->umsize = size;
+ esPtr->umsize_changed = 1;
+ }
return(TCL_OK);
}

View File

@@ -0,0 +1,43 @@
Submitted By: Matthew Burgess <matthew@linuxfromscratch.org>
Date: 2005-09-24
Initial Package Version: 3.1.5
Upstream Status: From Upstream
Origin: http://lists.gnu.org/archive/html/bug-gnu-utils/2005-08/msg00047.html
Description: Fixes a bug which causes gawk to segfault when operating on a non-existent file.
diff -Naur gawk-3.1.5.orig/io.c gawk-3.1.5/io.c
--- gawk-3.1.5.orig/io.c 2005-07-26 18:07:43.000000000 +0000
+++ gawk-3.1.5/io.c 2005-09-24 14:43:13.771380264 +0000
@@ -2480,9 +2480,12 @@
{
struct stat sbuf;
struct open_hook *oh;
+ int iop_malloced = FALSE;
- if (iop == NULL)
+ if (iop == NULL) {
emalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc");
+ iop_malloced = TRUE;
+ }
memset(iop, '\0', sizeof(IOBUF));
iop->flag = 0;
iop->fd = fd;
@@ -2495,7 +2498,8 @@
}
if (iop->fd == INVALID_HANDLE) {
- free(iop);
+ if (iop_malloced)
+ free(iop);
return NULL;
}
if (isatty(iop->fd))
@@ -2503,7 +2507,7 @@
iop->readsize = iop->size = optimal_bufsize(iop->fd, & sbuf);
iop->sbuf = sbuf;
if (do_lint && S_ISREG(sbuf.st_mode) && sbuf.st_size == 0)
- lintwarn(_("data file `%s' is empty"), name);
+ lintwarn(_("data file `%s' is empty"), name);
errno = 0;
iop->count = iop->scanoff = 0;
emalloc(iop->buf, char *, iop->size += 2, "iop_alloc");

View File

@@ -0,0 +1,336 @@
Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
Date: 2006-01-16
Initial Package Version: 4.0.0
Upstream Status: Not Sent - LFS Specfic
Origin: Idea originally developed by Ryan Oliver and Greg Schafer for
the Pure LFS project.
More architectures added by Zack Winkles.
Further fine tunings by Greg Schafer.
Modified for gcc 3.3.2 by Oliver Brakmann.
Rediffed against gcc 3.4.0 by Zack Winkles.
Rediffed against gcc 3.4.3 by Jim Gifford.
Rediffed against gcc 4.0.0 by Robert Connolly.
Description: This patch modifies the location of the dynamic linker for
the GCC Pass 2 build in LFS Chapter 5.
diff -Naur gcc-20050116.orig/gcc/config/alpha/linux-elf.h gcc-20050116/gcc/config/alpha/linux-elf.h
--- gcc-20050116.orig/gcc/config/alpha/linux-elf.h 2005-01-17 00:45:16.000000000 +0000
+++ gcc-20050116/gcc/config/alpha/linux-elf.h 2005-01-17 00:46:14.560651027 +0000
@@ -27,7 +27,7 @@
#define SUBTARGET_EXTRA_SPECS \
{ "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
-#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define ELF_DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
%{O*:-O3} %{!O*:-O1} \
diff -Naur gcc-20050116.orig/gcc/config/arm/linux-elf.h gcc-20050116/gcc/config/arm/linux-elf.h
--- gcc-20050116.orig/gcc/config/arm/linux-elf.h 2005-01-17 00:45:16.000000000 +0000
+++ gcc-20050116/gcc/config/arm/linux-elf.h 2005-01-17 00:46:50.538578614 +0000
@@ -87,7 +87,7 @@
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2} \
-X \
%{mbig-endian:-EB}" \
SUBTARGET_EXTRA_LINK_SPEC
diff -Naur gcc-20050116.orig/gcc/config/frv/linux.h gcc-20050116/gcc/config/frv/linux.h
--- gcc-20050116.orig/gcc/config/frv/linux.h 2005-01-17 00:45:16.000000000 +0000
+++ gcc-20050116/gcc/config/frv/linux.h 2005-01-17 01:33:50.600805260 +0000
@@ -41,7 +41,7 @@
%{mfdpic: -m elf32frvfd -z text} %{shared} %{pie} \
%{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
%{static}}"
/* Support for compile-time default CPU. */
diff -Naur gcc-20050116.orig/gcc/config/i386/gnu.h gcc-20050116/gcc/config/i386/gnu.h
--- gcc-20050116.orig/gcc/config/i386/gnu.h 2005-01-17 00:45:16.000000000 +0000
+++ gcc-20050116/gcc/config/i386/gnu.h 2005-01-17 01:34:11.142021939 +0000
@@ -27,7 +27,7 @@
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so}} \
%{static:-static}}"
#undef STARTFILE_SPEC
diff -Naur gcc-20050116.orig/gcc/config/i386/linux.h gcc-20050116/gcc/config/i386/linux.h
--- gcc-20050116.orig/gcc/config/i386/linux.h 2005-01-17 00:45:16.000000000 +0000
+++ gcc-20050116/gcc/config/i386/linux.h 2005-01-17 00:49:27.412667132 +0000
@@ -105,7 +105,7 @@
/* If ELF is the default format, we should not use /lib/elf. */
#define LINK_EMULATION "elf_i386"
-#define DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
diff -Naur gcc-20050116.orig/gcc/config/i386/linux64.h gcc-20050116/gcc/config/i386/linux64.h
--- gcc-20050116.orig/gcc/config/i386/linux64.h 2005-01-17 00:45:16.000000000 +0000
+++ gcc-20050116/gcc/config/i386/linux64.h 2005-01-17 00:50:23.055094690 +0000
@@ -60,8 +60,8 @@
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
- %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
+ %{m32:%{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
+ %{!m32:%{!dynamic-linker:-dynamic-linker /tools/lib64/ld-linux-x86-64.so.2}}} \
%{static:-static}}"
#define MULTILIB_DEFAULTS { "m64" }
diff -Naur gcc-20050116.orig/gcc/config/ia64/linux.h gcc-20050116/gcc/config/ia64/linux.h
--- gcc-20050116.orig/gcc/config/ia64/linux.h 2005-01-17 00:45:17.000000000 +0000
+++ gcc-20050116/gcc/config/ia64/linux.h 2005-01-17 00:50:43.146472133 +0000
@@ -43,7 +43,7 @@
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux-ia64.so.2}} \
%{static:-static}}"
diff -Naur gcc-20050116.orig/gcc/config/linux.h gcc-20050116/gcc/config/linux.h
--- gcc-20050116.orig/gcc/config/linux.h 2005-01-17 00:45:16.000000000 +0000
+++ gcc-20050116/gcc/config/linux.h 2005-01-17 00:51:14.101809663 +0000
@@ -104,3 +104,7 @@
#define TARGET_C99_FUNCTIONS 1
#define TARGET_HAS_F_SETLKW
+
+/* Remove /usr/include from the end of the include search path. */
+#undef STANDARD_INCLUDE_DIR
+#define STANDARD_INCLUDE_DIR 0
diff -Naur gcc-20050116.orig/gcc/config/m32r/linux.h gcc-20050116/gcc/config/m32r/linux.h
--- gcc-20050116.orig/gcc/config/m32r/linux.h 2005-01-17 00:45:17.000000000 +0000
+++ gcc-20050116/gcc/config/m32r/linux.h 2005-01-17 00:51:39.720640870 +0000
@@ -66,7 +66,7 @@
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
%{static:-static}}}"
#else
#define LINK_SPEC "%(link_cpu) -m m32relf_linux %{shared:-shared} \
@@ -74,7 +74,7 @@
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
%{static:-static}}}"
#endif
diff -Naur gcc-20050116.orig/gcc/config/m68k/linux.h gcc-20050116/gcc/config/m68k/linux.h
--- gcc-20050116.orig/gcc/config/m68k/linux.h 2005-01-17 00:45:17.000000000 +0000
+++ gcc-20050116/gcc/config/m68k/linux.h 2005-01-17 00:52:07.633830392 +0000
@@ -132,7 +132,7 @@
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
+ %{!dynamic-linker*:-dynamic-linker /tools/lib/ld.so.1}} \
%{static}}"
/* For compatibility with linux/a.out */
diff -Naur gcc-20050116.orig/gcc/config/mips/linux.h gcc-20050116/gcc/config/mips/linux.h
--- gcc-20050116.orig/gcc/config/mips/linux.h 2005-01-17 00:45:17.000000000 +0000
+++ gcc-20050116/gcc/config/mips/linux.h 2005-01-17 00:52:28.348034505 +0000
@@ -115,7 +115,7 @@
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
%{static:-static}}}"
#undef SUBTARGET_ASM_SPEC
diff -Naur gcc-20050116.orig/gcc/config/mips/linux64.h gcc-20050116/gcc/config/mips/linux64.h
--- gcc-20050116.orig/gcc/config/mips/linux64.h 2005-01-17 00:45:17.000000000 +0000
+++ gcc-20050116/gcc/config/mips/linux64.h 2005-01-17 00:53:04.645878728 +0000
@@ -60,9 +60,9 @@
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker: \
- %{mabi=n32: -dynamic-linker /lib32/ld.so.1} \
- %{mabi=64: -dynamic-linker /lib64/ld.so.1} \
- %{mabi=32: -dynamic-linker /lib/ld.so.1}}} \
+ %{mabi=n32: -dynamic-linker /tools/lib32/ld.so.1} \
+ %{mabi=64: -dynamic-linker /tools/lib64/ld.so.1} \
+ %{mabi=32: -dynamic-linker /tools/lib/ld.so.1}}} \
%{static:-static}}} \
%{mabi=n32:-melf32%{EB:b}%{EL:l}tsmipn32} \
%{mabi=64:-melf64%{EB:b}%{EL:l}tsmip} \
diff -Naur gcc-20050116.orig/gcc/config/mn10300/linux.h gcc-20050116/gcc/config/mn10300/linux.h
--- gcc-20050116.orig/gcc/config/mn10300/linux.h 2005-01-17 00:45:17.000000000 +0000
+++ gcc-20050116/gcc/config/mn10300/linux.h 2005-01-17 00:53:23.477610026 +0000
@@ -37,7 +37,7 @@
#define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
%{static:-static}"
#undef LIB_SPEC
diff -Naur gcc-20050116.orig/gcc/config/pa/pa-linux.h gcc-20050116/gcc/config/pa/pa-linux.h
--- gcc-20050116.orig/gcc/config/pa/pa-linux.h 2005-01-17 00:45:17.000000000 +0000
+++ gcc-20050116/gcc/config/pa/pa-linux.h 2005-01-17 00:53:45.334495141 +0000
@@ -88,7 +88,7 @@
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
%{static:-static}}"
/* glibc's profiling functions don't need gcc to allocate counters. */
diff -Naur gcc-20050116.orig/gcc/config/rs6000/linux64.h gcc-20050116/gcc/config/rs6000/linux64.h
--- gcc-20050116.orig/gcc/config/rs6000/linux64.h 2005-01-17 00:45:17.000000000 +0000
+++ gcc-20050116/gcc/config/rs6000/linux64.h 2005-01-17 00:54:28.524412534 +0000
@@ -351,11 +351,11 @@
#define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}"
#define LINK_OS_LINUX_SPEC64 "-m elf64ppc %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib64/ld64.so.1}}}"
+ %{!dynamic-linker:-dynamic-linker /tools/lib64/ld64.so.1}}}"
#undef TOC_SECTION_ASM_OP
#define TOC_SECTION_ASM_OP \
diff -Naur gcc-20050116.orig/gcc/config/rs6000/sysv4.h gcc-20050116/gcc/config/rs6000/sysv4.h
--- gcc-20050116.orig/gcc/config/rs6000/sysv4.h 2005-01-17 00:45:17.000000000 +0000
+++ gcc-20050116/gcc/config/rs6000/sysv4.h 2005-01-17 01:26:39.126999460 +0000
@@ -1131,7 +1131,7 @@
#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}"
#if defined(HAVE_LD_EH_FRAME_HDR)
# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
@@ -1162,7 +1162,7 @@
#define LINK_OS_GNU_SPEC "-m elf32ppclinux %{!shared: %{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}}}"
#define CPP_OS_GNU_SPEC "-D__unix__ -D__gnu_hurd__ -D__GNU__ \
%{!undef: \
diff -Naur gcc-20050116.orig/gcc/config/s390/linux.h gcc-20050116/gcc/config/s390/linux.h
--- gcc-20050116.orig/gcc/config/s390/linux.h 2005-01-17 00:45:17.000000000 +0000
+++ gcc-20050116/gcc/config/s390/linux.h 2005-01-17 01:26:58.672523211 +0000
@@ -86,8 +86,8 @@
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker: \
- %{m31:-dynamic-linker /lib/ld.so.1} \
- %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
+ %{m31:-dynamic-linker /tools/lib/ld.so.1} \
+ %{m64:-dynamic-linker /tools/lib/ld64.so.1}}}}"
#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
diff -Naur gcc-20050116.orig/gcc/config/sh/linux.h gcc-20050116/gcc/config/sh/linux.h
--- gcc-20050116.orig/gcc/config/sh/linux.h 2005-01-17 00:45:18.000000000 +0000
+++ gcc-20050116/gcc/config/sh/linux.h 2005-01-17 01:27:19.588663163 +0000
@@ -70,7 +70,7 @@
"%{shared:-shared} \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
%{static:-static}"
#undef LIB_SPEC
diff -Naur gcc-20050116.orig/gcc/config/sparc/linux.h gcc-20050116/gcc/config/sparc/linux.h
--- gcc-20050116.orig/gcc/config/sparc/linux.h 2005-01-17 00:45:18.000000000 +0000
+++ gcc-20050116/gcc/config/sparc/linux.h 2005-01-17 01:30:07.282688639 +0000
@@ -131,13 +131,13 @@
/* If ELF is the default format, we should not use /lib/elf. */
#undef LINK_SPEC
-#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
+#define LINK_SPEC "-m elf32_sparc -Y P,/tools/lib %{shared:-shared} \
%{!mno-relax:%{!r:-relax}} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
%{static:-static}}}"
/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
diff -Naur gcc-20050116.orig/gcc/config/sparc/linux64.h gcc-20050116/gcc/config/sparc/linux64.h
--- gcc-20050116.orig/gcc/config/sparc/linux64.h 2005-01-17 00:45:18.000000000 +0000
+++ gcc-20050116/gcc/config/sparc/linux64.h 2005-01-17 01:31:18.242712476 +0000
@@ -167,21 +167,21 @@
{ "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
{ "link_arch", LINK_ARCH_SPEC },
-#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
+#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/tools/lib %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}} \
%{static:-static}}} \
"
-#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
+#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/tools/lib64 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib64/ld-linux.so.2}} \
%{static:-static}}} \
"
@@ -257,12 +257,12 @@
#else /* !SPARC_BI_ARCH */
#undef LINK_SPEC
-#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
+#define LINK_SPEC "-m elf64_sparc -Y P,/tools/lib64 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib64/ld-linux.so.2}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib64/ld-linux.so.2}} \
%{static:-static}}} \
%{mlittle-endian:-EL} \
%{!mno-relax:%{!r:-relax}} \
diff -Naur gcc-20050116.orig/gcc/config/xtensa/linux.h gcc-20050116/gcc/config/xtensa/linux.h
--- gcc-20050116.orig/gcc/config/xtensa/linux.h 2005-01-17 00:45:18.000000000 +0000
+++ gcc-20050116/gcc/config/xtensa/linux.h 2005-01-17 01:32:08.951429623 +0000
@@ -50,7 +50,7 @@
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{!dynamic-linker:-dynamic-linker /tools/lib/ld.so.1}} \
%{static:-static}}}"
#undef LOCAL_LABEL_PREFIX

View File

@@ -0,0 +1,45 @@
Submitted By: Dan Nicholson <dnicholson at linuxfromscratch dot org>
Date: 2006-09-01
Initial Package Version: 2.3.6
Origin: udev-096, syscall functions generated by Alexander E. Patrakov
Upstream Status: Added to syscall list in 2.4
Description: Adds inotify syscall functions for use in userspace. Minimal
syscall functions borrowed from udev local implementation to
provide system inotify support.
Testcase: dovecot-1.0rc2, ./configure --with-notify=inotify
diff -pNur glibc-2.3.6.orig/sysdeps/unix/sysv/linux/inotify.h glibc-2.3.6/sysdeps/unix/sysv/linux/inotify.h
--- glibc-2.3.6.orig/sysdeps/unix/sysv/linux/inotify.h 1970-01-01 00:00:00.000000000 +0000
+++ glibc-2.3.6/sysdeps/unix/sysv/linux/inotify.h 2006-08-01 05:48:27.000000000 +0000
@@ -0,0 +1,31 @@
+/*
+ * Inode based directory notification for Linux
+ *
+ * Copyright (C) 2005 John McCutchan
+ */
+
+#ifndef _SYS_INOTIFY_H
+#define _SYS_INOTIFY_H
+
+#include <stdint.h>
+#include <linux/inotify.h>
+#include <asm/unistd.h>
+
+extern long int syscall (long int __sysno, ...) __THROW;
+
+static inline int inotify_init(void)
+{
+ return syscall(__NR_inotify_init);
+}
+
+static inline int inotify_add_watch(int fd, const char *name, uint32_t mask)
+{
+ return syscall(__NR_inotify_add_watch, fd, name, mask);
+}
+
+static inline int inotify_rm_watch (int fd, uint32_t wd)
+{
+ return syscall(__NR_inotify_rm_watch, fd, wd);
+}
+
+#endif /* _SYS_INOTIFY_H */

View File

@@ -0,0 +1,33 @@
Submitted By: DJ Lucas <dj at linuxfromscratch dot org>
Date: 2006-04-05
Initial Package Version: 2.3.6
Upstream Status: Committed
Origin: Glibc CVS
Description: Fixes build errors where linux/types.h is included after sys/kd.h.
diff -Naur glibc-2.3.6-orig/sysdeps/unix/sysv/linux/sys/kd.h glibc-2.3.6/sysdeps/unix/sysv/linux/sys/kd.h
--- glibc-2.3.6-orig/sysdeps/unix/sysv/linux/sys/kd.h 2001-07-05 23:56:21.000000000 -0500
+++ glibc-2.3.6/sysdeps/unix/sysv/linux/sys/kd.h 2006-04-04 21:40:50.000000000 -0500
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -21,9 +21,15 @@
/* Make sure the <linux/types.h> header is not loaded. */
#ifndef _LINUX_TYPES_H
-# define _LINUX_TYPES_H 1
+# define _LINUX_TYPES_H 1
+# define __undef_LINUX_TYPES_H
#endif
#include <linux/kd.h>
+#ifdef __undef_LINUX_TYPES_H
+# undef _LINUX_TYPES_H
+# undef __undef_LINUX_TYPES_H
+#endif
+
#endif /* sys/kd.h */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,63 @@
Submitted By: Matthew Burgess (matthew at linuxfromscratch dot org)
Origin: http://security.ubuntu.com/ubuntu/pool/main/g/gzip/gzip_1.3.5-9ubuntu3.1.diff.gz
Date: 2005-05-12
Initial package version: 1.3.5
Description: Fix two security vulnerabilities in gzip: A path traversal
bug when using the -N option (CAN-2005-1228) and a race condition in the
file permission restore code (CAN-2005-0998).
diff -Naur gzip-1.3.5.orig/gzip.c gzip-1.3.5/gzip.c
--- gzip-1.3.5.orig/gzip.c 2002-09-28 07:38:43.000000000 +0000
+++ gzip-1.3.5/gzip.c 2005-05-12 19:15:14.796031360 +0000
@@ -875,8 +875,11 @@
}
close(ifd);
- if (!to_stdout && close(ofd)) {
- write_error();
+ if (!to_stdout) {
+ /* Copy modes, times, ownership, and remove the input file */
+ copy_stat(&istat);
+ if (close(ofd))
+ write_error();
}
if (method == -1) {
if (!to_stdout) xunlink (ofname);
@@ -896,10 +899,6 @@
}
fprintf(stderr, "\n");
}
- /* Copy modes, times, ownership, and remove the input file */
- if (!to_stdout) {
- copy_stat(&istat);
- }
}
/* ========================================================================
@@ -1324,6 +1323,8 @@
error("corrupted input -- file name too large");
}
}
+ char *base2 = base_name (base);
+ strcpy(base, base2);
/* If necessary, adapt the name to local OS conventions: */
if (!list) {
MAKE_LEGAL_NAME(base);
@@ -1725,7 +1726,7 @@
reset_times(ofname, ifstat);
#endif
/* Copy the protection modes */
- if (chmod(ofname, ifstat->st_mode & 07777)) {
+ if (fchmod(ofd, ifstat->st_mode & 07777)) {
int e = errno;
WARN((stderr, "%s: ", progname));
if (!quiet) {
@@ -1734,7 +1735,7 @@
}
}
#ifndef NO_CHOWN
- chown(ofname, ifstat->st_uid, ifstat->st_gid); /* Copy ownership */
+ fchown(ofd, ifstat->st_uid, ifstat->st_gid); /* Copy ownership */
#endif
remove_ofname = 0;
/* It's now safe to remove the input file: */

View File

@@ -0,0 +1,225 @@
Submitted by: Alexander E. Patrakov
Date: 2005-12-07
Initial Package Version: 5.5
Upstream Status: Backport
Origin: Cherry-picked from ftp://invisible-island.net/ncurses/5.5/*.gz
Description: Fixes the following bugs:
* memory leak in keyname()
* mishandling of overlapped wide characters, http://bugs.debian.org/316663
* problems with line-drawing characters on cygwin, http://bugs.debian.org/338234
* mishandling of EINTR in tcgetattr/tcsetattr, http://bugs.debian.org/339518
* mishandling of single-column multibyte characters, http://bugs.debian.org/341661
--- ncurses-5.5-20051015+/ncurses/base/MKkeyname.awk 2005-04-30 19:26:25.000000000 +0000
+++ ncurses-5.5-20051022/ncurses/base/MKkeyname.awk 2005-10-22 19:01:23.000000000 +0000
@@ -97,6 +97,7 @@
print " break;"
print " }"
print " }"
+ print " free(bound);"
print " if (result != 0)"
print " break;"
print " }"
--- ncurses-5.5-20051022+/ncurses/base/lib_addch.c 2005-03-27 16:52:16.000000000 +0000
+++ ncurses-5.5-20051029/ncurses/base/lib_addch.c 2005-10-30 00:51:36.000000000 +0000
@@ -315,7 +315,7 @@
* setup though.
*/
for (i = 0; i < len; ++i) {
- if (isWidecBase(win->_line[y].text[i])) {
+ if (isWidecBase(win->_line[y].text[x + i])) {
break;
} else if (isWidecExt(win->_line[y].text[x + i])) {
for (j = i; x + j <= win->_maxx; ++j) {
@@ -334,7 +334,9 @@
for (i = 0; i < len; ++i) {
NCURSES_CH_T value = ch;
SetWidecExt(value, i);
- TR(TRACE_VIRTPUT, ("multicolumn %d:%d", i + 1, len));
+ TR(TRACE_VIRTPUT, ("multicolumn %d:%d (%d,%d)",
+ i + 1, len,
+ win->_begy + y, win->_begx + x));
line->text[x] = value;
CHANGED_CELL(line, x);
++x;
--- ncurses-5.5-20051022+/ncurses/base/lib_bkgd.c 2005-04-16 18:03:48.000000000 +0000
+++ ncurses-5.5-20051029/ncurses/base/lib_bkgd.c 2005-10-30 00:41:09.000000000 +0000
@@ -131,11 +131,11 @@
for (y = 0; y <= win->_maxy; y++) {
for (x = 0; x <= win->_maxx; x++) {
- if (CharEq(win->_line[y].text[x], old_bkgrnd))
+ if (CharEq(win->_line[y].text[x], old_bkgrnd)) {
win->_line[y].text[x] = win->_nc_bkgd;
- else {
+ } else {
NCURSES_CH_T wch = win->_line[y].text[x];
- RemAttr(wch, (~A_ALTCHARSET));
+ RemAttr(wch, (~(A_ALTCHARSET | A_CHARTEXT)));
win->_line[y].text[x] = _nc_render(win, wch);
}
}
--- ncurses-5.5-20051022+/ncurses/base/lib_erase.c 2001-12-19 01:06:13.000000000 +0000
+++ ncurses-5.5-20051029/ncurses/base/lib_erase.c 2005-10-30 00:36:36.000000000 +0000
@@ -58,6 +59,24 @@
start = win->_line[y].text;
end = &start[win->_maxx];
+ /*
+ * If this is a derived window, we have to handle the case where
+ * a multicolumn character extends into the window that we are
+ * erasing.
+ */
+ if_WIDEC({
+ if (isWidecExt(start[0])) {
+ int x = (win->_parent != 0) ? (win->_begx) : 0;
+ while (x-- > 0) {
+ if (isWidecBase(start[-1])) {
+ --start;
+ break;
+ }
+ --start;
+ }
+ }
+ });
+
for (sp = start; sp <= end; sp++)
*sp = blank;
--- ncurses-5.5-20051029+/misc/terminfo.src 2005-10-26 23:21:06.000000000 +0000
+++ ncurses-5.5-20051112/misc/terminfo.src 2005-11-12 23:01:03.000000000 +0000
@@ -4731,32 +4731,35 @@
# civis [make cursor invisible] causes everything to stackdump? \E[?25l\E[?1c
# ech [erase characters param] broken \E[%p1%dX
# kcbt [back-tab key] not implemented in cygwin? \E[Z
+#
+# 2005/11/12 -TD
+# Remove cbt since it does not work in current cygwin
+# Add 'mir' and 'in' flags based on tack
cygwin|ansi emulation for Cygwin,
- am, hs, in, msgr, xon,
+ am, hs, mir, msgr, xon,
colors#8, it#8, pairs#64,
acsc=+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376,
- bel=^G, bold=\E[1m, cbt=\E[Z, clear=\E[H\E[J, cr=^M,
- cub=\E[%p1%dD, cub1=^H, cud=\E[%p1%dB, cud1=\E[B,
- cuf=\E[%p1%dC, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
- cuu=\E[%p1%dA, cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P,
- dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, fsl=^G,
- home=\E[H, hpa=\E[%i%p1%dG, ht=^I, ich=\E[%p1%d@,
- ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m,
- kb2=\E[G, kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C,
- kcuu1=\E[A, kdch1=\E[3~, kend=\E[4~, kf1=\E[[A,
- kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[25~,
- kf14=\E[26~, kf15=\E[28~, kf16=\E[29~, kf17=\E[31~,
- kf18=\E[32~, kf19=\E[33~, kf2=\E[[B, kf20=\E[34~,
- kf3=\E[[C, kf4=\E[[D, kf5=\E[[E, kf6=\E[17~, kf7=\E[18~,
- kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~,
- knp=\E[6~, kpp=\E[5~, kspd=^Z, nel=^M^J, op=\E[39;49m,
- rc=\E8, rev=\E[7m, ri=\EM, rmacs=\E[10m,
- rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmpch=\E[10m,
- rmso=\E[27m, rmul=\E[24m, rs1=\Ec\E]R, sc=\E7,
- setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
+ bel=^G, bold=\E[1m, clear=\E[H\E[J, cr=^M, cub=\E[%p1%dD,
+ cub1=^H, cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC,
+ cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA,
+ cuu1=\E[A, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM,
+ dl1=\E[M, ed=\E[J, el=\E[K, el1=\E[1K, fsl=^G, home=\E[H,
+ hpa=\E[%i%p1%dG, ht=^I, ich=\E[%p1%d@, ich1=\E[@,
+ il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m, kb2=\E[G,
+ kbs=^H, kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A,
+ kdch1=\E[3~, kend=\E[4~, kf1=\E[[A, kf10=\E[21~,
+ kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
+ kf15=\E[28~, kf16=\E[29~, kf17=\E[31~, kf18=\E[32~,
+ kf19=\E[33~, kf2=\E[[B, kf20=\E[34~, kf3=\E[[C, kf4=\E[[D,
+ kf5=\E[[E, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~,
+ khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, kspd=^Z,
+ nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM,
+ rmacs=\E[10m, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l,
+ rmpch=\E[10m, rmso=\E[27m, rmul=\E[24m, rs1=\Ec\E]R,
+ sc=\E7, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p9%t;11%;m,
- sgr0=\E[0;10m, smacs=\E11m, smcup=\E7\E[?47h, smir=\E[4h,
- smpch=\E[11m, smso=\E[7m, smul=\E[4m, tsl=\E];,
+ sgr0=\E[0;10m, smacs=\E[11m, smcup=\E7\E[?47h,
+ smir=\E[4h, smpch=\E[11m, smso=\E[7m, smul=\E[4m, tsl=\E];,
u6=\E[%i%d;%dR, u7=\E[6n, u8=\E[?6c, u9=\E[c,
vpa=\E[%i%p1%dd,
--- ncurses-5.5-20051112+/ncurses/tinfo/lib_ttyflags.c 2003-05-17 23:50:37.000000000 +0000
+++ ncurses-5.5-20051119/ncurses/tinfo/lib_ttyflags.c 2005-11-19 20:36:23.000000000 +0000
@@ -59,28 +59,51 @@
NCURSES_EXPORT(int)
_nc_get_tty_mode(TTY * buf)
{
- if (cur_term == 0
- || GET_TTY(cur_term->Filedes, buf) != 0) {
- memset(buf, 0, sizeof(*buf));
- return (ERR);
+ int result = OK;
+
+ if (cur_term == 0) {
+ result = ERR;
+ } else {
+ for (;;) {
+ if (GET_TTY(cur_term->Filedes, buf) != 0) {
+ if (errno == EINTR)
+ continue;
+ result = ERR;
+ }
+ break;
+ }
}
+
+ if (result == ERR)
+ memset(buf, 0, sizeof(*buf));
+
TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s",
cur_term->Filedes, _nc_trace_ttymode(buf)));
- return (OK);
+ return (result);
}
NCURSES_EXPORT(int)
_nc_set_tty_mode(TTY * buf)
{
- if (cur_term == 0
- || SET_TTY(cur_term->Filedes, buf) != 0) {
- if ((errno == ENOTTY) && (SP != 0))
- SP->_notty = TRUE;
- return (ERR);
+ int result = OK;
+
+ if (cur_term == 0) {
+ result = ERR;
+ } else {
+ for (;;) {
+ if (SET_TTY(cur_term->Filedes, buf) != 0) {
+ if (errno == EINTR)
+ continue;
+ if ((errno == ENOTTY) && (SP != 0))
+ SP->_notty = TRUE;
+ result = ERR;
+ }
+ break;
+ }
}
TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s",
cur_term->Filedes, _nc_trace_ttymode(buf)));
- return (OK);
+ return (result);
}
NCURSES_EXPORT(int)
--- ncurses-5.5-20051126+/ncurses/widechar/lib_ins_wch.c 2005-09-17 19:25:13.000000000 +0000
+++ ncurses-5.5-20051203/ncurses/widechar/lib_ins_wch.c 2005-12-03 20:24:19.000000000 +0000
@@ -117,7 +117,7 @@
for (cp = wstr; *cp && ((cp - wstr) < n); cp++) {
int len = wcwidth(*cp);
- if (len != 1) {
+ if (len != 1 || !is8bits(*cp)) {
cchar_t tmp_cchar;
wchar_t tmp_wchar = *cp;
memset(&tmp_cchar, 0, sizeof(tmp_cchar));

View File

@@ -0,0 +1,32 @@
Submitted By: Anderson Lizardo <andersonlizardo(at)yahoo(dot)com(dot)br>
Date: 2006-02-15
Initial Package Version: 5.8.8
Origin: based on current LFS-BOOK patch (perl-5.8.0-libc-2.patch)
Description: this patch adapts some hard-wired paths to the C library.
It uses the $prefix variable to locate the correct libc.
diff -Naur perl-5.8.8.orig/hints/linux.sh perl-5.8.8/hints/linux.sh
--- perl-5.8.8.orig/hints/linux.sh 2005-11-18 01:18:45.000000000 +0000
+++ perl-5.8.8/hints/linux.sh 2006-02-12 12:20:32.000000000 +0000
@@ -52,9 +52,9 @@
# We don't use __GLIBC__ and __GLIBC_MINOR__ because they
# are insufficiently precise to distinguish things like
# libc-2.0.6 and libc-2.0.7.
-if test -L /lib/libc.so.6; then
- libc=`ls -l /lib/libc.so.6 | awk '{print $NF}'`
- libc=/lib/$libc
+if test -L ${prefix}/lib/libc.so.6; then
+ libc=`ls -l ${prefix}/lib/libc.so.6 | awk '{print $NF}'`
+ libc=${prefix}/lib/$libc
fi
# Configure may fail to find lstat() since it's a static/inline
@@ -330,3 +330,8 @@
libswanted="$*"
;;
esac
+
+locincpth=""
+loclibpth=""
+glibpth="${prefix}/lib"
+usrinc="${prefix}/include"

View File

@@ -0,0 +1,25 @@
Submitted By: Matthew Burgess <matthew@linuxfromscratch.org>
Date: 2005-07-15
Initial Package Version: 1.15.1
Upstream Status: From Upstream
Origin: Ryan Oliver
Description: Fixes a compilation problem with gcc-4.0.x that results in:
genfile.c:63: error: static declaration of 'argp_program_version' follows non-static declaration
../lib/argp.h:428: error: previous declaration of 'argp_program_version' was here
genfile.c:64: error: static declaration of 'argp_program_bug_address' follows non-static declaration
../lib/argp.h:444: error: previous declaration of 'argp_program_bug_address' was here
--- tar-1.15.1/tests/genfile.c-orig 2005-04-25 15:23:47.000000000 +1000
+++ tar-1.15.1/tests/genfile.c 2005-04-25 15:24:08.000000000 +1000
@@ -60,8 +60,8 @@
/* Block buffer for sparse file */
char *buffer;
-static const char *argp_program_version = "genfile (" PACKAGE ") " VERSION;
-static const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
+const char *argp_program_version = "genfile (" PACKAGE ") " VERSION;
+const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
static char doc[] = N_("genfile generates data files for GNU paxutils test suite");
static struct argp_option options[] = {

View File

@@ -0,0 +1,128 @@
Submitted By: Ken Moffat <ken at linuxfromscratch dot org>
Date: 2006-04-14
Initial Package Version: 1.15.1
Origin: gentoo, backported from CVS, rediffed to apply with -p1
Description: addresses vulnerability CVE-2006-0300
diff -Naurp tar-1.15.1-vanilla/src/xheader.c tar-1.15.1/src/xheader.c
--- tar-1.15.1-vanilla/src/xheader.c 2004-09-06 12:31:14.000000000 +0100
+++ tar-1.15.1/src/xheader.c 2006-04-14 16:26:26.000000000 +0100
@@ -783,6 +783,32 @@ code_num (uintmax_t value, char const *k
xheader_print (xhdr, keyword, sbuf);
}
+static bool
+decode_num (uintmax_t *num, char const *arg, uintmax_t maxval,
+ char const *keyword)
+{
+ uintmax_t u;
+ char *arg_lim;
+
+ if (! (ISDIGIT (*arg)
+ && (errno = 0, u = strtoumax (arg, &arg_lim, 10), !*arg_lim)))
+ {
+ ERROR ((0, 0, _("Malformed extended header: invalid %s=%s"),
+ keyword, arg));
+ return false;
+ }
+
+ if (! (u <= maxval && errno != ERANGE))
+ {
+ ERROR ((0, 0, _("Extended header %s=%s is out of range"),
+ keyword, arg));
+ return false;
+ }
+
+ *num = u;
+ return true;
+}
+
static void
dummy_coder (struct tar_stat_info const *st __attribute__ ((unused)),
char const *keyword __attribute__ ((unused)),
@@ -821,7 +847,7 @@ static void
gid_decoder (struct tar_stat_info *st, char const *arg)
{
uintmax_t u;
- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
+ if (decode_num (&u, arg, TYPE_MAXIMUM (gid_t), "gid"))
st->stat.st_gid = u;
}
@@ -903,7 +929,7 @@ static void
size_decoder (struct tar_stat_info *st, char const *arg)
{
uintmax_t u;
- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
+ if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), "size"))
st->archive_file_size = st->stat.st_size = u;
}
@@ -918,7 +944,7 @@ static void
uid_decoder (struct tar_stat_info *st, char const *arg)
{
uintmax_t u;
- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
+ if (decode_num (&u, arg, TYPE_MAXIMUM (uid_t), "uid"))
st->stat.st_uid = u;
}
@@ -946,7 +972,7 @@ static void
sparse_size_decoder (struct tar_stat_info *st, char const *arg)
{
uintmax_t u;
- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
+ if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), "GNU.sparse.size"))
st->stat.st_size = u;
}
@@ -962,10 +988,10 @@ static void
sparse_numblocks_decoder (struct tar_stat_info *st, char const *arg)
{
uintmax_t u;
- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
+ if (decode_num (&u, arg, SIZE_MAX, "GNU.sparse.numblocks"))
{
st->sparse_map_size = u;
- st->sparse_map = calloc(st->sparse_map_size, sizeof(st->sparse_map[0]));
+ st->sparse_map = xcalloc (u, sizeof st->sparse_map[0]);
st->sparse_map_avail = 0;
}
}
@@ -982,8 +1008,14 @@ static void
sparse_offset_decoder (struct tar_stat_info *st, char const *arg)
{
uintmax_t u;
- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
+ if (decode_num (&u, arg, TYPE_MAXIMUM (off_t), "GNU.sparse.offset"))
+ {
+ if (st->sparse_map_avail < st->sparse_map_size)
st->sparse_map[st->sparse_map_avail].offset = u;
+ else
+ ERROR ((0, 0, _("Malformed extended header: excess %s=%s"),
+ "GNU.sparse.offset", arg));
+ }
}
static void
@@ -998,15 +1030,13 @@ static void
sparse_numbytes_decoder (struct tar_stat_info *st, char const *arg)
{
uintmax_t u;
- if (xstrtoumax (arg, NULL, 10, &u, "") == LONGINT_OK)
+ if (decode_num (&u, arg, SIZE_MAX, "GNU.sparse.numbytes"))
{
if (st->sparse_map_avail == st->sparse_map_size)
- {
- st->sparse_map_size *= 2;
- st->sparse_map = xrealloc (st->sparse_map,
- st->sparse_map_size
- * sizeof st->sparse_map[0]);
- }
+ st->sparse_map = x2nrealloc (st->sparse_map,
+ &st->sparse_map_size,
+ sizeof st->sparse_map[0]);
+
st->sparse_map[st->sparse_map_avail++].numbytes = u;
}
}

View File

@@ -0,0 +1,26 @@
Submitted By: Jim Gifford (patches at jg555 dot com)
Date: 2005-03-19
Initial Package Version: 1.15.1
Origin: Tar Bug Reports List
Upstream Status: Applied
Description: Fixes large file corruptions using option -S
http://lists.gnu.org/archive/html/bug-tar/2005-03/msg00004.html
--- tar-1.15.1/src/sparse.c.orig 2005-03-20 04:23:34.144506120 +0000
+++ tar-1.15.1/src/sparse.c 2005-03-20 04:23:56.842055568 +0000
@@ -1,6 +1,6 @@
/* Functions for dealing with sparse files
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -182,7 +182,7 @@
{
static char buffer[BLOCKSIZE];
size_t count;
- size_t offset = 0;
+ off_t offset = 0;
struct sp_array sp = {0, 0};
if (!lseek_or_error (file, 0, SEEK_SET))

View File

@@ -0,0 +1,44 @@
Submitted By: Alexander E. Patrakov
Date: 2005-07-12
Initial Package Version: 4.8
Upstream Status: Hack, won't submit
Origin: Alexander E. Patrakov
Description: Info assumes that a string width in character cells is the
same as its length in bytes. This patch avoids cases when this assumption
is not true.
diff -ur texinfo-4.8/info/info.c texinfo-4.8.hacked/info/info.c
--- texinfo-4.8/info/info.c 2004-04-11 23:56:45.000000000 +0600
+++ texinfo-4.8.hacked/info/info.c 2005-07-12 12:11:34.852485776 +0600
@@ -154,6 +154,10 @@
#ifdef HAVE_SETLOCALE
/* Set locale via LC_ALL. */
setlocale (LC_ALL, "");
+ /* But don't use translated messages in the case when
+ string width and length can differ */
+ if (MB_CUR_MAX > 1)
+ setlocale(LC_MESSAGES, "C");
#endif
#ifdef ENABLE_NLS
diff -ur texinfo-4.8/info/man.c texinfo-4.8.hacked/info/man.c
--- texinfo-4.8/info/man.c 2004-04-11 23:56:46.000000000 +0600
+++ texinfo-4.8.hacked/info/man.c 2005-07-12 12:08:40.267026800 +0600
@@ -325,6 +325,17 @@
freopen (NULL_DEVICE, "r", stdin);
dup2 (pipes[1], fileno (stdout));
+ if (MB_CUR_MAX > 1)
+ {
+ /* Info has trouble wrapping man output if it contains
+ multibyte characters */
+ setenv("LANGUAGE", "C", 1);
+ setenv("LANG", "C", 1);
+ setenv("LC_MESSAGES", "C", 1);
+ setenv("LC_CTYPE", "C", 1);
+ setenv("LC_ALL", "C", 1);
+ }
+
execv (formatter_args[0], formatter_args);
/* If we get here, we couldn't exec, so close out the pipe and

View File

@@ -0,0 +1,80 @@
Updated By: Bruce Dubbs (bdubbs -aT- linuxfromscratch -DoT- org)
Date: 2005-12-12
Submitted By: Archaic (archaic -aT- linuxfromscratch -DoT- org)
Date: 2005-10-08
Initial Package Version: 4.8
Origin: http://gentoo.kems.net/gentoo-portage/sys-apps/texinfo/files/texinfo-4.8-tempfile.patch
Upstream Status: A few patches are floating around in Debian BZ #328365 of which
upstream hasn't made a full commitment on yet.
Description: (CAN-2005-3011) texindex in texinfo 4.8 and earlier allows local
users to overwrite arbitrary files via a symlink attack on
temporary files.
Update: Changed to not pass a constant string to mktemp().
diff -Naur texinfo-4.8.orig/util/texindex.c texinfo-4.8/util/texindex.c
--- texinfo-4.8.orig/util/texindex.c 2005-12-11 23:29:08.000000000 -0600
+++ texinfo-4.8/util/texindex.c 2005-12-11 23:33:31.000000000 -0600
@@ -99,6 +99,9 @@
/* Directory to use for temporary files. On Unix, it ends with a slash. */
char *tempdir;
+/* Basename for temp files inside of tempdir. */
+char *tempbase;
+
/* Number of last temporary file. */
int tempcount;
@@ -153,6 +156,7 @@
main (int argc, char **argv)
{
int i;
+ char template[]="txidxXXXXXX";
tempcount = 0;
last_deleted_tempcount = 0;
@@ -190,6 +194,11 @@
decode_command (argc, argv);
+ /* XXX mkstemp not appropriate, as we need to have somewhat predictable
+ * names. But race condition was fixed, see maketempname.
+ */
+ tempbase = mktemp (template);
+
/* Process input files completely, one by one. */
for (i = 0; i < num_infiles; i++)
@@ -389,21 +398,21 @@
static char *
maketempname (int count)
{
- static char *tempbase = NULL;
char tempsuffix[10];
-
- if (!tempbase)
- {
- int fd;
- tempbase = concat (tempdir, "txidxXXXXXX");
-
- fd = mkstemp (tempbase);
- if (fd == -1)
- pfatal_with_name (tempbase);
- }
+ char *name, *tmp_name;
+ int fd;
sprintf (tempsuffix, ".%d", count);
- return concat (tempbase, tempsuffix);
+ tmp_name = concat (tempdir, tempbase);
+ name = concat (tmp_name, tempsuffix);
+ free(tmp_name);
+
+ fd = open (name, O_CREAT|O_EXCL|O_WRONLY, 0600);
+ if (fd == -1)
+ pfatal_with_name (name);
+
+ close(fd);
+ return name;
}

View File

@@ -0,0 +1,93 @@
Submitted by: Jeremy Utley <jeremy@linuxfromscratch.org>
Date: 2004-12-25
Initial Package Version: 2.12p (should apply to versions back to at least k)
Upstream Status: Not Submitted - Test Version
Origin: Alexander Patrakov, adapted from debian build of cramfs utilities
Description: Util-Linux fails in cramfs compilation due to changes in the
linux-libc-headers package 2.6.9 and after. This patch is a proper fix to the
problem, but may in fact not be accepted upstream.
diff -Naur util-linux-2.12p/disk-utils/fsck.cramfs.c util-linux-2.12p-new/disk-utils/fsck.cramfs.c
--- util-linux-2.12p/disk-utils/fsck.cramfs.c 2004-12-11 14:53:16.000000000 +0000
+++ util-linux-2.12p-new/disk-utils/fsck.cramfs.c 2004-12-26 00:53:10.665199086 +0000
@@ -76,16 +76,7 @@
#define PAD_SIZE 512
-#include <asm/page.h>
-#ifdef PAGE_SIZE
-#define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
-#elif defined __ia64__
-#define PAGE_CACHE_SIZE (16384)
-#elif defined __alpha__
-#define PAGE_CACHE_SIZE (8192)
-#else
-#define PAGE_CACHE_SIZE (4096)
-#endif
+#define PAGE_CACHE_SIZE page_size
/* Guarantee access to at least 8kB at a time */
#define ROMBUFFER_BITS 13
@@ -95,11 +86,13 @@
static unsigned long read_buffer_block = ~0UL;
/* Uncompressing data structures... */
-static char outbuffer[PAGE_CACHE_SIZE*2];
+static char *outbuffer;
z_stream stream;
#endif /* INCLUDE_FS_TESTS */
+static size_t page_size;
+
/* Input status of 0 to print help and exit without an error. */
static void usage(int status)
{
@@ -464,9 +457,17 @@
int c; /* for getopt */
int start = 0;
+ page_size = sysconf(_SC_PAGESIZE);
+
if (argc)
progname = argv[0];
+ outbuffer = malloc(page_size * 2);
+ if (!outbuffer) {
+ fprintf(stderr, _("failed to allocate outbuffer\n"));
+ exit(8);
+ }
+
/* command line options */
while ((c = getopt(argc, argv, "hx:v")) != EOF) {
switch (c) {
diff -Naur util-linux-2.12p/disk-utils/mkfs.cramfs.c util-linux-2.12p-new/disk-utils/mkfs.cramfs.c
--- util-linux-2.12p/disk-utils/mkfs.cramfs.c 2004-12-11 14:56:01.000000000 +0000
+++ util-linux-2.12p-new/disk-utils/mkfs.cramfs.c 2004-12-26 00:53:10.666198928 +0000
@@ -46,16 +46,8 @@
static const char *progname = "mkcramfs";
static int verbose = 0;
-#ifdef __ia64__
-#define PAGE_CACHE_SIZE (16384)
-#elif defined __alpha__
-#define PAGE_CACHE_SIZE (8192)
-#else
-#define PAGE_CACHE_SIZE (4096)
-#endif
-
/* The kernel assumes PAGE_CACHE_SIZE as block size. */
-static unsigned int blksize = PAGE_CACHE_SIZE; /* settable via -b option */
+static unsigned int blksize; /* settable via -b option */
static long total_blocks = 0, total_nodes = 1; /* pre-count the root node */
static int image_length = 0;
@@ -730,6 +722,7 @@
u32 crc = crc32(0L, Z_NULL, 0);
int c;
+ blksize = sysconf(_SC_PAGESIZE);
total_blocks = 0;
if (argc) {