Zwischencommit beim Umzug auf LFS 6.2.

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@299 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2006-10-01 10:51:18 +00:00
parent 15679d9f96
commit 9b0ff0a0b6
57 changed files with 22590 additions and 24525 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,111 @@
Submitted By: Dan Nicholson <dnicholson AT linuxfromscratch DOT org>
Date: 2006-09-02
Initial Package Version: 4.4.20
Origin: Upstream - http://www.sleepycat.com/update/4.4.20/patch.4.4.20.html
Description: Bug fixes provided by the developer. Contains patches 1-4.
diff -pNur db-4.4.20.orig/db/db_cam.c db-4.4.20/db/db_cam.c
--- db-4.4.20.orig/db/db_cam.c 2006-01-10 16:19:21.000000000 +0000
+++ db-4.4.20/db/db_cam.c 2006-08-03 14:31:20.220319610 +0000
@@ -579,11 +579,12 @@ __db_c_get(dbc_arg, key, data, flags)
flags == DB_NEXT || flags == DB_NEXT_DUP || flags == DB_PREV)) {
if (tmp_rmw && (ret = dbc_arg->c_am_writelock(dbc_arg)) != 0)
return (ret);
- if ((ret = __db_c_idup(cp->opd, &opd, DB_POSITION)) != 0)
+ if (F_ISSET(dbc_arg, DBC_TRANSIENT))
+ opd = cp->opd;
+ else if ((ret = __db_c_idup(cp->opd, &opd, DB_POSITION)) != 0)
return (ret);
- switch (ret =
- opd->c_am_get(opd, key, data, flags, NULL)) {
+ switch (ret = opd->c_am_get(opd, key, data, flags, NULL)) {
case 0:
goto done;
case DB_NOTFOUND:
@@ -596,12 +597,18 @@ __db_c_get(dbc_arg, key, data, flags)
if ((ret = __db_c_close(opd)) != 0)
goto err;
opd = NULL;
+ if (F_ISSET(dbc_arg, DBC_TRANSIENT))
+ cp->opd = NULL;
break;
}
goto err;
default:
goto err;
}
+ } else if (cp->opd != NULL && F_ISSET(dbc_arg, DBC_TRANSIENT)) {
+ if ((ret = __db_c_close(cp->opd)) != 0)
+ goto err;
+ cp->opd = NULL;
}
/*
diff -pNur db-4.4.20.orig/mp/mp_fget.c db-4.4.20/mp/mp_fget.c
--- db-4.4.20.orig/mp/mp_fget.c 2005-10-12 17:53:36.000000000 +0000
+++ db-4.4.20/mp/mp_fget.c 2006-08-03 14:31:20.223318410 +0000
@@ -587,8 +587,11 @@ alloc: /*
*/
if (state != SECOND_MISS && bhp->ref == 1) {
bhp->priority = UINT32_MAX;
- SH_TAILQ_REMOVE(&hp->hash_bucket, bhp, hq, __bh);
- SH_TAILQ_INSERT_TAIL(&hp->hash_bucket, bhp, hq);
+ if (SH_TAILQ_FIRST(&hp->hash_bucket, __bh) !=
+ SH_TAILQ_LAST(&hp->hash_bucket, hq, __bh)) {
+ SH_TAILQ_REMOVE(&hp->hash_bucket, bhp, hq, __bh);
+ SH_TAILQ_INSERT_TAIL(&hp->hash_bucket, bhp, hq);
+ }
hp->hash_priority =
SH_TAILQ_FIRSTP(&hp->hash_bucket, __bh)->priority;
}
diff -pNur db-4.4.20.orig/qam/qam_files.c db-4.4.20/qam/qam_files.c
--- db-4.4.20.orig/qam/qam_files.c 2005-10-20 18:57:12.000000000 +0000
+++ db-4.4.20/qam/qam_files.c 2006-08-03 14:31:20.211323209 +0000
@@ -411,6 +411,12 @@ __qam_fremove(dbp, pgnoaddr)
DB_APP_DATA, buf, 0, NULL, &real_name)) != 0)
goto err;
#endif
+
+ mpf = array->mpfarray[offset].mpf;
+ /* This extent my already be marked for delete and closed. */
+ if (mpf == NULL)
+ goto err;
+
/*
* The log must be flushed before the file is deleted. We depend on
* the log record of the last delete to recreate the file if we crash.
@@ -418,7 +424,6 @@ __qam_fremove(dbp, pgnoaddr)
if (LOGGING_ON(dbenv) && (ret = __log_flush(dbenv, NULL)) != 0)
goto err;
- mpf = array->mpfarray[offset].mpf;
(void)__memp_set_flags(mpf, DB_MPOOL_UNLINK, 1);
/* Someone could be real slow, let them close it down. */
if (array->mpfarray[offset].pinref != 0)
diff -pNur db-4.4.20.orig/txn/txn.c db-4.4.20/txn/txn.c
--- db-4.4.20.orig/txn/txn.c 2005-11-01 14:50:03.000000000 +0000
+++ db-4.4.20/txn/txn.c 2006-08-03 14:31:20.215321609 +0000
@@ -1049,12 +1049,14 @@ __txn_set_name(txn, name)
return (ret);
memcpy(txn->name, name, len);
+ TXN_SYSTEM_LOCK(dbenv);
if (td->name != INVALID_ROFF) {
__db_shalloc_free(
&mgr->reginfo, R_ADDR(&mgr->reginfo, td->name));
td->name = INVALID_ROFF;
}
if ((ret = __db_shalloc(&mgr->reginfo, len, 0, &p)) != 0) {
+ TXN_SYSTEM_UNLOCK(dbenv);
__db_err(dbenv,
"Unable to allocate memory for transaction name");
@@ -1063,6 +1065,7 @@ __txn_set_name(txn, name)
return (ret);
}
+ TXN_SYSTEM_UNLOCK(dbenv);
td->name = R_OFFSET(&mgr->reginfo, p);
memcpy(p, name, len);

View File

