sync with new Cooker. Add our provides

This commit is contained in:
akdengi 2012-09-12 19:48:53 +04:00
parent 29f4f3b929
commit efe039908f
13 changed files with 913 additions and 668 deletions

View file

@ -1,2 +1,2 @@
sources: sources:
"coreutils-8.17.tar.xz": 34139edf28d72ff26626a221aba0d73d485a0ad9 "coreutils-8.19.tar.xz": b508dd4e21f5dccbdb846a27d9122598f1878a6a

View file

@ -1,17 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABCAAGBQJPq/5QAAoJEH/Z/MsAC+7uXVAP/2yhK+K5xsgfkjlVM+AtIA6f
rzW5tmOAcbJ1x0VqfcMUBSg4qB1/8Dp0s3Kofn8e4afcfIe6+oFFqbf04OT/jwPT
dGxWKnx7op3lI/IErgNAb4h0ejYKjRPbXwGspmGvygTlJzRRcLHSVLwlAYi674iq
hK1vloEQ2j9buYB/xWibdZd7hWjAnGzz7TIjcjhhV6mZLk0STZa6uDVCJxAvRHPC
+ZH4NIXExtD+OwkxbJ5KtokwAhZoAEoeGuxqLaZAuEuEtqPMC3NgJOJFQ+8OcSzI
1if3lQsrQisCAbjub5Z5/RwVNkhtaJI1WSmMUIIGfFX7k/egj1P/DNAwtS4jzZBY
I0pK8+FzEM2FxDwVMlo18lsNUMn6sgZ+p+2MUZg6ujM9cVkVuS+ht6gp0w2skg/g
nhvabLYgQJvhDBkKzOFaix1eKlJ9UxaX7ugv+0o+2i21uRrwZy2KgVlDi9DioT8v
3iJQK0zDdkC1ZgM5OIVrps56CLGi1HjAuBgk+ahJL26+Lbwf8Waa/sljbriIKxQi
sslHEdACkpTRThUiJyZOqKLsP+wuYsBPGsWPiIWofHtg2yJjVL541w1NMLgdwKex
w/cohCrHzvFocQs04zo6opdSVTuF0XcRU2fEBqvv/AuD8b8PwgmJqDCP3JdlutV0
CAvQQtTXnw0tHwI/1Aeo
=BFIo
-----END PGP SIGNATURE-----

View file