@@ -0,0 +1,802 @@
Submitted by: Alexander E. Patrakov
Date: 2005-08-13
Initial Package Version: 2.8.1
Upstream Status: Unknown, but required for LSB >= 2.0 certification
Origin: RedHat
Description: Fixes treatment of whitespace in multibyte locales.
--- diffutils-2.8.4/src/diff.c.i18n 2002-06-17 01:55:42.000000000 -0400
+++ diffutils-2.8.4/src/diff.c 2002-11-16 18:41:37.000000000 -0500
@@ -275,6 +275,13 @@
re_set_syntax (RE_SYNTAX_GREP | RE_NO_POSIX_BACKTRACKING);
excluded = new_exclude ();
+#ifdef HANDLE_MULTIBYTE
+ if (MB_CUR_MAX > 1)
+ lines_differ = lines_differ_multibyte;
+ else
+#endif
+ lines_differ = lines_differ_singlebyte;
+
/* Decode the options. */
while ((c = getopt_long (argc, argv, shortopts, longopts, 0)) != -1)
--- diffutils-2.8.4/src/diff.h.i18n 2002-11-16 18:31:32.000000000 -0500
+++ diffutils-2.8.4/src/diff.h 2002-11-16 18:48:58.000000000 -0500
@@ -23,6 +23,19 @@
#include "system.h"
#include <stdio.h>
+/* For platform which support the ISO C amendement 1 functionality we
+ support user defined character classes. */
+#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H
+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
+# include <wchar.h>
+# include <wctype.h>
+# if defined (HAVE_MBRTOWC)
+# define HANDLE_MULTIBYTE 1
+# endif
+#endif
+
+#define TAB_WIDTH 8
+
/* What kind of changes a hunk contains. */
enum changes
{
@@ -350,7 +363,13 @@
extern char const pr_program[];
char *concat (char const *, char const *, char const *);
char *dir_file_pathname (char const *, char const *);
-bool lines_differ (char const *, char const *);
+
+bool (*lines_differ) (char const *, char const *);
+bool lines_differ_singlebyte (char const *, char const *);
+#ifdef HANDLE_MULTIBYTE
+bool lines_differ_multibyte (char const *, char const *);
+#endif
+
lin translate_line_number (struct file_data const *, lin);
struct change *find_change (struct change *);
struct change *find_reverse_change (struct change *);
--- diffutils-2.8.4/src/io.c.i18n 2002-06-11 02:06:32.000000000 -0400
+++ diffutils-2.8.4/src/io.c 2002-11-16 18:57:30.000000000 -0500
@@ -26,6 +26,7 @@
#include <regex.h>
#include <setmode.h>
#include <xalloc.h>
+#include <assert.h>
/* Rotate an unsigned value to the left. */
#define ROL(v, n) ((v) << (n) | (v) >> (sizeof (v) * CHAR_BIT - (n)))
@@ -213,6 +214,28 @@
/* Split the file into lines, simultaneously computing the equivalence
class for each line. */
+#ifdef HANDLE_MULTIBYTE
+# define MBC2WC(P, END, MBLENGTH, WC, STATE, CONVFAIL) \
+do \
+{ \
+ mbstate_t state_bak = STATE; \
+ \
+ CONVFAIL = 0; \
+ MBLENGTH = mbrtowc (&WC, P, END - (char const *)P, &STATE); \
+ \
+ switch (MBLENGTH) \
+ { \
+ case (size_t)-2: \
+ case (size_t)-1: \
+ STATE = state_bak; \
+ ++CONVFAIL; \
+ /* Fall through. */ \
+ case 0: \
+ MBLENGTH = 1; \
+ } \
+} \
+while (0)
+#endif
static void
find_and_hash_each_line (struct file_data *current)
@@ -239,12 +262,280 @@
bool same_length_diff_contents_compare_anyway =
diff_length_compare_anyway | ignore_case;
+#ifdef HANDLE_MULTIBYTE
+ wchar_t wc;
+ size_t mblength;
+ mbstate_t state;
+ int convfail;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+#endif
+
while ((char const *) p < suffix_begin)
{
char const *ip = (char const *) p;
h = 0;
+#ifdef HANDLE_MULTIBYTE
+ if (MB_CUR_MAX > 1)
+ {
+ wchar_t lo_wc;
+ char mbc[MB_LEN_MAX];
+ mbstate_t state_wc;
+
+ /* Hash this line until we find a newline. */
+ switch (ignore_white_space)
+ {
+ case IGNORE_ALL_SPACE:
+ while (1)
+ {
+ if (*p == '\n')
+ {
+ ++p;
+ break;
+ }
+
+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail);
+
+ if (convfail)
+ mbc[0] = *p++;
+ else if (!iswspace (wc))
+ {
+ bool flag = 0;
+
+ if (ignore_case)
+ {
+ lo_wc = towlower (wc);
+ if (lo_wc != wc)
+ {
+ flag = 1;
+
+ p += mblength;
+ memset (&state_wc, '\0', sizeof(mbstate_t));
+ mblength = wcrtomb (mbc, lo_wc, &state_wc);
+
+ assert (mblength != (size_t)-1 &&
+ mblength != (size_t)-2);
+
+ mblength = (mblength < 1) ? 1 : mblength;
+ }
+ }
+
+ if (!flag)
+ {
+ for (i = 0; i < mblength; i++)
+ mbc[i] = *p++;
+ }
+ }
+ else
+ {
+ p += mblength;
+ continue;
+ }
+
+ for (i = 0; i < mblength; i++)
+ h = HASH (h, mbc[i]);
+ }
+ break;
+
+ case IGNORE_SPACE_CHANGE:
+ while (1)
+ {
+ if (*p == '\n')
+ {
+ ++p;
+ break;
+ }
+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail);
+
+ if (!convfail && iswspace (wc))
+ {
+ while (1)
+ {
+ if (*p == '\n')
+ {
+ ++p;
+ goto hashing_done;
+ }
+
+ p += mblength;
+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail);
+ if (convfail || (!convfail && !iswspace (wc)))
+ break;
+ }
+ h = HASH (h, ' ');
+ }
+
+ /* WC is now the first non-space. */
+ if (convfail)
+ mbc[0] = *p++;
+ else
+ {
+ bool flag = 0;
+
+ if (ignore_case)
+ {
+ lo_wc = towlower (wc);
+ if (lo_wc != wc)
+ {
+ flag = 1;
+
+ p += mblength;
+ memset (&state_wc, '\0', sizeof(mbstate_t));
+ mblength = wcrtomb (mbc, lo_wc, &state_wc);
+
+ assert (mblength != (size_t)-1 &&
+ mblength != (size_t)-2);
+
+ mblength = (mblength < 1) ? 1 : mblength;
+ }
+ }
+
+ if (!flag)
+ {
+ for (i = 0; i < mblength; i++)
+ mbc[i] = *p++;
+ }
+ }
+
+ for (i = 0; i < mblength; i++)
+ h = HASH (h, mbc[i]);
+ }
+ break;
+
+ case IGNORE_TAB_EXPANSION:
+ {
+ size_t column = 0;
+
+ while (1)
+ {
+ if (*p == '\n')
+ {
+ ++p;
+ break;
+ }
+
+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail);
+
+ if (convfail)
+ {
+ h = HASH (h, *p++);
+ ++column;
+ }
+ else
+ {
+ bool flag;
+
+ switch (wc)
+ {
+ case L'\b':
+ column -= 0 < column;
+ h = HASH (h, '\b');
+ ++p;
+ break;
+
+ case L'\t':
+ {
+ int repetitions;
+
+ repetitions = TAB_WIDTH - column % TAB_WIDTH;
+ column += repetitions;
+ do
+ h = HASH (h, ' ');
+ while (--repetitions != 0);
+ ++p;
+ }
+ break;
+
+ case L'\r':
+ column = 0;
+ h = HASH (h, '\r');
+ ++p;
+ break;
+
+ default:
+ flag = 0;
+ column += wcwidth (wc);
+ if (ignore_case)
+ {
+ lo_wc = towlower (wc);
+ if (lo_wc != wc)
+ {
+ flag = 1;
+ p += mblength;
+ memset (&state_wc, '\0', sizeof(mbstate_t));
+ mblength = wcrtomb (mbc, lo_wc, &state_wc);
+
+ assert (mblength != (size_t)-1 &&
+ mblength != (size_t)-2);
+
+ mblength = (mblength < 1) ? 1 : mblength;
+ }
+ }
+
+ if (!flag)
+ {
+ for (i = 0; i < mblength; i++)
+ mbc[i] = *p++;
+ }
+
+ for (i = 0; i < mblength; i++)
+ h = HASH (h, mbc[i]);
+ }
+ }
+ }
+ }
+ break;
+
+ default:
+ while (1)
+ {
+ if (*p == '\n')
+ {
+ ++p;
+ break;
+ }
+
+ MBC2WC (p, suffix_begin, mblength, wc, state, convfail);
+
+ if (convfail)
+ mbc[0] = *p++;
+ else
+ {
+ int flag = 0;
+
+ if (ignore_case)
+ {
+ lo_wc = towlower (wc);
+ if (lo_wc != wc)
+ {
+ flag = 1;
+ p += mblength;
+ memset (&state_wc, '\0', sizeof(mbstate_t));
+ mblength = wcrtomb (mbc, lo_wc, &state_wc);
+
+ assert (mblength != (size_t)-1 &&
+ mblength != (size_t)-2);
+
+ mblength = (mblength < 1) ? 1 : mblength;
+ }
+ }
+
+ if (!flag)
+ {
+ for (i = 0; i < mblength; i++)
+ mbc[i] = *p++;
+ }
+ }
+
+ for (i = 0; i < mblength; i++)
+ h = HASH (h, mbc[i]);
+ }
+ }
+ }
+ else
+#endif
/* Hash this line until we find a newline. */
if (ignore_case)
switch (ignore_white_space)
--- diffutils-2.8.4/src/side.c.i18n 2002-06-11 02:06:32.000000000 -0400
+++ diffutils-2.8.4/src/side.c 2002-11-16 18:41:37.000000000 -0500
@@ -73,11 +73,72 @@
register size_t out_position = 0;
register char const *text_pointer = line[0];
register char const *text_limit = line[1];
+#if defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H
+ unsigned char mbc[MB_LEN_MAX];
+ wchar_t wc;
+ mbstate_t state, state_bak;
+ size_t mbc_pos, mblength;
+ int mbc_loading_flag = 0;
+ int wc_width;
+
+ memset (&state, '\0', sizeof (mbstate_t));
+#endif
while (text_pointer < text_limit)
{
register unsigned char c = *text_pointer++;
+#if defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H
+ if (MB_CUR_MAX > 1 && mbc_loading_flag)
+ {
+ mbc_loading_flag = 0;
+ state_bak = state;
+ mbc[mbc_pos++] = c;
+
+process_mbc:
+ mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
+
+ switch (mblength)
+ {
+ case (size_t)-2: /* Incomplete multibyte character. */
+ mbc_loading_flag = 1;
+ state = state_bak;
+ break;
+
+ case (size_t)-1: /* Invalid as a multibyte character. */
+ if (in_position++ < out_bound)
+ {
+ out_position = in_position;
+ putc (mbc[0], out);
+ }
+ memmove (mbc, mbc + 1, --mbc_pos);
+ if (mbc_pos > 0)
+ {
+ mbc[mbc_pos] = '\0';
+ goto process_mbc;
+ }
+ break;
+
+ default:
+ wc_width = wcwidth (wc);
+ if (wc_width < 1) /* Unprintable multibyte character. */
+ {
+ if (in_position <= out_bound)
+ fprintf (out, "%lc", (wint_t)wc);
+ }
+ else /* Printable multibyte character. */
+ {
+ in_position += wc_width;
+ if (in_position <= out_bound)
+ {
+ out_position = in_position;
+ fprintf (out, "%lc", (wint_t)wc);
+ }
+ }
+ }
+ continue;
+ }
+#endif
switch (c)
{
case '\t':
@@ -135,8 +196,39 @@
break;
default:
- if (! ISPRINT (c))
- goto control_char;
+#if defined HAVE_WCHAR_H && defined HAVE_WCTYPE_H
+ if (MB_CUR_MAX > 1)
+ {
+ memset (mbc, '\0', MB_LEN_MAX);
+ mbc_pos = 0;
+ mbc[mbc_pos++] = c;
+ state_bak = state;
+
+ mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
+
+ /* The value of mblength is always less than 2 here. */
+ switch (mblength)
+ {
+ case (size_t)-2: /* Incomplete multibyte character. */
+ state = state_bak;
+ mbc_loading_flag = 1;
+ continue;
+
+ case (size_t)-1: /* Invalid as a multibyte character. */
+ state = state_bak;
+ break;
+
+ default:
+ if (! iswprint (wc))
+ goto control_char;
+ }
+ }
+ else
+#endif
+ {
+ if (! ISPRINT (c))
+ goto control_char;
+ }
/* falls through */
case ' ':
if (in_position++ < out_bound)
--- diffutils-2.8.4/src/util.c.i18n 2002-06-11 02:06:32.000000000 -0400
+++ diffutils-2.8.4/src/util.c 2002-11-16 18:41:37.000000000 -0500
@@ -321,7 +321,7 @@
Return nonzero if the lines differ. */
bool
-lines_differ (char const *s1, char const *s2)
+lines_differ_singlebyte (char const *s1, char const *s2)
{
register unsigned char const *t1 = (unsigned char const *) s1;
register unsigned char const *t2 = (unsigned char const *) s2;
@@ -450,6 +450,293 @@
return 1;
}
+
+#ifdef HANDLE_MULTIBYTE
+# define MBC2WC(T, END, MBLENGTH, WC, STATE, CONVFAIL) \
+do \
+{ \
+ mbstate_t bak = STATE; \
+ \
+ CONVFAIL = 0; \
+ MBLENGTH = mbrtowc (&WC, T, END - T, &STATE); \
+ \
+ switch (MBLENGTH) \
+ { \
+ case (size_t)-2: \
+ case (size_t)-1: \
+ STATE = bak; \
+ ++CONVFAIL; \
+ /* Fall through. */ \
+ case 0: \
+ MBLENGTH = 1; \
+ } \
+} \
+while (0)
+
+bool
+lines_differ_multibyte (char const *s1, char const *s2)
+{
+ unsigned char const *end1, *end2;
+ unsigned char c1, c2;
+ wchar_t wc1, wc2, wc1_bak, wc2_bak;
+ size_t mblen1, mblen2;
+ mbstate_t state1, state2, state1_bak, state2_bak;
+ int convfail1, convfail2, convfail1_bak, convfail2_bak;
+
+ unsigned char const *t1 = (unsigned char const *) s1;
+ unsigned char const *t2 = (unsigned char const *) s2;
+ unsigned char const *t1_bak, *t2_bak;
+ size_t column = 0;
+
+ if (ignore_white_space == IGNORE_NO_WHITE_SPACE && !ignore_case)
+ {
+ while (*t1 != '\n')
+ if (*t1++ != * t2++)
+ return 1;
+ return 0;
+ }
+
+ memset (&state1, '\0', sizeof (mbstate_t));
+ memset (&state2, '\0', sizeof (mbstate_t));
+
+ end1 = s1 + strlen (s1);
+ end2 = s2 + strlen (s2);
+
+ while (1)
+ {
+ c1 = *t1;
+ c2 = *t2;
+ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1);
+ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2);
+
+ /* Test for exact char equality first, since it's a common case. */
+ if (convfail1 ^ convfail2)
+ break;
+ else if (convfail1 && convfail2 && c1 != c2)
+ break;
+ else if (!convfail1 && !convfail2 && wc1 != wc2)
+ {
+ switch (ignore_white_space)
+ {
+ case IGNORE_ALL_SPACE:
+ /* For -w, just skip past any white space. */
+ while (1)
+ {
+ if (convfail1)
+ break;
+ else if (wc1 == L'\n' || !iswspace (wc1))
+ break;
+
+ t1 += mblen1;
+ c1 = *t1;
+ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1);
+ }
+
+ while (1)
+ {
+ if (convfail2)
+ break;
+ else if (wc2 == L'\n' || !iswspace (wc2))
+ break;
+
+ t2 += mblen2;
+ c2 = *t2;
+ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2);
+ }
+ t1 += mblen1;
+ t2 += mblen2;
+ break;
+
+ case IGNORE_SPACE_CHANGE:
+ /* For -b, advance past any sequence of white space in
+ line 1 and consider it just one space, or nothing at
+ all if it is at the end of the line. */
+ if (wc1 != L'\n' && iswspace (wc1))
+ {
+ size_t mblen_bak;
+ mbstate_t state_bak;
+
+ do
+ {
+ t1 += mblen1;
+ mblen_bak = mblen1;
+ state_bak = state1;
+ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1);
+ }
+ while (!convfail1 && (wc1 != L'\n' && iswspace (wc1)));
+
+ state1 = state_bak;
+ mblen1 = mblen_bak;
+ t1 -= mblen1;
+ convfail1 = 0;
+ wc1 = L' ';
+ }
+
+ /* Likewise for line 2. */
+ if (wc2 != L'\n' && iswspace (wc2))
+ {
+ size_t mblen_bak;
+ mbstate_t state_bak;
+
+ do
+ {
+ t2 += mblen2;
+ mblen_bak = mblen2;
+ state_bak = state2;
+ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2);
+ }
+ while (!convfail2 && (wc2 != L'\n' && iswspace (wc2)));
+
+ state2 = state_bak;
+ mblen2 = mblen_bak;
+ t2 -= mblen2;
+ convfail2 = 0;
+ wc2 = L' ';
+ }
+
+ if (wc1 != wc2)
+ {
+ if (wc2 == L' ' && wc1 != L'\n' &&
+ t1 > (unsigned char const *)s1 &&
+ !convfail1_bak && iswspace (wc1_bak))
+ {
+ t1 = t1_bak;
+ wc1 = wc1_bak;
+ state1 = state1_bak;
+ convfail1 = convfail1_bak;
+ continue;
+ }
+ if (wc1 == L' ' && wc2 != L'\n'
+ && t2 > (unsigned char const *)s2
+ && !convfail2_bak && iswspace (wc2_bak))
+ {
+ t2 = t2_bak;
+ wc2 = wc2_bak;
+ state2 = state2_bak;
+ convfail2 = convfail2_bak;
+ continue;
+ }
+ }
+
+ t1_bak = t1; t2_bak = t2;
+ wc1_bak = wc1; wc2_bak = wc2;
+ state1_bak = state1; state2_bak = state2;
+ convfail1_bak = convfail1; convfail2_bak = convfail2;
+
+ if (wc1 == L'\n')
+ wc1 = L' ';
+ else
+ t1 += mblen1;
+
+ if (wc2 == L'\n')
+ wc2 = L' ';
+ else
+ t2 += mblen2;
+
+ break;
+
+ case IGNORE_TAB_EXPANSION:
+ if ((wc1 == L' ' && wc2 == L'\t')
+ || (wc1 == L'\t' && wc2 == L' '))
+ {
+ size_t column2 = column;
+
+ while (1)
+ {
+ if (convfail1)
+ {
+ ++t1;
+ break;
+ }
+ else if (wc1 == L' ')
+ column++;
+ else if (wc1 == L'\t')
+ column += TAB_WIDTH - column % TAB_WIDTH;
+ else
+ {
+ t1 += mblen1;
+ break;
+ }
+
+ t1 += mblen1;
+ c1 = *t1;
+ MBC2WC (t1, end1, mblen1, wc1, state1, convfail1);
+ }
+
+ while (1)
+ {
+ if (convfail2)
+ {
+ ++t2;
+ break;
+ }
+ else if (wc2 == L' ')
+ column2++;
+ else if (wc2 == L'\t')
+ column2 += TAB_WIDTH - column2 % TAB_WIDTH;
+ else
+ {
+ t2 += mblen2;
+ break;
+ }
+
+ t2 += mblen2;
+ c2 = *t2;
+ MBC2WC (t2, end2, mblen2, wc2, state2, convfail2);
+ }
+
+ if (column != column2)
+ return 1;
+ }
+ else
+ {
+ t1 += mblen1;
+ t2 += mblen2;
+ }
+ break;
+
+ case IGNORE_NO_WHITE_SPACE:
+ t1 += mblen1;
+ t2 += mblen2;
+ break;
+ }
+
+ /* Lowercase all letters if -i is specified. */
+ if (ignore_case)
+ {
+ if (!convfail1)
+ wc1 = towlower (wc1);
+ if (!convfail2)
+ wc2 = towlower (wc2);
+ }
+
+ if (convfail1 ^ convfail2)
+ break;
+ else if (convfail1 && convfail2 && c1 != c2)
+ break;
+ else if (!convfail1 && !convfail2 && wc1 != wc2)
+ break;
+ }
+ else
+ {
+ t1_bak = t1; t2_bak = t2;
+ wc1_bak = wc1; wc2_bak = wc2;
+ state1_bak = state1; state2_bak = state2;
+ convfail1_bak = convfail1; convfail2_bak = convfail2;
+
+ t1 += mblen1; t2 += mblen2;
+ }
+
+ if (!convfail1 && wc1 == L'\n')
+ return 0;
+
+ column += convfail1 ? 1 :
+ (wc1 == L'\t') ? TAB_WIDTH - column % TAB_WIDTH : wcwidth (wc1);
+ }
+
+ return 1;
+}
+#endif
/* Find the consecutive changes at the start of the script START.
Return the last link before the first gap. */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,892 @@
Submitted By: Jim Gifford <jim@linuxfromscratch.org>
Date: 05-28-2006
Initial Package Version: 0.97
Upstream Status: Unknown
Origin: Fedora and Mandriva
Description: This patch fixes issues with disk geometry not being
detected properly. Part of this patch also fixes
gcc 4 compile errors, which are a part of the issue.
diff -Naur grub-0.97.orig/configure grub-0.97/configure
--- grub-0.97.orig/configure 2005-05-07 19:48:12.000000000 -0700
+++ grub-0.97/configure 2006-05-28 20:29:36.025466751 -0700
@@ -3485,9 +3485,9 @@
echo "$as_me:$LINENO: result: $size_flag" >&5
echo "${ECHO_T}$size_flag" >&6
if test "x$size_flag" = xyes; then
- STAGE2_CFLAGS="-Os"
+ STAGE2_CFLAGS="-Os -fno-strict-aliasing"
else
- STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops"
+ STAGE2_CFLAGS="-O2 -fno-strict-aliasing -fno-strength-reduce -fno-unroll-loops"
fi
# OpenBSD has a GCC extension for protecting applications from
# stack smashing attacks, but GRUB doesn't want this feature.
diff -Naur grub-0.97.orig/configure.ac grub-0.97/configure.ac
--- grub-0.97.orig/configure.ac 2005-05-07 19:36:03.000000000 -0700
+++ grub-0.97/configure.ac 2006-05-28 20:28:41.538819726 -0700
@@ -93,9 +93,9 @@
CFLAGS=$saved_CFLAGS
])
if test "x$size_flag" = xyes; then
- STAGE2_CFLAGS="-Os"
+ STAGE2_CFLAGS="-Os -fno-strict-aliasing"
else
- STAGE2_CFLAGS="-O2 -fno-strength-reduce -fno-unroll-loops"
+ STAGE2_CFLAGS="-O2 -fno-strict-aliasing -fno-strength-reduce -fno-unroll-loops"
fi
# OpenBSD has a GCC extension for protecting applications from
# stack smashing attacks, but GRUB doesn't want this feature.
diff -Naur grub-0.97.orig/lib/device.c grub-0.97/lib/device.c
--- grub-0.97.orig/lib/device.c 2005-03-27 15:14:25.000000000 -0800
+++ grub-0.97/lib/device.c 2006-05-28 20:34:03.546804777 -0700
@@ -131,6 +131,152 @@
#include <shared.h>
#include <device.h>
+#if defined(__linux__)
+/* The 2.6 kernel has removed all of the geometry handling for IDE drives
+ * that did fixups for LBA, etc. This means that the geometry we get
+ * with the ioctl has a good chance of being wrong. So, we get to
+ * also know about partition tables and try to read what the geometry
+ * is there. *grumble* Very closely based on code from cfdisk
+ */
+static void get_kernel_geometry(int fd, long long *cyl, int *heads, int *sectors) {
+ struct hd_geometry hdg;
+
+ if (ioctl (fd, HDIO_GETGEO, &hdg))
+ return;
+
+ *cyl = hdg.cylinders;
+ *heads = hdg.heads;
+ *sectors = hdg.sectors;
+}
+
+struct partition {
+ unsigned char boot_ind; /* 0x80 - active */
+ unsigned char head; /* starting head */
+ unsigned char sector; /* starting sector */
+ unsigned char cyl; /* starting cylinder */
+ unsigned char sys_ind; /* What partition type */
+ unsigned char end_head; /* end head */
+ unsigned char end_sector; /* end sector */
+ unsigned char end_cyl; /* end cylinder */
+ unsigned char start4[4]; /* starting sector counting from 0 */
+ unsigned char size4[4]; /* nr of sectors in partition */
+};
+
+#define ALIGNMENT 2
+typedef union {
+ struct {
+ unsigned char align[ALIGNMENT];
+ unsigned char b[SECTOR_SIZE];
+ } c;
+ struct {
+ unsigned char align[ALIGNMENT];
+ unsigned char buffer[0x1BE];
+ struct partition part[4];
+ unsigned char magicflag[2];
+ } p;
+} partition_table;
+
+#define PART_TABLE_FLAG0 0x55
+#define PART_TABLE_FLAG1 0xAA
+
+static void
+get_partition_table_geometry(partition_table *bufp, long long *cyl, int *heads,
+ int *sectors) {
+ struct partition *p;
+ int i,h,s,hh,ss;
+ int first = 1;
+ int bad = 0;
+
+ if (bufp->p.magicflag[0] != PART_TABLE_FLAG0 ||
+ bufp->p.magicflag[1] != PART_TABLE_FLAG1) {
+ /* Matthew Wilcox: slightly friendlier version of
+ fatal(_("Bad signature on partition table"), 3);
+ */
+ fprintf(stderr, "Unknown partition table signature\n");
+ return;
+ }
+
+ hh = ss = 0;
+ for (i=0; i<4; i++) {
+ p = &(bufp->p.part[i]);
+ if (p->sys_ind != 0) {
+ h = p->end_head + 1;
+ s = (p->end_sector & 077);
+ if (first) {
+ hh = h;
+ ss = s;
+ first = 0;
+ } else if (hh != h || ss != s)
+ bad = 1;
+ }
+ }
+
+ if (!first && !bad) {
+ *heads = hh;
+ *sectors = ss;
+ }
+}
+
+static long long my_lseek (unsigned int fd, long long offset,
+ unsigned int origin)
+{
+#if defined(__linux__) && (!defined(__GLIBC__) || \
+ ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))))
+ /* Maybe libc doesn't have large file support. */
+ loff_t offset, result;
+ static int _llseek (uint filedes, ulong hi, ulong lo,
+ loff_t *res, uint wh);
+ _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo,
+ loff_t *, res, uint, wh);
+
+ if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET) < 0)
+ return (long long) -1;
+ return result;
+#else
+ return lseek(fd, offset, SEEK_SET);
+#endif
+}
+
+static void get_linux_geometry (int fd, struct geometry *geom) {
+ long long kern_cyl = 0; int kern_head = 0, kern_sectors = 0;
+ long long pt_cyl = 0; int pt_head = 0, pt_sectors = 0;
+ partition_table bufp;
+ char *buff, *buf_unaligned;
+
+ buf_unaligned = malloc(sizeof(partition_table) + 4095);
+ buff = (char *) (((unsigned long)buf_unaligned + 4096 - 1) &
+ (~(4096-1)));
+
+ get_kernel_geometry(fd, &kern_cyl, &kern_head, &kern_sectors);
+
+ if (my_lseek (fd, 0*SECTOR_SIZE, SEEK_SET) < 0) {
+ fprintf(stderr, "Unable to seek");
+ }
+
+ if (read(fd, buff, SECTOR_SIZE) == SECTOR_SIZE) {
+ memcpy(bufp.c.b, buff, SECTOR_SIZE);
+ get_partition_table_geometry(&bufp, &pt_cyl, &pt_head, &pt_sectors);
+ } else {
+ fprintf(stderr, "Unable to read partition table: %s\n", strerror(errno));
+ }
+
+ if (pt_head && pt_sectors) {
+ int cyl_size;
+
+ geom->heads = pt_head;
+ geom->sectors = pt_sectors;
+ cyl_size = pt_head * pt_sectors;
+ geom->cylinders = geom->total_sectors/cyl_size;
+ } else {
+ geom->heads = kern_head;
+ geom->sectors = kern_sectors;
+ geom->cylinders = kern_cyl;
+ }
+
+ return;
+}
+#endif
+
/* Get the geometry of a drive DRIVE. */
void
get_drive_geometry (struct geometry *geom, char **map, int drive)
@@ -151,21 +297,16 @@
#if defined(__linux__)
/* Linux */
{
- struct hd_geometry hdg;
unsigned long nr;
-
- if (ioctl (fd, HDIO_GETGEO, &hdg))
- goto fail;
if (ioctl (fd, BLKGETSIZE, &nr))
goto fail;
/* Got the geometry, so save it. */
- geom->cylinders = hdg.cylinders;
- geom->heads = hdg.heads;
- geom->sectors = hdg.sectors;
geom->total_sectors = nr;
-
+ get_linux_geometry(fd, geom);
+ if (!geom->heads && !geom->cylinders && !geom->sectors)
+ goto fail;
goto success;
}
@@ -844,6 +985,7 @@
{
char dev[PATH_MAX]; /* XXX */
int fd;
+ off_t offset = (off_t) sector * (off_t) SECTOR_SIZE;
if ((partition & 0x00FF00) != 0x00FF00)
{
@@ -870,35 +1012,13 @@
errnum = ERR_NO_PART;
return 0;
}
-
-#if defined(__linux__) && (!defined(__GLIBC__) || \
- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))))
- /* Maybe libc doesn't have large file support. */
- {
- loff_t offset, result;
- static int _llseek (uint filedes, ulong hi, ulong lo,
- loff_t *res, uint wh);
- _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo,
- loff_t *, res, uint, wh);
- offset = (loff_t) sector * (loff_t) SECTOR_SIZE;
- if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET))
- {
- errnum = ERR_DEV_VALUES;
- return 0;
- }
- }
-#else
- {
- off_t offset = (off_t) sector * (off_t) SECTOR_SIZE;
- if (lseek (fd, offset, SEEK_SET) != offset)
- {
- errnum = ERR_DEV_VALUES;
- return 0;
- }
- }
-#endif
+ if (my_lseek(fd, offset, SEEK_SET) != offset)
+ {
+ errnum = ERR_DEV_VALUES;
+ return 0;
+ }
if (write (fd, buf, size * SECTOR_SIZE) != (size * SECTOR_SIZE))
{
diff -Naur grub-0.97.orig/stage2/Makefile.am grub-0.97/stage2/Makefile.am
--- grub-0.97.orig/stage2/Makefile.am 2005-02-02 12:37:35.000000000 -0800
+++ grub-0.97/stage2/Makefile.am 2006-05-28 20:28:41.590818435 -0700
@@ -24,7 +24,8 @@
-DGRUB_UTIL=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 \
-DFSYS_ISO9660=1 -DFSYS_JFS=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 \
-DFSYS_UFS2=1 -DFSYS_VSTAFS=1 -DFSYS_XFS=1 \
- -DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1
+ -DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 \
+ -fno-strict-aliasing
# Stage 2 and Stage 1.5's.
pkglibdir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
diff -Naur grub-0.97.orig/stage2/boot.c grub-0.97/stage2/boot.c
--- grub-0.97.orig/stage2/boot.c 2004-03-30 03:44:08.000000000 -0800
+++ grub-0.97/stage2/boot.c 2006-05-28 20:33:30.123638792 -0700
@@ -55,7 +55,7 @@
pu;
/* presuming that MULTIBOOT_SEARCH is large enough to encompass an
executable header */
- unsigned char buffer[MULTIBOOT_SEARCH];
+ char buffer[MULTIBOOT_SEARCH];
/* sets the header pointer to point to the beginning of the
buffer by default */
@@ -98,7 +98,7 @@
/* ELF loading supported if multiboot, FreeBSD and NetBSD. */
if ((type == KERNEL_TYPE_MULTIBOOT
|| pu.elf->e_ident[EI_OSABI] == ELFOSABI_FREEBSD
- || grub_strcmp (pu.elf->e_ident + EI_BRAND, "FreeBSD") == 0
+ || grub_strcmp ((char *) pu.elf->e_ident + EI_BRAND, "FreeBSD") == 0
|| suggested_type == KERNEL_TYPE_NETBSD)
&& len > sizeof (Elf32_Ehdr)
&& BOOTABLE_I386_ELF ((*((Elf32_Ehdr *) buffer))))
@@ -824,8 +824,12 @@
moveto = (mbi.mem_upper + 0x400) << 10;
moveto = (moveto - len) & 0xfffff000;
+#if 0
max_addr = (lh->header == LINUX_MAGIC_SIGNATURE && lh->version >= 0x0203
? lh->initrd_addr_max : LINUX_INITRD_MAX_ADDRESS);
+#else
+ max_addr = LINUX_INITRD_MAX_ADDRESS;
+#endif
if (moveto + len >= max_addr)
moveto = (max_addr - len) & 0xfffff000;
diff -Naur grub-0.97.orig/stage2/disk_io.c grub-0.97/stage2/disk_io.c
--- grub-0.97.orig/stage2/disk_io.c 2004-05-23 09:35:24.000000000 -0700
+++ grub-0.97/stage2/disk_io.c 2006-05-28 20:28:41.582818634 -0700
@@ -127,12 +127,19 @@
int filepos;
int filemax;
-static inline unsigned long
-log2 (unsigned long word)
+#define log2(n) ffz(~(n))
+
+/* include/asm-i386/bitops.h */
+/*
+ * ffz = Find First Zero in word. Undefined if no zero exists,
+ * so code should check against ~0UL first..
+ */
+static __inline__ unsigned long
+ffz (unsigned long word)
{
- asm volatile ("bsfl %1,%0"
- : "=r" (word)
- : "r" (word));
+ __asm__ ("bsfl %1,%0"
+: "=r" (word)
+: "r" (~word));
return word;
}
diff -Naur grub-0.97.orig/stage2/freebsd.h grub-0.97/stage2/freebsd.h
--- grub-0.97.orig/stage2/freebsd.h 2003-07-09 04:45:52.000000000 -0700
+++ grub-0.97/stage2/freebsd.h 2006-05-28 20:28:41.582818634 -0700
@@ -78,7 +78,7 @@
struct bootinfo
{
unsigned int bi_version;
- unsigned char *bi_kernelname;
+ char *bi_kernelname;
struct nfs_diskless *bi_nfs_diskless;
/* End of fields that are always present. */
#define bi_endcommon bi_n_bios_used
diff -Naur grub-0.97.orig/stage2/fsys_fat.c grub-0.97/stage2/fsys_fat.c
--- grub-0.97.orig/stage2/fsys_fat.c 2005-03-15 08:52:00.000000000 -0800
+++ grub-0.97/stage2/fsys_fat.c 2006-05-28 20:28:41.582818634 -0700
@@ -54,12 +54,19 @@
#define FAT_CACHE_SIZE 2048
+#define log2(n) ffz(~(n))
+
+/* include/asm-i386/bitops.h */
+/*
+ * ffz = Find First Zero in word. Undefined if no zero exists,
+ * so code should check against ~0UL first..
+ */
static __inline__ unsigned long
-log2 (unsigned long word)
+ffz (unsigned long word)
{
__asm__ ("bsfl %1,%0"
- : "=r" (word)
- : "r" (word));
+: "=r" (word)
+: "r" (~word));
return word;
}
diff -Naur grub-0.97.orig/stage2/fsys_iso9660.c grub-0.97/stage2/fsys_iso9660.c
--- grub-0.97.orig/stage2/fsys_iso9660.c 2004-05-11 05:11:19.000000000 -0700
+++ grub-0.97/stage2/fsys_iso9660.c 2006-05-28 20:28:41.582818634 -0700
@@ -55,13 +55,19 @@
#define RRCONT_BUF ((unsigned char *)(FSYS_BUF + 6144))
#define NAME_BUF ((unsigned char *)(FSYS_BUF + 8192))
+#define log2(n) ffz(~(n))
-static inline unsigned long
-log2 (unsigned long word)
+/* include/asm-i386/bitops.h */
+/*
+ * ffz = Find First Zero in word. Undefined if no zero exists,
+ * so code should check against ~0UL first..
+ */
+static __inline__ unsigned long
+ffz (unsigned long word)
{
- asm volatile ("bsfl %1,%0"
- : "=r" (word)
- : "r" (word));
+ __asm__ ("bsfl %1,%0"
+: "=r" (word)
+: "r" (~word));
return word;
}
@@ -120,7 +126,7 @@
break;
/* check ISO_VD_PRIMARY and ISO_STANDARD_ID */
if (PRIMDESC->type.l == ISO_VD_PRIMARY
- && !memcmp(PRIMDESC->id, ISO_STANDARD_ID, sizeof(PRIMDESC->id)))
+ && !memcmp((char *) PRIMDESC->id, ISO_STANDARD_ID, sizeof(PRIMDESC->id)))
{
ISO_SUPER->vol_sector = sector;
INODE->file_start = 0;
@@ -175,7 +181,7 @@
for (; idr->length.l > 0;
idr = (struct iso_directory_record *)((char *)idr + idr->length.l) )
{
- const char *name = idr->name;
+ const u_int8_t *name = idr->name;
unsigned int name_len = idr->name_len.l;
file_type = (idr->flags.l & 2) ? ISO_DIRECTORY : ISO_REGULAR;
@@ -198,7 +204,7 @@
rr_len = (idr->length.l - idr->name_len.l
- sizeof(struct iso_directory_record)
+ sizeof(idr->name));
- rr_ptr.ptr = ((unsigned char *)idr + idr->name_len.l
+ rr_ptr.ptr = ((char *)idr + idr->name_len.l
+ sizeof(struct iso_directory_record)
- sizeof(idr->name));
if (rr_ptr.i & 1)
@@ -331,9 +337,9 @@
memcpy(NAME_BUF, name, name_len);
name = NAME_BUF;
}
- rr_ptr.ptr = RRCONT_BUF + ce_ptr->u.ce.offset.l;
+ rr_ptr.ptr = (char *) RRCONT_BUF + ce_ptr->u.ce.offset.l;
rr_len = ce_ptr->u.ce.size.l;
- if (!iso9660_devread(ce_ptr->u.ce.extent.l, 0, ISO_SECTOR_SIZE, RRCONT_BUF))
+ if (!iso9660_devread(ce_ptr->u.ce.extent.l, 0, ISO_SECTOR_SIZE, (char *) RRCONT_BUF))
{
errnum = 0; /* this is not fatal. */
break;
@@ -344,7 +350,7 @@
filemax = MAXINT;
if (name_len >= pathlen
- && !memcmp(name, dirname, pathlen))
+ && !memcmp((char *) name, dirname, pathlen))
{
if (dirname[pathlen] == '/' || !print_possibilities)
{
@@ -381,7 +387,7 @@
print_possibilities = -print_possibilities;
memcpy(NAME_BUF, name, name_len);
NAME_BUF[name_len] = '\0';
- print_a_completion (NAME_BUF);
+ print_a_completion ((char *) NAME_BUF);
#endif
}
}
diff -Naur grub-0.97.orig/stage2/fsys_reiserfs.c grub-0.97/stage2/fsys_reiserfs.c
--- grub-0.97.orig/stage2/fsys_reiserfs.c 2004-02-18 14:09:10.000000000 -0800
+++ grub-0.97/stage2/fsys_reiserfs.c 2006-05-28 20:28:41.586818535 -0700
@@ -365,13 +365,19 @@
#define JOURNAL_START ((__u32 *) (INFO + 1))
#define JOURNAL_END ((__u32 *) (FSYS_BUF + FSYS_BUFLEN))
+#define log2(n) ffz(~(n))
+/* include/asm-i386/bitops.h */
+/*
+ * ffz = Find First Zero in word. Undefined if no zero exists,
+ * so code should check against ~0UL first..
+ */
static __inline__ unsigned long
-log2 (unsigned long word)
+ffz (unsigned long word)
{
__asm__ ("bsfl %1,%0"
- : "=r" (word)
- : "r" (word));
+: "=r" (word)
+: "r" (~word));
return word;
}
diff -Naur grub-0.97.orig/stage2/fsys_vstafs.c grub-0.97/stage2/fsys_vstafs.c
--- grub-0.97.orig/stage2/fsys_vstafs.c 2003-07-09 04:45:53.000000000 -0700
+++ grub-0.97/stage2/fsys_vstafs.c 2006-05-28 20:28:41.586818535 -0700
@@ -186,35 +186,35 @@
int
vstafs_read (char *addr, int len)
{
- struct alloc *a;
+ struct alloc *b;
int size, ret = 0, offset, curr_len = 0;
- int curr_ext;
+ int curr_exten;
char extent;
int ext_size;
char *curr_pos;
get_file_info (f_sector);
size = FILE_INFO->len-VSTAFS_START_DATA;
- a = FILE_INFO->blocks;
+ b = FILE_INFO->blocks;
if (filepos > 0)
{
- if (filepos < a[0].a_len * 512 - VSTAFS_START_DATA)
+ if (filepos < b[0].a_len * 512 - VSTAFS_START_DATA)
{
offset = filepos + VSTAFS_START_DATA;
extent = 0;
- curr_len = a[0].a_len * 512 - offset - filepos;
+ curr_len = b[0].a_len * 512 - offset - filepos;
}
else
{
- ext_size = a[0].a_len * 512 - VSTAFS_START_DATA;
+ ext_size = b[0].a_len * 512 - VSTAFS_START_DATA;
offset = filepos - ext_size;
extent = 1;
do
{
curr_len -= ext_size;
offset -= ext_size;
- ext_size = a[extent+1].a_len * 512;
+ ext_size = b[extent+1].a_len * 512;
}
while (extent < FILE_INFO->extents && offset>ext_size);
}
@@ -223,16 +223,16 @@
{
offset = VSTAFS_START_DATA;
extent = 0;
- curr_len = a[0].a_len * 512 - offset;
+ curr_len = b[0].a_len * 512 - offset;
}
curr_pos = addr;
if (curr_len > len)
curr_len = len;
- for (curr_ext=extent;
- curr_ext < FILE_INFO->extents;
- curr_len = a[curr_ext].a_len * 512, curr_pos += curr_len, curr_ext++)
+ for (curr_exten = extent;
+ curr_exten < FILE_INFO->extents;
+ curr_len = b[curr_exten].a_len * 512, curr_pos += curr_len, curr_exten++)
{
ret += curr_len;
size -= curr_len;
@@ -242,7 +242,7 @@
curr_len += size;
}
- devread (a[curr_ext].a_start,offset, curr_len, curr_pos);
+ devread (b[curr_exten].a_start, offset, curr_len, curr_pos);
offset = 0;
}
diff -Naur grub-0.97.orig/stage2/fsys_xfs.c grub-0.97/stage2/fsys_xfs.c
--- grub-0.97.orig/stage2/fsys_xfs.c 2005-05-07 19:15:55.000000000 -0700
+++ grub-0.97/stage2/fsys_xfs.c 2006-05-28 20:28:41.586818535 -0700
@@ -97,7 +97,7 @@
return ino & XFS_INO_MASK(XFS_INO_OFFSET_BITS);
}
-static inline __const__ xfs_uint16_t
+static inline __attribute__((const)) xfs_uint16_t
le16 (xfs_uint16_t x)
{
__asm__("xchgb %b0,%h0" \
@@ -106,7 +106,7 @@
return x;
}
-static inline __const__ xfs_uint32_t
+static inline __attribute__((const)) xfs_uint32_t
le32 (xfs_uint32_t x)
{
#if 0
@@ -122,7 +122,7 @@
return x;
}
-static inline __const__ xfs_uint64_t
+static inline __attribute__((const)) xfs_uint64_t
le64 (xfs_uint64_t x)
{
xfs_uint32_t h = x >> 32;
@@ -368,7 +368,7 @@
default:
namelen = sfe->namelen;
*ino = sf_ino ((char *)sfe, namelen);
- name = sfe->name;
+ name = (char *) sfe->name;
sfe = (xfs_dir2_sf_entry_t *)
((char *)sfe + namelen + 11 - xfs.i8param);
}
diff -Naur grub-0.97.orig/stage2/gunzip.c grub-0.97/stage2/gunzip.c
--- grub-0.97.orig/stage2/gunzip.c 2003-07-09 04:45:53.000000000 -0700
+++ grub-0.97/stage2/gunzip.c 2006-05-28 20:28:41.586818535 -0700
@@ -277,7 +277,7 @@
* is a compressed file, and simply mark it as such.
*/
if (no_decompression
- || grub_read (buf, 10) != 10
+ || grub_read ((char *) buf, 10) != 10
|| ((*((unsigned short *) buf) != GZIP_HDR_LE)
&& (*((unsigned short *) buf) != OLD_GZIP_HDR_LE)))
{
@@ -293,7 +293,7 @@
if (buf[2] != DEFLATED
|| (buf[3] & UNSUPP_FLAGS)
|| ((buf[3] & EXTRA_FIELD)
- && (grub_read (buf, 2) != 2
+ && (grub_read ((char *) buf, 2) != 2
|| bad_field (*((unsigned short *) buf))))
|| ((buf[3] & ORIG_NAME) && bad_field (-1))
|| ((buf[3] & COMMENT) && bad_field (-1)))
@@ -308,7 +308,7 @@
filepos = filemax - 8;
- if (grub_read (buf, 8) != 8)
+ if (grub_read ((char *) buf, 8) != 8)
{
if (! errnum)
errnum = ERR_BAD_GZIP_HEADER;
@@ -485,8 +485,8 @@
#define INBUFSIZ 0x2000
-static uch inbuf[INBUFSIZ];
-static int bufloc;
+static unsigned char inbuf[INBUFSIZ];
+static int bufloc;
static int
get_byte (void)
@@ -494,7 +494,7 @@
if (filepos == gzip_data_offset || bufloc == INBUFSIZ)
{
bufloc = 0;
- grub_read (inbuf, INBUFSIZ);
+ grub_read ((char *) inbuf, INBUFSIZ);
}
return inbuf[bufloc++];
@@ -925,7 +925,7 @@
unsigned m; /* mask for bit lengths table */
unsigned n; /* number of lengths to get */
unsigned nb; /* number of bit length codes */
- unsigned nl; /* number of literal/length codes */
+ unsigned nc; /* number of literal/length codes */
unsigned nd; /* number of distance codes */
unsigned ll[286 + 30]; /* literal/length and distance code lengths */
register ulg b; /* bit buffer */
@@ -937,7 +937,7 @@
/* read in table lengths */
NEEDBITS (5);
- nl = 257 + ((unsigned) b & 0x1f); /* number of literal/length codes */
+ nc = 257 + ((unsigned) b & 0x1f); /* number of literal/length codes */
DUMPBITS (5);
NEEDBITS (5);
nd = 1 + ((unsigned) b & 0x1f); /* number of distance codes */
@@ -945,7 +945,7 @@
NEEDBITS (4);
nb = 4 + ((unsigned) b & 0xf); /* number of bit length codes */
DUMPBITS (4);
- if (nl > 286 || nd > 30)
+ if (nc > 286 || nd > 30)
{
errnum = ERR_BAD_GZIP_DATA;
return;
@@ -970,7 +970,7 @@
}
/* read in literal and distance code lengths */
- n = nl + nd;
+ n = nc + nd;
m = mask_bits[bl];
i = l = 0;
while ((unsigned) i < n)
@@ -1034,7 +1034,7 @@
/* build the decoding tables for literal/length and distance codes */
bl = lbits;
- if ((i = huft_build (ll, nl, 257, cplens, cplext, &tl, &bl)) != 0)
+ if ((i = huft_build (ll, nc, 257, cplens, cplext, &tl, &bl)) != 0)
{
#if 0
if (i == 1)
@@ -1045,7 +1045,7 @@
return;
}
bd = dbits;
- if ((i = huft_build (ll + nl, nd, 0, cpdist, cpdext, &td, &bd)) != 0)
+ if ((i = huft_build (ll + nc, nd, 0, cpdist, cpdext, &td, &bd)) != 0)
{
#if 0
if (i == 1)
diff -Naur grub-0.97.orig/stage2/md5.c grub-0.97/stage2/md5.c
--- grub-0.97.orig/stage2/md5.c 2003-07-09 04:45:53.000000000 -0700
+++ grub-0.97/stage2/md5.c 2006-05-28 20:28:41.590818435 -0700
@@ -166,7 +166,7 @@
inputlen -= 64 - buflen;
while (inputlen >= 64)
{
- md5_transform (input);
+ md5_transform ((unsigned char *) input);
input += 64;
inputlen -= 64;
}
@@ -211,7 +211,7 @@
char *p;
int saltlen;
int i, n;
- unsigned char alt_result[16];
+ char alt_result[16];
unsigned char *digest;
if (check)
diff -Naur grub-0.97.orig/stage2/start_eltorito.S grub-0.97/stage2/start_eltorito.S
--- grub-0.97.orig/stage2/start_eltorito.S 2004-03-27 08:14:20.000000000 -0800
+++ grub-0.97/stage2/start_eltorito.S 2006-05-28 20:31:17.770936712 -0700
@@ -40,9 +40,9 @@
#define ABS(x) (x-_start+BOOTSEC_LOCATION)
#ifdef STAGE1_5
-# define STAGE_ADDR 0x2000
+# define STAGE_ADDR 0x2200
#else
-# define STAGE_ADDR 0x8000
+# define STAGE_ADDR 0x8200
#endif /* STAGE1_5 */
/* Print message string */
@@ -71,12 +71,14 @@
. = _start + 8 /* Pad to file offset 8 */
/* This table gets filled in by mkisofs using the
- -boot-info-table option */
-bi_pvd: .long 0xDEADBEEF /* LBA of primary volume descript */
-bi_file: .long 0xDEADBEEF /* LBA of boot file */
-bi_length: .long 0xDEADBEEF /* Length of boot file */
-bi_csum: .long 0xDEADBEEF /* Checksum of boot file */
-bi_reserved: .space (10*4) /* Reserved */
+ -boot-info-table option If not, the values in this
+ table are default values that we can use to get us
+ what we need, at least under a certain set of assumptions. */
+bi_pvd: .long 16 /* LBA of primary volume descript */
+bi_file: .long 0 /* LBA of boot file */
+bi_length: .long 0xDEADBEEF /* Length of boot file */
+bi_csum: .long 0xDEADBEEF /* Checksum of boot file */
+bi_reserved: .space (10*4) /* Reserved */
real_start:
xor %ax, %ax
@@ -92,10 +94,28 @@
/* save drive reference first thing! */
mov %dl, ABS(BootDrive)
- /* print a notification message on the screen */
- MSG(notification_string)
+ /* check if machine support IBM/MS int 13h extensions */
+ mov $0x41, %ah
+ mov $0x55AA, %bx
+ int $0x13
+ jnc load_image
+
+ /* bios doesn't support int 13h extensions, print error messages */
+ MSG(int13_error_string1)
+ MSG(notification_done)
+ MSG(int13_error_string2)
+ MSG(notification_done)
+ MSG(int13_error_string3)
+ MSG(notification_done)
+ /* even when bios says that it doesn't support int 13h
+ extensions, do not stop here and try to load image anyway,
+ because some bioses says that there isn't support for
+ extended functions but have the needed extended read function
+ (int 13h, function AH=42h) */
load_image:
+ /* print a notification message on the screen */
+ MSG(notification_string)
/* Set up boot file sector, size, load address */
mov ABS(bi_length), %eax
add $(ISO_SECTOR_SIZE-1), %eax
@@ -105,6 +125,8 @@
mov %bx, %es
xor %bx, %bx
mov ABS(bi_file), %eax
+ inc %eax /* do not reload the first sector (this code) */
+ dec %bp /* this way we have more room for code in stage1 */
call getlinsec
mov %ds, %ax
mov %ax, %es
@@ -115,7 +137,7 @@
mov $ABS(firstlist - BOOTSEC_LISTSIZE), %si
mov (%si), %ebp
mov ABS(BootDrive), %dl /* this makes sure %dl is our "boot" drive */
- ljmp $0, $(STAGE_ADDR+SECTOR_SIZE) /* jump to main() in asm.S */
+ ljmp $0, $(STAGE_ADDR) /* jump to main() in asm.S */
/* go here when you need to stop the machine hard after an error condition */
stop: jmp stop
@@ -171,11 +193,11 @@
*/
xint13:
movb $6, ABS(RetryCount)
- pushal
.try:
+ pushal
int $0x13
jc 1f
- add $(8*4), %sp /* Clean up stack */
+ popal /* Clean up stack */
ret
1:
mov %ah, %dl /* Save error code */
@@ -276,6 +298,10 @@
read_error_string: .string "Read error 0x"
+int13_error_string1: .string "Support for IBM/MS INT 13h extensions not found"
+int13_error_string2: .string "GRUB cannot be loaded if int 13h/function AH=42h isn't present"
+int13_error_string3: .string "Trying to load stage 2 anyway..."
+
/*
* EBIOS disk address packet
*/
@@ -306,7 +332,8 @@
.word 0
.word 0
- . = _start + SECTOR_SIZE - BOOTSEC_LISTSIZE
+ /* size of the code we can place between main body and fixed top location */
+ . = _start + 1536 - BOOTSEC_LISTSIZE
/* fill the first data listing with the default */
blocklist_default_start:/* this is the sector start parameter, in logical
@@ -321,6 +348,12 @@
#endif
blocklist_default_seg: /* this is the segment of the starting address
to load the data into */
- .word (STAGE_ADDR + SECTOR_SIZE) >> 4
+ .word (STAGE_ADDR) >> 4
firstlist: /* this label has to be after the list data!!! */
+
+ /* this is a workaround to allow more code to be added in stage1,
+ it allows more code to be added for this stage, but for this
+ we can't reload the first sector. So we have to align the code
+ to ISO_SECTOR_SIZE. */
+ . = _start + ISO_SECTOR_SIZE
diff -Naur grub-0.97.orig/util/grub-install.in grub-0.97/util/grub-install.in
--- grub-0.97.orig/util/grub-install.in 2004-07-24 11:57:31.000000000 -0700
+++ grub-0.97/util/grub-install.in 2006-05-28 20:30:31.484088268 -0700
@@ -336,6 +336,10 @@
# Create a safe temporary file.
test -n "$mklog" && log_file=`$mklog`
+ # Before all invocations of the grub shell, call sync to make sure
+ # the raw device is in sync with any bufferring in filesystems.
+ sync
+
$grub_shell --batch $no_floppy --device-map=$device_map <<EOF >$log_file
quit
EOF
@@ -450,6 +454,10 @@
# Create a safe temporary file.
test -n "$mklog" && log_file=`$mklog`
+# Before all invocations of the grub shell, call sync to make sure
+# the raw device is in sync with any bufferring in filesystems.
+sync
+
# Now perform the installation.
$grub_shell --batch $no_floppy --device-map=$device_map <<EOF >$log_file
root $root_drive

View File

@@ -0,0 +1,37 @@
Submitted By: Matthew Burgess <matthew@linuxfromscratch.org>
Date: 2005-08-30
Initial Package Version: 1.4.2
Upstream Status: From upstream
Origin: Greg Schafer <gschafer@zip.com.au> (http://www.diy-linux.org/downloads/patches/GCC4/inetutils-1.4.2-gcc4-fixes-1.patch)
Description: Fix compilation issues with gcc4
diff -Naur inetutils-1.4.2.orig/ftp/ftp_var.h inetutils-1.4.2/ftp/ftp_var.h
--- inetutils-1.4.2.orig/ftp/ftp_var.h 2000-07-08 01:00:53.000000000 +0000
+++ inetutils-1.4.2/ftp/ftp_var.h 2005-08-30 20:25:27.205932304 +0000
@@ -36,8 +36,6 @@
#include <sys/param.h>
#include <setjmp.h>
-#include "extern.h"
-
#ifndef FTP_EXTERN
#define FTP_EXTERN extern
#endif
@@ -129,3 +127,5 @@
FTP_EXTERN int macnum; /* number of defined macros */
FTP_EXTERN struct macel macros[16];
FTP_EXTERN char macbuf[4096];
+
+#include "extern.h"
diff -Naur inetutils-1.4.2.orig/libinetutils/ttymsg.c inetutils-1.4.2/libinetutils/ttymsg.c
--- inetutils-1.4.2.orig/libinetutils/ttymsg.c 2001-11-01 15:52:19.000000000 +0000
+++ inetutils-1.4.2/libinetutils/ttymsg.c 2005-08-30 20:24:27.168059448 +0000
@@ -132,7 +132,7 @@
}
if (wret)
{
- (char *)iov->iov_base += wret;
+ iov->iov_base = (char *)iov->iov_base + wret;
iov->iov_len -= wret;
}
continue;

View File

@@ -0,0 +1,116 @@
Submitted By: Greg Schafer <gschafer at zip dot com dot au>
Date: 2003-12-11
Initial Package Version: 1.4.2
Origin: Greg Schafer
Description: Prevent installation of unwanted server man pages.
diff -Naur inetutils-1.4.2.orig/ftpd/Makefile.in inetutils-1.4.2/ftpd/Makefile.in
--- inetutils-1.4.2.orig/ftpd/Makefile.in 2002-12-23 04:30:12.000000000 +0000
+++ inetutils-1.4.2/ftpd/Makefile.in 2003-12-11 02:21:24.222010104 +0000
@@ -177,7 +177,6 @@
noinst_HEADERS = extern.h
-man_MANS = ftpd.8
INCLUDES = $(PATHDEF_FTPWELCOME) $(PATHDEF_FTPUSERS) \
$(PATHDEF_FTPLOGINMESG) $(PATHDEF_FTPCHROOT) $(PATHDEF_FTPDPID) \
diff -Naur inetutils-1.4.2.orig/inetd/Makefile.in inetutils-1.4.2/inetd/Makefile.in
--- inetutils-1.4.2.orig/inetd/Makefile.in 2002-12-23 04:30:13.000000000 +0000
+++ inetutils-1.4.2/inetd/Makefile.in 2003-12-11 02:21:24.223009952 +0000
@@ -172,7 +172,6 @@
inetd_SOURCES = inetd.c
-man_MANS = inetd.8
INCLUDES = $(PATHDEF_INETDCONF) $(PATHDEF_INETDDIR) -I$(top_builddir)/include
diff -Naur inetutils-1.4.2.orig/logger/Makefile.in inetutils-1.4.2/logger/Makefile.in
--- inetutils-1.4.2.orig/logger/Makefile.in 2002-12-23 04:30:16.000000000 +0000
+++ inetutils-1.4.2/logger/Makefile.in 2003-12-11 02:21:24.224009800 +0000
@@ -175,7 +175,6 @@
logger_SOURCES = logger.c
-man_MANS = logger.1
EXTRA_DIST = $(man_MANS)
subdir = logger
diff -Naur inetutils-1.4.2.orig/rexecd/Makefile.in inetutils-1.4.2/rexecd/Makefile.in
--- inetutils-1.4.2.orig/rexecd/Makefile.in 2002-12-23 04:30:17.000000000 +0000
+++ inetutils-1.4.2/rexecd/Makefile.in 2003-12-11 02:21:24.225009648 +0000
@@ -173,7 +173,6 @@
rexecd_SOURCES = rexecd.c
-man_MANS = rexecd.8
INCLUDES = $(PATHDEF_DEFPATH) $(PATHDEF_BSHELL) -I$(top_builddir)/include
diff -Naur inetutils-1.4.2.orig/rlogind/Makefile.in inetutils-1.4.2/rlogind/Makefile.in
--- inetutils-1.4.2.orig/rlogind/Makefile.in 2002-12-23 04:30:18.000000000 +0000
+++ inetutils-1.4.2/rlogind/Makefile.in 2003-12-11 02:21:24.225009648 +0000
@@ -173,7 +173,6 @@
rlogind_SOURCES = rlogind.c
-man_MANS = rlogind.8
INCLUDES = $(PATHDEF_DEV) $(PATHDEF_LOGIN) -I$(top_builddir)/include
diff -Naur inetutils-1.4.2.orig/rshd/Makefile.in inetutils-1.4.2/rshd/Makefile.in
--- inetutils-1.4.2.orig/rshd/Makefile.in 2002-12-23 04:30:19.000000000 +0000
+++ inetutils-1.4.2/rshd/Makefile.in 2003-12-11 02:21:24.226009496 +0000
@@ -172,7 +172,6 @@
rshd_SOURCES = rshd.c
-man_MANS = rshd.8
INCLUDES = $(PATHDEF_BSHELL) $(PATHDEF_NOLOGIN) $(PATHDEF_DEFPATH) -I$(top_builddir)/include
diff -Naur inetutils-1.4.2.orig/syslogd/Makefile.in inetutils-1.4.2/syslogd/Makefile.in
--- inetutils-1.4.2.orig/syslogd/Makefile.in 2002-12-23 04:30:19.000000000 +0000
+++ inetutils-1.4.2/syslogd/Makefile.in 2003-12-11 02:21:24.226009496 +0000
@@ -172,7 +172,6 @@
syslogd_SOURCES = syslogd.c
-man_MANS = syslog.conf.5 syslogd.8
INCLUDES = $(PATHDEF_LOG) $(PATHDEF_LOGCONF) $(PATHDEF_LOGPID) \
$(PATHDEF_CONSOLE) -I$(top_builddir)/include
diff -Naur inetutils-1.4.2.orig/talkd/Makefile.in inetutils-1.4.2/talkd/Makefile.in
--- inetutils-1.4.2.orig/talkd/Makefile.in 2002-12-23 04:30:20.000000000 +0000
+++ inetutils-1.4.2/talkd/Makefile.in 2003-12-11 02:21:24.227009344 +0000
@@ -180,7 +180,6 @@
intalkd.h
-man_MANS = talkd.8
INCLUDES = $(PATHDEF_DEV) -I${top_srcdir}/libinetutils -I$(top_builddir)/include
diff -Naur inetutils-1.4.2.orig/telnetd/Makefile.in inetutils-1.4.2/telnetd/Makefile.in
--- inetutils-1.4.2.orig/telnetd/Makefile.in 2002-12-23 04:30:21.000000000 +0000
+++ inetutils-1.4.2/telnetd/Makefile.in 2003-12-11 02:21:24.228009192 +0000
@@ -176,7 +176,6 @@
noinst_HEADERS = telnetd.h
-man_MANS = telnetd.8
INCLUDES = $(PATHDEF_DEV) $(PATHDEF_TTY) $(PATHDEF_LOGIN) -I$(top_builddir)/include \
-I$(top_srcdir) @INCAUTH@
diff -Naur inetutils-1.4.2.orig/tftpd/Makefile.in inetutils-1.4.2/tftpd/Makefile.in
--- inetutils-1.4.2.orig/tftpd/Makefile.in 2002-12-23 04:30:22.000000000 +0000
+++ inetutils-1.4.2/tftpd/Makefile.in 2003-12-11 02:21:24.229009040 +0000
@@ -174,7 +174,6 @@
tftpd_SOURCES = tftpd.c
-man_MANS = tftpd.8
LDADD = -L../libinetutils -linetutils

View File

@@ -0,0 +1,232 @@
Submitted By: Alexander E. Patrakov
Date: 2005-05-16
Initial Package Version: 1.12
Upstream Status: Not submitted, possibly incomplete
Description: Makes Backspace and Delete keys consistent in all i386 keymaps.
Obsoletes the /etc/kbd/bs-sends-del file for i386.
diff -urN kbd-1.12.orig/data/keymaps/i386/dvorak/dvorak-l.map kbd-1.12/data/keymaps/i386/dvorak/dvorak-l.map
--- kbd-1.12.orig/data/keymaps/i386/dvorak/dvorak-l.map 2002-10-11 17:08:51.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/dvorak/dvorak-l.map 2005-05-16 19:54:48.000000000 +0600
@@ -43,7 +43,7 @@
keycode 11 = three numbersign
keycode 12 = two at
keycode 13 = one exclam
- keycode 14 = BackSpace Delete
+ keycode 14 = Delete Delete
! --------------------------------------------------------------------------
! Row 3
! --------------------------------------------------------------------------
diff -urN kbd-1.12.orig/data/keymaps/i386/dvorak/dvorak-r.map kbd-1.12/data/keymaps/i386/dvorak/dvorak-r.map
--- kbd-1.12.orig/data/keymaps/i386/dvorak/dvorak-r.map 2002-10-11 17:08:51.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/dvorak/dvorak-r.map 2005-05-16 19:54:48.000000000 +0600
@@ -43,7 +43,7 @@
keycode 11 = slash question
keycode 12 = bracketleft braceleft
keycode 13 = bracketright braceright
- keycode 14 = BackSpace Delete
+ keycode 14 = Delete Delete
! --------------------------------------------------------------------------
! Row 3
! --------------------------------------------------------------------------
diff -urN kbd-1.12.orig/data/keymaps/i386/fgGIod/tr_f-latin5.map kbd-1.12/data/keymaps/i386/fgGIod/tr_f-latin5.map
--- kbd-1.12.orig/data/keymaps/i386/fgGIod/tr_f-latin5.map 2002-10-13 06:21:12.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/fgGIod/tr_f-latin5.map 2005-05-16 19:54:48.000000000 +0600
@@ -51,7 +51,7 @@
alt keycode 12 = Meta_minus
keycode 13 = minus underscore
alt keycode 13 = Meta_equal
-keycode 14 = BackSpace Delete
+keycode 14 = Delete Delete
alt keycode 14 = Meta_Delete
keycode 15 = Tab Tab
alt keycode 15 = Meta_Tab
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/lt.l4.map kbd-1.12/data/keymaps/i386/qwerty/lt.l4.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/lt.l4.map 2002-10-13 05:59:51.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/lt.l4.map 2005-05-16 19:54:48.000000000 +0600
@@ -205,7 +205,7 @@
# edit this if you want the key above <Enter> to delete symbols above
# cursor, not before.
keycode 14 = \
- BackSpace BackSpace BackSpace BackSpace \
+ Delete Delete Delete Delete \
Delete Delete Delete Delete \
Meta_BackSpace Meta_BackSpace Meta_BackSpace Meta_BackSpace \
Meta_Delete Meta_Delete Meta_Delete Meta_Delete
@@ -506,7 +506,7 @@
# Edit this if you want strict VT100 emulation.
string F111 = "\033[3$"
-keycode 111 = Delete F111 Delete F111 \
+keycode 111 = Remove F111 Remove F111 \
Remove Remove Remove Remove \
Meta_Delete Meta_Delete Meta_Delete Meta_Delete \
Boot Boot Boot Boot
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/lt.map kbd-1.12/data/keymaps/i386/qwerty/lt.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/lt.map 2002-10-13 06:00:25.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/lt.map 2005-05-16 19:54:48.000000000 +0600
@@ -204,7 +204,7 @@
# edit this if you want the key above <Enter> to delete symbols above
# cursor, not before.
keycode 14 = \
- BackSpace BackSpace BackSpace BackSpace \
+ Delete Delete Delete Delete \
Delete Delete Delete Delete \
Meta_BackSpace Meta_BackSpace Meta_BackSpace Meta_BackSpace \
Meta_Delete Meta_Delete Meta_Delete Meta_Delete
@@ -505,7 +505,7 @@
# Edit this if you want strict VT100 emulation.
string F111 = "\033[3$"
-keycode 111 = Delete F111 Delete F111 \
+keycode 111 = Remove F111 Remove F111 \
Remove Remove Remove Remove \
Meta_Delete Meta_Delete Meta_Delete Meta_Delete \
Boot Boot Boot Boot
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/no-latin1.map kbd-1.12/data/keymaps/i386/qwerty/no-latin1.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/no-latin1.map 2002-10-11 17:08:49.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/no-latin1.map 2005-05-16 19:54:48.000000000 +0600
@@ -3,7 +3,7 @@
# Send comments to Kjetil T. Homme <kjetilho@ifi.uio.no>
include "linux-with-alt-and-altgr"
plain keycode 83 = KP_Comma
- plain keycode 111 = Delete # "Remove" originally, weird...
+ plain keycode 111 = Remove
strings as usual
keycode 1 = Escape
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ru-ms.map kbd-1.12/data/keymaps/i386/qwerty/ru-ms.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/ru-ms.map 2002-10-13 06:07:05.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/ru-ms.map 2005-05-16 19:54:48.000000000 +0600
@@ -89,8 +89,8 @@
altgr alt keycode 13 = Meta_equal
shift alt keycode 13 = Meta_plus
altgr shift alt keycode 13 = Meta_plus
- keycode 14 = BackSpace BackSpace BackSpace BackSpace
-# keycode 14 = Delete Delete Delete Delete
+# keycode 14 = BackSpace BackSpace BackSpace BackSpace
+ keycode 14 = Delete Delete Delete Delete
alt keycode 14 = Meta_Delete
altgr alt keycode 14 = Meta_Delete
keycode 15 = Tab Tab Tab Tab
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ru.map kbd-1.12/data/keymaps/i386/qwerty/ru.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/ru.map 2002-10-13 06:02:19.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/ru.map 2005-05-16 19:56:08.000000000 +0600
@@ -37,7 +37,7 @@
alt keycode 12 = Meta_minus
keycode 13 = equal plus equal plus
alt keycode 13 = Meta_equal
- keycode 14 = BackSpace BackSpace BackSpace BackSpace
+ keycode 14 = Delete Delete Delete Delete
alt keycode 14 = Meta_Delete
keycode 15 = Tab Tab Tab Tab
alt keycode 15 = Meta_Tab
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ru1.map kbd-1.12/data/keymaps/i386/qwerty/ru1.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/ru1.map 2002-10-13 06:02:30.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/ru1.map 2005-05-16 19:55:32.000000000 +0600
@@ -143,8 +143,8 @@
# The keycode "0xFF" is too dangerous for many programs (including emacs).
# So let it be bracket instead of Hard Sign.
-# altgr keycode 27 = +0xDF
-# altgr shift keycode 27 = +0xFF
+altgr keycode 27 = +0xDF
+altgr shift keycode 27 = +0xFF
control keycode 27 = Control_bracketright
altgr control keycode 27 = Control_bracketright
alt keycode 27 = Meta_bracketright
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ru2.map kbd-1.12/data/keymaps/i386/qwerty/ru2.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/ru2.map 2002-10-13 06:05:47.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/ru2.map 2005-05-16 19:56:52.000000000 +0600
@@ -46,7 +46,7 @@
alt keycode 12 = Meta_minus
keycode 13 = equal plus equal plus
alt keycode 13 = Meta_equal
- keycode 14 = BackSpace BackSpace BackSpace BackSpace
+ keycode 14 = Delete Delete Delete Delete
alt keycode 14 = Meta_Delete
keycode 15 = Tab Tab Tab Tab
alt keycode 15 = Meta_Tab
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/se-ir209.map kbd-1.12/data/keymaps/i386/qwerty/se-ir209.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/se-ir209.map 2002-10-13 06:12:48.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/se-ir209.map 2005-05-16 19:54:48.000000000 +0600
@@ -345,7 +345,7 @@
keycode 109 = Next Scroll_Forward
keycode 110 = Insert
- keycode 111 = Delete # "Remove" originally, weird...
+ keycode 111 = Remove
control alt keycode 111 = Boot
control altgr keycode 111 = Boot
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/se-lat6.map kbd-1.12/data/keymaps/i386/qwerty/se-lat6.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/se-lat6.map 2002-10-13 06:13:01.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/se-lat6.map 2005-05-16 19:54:48.000000000 +0600
@@ -374,6 +374,6 @@
keycode 109 = Next Scroll_Forward
keycode 110 = Insert
- keycode 111 = Delete # "Remove" originally, weird...
+ keycode 111 = Remove
control alt keycode 111 = Boot
control altgr keycode 111 = Boot
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/tr_q-latin5.map kbd-1.12/data/keymaps/i386/qwerty/tr_q-latin5.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/tr_q-latin5.map 2002-10-11 17:08:49.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/tr_q-latin5.map 2005-05-16 19:54:48.000000000 +0600
@@ -49,7 +49,7 @@
alt keycode 12 = Meta_minus
keycode 13 = minus underscore
alt keycode 13 = Meta_equal
-keycode 14 = BackSpace Delete
+keycode 14 = Delete Delete
alt keycode 14 = Meta_Delete
keycode 15 = Tab Tab
alt keycode 15 = Meta_Tab
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ua-utf-ws.map kbd-1.12/data/keymaps/i386/qwerty/ua-utf-ws.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/ua-utf-ws.map 2002-10-13 06:07:56.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/ua-utf-ws.map 2005-05-16 19:54:48.000000000 +0600
@@ -260,7 +260,7 @@
shift ctrll ctrlr keycode 13 = plus
alt ctrll ctrlr keycode 13 = Meta_equal
shift alt ctrll ctrlr keycode 13 = Meta_plus
-keycode 14 = BackSpace Delete
+keycode 14 = Delete Delete
control keycode 14 = BackSpace
alt keycode 14 = Meta_Delete
ctrlr keycode 14 = BackSpace
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ua-utf.map kbd-1.12/data/keymaps/i386/qwerty/ua-utf.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/ua-utf.map 2002-10-13 06:08:07.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/ua-utf.map 2005-05-16 19:54:48.000000000 +0600
@@ -250,7 +250,7 @@
shift ctrll ctrlr keycode 13 = plus
alt ctrll ctrlr keycode 13 = Meta_equal
shift alt ctrll ctrlr keycode 13 = Meta_plus
-keycode 14 = BackSpace Delete
+keycode 14 = Delete Delete
control keycode 14 = BackSpace
alt keycode 14 = Meta_Delete
ctrlr keycode 14 = BackSpace
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ua-ws.map kbd-1.12/data/keymaps/i386/qwerty/ua-ws.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/ua-ws.map 2002-10-13 06:08:19.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/ua-ws.map 2005-05-16 19:54:48.000000000 +0600
@@ -260,7 +260,7 @@
shift ctrll ctrlr keycode 13 = plus
alt ctrll ctrlr keycode 13 = Meta_equal
shift alt ctrll ctrlr keycode 13 = Meta_plus
-keycode 14 = BackSpace Delete
+keycode 14 = Delete Delete
control keycode 14 = BackSpace
alt keycode 14 = Meta_Delete
ctrlr keycode 14 = BackSpace
diff -urN kbd-1.12.orig/data/keymaps/i386/qwerty/ua.map kbd-1.12/data/keymaps/i386/qwerty/ua.map
--- kbd-1.12.orig/data/keymaps/i386/qwerty/ua.map 2002-10-13 06:08:31.000000000 +0600
+++ kbd-1.12/data/keymaps/i386/qwerty/ua.map 2005-05-16 19:54:48.000000000 +0600
@@ -249,7 +249,7 @@
shift ctrll ctrlr keycode 13 = plus
alt ctrll ctrlr keycode 13 = Meta_equal
shift alt ctrll ctrlr keycode 13 = Meta_plus
-keycode 14 = BackSpace Delete
+keycode 14 = Delete Delete
control keycode 14 = BackSpace
alt keycode 14 = Meta_Delete
ctrlr keycode 14 = BackSpace

View File

@@ -0,0 +1,54 @@
Submitted By: Matthew Burgess <matthew@linuxfromscratch.org>
Date: 2005-07-28
Initial Package Version: 1.12
Upstream Status: Unknown
Origin: http://cvs.fedora.redhat.com/viewcvs/devel/kbd/kbd-1.12-alias.patch?rev=1.2&view=markup
Description: Fix violations of C aliasing rules, triggered by gcc4.
diff -Naur kbd-1.12.orig/src/psffontop.c kbd-1.12/src/psffontop.c
--- kbd-1.12.orig/src/psffontop.c 2004-01-16 19:45:31.000000000 +0000
+++ kbd-1.12/src/psffontop.c 2005-07-28 20:33:57.946088984 +0000
@@ -59,7 +59,6 @@
static unsigned int
assemble_ucs2(char **inptr, int cnt) {
- unsigned char **in = (unsigned char **) inptr;
unsigned int u1, u2;
if (cnt < 2) {
@@ -68,8 +67,8 @@
exit(EX_DATAERR);
}
- u1 = *(*in)++;
- u2 = *(*in)++;
+ u1 = (unsigned char)*(*inptr)++;
+ u2 = (unsigned char)*(*inptr)++;
return (u1 | (u2 << 8));
}
@@ -110,7 +109,6 @@
*/
static void
get_uni_entry(char **inptr, char **endptr, struct unicode_list *up, int utf8) {
- unsigned char **in = (unsigned char **) inptr;
unsigned char uc;
unicode unichar;
int inseq = 0;
@@ -126,14 +124,14 @@
exit(EX_DATAERR);
}
if (utf8) {
- uc = *(*in)++;
+ uc = *(*inptr)++;
if (uc == PSF2_SEPARATOR)
break;
if (uc == PSF2_STARTSEQ) {
inseq = 1;
continue;
}
- --(*in);
+ --(*inptr);
unichar = assemble_utf8(inptr, *endptr - *inptr);
} else {
unichar = assemble_ucs2(inptr, *endptr - *inptr);

View File

@@ -0,0 +1,115 @@
Submitted By: Dan Nicholson <dnicholson at linuxfromscratch dot org>
Date: 2006-08-01
Initial Package Version: 2.6.12.0
Origin: linux-2.6.16 series, syscalls diffed by Alexander Patrakov
Upstream Status: Project is dead
Description: Adds userspace headers and syscalls for inotify
Testcase: dovecot-1.0rc2, ./configure --with-notify=inotify
diff -pNur linux-libc-headers-2.6.12.0.orig/include/asm-i386/unistd.h linux-libc-headers-2.6.12.0/include/asm-i386/unistd.h
--- linux-libc-headers-2.6.12.0.orig/include/asm-i386/unistd.h 2005-07-06 00:17:47.000000000 +0000
+++ linux-libc-headers-2.6.12.0/include/asm-i386/unistd.h 2006-08-01 05:56:42.000000000 +0000
@@ -294,8 +294,13 @@
#define __NR_add_key 286
#define __NR_request_key 287
#define __NR_keyctl 288
+/* #define __NR_ioprio_set 289 */
+/* #define __NR_ioprio_get 290 */
+#define __NR_inotify_init 291
+#define __NR_inotify_add_watch 292
+#define __NR_inotify_rm_watch 293
-#define NR_syscalls 289
+#define NR_syscalls 294
/*
* user-visible error numbers are in the range -1 - -128: see
diff -pNur linux-libc-headers-2.6.12.0.orig/include/asm-ppc/unistd.h linux-libc-headers-2.6.12.0/include/asm-ppc/unistd.h
--- linux-libc-headers-2.6.12.0.orig/include/asm-ppc/unistd.h 2005-07-06 00:17:23.000000000 +0000
+++ linux-libc-headers-2.6.12.0/include/asm-ppc/unistd.h 2006-08-01 05:56:42.000000000 +0000
@@ -277,8 +277,13 @@
#define __NR_request_key 270
#define __NR_keyctl 271
#define __NR_waitid 272
+/* #define __NR_ioprio_set 273 */
+/* #define __NR_ioprio_get 274 */
+#define __NR_inotify_init 275
+#define __NR_inotify_add_watch 276
+#define __NR_inotify_rm_watch 277
-#define __NR_syscalls 273
+#define __NR_syscalls 278
#define __NR(n) #n
diff -pNur linux-libc-headers-2.6.12.0.orig/include/linux/inotify.h linux-libc-headers-2.6.12.0/include/linux/inotify.h
--- linux-libc-headers-2.6.12.0.orig/include/linux/inotify.h 1970-01-01 00:00:00.000000000 +0000
+++ linux-libc-headers-2.6.12.0/include/linux/inotify.h 2006-08-01 05:56:42.000000000 +0000
@@ -0,0 +1,67 @@
+/*
+ * Inode based directory notification for Linux
+ *
+ * Copyright (C) 2005 John McCutchan
+ */
+
+#ifndef _LINUX_INOTIFY_H
+#define _LINUX_INOTIFY_H
+
+#include <linux/types.h>
+
+/*
+ * struct inotify_event - structure read from the inotify device for each event
+ *
+ * When you are watching a directory, you will receive the filename for events
+ * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
+ */
+struct inotify_event {
+ __s32 wd; /* watch descriptor */
+ __u32 mask; /* watch mask */
+ __u32 cookie; /* cookie to synchronize two events */
+ __u32 len; /* length (including nulls) of name */
+ char name[0]; /* stub for possible name */
+};
+
+/* the following are legal, implemented events that user-space can watch for */
+#define IN_ACCESS 0x00000001 /* File was accessed */
+#define IN_MODIFY 0x00000002 /* File was modified */
+#define IN_ATTRIB 0x00000004 /* Metadata changed */
+#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
+#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
+#define IN_OPEN 0x00000020 /* File was opened */
+#define IN_MOVED_FROM 0x00000040 /* File was moved from X */
+#define IN_MOVED_TO 0x00000080 /* File was moved to Y */
+#define IN_CREATE 0x00000100 /* Subfile was created */
+#define IN_DELETE 0x00000200 /* Subfile was deleted */
+#define IN_DELETE_SELF 0x00000400 /* Self was deleted */
+#define IN_MOVE_SELF 0x00000800 /* Self was moved */
+
+/* the following are legal events. they are sent as needed to any watch */
+#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */
+#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
+#define IN_IGNORED 0x00008000 /* File was ignored */
+
+/* helper events */
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
+
+/* special flags */
+#define IN_ONLYDIR 0x01000000 /* only watch the path if it is a directory */
+#define IN_DONT_FOLLOW 0x02000000 /* don't follow a sym link */
+#define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */
+#define IN_ISDIR 0x40000000 /* event occurred against dir */
+#define IN_ONESHOT 0x80000000 /* only send event once */
+
+/*
+ * All of the events - we build the list by hand so that we can add flags in
+ * the future and not break backward compatibility. Apps will get only the
+ * events that they originally wanted. Be sure to add new events here!
+ */
+#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
+ IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
+ IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
+ IN_MOVE_SELF)
+
+
+#endif /* _LINUX_INOTIFY_H */

View File

@@ -0,0 +1,111 @@
Submitted By: Tushar Teredesai <tushar@linuxfromscratch.org>
Date: 2005-07-25
Initial Package Version: 1.5
Upstream Status: Sent, no response yet.
Origin: http://archive.linuxfromscratch.org/mail-archives/lfs-dev/2003-April/033602.html
http://archive.linuxfromscratch.org/mail-archives/lfs-dev/2003-June/035234.html
http://linuxfromscratch.org/pipermail/lfs-dev/2005-June/051908.html
Description: Add tempfile wrapper script. Use "make install-tempfile" to install it.
diff -Naur mktemp-1.5.orig/Makefile.in mktemp-1.5/Makefile.in
--- mktemp-1.5.orig/Makefile.in 2003-03-23 18:09:56.000000000 -0700
+++ mktemp-1.5/Makefile.in 2005-07-25 11:11:11.000000000 -0600
@@ -113,6 +113,9 @@
install-man:
$(INSTALL) -m 0444 $(srcdir)/$(PROG).$(mantype) $(mandir)/man1/$(PROG).1
+install-tempfile: $(srcdir)/tempfile
+ $(INSTALL) -m 0555 $(srcdir)/tempfile $(bindir)/tempfile
+
check:
@echo nothing to check
diff -Naur mktemp-1.5.orig/tempfile mktemp-1.5/tempfile
--- mktemp-1.5.orig/tempfile 1969-12-31 17:00:00.000000000 -0700
+++ mktemp-1.5/tempfile 2005-07-25 11:13:41.000000000 -0600
@@ -0,0 +1,85 @@
+#!/bin/bash
+# A tempfile wrapper for mktemp
+# Note: If you can, avoid using tempfile and use mktemp instead.
+# This wrapper is provided for compatibility since some scripts use
+# tempfile. If possible, the best solution is to patch the scripts
+# to use mktemp.
+#
+# Copyright (c) Tushar Teredesai <tush@yahoo.com>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+# Usage info
+usage()
+{
+ echo "Usage: tempfile [OPTION]"
+ echo
+ echo "Create a temporary file in a safe manner."
+ echo "This version is a wrapper that invokes mktemp."
+ echo "NOTE: Do not use tempfile in your scripts."
+ echo " Use mktemp instead."
+ echo
+ echo "[-d|--directory] DIR -> place temporary file in DIR"
+ echo "[-p|--prefix] PREFIX -> ignored"
+ echo "[-s|--suffix] SUFFIX -> ignored"
+ echo "[-n|--name] NAME -> ignored"
+ echo "[-m|--mode] MODE -> ignored"
+ echo "--version -> output version information and exit"
+}
+
+# parse all arguments
+while [ $# != 0 ]
+do
+ case "$1" in
+ # -d for tempfile is equivalent to -p for mktemp
+ -d|--directory)
+ dir="$2"
+ shift 2
+ ;;
+ --directory=*)
+ dir="${1#--directory=}"
+ shift 1
+ ;;
+ -d*)
+ dir="${1#-d}"
+ shift 1
+ ;;
+ # The following switches are ignored.
+ -p|--prefix|-s|--suffix|-n|--name|-m|--mode)
+ shift 2
+ ;;
+ -p*|--prefix=*|-s*|--suffix=*|-n*|--name=*|-m*|--mode=*)
+ shift 1
+ ;;
+ # --version for tempfile is equivalent to -V for mktemp
+ --version)
+ echo "tempfile 1.0 (`mktemp -V 2>/dev/null`)"
+ exit 0
+ ;;
+ # Unknown switch
+ *)
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+# Use the dir if $TMPDIR is not set.
+if [ -z "$TMPDIR" -a ! -z "$dir" ]
+then
+ export TMPDIR="$dir"
+fi
+# Execute mktemp with proper arguments
+# the -t behaviour of mktemp is the default for tempfile
+exec mktemp -t

View File

@@ -0,0 +1,41 @@
Submitted By: Bruce Dubbs (bdubbs at linuxfromscratch dot org)
Date: 2006-07-15
Initial Package Version: 3.2.2
Origin:
Upstream Status: This is fixed in 3.3-pre1
Description: Updates modprobe functionality to fix problem where
aliases don't quite work properly
--- module-init-tools-3.2.2/modprobe.c 2005-12-01 15:42:09.000000000 -0800
+++ module-init-tools-3.3-pre1/modprobe.c 2006-02-04 15:18:07.000000000 -0800
@@ -990,13 +990,27 @@
return ret;
}
+/* Careful! Don't munge - in [ ] as per Debian Bug#350915 */
static char *underscores(char *string)
{
if (string) {
unsigned int i;
- for (i = 0; string[i]; i++)
- if (string[i] == '-')
- string[i] = '_';
+ int inbracket = 0;
+ for (i = 0; string[i]; i++) {
+ switch (string[i]) {
+ case '[':
+ inbracket++;
+ break;
+ case ']':
+ inbracket--;
+ break;
+ case '-':
+ if (!inbracket)
+ string[i] = '_';
+ }
+ }
+ if (inbracket)
+ warn("Unmatched bracket in %s\n", string);
}
return string;
}

View File