@ -1,5 +1,6 @@
--- coreutils-8.17/lib/linebuffer.h.i18n~ 2012-01-06 10:14:31.000000000 +0100 diff -urNp coreutils-8.19-orig/lib/linebuffer.h coreutils-8.19/lib/linebuffer.h
+++ coreutils-8.17/lib/linebuffer.h 2012-05-13 22:09:19.136905990 +0200 --- coreutils-8.19-orig/lib/linebuffer.h 2012-01-06 10:14:31.000000000 +0100
+++ coreutils-8.19/lib/linebuffer.h 2012-08-20 13:52:04.061593006 +0200
@@ -21,6 +21,11 @@ @@ -21,6 +21,11 @@
# include <stdio.h> # include <stdio.h>
@ -22,8 +23,9 @@
}; };
/* Initialize linebuffer LINEBUFFER for use. */ /* Initialize linebuffer LINEBUFFER for use. */
--- coreutils-8.17/src/cut.c.i18n~ 2012-05-02 10:31:47.000000000 +0200 diff -urNp coreutils-8.19-orig/src/cut.c coreutils-8.19/src/cut.c
+++ coreutils-8.17/src/cut.c 2012-05-13 22:09:19.142905989 +0200 --- coreutils-8.19-orig/src/cut.c 2012-07-21 16:54:31.000000000 +0200
+++ coreutils-8.19/src/cut.c 2012-08-20 13:52:52.299593173 +0200
@@ -28,6 +28,11 @@ @@ -28,6 +28,11 @@
#include <assert.h> #include <assert.h>
#include <getopt.h> #include <getopt.h>
@ -168,7 +170,7 @@
/* True if the --output-delimiter=STRING option was specified. */ /* True if the --output-delimiter=STRING option was specified. */
static bool output_delimiter_specified; static bool output_delimiter_specified;
@@ -206,7 +283,7 @@ Mandatory arguments to long options are @@ -206,7 +283,7 @@ Mandatory arguments to long options are
-f, --fields=LIST select only these fields; also print any line\n\ -f, --fields=LIST select only these fields; also print any line\n\
that contains no delimiter character, unless\n\ that contains no delimiter character, unless\n\
the -s option is specified\n\ the -s option is specified\n\
@ -201,7 +203,7 @@
/* 'm-n' or '-n' (1-n). */ /* 'm-n' or '-n' (1-n). */
if (value < initial) if (value < initial)
- FATAL_ERROR (_("invalid decreasing range")); - FATAL_ERROR (_("invalid decreasing range"));
+ FATAL_ERROR (_("invalid byte, character or fiend list")); + FATAL_ERROR (_("invalid byte, character or field list"));
/* Is there already a range going to end of line? */ /* Is there already a range going to end of line? */
if (eol_range_start != 0) if (eol_range_start != 0)
@ -374,7 +376,7 @@
+ break; + break;
+ } + }
+ +
+ if (wc == WEOF) + if (len <= 0 && wc == WEOF)
+ break; + break;
+ +
+ /* If the first field extends to the end of line (it is not + /* If the first field extends to the end of line (it is not
@ -631,8 +633,9 @@
} }
if (optind == argc) if (optind == argc)
--- coreutils-8.17/src/expand.c.i18n~ 2012-05-01 22:55:08.000000000 +0200 diff -urNp coreutils-8.19-orig/src/expand.c coreutils-8.19/src/expand.c
+++ coreutils-8.17/src/expand.c 2012-05-13 22:09:19.143905989 +0200 --- coreutils-8.19-orig/src/expand.c 2012-07-21 16:54:31.000000000 +0200
+++ coreutils-8.19/src/expand.c 2012-08-20 13:54:02.974621693 +0200
@@ -37,12 +37,29 @@ @@ -37,12 +37,29 @@
#include <stdio.h> #include <stdio.h>
#include <getopt.h> #include <getopt.h>
@ -730,7 +733,7 @@
+ if (convert) + if (convert)
+ { + {
+ ++column; + ++column;
+ if (convert_entire_line == 0) + if (convert_entire_line == 0 && !isblank(*bufpos))
+ convert = 0; + convert = 0;
+ } + }
+ putchar (*bufpos); + putchar (*bufpos);
@ -790,7 +793,7 @@
+ +
+ width = wcwidth (wc); + width = wcwidth (wc);
+ column += (width > 0) ? width : 0; + column += (width > 0) ? width : 0;
+ if (convert_entire_line == 0) + if (convert_entire_line == 0 && !iswblank(wc))
+ convert = 0; + convert = 0;
+ } + }
+ } + }
@ -820,8 +823,9 @@
if (have_read_stdin && fclose (stdin) != 0) if (have_read_stdin && fclose (stdin) != 0)
error (EXIT_FAILURE, errno, "-"); error (EXIT_FAILURE, errno, "-");
--- coreutils-8.17/src/fold.c.i18n~ 2012-04-29 13:45:30.000000000 +0200 diff -urNp coreutils-8.19-orig/src/fold.c coreutils-8.19/src/fold.c
+++ coreutils-8.17/src/fold.c 2012-05-13 22:09:19.148905989 +0200 --- coreutils-8.19-orig/src/fold.c 2012-07-21 16:54:31.000000000 +0200
+++ coreutils-8.19/src/fold.c 2012-08-20 13:52:04.066592980 +0200
@@ -22,12 +22,34 @@ @@ -22,12 +22,34 @@
#include <getopt.h> #include <getopt.h>
#include <sys/types.h> #include <sys/types.h>
@ -843,7 +847,7 @@
#include "xstrtol.h" #include "xstrtol.h"
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC +/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
+ installation; work around this configuration error. */ + installation; work around this configuration error. */
+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2 +#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
+# undef MB_LEN_MAX +# undef MB_LEN_MAX
+# define MB_LEN_MAX 16 +# define MB_LEN_MAX 16
@ -903,7 +907,7 @@
{"spaces", no_argument, NULL, 's'}, {"spaces", no_argument, NULL, 's'},
{"width", required_argument, NULL, 'w'}, {"width", required_argument, NULL, 'w'},
{GETOPT_HELP_OPTION_DECL}, {GETOPT_HELP_OPTION_DECL},
@@ -77,6 +120,7 @@ Mandatory arguments to long options are @@ -77,6 +120,7 @@ Mandatory arguments to long options are
"), stdout); "), stdout);
fputs (_("\ fputs (_("\
-b, --bytes count bytes rather than columns\n\ -b, --bytes count bytes rather than columns\n\
@ -911,7 +915,7 @@
-s, --spaces break at spaces\n\ -s, --spaces break at spaces\n\
-w, --width=WIDTH use WIDTH columns instead of 80\n\ -w, --width=WIDTH use WIDTH columns instead of 80\n\
"), stdout); "), stdout);
@@ -94,7 +138,7 @@ Mandatory arguments to long options are @@ -94,7 +138,7 @@ Mandatory arguments to long options are
static size_t static size_t
adjust_column (size_t column, char c) adjust_column (size_t column, char c)
{ {
@ -953,7 +957,7 @@
fadvise (istream, FADVISE_SEQUENTIAL); fadvise (istream, FADVISE_SEQUENTIAL);
@@ -170,6 +198,15 @@ fold_file (char const *filename, size_t @@ -170,6 +198,15 @@ fold_file (char const *filename, size_t
bool found_blank = false; bool found_blank = false;
size_t logical_end = offset_out; size_t logical_end = offset_out;
@ -969,16 +973,16 @@
/* Look for the last blank. */ /* Look for the last blank. */
while (logical_end) while (logical_end)
{ {
@@ -216,11 +253,221 @@ fold_file (char const *filename, size_t @@ -216,11 +253,221 @@ fold_file (char const *filename, size_t
line_out[offset_out++] = c; line_out[offset_out++] = c;
} }
- saved_errno = errno; - saved_errno = errno;
+ *saved_errno = errno; + *saved_errno = errno;
+
+ if (offset_out) if (offset_out)
+ fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
+
+} +}
+ +
+#if HAVE_MBRTOWC +#if HAVE_MBRTOWC
@ -1150,10 +1154,10 @@
+ } + }
+ +
+ *saved_errno = errno; + *saved_errno = errno;
+
if (offset_out) + if (offset_out)
fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); + fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
+
+} +}
+#endif +#endif
+ +
@ -1219,8 +1223,9 @@
break; break;
case 's': /* Break at word boundaries. */ case 's': /* Break at word boundaries. */
--- coreutils-8.17/src/join.c.i18n~ 2012-05-02 10:31:47.000000000 +0200 diff -urNp coreutils-8.19-orig/src/join.c coreutils-8.19/src/join.c
+++ coreutils-8.17/src/join.c 2012-05-13 22:09:19.149905989 +0200 --- coreutils-8.19-orig/src/join.c 2012-07-21 16:54:31.000000000 +0200
+++ coreutils-8.19/src/join.c 2012-08-20 13:52:04.069594876 +0200
@@ -22,18 +22,32 @@ @@ -22,18 +22,32 @@
#include <sys/types.h> #include <sys/types.h>
#include <getopt.h> #include <getopt.h>
@ -1696,8 +1701,9 @@
break; break;
case NOCHECK_ORDER_OPTION: case NOCHECK_ORDER_OPTION:
--- coreutils-8.17/src/pr.c.i18n~ 2012-05-10 09:14:30.000000000 +0200 diff -urNp coreutils-8.19-orig/src/pr.c coreutils-8.19/src/pr.c
+++ coreutils-8.17/src/pr.c 2012-05-13 22:10:45.477907910 +0200 --- coreutils-8.19-orig/src/pr.c 2012-07-21 16:54:31.000000000 +0200
+++ coreutils-8.19/src/pr.c 2012-08-20 13:52:04.074593445 +0200
@@ -312,6 +312,32 @@ @@ -312,6 +312,32 @@
#include <getopt.h> #include <getopt.h>
@ -1776,7 +1782,7 @@
static void pad_across_to (int position); static void pad_across_to (int position);
static void add_line_number (COLUMN *p); static void add_line_number (COLUMN *p);
static void getoptarg (char *arg, char switch_char, char *character, static void getoptarg (char *arg, char switch_char, char *character,
+ int *character_length, int *character_width, + int *character_length, int *character_width,
int *number); int *number);
static void print_files (int number_of_files, char **av); static void print_files (int number_of_files, char **av);
static void init_parameters (int number_of_files); static void init_parameters (int number_of_files);
@ -1975,7 +1981,19 @@
if (*arg) if (*arg)
{ {
long int tmp_long; long int tmp_long;
@@ -1248,7 +1374,7 @@ init_parameters (int number_of_files) @@ -1211,6 +1337,11 @@ static void
init_parameters (int number_of_files)
{
int chars_used_by_number = 0;
+ int mb_len = 1;
+#if HAVE_MBRTOWC
+ if (MB_CUR_MAX > 1)
+ mb_len = MB_LEN_MAX;
+#endif
lines_per_body = lines_per_page - lines_per_header - lines_per_footer;
if (lines_per_body <= 0)
@@ -1248,7 +1379,7 @@ init_parameters (int number_of_files)
else else
col_sep_string = column_separator; col_sep_string = column_separator;
@ -1984,7 +2002,7 @@
use_col_separator = true; use_col_separator = true;
} }
/* It's rather pointless to define a TAB separator with column /* It's rather pointless to define a TAB separator with column
@@ -1279,11 +1405,11 @@ init_parameters (int number_of_files) @@ -1279,11 +1410,11 @@ init_parameters (int number_of_files)
+ TAB_WIDTH (chars_per_input_tab, chars_per_number); */ + TAB_WIDTH (chars_per_input_tab, chars_per_number); */
/* Estimate chars_per_text without any margin and keep it constant. */ /* Estimate chars_per_text without any margin and keep it constant. */
@ -1998,7 +2016,7 @@
/* The number is part of the column width unless we are /* The number is part of the column width unless we are
printing files in parallel. */ printing files in parallel. */
@@ -1298,7 +1424,7 @@ init_parameters (int number_of_files) @@ -1298,7 +1429,7 @@ init_parameters (int number_of_files)
} }
chars_per_column = (chars_per_line - chars_used_by_number chars_per_column = (chars_per_line - chars_used_by_number
@ -2007,7 +2025,16 @@
if (chars_per_column < 1) if (chars_per_column < 1)
error (EXIT_FAILURE, 0, _("page width too narrow")); error (EXIT_FAILURE, 0, _("page width too narrow"));
@@ -1423,7 +1549,7 @@ init_funcs (void) @@ -1315,7 +1446,7 @@ init_parameters (int number_of_files)
We've to use 8 as the lower limit, if we use chars_per_default_tab = 8
to expand a tab which is not an input_tab-char. */
free (clump_buff);
- clump_buff = xmalloc (MAX (8, chars_per_input_tab));
+ clump_buff = xmalloc (mb_len * MAX (8, chars_per_input_tab));
}
/* Open the necessary files,
@@ -1423,7 +1554,7 @@ init_funcs (void)
/* Enlarge p->start_position of first column to use the same form of /* Enlarge p->start_position of first column to use the same form of
padding_not_printed with all columns. */ padding_not_printed with all columns. */
@ -2016,7 +2043,7 @@
/* This loop takes care of all but the rightmost column. */ /* This loop takes care of all but the rightmost column. */
@@ -1457,7 +1583,7 @@ init_funcs (void) @@ -1457,7 +1588,7 @@ init_funcs (void)
} }
else else
{ {
@ -2025,7 +2052,7 @@
h_next = h + chars_per_column; h_next = h + chars_per_column;
} }
} }
@@ -1748,9 +1874,9 @@ static void @@ -1748,9 +1879,9 @@ static void
align_column (COLUMN *p) align_column (COLUMN *p)
{ {
padding_not_printed = p->start_position; padding_not_printed = p->start_position;
@ -2037,7 +2064,7 @@
padding_not_printed = ANYWHERE; padding_not_printed = ANYWHERE;
} }
@@ -2021,13 +2147,13 @@ store_char (char c) @@ -2021,13 +2152,13 @@ store_char (char c)
/* May be too generous. */ /* May be too generous. */
buff = X2REALLOC (buff, &buff_allocated); buff = X2REALLOC (buff, &buff_allocated);
} }
@ -2053,7 +2080,7 @@
char *s; char *s;
int left_cut; int left_cut;
@@ -2050,22 +2176,24 @@ add_line_number (COLUMN *p) @@ -2050,22 +2181,24 @@ add_line_number (COLUMN *p)
/* Tabification is assumed for multiple columns, also for n-separators, /* Tabification is assumed for multiple columns, also for n-separators,
but 'default n-separator = TAB' hasn't been given priority over but 'default n-separator = TAB' hasn't been given priority over
equal column_width also specified by POSIX. */ equal column_width also specified by POSIX. */
@ -2082,7 +2109,7 @@
output_position = POS_AFTER_TAB (chars_per_output_tab, output_position = POS_AFTER_TAB (chars_per_output_tab,
output_position); output_position);
} }
@@ -2226,7 +2354,7 @@ print_white_space (void) @@ -2226,7 +2359,7 @@ print_white_space (void)
while (goal - h_old > 1 while (goal - h_old > 1
&& (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal) && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
{ {
@ -2091,7 +2118,7 @@
h_old = h_new; h_old = h_new;
} }
while (++h_old <= goal) while (++h_old <= goal)
@@ -2246,6 +2374,7 @@ print_sep_string (void) @@ -2246,6 +2379,7 @@ print_sep_string (void)
{ {
char *s; char *s;
int l = col_sep_length; int l = col_sep_length;
@ -2099,7 +2126,7 @@
s = col_sep_string; s = col_sep_string;
@@ -2259,6 +2388,7 @@ print_sep_string (void) @@ -2259,6 +2393,7 @@ print_sep_string (void)
{ {
for (; separators_not_printed > 0; --separators_not_printed) for (; separators_not_printed > 0; --separators_not_printed)
{ {
@ -2107,7 +2134,7 @@
while (l-- > 0) while (l-- > 0)
{ {
/* 3 types of sep_strings: spaces only, spaces and chars, /* 3 types of sep_strings: spaces only, spaces and chars,
@@ -2272,12 +2402,15 @@ print_sep_string (void) @@ -2272,12 +2407,15 @@ print_sep_string (void)
} }
else else
{ {
@ -2124,7 +2151,7 @@
/* sep_string ends with some spaces */ /* sep_string ends with some spaces */
if (spaces_not_printed > 0) if (spaces_not_printed > 0)
print_white_space (); print_white_space ();
@@ -2305,7 +2438,7 @@ print_clump (COLUMN *p, int n, char *clu @@ -2305,7 +2443,7 @@ print_clump (COLUMN *p, int n, char *clu
required number of tabs and spaces. */ required number of tabs and spaces. */
static void static void
@ -2133,7 +2160,7 @@
{ {
if (tabify_output) if (tabify_output)
{ {
@@ -2329,6 +2462,74 @@ print_char (char c) @@ -2329,6 +2467,74 @@ print_char (char c)
putchar (c); putchar (c);
} }
@ -2208,7 +2235,7 @@
/* Skip to page PAGE before printing. /* Skip to page PAGE before printing.
PAGE may be larger than total number of pages. */ PAGE may be larger than total number of pages. */
@@ -2508,9 +2709,9 @@ read_line (COLUMN *p) @@ -2508,9 +2714,9 @@ read_line (COLUMN *p)
align_empty_cols = false; align_empty_cols = false;
} }
@ -2220,7 +2247,7 @@
padding_not_printed = ANYWHERE; padding_not_printed = ANYWHERE;
} }
@@ -2611,9 +2812,9 @@ print_stored (COLUMN *p) @@ -2611,9 +2817,9 @@ print_stored (COLUMN *p)
} }
} }
@ -2232,7 +2259,7 @@
padding_not_printed = ANYWHERE; padding_not_printed = ANYWHERE;
} }
@@ -2626,8 +2827,8 @@ print_stored (COLUMN *p) @@ -2626,8 +2832,8 @@ print_stored (COLUMN *p)
if (spaces_not_printed == 0) if (spaces_not_printed == 0)
{ {
output_position = p->start_position + end_vector[line]; output_position = p->start_position + end_vector[line];
@ -2243,7 +2270,7 @@
} }
return true; return true;
@@ -2646,7 +2847,7 @@ print_stored (COLUMN *p) @@ -2646,7 +2852,7 @@ print_stored (COLUMN *p)
number of characters is 1.) */ number of characters is 1.) */
static int static int
@ -2252,7 +2279,7 @@
{ {
unsigned char uc = c; unsigned char uc = c;
char *s = clump_buff; char *s = clump_buff;
@@ -2656,10 +2857,10 @@ char_to_clump (char c) @@ -2656,10 +2862,10 @@ char_to_clump (char c)
int chars; int chars;
int chars_per_c = 8; int chars_per_c = 8;
@ -2265,7 +2292,7 @@
{ {
width = TAB_WIDTH (chars_per_c, input_position); width = TAB_WIDTH (chars_per_c, input_position);
@@ -2740,6 +2941,154 @@ char_to_clump (char c) @@ -2740,6 +2946,154 @@ char_to_clump (char c)
return chars; return chars;
} }
@ -2310,7 +2337,7 @@
+ width = +4; + width = +4;
+ chars = +4; + chars = +4;
+ *s++ = '\\'; + *s++ = '\\';
+ sprintf (esc_buff, "%03o", mbc[0]); + sprintf (esc_buff, "%03o", (unsigned char) mbc[0]);
+ for (i = 0; i <= 2; ++i) + for (i = 0; i <= 2; ++i)
+ *s++ = (int) esc_buff[i]; + *s++ = (int) esc_buff[i];
+ } + }
@ -2359,7 +2386,7 @@
+ width += 4; + width += 4;
+ chars += 4; + chars += 4;
+ *s++ = '\\'; + *s++ = '\\';
+ sprintf (esc_buff, "%03o", c); + sprintf (esc_buff, "%03o", (unsigned char) mbc[i]);
+ for (j = 0; j <= 2; ++j) + for (j = 0; j <= 2; ++j)
+ *s++ = (int) esc_buff[j]; + *s++ = (int) esc_buff[j];
+ } + }
@ -2380,7 +2407,7 @@
+ width += 4; + width += 4;
+ chars += 4; + chars += 4;
+ *s++ = '\\'; + *s++ = '\\';
+ sprintf (esc_buff, "%03o", c); + sprintf (esc_buff, "%03o", (unsigned char) mbc[i]);
+ for (j = 0; j <= 2; ++j) + for (j = 0; j <= 2; ++j)
+ *s++ = (int) esc_buff[j]; + *s++ = (int) esc_buff[j];
+ } + }
@ -2420,19 +2447,13 @@
/* We've just printed some files and need to clean up things before /* We've just printed some files and need to clean up things before
looking for more options and printing the next batch of files. looking for more options and printing the next batch of files.
--- coreutils-8.17/src/sort.c.i18n~ 2012-05-04 12:06:22.000000000 +0200 diff -urNp coreutils-8.19-orig/src/sort.c coreutils-8.19/src/sort.c
+++ coreutils-8.17/src/sort.c 2012-05-13 22:11:33.046909063 +0200 --- coreutils-8.19-orig/src/sort.c 2012-08-18 07:39:29.000000000 +0200
@@ -22,12 +22,21 @@ +++ coreutils-8.19/src/sort.c 2012-08-20 13:52:04.079596072 +0200
@@ -29,6 +29,14 @@
#include <config.h>
+#include <assert.h>
#include <getopt.h>
#include <pthread.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <signal.h> #include <signal.h>
#include <assert.h>
+#if HAVE_WCHAR_H +#if HAVE_WCHAR_H
+# include <wchar.h> +# include <wchar.h>
+#endif +#endif
@ -2444,7 +2465,7 @@
#include "system.h" #include "system.h"
#include "argmatch.h" #include "argmatch.h"
#include "error.h" #include "error.h"
@@ -165,12 +174,34 @@ static int thousands_sep; @@ -166,12 +174,34 @@ static int thousands_sep;
/* Nonzero if the corresponding locales are hard. */ /* Nonzero if the corresponding locales are hard. */
static bool hard_LC_COLLATE; static bool hard_LC_COLLATE;
@ -2480,7 +2501,7 @@
/* The kind of blanks for '-b' to skip in various options. */ /* The kind of blanks for '-b' to skip in various options. */
enum blanktype { bl_start, bl_end, bl_both }; enum blanktype { bl_start, bl_end, bl_both };
@@ -341,13 +372,11 @@ static bool reverse; @@ -345,13 +375,11 @@ static bool reverse;
they were read if all keys compare equal. */ they were read if all keys compare equal. */
static bool stable; static bool stable;
@ -2497,7 +2518,7 @@
/* Flag to remove consecutive duplicate lines from the output. /* Flag to remove consecutive duplicate lines from the output.
Only the last of a sequence of equal lines will be output. */ Only the last of a sequence of equal lines will be output. */
@@ -780,6 +809,46 @@ reap_all (void) @@ -784,6 +812,46 @@ reap_all (void)
reap (-1); reap (-1);
} }
@ -2544,7 +2565,7 @@
/* Clean up any remaining temporary files. */ /* Clean up any remaining temporary files. */
static void static void
@@ -1212,7 +1281,7 @@ zaptemp (char const *name) @@ -1224,7 +1292,7 @@ zaptemp (char const *name)
free (node); free (node);
} }
@ -2553,7 +2574,7 @@
static int static int
struct_month_cmp (void const *m1, void const *m2) struct_month_cmp (void const *m1, void const *m2)
@@ -1227,7 +1296,7 @@ struct_month_cmp (void const *m1, void c @@ -1239,7 +1307,7 @@ struct_month_cmp (void const *m1, void c
/* Initialize the character class tables. */ /* Initialize the character class tables. */
static void static void
@ -2562,7 +2583,7 @@
{ {
size_t i; size_t i;
@@ -1239,7 +1308,7 @@ inittables (void) @@ -1251,7 +1319,7 @@ inittables (void)
fold_toupper[i] = toupper (i); fold_toupper[i] = toupper (i);
} }
@ -2571,7 +2592,7 @@
/* If we're not in the "C" locale, read different names for months. */ /* If we're not in the "C" locale, read different names for months. */
if (hard_LC_TIME) if (hard_LC_TIME)
{ {
@@ -1321,6 +1390,84 @@ specify_nmerge (int oi, char c, char con @@ -1333,6 +1401,84 @@ specify_nmerge (int oi, char c, char con
xstrtol_fatal (e, oi, c, long_options, s); xstrtol_fatal (e, oi, c, long_options, s);
} }
@ -2656,7 +2677,7 @@
/* Specify the amount of main memory to use when sorting. */ /* Specify the amount of main memory to use when sorting. */
static void static void
specify_sort_size (int oi, char c, char const *s) specify_sort_size (int oi, char c, char const *s)
@@ -1549,7 +1696,7 @@ buffer_linelim (struct buffer const *buf @@ -1565,7 +1711,7 @@ buffer_linelim (struct buffer const *buf
by KEY in LINE. */ by KEY in LINE. */
static char * static char *
@ -2665,7 +2686,7 @@
{ {
char *ptr = line->text, *lim = ptr + line->length - 1; char *ptr = line->text, *lim = ptr + line->length - 1;
size_t sword = key->sword; size_t sword = key->sword;
@@ -1558,10 +1705,10 @@ begfield (struct line const *line, struc @@ -1574,10 +1720,10 @@ begfield (struct line const *line, struc
/* The leading field separator itself is included in a field when -t /* The leading field separator itself is included in a field when -t
is absent. */ is absent. */
@ -2678,7 +2699,7 @@
++ptr; ++ptr;
if (ptr < lim) if (ptr < lim)
++ptr; ++ptr;
@@ -1587,11 +1734,70 @@ begfield (struct line const *line, struc @@ -1603,11 +1749,70 @@ begfield (struct line const *line, struc
return ptr; return ptr;
} }
@ -2750,7 +2771,7 @@
{ {
char *ptr = line->text, *lim = ptr + line->length - 1; char *ptr = line->text, *lim = ptr + line->length - 1;
size_t eword = key->eword, echar = key->echar; size_t eword = key->eword, echar = key->echar;
@@ -1606,10 +1812,10 @@ limfield (struct line const *line, struc @@ -1622,10 +1827,10 @@ limfield (struct line const *line, struc
'beginning' is the first character following the delimiting TAB. 'beginning' is the first character following the delimiting TAB.
Otherwise, leave PTR pointing at the first 'blank' character after Otherwise, leave PTR pointing at the first 'blank' character after
the preceding field. */ the preceding field. */
@ -2763,7 +2784,7 @@
++ptr; ++ptr;
if (ptr < lim && (eword || echar)) if (ptr < lim && (eword || echar))
++ptr; ++ptr;
@@ -1655,10 +1861,10 @@ limfield (struct line const *line, struc @@ -1671,10 +1876,10 @@ limfield (struct line const *line, struc
*/ */
/* Make LIM point to the end of (one byte past) the current field. */ /* Make LIM point to the end of (one byte past) the current field. */
@ -2776,7 +2797,7 @@
if (newlim) if (newlim)
lim = newlim; lim = newlim;
} }
@@ -1689,6 +1895,130 @@ limfield (struct line const *line, struc @@ -1705,6 +1910,130 @@ limfield (struct line const *line, struc
return ptr; return ptr;
} }
@ -2907,7 +2928,7 @@
/* Fill BUF reading from FP, moving buf->left bytes from the end /* Fill BUF reading from FP, moving buf->left bytes from the end
of buf->buf to the beginning first. If EOF is reached and the of buf->buf to the beginning first. If EOF is reached and the
file wasn't terminated by a newline, supply one. Set up BUF's line file wasn't terminated by a newline, supply one. Set up BUF's line
@@ -1775,8 +2105,22 @@ fillbuf (struct buffer *buf, FILE *fp, c @@ -1791,8 +2120,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
else else
{ {
if (key->skipsblanks) if (key->skipsblanks)
@ -2932,7 +2953,7 @@
line->keybeg = line_start; line->keybeg = line_start;
} }
} }
@@ -1897,7 +2241,7 @@ human_numcompare (char const *a, char co @@ -1913,7 +2256,7 @@ human_numcompare (char const *a, char co
hideously fast. */ hideously fast. */
static int static int
@ -2941,8 +2962,8 @@
{ {
while (blanks[to_uchar (*a)]) while (blanks[to_uchar (*a)])
a++; a++;
@@ -1925,6 +2269,25 @@ nan_compare (char const *sa, char const @@ -1923,6 +2266,25 @@ numcompare (char const *a, char const *b
return memcmp (&a, &b, sizeof a); return strnumcmp (a, b, decimal_point, thousands_sep);
} }
+#if HAVE_MBRTOWC +#if HAVE_MBRTOWC
@ -2964,10 +2985,10 @@
+} +}
+#endif /* HAV_EMBRTOWC */ +#endif /* HAV_EMBRTOWC */
+ +
static int /* Work around a problem whereby the long double value returned by glibc's
general_numcompare (char const *sa, char const *sb) strtold ("NaN", ...) contains uninitialized bits: clear all bytes of
{ A and B before calling strtold. FIXME: remove this function once
@@ -1957,7 +2320,7 @@ general_numcompare (char const *sa, char @@ -1973,7 +2335,7 @@ general_numcompare (char const *sa, char
Return 0 if the name in S is not recognized. */ Return 0 if the name in S is not recognized. */
static int static int
@ -2976,7 +2997,7 @@
{ {
size_t lo = 0; size_t lo = 0;
size_t hi = MONTHS_PER_YEAR; size_t hi = MONTHS_PER_YEAR;
@@ -2232,15 +2595,14 @@ debug_key (struct line const *line, stru @@ -2248,15 +2610,14 @@ debug_key (struct line const *line, stru
char saved = *lim; char saved = *lim;
*lim = '\0'; *lim = '\0';
@ -2994,7 +3015,7 @@
else if (key->general_numeric) else if (key->general_numeric)
ignore_value (strtold (beg, &tighter_lim)); ignore_value (strtold (beg, &tighter_lim));
else if (key->numeric || key->human_numeric) else if (key->numeric || key->human_numeric)
@@ -2384,7 +2746,7 @@ key_warnings (struct keyfield const *gke @@ -2400,7 +2761,7 @@ key_warnings (struct keyfield const *gke
bool maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key) bool maybe_space_aligned = !hard_LC_COLLATE && default_key_compare (key)
&& !(key->schar || key->echar); && !(key->schar || key->echar);
bool line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */ bool line_offset = key->eword == 0 && key->echar != 0; /* -k1.x,1.y */
@ -3003,7 +3024,7 @@
&& ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned)) && ((!key->skipsblanks && !(implicit_skip || maybe_space_aligned))
|| (!key->skipsblanks && key->schar) || (!key->skipsblanks && key->schar)
|| (!key->skipeblanks && key->echar))) || (!key->skipeblanks && key->echar)))
@@ -2442,11 +2804,83 @@ key_warnings (struct keyfield const *gke @@ -2458,11 +2819,83 @@ key_warnings (struct keyfield const *gke
error (0, 0, _("option '-r' only applies to last-resort comparison")); error (0, 0, _("option '-r' only applies to last-resort comparison"));
} }
@ -3069,12 +3090,12 @@
+ } + }
+ while (hi - lo > 1); + while (hi - lo > 1);
+ +
+ if (ea)
+ *ea = (char *) month;
+
+ result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name)) + result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name))
+ ? monthtab[lo].val : 0); + ? monthtab[lo].val : 0);
+ +
+ if (ea && result)
+ *ea = s + strlen (monthtab[lo].name);
+
+ return result; + return result;
+} +}
+#endif +#endif
@ -3084,11 +3105,11 @@
static int static int
-keycompare (struct line const *a, struct line const *b) -keycompare (struct line const *a, struct line const *b)
+keycompare_uni (struct line const *a, struct line const *b) +keycompare_uni (const struct line *a, const struct line *b)
{ {
struct keyfield *key = keylist; struct keyfield *key = keylist;
@@ -2531,7 +2965,7 @@ keycompare (struct line const *a, struct @@ -2547,7 +2980,7 @@ keycompare (struct line const *a, struct
else if (key->human_numeric) else if (key->human_numeric)
diff = human_numcompare (ta, tb); diff = human_numcompare (ta, tb);
else if (key->month) else if (key->month)
@ -3097,7 +3118,7 @@
else if (key->random) else if (key->random)
diff = compare_random (ta, tlena, tb, tlenb); diff = compare_random (ta, tlena, tb, tlenb);
else if (key->version) else if (key->version)
@@ -2647,6 +3081,180 @@ keycompare (struct line const *a, struct @@ -2663,6 +3096,180 @@ keycompare (struct line const *a, struct
return key->reverse ? -diff : diff; return key->reverse ? -diff : diff;
} }
@ -3278,7 +3299,7 @@
/* Compare two lines A and B, returning negative, zero, or positive /* Compare two lines A and B, returning negative, zero, or positive
depending on whether A compares less than, equal to, or greater than B. */ depending on whether A compares less than, equal to, or greater than B. */
@@ -4107,7 +4715,7 @@ main (int argc, char **argv) @@ -4158,7 +4765,7 @@ main (int argc, char **argv)
initialize_exit_failure (SORT_FAILURE); initialize_exit_failure (SORT_FAILURE);
hard_LC_COLLATE = hard_locale (LC_COLLATE); hard_LC_COLLATE = hard_locale (LC_COLLATE);
@ -3287,7 +3308,7 @@
hard_LC_TIME = hard_locale (LC_TIME); hard_LC_TIME = hard_locale (LC_TIME);
#endif #endif
@@ -4128,6 +4736,29 @@ main (int argc, char **argv) @@ -4179,6 +4786,29 @@ main (int argc, char **argv)
thousands_sep = -1; thousands_sep = -1;
} }
@ -3317,7 +3338,7 @@
have_read_stdin = false; have_read_stdin = false;
inittables (); inittables ();
@@ -4398,13 +5029,34 @@ main (int argc, char **argv) @@ -4453,13 +5083,34 @@ main (int argc, char **argv)
case 't': case 't':
{ {
@ -3325,7 +3346,7 @@
- if (! newtab) - if (! newtab)
+ char newtab[MB_LEN_MAX + 1]; + char newtab[MB_LEN_MAX + 1];
+ size_t newtab_length = 1; + size_t newtab_length = 1;
+ strncpy(newtab, optarg, MB_LEN_MAX); + strncpy (newtab, optarg, MB_LEN_MAX);
+ if (! newtab[0]) + if (! newtab[0])
error (SORT_FAILURE, 0, _("empty tab")); error (SORT_FAILURE, 0, _("empty tab"));
- if (optarg[1]) - if (optarg[1])
@ -3356,7 +3377,7 @@
else else
{ {
/* Provoke with 'sort -txx'. Complain about /* Provoke with 'sort -txx'. Complain about
@@ -4415,9 +5067,12 @@ main (int argc, char **argv) @@ -4470,9 +5121,12 @@ main (int argc, char **argv)
quote (optarg)); quote (optarg));
} }
} }
@ -3371,8 +3392,9 @@
} }
break; break;
--- coreutils-8.17/src/unexpand.c.i18n~ 2012-05-01 22:55:08.000000000 +0200 diff -urNp coreutils-8.19-orig/src/unexpand.c coreutils-8.19/src/unexpand.c
+++ coreutils-8.17/src/unexpand.c 2012-05-13 22:09:19.151905989 +0200 --- coreutils-8.19-orig/src/unexpand.c 2012-07-21 16:54:31.000000000 +0200
+++ coreutils-8.19/src/unexpand.c 2012-08-20 13:52:04.081596774 +0200
@@ -38,12 +38,29 @@ @@ -38,12 +38,29 @@
#include <stdio.h> #include <stdio.h>
#include <getopt.h> #include <getopt.h>
@ -3390,7 +3412,7 @@
#include "xstrndup.h" #include "xstrndup.h"
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC +/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
+ installation; work around this configuration error. */ + installation; work around this configuration error. */
+#if !defined MB_LEN_MAX || MB_LEN_MAX < 2 +#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
+# define MB_LEN_MAX 16 +# define MB_LEN_MAX 16
+#endif +#endif
@ -3626,8 +3648,9 @@
if (have_read_stdin && fclose (stdin) != 0) if (have_read_stdin && fclose (stdin) != 0)
error (EXIT_FAILURE, errno, "-"); error (EXIT_FAILURE, errno, "-");
--- coreutils-8.17/src/uniq.c.i18n~ 2012-05-01 22:55:08.000000000 +0200 diff -urNp coreutils-8.19-orig/src/uniq.c coreutils-8.19/src/uniq.c
+++ coreutils-8.17/src/uniq.c 2012-05-13 22:09:19.151905989 +0200 --- coreutils-8.19-orig/src/uniq.c 2012-07-21 16:54:31.000000000 +0200
+++ coreutils-8.19/src/uniq.c 2012-08-20 13:52:04.083502506 +0200
@@ -21,6 +21,16 @@ @@ -21,6 +21,16 @@
#include <getopt.h> #include <getopt.h>
#include <sys/types.h> #include <sys/types.h>
@ -3645,7 +3668,7 @@
#include "system.h" #include "system.h"
#include "argmatch.h" #include "argmatch.h"
#include "linebuffer.h" #include "linebuffer.h"
@@ -32,7 +42,18 @@ @@ -32,7 +42,19 @@
#include "stdio--.h" #include "stdio--.h"
#include "xmemcoll.h" #include "xmemcoll.h"
#include "xstrtol.h" #include "xstrtol.h"
@ -3662,10 +3685,11 @@
+#if HAVE_MBRTOWC && defined mbstate_t +#if HAVE_MBRTOWC && defined mbstate_t
+# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) +# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
+#endif +#endif
+
/* The official name of this program (e.g., no 'g' prefix). */ /* The official name of this program (e.g., no 'g' prefix). */
#define PROGRAM_NAME "uniq" #define PROGRAM_NAME "uniq"
@@ -108,6 +129,10 @@ static enum delimit_method const delimit @@ -108,6 +130,10 @@ static enum delimit_method const delimit
/* Select whether/how to delimit groups of duplicate lines. */ /* Select whether/how to delimit groups of duplicate lines. */
static enum delimit_method delimit_groups; static enum delimit_method delimit_groups;
@ -3676,7 +3700,7 @@
static struct option const longopts[] = static struct option const longopts[] =
{ {
{"count", no_argument, NULL, 'c'}, {"count", no_argument, NULL, 'c'},
@@ -206,7 +231,7 @@ size_opt (char const *opt, char const *m @@ -206,7 +232,7 @@ size_opt (char const *opt, char const *m
return a pointer to the beginning of the line's field to be compared. */ return a pointer to the beginning of the line's field to be compared. */
static char * _GL_ATTRIBUTE_PURE static char * _GL_ATTRIBUTE_PURE
@ -3685,7 +3709,7 @@
{ {
size_t count; size_t count;
char const *lp = line->buffer; char const *lp = line->buffer;
@@ -226,6 +251,83 @@ find_field (struct linebuffer const *lin @@ -226,6 +252,83 @@ find_field (struct linebuffer const *lin
return line->buffer + i; return line->buffer + i;
} }
@ -3769,7 +3793,7 @@
/* Return false if two strings OLD and NEW match, true if not. /* Return false if two strings OLD and NEW match, true if not.
OLD and NEW point not to the beginnings of the lines OLD and NEW point not to the beginnings of the lines
but rather to the beginnings of the fields to compare. but rather to the beginnings of the fields to compare.
@@ -234,6 +336,8 @@ find_field (struct linebuffer const *lin @@ -234,6 +337,8 @@ find_field (struct linebuffer const *lin
static bool static bool
different (char *old, char *new, size_t oldlen, size_t newlen) different (char *old, char *new, size_t oldlen, size_t newlen)
{ {
@ -3778,7 +3802,7 @@
if (check_chars < oldlen) if (check_chars < oldlen)
oldlen = check_chars; oldlen = check_chars;
if (check_chars < newlen) if (check_chars < newlen)
@@ -241,15 +345,93 @@ different (char *old, char *new, size_t @@ -241,14 +346,92 @@ different (char *old, char *new, size_t
if (ignore_case) if (ignore_case)
{ {
@ -3805,8 +3829,8 @@
+ } + }
+ +
+ return xmemcoll (copy_old, oldlen, copy_new, newlen); + return xmemcoll (copy_old, oldlen, copy_new, newlen);
} +}
+
+#if HAVE_MBRTOWC +#if HAVE_MBRTOWC
+static int +static int
+different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate) +different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate)
@ -3871,13 +3895,12 @@
+ } + }
+ +
+ return xmemcoll (copy[0], len[0], copy[1], len[1]); + return xmemcoll (copy[0], len[0], copy[1], len[1]);
+} }
+#endif +#endif
+
/* Output the line in linebuffer LINE to standard output /* Output the line in linebuffer LINE to standard output
provided that the switches say it should be output. provided that the switches say it should be output.
MATCH is true if the line matches the previous line. @@ -304,15 +487,43 @@ check_file (const char *infile, const ch
@@ -304,15 +486,43 @@ check_file (const char *infile, const ch
{ {
char *prevfield IF_LINT ( = NULL); char *prevfield IF_LINT ( = NULL);
size_t prevlen IF_LINT ( = 0); size_t prevlen IF_LINT ( = 0);
@ -3921,7 +3944,7 @@
if (prevline->length == 0 if (prevline->length == 0
|| different (thisfield, prevfield, thislen, prevlen)) || different (thisfield, prevfield, thislen, prevlen))
{ {
@@ -331,17 +541,26 @@ check_file (const char *infile, const ch @@ -331,17 +542,26 @@ check_file (const char *infile, const ch
size_t prevlen; size_t prevlen;
uintmax_t match_count = 0; uintmax_t match_count = 0;
bool first_delimiter = true; bool first_delimiter = true;
@ -3948,7 +3971,7 @@
if (readlinebuffer_delim (thisline, stdin, delimiter) == 0) if (readlinebuffer_delim (thisline, stdin, delimiter) == 0)
{ {
if (ferror (stdin)) if (ferror (stdin))
@@ -350,6 +569,14 @@ check_file (const char *infile, const ch @@ -350,6 +570,14 @@ check_file (const char *infile, const ch
} }
thisfield = find_field (thisline); thisfield = find_field (thisline);
thislen = thisline->length - 1 - (thisfield - thisline->buffer); thislen = thisline->length - 1 - (thisfield - thisline->buffer);
@ -3963,7 +3986,7 @@
match = !different (thisfield, prevfield, thislen, prevlen); match = !different (thisfield, prevfield, thislen, prevlen);
match_count += match; match_count += match;
@@ -382,6 +609,9 @@ check_file (const char *infile, const ch @@ -382,6 +610,9 @@ check_file (const char *infile, const ch
SWAP_LINES (prevline, thisline); SWAP_LINES (prevline, thisline);
prevfield = thisfield; prevfield = thisfield;
prevlen = thislen; prevlen = thislen;
@ -3973,7 +3996,7 @@
if (!match) if (!match)
match_count = 0; match_count = 0;
} }
@@ -427,6 +657,19 @@ main (int argc, char **argv) @@ -427,6 +658,19 @@ main (int argc, char **argv)
atexit (close_stdout); atexit (close_stdout);
@ -3993,8 +4016,9 @@
skip_chars = 0; skip_chars = 0;
skip_fields = 0; skip_fields = 0;
check_chars = SIZE_MAX; check_chars = SIZE_MAX;
--- coreutils-8.17/tests/Makefile.am.i18n~ 2012-05-10 16:36:42.000000000 +0200 diff -urNp coreutils-8.19-orig/tests/Makefile.am coreutils-8.19/tests/Makefile.am
+++ coreutils-8.17/tests/Makefile.am 2012-05-13 22:09:19.151905989 +0200 --- coreutils-8.19-orig/tests/Makefile.am 2012-08-20 13:51:39.856841699 +0200
+++ coreutils-8.19/tests/Makefile.am 2012-08-20 13:52:04.085491266 +0200
@@ -247,6 +247,7 @@ TESTS = \ @@ -247,6 +247,7 @@ TESTS = \
misc/sort-debug-warn \ misc/sort-debug-warn \
misc/sort-discrim \ misc/sort-discrim \
@ -4003,7 +4027,7 @@
misc/sort-float \ misc/sort-float \
misc/sort-merge \ misc/sort-merge \
misc/sort-merge-fdlimit \ misc/sort-merge-fdlimit \
@@ -543,6 +544,10 @@ TESTS = \ @@ -551,6 +552,10 @@ TESTS = \
$(root_tests) $(root_tests)
pr_data = \ pr_data = \
@ -4014,8 +4038,9 @@
pr/0F \ pr/0F \
pr/0FF \ pr/0FF \
pr/0FFnt \ pr/0FFnt \
--- coreutils-8.17/tests/misc/cut.i18n~ 2012-02-03 10:22:06.000000000 +0100 diff -urNp coreutils-8.19-orig/tests/misc/cut coreutils-8.19/tests/misc/cut
+++ coreutils-8.17/tests/misc/cut 2012-05-13 22:09:19.151905989 +0200 --- coreutils-8.19-orig/tests/misc/cut 2012-07-21 16:54:31.000000000 +0200
+++ coreutils-8.19/tests/misc/cut 2012-08-20 13:52:04.086593767 +0200
@@ -23,14 +23,15 @@ use strict; @@ -23,14 +23,15 @@ use strict;
# Turn off localization of executable's output. # Turn off localization of executable's output.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
@ -4045,36 +4070,98 @@
['inval2', qw(-f -), {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}], ['inval2', qw(-f -), {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
['inval3', '-f', '4,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}], ['inval3', '-f', '4,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
['inval4', '-f', '1-2,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, ['inval4', '-f', '1-2,-', {IN=>''}, {OUT=>''}, {EXIT=>1},
--- coreutils-8.17/tests/misc/mb1.I.i18n~ 2012-05-13 22:09:19.151905989 +0200 diff -urNp coreutils-8.19-orig/tests/misc/expand coreutils-8.19/tests/misc/expand
+++ coreutils-8.17/tests/misc/mb1.I 2012-05-13 22:09:19.151905989 +0200 --- coreutils-8.19-orig/tests/misc/expand 2012-07-21 16:54:31.000000000 +0200
+++ coreutils-8.19/tests/misc/expand 2012-08-20 13:55:44.188467648 +0200
@@ -23,6 +23,15 @@ use strict;
# Turn off localization of executable's output.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
+# uncommented according to upstream commit enabling multibyte paths
+my $mb_locale = $ENV{LOCALE_FR_UTF8};
+! defined $mb_locale || $mb_locale eq 'none'
+ and $mb_locale = 'C';
+
+my $prog = 'expand';
+my $try = "Try \`$prog --help' for more information.\n";
+my $inval = "$prog: invalid byte, character or field list\n$try";
+
my @Tests =
(
['t1', '--tabs=3', {IN=>"a\tb"}, {OUT=>"a b"}],
@@ -31,6 +40,37 @@ my @Tests =
['i2', '--tabs=3 -i', {IN=>" \ta\tb"}, {OUT=>" a\tb"}],
);
+if ($mb_locale ne 'C')
+ {
+ # Duplicate each test vector, appending "-mb" to the test name and
+ # inserting {ENV => "LC_ALL=$mb_locale"} in the copy, so that we
+ # provide coverage for the distro-added multi-byte code paths.
+ my @new;
+ foreach my $t (@Tests)
+ {
+ my @new_t = @$t;
+ my $test_name = shift @new_t;
+
+ # Depending on whether expand is multi-byte-patched,
+ # it emits different diagnostics:
+ # non-MB: invalid byte or field list
+ # MB: invalid byte, character or field list
+ # Adjust the expected error output accordingly.
+ if (grep {ref $_ eq 'HASH' && exists $_->{ERR} && $_->{ERR} eq $inval}
+ (@new_t))
+ {
+ my $sub = {ERR_SUBST => 's/, character//'};
+ push @new_t, $sub;
+ push @$t, $sub;
+ }
+ push @new, ["$test_name-mb", @new_t, {ENV => "LC_ALL=$mb_locale"}];
+ }
+ push @Tests, @new;
+ }
+
+
+@Tests = triple_test \@Tests;
+
my $save_temps = $ENV{DEBUG};
my $verbose = $ENV{VERBOSE};
diff -urNp coreutils-8.19-orig/tests/misc/mb1.I coreutils-8.19/tests/misc/mb1.I
--- coreutils-8.19-orig/tests/misc/mb1.I 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.19/tests/misc/mb1.I 2012-08-20 13:52:04.086593767 +0200
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
+Apple10 +Apple10
+Banana5 +Banana5
+Citrus20 +Citrus20
+Cherry30 +Cherry30
--- coreutils-8.17/tests/misc/mb1.X.i18n~ 2012-05-13 22:09:19.151905989 +0200 diff -urNp coreutils-8.19-orig/tests/misc/mb1.X coreutils-8.19/tests/misc/mb1.X
+++ coreutils-8.17/tests/misc/mb1.X 2012-05-13 22:09:19.151905989 +0200 --- coreutils-8.19-orig/tests/misc/mb1.X 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.19/tests/misc/mb1.X 2012-08-20 13:52:04.087526516 +0200
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
+Banana5 +Banana5
+Apple10 +Apple10
+Citrus20 +Citrus20
+Cherry30 +Cherry30
--- coreutils-8.17/tests/misc/mb2.I.i18n~ 2012-05-13 22:09:19.152905989 +0200 diff -urNp coreutils-8.19-orig/tests/misc/mb2.I coreutils-8.19/tests/misc/mb2.I
+++ coreutils-8.17/tests/misc/mb2.I 2012-05-13 22:09:19.152905989 +0200 --- coreutils-8.19-orig/tests/misc/mb2.I 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.19/tests/misc/mb2.I 2012-08-20 13:52:04.088593815 +0200
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
+Apple1020 +Apple1020
+Banana530 +Banana530
+Citrus205 +Citrus205
+Cherry3010 +Cherry3010
--- coreutils-8.17/tests/misc/mb2.X.i18n~ 2012-05-13 22:09:19.152905989 +0200 diff -urNp coreutils-8.19-orig/tests/misc/mb2.X coreutils-8.19/tests/misc/mb2.X
+++ coreutils-8.17/tests/misc/mb2.X 2012-05-13 22:09:19.152905989 +0200 --- coreutils-8.19-orig/tests/misc/mb2.X 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.19/tests/misc/mb2.X 2012-08-20 13:52:04.088593815 +0200
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
+Citrus205 +Citrus205
+Cherry3010 +Cherry3010
+Apple1020 +Apple1020
+Banana530 +Banana530
--- coreutils-8.17/tests/misc/sort-mb-tests.i18n~ 2012-05-13 22:09:19.152905989 +0200 diff -urNp coreutils-8.19-orig/tests/misc/sort-mb-tests coreutils-8.19/tests/misc/sort-mb-tests
+++ coreutils-8.17/tests/misc/sort-mb-tests 2012-05-13 22:09:19.152905989 +0200 --- coreutils-8.19-orig/tests/misc/sort-mb-tests 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.19/tests/misc/sort-mb-tests 2012-08-20 13:52:04.089593318 +0200
@@ -0,0 +1,58 @@ @@ -0,0 +1,58 @@
+#! /bin/sh +#! /bin/sh
+case $# in +case $# in

View file

@ -1,8 +1,8 @@
--- coreutils-8.14/src/stty.c.tcsadrain~ 2011-10-02 11:20:54.000000000 +0200 --- coreutils-8.19/src/stty.c.tcsadrain~ 2012-07-21 16:54:31.000000000 +0200
+++ coreutils-8.14/src/stty.c 2011-10-20 20:01:10.330462408 +0200 +++ coreutils-8.19/src/stty.c 2012-08-21 05:46:40.352604844 +0200
@@ -1005,7 +1005,7 @@ main (int argc, char **argv) @@ -1005,7 +1005,7 @@ main (int argc, char **argv)
spurious difference in an uninitialized portion of the structure. */ spurious difference in an uninitialized portion of the structure. */
struct termios new_mode = { 0, }; static struct termios new_mode;
- if (tcsetattr (STDIN_FILENO, TCSADRAIN, &mode)) - if (tcsetattr (STDIN_FILENO, TCSADRAIN, &mode))
+ if (tcsetattr (STDIN_FILENO, TCSANOW, &mode)) + if (tcsetattr (STDIN_FILENO, TCSANOW, &mode))

17
coreutils-8.19.tar.xz.sig Normal file
View file

@ -0,0 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABCAAGBQJQMdyBAAoJEH/Z/MsAC+7uPSkQAIVt2Eow5UChyij0PL95zvG4
l72JuAHgHYzSv4qCQQ4OOYTWhIdjo8DAe6byyTfyjJx67Mypz4e1oIkal+9CoReT
UDLfjJo90n46kwYVdogBs5Zgs+/7R4eNKLlNtiJ3w52JxGlOjZTSexfe/Km4wqqQ
6vQRx3LyZva7a4w/BiLFlCi/BLrid3ZeDsGOgMZ/A8zf+YFPXTOPqcFMnxmxQXMb
jVGjSrjMIPjeozX4h11T4/mTN2qeUEG0RjN1DwjrcC+v24Jz97CsrvlQZtBrzmxr
vyAr+Nf2x1bwwRHJHrJ1HvNQV0SQGLjPIIfbfSULSau5bv/wFRxIDfak7Z0S9bbq
n9l6+qzSii40utIX9S+LwwbNNBe5ORktLy8TzfU1np7/998RqK7TlhiedXzZ1NLq
wV7sRr34h1qpr4JRM4ieJrwIKXQImlktbu/WRe4OCC560ON3XJppd1cAxFLzynhN
LgGlX1O6LjyiFpAJkx7oNkQ9QGIjghz4YD06TITkfrxD+zzdwt2WDSMr/1/6z2/y
4pmpZaW68tGCLLFaluhJ0Pr+3g/QdnqvY3Nod5VXjsT2TlDUnqK59pWsNMBxeeyk
G0OD4UvaZrkh8RJUbzCJtQsi5ZZTrzv0/3HjkTEshu8m5hdklEwOEQjtpsHfT/iv
aTUjgqN11Iw67QIvYKaB
=bzPS
-----END PGP SIGNATURE-----

View file

@ -1,11 +0,0 @@
diff -urNp coreutils-8.4-orig/src/Makefile.am coreutils-8.4/src/Makefile.am
--- coreutils-8.4-orig/src/Makefile.am 2010-09-03 17:34:43.399747649 +0200
+++ coreutils-8.4/src/Makefile.am 2010-09-03 17:36:13.005765125 +0200
@@ -367,6 +367,7 @@ factor_LDADD += $(LIB_GMP)
# for crypt and pam
su_LDADD += $(LIB_CRYPT) $(PAM_LIBS)
+su_LDFLAGS = -pie -Wl,-z,relro,-z,now
# for various ACL functions
copy_LDADD += $(LIB_ACL)

View file

@ -1,316 +0,0 @@
--- coreutils-8.16/AUTHORS.runuser~ 2012-02-03 10:22:06.000000000 +0100
+++ coreutils-8.16/AUTHORS 2012-03-27 02:17:22.248536386 +0200
@@ -66,6 +66,7 @@ realpath: Pádraig Brady
rm: Paul Rubin, David MacKenzie, Richard M. Stallman, Jim Meyering
rmdir: David MacKenzie
runcon: Russell Coker
+runuser: David MacKenzie, Dan Walsh
seq: Ulrich Drepper
sha1sum: Ulrich Drepper, Scott Miller, David Madore
sha224sum: Ulrich Drepper, Scott Miller, David Madore
--- coreutils-8.16/man/help2man.runuser~ 2012-03-24 19:22:13.000000000 +0100
+++ coreutils-8.16/man/help2man 2012-03-27 02:17:22.248536386 +0200
@@ -558,6 +558,9 @@ while (length)
$include{$sect} .= $content;
}
+# There is no info documentation for runuser (shared with su).
+$opt_no_info = 1 if $program eq 'runuser';
+
# Refer to the real documentation.
unless ($opt_no_info)
{
--- coreutils-8.16/man/Makefile.am.runuser~ 2012-03-26 11:50:41.000000000 +0200
+++ coreutils-8.16/man/Makefile.am 2012-03-27 02:17:22.248536386 +0200
@@ -96,6 +96,7 @@ realpath.1: $(common_dep) $(srcdir)/real
rm.1: $(common_dep) $(srcdir)/rm.x ../src/rm.c
rmdir.1: $(common_dep) $(srcdir)/rmdir.x ../src/rmdir.c
runcon.1: $(common_dep) $(srcdir)/runcon.x ../src/runcon.c
+runuser.1: $(common_dep) $(srcdir)/runuser.x ../src/su.c
seq.1: $(common_dep) $(srcdir)/seq.x ../src/seq.c
sha1sum.1: $(common_dep) $(srcdir)/sha1sum.x ../src/md5sum.c
sha224sum.1: $(common_dep) $(srcdir)/sha224sum.x ../src/md5sum.c
--- coreutils-8.16/man/runuser.x.runuser~ 2012-03-27 02:17:22.248536386 +0200
+++ coreutils-8.16/man/runuser.x 2012-03-27 02:17:22.248536386 +0200
@@ -0,0 +1,12 @@
+[NAME]
+runuser \- run a shell with substitute user and group IDs
+[DESCRIPTION]
+.\" Add any additional description here
+[SEE ALSO]
+.TP
+More detailed Texinfo documentation could be found by command
+.TP
+\t\fBinfo coreutils \(aqsu invocation\(aq\fR\t
+.TP
+since the command \fBrunuser\fR is trimmed down version of command \fBsu\fR.
+.br
--- coreutils-8.16/src/Makefile.am.runuser~ 2012-03-27 02:17:22.219536384 +0200
+++ coreutils-8.16/src/Makefile.am 2012-03-27 02:17:22.248536386 +0200
@@ -101,6 +101,7 @@ EXTRA_PROGRAMS = \
rm \
rmdir \
runcon \
+ runuser \
seq \
sha1sum \
sha224sum \
@@ -305,6 +306,10 @@ cp_LDADD += $(copy_LDADD)
ginstall_LDADD += $(copy_LDADD)
mv_LDADD += $(copy_LDADD)
+runuser_SOURCES = su.c
+runuser_CFLAGS = -DRUNUSER -DAUTHORS="\"David MacKenzie, Dan Walsh\""
+runuser_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS)
+
remove_LDADD =
mv_LDADD += $(remove_LDADD)
rm_LDADD += $(remove_LDADD)
@@ -402,7 +407,7 @@ RELEASE_YEAR = \
`sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
$(top_srcdir)/lib/version-etc.c`
-all-local: su$(EXEEXT)
+all-local: su$(EXEEXT) runuser
installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
--- coreutils-8.16/src/su.c.runuser~ 2012-03-27 02:17:22.237536385 +0200
+++ coreutils-8.16/src/su.c 2012-03-27 02:18:02.645538702 +0200
@@ -100,9 +100,15 @@
#include "error.h"
/* The official name of this program (e.g., no 'g' prefix). */
+#ifndef RUNUSER
#define PROGRAM_NAME "su"
+#else
+#define PROGRAM_NAME "runuser"
+#endif
+#ifndef AUTHORS
#define AUTHORS proper_name ("David MacKenzie")
+#endif
#if HAVE_PATHS_H
# include <paths.h>
@@ -140,6 +146,9 @@
#ifndef USE_PAM
char *crypt (char const *key, char const *salt);
#endif
+#ifndef CHECKPASSWD
+#define CHECKPASSWD 1
+#endif
static void run_shell (char const *, char const *, char **, size_t)
ATTRIBUTE_NORETURN;
@@ -169,6 +178,10 @@ static struct option const longopts[] =
{"login", no_argument, NULL, 'l'},
{"preserve-environment", no_argument, NULL, 'p'},
{"shell", required_argument, NULL, 's'},
+#ifdef RUNUSER
+ {"group", required_argument, NULL, 'g'},
+ {"supp-group", required_argument, NULL, 'G'},
+#endif
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
@@ -447,6 +460,11 @@ correct_password (const struct passwd *p
retval = pam_set_item (pamh, PAM_RUSER, (const void *) lpw->pw_name);
PAM_BAIL_P (return false);
}
+#ifdef RUNUSER
+ if (getuid() != geteuid())
+ /* safety net: deny operation if we are suid by accident */
+ error(EXIT_FAILURE, 1, "runuser may not be setuid");
+#else
retval = pam_authenticate (pamh, 0);
PAM_BAIL_P (return false);
retval = pam_acct_mgmt (pamh, 0);
@@ -457,6 +475,7 @@ correct_password (const struct passwd *p
PAM_BAIL_P (return false);
}
PAM_BAIL_P (return false);
+#endif
/* Must be authenticated if this point was reached. */
return true;
#else /* !USE_PAM */
@@ -536,11 +555,22 @@ modify_environment (const struct passwd
/* Become the user and group(s) specified by PW. */
static void
-init_groups (const struct passwd *pw)
+init_groups (const struct passwd *pw
+#ifdef RUNUSER
+ , gid_t *groups, int num_groups
+#endif
+ )
{
#ifdef HAVE_INITGROUPS
+ int rc = 0;
errno = 0;
- if (initgroups (pw->pw_name, pw->pw_gid) == -1)
+#ifdef RUNUSER
+ if (num_groups)
+ rc = setgroups(num_groups, groups);
+ else
+#endif
+ rc = initgroups(pw->pw_name, pw->pw_gid);
+ if (rc == -1)
{
#ifdef USE_PAM
cleanup_pam (PAM_ABORT);
@@ -641,6 +671,28 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... [-] [USER [ARG]...]\n"), program_name);
+#ifdef RUNUSER
+ printf (_("\
+Change the effective user id and group id to that of USER. Only session PAM\n\
+hooks are run, and there is no password prompt. This command is useful only\n\
+when run as the root user. If run as a non-root user without privilege\n\
+to set user ID, the command will fail as the binary is not setuid.\n\
+As %s doesn't run auth and account PAM hooks, it runs with lower overhead\n\
+than su.\n\
+\n\
+ -, -l, --login make the shell a login shell, uses runuser-l\n\
+ PAM file instead of default one\n\
+ -g --group=group specify the primary group\n\
+ -G --supp-group=group specify a supplemental group\n\
+ -c, --command=COMMAND pass a single COMMAND to the shell with -c\n\
+ --session-command=COMMAND pass a single COMMAND to the shell with -c\n\
+ and do not create a new session\n\
+ -f, --fast pass -f to the shell (for csh or tcsh)\n\
+ -m, --preserve-environment do not reset environment variables\n\
+ -p same as -m\n\
+ -s, --shell=SHELL run SHELL if /etc/shells allows it\n\
+"), program_name);
+#else
fputs (_("\
Change the effective user id and group id to that of USER.\n\
\n\
@@ -653,6 +705,7 @@ Change the effective user id and group i
-p same as -m\n\
-s, --shell=SHELL run SHELL if /etc/shells allows it\n\
"), stdout);
+#endif
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
fputs (_("\
@@ -674,6 +727,12 @@ main (int argc, char **argv)
char *shell = NULL;
struct passwd *pw;
struct passwd pw_copy;
+#ifdef RUNUSER
+ struct group *gr;
+ gid_t groups[NGROUPS_MAX];
+ int num_supp_groups = 0;
+ int use_gid = 0;
+#endif
initialize_main (&argc, &argv);
set_program_name (argv[0]);
@@ -688,7 +747,11 @@ main (int argc, char **argv)
simulate_login = false;
change_environment = true;
- while ((optc = getopt_long (argc, argv, "c:flmps:", longopts, NULL)) != -1)
+ while ((optc = getopt_long (argc, argv, "c:flmps:"
+#ifdef RUNUSER
+ "g:G:"
+#endif
+ , longopts, NULL)) != -1)
{
switch (optc)
{
@@ -718,6 +781,28 @@ main (int argc, char **argv)
shell = optarg;
break;
+#ifdef RUNUSER
+ case 'g':
+ gr = getgrnam(optarg);
+ if (!gr)
+ error (EXIT_FAILURE, 0, _("group %s does not exist"), optarg);
+ use_gid = 1;
+ groups[0] = gr->gr_gid;
+ break;
+
+ case 'G':
+ num_supp_groups++;
+ if (num_supp_groups >= NGROUPS_MAX)
+ error (EXIT_FAILURE, 0,
+ _("Can't specify more than %d supplemental groups"),
+ NGROUPS_MAX - 1);
+ gr = getgrnam(optarg);
+ if (!gr)
+ error (EXIT_FAILURE, 0, _("group %s does not exist"), optarg);
+ groups[num_supp_groups] = gr->gr_gid;
+ break;
+#endif
+
case_GETOPT_HELP_CHAR;
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
@@ -756,7 +841,20 @@ main (int argc, char **argv)
: DEFAULT_SHELL);
endpwent ();
- if (!correct_password (pw))
+#ifdef RUNUSER
+ if (num_supp_groups && !use_gid)
+ {
+ pw->pw_gid = groups[1];
+ memmove (groups, groups + 1, sizeof(gid_t) * num_supp_groups);
+ }
+ else if (use_gid)
+ {
+ pw->pw_gid = groups[0];
+ num_supp_groups++;
+ }
+#endif
+
+ if (CHECKPASSWD && !correct_password (pw))
{
#ifdef SYSLOG_FAILURE
log_su (pw, false);
@@ -786,7 +884,11 @@ main (int argc, char **argv)
}
shell = xstrdup (shell ? shell : pw->pw_shell);
- init_groups (pw);
+ init_groups (pw
+#ifdef RUNUSER
+ , groups, num_supp_groups
+#endif
+ );
#ifdef USE_PAM
create_watching_parent ();
--- coreutils-8.16/tests/misc/help-version.runuser~ 2012-03-24 19:22:13.000000000 +0100
+++ coreutils-8.16/tests/misc/help-version 2012-03-27 02:17:22.249536386 +0200
@@ -32,6 +32,7 @@ expected_failure_status_nohup=125
expected_failure_status_stdbuf=125
expected_failure_status_su=125
expected_failure_status_timeout=125
+expected_failure_status_runuser=125
expected_failure_status_printenv=2
expected_failure_status_tty=3
expected_failure_status_sort=2
@@ -210,6 +211,7 @@ seq_setup () { args=10; }
sleep_setup () { args=0; }
su_setup () { args=--version; }
stdbuf_setup () { args="-oL true"; }
+runuser_setup () { args=--version; }
timeout_setup () { args=--version; }
# I'd rather not run sync, since it spins up disks that I've
--- coreutils-8.16/tests/misc/invalid-opt.runuser~ 2012-02-03 10:22:06.000000000 +0100
+++ coreutils-8.16/tests/misc/invalid-opt 2012-03-27 02:17:22.249536386 +0200
@@ -37,6 +37,7 @@ my %exit_status =
sort => 2,
stdbuf => 125,
su => 125,
+ runuser => 125,
test => 0,
timeout => 125,
true => 0,

View file

@ -1,102 +0,0 @@
diff -urNp coreutils-8.6-orig/src/su.c coreutils-8.6/src/su.c
--- coreutils-8.6-orig/src/su.c 2010-11-03 13:56:11.679069689 +0100
+++ coreutils-8.6/src/su.c 2010-11-03 13:56:45.304325661 +0100
@@ -153,6 +153,9 @@ static bool simulate_login;
/* If true, change some environment vars to indicate the user su'd to. */
static bool change_environment;
+/* If true, then don't call setsid() with a command. */
+int same_session = 0;
+
#ifdef USE_PAM
static bool _pam_session_opened;
static bool _pam_cred_established;
@@ -161,6 +164,7 @@ static bool _pam_cred_established;
static struct option const longopts[] =
{
{"command", required_argument, NULL, 'c'},
+ {"session-command", required_argument, NULL, 'C'},
{"fast", no_argument, NULL, 'f'},
{"login", no_argument, NULL, 'l'},
{"preserve-environment", no_argument, NULL, 'p'},
@@ -335,14 +339,27 @@ create_watching_parent (void)
sigemptyset (&action.sa_mask);
action.sa_flags = 0;
sigemptyset (&ourset);
- if (sigaddset (&ourset, SIGTERM)
- || sigaddset (&ourset, SIGALRM)
- || sigaction (SIGTERM, &action, NULL)
- || sigprocmask (SIG_UNBLOCK, &ourset, NULL))
- {
+ if (!same_session)
+ {
+ if (sigaddset(&ourset, SIGINT) || sigaddset(&ourset, SIGQUIT))
+ {
+ error (0, errno, _("cannot set signal handler"));
+ caught_signal = true;
+ }
+ }
+ if (!caught_signal && (sigaddset(&ourset, SIGTERM)
+ || sigaddset(&ourset, SIGALRM)
+ || sigaction(SIGTERM, &action, NULL)
+ || sigprocmask(SIG_UNBLOCK, &ourset, NULL))) {
error (0, errno, _("cannot set signal handler"));
caught_signal = true;
}
+ if (!caught_signal && !same_session && (sigaction(SIGINT, &action, NULL)
+ || sigaction(SIGQUIT, &action, NULL)))
+ {
+ error (0, errno, _("cannot set signal handler"));
+ caught_signal = true;
+ }
}
if (!caught_signal)
{
@@ -627,6 +644,8 @@ Change the effective user id and group i
\n\
-, -l, --login make the shell a login shell\n\
-c, --command=COMMAND pass a single COMMAND to the shell with -c\n\
+ --session-command=COMMAND pass a single COMMAND to the shell with -c\n\
+ and do not create a new session\n\
-f, --fast pass -f to the shell (for csh or tcsh)\n\
-m, --preserve-environment do not reset environment variables\n\
-p same as -m\n\
@@ -649,6 +668,7 @@ main (int argc, char **argv)
int optc;
const char *new_user = DEFAULT_USER;
char *command = NULL;
+ int request_same_session = 0;
char *shell = NULL;
struct passwd *pw;
struct passwd pw_copy;
@@ -674,6 +694,11 @@ main (int argc, char **argv)
command = optarg;
break;
+ case 'C':
+ command = optarg;
+ request_same_session = 1;
+ break;
+
case 'f':
fast_startup = true;
break;
@@ -743,6 +768,9 @@ main (int argc, char **argv)
}
#endif
+ if (request_same_session || !command || !pw->pw_uid)
+ same_session = 1;
+
if (!shell && !change_environment)
shell = getenv ("SHELL");
if (shell && getuid () != 0 && restricted_shell (pw->pw_shell))
@@ -764,6 +792,8 @@ main (int argc, char **argv)
#endif
change_identity (pw);
+ if (!same_session)
+ setsid ();
/* Set environment after pam_open_session, which may put KRB5CCNAME
into the pam_env, etc. */

View file

@ -1,14 +1,12 @@
Summary: The GNU core utilities: a set of tools commonly used in shell scripts Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils Name: coreutils
Version: 8.17 Version: 8.19
Release: 2 Release: 5
License: GPLv3+ License: GPLv3+
Group: System/Base Group: System/Base
Url: http://www.gnu.org/software/coreutils/ Url: http://www.gnu.org/software/coreutils/
Source0: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz Source0: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
Source1: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig Source1: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig
Source200: su.pamd
Source202: su-l.pamd
# fileutils # fileutils
Patch101: coreutils-8.2-spacedir.patch Patch101: coreutils-8.2-spacedir.patch
@ -20,8 +18,6 @@ Patch500: coreutils-8.3-mem.patch
#add info about TZ envvar to date manpage #add info about TZ envvar to date manpage
Patch703: coreutils-6.11-dateman.patch Patch703: coreutils-6.11-dateman.patch
#set paths for su explicitly, don't get influenced by paths.h
Patch704: sh-utils-1.16-paths.patch
# RMS will never accept the PAM patch because it removes his historical # RMS will never accept the PAM patch because it removes his historical
# rant about Twenex and the wheel group, so we'll continue to maintain # rant about Twenex and the wheel group, so we'll continue to maintain
# it here indefinitely. # it here indefinitely.
@ -33,7 +29,7 @@ Patch713: coreutils-4.5.3-langinfo.patch
# this one is actually a merger of 5.2 and 5.3, as join segfaults # this one is actually a merger of 5.2 and 5.3, as join segfaults
# compiled with gcc4 and the 5.1/5.2 patch # compiled with gcc4 and the 5.1/5.2 patch
# fwang: we often get this patch from fedora # fwang: we often get this patch from fedora
Patch800: coreutils-8.17-new-i18n.patch Patch800: coreutils-8.19-new-i18n.patch
Patch909: coreutils-5.1.0-64bit-fixes.patch Patch909: coreutils-5.1.0-64bit-fixes.patch
@ -48,7 +44,7 @@ Patch1014: coreutils-8.8-check-string-format.patch
#add note about no difference between binary/text mode on Linux - md5sum manpage #add note about no difference between binary/text mode on Linux - md5sum manpage
Patch2101: coreutils-8.9-manpages.patch Patch2101: coreutils-8.9-manpages.patch
#temporarily workaround probable kernel issue with TCSADRAIN(#504798) #temporarily workaround probable kernel issue with TCSADRAIN(#504798)
Patch2102: coreutils-8.14-sttytcsadrain.patch Patch2102: coreutils-8.19-sttytcsadrain.patch
#do display processor type for uname -p/-i based on uname(2) syscall #do display processor type for uname -p/-i based on uname(2) syscall
Patch2103: coreutils-8.2-uname-processortype.patch Patch2103: coreutils-8.2-uname-processortype.patch
#df --direct #df --direct
@ -56,16 +52,10 @@ Patch2104: coreutils-8.9-df-direct.patch
#Fix mkstemp on sparc64 #Fix mkstemp on sparc64
Patch2105: coreutils-mkstemp.patch Patch2105: coreutils-mkstemp.patch
#Call setsid() in su under some circumstances (bug #173008).
Patch2900: coreutils-setsid.patch
#make runuser binary based on su.c
Patch2907: coreutils-8.7-runuser.patch
#getgrouplist() patch from Ulrich Drepper. #getgrouplist() patch from Ulrich Drepper.
Patch2908: coreutils-8.14-getgrouplist.patch Patch2908: coreutils-8.14-getgrouplist.patch
#Prevent buffer overflow in who(1) (bug #158405). #Prevent buffer overflow in who(1) (bug #158405).
Patch2912: coreutils-overflow.patch Patch2912: coreutils-overflow.patch
#compile su with pie flag and RELRO protection
Patch2917: coreutils-8.4-su-pie.patch
BuildRequires: gettext BuildRequires: gettext
BuildRequires: termcap-devel BuildRequires: termcap-devel
@ -76,9 +66,9 @@ BuildRequires: automake >= 1.10.2-2
# And tar which supports xz automagically since rpm.org seems to rely on this(..?) # And tar which supports xz automagically since rpm.org seems to rely on this(..?)
BuildRequires: tar >= 1.21-2 BuildRequires: tar >= 1.21-2
BuildRequires: acl-devel BuildRequires: acl-devel
BuildRequires: attr-devel BuildRequires: libattr-devel
BuildRequires: gmp-devel BuildRequires: gmp-devel
BuildRequires: cap-devel BuildRequires: libcap-devel
BuildRequires: bison BuildRequires: bison
BuildRequires: flex BuildRequires: flex
BuildRequires: strace BuildRequires: strace
@ -93,7 +83,8 @@ Provides: /bin/rm
Provides: /bin/cp Provides: /bin/cp
Provides: /bin/stty Provides: /bin/stty
Provides: /bin/ln Provides: /bin/ln
Provides: /bin/mktemp Provides: /bin/mktemp
Obsoletes: base64
Suggests: coreutils-doc Suggests: coreutils-doc
%description %description
@ -133,8 +124,6 @@ This package contains coreutils documentation in GNU info format.
# sh-utils # sh-utils
%patch703 -p1 -b .dateman~ %patch703 -p1 -b .dateman~
%patch704 -p1 -b .paths~
%patch706 -p1 -b .pam~
%patch713 -p1 -b .langinfo~ %patch713 -p1 -b .langinfo~
# li18nux/lsb # li18nux/lsb
@ -156,11 +145,8 @@ This package contains coreutils documentation in GNU info format.
%patch2105 -p1 -b .sparc~ %patch2105 -p1 -b .sparc~
%endif %endif
%patch2900 -p1 -b .setsid~
%patch2907 -p1 -b .runuser~
%patch2908 -p1 -b .getgrouplist~ %patch2908 -p1 -b .getgrouplist~
%patch2912 -p1 -b .overflow~ %patch2912 -p1 -b .overflow~
%patch2917 -p1 -b .pie~
chmod a+x tests/misc/sort-mb-tests tests/misc/id-context chmod a+x tests/misc/sort-mb-tests tests/misc/id-context
chmod +w ./src/dircolors.h chmod +w ./src/dircolors.h
@ -178,7 +164,6 @@ export CFLAGS="%{optflags} -fPIC -D_GNU_SOURCE=1"
%configure2_5x \ %configure2_5x \
--enable-largefile \ --enable-largefile \
--enable-pam \ --enable-pam \
--enable-install-program=su \
--enable-no-install-program=arch,hostname,uptime,kill \ --enable-no-install-program=arch,hostname,uptime,kill \
--without-selinux \ --without-selinux \
--disable-rpath \ --disable-rpath \
@ -213,20 +198,12 @@ done
install -m644 src/dircolors.hin -D %{buildroot}%{_sysconfdir}/DIR_COLORS install -m644 src/dircolors.hin -D %{buildroot}%{_sysconfdir}/DIR_COLORS
# su
install -m 4755 src/su %{buildroot}/bin
install -m 644 %{SOURCE200} %{buildroot}%{_sysconfdir}/pam.d/su
install -m 644 %{SOURCE202} %{buildroot}%{_sysconfdir}/pam.d/su-l
#TV# find_lang look for LC_MESSAGES, not LC_TIME: #TV# find_lang look for LC_MESSAGES, not LC_TIME:
find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs rm -f find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs rm -f
%find_lang %{name} %find_lang %{name}
%files -f %{name}.lang %files -f %{name}.lang
%config(noreplace) %{_sysconfdir}/D* %config(noreplace) %{_sysconfdir}/D*
%config(noreplace) %{_sysconfdir}/pam.d/su
%config(noreplace) %{_sysconfdir}/pam.d/su-l
%doc README %doc README
/bin/* /bin/*
%{_bindir}/* %{_bindir}/*
@ -241,6 +218,20 @@ find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs
%changelog %changelog
* Sat Aug 25 2012 Tomasz Pawel Gajc <tpg@mandriva.org> 8.19-3
+ Revision: 815748
- su.pamd and su-l.pamd files have been moved to util-linux package
* Fri Aug 24 2012 Paulo Andrade <pcpa@mandriva.com.br> 8.19-2
+ Revision: 815704
- Bump release and rebuild.
+ Per Øyvind Karlsen <peroyvind@mandriva.org>
- new version
+ Bernhard Rosenkraenzer <bero@bero.eu>
- Fix build dependency on 32-bit libgmp
* Sun May 13 2012 Bernhard Rosenkraenzer <bero@bero.eu> 8.17-1 * Sun May 13 2012 Bernhard Rosenkraenzer <bero@bero.eu> 8.17-1
+ Revision: 798678 + Revision: 798678
- Update to 8.17 - Update to 8.17
@ -257,11 +248,11 @@ find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs
- update to version 8.15 - update to version 8.15
update some patch update some patch
* Sun Nov 27 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.14-2 * Sun Nov 27 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.14-2
+ Revision: 734461 + Revision: 734461
- add a suggests on coreutils-doc - add a suggests on coreutils-doc
* Fri Oct 21 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.14-1 * Fri Oct 21 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.14-1
+ Revision: 705614 + Revision: 705614
- remove ancient versioned conflicts on tetex - remove ancient versioned conflicts on tetex
- sync multibyte patch with Fedora to pull in some additional fixes (P800) - sync multibyte patch with Fedora to pull in some additional fixes (P800)
@ -282,21 +273,21 @@ find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs
- update to new version 8.10 - update to new version 8.10
- update patch 800 - update patch 800
+ Per Øyvind Karlsen <peroyvind@mandriva.org> + Per Øyvind Karlsen <peroyvind@mandriva.org>
- add '.gem' suffix with same color as other arhives with 'ls' - add '.gem' suffix with same color as other arhives with 'ls'
* Tue Jan 18 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.9-2 * Tue Jan 18 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.9-2
+ Revision: 631565 + Revision: 631565
- remove unnecessary buildrequires on locales-* - remove unnecessary buildrequires on locales-*
- remove dependency on pam causing dependency loop - remove dependency on pam causing dependency loop
- add back LC_TIME workaround for %%find_lang for now as it breaks upgrades.. - add back LC_TIME workaround for %%find_lang for now as it breaks upgrades..
* Sun Jan 09 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.9-1mdv2011.0 * Sun Jan 09 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.9-1mdv2011.0
+ Revision: 630708 + Revision: 630708
- let %%find_lang take care of LC_TIME locale symlinks now - let %%find_lang take care of LC_TIME locale symlinks now
- new release: 8.9 - new release: 8.9
* Wed Dec 29 2010 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.8-1mdv2011.0 * Wed Dec 29 2010 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.8-1mdv2011.0
+ Revision: 625742 + Revision: 625742
- license is actually GPLv3+, not GPLv3.. ;p - license is actually GPLv3+, not GPLv3.. ;p
- drop old patches - drop old patches
@ -382,7 +373,7 @@ find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs
- fix license - fix license
- package libstdbuf.so - package libstdbuf.so
+ Nicolas Lécureuil <nlecureuil@mandriva.com> + Nicolas Lécureuil <nlecureuil@mandriva.com>
- Add su manpage (Bug #51699) - Add su manpage (Bug #51699)
* Mon Jul 20 2009 Guillaume Rousse <guillomovitch@mandriva.org> 7.4-2mdv2010.0 * Mon Jul 20 2009 Guillaume Rousse <guillomovitch@mandriva.org> 7.4-2mdv2010.0
@ -404,7 +395,7 @@ find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs
+ Revision: 349061 + Revision: 349061
- Add explicit provides for /bin/env and /usr/bin/env - Add explicit provides for /bin/env and /usr/bin/env
* Thu Feb 26 2009 Per Øyvind Karlsen <peroyvind@mandriva.org> 7.1-1mdv2009.1 * Thu Feb 26 2009 Per Øyvind Karlsen <peroyvind@mandriva.org> 7.1-1mdv2009.1
+ Revision: 345271 + Revision: 345271
- add versioned buildrequires on tar & automake for xz support - add versioned buildrequires on tar & automake for xz support
- new release: 7.1 - new release: 7.1
@ -482,11 +473,11 @@ find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs
- Use proper way to change CFLAGS in the spec file. - Use proper way to change CFLAGS in the spec file.
(aka dd if=/dev/zero bs=1M count=300 | time -p sum -s bug fix). (aka dd if=/dev/zero bs=1M count=300 | time -p sum -s bug fix).
* Thu Sep 06 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 6.9-5mdv2008.0 * Thu Sep 06 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 6.9-5mdv2008.0
+ Revision: 81114 + Revision: 81114
- disable coloring for text documents - disable coloring for text documents
* Sun Aug 26 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 6.9-4mdv2008.0 * Sun Aug 26 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 6.9-4mdv2008.0
+ Revision: 71568 + Revision: 71568
- give black background for white text for documents in case of using - give black background for white text for documents in case of using
terminal with white background (updates P1011, fixes #32827) terminal with white background (updates P1011, fixes #32827)
@ -496,7 +487,7 @@ find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs
+ Revision: 69360 + Revision: 69360
- kill file require on info-install - kill file require on info-install
+ Per Øyvind Karlsen <peroyvind@mandriva.org> + Per Øyvind Karlsen <peroyvind@mandriva.org>
- add coloring for .wma & *rc (updates P1011) - add coloring for .wma & *rc (updates P1011)
- add even more formats (updates P1011, I have no life:p) - add even more formats (updates P1011, I have no life:p)
- drop lzma patch (P1010) and rather merge with generic dircolors patch (P1011) - drop lzma patch (P1010) and rather merge with generic dircolors patch (P1011)
@ -514,7 +505,7 @@ find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs
- Update program list - Update program list
- Obsoletes base64 - Obsoletes base64
+ Per Øyvind Karlsen <peroyvind@mandriva.org> + Per Øyvind Karlsen <peroyvind@mandriva.org>
- add back always blinking colors for broken symlinks (P1013) - add back always blinking colors for broken symlinks (P1013)
- fix P1011 as it reverted P1010 and lzma coloring - fix P1011 as it reverted P1010 and lzma coloring
@ -533,7 +524,7 @@ find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs
- Remove patch0: lg.po not there - Remove patch0: lg.po not there
- New upstream version - New upstream version
* Wed Jul 11 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 5.97-8mdv2008.0 * Wed Jul 11 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 5.97-8mdv2008.0
+ Revision: 51341 + Revision: 51341
- drop S101 & S102 and rather merge with dircolors.hin in package as well as add few types (P1011) - drop S101 & S102 and rather merge with dircolors.hin in package as well as add few types (P1011)
- add lzma coloring support for ls (P1010, might need some more work?) - add lzma coloring support for ls (P1010, might need some more work?)
@ -557,7 +548,7 @@ find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs
+ Revision: 123126 + Revision: 123126
- bump release (#28834) - bump release (#28834)
+ Per Øyvind Karlsen <pkarlsen@mandriva.com> + Per Øyvind Karlsen <pkarlsen@mandriva.com>
- reintroduce interactive override (-if) and rather fix check (P1155, real fix for #16209) - reintroduce interactive override (-if) and rather fix check (P1155, real fix for #16209)
+ Olivier Blin <oblin@mandriva.com> + Olivier Blin <oblin@mandriva.com>
@ -607,7 +598,7 @@ find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs
(#15050) (#15050)
- patch 801: fix some typos in pt_BR.po file - patch 801: fix some typos in pt_BR.po file
* Fri Aug 12 2005 Nicolas Lécureuil <neoclust@mandriva.org> 5.2.1-6mdk * Fri Aug 12 2005 Nicolas Lécureuil <neoclust@mandriva.org> 5.2.1-6mdk
- fix rpmlint errors (PreReq) - fix rpmlint errors (PreReq)
* Thu Feb 10 2005 Thierry Vignaud <tvignaud@mandrakesoft.com> 5.2.1-5mdk * Thu Feb 10 2005 Thierry Vignaud <tvignaud@mandrakesoft.com> 5.2.1-5mdk

632
old.spec Normal file
View file

@ -0,0 +1,632 @@
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils
Version: 8.17
Release: 2
License: GPLv3+
Group: System/Base
Url: http://www.gnu.org/software/coreutils/
Source0: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
Source1: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig
Source200: su.pamd
Source202: su-l.pamd
# fileutils
Patch101: coreutils-8.2-spacedir.patch
Patch1155: coreutils-8.2-force-option--override--interactive-option.patch
Patch118: fileutils-4.1-ls_h.patch
Patch500: coreutils-8.3-mem.patch
# sh-utils
#add info about TZ envvar to date manpage
Patch703: coreutils-6.11-dateman.patch
#set paths for su explicitly, don't get influenced by paths.h
Patch704: sh-utils-1.16-paths.patch
# RMS will never accept the PAM patch because it removes his historical
# rant about Twenex and the wheel group, so we'll continue to maintain
# it here indefinitely.
Patch706: coreutils-8.7-pam.patch
Patch713: coreutils-4.5.3-langinfo.patch
# (sb) lin18nux/lsb compliance - normally from here:
# http://www.openi18n.org/subgroups/utildev/patch/
# this one is actually a merger of 5.2 and 5.3, as join segfaults
# compiled with gcc4 and the 5.1/5.2 patch
# fwang: we often get this patch from fedora
Patch800: coreutils-8.17-new-i18n.patch
Patch909: coreutils-5.1.0-64bit-fixes.patch
# https://qa.mandriva.com/show_bug.cgi?id=38577
Patch911: coreutils-8.3-groupfix.patch
Patch1011: coreutils-8.14-DIR_COLORS-mdkconf.patch
#(peroyvind): fix a test that fails to compile with -Werror=format-security
Patch1014: coreutils-8.8-check-string-format.patch
# fedora patches
#add note about no difference between binary/text mode on Linux - md5sum manpage
Patch2101: coreutils-8.9-manpages.patch
#temporarily workaround probable kernel issue with TCSADRAIN(#504798)
Patch2102: coreutils-8.14-sttytcsadrain.patch
#do display processor type for uname -p/-i based on uname(2) syscall
Patch2103: coreutils-8.2-uname-processortype.patch
#df --direct
Patch2104: coreutils-8.9-df-direct.patch
#Fix mkstemp on sparc64
Patch2105: coreutils-mkstemp.patch
#Call setsid() in su under some circumstances (bug #173008).
Patch2900: coreutils-setsid.patch
#make runuser binary based on su.c
Patch2907: coreutils-8.7-runuser.patch
#getgrouplist() patch from Ulrich Drepper.
Patch2908: coreutils-8.14-getgrouplist.patch
#Prevent buffer overflow in who(1) (bug #158405).
Patch2912: coreutils-overflow.patch
#compile su with pie flag and RELRO protection
Patch2917: coreutils-8.4-su-pie.patch
BuildRequires: gettext
BuildRequires: termcap-devel
BuildRequires: pam-devel
BuildRequires: texinfo >= 4.3
# We need automake which supports the dist-xz target
BuildRequires: automake >= 1.10.2-2
# And tar which supports xz automagically since rpm.org seems to rely on this(..?)
BuildRequires: tar >= 1.21-2
BuildRequires: acl-devel
BuildRequires: attr-devel
BuildRequires: gmp-devel
BuildRequires: cap-devel
BuildRequires: bison
BuildRequires: flex
BuildRequires: strace
%rename mktemp
Provides: stat = %{version}
Provides: %{_bindir}/env
Provides: /bin/env
Provides: %{_bindir}/tr
Provides: /bin/rm
Provides: /bin/cp
Provides: /bin/stty
Provides: /bin/ln
Provides: /bin/mktemp
Suggests: coreutils-doc
%description
This package is the union of the old GNU fileutils, sh-utils, and
textutils packages.
These tools are the GNU versions of common useful and popular
file & text utilities which are used for:
- file management
- shell scripts
- modifying text file (spliting, joining, comparing, modifying, ...)
Most of these programs have significant advantages over their Unix
counterparts, such as greater speed, additional options, and fewer
arbitrary limits.
%package doc
Summary: Coreutils documentation in info format
Group: Books/Computer books
Requires: coreutils >= 4.5.4-2mdk
BuildArch: noarch
%description doc
This package contains coreutils documentation in GNU info format.
%prep
%setup -q
# fileutils
# (tpg) seems to be fixed
#%patch101 -p1 -b .space~
%patch1155 -p1 -b .override~
%patch118 -p1 -b .lsh~
# textutils
%patch500 -p1
# sh-utils
%patch703 -p1 -b .dateman~
%patch704 -p1 -b .paths~
%patch706 -p1 -b .pam~
%patch713 -p1 -b .langinfo~
# li18nux/lsb
%patch800 -p1 -b .i18n~
%patch909 -p1 -b .64bit~
%patch911 -p1 -b .groups~
%patch1011 -p1 -b .colors_mdkconf~
%patch1014 -p1 -b .str_fmt~
%patch2101 -p1 -b .manpages~
%patch2102 -p1 -b .tcsadrain~
%patch2103 -p1 -b .sysinfo~
# (tpg) not needed for now
#%patch2104 -p1 -b .dfdirect~
%ifnarch %arm
%patch2105 -p1 -b .sparc~
%endif
%patch2900 -p1 -b .setsid~
%patch2907 -p1 -b .runuser~
%patch2908 -p1 -b .getgrouplist~
%patch2912 -p1 -b .overflow~
%patch2917 -p1 -b .pie~
chmod a+x tests/misc/sort-mb-tests tests/misc/id-context
chmod +w ./src/dircolors.h
./src/dcgen ./src/dircolors.hin > ./src/dircolors.h
export DEFAULT_POSIX2_VERSION=199209
aclocal -I m4
automake --gnits --add-missing
autoconf
bzip2 -9 ChangeLog
%build
export CFLAGS="%{optflags} -fPIC -D_GNU_SOURCE=1"
%configure2_5x \
--enable-largefile \
--enable-pam \
--enable-install-program=su \
--enable-no-install-program=arch,hostname,uptime,kill \
--without-selinux \
--disable-rpath \
--disable-silent-rules
%make
%check
#(proyvind): check suite randomly fails on build hosts, unable to reproduce
# locally, so just disable for now.. :(
#%make check
%install
%makeinstall_std
# man pages are not installed with make install
make mandir=%{buildroot}%{_mandir} install-man
# let be compatible with old fileutils, sh-utils and textutils packages :
mkdir -p %{buildroot}{/bin,%{_bindir},%{_sbindir},%{_sysconfdir}/pam.d}
for f in basename cat chgrp chmod chown cp cut date dd df echo env expr false id link ln ls mkdir mknod mktemp mv nice pwd rm rmdir sleep sort stat stty sync touch true uname unlink tac
do
mv %{buildroot}/{%{_bindir},bin}/$f
done
# chroot was in /usr/sbin :
mv %{buildroot}/{%{_bindir},%{_sbindir}}/chroot
# {cat,sort,cut} were previously moved from bin to /usr/bin and linked into
for f in cut env expr tac; do
ln -s /bin/$f %{buildroot}%{_bindir}/$f
done
install -m644 src/dircolors.hin -D %{buildroot}%{_sysconfdir}/DIR_COLORS
# su
install -m 4755 src/su %{buildroot}/bin
install -m 644 %{SOURCE200} %{buildroot}%{_sysconfdir}/pam.d/su
install -m 644 %{SOURCE202} %{buildroot}%{_sysconfdir}/pam.d/su-l
#TV# find_lang look for LC_MESSAGES, not LC_TIME:
find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs rm -f
%find_lang %{name}
%files -f %{name}.lang
%config(noreplace) %{_sysconfdir}/D*
%config(noreplace) %{_sysconfdir}/pam.d/su
%config(noreplace) %{_sysconfdir}/pam.d/su-l
%doc README
/bin/*
%{_bindir}/*
%{_sbindir}/chroot
%dir %{_libdir}/coreutils
%{_libdir}/coreutils/libstdbuf.so
%files doc
%doc ABOUT-NLS ChangeLog.bz2 NEWS THANKS TODO
%{_infodir}/coreutils*
%{_mandir}/man*/*
%changelog
* Sun May 13 2012 Bernhard Rosenkraenzer <bero@bero.eu> 8.17-1
+ Revision: 798678
- Update to 8.17
* Tue Mar 27 2012 Bernhard Rosenkraenzer <bero@bero.eu> 8.16-1
+ Revision: 787345
- Update to 8.16
+ Matthew Dawkins <mattydaw@mandriva.org>
- rebuild for new internal dependency generator
* Wed Jan 25 2012 Antoine Ginies <aginies@mandriva.com> 8.15-1
+ Revision: 768322
- update to version 8.15
update some patch
* Sun Nov 27 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.14-2
+ Revision: 734461
- add a suggests on coreutils-doc
* Fri Oct 21 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.14-1
+ Revision: 705614
- remove ancient versioned conflicts on tetex
- sync multibyte patch with Fedora to pull in some additional fixes (P800)
- remove patch for adding back blinking colors on broken symlinks (P1013, fixed)
- clean out some legacy rpm stuff
- new version (with a bunch of patches resynced;)
- add a manual provides on /usr/bin/tr to satisfy scriptlet dependency
- use %%rename macro for mktemp
* Sun Jun 19 2011 Tomasz Pawel Gajc <tpg@mandriva.org> 8.12-1
+ Revision: 686061
- update to new version 8.12
* Wed Apr 20 2011 Tomasz Pawel Gajc <tpg@mandriva.org> 8.11-1
+ Revision: 656350
- update to new version 8.11
- disable patches 101 and 2104
- update to new version 8.10
- update patch 800
+ Per Øyvind Karlsen <peroyvind@mandriva.org>
- add '.gem' suffix with same color as other arhives with 'ls'
* Tue Jan 18 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.9-2
+ Revision: 631565
- remove unnecessary buildrequires on locales-*
- remove dependency on pam causing dependency loop
- add back LC_TIME workaround for %%find_lang for now as it breaks upgrades..
* Sun Jan 09 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.9-1mdv2011.0
+ Revision: 630708
- let %%find_lang take care of LC_TIME locale symlinks now
- new release: 8.9
* Wed Dec 29 2010 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.8-1mdv2011.0
+ Revision: 625742
- license is actually GPLv3+, not GPLv3.. ;p
- drop old patches
- don't install kill(1), it's provided by util-linux
- create all symlinks from /bin/ to /usr/bin in one and same loop
- drop no longer required fix for japanese catalog file
- be sure to own %%{_libdir}/coreutils directory
- fix check that fails to compile with -Werror=format-security (P1014)
- use included help2man
- sync patches with coreutils-8.8-1 from fedora
- sh-utils, fileutils & textutils merge with corresponding provides/obsoletes
dates back to 2002, so we can prolly' safely drop these now... ;)
- new release: 8.8
- pass '--disable-silent-rules' to configure, build output is nice for build logs
- configure not to install 'hostname' & 'uptime' in %%build, rather than removing
those in %%install
- do autofoo in %%prep
- remove perl regexp on texinfo page for wtmp path, now giving duplicate..
- compress ChangeLog in %%prep and drop shipping ancient changelogs
- explicitly build without selinux support
- obsolete/provide mktemp
* Tue Nov 16 2010 Bogdano Arendartchuk <bogdano@mandriva.com> 8.7-3mdv2011.0
+ Revision: 598126
- replacing ealier release uploaded manually
+ Andrey Borzenkov <arvidjaar@mandriva.org>
- source202: su -l PAM config (fedora)
* Tue Nov 16 2010 Funda Wang <fwang@mandriva.org> 8.7-1mdv2011.0
+ Revision: 598011
- new version 8.7
+ Tomasz Pawel Gajc <tpg@mandriva.org>
- update to new version 8.6
- update patches 706 and 800 (from Fedora)
* Tue Aug 31 2010 Thierry Vignaud <tv@mandriva.org> 8.5-2mdv2011.0
+ Revision: 574911
- let the doc subpackage be noarch
* Thu Apr 29 2010 Funda Wang <fwang@mandriva.org> 8.5-1mdv2010.1
+ Revision: 540892
- New version 8.5
* Tue Feb 09 2010 Funda Wang <fwang@mandriva.org> 8.4-2mdv2010.1
+ Revision: 502813
- rebuild for new gmp
* Thu Jan 14 2010 Funda Wang <fwang@mandriva.org> 8.4-1mdv2010.1
+ Revision: 491125
- add several BRs for locales
- new version 8.4
* Mon Jan 11 2010 Funda Wang <fwang@mandriva.org> 8.3-1mdv2010.1
+ Revision: 489498
- no tests needed to be disabled
- rediff i18n patch
- rediff some patches
- New version 8.3
* Sun Jan 03 2010 Funda Wang <fwang@mandriva.org> 8.2-1mdv2010.1
+ Revision: 485787
- disable utimens too
- disable tests which introduce assertion (unknown reason)
- disable format check in check section
- rediff spacedir patch
- New version 8.2
- drop touch_errno patch (don't know where it comes and does not apply)
- renew uname patch with fedora one
- rediff patches
* Fri Oct 16 2009 Frederic Crozat <fcrozat@mandriva.com> 7.5-2mdv2010.0
+ Revision: 457931
- Move tac to /bin, needed for latest initscripts
* Sun Aug 23 2009 Tomasz Pawel Gajc <tpg@mandriva.org> 7.5-1mdv2010.0
+ Revision: 419994
- add missing buildrequires on strace, bison, flex, libcap-devel and libgmp-devel
- spec file clean
- rediff patches 800, 1011 and 1013
- disable rpath
- fix license
- package libstdbuf.so
+ Nicolas Lécureuil <nlecureuil@mandriva.com>
- Add su manpage (Bug #51699)
* Mon Jul 20 2009 Guillaume Rousse <guillomovitch@mandriva.org> 7.4-2mdv2010.0
+ Revision: 398210
- re-activate utimensat, now the xen kernel is uptodate
* Tue May 19 2009 Guillaume Rousse <guillomovitch@mandriva.org> 7.4-1mdv2010.0
+ Revision: 377815
- new version
+ Thierry Vignaud <tv@mandriva.org>
- new version
* Sat May 02 2009 Funda Wang <fwang@mandriva.org> 7.2-1mdv2010.0
+ Revision: 370446
- New version 7.2
* Thu Mar 05 2009 Frederic Crozat <fcrozat@mandriva.com> 7.1-2mdv2009.1
+ Revision: 349061
- Add explicit provides for /bin/env and /usr/bin/env
* Thu Feb 26 2009 Per Øyvind Karlsen <peroyvind@mandriva.org> 7.1-1mdv2009.1
+ Revision: 345271
- add versioned buildrequires on tar & automake for xz support
- new release: 7.1
- rediff a lot of patches..
- fix typo
- update DIR_COLORS patch with new .xz format added
+ Tomasz Pawel Gajc <tpg@mandriva.org>
- rebuild for python-2.6
* Sun Dec 21 2008 Oden Eriksson <oeriksson@mandriva.com> 6.12-4mdv2009.1
+ Revision: 316959
- rediffed some fuzzy patches
* Tue Nov 11 2008 Gustavo De Nardin <gustavodn@mandriva.com> 6.12-3mdv2009.1
+ Revision: 302337
- cripple coreutils to not use utimensat() syscall, available since kernel
2.6.22, for Xen kernel compatibility (#45606)
+ Thierry Vignaud <tv@mandriva.org>
- remove tool list from description
* Tue Jun 24 2008 Luiz Fernando Capitulino <lcapitulino@mandriva.com> 6.12-2mdv2009.0
+ Revision: 228635
- Fix wrong allocation size
The line which allocates szStrings is allocating only
three bytes instead of the space required for three
char pointers.
Bug reproducible by doing 'uname -p'.
* Mon Jun 16 2008 Funda Wang <fwang@mandriva.org> 6.12-1mdv2009.0
+ Revision: 219518
- fix problematic cut test case
- chmod at prep section
- New version 6.12
- sync i18n patch with fedora
* Thu May 01 2008 Funda Wang <fwang@mandriva.org> 6.11-1mdv2009.0
+ Revision: 199891
- rediff groupfix patch
- rediff i18n and pam patch
- rediff patch703
- New version 6.11
* Fri Mar 07 2008 Andreas Hasenack <andreas@mandriva.com> 6.10-4mdv2008.1
+ Revision: 181646
- drop specific versioned requires of automake
- fix "id" can't fetch group name (#38577)
* Tue Jan 29 2008 Funda Wang <fwang@mandriva.org> 6.10-3mdv2008.1
+ Revision: 159680
- fix requirment on info-install
* Sun Jan 27 2008 Funda Wang <fwang@mandriva.org> 6.10-2mdv2008.1
+ Revision: 158552
- update binary list
* Sat Jan 26 2008 Funda Wang <fwang@mandriva.org> 6.10-1mdv2008.1
+ Revision: 158248
- Update i18n patch with fedora one
- rediff uname patch
- rediff pam patch
- New version 6.10
- drop patches merged upstream
* Fri Jan 11 2008 Thierry Vignaud <tv@mandriva.org> 6.9-6mdv2008.1
+ Revision: 149129
- rebuild
- kill re-definition of %%buildroot on Pixel's request
+ Olivier Blin <blino@mandriva.org>
- restore BuildRoot
+ Arnaud Patard <apatard@mandriva.com>
- Use proper way to change CFLAGS in the spec file.
(aka dd if=/dev/zero bs=1M count=300 | time -p sum -s bug fix).
* Thu Sep 06 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 6.9-5mdv2008.0
+ Revision: 81114
- disable coloring for text documents
* Sun Aug 26 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 6.9-4mdv2008.0
+ Revision: 71568
- give black background for white text for documents in case of using
terminal with white background (updates P1011, fixes #32827)
- add some more files to doc coloring (updates P1011)
* Thu Aug 23 2007 Thierry Vignaud <tv@mandriva.org> 6.9-3mdv2008.0
+ Revision: 69360
- kill file require on info-install
+ Per Øyvind Karlsen <peroyvind@mandriva.org>
- add coloring for .wma & *rc (updates P1011)
- add even more formats (updates P1011, I have no life:p)
- drop lzma patch (P1010) and rather merge with generic dircolors patch (P1011)
- add some more formats (updates P1011)
- regenerate dircolors.h with dcgen in stead of patch
- add coloring for backup files (updates P1011)
- drop junk and be sure not to remove copyright notice in dircolors.hin (updates P1011)
- add white color for document formats (updates P1011)
- add a few more formats (updates P1011)
- update P1011 with coloring for .flv (flash video)
* Sat Jul 14 2007 Funda Wang <fwang@mandriva.org> 6.9-2mdv2008.0
+ Revision: 51981
- Add fedora patch to build against glibc 2.6
- Update program list
- Obsoletes base64
+ Per Øyvind Karlsen <peroyvind@mandriva.org>
- add back always blinking colors for broken symlinks (P1013)
- fix P1011 as it reverted P1010 and lzma coloring
* Thu Jul 12 2007 Funda Wang <fwang@mandriva.org> 6.9-1mdv2008.0
+ Revision: 51465
- Enable test scripts
- Remove old acl patches
- rediff patch 1011
- Rediff patch 1010.
- Add patch1012: From fedora, fix ls -x
- Rediff patch800: from fedora
- Rediff patch706: from Fedora.
- Rediff patch1155
- remove patch107: obsoletes by upstream code
- Remove patch102: sparc detection not there
- Remove patch0: lg.po not there
- New upstream version
* Wed Jul 11 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 5.97-8mdv2008.0
+ Revision: 51341
- drop S101 & S102 and rather merge with dircolors.hin in package as well as add few types (P1011)
- add lzma coloring support for ls (P1010, might need some more work?)
- change to and fix usage of new automake 1.10
- fix inclusion of locale files
* Mon May 28 2007 Ademar de Souza Reis Jr <ademar@mandriva.com.br> 5.97-7mdv2008.0
+ Revision: 32177
+ rebuild (emptylog)
* Mon May 28 2007 Ademar de Souza Reis Jr <ademar@mandriva.com.br> 5.97-6mdv2008.0
+ Revision: 32036
- fix -doc description
- remove redundant build-requirement of acl-devel
+ Anssi Hannula <anssi@mandriva.org>
- fix URL
* Tue Feb 20 2007 Thierry Vignaud <tvignaud@mandriva.com> 5.97-6mdv2007.0
+ Revision: 123126
- bump release (#28834)
+ Per Øyvind Karlsen <pkarlsen@mandriva.com>
- reintroduce interactive override (-if) and rather fix check (P1155, real fix for #16209)
+ Olivier Blin <oblin@mandriva.com>
- explicitely run autotools (or else configure is run two times), we need them for pam/i18n/acl/xattr/hname
* Fri Oct 20 2006 Olivier Blin <oblin@mandriva.com> 5.97-4mdv2007.1
+ Revision: 71290
- rebuild for su to be linked with pam (#26353 and #26527)
- Import coreutils
* Thu Aug 31 2006 Thierry Vignaud <tvignaud@mandriva.com> 5.97-3mdv2007.0
- kill patch 1155 thus the testsuite works again (#16209)
[warning: this means cp -i -f behaves like cp -i, no more like cp -f]
- update & reenable patch 1001-1004 from suse (ACL+xattr support)
* Thu Aug 31 2006 Thierry Vignaud <tvignaud@mandriva.com> 5.97-1mdv2007.0
- new release
- update patches 800 & 1001 from rh
- rediff patches 101, 105, 111, 114, 1115, 703 & 1003
- kill patches 108, 112, 116, 117, 153, 908, 2000 (merged upstream)
- kill patch 2001 (no more needed)
- kill patch 105 (unstandard option)
- drop patches 111 (deprecated rh patch introduced in fileutils-4.1.1-1mdk),
114 (likewise, 4.1) 115 (likewise, 4.1.5-1mdk), 710, 901 (no more needed),
1002 (merged in 1001)
- source 200: sync with fedora
- disable patch 104 (it's time to catch offenders) and 1003 (broken)
- fix build
* Thu Aug 31 2006 Thierry Vignaud <tvignaud@mandriva.com> 5.2.1-11mdv2007.0
- patch 2000: update zh translation (#17302)
- patch 2001: fix build
- fix macro-in-%%changelog
* Sat May 13 2006 Stefan van der Eijk <stefan@eijk.nu> 5.2.1-10mdk
- rebuild for sparc
* Mon Jan 30 2006 Olivier Blin <oblin@mandriva.com> 5.2.1-9mdk
- use "include" directive instead of deprecated pam_stack module
* Fri Aug 19 2005 Stew Benedict <sbenedict@mandriva.com> 5.2.1-8mdk
- redo LSB/i18n patch, join segfaults during LSB testing
when compiled with gcc4
* Fri Aug 12 2005 Leonardo Chiquitto Filho <chiquitto@mandriva.com> 5.2.1-7mdk
- patches 1001, 1002 1003: add support to posix acls and extended attributes
(#15050)
- patch 801: fix some typos in pt_BR.po file
* Fri Aug 12 2005 Nicolas Lécureuil <neoclust@mandriva.org> 5.2.1-6mdk
- fix rpmlint errors (PreReq)
* Thu Feb 10 2005 Thierry Vignaud <tvignaud@mandrakesoft.com> 5.2.1-5mdk
- move expr into /bin (#7052)
* Mon Jul 26 2004 Christiaan Welvaart <cjw@daneel.dyndns.org> 5.2.1-4mdk
- run automake for patch 111
* Fri Jun 25 2004 Thierry Vignaud <tvignaud@mandrakesoft.com> 5.2.1-3mdk
- simplify build
* Thu Jun 24 2004 Thierry Vignaud <tvignaud@mandrakesoft.com> 5.2.1-2mdk
- fix link with pam
- fix --short-circuit when %%build failled
- patch 910: show correct CPU name (Marcin Gondek, #7865)
(if it brokes anything, we'll revert)
- patch 111: fix ls build
* Fri Apr 02 2004 Thierry Vignaud <tvignaud@mandrakesoft.com> 5.2.1-1mdk
- new release
- remove patch 502, 906 (useless)

View file

@ -1,19 +0,0 @@
diff -Naurp coreutils-6.12/src/su.c coreutils-6.12.oden/src/su.c
--- coreutils-6.12/src/su.c 2008-05-26 08:40:33.000000000 +0200
+++ coreutils-6.12.oden/src/su.c 2008-12-21 16:09:29.000000000 +0100
@@ -112,6 +112,15 @@
# define DEFAULT_ROOT_LOGIN_PATH "/usr/ucb:/bin:/usr/bin:/etc"
#endif
+/* The default paths which get set are both bogus and oddly influenced
+ by <paths.h> and -D on the commands line. Just to be clear, we'll set
+ these explicitly. -ewt */
+#undef DEFAULT_LOGIN_PATH
+#undef DEFAULT_ROOT_LOGIN_PATH
+#define DEFAULT_LOGIN_PATH "/bin:/usr/bin:/usr/local/bin:/usr/bin/X11"
+#define DEFAULT_ROOT_LOGIN_PATH \
+ "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11"
+
/* The shell to run if none is given in the user's passwd entry. */
#define DEFAULT_SHELL "/bin/sh"

View file

@ -1,6 +0,0 @@
#%PAM-1.0
auth include su
account include su
password include su
session optional pam_keyinit.so force revoke
session include su

11
su.pamd
View file

@ -1,11 +0,0 @@
#%PAM-1.0
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth required pam_wheel.so use_uid
auth include system-auth
account include system-auth
password include system-auth
session optional pam_xauth.so
session include system-auth