@@ -0,0 +1,23 @@
Submitted By: Alexander E. Patrakov
Date: 2004-05-09
Initial Package Version: 1.4.1
Origin: Alexander E. Patrakov
Upstream status: not submitted yet, probably will not be accepted
Description: Weakens rules for determining whether a character is printable.
Now only bytes < 0x20 and the 0x7f byte are considered to be unprintable.
The original rules were valid for ISO-8859-* and KOI*.
Without this fix, logging meaningful Russian messages in UTF-8 is impossible.
diff -u sysklogd-1.4.1/syslogd.c sysklogd-1.4.1.fixed/syslogd.c
--- sysklogd-1.4.1/syslogd.c 2001-03-12 00:40:10.000000000 +0500
+++ sysklogd-1.4.1.fixed/syslogd.c 2004-05-09 09:05:42.972864104 +0600
@@ -1449,7 +1449,7 @@
else if (c < 040) {
*q++ = '^';
*q++ = c ^ 0100;
- } else if (c == 0177 || (c & 0177) < 040) {
+ } else if (c == 0177) {
*q++ = '\\';
*q++ = '0' + ((c & 0300) >> 6);
*q++ = '0' + ((c & 0070) >> 3);

View File

@@ -0,0 +1,833 @@
Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
Date: 2005-01-23
Initial Package Version: 1.4.1
Upstream Status: Not submitted
Origin: http://www.infodrom.org/projects/sysklogd/cvs.php3
Description: This patch is a cvs snapshot update as of 20050123.
Minus the debain and CVS directories. See the CHANGES.
diff -Naur sysklogd-1.4.1/CHANGES sysklogd-20050123/CHANGES
--- sysklogd-1.4.1/CHANGES 2001-03-11 14:35:51.000000000 -0500
+++ sysklogd-20050123/CHANGES 2005-01-15 14:14:21.000000000 -0500
@@ -1,3 +1,42 @@
+Version 1.4.2
+
+ . Dmitry V. Levin <ldv@altlinux.org>
+ - Close file descriptor in FindSymbolFile() in ksym.c in order not to
+ leak file descriptors.
+ . Solar Designer <solar@openwall.com>
+ - improve crunch_list()
+ - Prevent potential buffer overflow in reading messages from the
+ kernel log ringbuffer.
+ - Ensure that "len" is not placed in a register, and that the
+ endtty() signal handler is not installed too early which could
+ cause a segmentation fault or worse.
+ . Steve Grubb <linux_4ever@yahoo.com>
+ - fix memory calculation in crunch_list()
+ . Martin Schulze <joey@infodrom.org>
+ - klogd will reconnect to the logger (mostly syslogd) after it went
+ away
+ - On heavily loaded system syslog will not spit out error messages
+ anymore when recvfrom() results in EAGAIN
+ - Makefile improvements
+ - Local copy of module.h
+ - Improved sysklogd.8
+ - Always log with syslogd's timezone and locale
+ - Remove trailing newline when forwarding messages
+ . Jon Burgess <Jon_Burgess@eur.3com.com>
+ - Moved the installation of the signal handler up a little bit so it
+ guaranteed to be available when the child is forked, hence, fixing a
+ race condition. This used to create problems with UML and fast
+ machines.
+ . Greg Trounson <gregt@maths.otago.ac.nz>
+ - Improved README.linux
+ . Ulf H<>rnhammar <Ulf.Harnhammar.9485@student.uu.se>
+ - Bondary check for fscanf() in InitKsyms() and CheckMapVersion()
+ . Colin Phipps <cph@cph.demon.co.uk>
+ - Don't block on the network socket in case of package los
+ . Dirk Mueller <mueller@kde.org>
+ - Don't crash when filesize limit is reached (e.g. without LFS)
+
+
Version 1.4.1
. klogd will set the console log level only if `-c' is given on the
@@ -30,3 +69,9 @@
. Olaf Kirch <okir@caldera.de>
- Remove Unix Domain Sockets and switch to Datagram Unix Sockets
. Several bugfixes and improvements, please refer to the .c files
+
+
+Local variables:
+mode: indented-text
+fill-column: 72
+End:
diff -Naur sysklogd-1.4.1/klogd.8 sysklogd-20050123/klogd.8
--- sysklogd-1.4.1/klogd.8 2001-03-11 14:35:51.000000000 -0500
+++ sysklogd-20050123/klogd.8 2001-03-11 18:00:51.000000000 -0500
@@ -321,7 +321,7 @@
.B klogd
to reload the module symbol information whenever a protection fault
is detected. Caution should be used before invoking the program in
-\'paranoid\' mode. The stability of the kernel and the operating
+\&'paranoid\&' mode. The stability of the kernel and the operating
environment is always under question when a protection fault occurs.
Since the klogd daemon must execute system calls in order to read the
module symbol information there is the possibility that the system may
diff -Naur sysklogd-1.4.1/klogd.c sysklogd-20050123/klogd.c
--- sysklogd-1.4.1/klogd.c 2001-03-11 14:40:10.000000000 -0500
+++ sysklogd-20050123/klogd.c 2004-04-29 09:29:03.000000000 -0400
@@ -243,6 +243,9 @@
* people have submitted patches: Troels Walsted Hansen
* <troels@thule.no>, Wolfgang Oertl <Wolfgang.Oertl@uibk.ac.at>
* and Thomas Roessler.
+ * Thu Apr 29 15:24:07 2004: Solar Designer <solar@openwall.com>
+ * Prevent potential buffer overflow in reading messages from the
+ * kernel log rinbuffer.
*/
@@ -938,7 +941,7 @@
* messages into this fresh buffer.
*/
memset(log_buffer, '\0', sizeof(log_buffer));
- if ( (rdcnt = ksyslog(2, log_buffer, sizeof(log_buffer))) < 0 )
+ if ( (rdcnt = ksyslog(2, log_buffer, sizeof(log_buffer)-1)) < 0 )
{
if ( errno == EINTR )
return;
diff -Naur sysklogd-1.4.1/ksym.c sysklogd-20050123/ksym.c
--- sysklogd-1.4.1/ksym.c 2000-09-12 17:53:31.000000000 -0400
+++ sysklogd-20050123/ksym.c 2004-07-16 02:48:27.000000000 -0400
@@ -105,6 +105,15 @@
*
* Tue Sep 12 23:48:12 CEST 2000: Martin Schulze <joey@infodrom.ffis.de>
* Close symbol file in InitKsyms() when an error occurred.
+ *
+ * Thu Apr 29 18:07:16 CEST 2004: Dmitry Levin <ldv@altlinux.org>
+ * Close file descriptor in FindSymbolFile() in order not to leak
+ * file descriptors.
+ *
+ * Fri Jul 16 08:32:49 CEST 2004: Ulf H<>rnhammar <Ulf.Harnhammar.9485@student.uu.se>
+ * Added boundary check for fscanf() in InitKsyms() and
+ * CheckMapVersion() to prevent an unintended crash when reading
+ * an incorrect System.map.
*/
@@ -236,7 +245,7 @@
*/
while ( !feof(sym_file) )
{
- if ( fscanf(sym_file, "%lx %c %s\n", &address, &type, sym)
+ if ( fscanf(sym_file, "%lx %c %511s\n", &address, &type, sym)
!= 3 )
{
Syslog(LOG_ERR, "Error in symbol table input (#1).");
@@ -344,6 +353,7 @@
if ( (sym_file = fopen(symfile, "r")) != (FILE *) 0 ) {
if (CheckMapVersion(symfile) == 1)
file = symfile;
+ fclose (sym_file);
}
if (sym_file == (FILE *) 0 || file == (char *) 0) {
sprintf (symfile, "%s", *mf);
@@ -352,6 +362,7 @@
if ( (sym_file = fopen(symfile, "r")) != (FILE *) 0 ) {
if (CheckMapVersion(symfile) == 1)
file = symfile;
+ fclose (sym_file);
}
}
@@ -533,7 +544,7 @@
version = 0;
while ( !feof(sym_file) && (version == 0) )
{
- if ( fscanf(sym_file, "%lx %c %s\n", &address, \
+ if ( fscanf(sym_file, "%lx %c %511s\n", &address, \
&type, sym) != 3 )
{
Syslog(LOG_ERR, "Error in symbol table input (#2).");
@@ -899,3 +910,11 @@
return;
}
#endif
+
+/*
+ * Local variables:
+ * c-indent-level: 8
+ * c-basic-offset: 8
+ * tab-width: 8
+ * End:
+ */
diff -Naur sysklogd-1.4.1/ksym_mod.c sysklogd-20050123/ksym_mod.c
--- sysklogd-1.4.1/ksym_mod.c 2000-09-12 17:15:28.000000000 -0400
+++ sysklogd-20050123/ksym_mod.c 2004-03-31 10:47:08.000000000 -0500
@@ -78,6 +78,11 @@
*
* Tue Sep 12 23:11:13 CEST 2000: Martin Schulze <joey@infodrom.ffis.de>
* Changed llseek() to lseek64() in order to skip a libc warning.
+ *
+ * Wed Mar 31 17:35:01 CEST 2004: Martin Schulze <joey@infodrom.org>
+ * Removed references to <linux/module.h> since it doesn't work
+ * anymore with its recent content from Linux 2.4/2.6, created
+ * module.h locally instead.
*/
@@ -89,11 +94,12 @@
#include <errno.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
+#include "module.h"
#if !defined(__GLIBC__)
#include <linux/time.h>
-#include <linux/module.h>
+#include <linux/linkage.h>
#else /* __GLIBC__ */
-#include <linux/module.h>
+#include <linux/linkage.h>
extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
extern int get_kernel_syms __P ((struct kernel_sym *__table));
#endif /* __GLIBC__ */
@@ -107,7 +113,7 @@
#if !defined(__GLIBC__)
/*
- * The following bit uses some kernel/library magic to product what
+ * The following bit uses some kernel/library magic to produce what
* looks like a function call to user level code. This function is
* actually a system call in disguise. The purpose of the getsyms
* call is to return a current copy of the in-kernel symbol table.
diff -Naur sysklogd-1.4.1/Makefile sysklogd-20050123/Makefile
--- sysklogd-1.4.1/Makefile 1998-10-12 16:25:15.000000000 -0400
+++ sysklogd-20050123/Makefile 2004-04-29 07:04:03.000000000 -0400
@@ -4,12 +4,15 @@
#CFLAGS= -g -DSYSV -Wall
#LDFLAGS= -g
CFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
+# -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
LDFLAGS= -s
# Look where your install program is.
INSTALL = /usr/bin/install
-BINDIR = /usr/sbin
-MANDIR = /usr/man
+
+# Destination paths, set prefix=/opt if required
+BINDIR = $(prefix)/usr/sbin
+MANDIR = $(prefix)/usr/share/man
# There is one report that under an all ELF system there may be a need to
# explicilty link with libresolv.a. If linking syslogd fails you may wish
@@ -34,8 +37,9 @@
# The following define establishes ownership for the man pages.
# Avery tells me that there is a difference between Debian and
# Slackware. Rather than choose sides I am leaving it up to the user.
-MAN_OWNER = root
-# MAN_OWNER = man
+MAN_USER = root
+MAN_GROUP = root
+MAN_PERMS = 644
# The following define establishes the name of the pid file for the
# syslogd daemon. The library include file (paths.h) defines the
@@ -116,7 +120,7 @@
${INSTALL} -m 500 -s klogd ${BINDIR}/klogd
install_man:
- ${INSTALL} -o ${MAN_OWNER} -g ${MAN_OWNER} -m 644 sysklogd.8 ${MANDIR}/man8/sysklogd.8
- ${INSTALL} -o ${MAN_OWNER} -g ${MAN_OWNER} -m 644 syslogd.8 ${MANDIR}/man8/syslogd.8
- ${INSTALL} -o ${MAN_OWNER} -g ${MAN_OWNER} -m 644 syslog.conf.5 ${MANDIR}/man5/syslog.conf.5
- ${INSTALL} -o ${MAN_OWNER} -g ${MAN_OWNER} -m 644 klogd.8 ${MANDIR}/man8/klogd.8
+ ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} sysklogd.8 ${MANDIR}/man8/sysklogd.8
+ ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} syslogd.8 ${MANDIR}/man8/syslogd.8
+ ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} syslog.conf.5 ${MANDIR}/man5/syslog.conf.5
+ ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} klogd.8 ${MANDIR}/man8/klogd.8
diff -Naur sysklogd-1.4.1/module.h sysklogd-20050123/module.h
--- sysklogd-1.4.1/module.h 1969-12-31 19:00:00.000000000 -0500
+++ sysklogd-20050123/module.h 2004-07-27 07:36:10.000000000 -0400
@@ -0,0 +1,90 @@
+/*
+ module.h - Miscellaneous module definitions
+ Copyright (c) 1996 Richard Henderson <rth@tamu.edu>
+ Copyright (c) 2004 Martin Schulze <joey@infodrom.org>
+
+ This file is part of the sysklogd package.
+
+ 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 Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+/* ChangeLog:
+ *
+ * Wed Mar 31 17:35:01 CEST 2004: Martin Schulze <joey@infodrom.org>
+ * Created local copy of module.h based on the content of Linux
+ * 2.2 since <linux/module.h> doesn't work anymore with its
+ * recent content from Linux 2.4/2.6.
+ */
+
+#include <asm/atomic.h>
+
+#define MODULE_NAME_LEN 60
+
+struct kernel_sym
+{
+ unsigned long value;
+ char name[MODULE_NAME_LEN];
+};
+
+
+struct list_head {
+ struct list_head *next, *prev;
+};
+
+
+struct module_info
+{
+ unsigned long addr;
+ unsigned long size;
+ unsigned long flags;
+ long usecount;
+};
+
+
+struct module
+{
+ unsigned long size_of_struct; /* == sizeof(module) */
+ struct module *next;
+ const char *name;
+ unsigned long size;
+
+ union
+ {
+ int usecount;
+ long pad;
+ } uc; /* Needs to keep its size - so says rth */
+
+ unsigned long flags; /* AUTOCLEAN et al */
+
+ unsigned nsyms;
+ unsigned ndeps;
+
+ struct module_symbol *syms;
+ struct module_ref *deps;
+ struct module_ref *refs;
+ int (*init)(void);
+ void (*cleanup)(void);
+ const struct exception_table_entry *ex_table_start;
+ const struct exception_table_entry *ex_table_end;
+#ifdef __alpha__
+ unsigned long gp;
+#endif
+ /* Members past this point are extensions to the basic
+ module support and are optional. Use mod_opt_member()
+ to examine them. */
+ const struct module_persist *persist_start;
+ const struct module_persist *persist_end;
+ int (*can_unload)(void);
+};
diff -Naur sysklogd-1.4.1/pidfile.c sysklogd-20050123/pidfile.c
--- sysklogd-1.4.1/pidfile.c 1998-02-10 17:37:12.000000000 -0500
+++ sysklogd-20050123/pidfile.c 2003-09-27 22:38:18.000000000 -0400
@@ -87,7 +87,7 @@
int fd;
int pid;
- if ( ((fd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1)
+ if ( ((fd = open(pidfile, O_RDWR|O_CREAT|O_TRUNC, 0644)) == -1)
|| ((f = fdopen(fd, "r+")) == NULL) ) {
fprintf(stderr, "Can't open or create %s.\n", pidfile);
return 0;
diff -Naur sysklogd-1.4.1/README.1st sysklogd-20050123/README.1st
--- sysklogd-1.4.1/README.1st 1997-06-02 13:21:39.000000000 -0400
+++ sysklogd-20050123/README.1st 2003-09-04 09:22:23.000000000 -0400
@@ -1,5 +1,5 @@
-Very important information before using version 1.3
----------------------------------------------------
+Important information
+---------------------
The included version of syslogd behaves in a slightly different manner
to the one in former releases. Please review the following important
@@ -63,3 +63,10 @@
these scripts should remove all old .pid files found in /var/run.
This will insure that klogd and syslogd start properly even if prior
executions have been terminated harshly.
+
+* Large file support, i.e. support to write to log files that are
+ larger than 2 GB is not part of syslogd, but a matter of the Glibc
+ emitting different system calls to the kernel interface. To support
+ large files you'll have to compile syslogd with the compiler defines
+ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE so that glibc adjusts the
+ system calls.
diff -Naur sysklogd-1.4.1/README.linux sysklogd-20050123/README.linux
--- sysklogd-1.4.1/README.linux 1999-01-18 19:09:12.000000000 -0500
+++ sysklogd-20050123/README.linux 2004-07-09 13:22:29.000000000 -0400
@@ -40,12 +40,17 @@
a useful addition to the software gene pool.
There is a mailing list covering this package and syslog in general.
-The lists address is sysklogd@Infodrom.North.DE . To subscribe send a
-mail to Majordomo@Infodrom.North.DE with a line "subscribe sysklogd"
+The lists address is infodrom-sysklogd@lists.infodrom.org . To subscribe send a
+mail to majordomo@lists.infodrom.org with a line "subscribe infodrom-sysklogd"
in the message body.
-New versions of this package will be available at Joey's ftp server.
-ftp://ftp.infodrom.north.de/pub/people/joey/sysklogd/
+A second mailing list exists as infodrom-sysklogd-cvs@lists.infodrom.org. Only
+CVS messages and diffs are distributed there. Whenever new code is added to
+sysklogd, CVS generates a mail from these changes which will be sent to
+this list. Discussions will take place on the first list.
+
+The latest version of this software can be found at:
+http://www.infodrom.org/projects/sysklogd/download.php3
Best regards,
@@ -67,6 +72,6 @@
Martin Schulze
Infodrom Oldenburg
-joey@linux.de
+joey@infodrom.org
-And a host of bug reporters whose contributions cannot be underestimated.
+And a number of bug reporters whose contributions cannot be underestimated.
diff -Naur sysklogd-1.4.1/sysklogd.8 sysklogd-20050123/sysklogd.8
--- sysklogd-1.4.1/sysklogd.8 2001-03-11 14:35:51.000000000 -0500
+++ sysklogd-20050123/sysklogd.8 2004-07-09 13:33:32.000000000 -0400
@@ -84,7 +84,7 @@
.B MAXFUNIX
within the syslogd.c source file. An example for a chroot() daemon is
described by the people from OpenBSD at
-http://www.psionic.com/papers/dns.html.
+<http://www.guides.sk/psionic/dns/>.
.TP
.B "\-d"
Turns on debug mode. Using this the daemon will not proceed a
@@ -117,7 +117,8 @@
between two \fI-- MARK --\fR lines is 20 minutes. This can be changed
with this option. Setting the
.I interval
-to zero turns it off entirely.
+to zero turns it off entirely. Depending on other log messages
+generated these lines may not be written consecutively.
.TP
.B "\-n"
Avoid auto-backgrounding. This is needed especially if the
@@ -364,8 +365,10 @@
To avoid this in further times no messages that were received from a
remote host are sent out to another (or the same) remote host
-anymore. If there are scenarios where this doesn't make sense, please
-drop me (Joey) a line.
+anymore. If you experience are setup in which this doesn't make
+sense, please use the
+.B \-h
+commandline switch.
If the remote host is located in the same domain as the host,
.B syslogd
diff -Naur sysklogd-1.4.1/syslog.c sysklogd-20050123/syslog.c
--- sysklogd-1.4.1/syslog.c 2001-03-11 14:35:51.000000000 -0500
+++ sysklogd-20050123/syslog.c 2003-08-27 11:56:01.000000000 -0400
@@ -47,6 +47,9 @@
* Sun Mar 11 20:23:44 CET 2001: Martin Schulze <joey@infodrom.ffis.de>
* Use SOCK_DGRAM for loggin, renables it to work.
*
+ * Wed Aug 27 17:48:16 CEST 2003: Martin Schulze <joey@Infodrom.org>
+ * Improved patch by Michael Pomraning <mjp@securepipe.com> to
+ * reconnect klogd to the logger after it went away.
*/
#include <sys/types.h>
@@ -98,6 +101,7 @@
register char *p;
time_t now;
int fd, saved_errno;
+ int result;
char tbuf[2048], fmt_cpy[1024], *stdp = (char *) 0;
saved_errno = errno;
@@ -167,7 +171,16 @@
}
/* output the message to the local logger */
- if (write(LogFile, tbuf, cnt + 1) >= 0 || !(LogStat&LOG_CONS))
+ result = write(LogFile, tbuf, cnt + 1);
+
+ if (result == -1
+ && (errno == ECONNRESET || errno == ENOTCONN || errno == ECONNREFUSED)) {
+ closelog();
+ openlog(LogTag, LogStat | LOG_NDELAY, LogFacility);
+ result = write(LogFile, tbuf, cnt + 1);
+ }
+
+ if (result >= 0 || !(LogStat&LOG_CONS))
return;
/*
diff -Naur sysklogd-1.4.1/syslog.conf.5 sysklogd-20050123/syslog.conf.5
--- sysklogd-1.4.1/syslog.conf.5 1999-08-21 06:49:14.000000000 -0400
+++ sysklogd-20050123/syslog.conf.5 2003-05-22 15:31:20.000000000 -0400
@@ -64,7 +64,7 @@
The
.I facility
is one of the following keywords:
-.BR auth ", " authpriv ", " cron ", " daemon ", " kern ", " lpr ", "
+.BR auth ", " authpriv ", " cron ", " daemon ", " ftp ", " kern ", " lpr ", "
.BR mail ", " mark ", " news ", " security " (same as " auth "), "
.BR syslog ", " user ", " uucp " and " local0 " through " local7 .
The keyword
@@ -121,12 +121,21 @@
This
.BR syslogd (8)
-has a syntax extension to the original BSD source, that makes its use
+has a syntax extension to the original BSD source, which makes its use
more intuitively. You may precede every priority with an equation sign
-(``='') to specify only this single priority and not any of the
-above. You may also (both is valid, too) precede the priority with an
-exclamation mark (``!'') to ignore all that priorities, either exact
-this one or this and any higher priority. If you use both extensions
+(``='') to specify that
+.B syslogd
+should only refer to this single priority and not this priority and
+all higher priorities.
+
+You may also precide the priority with an exclamation mark (``!'') if
+you want
+.B syslogd
+to ignore this priority and all higher priorities.
+You may even use both, the exclamation mark and the equation sign if
+you want
+.B syslogd
+to ignore only this single priority. If you use both extensions
than the exclamation mark must occur before the equation sign, just
use it intuitively.
@@ -300,7 +309,7 @@
.B syslogd
log all messages that come with either the
.BR info " or the " notice
-facility into the file
+priority into the file
.IR /var/log/messages ,
except for all messages that use the
.B mail
diff -Naur sysklogd-1.4.1/syslogd.c sysklogd-20050123/syslogd.c
--- sysklogd-1.4.1/syslogd.c 2001-03-11 14:40:10.000000000 -0500
+++ sysklogd-20050123/syslogd.c 2005-01-15 14:13:08.000000000 -0500
@@ -441,6 +441,39 @@
* Don't return a closed fd if `-a' is called with a wrong path.
* Thanks to Bill Nottingham <notting@redhat.com> for providing
* a patch.
+ * Thu Apr 13 05:08:10 CEST 2001: Jon Burgess <Jon_Burgess@eur.3com.com>
+ * Moved the installation of the signal handler up a little bit
+ * so it guaranteed to be available when the child is forked,
+ * hence, fixing a race condition. This used to create problems
+ * with UML and fast machines.
+ *
+ * Sat Apr 17 18:03:05 CEST 2004: Steve Grubb <linux_4ever@yahoo.com>
+ * Correct memory allocation for for commandline arguments in
+ * crunch_list().
+ *
+ * Thu Apr 29 12:38:39 CEST 2004: Solar Designer <solar@openwall.com>
+ * Applied Openwall paranoia patches to improve crunch_list().
+ *
+ * Tue May 4 16:47:30 CEST 2004: Solar Designer <solar@openwall.com>
+ * Ensure that "len" is not placed in a register, and that the
+ * endtty() signal handler is not installed too early which could
+ * cause a segmentation fault or worse.
+ *
+ * Tue May 4 16:52:01 CEST 2004: Solar Designer <solar@openwall.com>
+ * Adjust the size of a variable to prevent a buffer overflow
+ * should _PATH_DEV ever contain something different than "/dev/".
+ *
+ * Tue Nov 2 20:28:23 CET 2004: Colin Phipps <cph@cph.demon.co.uk>
+ * Don't block on the network socket, in case a packet gets lost
+ * between select and recv.
+ *
+ * Sun Nov 7 12:28:47 CET 2004: Martin Schulze <joey@infodrom.org>
+ * Discard any timestamp information found in received syslog
+ * messages. This will affect local messages sent from a
+ * different timezone.
+ *
+ * Sun Nov 7 13:47:00 CET 2004: Martin Schulze <joey@infodrom.org>
+ * Remove trailing newline when forwarding messages.
*/
@@ -890,11 +923,11 @@
dprintf("Checking pidfile.\n");
if (!check_pid(PidFile))
{
+ signal (SIGTERM, doexit);
if (fork()) {
/*
* Parent process
*/
- signal (SIGTERM, doexit);
sleep(300);
/*
* Not reached unless something major went wrong. 5
@@ -992,6 +1025,7 @@
(void) signal(SIGCHLD, reapchild);
(void) signal(SIGALRM, domark);
(void) signal(SIGUSR1, Debug ? debug_switch : SIG_IGN);
+ (void) signal(SIGXFSZ, SIG_IGN);
(void) alarm(TIMERINTVL);
/* Create a partial message table for all file descriptors. */
@@ -1141,13 +1175,13 @@
*/
printchopped(from, line, \
i + 2, finet);
- } else if (i < 0 && errno != EINTR) {
+ } else if (i < 0 && errno != EINTR && errno != EAGAIN) {
dprintf("INET socket error: %d = %s.\n", \
errno, strerror(errno));
logerror("recvfrom inet");
/* should be harmless now that we set
* BSDCOMPAT on the socket */
- sleep(10);
+ sleep(1);
}
}
#endif
@@ -1216,6 +1250,7 @@
{
int fd, on = 1;
struct sockaddr_in sin;
+ int sockflags;
fd = socket(AF_INET, SOCK_DGRAM, 0);
if (fd < 0) {
@@ -1241,6 +1276,24 @@
close(fd);
return -1;
}
+ /* We must not block on the network socket, in case a packet
+ * gets lost between select and recv, otherise the process
+ * will stall until the timeout, and other processes trying to
+ * log will also stall.
+ */
+ if ((sockflags = fcntl(fd, F_GETFL)) != -1) {
+ sockflags |= O_NONBLOCK;
+ /*
+ * SETFL could fail too, so get it caught by the subsequent
+ * error check.
+ */
+ sockflags = fcntl(fd, F_SETFL, sockflags);
+ }
+ if (sockflags == -1) {
+ logerror("fcntl(O_NONBLOCK), suspending inet");
+ close(fd);
+ return -1;
+ }
if (bind(fd, (struct sockaddr *) &sin, sizeof(sin)) < 0) {
logerror("bind, suspending inet");
close(fd);
@@ -1254,30 +1307,26 @@
crunch_list(list)
char *list;
{
- int count, i;
+ int i, m, n;
char *p, *q;
char **result = NULL;
p = list;
/* strip off trailing delimiters */
- while (p[strlen(p)-1] == LIST_DELIMITER) {
- count--;
+ while (*p && p[strlen(p)-1] == LIST_DELIMITER)
p[strlen(p)-1] = '\0';
- }
/* cut off leading delimiters */
- while (p[0] == LIST_DELIMITER) {
- count--;
+ while (p[0] == LIST_DELIMITER)
p++;
- }
- /* count delimiters to calculate elements */
- for (count=i=0; p[i]; i++)
- if (p[i] == LIST_DELIMITER) count++;
+ /* count delimiters to calculate the number of elements */
+ for (n = i = 0; p[i]; i++)
+ if (p[i] == LIST_DELIMITER) n++;
- if ((result = (char **)malloc(sizeof(char *) * count+2)) == NULL) {
+ if ((result = (char **)malloc(sizeof(char *) * (n + 2))) == NULL) {
printf ("Sorry, can't get enough memory, exiting.\n");
- exit(0);
+ exit(1);
}
/*
@@ -1285,30 +1334,28 @@
* characters are different from any delimiters,
* so we don't have to care about this.
*/
- count = 0;
- while ((q=strchr(p, LIST_DELIMITER))) {
- result[count] = (char *) malloc((q - p + 1) * sizeof(char));
- if (result[count] == NULL) {
+ m = 0;
+ while ((q = strchr(p, LIST_DELIMITER)) && m < n) {
+ result[m] = (char *) malloc((q - p + 1) * sizeof(char));
+ if (result[m] == NULL) {
printf ("Sorry, can't get enough memory, exiting.\n");
- exit(0);
+ exit(1);
}
- strncpy(result[count], p, q - p);
- result[count][q - p] = '\0';
+ memcpy(result[m], p, q - p);
+ result[m][q - p] = '\0';
p = q; p++;
- count++;
+ m++;
}
- if ((result[count] = \
- (char *)malloc(sizeof(char) * strlen(p) + 1)) == NULL) {
+ if ((result[m] = strdup(p)) == NULL) {
printf ("Sorry, can't get enough memory, exiting.\n");
- exit(0);
+ exit(1);
}
- strcpy(result[count],p);
- result[++count] = NULL;
+ result[++m] = NULL;
#if 0
- count=0;
- while (result[count])
- dprintf ("#%d: %s\n", count, StripDomains[count++]);
+ m = 0;
+ while (result[m])
+ dprintf ("#%d: %s\n", m, result[m++]);
#endif
return result;
}
@@ -1548,21 +1595,25 @@
/*
* Check to see if msg looks non-standard.
+ *
+ * A message looks like
+ * Nov 17 11:42:33 CRON[
+ * 01234567890123456
+ * ^ ^ ^ ^ ^
+ *
+ * Remote messages are not accompanied by a timestamp.
+ * Local messages are accompanied by a timestamp (program's timezone)
*/
msglen = strlen(msg);
- if (msglen < 16 || msg[3] != ' ' || msg[6] != ' ' ||
- msg[9] != ':' || msg[12] != ':' || msg[15] != ' ')
- flags |= ADDDATE;
-
- (void) time(&now);
- if (flags & ADDDATE)
- timestamp = ctime(&now) + 4;
- else {
- timestamp = msg;
+ if (!(msglen < 16 || msg[3] != ' ' || msg[6] != ' ' ||
+ msg[9] != ':' || msg[12] != ':' || msg[15] != ' ')) {
msg += 16;
msglen -= 16;
}
+ (void) time(&now);
+ timestamp = ctime(&now) + 4;
+
/* extract facility and priority level */
if (flags & MARK)
fac = LOG_NFACILITIES;
@@ -1771,7 +1822,7 @@
dprintf("Not sending message to remote.\n");
else {
f->f_time = now;
- (void) snprintf(line, sizeof(line), "<%d>%s\n", f->f_prevpri, \
+ (void) snprintf(line, sizeof(line), "<%d>%s", f->f_prevpri, \
(char *) iov[4].iov_base);
l = strlen(line);
if (l > MAXLINE)
@@ -1815,7 +1866,7 @@
v->iov_len = 1;
}
again:
- /* f->f_file == -1 is an indicator that the we couldn't
+ /* f->f_file == -1 is an indicator that we couldn't
open the file at startup. */
if (f->f_file == -1)
break;
@@ -1852,7 +1903,7 @@
errno = e;
logerror(f->f_un.f_fname);
}
- } else if (f->f_flags & SYNC_FILE)
+ } else if (f->f_type == F_FILE && (f->f_flags & SYNC_FILE))
(void) fsync(f->f_file);
break;
@@ -1891,7 +1942,7 @@
register struct filed *f;
struct iovec *iov;
{
- char p[6 + UNAMESZ];
+ char p[sizeof (_PATH_DEV) + UNAMESZ];
register int i;
int ttyf, len;
static int reenter = 0;
@@ -1899,6 +1950,8 @@
struct utmp *uptr;
char greetings[200];
+ (void) &len;
+
if (reenter++)
return;
@@ -1913,7 +1966,6 @@
if (fork() == 0) {
(void) signal(SIGTERM, SIG_DFL);
(void) alarm(0);
- (void) signal(SIGALRM, endtty);
#ifndef SYSV
(void) signal(SIGTTOU, SIG_IGN);
(void) sigsetmask(0);
@@ -1929,7 +1981,7 @@
/* is this slot used? */
if (ut.ut_name[0] == '\0')
continue;
- if (ut.ut_type == LOGIN_PROCESS)
+ if (ut.ut_type != USER_PROCESS)
continue;
if (!(strcmp (ut.ut_name,"LOGIN"))) /* paranoia */
continue;
@@ -1959,6 +2011,7 @@
iov[1].iov_len = 0;
}
if (setjmp(ttybuf) == 0) {
+ (void) signal(SIGALRM, endtty);
(void) alarm(15);
/* open the terminal */
ttyf = open(p, O_WRONLY|O_NOCTTY);