From a4ae165425664a6d3b99f61bcb843e1d3d1826133403b738ee49d7c4a6729871 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 23 Feb 2009 11:44:46 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/coreutils?expand=0&rev=33 --- coreutils-5.3.0-i18n-0.1.patch | 304 ++++++++++---------- coreutils-6.12.tar.gz | 3 - coreutils-6.8-su.diff | 330 ++++++++++++++++++++-- coreutils-6.8.0-pie.diff | 180 +++++++++++- coreutils-6.12.diff => coreutils-7.1.diff | 65 +++-- coreutils-7.1.tar.xz | 3 + coreutils-changelog.diff | 44 --- coreutils-cifs-afs.diff | 57 ++-- coreutils-getaddrinfo.diff | 27 +- coreutils-xattr.diff | 308 -------------------- coreutils.changes | 50 ++++ coreutils.spec | 78 +++-- utimens.diff | 112 -------- 13 files changed, 823 insertions(+), 738 deletions(-) delete mode 100644 coreutils-6.12.tar.gz rename coreutils-6.12.diff => coreutils-7.1.diff (70%) create mode 100644 coreutils-7.1.tar.xz delete mode 100644 coreutils-changelog.diff delete mode 100644 coreutils-xattr.diff delete mode 100644 utimens.diff diff --git a/coreutils-5.3.0-i18n-0.1.patch b/coreutils-5.3.0-i18n-0.1.patch index 98a98c3..9b0febf 100644 --- a/coreutils-5.3.0-i18n-0.1.patch +++ b/coreutils-5.3.0-i18n-0.1.patch @@ -1,5 +1,5 @@ ---- coreutils-6.12/lib/linebuffer.h -+++ coreutils-6.12/lib/linebuffer.h +--- coreutils-7.1/lib/linebuffer.h ++++ coreutils-7.1/lib/linebuffer.h @@ -21,6 +21,11 @@ # include @@ -22,8 +22,8 @@ }; /* Initialize linebuffer LINEBUFFER for use. */ ---- coreutils-6.12/src/cut.c -+++ coreutils-6.12/src/cut.c +--- coreutils-7.1/src/cut.c ++++ coreutils-7.1/src/cut.c @@ -28,6 +28,12 @@ #include #include @@ -129,7 +129,7 @@ (K <= MAX_RANGE_ENDPOINT and is_printable_field(K)) || (EOL_RANGE_START > 0 && K >= EOL_RANGE_START). */ static unsigned char *printable_field; -@@ -113,9 +175,12 @@ enum operating_mode +@@ -113,15 +175,25 @@ enum operating_mode { undefined_mode, @@ -143,7 +143,6 @@ /* Output the given delimeter-separated fields. */ field_mode }; -@@ -125,6 +190,13 @@ char *program_name; static enum operating_mode operating_mode; @@ -157,7 +156,7 @@ /* If true do not output lines containing no delimeter characters. Otherwise, all such lines are printed. This option is valid only with field mode. */ -@@ -136,6 +208,9 @@ static bool complement; +@@ -133,6 +205,9 @@ static bool complement; /* The delimeter character for field mode. */ static unsigned char delim; @@ -167,7 +166,7 @@ /* True if the --output-delimiter=STRING option was specified. */ static bool output_delimiter_specified; -@@ -209,7 +284,7 @@ Mandatory arguments to long options are +@@ -206,7 +281,7 @@ Mandatory arguments to long options are -f, --fields=LIST select only these fields; also print any line\n\ that contains no delimiter character, unless\n\ the -s option is specified\n\ @@ -176,7 +175,7 @@ "), stdout); fputs (_("\ --complement complement the set of selected bytes, characters\n\ -@@ -368,7 +443,7 @@ set_fields (const char *fieldstr) +@@ -365,7 +440,7 @@ set_fields (const char *fieldstr) in_digits = false; /* Starting a range. */ if (dash_found) @@ -185,7 +184,7 @@ dash_found = true; fieldstr++; -@@ -392,7 +467,9 @@ set_fields (const char *fieldstr) +@@ -389,7 +464,9 @@ set_fields (const char *fieldstr) if (!rhs_specified) { /* `n-'. From `initial' to end of line. */ @@ -196,7 +195,7 @@ field_found = true; } else -@@ -489,7 +566,7 @@ set_fields (const char *fieldstr) +@@ -486,7 +563,7 @@ set_fields (const char *fieldstr) fieldstr++; } else @@ -205,7 +204,7 @@ } max_range_endpoint = 0; -@@ -582,6 +659,81 @@ cut_bytes (FILE *stream) +@@ -579,6 +656,81 @@ cut_bytes (FILE *stream) } } @@ -287,7 +286,7 @@ /* Read from stream STREAM, printing to standard output any selected fields. */ static void -@@ -704,13 +856,190 @@ cut_fields (FILE *stream) +@@ -701,13 +853,190 @@ cut_fields (FILE *stream) } } @@ -481,7 +480,7 @@ } /* Process file FILE to standard output. -@@ -760,6 +1089,8 @@ main (int argc, char **argv) +@@ -757,6 +1086,8 @@ main (int argc, char **argv) bool ok; bool delim_specified = false; char *spec_list_string IF_LINT(= NULL); @@ -489,8 +488,8 @@ + size_t delimlen = 0; initialize_main (&argc, &argv); - program_name = argv[0]; -@@ -782,7 +1113,6 @@ main (int argc, char **argv) + set_program_name (argv[0]); +@@ -779,7 +1110,6 @@ main (int argc, char **argv) switch (optc) { case 'b': @@ -498,7 +497,7 @@ /* Build the byte list. */ if (operating_mode != undefined_mode) FATAL_ERROR (_("only one type of list may be specified")); -@@ -790,6 +1120,14 @@ main (int argc, char **argv) +@@ -787,6 +1117,14 @@ main (int argc, char **argv) spec_list_string = optarg; break; @@ -513,7 +512,7 @@ case 'f': /* Build the field list. */ if (operating_mode != undefined_mode) -@@ -801,9 +1139,32 @@ main (int argc, char **argv) +@@ -798,9 +1136,32 @@ main (int argc, char **argv) case 'd': /* New delimiter. */ /* Interpret -d '' to mean `use the NUL byte as the delimiter.' */ @@ -549,7 +548,7 @@ delim_specified = true; break; -@@ -817,6 +1178,7 @@ main (int argc, char **argv) +@@ -814,6 +1175,7 @@ main (int argc, char **argv) break; case 'n': @@ -557,7 +556,7 @@ break; case 's': -@@ -839,7 +1201,7 @@ main (int argc, char **argv) +@@ -836,7 +1198,7 @@ main (int argc, char **argv) if (operating_mode == undefined_mode) FATAL_ERROR (_("you must specify a list of bytes, characters, or fields")); @@ -566,7 +565,7 @@ FATAL_ERROR (_("an input delimiter may be specified only\ when operating on fields")); -@@ -866,15 +1228,34 @@ main (int argc, char **argv) +@@ -863,15 +1225,34 @@ main (int argc, char **argv) } if (!delim_specified) @@ -607,8 +606,8 @@ } if (optind == argc) ---- coreutils-6.12/src/expand.c -+++ coreutils-6.12/src/expand.c +--- coreutils-7.1/src/expand.c ++++ coreutils-7.1/src/expand.c @@ -37,11 +37,31 @@ #include #include @@ -641,7 +640,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "expand" -@@ -346,9 +366,12 @@ expand (void) +@@ -343,9 +363,12 @@ expand (void) } else { @@ -657,7 +656,7 @@ } convert &= convert_entire_line | !! isblank (c); -@@ -364,6 +387,165 @@ expand (void) +@@ -361,6 +384,165 @@ expand (void) } } @@ -823,7 +822,7 @@ int main (int argc, char **argv) { -@@ -428,7 +610,12 @@ main (int argc, char **argv) +@@ -425,7 +607,12 @@ main (int argc, char **argv) file_list = (optind < argc ? &argv[optind] : stdin_argv); @@ -837,8 +836,8 @@ if (have_read_stdin && fclose (stdin) != 0) error (EXIT_FAILURE, errno, "-"); ---- coreutils-6.12/src/fold.c -+++ coreutils-6.12/src/fold.c +--- coreutils-7.1/src/fold.c ++++ coreutils-7.1/src/fold.c @@ -22,6 +22,19 @@ #include #include @@ -859,7 +858,7 @@ #include "system.h" #include "error.h" #include "quote.h" -@@ -29,14 +42,57 @@ +@@ -29,11 +42,54 @@ #define TAB_WIDTH 8 @@ -908,16 +907,13 @@ + character_mode, +}; + - /* The name this program was run with. */ - char *program_name; - +/* The argument shows current mode. (Default: column_mode) */ +static enum operating_mode operating_mode; + /* If nonzero, try to break on whitespace. */ static bool break_spaces; -@@ -46,11 +102,17 @@ static bool count_bytes; +@@ -43,11 +99,17 @@ static bool count_bytes; /* If nonzero, at least one of the files we read was standard input. */ static bool have_read_stdin; @@ -936,7 +932,7 @@ {"spaces", no_argument, NULL, 's'}, {"width", required_argument, NULL, 'w'}, {GETOPT_HELP_OPTION_DECL}, -@@ -80,6 +142,7 @@ Mandatory arguments to long options are +@@ -77,6 +139,7 @@ Mandatory arguments to long options are "), stdout); fputs (_("\ -b, --bytes count bytes rather than columns\n\ @@ -944,7 +940,7 @@ -s, --spaces break at spaces\n\ -w, --width=WIDTH use WIDTH columns instead of 80\n\ "), stdout); -@@ -97,7 +160,7 @@ Mandatory arguments to long options are +@@ -94,7 +157,7 @@ Mandatory arguments to long options are static size_t adjust_column (size_t column, char c) { @@ -953,7 +949,7 @@ { if (c == '\b') { -@@ -116,14 +179,9 @@ adjust_column (size_t column, char c) +@@ -113,14 +176,9 @@ adjust_column (size_t column, char c) return column; } @@ -970,7 +966,7 @@ int c; size_t column = 0; /* Screen column where next char will go. */ size_t offset_out = 0; /* Index in `line_out' for next char. */ -@@ -131,20 +189,6 @@ fold_file (char const *filename, size_t +@@ -128,20 +186,6 @@ fold_file (char const *filename, size_t static size_t allocated_out = 0; int saved_errno; @@ -991,7 +987,7 @@ while ((c = getc (istream)) != EOF) { if (offset_out + 1 >= allocated_out) -@@ -222,6 +266,234 @@ fold_file (char const *filename, size_t +@@ -219,6 +263,234 @@ fold_file (char const *filename, size_t if (offset_out) fwrite (line_out, sizeof (char), (size_t) offset_out, stdout); @@ -1226,7 +1222,7 @@ if (ferror (istream)) { error (0, saved_errno, "%s", filename); -@@ -254,6 +526,10 @@ main (int argc, char **argv) +@@ -251,6 +523,10 @@ main (int argc, char **argv) atexit (close_stdout); @@ -1237,7 +1233,7 @@ break_spaces = count_bytes = have_read_stdin = false; while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1) -@@ -263,7 +539,15 @@ main (int argc, char **argv) +@@ -260,7 +536,15 @@ main (int argc, char **argv) switch (optc) { case 'b': /* Count bytes rather than columns. */ @@ -1254,8 +1250,8 @@ break; case 's': /* Break at word boundaries. */ ---- coreutils-6.12/src/join.c -+++ coreutils-6.12/src/join.c +--- coreutils-7.1/src/join.c ++++ coreutils-7.1/src/join.c @@ -22,6 +22,16 @@ #include #include @@ -1272,8 +1268,8 @@ + #include "system.h" #include "error.h" - #include "hard-locale.h" -@@ -33,6 +43,11 @@ + #include "linebuffer.h" +@@ -32,6 +42,11 @@ #include "xstrtol.h" #include "argmatch.h" @@ -1285,7 +1281,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "join" -@@ -113,10 +128,13 @@ static struct outlist outlist_head; +@@ -120,10 +135,13 @@ static struct outlist outlist_head; /* Last element in `outlist', where a new element can be added. */ static struct outlist *outlist_end = &outlist_head; @@ -1301,7 +1297,7 @@ /* If nonzero, check that the input is correctly ordered. */ static enum -@@ -230,10 +248,10 @@ xfields (struct line *line) +@@ -237,10 +255,10 @@ xfields (struct line *line) if (ptr == lim) return; @@ -1314,7 +1310,7 @@ extract_field (line, ptr, sep - ptr); } else -@@ -305,56 +323,115 @@ keycmp (struct line const *line1, struct +@@ -285,56 +303,115 @@ keycmp (struct line const *line1, struct size_t jf_1, size_t jf_2) { /* Start of field to compare in each file. */ @@ -1452,8 +1448,8 @@ } /* Check that successive input lines PREV and CURRENT from input file -@@ -393,6 +470,133 @@ check_order (const struct line *prev, - } +@@ -388,6 +465,133 @@ init_linep (struct line **linep) + return line; } +#if HAVE_MBRTOWC @@ -1586,12 +1582,11 @@ /* Read a line from FP into LINE and split it into fields. Return true if successful. */ -@@ -413,7 +617,13 @@ get_line (FILE *fp, struct line *line, i - line->nfields_allocated = 0; - line->nfields = 0; - line->fields = NULL; +@@ -415,7 +619,12 @@ get_line (FILE *fp, struct line **linep, + return false; + } + - xfields (line); -+ +#if HAVE_MBRTOWC + if (MB_CUR_MAX > 1) + xfields_multibyte (line); @@ -1600,8 +1595,8 @@ + xfields (line); if (prevline[which - 1]) - { -@@ -513,7 +723,8 @@ static void + check_order (prevline[which - 1], line, which); +@@ -520,7 +729,8 @@ static void prjoin (struct line const *line1, struct line const *line2) { const struct outlist *outlist; @@ -1611,7 +1606,7 @@ outlist = outlist_head.next; if (outlist) -@@ -548,7 +759,7 @@ prjoin (struct line const *line1, struct +@@ -555,7 +765,7 @@ prjoin (struct line const *line1, struct o = o->next; if (o == NULL) break; @@ -1620,7 +1615,7 @@ } putchar ('\n'); } -@@ -566,23 +777,23 @@ prjoin (struct line const *line1, struct +@@ -573,23 +783,23 @@ prjoin (struct line const *line1, struct prfield (join_field_1, line1); for (i = 0; i < join_field_1 && i < line1->nfields; ++i) { @@ -1648,7 +1643,7 @@ prfield (i, line2); } putchar ('\n'); -@@ -1016,20 +1227,40 @@ main (int argc, char **argv) +@@ -1020,20 +1230,40 @@ main (int argc, char **argv) case 't': { @@ -1694,8 +1689,8 @@ } break; ---- coreutils-6.12/src/pr.c -+++ coreutils-6.12/src/pr.c +--- coreutils-7.1/src/pr.c ++++ coreutils-7.1/src/pr.c @@ -312,6 +312,32 @@ #include @@ -1728,8 +1723,8 @@ + #include "system.h" #include "error.h" - #include "hard-locale.h" -@@ -322,6 +348,18 @@ + #include "mbswidth.h" +@@ -321,6 +347,18 @@ #include "strftime.h" #include "xstrtol.h" @@ -1748,7 +1743,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "pr" -@@ -415,8 +453,21 @@ struct COLUMN +@@ -414,8 +452,21 @@ struct COLUMN typedef struct COLUMN COLUMN; #define NULLCOL (COLUMN *)0 @@ -1771,7 +1766,7 @@ static bool read_line (COLUMN *p); static bool print_page (void); static bool print_stored (COLUMN *p); -@@ -426,6 +477,7 @@ static void print_header (void); +@@ -425,6 +476,7 @@ static void print_header (void); static void pad_across_to (int position); static void add_line_number (COLUMN *p); static void getoptarg (char *arg, char switch_char, char *character, @@ -1779,7 +1774,7 @@ int *number); void usage (int status); static void print_files (int number_of_files, char **av); -@@ -440,7 +492,6 @@ static void store_char (char c); +@@ -439,7 +491,6 @@ static void store_char (char c); static void pad_down (int lines); static void read_rest_of_line (COLUMN *p); static void skip_read (COLUMN *p, int column_number); @@ -1787,7 +1782,7 @@ static void cleanup (void); static void print_sep_string (void); static void separator_string (const char *optarg_S); -@@ -455,7 +506,7 @@ static COLUMN *column_vector; +@@ -451,7 +502,7 @@ static COLUMN *column_vector; we store the leftmost columns contiguously in buff. To print a line from buff, get the index of the first character from line_vector[i], and print up to line_vector[i + 1]. */ @@ -1796,7 +1791,7 @@ /* Index of the position in buff where the next character will be stored. */ -@@ -559,7 +610,7 @@ static int chars_per_column; +@@ -555,7 +606,7 @@ static int chars_per_column; static bool untabify_input = false; /* (-e) The input tab character. */ @@ -1805,7 +1800,7 @@ /* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ... where the leftmost column is 1. */ -@@ -569,7 +620,10 @@ static int chars_per_input_tab = 8; +@@ -565,7 +616,10 @@ static int chars_per_input_tab = 8; static bool tabify_output = false; /* (-i) The output tab character. */ @@ -1817,7 +1812,7 @@ /* (-i) The width of the output tab. */ static int chars_per_output_tab = 8; -@@ -643,7 +697,13 @@ static int power_10; +@@ -639,7 +693,13 @@ static int power_10; static bool numbered_lines = false; /* (-n) Character which follows each line number. */ @@ -1832,15 +1827,15 @@ /* (-n) line counting starts with 1st line of input file (not with 1st line of 1st page printed). */ -@@ -696,6 +756,7 @@ static bool use_col_separator = false; +@@ -692,6 +752,7 @@ static bool use_col_separator = false; -a|COLUMN|-m is a `space' and with the -J option a `tab'. */ - static char *col_sep_string = ""; + static char *col_sep_string = (char *) ""; static int col_sep_length = 0; +static int col_sep_width = 0; - static char *column_separator = " "; - static char *line_separator = "\t"; + static char *column_separator = (char *) " "; + static char *line_separator = (char *) "\t"; -@@ -852,6 +913,13 @@ separator_string (const char *optarg_S) +@@ -848,6 +909,13 @@ separator_string (const char *optarg_S) col_sep_length = (int) strlen (optarg_S); col_sep_string = xmalloc (col_sep_length + 1); strcpy (col_sep_string, optarg_S); @@ -1854,7 +1849,7 @@ } int -@@ -876,6 +944,21 @@ main (int argc, char **argv) +@@ -872,6 +940,21 @@ main (int argc, char **argv) atexit (close_stdout); @@ -1876,7 +1871,7 @@ n_files = 0; file_names = (argc > 1 ? xmalloc ((argc - 1) * sizeof (char *)) -@@ -952,8 +1035,12 @@ main (int argc, char **argv) +@@ -948,8 +1031,12 @@ main (int argc, char **argv) break; case 'e': if (optarg) @@ -1891,7 +1886,7 @@ /* Could check tab width > 0. */ untabify_input = true; break; -@@ -966,8 +1053,12 @@ main (int argc, char **argv) +@@ -962,8 +1049,12 @@ main (int argc, char **argv) break; case 'i': if (optarg) @@ -1906,7 +1901,7 @@ /* Could check tab width > 0. */ tabify_output = true; break; -@@ -994,8 +1085,8 @@ main (int argc, char **argv) +@@ -990,8 +1081,8 @@ main (int argc, char **argv) case 'n': numbered_lines = true; if (optarg) @@ -1917,16 +1912,15 @@ break; case 'N': skip_count = false; -@@ -1034,7 +1125,7 @@ main (int argc, char **argv) - old_s = false; +@@ -1031,6 +1122,7 @@ main (int argc, char **argv) /* Reset an additional input of -s, -S dominates -s */ - col_sep_string = ""; -- col_sep_length = 0; -+ col_sep_length = col_sep_width = 0; + col_sep_string = bad_cast (""); + col_sep_length = 0; ++ col_sep_width = 0; use_col_separator = true; if (optarg) separator_string (optarg); -@@ -1191,10 +1282,45 @@ main (int argc, char **argv) +@@ -1187,10 +1279,45 @@ main (int argc, char **argv) a number. */ static void @@ -1974,7 +1968,7 @@ if (*arg) { long int tmp_long; -@@ -1253,7 +1379,7 @@ init_parameters (int number_of_files) +@@ -1249,7 +1376,7 @@ init_parameters (int number_of_files) else col_sep_string = column_separator; @@ -1983,7 +1977,7 @@ use_col_separator = true; } /* It's rather pointless to define a TAB separator with column -@@ -1284,11 +1410,11 @@ init_parameters (int number_of_files) +@@ -1280,11 +1407,11 @@ init_parameters (int number_of_files) TAB_WIDTH (chars_per_input_tab, chars_per_number); */ /* Estimate chars_per_text without any margin and keep it constant. */ @@ -1997,7 +1991,7 @@ /* The number is part of the column width unless we are printing files in parallel. */ -@@ -1303,7 +1429,7 @@ init_parameters (int number_of_files) +@@ -1299,7 +1426,7 @@ init_parameters (int number_of_files) } chars_per_column = (chars_per_line - chars_used_by_number - @@ -2006,7 +2000,7 @@ if (chars_per_column < 1) error (EXIT_FAILURE, 0, _("page width too narrow")); -@@ -1428,7 +1554,7 @@ init_funcs (void) +@@ -1424,7 +1551,7 @@ init_funcs (void) /* Enlarge p->start_position of first column to use the same form of padding_not_printed with all columns. */ @@ -2015,7 +2009,7 @@ /* This loop takes care of all but the rightmost column. */ -@@ -1462,7 +1588,7 @@ init_funcs (void) +@@ -1458,7 +1585,7 @@ init_funcs (void) } else { @@ -2024,7 +2018,7 @@ h_next = h + chars_per_column; } } -@@ -1752,9 +1878,9 @@ static void +@@ -1748,9 +1875,9 @@ static void align_column (COLUMN *p) { padding_not_printed = p->start_position; @@ -2036,7 +2030,7 @@ padding_not_printed = ANYWHERE; } -@@ -2025,13 +2151,13 @@ store_char (char c) +@@ -2021,13 +2148,13 @@ store_char (char c) /* May be too generous. */ buff = X2REALLOC (buff, &buff_allocated); } @@ -2052,7 +2046,7 @@ char *s; int left_cut; -@@ -2054,22 +2180,24 @@ add_line_number (COLUMN *p) +@@ -2050,22 +2177,24 @@ add_line_number (COLUMN *p) /* Tabification is assumed for multiple columns, also for n-separators, but `default n-separator = TAB' hasn't been given priority over equal column_width also specified by POSIX. */ @@ -2081,7 +2075,7 @@ output_position = POS_AFTER_TAB (chars_per_output_tab, output_position); } -@@ -2230,7 +2358,7 @@ print_white_space (void) +@@ -2226,7 +2355,7 @@ print_white_space (void) while (goal - h_old > 1 && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal) { @@ -2090,7 +2084,7 @@ h_old = h_new; } while (++h_old <= goal) -@@ -2250,6 +2378,7 @@ print_sep_string (void) +@@ -2246,6 +2375,7 @@ print_sep_string (void) { char *s; int l = col_sep_length; @@ -2098,7 +2092,7 @@ s = col_sep_string; -@@ -2263,6 +2392,7 @@ print_sep_string (void) +@@ -2259,6 +2389,7 @@ print_sep_string (void) { for (; separators_not_printed > 0; --separators_not_printed) { @@ -2106,7 +2100,7 @@ while (l-- > 0) { /* 3 types of sep_strings: spaces only, spaces and chars, -@@ -2276,12 +2406,15 @@ print_sep_string (void) +@@ -2272,12 +2403,15 @@ print_sep_string (void) } else { @@ -2123,7 +2117,7 @@ /* sep_string ends with some spaces */ if (spaces_not_printed > 0) print_white_space (); -@@ -2308,8 +2441,9 @@ print_clump (COLUMN *p, int n, char *clu +@@ -2304,8 +2438,9 @@ print_clump (COLUMN *p, int n, char *clu a nonspace is encountered, call print_white_space() to print the required number of tabs and spaces. */ @@ -2134,7 +2128,7 @@ { if (tabify_output) { -@@ -2333,6 +2467,75 @@ print_char (char c) +@@ -2329,6 +2464,75 @@ print_char (char c) putchar (c); } @@ -2210,7 +2204,7 @@ /* Skip to page PAGE before printing. PAGE may be larger than total number of pages. */ -@@ -2510,9 +2713,9 @@ read_line (COLUMN *p) +@@ -2506,9 +2710,9 @@ read_line (COLUMN *p) align_empty_cols = false; } @@ -2222,7 +2216,7 @@ padding_not_printed = ANYWHERE; } -@@ -2613,9 +2816,9 @@ print_stored (COLUMN *p) +@@ -2609,9 +2813,9 @@ print_stored (COLUMN *p) } } @@ -2234,7 +2228,7 @@ padding_not_printed = ANYWHERE; } -@@ -2628,8 +2831,8 @@ print_stored (COLUMN *p) +@@ -2624,8 +2828,8 @@ print_stored (COLUMN *p) if (spaces_not_printed == 0) { output_position = p->start_position + end_vector[line]; @@ -2245,7 +2239,7 @@ } return true; -@@ -2647,8 +2850,9 @@ print_stored (COLUMN *p) +@@ -2643,8 +2847,9 @@ print_stored (COLUMN *p) characters in clump_buff. (e.g, the width of '\b' is -1, while the number of characters is 1.) */ @@ -2256,7 +2250,7 @@ { unsigned char uc = c; char *s = clump_buff; -@@ -2658,10 +2862,10 @@ char_to_clump (char c) +@@ -2654,10 +2859,10 @@ char_to_clump (char c) int chars; int chars_per_c = 8; @@ -2269,7 +2263,7 @@ { width = TAB_WIDTH (chars_per_c, input_position); -@@ -2742,6 +2946,155 @@ char_to_clump (char c) +@@ -2738,6 +2943,155 @@ char_to_clump (char c) return chars; } @@ -2425,8 +2419,8 @@ /* We've just printed some files and need to clean up things before looking for more options and printing the next batch of files. ---- coreutils-6.12/src/sort.c -+++ coreutils-6.12/src/sort.c +--- coreutils-7.1/src/sort.c ++++ coreutils-7.1/src/sort.c @@ -26,6 +26,19 @@ #include #include @@ -2447,7 +2441,7 @@ #include "system.h" #include "argmatch.h" #include "error.h" -@@ -52,6 +65,17 @@ struct rlimit { size_t rlim_cur; }; +@@ -53,6 +66,17 @@ struct rlimit { size_t rlim_cur; }; # define getrlimit(Resource, Rlp) (-1) #endif @@ -2465,7 +2459,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "sort" -@@ -117,14 +141,38 @@ static int decimal_point; +@@ -121,14 +145,38 @@ static int decimal_point; /* Thousands separator; if -1, then there isn't one. */ static int thousands_sep; @@ -2505,7 +2499,7 @@ /* The kind of blanks for '-b' to skip in various options. */ enum blanktype { bl_start, bl_end, bl_both }; -@@ -262,13 +310,11 @@ static bool reverse; +@@ -264,13 +312,11 @@ static bool reverse; they were read if all keys compare equal. */ static bool stable; @@ -2523,7 +2517,7 @@ /* Flag to remove consecutive duplicate lines from the output. Only the last of a sequence of equal lines will be output. */ -@@ -655,6 +701,43 @@ reap_some (void) +@@ -702,6 +748,43 @@ reap_some (void) update_proc (pid); } @@ -2567,7 +2561,7 @@ /* Clean up any remaining temporary files. */ static void -@@ -994,7 +1077,7 @@ zaptemp (const char *name) +@@ -1042,7 +1125,7 @@ zaptemp (const char *name) free (node); } @@ -2576,7 +2570,7 @@ static int struct_month_cmp (const void *m1, const void *m2) -@@ -1021,7 +1104,7 @@ inittables (void) +@@ -1069,7 +1152,7 @@ inittables (void) fold_toupper[i] = toupper (i); } @@ -2585,8 +2579,8 @@ /* If we're not in the "C" locale, read different names for months. */ if (hard_LC_TIME) { -@@ -1047,6 +1130,71 @@ inittables (void) - #endif +@@ -1151,6 +1234,71 @@ specify_nmerge (int oi, char c, char con + xstrtol_fatal (e, oi, c, long_options, s); } +#if HAVE_MBRTOWC @@ -2657,7 +2651,7 @@ /* Specify the amount of main memory to use when sorting. */ static void specify_sort_size (int oi, char c, char const *s) -@@ -1257,7 +1405,7 @@ buffer_linelim (struct buffer const *buf +@@ -1361,7 +1509,7 @@ buffer_linelim (struct buffer const *buf by KEY in LINE. */ static char * @@ -2666,7 +2660,7 @@ { char *ptr = line->text, *lim = ptr + line->length - 1; size_t sword = key->sword; -@@ -1267,10 +1415,10 @@ begfield (const struct line *line, const +@@ -1371,10 +1519,10 @@ begfield (const struct line *line, const /* The leading field separator itself is included in a field when -t is absent. */ @@ -2679,7 +2673,7 @@ ++ptr; if (ptr < lim) ++ptr; -@@ -1298,11 +1446,70 @@ begfield (const struct line *line, const +@@ -1402,11 +1550,70 @@ begfield (const struct line *line, const return ptr; } @@ -2751,7 +2745,7 @@ { char *ptr = line->text, *lim = ptr + line->length - 1; size_t eword = key->eword, echar = key->echar; -@@ -1315,10 +1522,10 @@ limfield (const struct line *line, const +@@ -1419,10 +1626,10 @@ limfield (const struct line *line, const `beginning' is the first character following the delimiting TAB. Otherwise, leave PTR pointing at the first `blank' character after the preceding field. */ @@ -2764,7 +2758,7 @@ ++ptr; if (ptr < lim && (eword | echar)) ++ptr; -@@ -1364,7 +1571,7 @@ limfield (const struct line *line, const +@@ -1468,7 +1675,7 @@ limfield (const struct line *line, const */ /* Make LIM point to the end of (one byte past) the current field. */ @@ -2773,7 +2767,7 @@ { char *newlim; newlim = memchr (ptr, tab, lim - ptr); -@@ -1400,6 +1607,107 @@ limfield (const struct line *line, const +@@ -1504,6 +1711,107 @@ limfield (const struct line *line, const return ptr; } @@ -2881,7 +2875,7 @@ /* 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 file wasn't terminated by a newline, supply one. Set up BUF's line -@@ -1482,8 +1790,22 @@ fillbuf (struct buffer *buf, FILE *fp, c +@@ -1586,8 +1894,22 @@ fillbuf (struct buffer *buf, FILE *fp, c else { if (key->skipsblanks) @@ -2906,7 +2900,7 @@ line->keybeg = line_start; } } -@@ -1538,15 +1860,59 @@ general_numcompare (const char *sa, cons +@@ -1642,15 +1964,59 @@ general_numcompare (const char *sa, cons /* FIXME: maybe add option to try expensive FP conversion only if A and B can't be compared more cheaply/accurately. */ @@ -2973,7 +2967,7 @@ return 1; /* Sort numbers in the usual way, where -0 == +0. Put NaNs after -@@ -1564,7 +1930,7 @@ general_numcompare (const char *sa, cons +@@ -1668,7 +2034,7 @@ general_numcompare (const char *sa, cons Return 0 if the name in S is not recognized. */ static int @@ -2982,7 +2976,7 @@ { size_t lo = 0; size_t hi = MONTHS_PER_YEAR; -@@ -1719,11 +2085,79 @@ compare_random (char *restrict texta, si +@@ -1849,11 +2215,79 @@ compare_version (char *restrict texta, s return diff; } @@ -3063,7 +3057,7 @@ { struct keyfield const *key = keylist; -@@ -1890,12 +2324,189 @@ keycompare (const struct line *a, const +@@ -2022,12 +2456,189 @@ keycompare (const struct line *a, const return 0; @@ -3255,7 +3249,7 @@ /* Compare two lines A and B, returning negative, zero, or positive depending on whether A compares less than, equal to, or greater than B. */ -@@ -2712,6 +3323,11 @@ set_ordering (const char *s, struct keyf +@@ -2857,6 +3468,11 @@ set_ordering (const char *s, struct keyf break; case 'M': key->month = true; @@ -3267,7 +3261,7 @@ break; case 'n': key->numeric = true; -@@ -2765,7 +3381,7 @@ main (int argc, char **argv) +@@ -2915,7 +3531,7 @@ main (int argc, char **argv) initialize_exit_failure (SORT_FAILURE); hard_LC_COLLATE = hard_locale (LC_COLLATE); @@ -3276,7 +3270,7 @@ hard_LC_TIME = hard_locale (LC_TIME); #endif -@@ -2778,14 +3394,40 @@ main (int argc, char **argv) +@@ -2928,14 +3544,40 @@ main (int argc, char **argv) add support for multibyte decimal points. */ decimal_point = to_uchar (locale->decimal_point[0]); if (! decimal_point || locale->decimal_point[1]) @@ -3319,7 +3313,7 @@ have_read_stdin = false; inittables (); -@@ -3037,13 +3679,32 @@ main (int argc, char **argv) +@@ -3196,13 +3838,32 @@ main (int argc, char **argv) case 't': { @@ -3356,7 +3350,7 @@ else { /* Provoke with `sort -txx'. Complain about -@@ -3054,9 +3715,12 @@ main (int argc, char **argv) +@@ -3213,9 +3874,12 @@ main (int argc, char **argv) quote (optarg)); } } @@ -3370,8 +3364,8 @@ } break; ---- coreutils-6.12/src/unexpand.c -+++ coreutils-6.12/src/unexpand.c +--- coreutils-7.1/src/unexpand.c ++++ coreutils-7.1/src/unexpand.c @@ -38,11 +38,34 @@ #include #include @@ -3407,7 +3401,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "unexpand" -@@ -452,6 +475,237 @@ unexpand (void) +@@ -449,6 +472,237 @@ unexpand (void) } } @@ -3645,7 +3639,7 @@ int main (int argc, char **argv) { -@@ -530,7 +784,12 @@ main (int argc, char **argv) +@@ -527,7 +781,12 @@ main (int argc, char **argv) file_list = (optind < argc ? &argv[optind] : stdin_argv); @@ -3659,8 +3653,8 @@ if (have_read_stdin && fclose (stdin) != 0) error (EXIT_FAILURE, errno, "-"); ---- coreutils-6.12/src/uniq.c -+++ coreutils-6.12/src/uniq.c +--- coreutils-7.1/src/uniq.c ++++ coreutils-7.1/src/uniq.c @@ -22,6 +22,16 @@ #include #include @@ -3678,7 +3672,7 @@ #include "system.h" #include "argmatch.h" #include "linebuffer.h" -@@ -33,6 +43,13 @@ +@@ -32,6 +42,13 @@ #include "xstrtol.h" #include "memcasecmp.h" @@ -3692,7 +3686,7 @@ /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "uniq" -@@ -110,6 +127,12 @@ static enum delimit_method const delimit +@@ -106,6 +123,12 @@ static enum delimit_method const delimit /* Select whether/how to delimit groups of duplicate lines. */ static enum delimit_method delimit_groups; @@ -3705,17 +3699,17 @@ static struct option const longopts[] = { {"count", no_argument, NULL, 'c'}, -@@ -206,7 +229,7 @@ size_opt (char const *opt, char const *m +@@ -202,7 +225,7 @@ size_opt (char const *opt, char const *m return a pointer to the beginning of the line's field to be compared. */ static char * --find_field (const struct linebuffer *line) -+find_field_uni (struct linebuffer *line) +-find_field (struct linebuffer const *line) ++find_field_uni (struct linebuffer const *line) { size_t count; - char *lp = line->buffer; -@@ -227,6 +250,83 @@ find_field (const struct linebuffer *lin - return lp + i; + char const *lp = line->buffer; +@@ -223,6 +246,83 @@ find_field (struct linebuffer const *lin + return line->buffer + i; } +#if HAVE_MBRTOWC @@ -3744,7 +3738,7 @@ + while (0) + +static char * -+find_field_multi (struct linebuffer *line) ++find_field_multi (struct linebuffer const *line) +{ + size_t count; + char *lp = line->buffer; @@ -3756,7 +3750,7 @@ + int convfail; + + pos = 0; -+ statep = &(line->state); ++ statep = &line->state; + + /* skip fields. */ + for (count = 0; count < skip_fields && pos < size; count++) @@ -3798,7 +3792,7 @@ /* Return false if two strings OLD and NEW match, true if not. OLD and NEW point not to the beginnings of the lines but rather to the beginnings of the fields to compare. -@@ -251,6 +351,73 @@ different (char *old, char *new, size_t +@@ -247,6 +347,73 @@ different (char *old, char *new, size_t return oldlen != newlen || memcmp (old, new, oldlen); } @@ -3872,7 +3866,7 @@ /* Output the line in linebuffer LINE to standard output provided that the switches say it should be output. MATCH is true if the line matches the previous line. -@@ -303,15 +470,42 @@ check_file (const char *infile, const ch +@@ -299,15 +466,42 @@ check_file (const char *infile, const ch { char *prevfield IF_LINT (= NULL); size_t prevlen IF_LINT (= 0); @@ -3915,7 +3909,7 @@ if (prevline->length == 0 || different (thisfield, prevfield, thislen, prevlen)) { -@@ -330,17 +524,26 @@ check_file (const char *infile, const ch +@@ -326,17 +520,26 @@ check_file (const char *infile, const ch size_t prevlen; uintmax_t match_count = 0; bool first_delimiter = true; @@ -3942,7 +3936,7 @@ if (readlinebuffer_delim (thisline, stdin, delimiter) == 0) { if (ferror (stdin)) -@@ -349,6 +552,15 @@ check_file (const char *infile, const ch +@@ -345,6 +548,15 @@ check_file (const char *infile, const ch } thisfield = find_field (thisline); thislen = thisline->length - 1 - (thisfield - thisline->buffer); @@ -3958,7 +3952,7 @@ match = !different (thisfield, prevfield, thislen, prevlen); match_count += match; -@@ -381,6 +593,9 @@ check_file (const char *infile, const ch +@@ -377,6 +589,9 @@ check_file (const char *infile, const ch SWAP_LINES (prevline, thisline); prevfield = thisfield; prevlen = thislen; @@ -3968,7 +3962,7 @@ if (!match) match_count = 0; } -@@ -426,6 +641,18 @@ main (int argc, char **argv) +@@ -422,6 +637,18 @@ main (int argc, char **argv) atexit (close_stdout); @@ -3987,8 +3981,8 @@ skip_chars = 0; skip_fields = 0; check_chars = SIZE_MAX; ---- coreutils-6.12/tests/misc/cut -+++ coreutils-6.12/tests/misc/cut +--- coreutils-7.1/tests/misc/cut ++++ coreutils-7.1/tests/misc/cut @@ -26,7 +26,7 @@ use strict; my $prog = 'cut'; my $try = "Try \`$prog --help' for more information.\n"; diff --git a/coreutils-6.12.tar.gz b/coreutils-6.12.tar.gz deleted file mode 100644 index 93727cc..0000000 --- a/coreutils-6.12.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:49d2f703e2310e6328cb6f9d9bae3612c42b3ee5175f449692c5b95e453cf18a -size 9001890 diff --git a/coreutils-6.8-su.diff b/coreutils-6.8-su.diff index 6082b85..090b0f3 100644 --- a/coreutils-6.8-su.diff +++ b/coreutils-6.8-su.diff @@ -1,8 +1,162 @@ -Index: src/Makefile.am -================================================================================ +--- Makefile.in ++++ Makefile.in +@@ -732,6 +732,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ ++PAM_LIBS = @PAM_LIBS@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PERL = @PERL@ + POSIX_SHELL = @POSIX_SHELL@ +--- configure ++++ configure +@@ -612,6 +612,7 @@ OPTIONAL_BIN_PROGS + INSTALL_SU + LIB_GMP + LIB_CRYPT ++PAM_LIBS + WERROR_CFLAGS + SEQ_LIBM + LIB_CAP +@@ -1231,6 +1232,7 @@ with_included_regex + enable_xattr + enable_libcap + enable_gcc_warnings ++enable_pam + with_gmp + enable_install_program + enable_no_install_program +@@ -1877,6 +1879,7 @@ Optional Features: + --disable-xattr do not support extended attributes + --disable-libcap disable libcap support + --enable-gcc-warnings turn on lots of GCC warnings (not recommended) ++ --disable-pam Enable PAM support in su (default=auto) + --enable-install-program=PROG_LIST + install the programs in PROG_LIST (comma-separated, + default: none) +@@ -26931,7 +26934,6 @@ fi + + + +- + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'" + + +@@ -39096,6 +39098,111 @@ $as_echo "#define HAVE_WORKING_FORK 1" > + fi + + ++# Check whether --enable-pam was given. ++if test "${enable_pam+set}" = set; then ++ enableval=$enable_pam; ++else ++ enable_pam=yes ++fi ++ ++if test "x$enable_pam" != xno; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5 ++$as_echo_n "checking for pam_start in -lpam... " >&6; } ++if test "${ac_cv_lib_pam_pam_start+set}" = set; then ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lpam $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char pam_start (); ++int ++main () ++{ ++return pam_start (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then ++ ac_cv_lib_pam_pam_start=yes ++else ++ ac_cv_lib_pam_pam_start=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5 ++$as_echo "$ac_cv_lib_pam_pam_start" >&6; } ++if test "x$ac_cv_lib_pam_pam_start" = x""yes; then ++ enable_pam=yes ++else ++ enable_pam=no ++fi ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for misc_conv in -lpam_misc" >&5 ++$as_echo_n "checking for misc_conv in -lpam_misc... " >&6; } ++if test "${ac_cv_lib_pam_misc_misc_conv+set}" = set; then ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lpam_misc $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char misc_conv (); ++int ++main () ++{ ++return misc_conv (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then ++ ac_cv_lib_pam_misc_misc_conv=yes ++else ++ ac_cv_lib_pam_misc_misc_conv=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_misc_misc_conv" >&5 ++$as_echo "$ac_cv_lib_pam_misc_misc_conv" >&6; } ++if test "x$ac_cv_lib_pam_misc_misc_conv" = x""yes; then ++ : ++else ++ enable_pam=no ++fi ++ ++ if test "x$enable_pam" != xno; then ++ ++$as_echo "#define USE_PAM 1" >>confdefs.h ++ ++ PAM_LIBS="-lpam -lpam_misc" ++ ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable PAM support in su" >&5 ++$as_echo_n "checking whether to enable PAM support in su... " >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_pam" >&5 ++$as_echo "$enable_pam" >&6; } ++ + optional_bin_progs= + for ac_func in uname + do --- configure.ac +++ configure.ac -@@ -46,6 +46,20 @@ coreutils_MACROS +@@ -79,6 +79,20 @@ fi AC_FUNC_FORK @@ -21,11 +175,51 @@ Index: src/Makefile.am +AC_MSG_RESULT([$enable_pam]) + optional_bin_progs= - AC_CHECK_FUNCS(uname, + AC_CHECK_FUNCS([uname], gl_ADD_PROG([optional_bin_progs], [uname])) +--- doc/Makefile.in ++++ doc/Makefile.in +@@ -713,6 +713,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ ++PAM_LIBS = @PAM_LIBS@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PERL = @PERL@ + POSIX_SHELL = @POSIX_SHELL@ +--- gnulib-tests/Makefile.in ++++ gnulib-tests/Makefile.in +@@ -1421,6 +1421,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ ++PAM_LIBS = @PAM_LIBS@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PERL = @PERL@ + POSIX_SHELL = @POSIX_SHELL@ +--- lib/Makefile.in ++++ lib/Makefile.in +@@ -763,6 +763,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ ++PAM_LIBS = @PAM_LIBS@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PERL = @PERL@ + POSIX_SHELL = @POSIX_SHELL@ +--- man/Makefile.in ++++ man/Makefile.in +@@ -703,6 +703,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ ++PAM_LIBS = @PAM_LIBS@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PERL = @PERL@ + POSIX_SHELL = @POSIX_SHELL@ --- src/Makefile.am +++ src/Makefile.am -@@ -124,7 +124,8 @@ tail_LDADD = $(nanosec_libs) +@@ -147,7 +147,8 @@ tail_LDADD = $(nanosec_libs) # If necessary, add -lm to resolve use of pow in lib/strtod.c. uptime_LDADD = $(LDADD) $(POW_LIB) $(GETLOADAVG_LIBS) @@ -33,8 +227,82 @@ Index: src/Makefile.am +su_SOURCES = su.c getdef.c +su_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS) - dir_LDADD += $(LIB_ACL_TRIVIAL) $(LIB_ACL) - ls_LDADD += $(LIB_ACL_TRIVIAL) $(LIB_ACL) + dir_LDADD += $(LIB_ACL) + ls_LDADD += $(LIB_ACL) +--- src/Makefile.in ++++ src/Makefile.in +@@ -605,9 +605,10 @@ stty_OBJECTS = stty.$(OBJEXT) + stty_LDADD = $(LDADD) + stty_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a +-su_SOURCES = su.c +-su_OBJECTS = su.$(OBJEXT) +-su_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) ++am_su_OBJECTS = su.$(OBJEXT) getdef.$(OBJEXT) ++su_OBJECTS = $(am_su_OBJECTS) ++su_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ ++ $(am__DEPENDENCIES_1) + sum_SOURCES = sum.c + sum_OBJECTS = sum.$(OBJEXT) + sum_LDADD = $(LDADD) +@@ -735,11 +736,11 @@ SOURCES = $(nodist_libver_a_SOURCES) $(_ + $(rm_SOURCES) $(rmdir_SOURCES) runcon.c seq.c setuidgid.c \ + $(sha1sum_SOURCES) $(sha224sum_SOURCES) $(sha256sum_SOURCES) \ + $(sha384sum_SOURCES) $(sha512sum_SOURCES) shred.c shuf.c \ +- sleep.c sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c \ +- tail.c tee.c test.c $(timeout_SOURCES) touch.c tr.c true.c \ +- truncate.c tsort.c tty.c $(uname_SOURCES) unexpand.c uniq.c \ +- unlink.c uptime.c users.c $(vdir_SOURCES) wc.c who.c whoami.c \ +- yes.c ++ sleep.c sort.c split.c stat.c stty.c $(su_SOURCES) sum.c \ ++ sync.c tac.c tail.c tee.c test.c $(timeout_SOURCES) touch.c \ ++ tr.c true.c truncate.c tsort.c tty.c $(uname_SOURCES) \ ++ unexpand.c uniq.c unlink.c uptime.c users.c $(vdir_SOURCES) \ ++ wc.c who.c whoami.c yes.c + DIST_SOURCES = $(__SOURCES) $(arch_SOURCES) base64.c basename.c cat.c \ + chcon.c $(chgrp_SOURCES) chmod.c $(chown_SOURCES) chroot.c \ + cksum.c comm.c $(cp_SOURCES) csplit.c cut.c date.c dd.c df.c \ +@@ -754,10 +755,10 @@ DIST_SOURCES = $(__SOURCES) $(arch_SOURC + $(rmdir_SOURCES) runcon.c seq.c setuidgid.c $(sha1sum_SOURCES) \ + $(sha224sum_SOURCES) $(sha256sum_SOURCES) $(sha384sum_SOURCES) \ + $(sha512sum_SOURCES) shred.c shuf.c sleep.c sort.c split.c \ +- stat.c stty.c su.c sum.c sync.c tac.c tail.c tee.c test.c \ +- $(timeout_SOURCES) touch.c tr.c true.c truncate.c tsort.c \ +- tty.c $(uname_SOURCES) unexpand.c uniq.c unlink.c uptime.c \ +- users.c $(vdir_SOURCES) wc.c who.c whoami.c yes.c ++ stat.c stty.c $(su_SOURCES) sum.c sync.c tac.c tail.c tee.c \ ++ test.c $(timeout_SOURCES) touch.c tr.c true.c truncate.c \ ++ tsort.c tty.c $(uname_SOURCES) unexpand.c uniq.c unlink.c \ ++ uptime.c users.c $(vdir_SOURCES) wc.c who.c whoami.c yes.c + HEADERS = $(noinst_HEADERS) + ETAGS = etags + CTAGS = ctags +@@ -1209,6 +1210,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ ++PAM_LIBS = @PAM_LIBS@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PERL = @PERL@ + POSIX_SHELL = @POSIX_SHELL@ +@@ -1511,7 +1513,8 @@ tail_LDADD = $(nanosec_libs) + + # If necessary, add -lm to resolve use of pow in lib/strtod.c. + uptime_LDADD = $(LDADD) $(POW_LIB) $(GETLOADAVG_LIBS) +-su_LDADD = $(LDADD) $(LIB_CRYPT) ++su_SOURCES = su.c getdef.c ++su_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS) + stat_LDADD = $(LDADD) $(LIB_SELINUX) + + # programs that use getaddrinfo (e.g., via canon_host) +@@ -2040,6 +2043,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/false.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fold.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdef.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getlimits.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-copy.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-cp-hash.Po@am__quote@ --- src/getdef.c +++ src/getdef.c @@ -0,0 +1,259 @@ @@ -401,25 +669,25 @@ Index: src/Makefile.am #define DEFAULT_USER "root" +#ifndef USE_PAM - char *crypt (); + char *crypt (char const *key, char const *salt); +#endif - char *getusershell (); - void endusershell (); - void setusershell (); + char *getusershell (void); + void endusershell (void); + void setusershell (void); extern char **environ; +#ifdef USE_PAM +static bool _pam_session_opened; +static bool _pam_cred_established; -+static void export_pamenv(void); -+static void create_watching_parent(void); ++static void export_pamenv (void); ++static void create_watching_parent (void); +#endif + static void run_shell (char const *, char const *, char **, size_t) ATTRIBUTE_NORETURN; -@@ -215,7 +238,162 @@ log_su (struct passwd const *pw, bool su +@@ -212,7 +235,162 @@ log_su (struct passwd const *pw, bool su } #endif @@ -582,7 +850,7 @@ Index: src/Makefile.am Return true if the user gives the correct password for entry PW, false if not. Return true without asking for a password if run by UID 0 or if PW has an empty password. */ -@@ -223,10 +402,52 @@ log_su (struct passwd const *pw, bool su +@@ -220,10 +398,52 @@ log_su (struct passwd const *pw, bool su static bool correct_password (const struct passwd *pw) { @@ -636,7 +904,7 @@ Index: src/Makefile.am endspent (); if (sp) -@@ -247,6 +468,7 @@ correct_password (const struct passwd *p +@@ -244,6 +464,7 @@ correct_password (const struct passwd *p encrypted = crypt (unencrypted, correct); memset (unencrypted, 0, strlen (unencrypted)); return STREQ (encrypted, correct); @@ -644,7 +912,7 @@ Index: src/Makefile.am } /* Update `environ' for the new shell based on PW, with SHELL being -@@ -271,8 +493,8 @@ modify_environment (const struct passwd +@@ -268,8 +489,8 @@ modify_environment (const struct passwd xsetenv ("USER", pw->pw_name); xsetenv ("LOGNAME", pw->pw_name); xsetenv ("PATH", (pw->pw_uid @@ -655,7 +923,7 @@ Index: src/Makefile.am } else { -@@ -282,6 +504,12 @@ modify_environment (const struct passwd +@@ -279,6 +500,12 @@ modify_environment (const struct passwd { xsetenv ("HOME", pw->pw_dir); xsetenv ("SHELL", shell); @@ -668,7 +936,7 @@ Index: src/Makefile.am if (pw->pw_uid) { xsetenv ("USER", pw->pw_name); -@@ -289,19 +517,41 @@ modify_environment (const struct passwd +@@ -286,19 +513,41 @@ modify_environment (const struct passwd } } } @@ -712,7 +980,7 @@ Index: src/Makefile.am if (setgid (pw->pw_gid)) error (EXIT_FAILURE, errno, _("cannot set group id")); if (setuid (pw->pw_uid)) -@@ -494,6 +744,7 @@ main (int argc, char **argv) +@@ -491,6 +740,7 @@ main (int argc, char **argv) #ifdef SYSLOG_FAILURE log_su (pw, false); #endif @@ -720,10 +988,11 @@ Index: src/Makefile.am error (EXIT_FAILURE, 0, _("incorrect password")); } #ifdef SYSLOG_SUCCESS -@@ -515,9 +766,21 @@ main (int argc, char **argv) +@@ -512,9 +762,21 @@ main (int argc, char **argv) shell = NULL; } shell = xstrdup (shell ? shell : pw->pw_shell); +- modify_environment (pw, shell); + + init_groups (pw); + @@ -731,15 +1000,24 @@ Index: src/Makefile.am + create_watching_parent (); + /* Now we're in the child. */ +#endif -+ -+ change_identity (pw); + + change_identity (pw); + + /* Set environment after pam_open_session, which may put KRB5CCNAME + into the pam_env, etc. */ + - modify_environment (pw, shell); - -- change_identity (pw); ++ modify_environment (pw, shell); ++ if (simulate_login && chdir (pw->pw_dir) != 0) error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir); +--- tests/Makefile.in ++++ tests/Makefile.in +@@ -677,6 +677,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ + PACKAGE_TARNAME = @PACKAGE_TARNAME@ + PACKAGE_URL = @PACKAGE_URL@ + PACKAGE_VERSION = @PACKAGE_VERSION@ ++PAM_LIBS = @PAM_LIBS@ + PATH_SEPARATOR = @PATH_SEPARATOR@ + PERL = @PERL@ + POSIX_SHELL = @POSIX_SHELL@ diff --git a/coreutils-6.8.0-pie.diff b/coreutils-6.8.0-pie.diff index 49cc8d0..36f565f 100644 --- a/coreutils-6.8.0-pie.diff +++ b/coreutils-6.8.0-pie.diff @@ -1,25 +1,183 @@ -Index: lib/Makefile.am -=================================================================== ---- lib/Makefile.am.orig +--- lib/Makefile.am +++ lib/Makefile.am -@@ -20,6 +20,7 @@ +@@ -18,6 +18,7 @@ include gnulib.mk - AM_CFLAGS = $(WARNING_CFLAGS) $(WERROR_CFLAGS) + AM_CFLAGS = $(WARN_CFLAGS) # $(WERROR_CFLAGS) +AM_CFLAGS += -fpie - noinst_PROGRAMS = t-fpending - LDADD = $(noinst_LIBRARIES) -Index: src/Makefile.am -=================================================================== ---- src/Makefile.am.orig + libcoreutils_a_SOURCES += \ + buffer-lcm.c buffer-lcm.h \ +--- lib/Makefile.in ++++ lib/Makefile.in +@@ -1169,7 +1169,7 @@ GPERF = gperf + LINK_WARNING_H = $(top_srcdir)/build-aux/link-warning.h + charset_alias = $(DESTDIR)$(libdir)/charset.alias + charset_tmp = $(DESTDIR)$(libdir)/charset.tmp +-AM_CFLAGS = $(WARN_CFLAGS) # $(WERROR_CFLAGS) ++AM_CFLAGS = $(WARN_CFLAGS) -fpie + all: $(BUILT_SOURCES) config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +--- src/Makefile.am +++ src/Makefile.am -@@ -104,6 +104,8 @@ uptime_LDADD = $(LDADD) $(POW_LIB) $(GET +@@ -149,6 +149,10 @@ uptime_LDADD = $(LDADD) $(POW_LIB) $(GET su_SOURCES = su.c getdef.c su_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS) +su_CFLAGS = -fpie +su_LDFLAGS = -pie ++timeout_CFLAGS = -fpie ++timeout_LDFLAGS = -pie dir_LDADD += $(LIB_ACL) ls_LDADD += $(LIB_ACL) +--- src/Makefile.in ++++ src/Makefile.in +@@ -605,10 +605,12 @@ stty_OBJECTS = stty.$(OBJEXT) + stty_LDADD = $(LDADD) + stty_DEPENDENCIES = libver.a ../lib/libcoreutils.a \ + $(am__DEPENDENCIES_1) ../lib/libcoreutils.a +-am_su_OBJECTS = su.$(OBJEXT) getdef.$(OBJEXT) ++am_su_OBJECTS = su-su.$(OBJEXT) su-getdef.$(OBJEXT) + su_OBJECTS = $(am_su_OBJECTS) + su_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) ++su_LINK = $(CCLD) $(su_CFLAGS) $(CFLAGS) $(su_LDFLAGS) $(LDFLAGS) -o \ ++ $@ + sum_SOURCES = sum.c + sum_OBJECTS = sum.$(OBJEXT) + sum_LDADD = $(LDADD) +@@ -633,9 +635,12 @@ tee_DEPENDENCIES = libver.a ../lib/libco + test_SOURCES = test.c + test_OBJECTS = test.$(OBJEXT) + test_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +-am_timeout_OBJECTS = timeout.$(OBJEXT) operand2sig.$(OBJEXT) ++am_timeout_OBJECTS = timeout-timeout.$(OBJEXT) \ ++ timeout-operand2sig.$(OBJEXT) + timeout_OBJECTS = $(am_timeout_OBJECTS) + timeout_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) ++timeout_LINK = $(CCLD) $(timeout_CFLAGS) $(CFLAGS) $(timeout_LDFLAGS) \ ++ $(LDFLAGS) -o $@ + touch_SOURCES = touch.c + touch_OBJECTS = touch.$(OBJEXT) + touch_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +@@ -1515,6 +1520,10 @@ tail_LDADD = $(nanosec_libs) + uptime_LDADD = $(LDADD) $(POW_LIB) $(GETLOADAVG_LIBS) + su_SOURCES = su.c getdef.c + su_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS) ++su_CFLAGS = -fpie ++su_LDFLAGS = -pie ++timeout_CFLAGS = -fpie ++timeout_LDFLAGS = -pie + stat_LDADD = $(LDADD) $(LIB_SELINUX) + + # programs that use getaddrinfo (e.g., via canon_host) +@@ -1933,7 +1942,7 @@ stty$(EXEEXT): $(stty_OBJECTS) $(stty_DE + $(LINK) $(stty_OBJECTS) $(stty_LDADD) $(LIBS) + su$(EXEEXT): $(su_OBJECTS) $(su_DEPENDENCIES) + @rm -f su$(EXEEXT) +- $(LINK) $(su_OBJECTS) $(su_LDADD) $(LIBS) ++ $(su_LINK) $(su_OBJECTS) $(su_LDADD) $(LIBS) + sum$(EXEEXT): $(sum_OBJECTS) $(sum_DEPENDENCIES) + @rm -f sum$(EXEEXT) + $(LINK) $(sum_OBJECTS) $(sum_LDADD) $(LIBS) +@@ -1954,7 +1963,7 @@ test$(EXEEXT): $(test_OBJECTS) $(test_DE + $(LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS) + timeout$(EXEEXT): $(timeout_OBJECTS) $(timeout_DEPENDENCIES) + @rm -f timeout$(EXEEXT) +- $(LINK) $(timeout_OBJECTS) $(timeout_LDADD) $(LIBS) ++ $(timeout_LINK) $(timeout_OBJECTS) $(timeout_LDADD) $(LIBS) + touch$(EXEEXT): $(touch_OBJECTS) $(touch_DEPENDENCIES) + @rm -f touch$(EXEEXT) + $(LINK) $(touch_OBJECTS) $(touch_LDADD) $(LIBS) +@@ -2043,7 +2052,6 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/false.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fold.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdef.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getlimits.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-copy.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-cp-hash.Po@am__quote@ +@@ -2104,14 +2112,16 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/split.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stty.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/su.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/su-getdef.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/su-su.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tac.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tail.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeout.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeout-operand2sig.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeout-timeout.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/touch.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tr.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/true.Po@am__quote@ +@@ -2286,6 +2296,62 @@ sha512sum-md5sum.obj: md5sum.c + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha512sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha512sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi` + ++su-su.o: su.c ++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -MT su-su.o -MD -MP -MF $(DEPDIR)/su-su.Tpo -c -o su-su.o `test -f 'su.c' || echo '$(srcdir)/'`su.c ++@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/su-su.Tpo $(DEPDIR)/su-su.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='su.c' object='su-su.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -c -o su-su.o `test -f 'su.c' || echo '$(srcdir)/'`su.c ++ ++su-su.obj: su.c ++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -MT su-su.obj -MD -MP -MF $(DEPDIR)/su-su.Tpo -c -o su-su.obj `if test -f 'su.c'; then $(CYGPATH_W) 'su.c'; else $(CYGPATH_W) '$(srcdir)/su.c'; fi` ++@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/su-su.Tpo $(DEPDIR)/su-su.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='su.c' object='su-su.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -c -o su-su.obj `if test -f 'su.c'; then $(CYGPATH_W) 'su.c'; else $(CYGPATH_W) '$(srcdir)/su.c'; fi` ++ ++su-getdef.o: getdef.c ++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -MT su-getdef.o -MD -MP -MF $(DEPDIR)/su-getdef.Tpo -c -o su-getdef.o `test -f 'getdef.c' || echo '$(srcdir)/'`getdef.c ++@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/su-getdef.Tpo $(DEPDIR)/su-getdef.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getdef.c' object='su-getdef.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -c -o su-getdef.o `test -f 'getdef.c' || echo '$(srcdir)/'`getdef.c ++ ++su-getdef.obj: getdef.c ++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -MT su-getdef.obj -MD -MP -MF $(DEPDIR)/su-getdef.Tpo -c -o su-getdef.obj `if test -f 'getdef.c'; then $(CYGPATH_W) 'getdef.c'; else $(CYGPATH_W) '$(srcdir)/getdef.c'; fi` ++@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/su-getdef.Tpo $(DEPDIR)/su-getdef.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getdef.c' object='su-getdef.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -c -o su-getdef.obj `if test -f 'getdef.c'; then $(CYGPATH_W) 'getdef.c'; else $(CYGPATH_W) '$(srcdir)/getdef.c'; fi` ++ ++timeout-timeout.o: timeout.c ++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -MT timeout-timeout.o -MD -MP -MF $(DEPDIR)/timeout-timeout.Tpo -c -o timeout-timeout.o `test -f 'timeout.c' || echo '$(srcdir)/'`timeout.c ++@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/timeout-timeout.Tpo $(DEPDIR)/timeout-timeout.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='timeout.c' object='timeout-timeout.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -c -o timeout-timeout.o `test -f 'timeout.c' || echo '$(srcdir)/'`timeout.c ++ ++timeout-timeout.obj: timeout.c ++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -MT timeout-timeout.obj -MD -MP -MF $(DEPDIR)/timeout-timeout.Tpo -c -o timeout-timeout.obj `if test -f 'timeout.c'; then $(CYGPATH_W) 'timeout.c'; else $(CYGPATH_W) '$(srcdir)/timeout.c'; fi` ++@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/timeout-timeout.Tpo $(DEPDIR)/timeout-timeout.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='timeout.c' object='timeout-timeout.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -c -o timeout-timeout.obj `if test -f 'timeout.c'; then $(CYGPATH_W) 'timeout.c'; else $(CYGPATH_W) '$(srcdir)/timeout.c'; fi` ++ ++timeout-operand2sig.o: operand2sig.c ++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -MT timeout-operand2sig.o -MD -MP -MF $(DEPDIR)/timeout-operand2sig.Tpo -c -o timeout-operand2sig.o `test -f 'operand2sig.c' || echo '$(srcdir)/'`operand2sig.c ++@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/timeout-operand2sig.Tpo $(DEPDIR)/timeout-operand2sig.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='operand2sig.c' object='timeout-operand2sig.o' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -c -o timeout-operand2sig.o `test -f 'operand2sig.c' || echo '$(srcdir)/'`operand2sig.c ++ ++timeout-operand2sig.obj: operand2sig.c ++@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -MT timeout-operand2sig.obj -MD -MP -MF $(DEPDIR)/timeout-operand2sig.Tpo -c -o timeout-operand2sig.obj `if test -f 'operand2sig.c'; then $(CYGPATH_W) 'operand2sig.c'; else $(CYGPATH_W) '$(srcdir)/operand2sig.c'; fi` ++@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/timeout-operand2sig.Tpo $(DEPDIR)/timeout-operand2sig.Po ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='operand2sig.c' object='timeout-operand2sig.obj' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -c -o timeout-operand2sig.obj `if test -f 'operand2sig.c'; then $(CYGPATH_W) 'operand2sig.c'; else $(CYGPATH_W) '$(srcdir)/operand2sig.c'; fi` ++ + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ diff --git a/coreutils-6.12.diff b/coreutils-7.1.diff similarity index 70% rename from coreutils-6.12.diff rename to coreutils-7.1.diff index 90fa14e..f755a19 100644 --- a/coreutils-6.12.diff +++ b/coreutils-7.1.diff @@ -1,6 +1,16 @@ +--- configure ++++ configure +@@ -3029,7 +3029,6 @@ as_fn_append ac_func_list " fchmod" + as_fn_append ac_func_list " alarm" + as_fn_append ac_header_list " sys/statvfs.h" + as_fn_append ac_header_list " sys/select.h" +-gl_printf_safe=yes + as_fn_append ac_func_list " readlink" + as_fn_append ac_header_list " utmp.h" + as_fn_append ac_header_list " utmpx.h" --- doc/coreutils.texi +++ doc/coreutils.texi -@@ -67,8 +67,6 @@ +@@ -66,8 +66,6 @@ * fold: (coreutils)fold invocation. Wrap long input lines. * groups: (coreutils)groups invocation. Print group names a user is in. * head: (coreutils)head invocation. Output the first part of files. @@ -9,29 +19,37 @@ * id: (coreutils)id invocation. Print user identity. * install: (coreutils)install invocation. Copy and change attributes. * join: (coreutils)join invocation. Join lines on a common field. -@@ -402,8 +400,6 @@ System context +@@ -195,7 +193,7 @@ Free Documentation License''. + * File name manipulation:: dirname basename pathchk + * Working context:: pwd stty printenv tty + * User information:: id logname whoami groups users who +-* System context:: date uname hostname hostid uptime ++* System context:: date uname uptime + * SELinux context:: chcon runcon + * Modified command invocation:: chroot env nice nohup su timeout + * Process control:: kill +@@ -409,8 +407,6 @@ System context * arch invocation:: Print machine hardware name * date invocation:: Print or set system date and time * uname invocation:: Print system information -* hostname invocation:: Print or set system name --* hostid invocation:: Print numeric host identifier. +-* hostid invocation:: Print numeric host identifier + * uptime invocation:: Print system uptime and load @command{date}: Print or set system date and time - -@@ -12523,8 +12519,6 @@ information. +@@ -12969,8 +12965,6 @@ information. * arch invocation:: Print machine hardware name. * date invocation:: Print or set system date and time. * uname invocation:: Print system information. -* hostname invocation:: Print or set system name. -* hostid invocation:: Print numeric host identifier. + * uptime invocation:: Print system uptime and load @end menu - -@@ -13304,55 +13298,6 @@ Print the kernel version. - +@@ -13928,54 +13922,6 @@ Print the kernel version. @exitstatus -- + -@node hostname invocation -@section @command{hostname}: Print or set system name - @@ -80,12 +98,12 @@ - -@exitstatus - + @node uptime invocation + @section @command{uptime}: Print system uptime and load - @node Modified command invocation - @chapter Modified command invocation --- gnulib-tests/test-isnanl.h +++ gnulib-tests/test-isnanl.h -@@ -59,7 +59,7 @@ main () +@@ -75,7 +75,7 @@ main () /* Quiet NaN. */ ASSERT (isnanl (0.0L / 0.0L)); @@ -94,7 +112,7 @@ /* A bit pattern that is different from a Quiet NaN. With a bit of luck, it's a Signalling NaN. */ { -@@ -101,6 +101,7 @@ main () +@@ -117,6 +117,7 @@ main () { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; ASSERT (isnanl (x.value)); } @@ -102,7 +120,7 @@ /* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities, Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in Intel IA-64 Architecture Software Developer's Manual, Volume 1: -@@ -134,6 +135,7 @@ main () +@@ -150,6 +151,7 @@ main () ASSERT (isnanl (x.value)); } #endif @@ -112,7 +130,7 @@ } --- m4/gnulib-comp.m4 +++ m4/gnulib-comp.m4 -@@ -260,7 +260,6 @@ AC_DEFUN([gl_INIT], +@@ -287,7 +287,6 @@ AC_DEFUN([gl_INIT], gl_POSIXVER gl_FUNC_PRINTF_FREXP gl_FUNC_PRINTF_FREXPL @@ -122,7 +140,18 @@ AM_XGETTEXT_OPTION([--keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'])]) --- man/Makefile.am +++ man/Makefile.am -@@ -179,7 +179,7 @@ check-x-vs-1: +@@ -184,7 +184,7 @@ check-x-vs-1: + PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \ + t=ls-files.$$$$; \ + (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\ +- (echo $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT) \ ++ (echo $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT) hostid \ + | tr -s ' ' '\n' | sed 's/\.1$$//') \ + | $(ASSORT) -u | diff - $$t || { rm $$t; exit 1; }; \ + rm $$t +--- man/Makefile.in ++++ man/Makefile.in +@@ -1275,7 +1275,7 @@ check-x-vs-1: PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \ t=ls-files.$$$$; \ (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\ @@ -133,7 +162,7 @@ rm $$t --- src/system.h +++ src/system.h -@@ -168,7 +168,7 @@ enum +@@ -156,7 +156,7 @@ enum # define DEV_BSIZE BBSIZE #endif #ifndef DEV_BSIZE @@ -144,7 +173,7 @@ /* Extract or fake data from a `struct stat'. --- tests/misc/help-version +++ tests/misc/help-version -@@ -178,6 +178,7 @@ lbracket_args=": ]" +@@ -182,6 +182,7 @@ lbracket_args=": ]" for i in $built_programs; do # Skip these. case $i in chroot|stty|tty|false|chcon|runcon) continue;; esac diff --git a/coreutils-7.1.tar.xz b/coreutils-7.1.tar.xz new file mode 100644 index 0000000..5f576f5 --- /dev/null +++ b/coreutils-7.1.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a584c6ce92f390c684dac00032e5c790ecc15cb0fa3e61891ac62401832ae108 +size 3967824 diff --git a/coreutils-changelog.diff b/coreutils-changelog.diff deleted file mode 100644 index 2cafff1..0000000 --- a/coreutils-changelog.diff +++ /dev/null @@ -1,44 +0,0 @@ -2005-10-20 Andreas Gruenbacher - - * Add support for access control lists and extended attributes - (see below). - - * lib/acl.h: Remove HAVE_ACL symbol; is needed for POSIX - ACLs even if there is no acl system call. - - * lib/acl.c (file_has_acl, copy_acl, set_acl): Add Linux/POSIX ACL - implementation. - - * src/copy.c (get_dest_mode): Remove, no longer correct with acls. - - * src/copy.c (copy_internal): Check effective permissions after - mkdir(). Add S_IRWXU only after saving the default permissions, - so that the default permissions can be restored. This is needed - with POSIX 1003.1e draft 17 acls. Add dst_mode and dst_mode_valid, - which are set when the destination file mode is changed - temporarily. Remove obsolete ran_chown. - - * src/copy.c (copy_internal): Use copy_acl and set_acl instead of - chmod. - - * src/copy.c: Add --attributes option for controlling which extended - attributes to copy. - - * src/cp.c (make_path_private): Remove the mode parameter. Pass in - cp_options, instead of cp_options->xstat only. Stat the source dir, - and create the destination dir with the source dir's mode as create - mode (see analog change to src/copy.c (copy_internal)). Check if the - effective permissions include S_IRWXU. Remember the original mode - only if needed later. - - * src/cp.c, src/install.c, src/mv.c, src/copy.h: Remove umask_kill, - and never change the startup umask. The functions creating files - need the original umask to create the correct permissions inside - directories with default ACLs. - - * src/cp.c (struct dir_attr, re_protect, make_path_private): Replace - is_new_dir by mode and mode_valid variables. - - * src/ls.c: change `HAVE_ACL' to `USE_ACL' for POSIX ACLs: POSIX ACLs - have no acl syscall. - diff --git a/coreutils-cifs-afs.diff b/coreutils-cifs-afs.diff index 0e1e381..41cd49f 100644 --- a/coreutils-cifs-afs.diff +++ b/coreutils-cifs-afs.diff @@ -1,38 +1,35 @@ --- src/fs.h -+++ src/fs.h 2008-11-19 12:28:00.977049694 +0100 -@@ -34,6 +34,7 @@ - # define S_MAGIC_MINIX_V2_30 0x2478 - # define S_MAGIC_MSDOS 0x4D44 - # define S_MAGIC_NCP 0x564C ++++ src/fs.h +@@ -5,10 +5,12 @@ + #if defined __linux__ + # define S_MAGIC_ADFS 0xADF5 + # define S_MAGIC_AFFS 0xADFF +# define S_MAGIC_AFS 0x6B414653 - # define S_MAGIC_NFS 0x6969 - # define S_MAGIC_NFSD 0x6E667364 - # define S_MAGIC_NTFS 0x5346544E -@@ -44,6 +45,7 @@ - # define S_MAGIC_REISERFS 0x52654973 - # define S_MAGIC_ROMFS 0x7275 - # define S_MAGIC_SMB 0x517B + # define S_MAGIC_AUTOFS 0x187 + # define S_MAGIC_BEFS 0x42465331 + # define S_MAGIC_BFS 0x1BADFACE + # define S_MAGIC_BINFMT_MISC 0x42494e4d +# define S_MAGIC_CIFS 0xFF534D42 - # define S_MAGIC_SQUASHFS 0x73717368 - # define S_MAGIC_SYSFS 0x62656572 - # define S_MAGIC_SYSV2 0x012FF7B6 + # define S_MAGIC_CODA 0x73757245 + # define S_MAGIC_COH 0x012FF7B7 + # define S_MAGIC_CRAMFS 0x28CD3D45 --- src/stat.c -+++ src/stat.c 2008-11-19 12:28:26.235780004 +0100 -@@ -283,6 +283,8 @@ human_fstype (STRUCT_STATVFS const *stat - return "msdos"; - case S_MAGIC_NCP: /* 0x564C */ - return "novell"; ++++ src/stat.c +@@ -219,6 +219,8 @@ human_fstype (STRUCT_STATVFS const *stat + return "adfs"; + case S_MAGIC_AFFS: /* 0xADFF */ + return "affs"; + case S_MAGIC_AFS: /* 0x6B414653 */ + return "afs"; - case S_MAGIC_NFS: /* 0x6969 */ - return "nfs"; - case S_MAGIC_NFSD: /* 0x6E667364 */ -@@ -303,6 +305,8 @@ human_fstype (STRUCT_STATVFS const *stat - return "romfs"; - case S_MAGIC_SMB: /* 0x517B */ - return "smb"; + case S_MAGIC_AUTOFS: /* 0x187 */ + return "autofs"; + case S_MAGIC_BEFS: /* 0x42465331 */ +@@ -227,6 +229,8 @@ human_fstype (STRUCT_STATVFS const *stat + return "bfs"; + case S_MAGIC_BINFMT_MISC: /* 0x42494e4d */ + return "binfmt_misc"; + case S_MAGIC_CIFS: /* 0xFF534D42 */ + return "cifs"; - case S_MAGIC_SQUASHFS: /* 0x73717368 */ - return "squashfs"; - case S_MAGIC_SYSFS: /* 0x62656572 */ + case S_MAGIC_CODA: /* 0x73757245 */ + return "coda"; + case S_MAGIC_COH: /* 0x012FF7B7 */ diff --git a/coreutils-getaddrinfo.diff b/coreutils-getaddrinfo.diff index 4ab88ee..39a0f38 100644 --- a/coreutils-getaddrinfo.diff +++ b/coreutils-getaddrinfo.diff @@ -1,15 +1,16 @@ Index: coreutils-6.9.90/gnulib-tests/test-getaddrinfo.c -=================================================================== ---- coreutils-6.9.90.orig/gnulib-tests/test-getaddrinfo.c 2007-11-17 07:59:42.000000000 +0100 -+++ coreutils-6.9.90/gnulib-tests/test-getaddrinfo.c 2007-12-12 11:25:49.000000000 +0100 -@@ -61,6 +61,10 @@ int simple (char *host, char *service) - if (res == EAI_SERVICE) - return 0; - -+ /* Do not fail this test for temporary name resolution errors. */ -+ if (res == EAI_AGAIN) +================================================================================ +--- coreutils-7.1/gnulib-tests/test-getaddrinfo.c ++++ coreutils-7.1/gnulib-tests/test-getaddrinfo.c +@@ -71,10 +71,7 @@ int simple (char *host, char *service) + the test merely because someone is down the country on their + in-law's farm. */ + if (res == EAI_AGAIN) +- { +- fprintf (stderr, "skipping getaddrinfo test: no network?\n"); +- return 77; +- } + return 0; -+ - return 1; - } - + /* IRIX reports EAI_NONAME for "https". Don't fail the test + merely because of this. */ + if (res == EAI_NONAME) diff --git a/coreutils-xattr.diff b/coreutils-xattr.diff deleted file mode 100644 index 3060ba1..0000000 --- a/coreutils-xattr.diff +++ /dev/null @@ -1,308 +0,0 @@ -Index: coreutils-6.2/configure.ac -================================================================================ ---- coreutils-6.9.89.48-96961/configure.ac -+++ coreutils-6.9.89.48-96961/configure.ac -@@ -325,6 +325,9 @@ CONFIG_STATUS_DEPENDENCIES='$(top_srcdir - AC_SUBST([CONFIG_STATUS_DEPENDENCIES]) - ############################################################################ - -+# Extended attribute copying. -+AC_FUNC_XATTR -+ - AM_GNU_GETTEXT([external], [need-formatstring-macros]) - AM_GNU_GETTEXT_VERSION([0.15]) - ---- coreutils-6.9.89.48-96961/doc/coreutils.texi -+++ coreutils-6.9.89.48-96961/doc/coreutils.texi -@@ -7087,6 +7087,8 @@ Preserve in the destination files - any links between corresponding source files. - @c Give examples illustrating how hard links are preserved. - @c Also, show how soft links map to hard links with -L and -H. -+@itemx xattrs -+Preserve extended attributes. (See /etc/xattr.conf.) - @itemx all - Preserve all file attributes. - Equivalent to specifying all of the above. ---- coreutils-6.9.89.48-96961/m4/xattr.m4 -+++ coreutils-6.9.89.48-96961/m4/xattr.m4 -@@ -0,0 +1,38 @@ -+# xattr.m4 - check for Extended Attributes (Linux) -+ -+# Copyright (C) 2003 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2, or (at your option) -+# any later version. -+ -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+ -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software Foundation, -+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -+ -+# Written by Andreas Gruenbacher. -+ -+AC_DEFUN([AC_FUNC_XATTR], -+[ -+ AC_CHECK_HEADERS(attr/error_context.h attr/libattr.h) -+ if test "$ac_cv_header_attr_libattr_h" = yes \ -+ && test "$ac_cv_header_attr_error_context_h" = yes; then -+ use_xattr=1 -+ else -+ use_xattr=0 -+ fi -+ AC_DEFINE_UNQUOTED(USE_XATTR, $use_xattr, -+ [Define if you want extended attribute support.]) -+ xattr_saved_LIBS=$LIBS -+ AC_SEARCH_LIBS(attr_copy_file, attr, -+ [test "$ac_cv_search_attr_copy_file" = "none required" || LIB_XATTR=$ac_cv_search_attr_copy_file]) -+ AC_SUBST(LIB_XATTR) -+ AC_CHECK_FUNCS(attr_copy_file) -+ LIBS=$xattr_saved_LIBS -+]) ---- coreutils-6.9.89.48-96961/src/Makefile.am -+++ coreutils-6.9.89.48-96961/src/Makefile.am -@@ -135,6 +135,10 @@ ginstall_LDADD += $(LIB_ACL) - - stat_LDADD = $(LDADD) $(LIB_SELINUX) - -+cp_LDADD += $(LIB_XATTR) -+mv_LDADD += $(LIB_XATTR) -+ginstall_LDADD += $(LIB_XATTR) -+ - $(PROGRAMS): ../lib/libcoreutils.a - - # Get the release year from ../lib/version-etc.c. ---- coreutils-6.9.89.48-96961/src/copy.c -+++ coreutils-6.9.89.48-96961/src/copy.c -@@ -56,6 +56,12 @@ - #include "areadlink.h" - #include "yesno.h" - -+#if USE_XATTR -+# include -+# include -+# include -+#endif -+ - #ifndef HAVE_FCHOWN - # define HAVE_FCHOWN false - # define fchown(fd, uid, gid) (-1) -@@ -113,6 +119,98 @@ is_ancestor (const struct stat *sb, cons - return false; - } - -+#if USE_XATTR -+static void -+copy_xattr_error (struct error_context *ctx, const char *fmt, ...) -+{ -+ int err = errno; -+ va_list ap; -+ int len; -+ char *buffer; -+ -+ /* There is no error function that takes a va_list argument, -+ so we print the message in a buffer first. */ -+ -+ va_start (ap, fmt); -+ len = vsnprintf (NULL, 0, fmt, ap); -+ va_end (ap); -+ if (len > 0) -+ { -+ buffer = xmalloc (len + 1); -+ va_start (ap, fmt); -+ vsnprintf (buffer, len + 1, fmt, ap); -+ va_end (ap); -+ error (0, err, "%s", buffer); -+ free (buffer); -+ } -+} -+ -+static const char * -+copy_xattr_quote (struct error_context *ctx, const char *str) -+{ -+ return xstrdup (quote (str)); -+} -+ -+static void -+copy_xattr_free (struct error_context *ctx, const char *str) -+{ -+ free ((void *) str); -+} -+ -+struct copy_xattr_context { -+ struct error_context ctx; -+ struct cp_options *x; -+}; -+ -+static int -+copy_xattr_filter (const char *name, struct error_context *ctx) -+{ -+ struct copy_xattr_context *copy_ctx = (struct copy_xattr_context *) ctx; -+ int action; -+ -+ /* We handle POSIX ACLs separately. */ -+ if (!strcmp(name, "system.posix_acl_access") -+ || !strcmp(name, "system.posix_acl_default")) -+ return 0; -+ -+ action = attr_copy_action(name, ctx); -+ return (action != ATTR_ACTION_SKIP && -+ (!copy_ctx->x->preserve_mode -+ || action != ATTR_ACTION_PERMISSIONS)); -+} -+#endif /* USE_XATTR */ -+ -+static bool -+copy_xattrs (const char *src_path, int source_desc, const char *dst_path, -+ int dest_desc, const struct cp_options *x) -+{ -+ struct copy_xattr_context copy_xattr_ctx = { -+ { copy_xattr_error, -+ copy_xattr_quote, -+ copy_xattr_free }, -+ x -+ }; -+ -+#if USE_XATTR -+ if (x->preserve_xattrs) -+ { -+ int ret; -+ -+ if (source_desc != -1 && dest_desc != -1) -+ ret = attr_copy_fd(src_path, source_desc, dst_path, dest_desc, -+ copy_xattr_filter, ©_xattr_ctx.ctx); -+ else -+ ret = attr_copy_file (src_path, dst_path, -+ copy_xattr_filter, ©_xattr_ctx.ctx); -+ return ret == 0 || !x->require_preserve; -+ } -+ else -+ return true; -+#else /* USE_XATTR */ -+ return true; -+#endif /* USE_XATTR */ -+} -+ - /* Read the contents of the directory SRC_NAME_IN, and recursively - copy the contents to DST_NAME_IN. NEW_DST is true if - DST_NAME_IN is a directory that was created previously in the -@@ -640,6 +738,9 @@ copy_reg (char const *src_name, char con - } - } - -+ if (!copy_xattrs (src_name, source_desc, dst_name, dest_desc, x)) -+ return_val = false; -+ - set_author (dst_name, dest_desc, src_sb); - - if (x->preserve_mode || x->move_mode) -@@ -1939,6 +2040,9 @@ copy_internal (char const *src_name, cha - } - } - -+ if (!copy_xattrs (src_name, -1, dst_name, -1, x)) -+ delayed_ok = false; -+ - set_author (dst_name, -1, &src_sb); - - if (x->preserve_mode || x->move_mode) ---- coreutils-6.9.89.48-96961/src/copy.h -+++ coreutils-6.9.89.48-96961/src/copy.h -@@ -134,6 +134,9 @@ struct cp_options - bool preserve_mode; - bool preserve_timestamps; - -+ /* If true, attempt to copy extended attributes. */ -+ bool preserve_xattrs; -+ - /* Enabled for mv, and for cp by the --preserve=links option. - If true, attempt to preserve in the destination files any - logical hard links between the source files. If used with cp's ---- coreutils-6.9.89.48-96961/src/cp.c -+++ coreutils-6.9.89.48-96961/src/cp.c -@@ -197,7 +197,8 @@ Mandatory arguments to long options are - -p same as --preserve=mode,ownership,timestamps\n\ - --preserve[=ATTR_LIST] preserve the specified attributes (default:\n\ - mode,ownership,timestamps), if possible\n\ -- additional attributes: context, links, all\n\ -+ additional attributes: context, links,\n\ -+ xattrs, all\n\ - "), stdout); - fputs (_("\ - --no-preserve=ATTR_LIST don't preserve the specified attributes\n\ -@@ -751,6 +752,7 @@ cp_option_init (struct cp_options *x) - x->preserve_links = false; - x->preserve_mode = false; - x->preserve_timestamps = false; -+ x->preserve_xattrs = false; - x->preserve_security_context = false; - x->require_preserve_context = false; - -@@ -788,19 +790,21 @@ decode_preserve_arg (char const *arg, st - PRESERVE_TIMESTAMPS, - PRESERVE_OWNERSHIP, - PRESERVE_LINK, -+ PRESERVE_XATTRS, - PRESERVE_CONTEXT, - PRESERVE_ALL - }; - static enum File_attribute const preserve_vals[] = - { - PRESERVE_MODE, PRESERVE_TIMESTAMPS, -- PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_CONTEXT, PRESERVE_ALL -+ PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_XATTRS, PRESERVE_CONTEXT, -+ PRESERVE_ALL - }; - /* Valid arguments to the `--preserve' option. */ - static char const* const preserve_args[] = - { - "mode", "timestamps", -- "ownership", "links", "context", "all", NULL -+ "ownership", "links", "xattrs", "context", "all", NULL - }; - ARGMATCH_VERIFY (preserve_args, preserve_vals); - -@@ -836,6 +840,10 @@ decode_preserve_arg (char const *arg, st - x->preserve_links = on_off; - break; - -+ case PRESERVE_XATTRS: -+ x->preserve_xattrs = on_off; -+ break; -+ - case PRESERVE_CONTEXT: - x->preserve_security_context = on_off; - x->require_preserve_context = on_off; -@@ -846,6 +854,7 @@ decode_preserve_arg (char const *arg, st - x->preserve_timestamps = on_off; - x->preserve_ownership = on_off; - x->preserve_links = on_off; -+ x->preserve_xattrs = on_off; - if (selinux_enabled) - x->preserve_security_context = on_off; - break; ---- coreutils-6.9.89.48-96961/src/install.c -+++ coreutils-6.9.89.48-96961/src/install.c -@@ -176,6 +176,7 @@ cp_option_init (struct cp_options *x) - x->preserve_links = false; - x->preserve_mode = false; - x->preserve_timestamps = false; -+ x->preserve_xattrs = false; - x->require_preserve = false; - x->require_preserve_context = false; - x->recursive = false; ---- coreutils-6.9.89.48-96961/src/mv.c -+++ coreutils-6.9.89.48-96961/src/mv.c -@@ -136,6 +136,7 @@ cp_option_init (struct cp_options *x) - x->preserve_links = true; - x->preserve_mode = true; - x->preserve_timestamps = true; -+ x->preserve_xattrs = true; - x->preserve_security_context = selinux_enabled; - x->require_preserve = false; /* FIXME: maybe make this an option */ - x->require_preserve_context = false; diff --git a/coreutils.changes b/coreutils.changes index 67a417e..bc00f83 100644 --- a/coreutils.changes +++ b/coreutils.changes @@ -1,3 +1,53 @@ +------------------------------------------------------------------- +Sun Feb 22 10:49:52 CET 2009 - schwab@suse.de + +- Update to coreutils 7.1. + ** New features + Add extended attribute support available on certain filesystems like ext2 + and XFS. + cp: Tries to copy xattrs when --preserve=xattr or --preserve=all specified + mv: Always tries to copy xattrs + install: Never copies xattrs + cp and mv accept a new option, --no-clobber (-n): silently refrain + from overwriting any existing destination file + dd accepts iflag=cio and oflag=cio to open the file in CIO (concurrent I/O) + mode where this feature is available. + install accepts a new option, --compare (-C): compare each pair of source + and destination files, and if the destination has identical content and + any specified owner, group, permissions, and possibly SELinux context, then + do not modify the destination at all. + ls --color now highlights hard linked files, too + stat -f recognizes the Lustre file system type + ** Bug fixes + chgrp, chmod, chown --silent (--quiet, -f) no longer print some diagnostics + [bug introduced in coreutils-5.1] + cp uses much less memory in some situations + cp -a now correctly tries to preserve SELinux context (announced in 6.9.90), + doesn't inform about failure, unlike with --preserve=all + du --files0-from=FILE no longer reads all of FILE into RAM before + processing the first file name + seq 9223372036854775807 9223372036854775808 now prints only two numbers + on systems with extended long double support and good library support. + Even with this patch, on some systems, it still produces invalid output, + from 3 to at least 1026 lines long. [bug introduced in coreutils-6.11] + seq -w now accounts for a decimal point added to the last number + to correctly print all numbers to the same width. + wc --files0-from=FILE no longer reads all of FILE into RAM, before + processing the first file name, unless the list of names is known + to be small enough. + ** Changes in behavior + cp and mv: the --reply={yes,no,query} option has been removed. + Using it has elicited a warning for the last three years. + dd: user specified offsets that are too big are handled better. + Previously, erroneous parameters to skip and seek could result + in redundant reading of the file with no warnings or errors. + du: -H (initially equivalent to --si) is now equivalent to + --dereference-args, and thus works as POSIX requires + shred: now does 3 overwrite passes by default rather than 25. + ls -l now marks SELinux-only files with the less obtrusive '.', + rather than '+'. A file with any other combination of MAC and ACL + is still marked with a '+'. + ------------------------------------------------------------------- Wed Nov 19 12:42:10 CET 2008 - werner@suse.de diff --git a/coreutils.spec b/coreutils.spec index 493ed1c..894c907 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,7 +1,7 @@ # -# spec file for package coreutils (Version 6.12) +# spec file for package coreutils (Version 7.1) # -# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,24 +19,22 @@ Name: coreutils Summary: GNU Core Utilities -BuildRequires: help2man libacl-devel libselinux-devel pam-devel +BuildRequires: help2man libacl-devel libcap-devel libselinux-devel pam-devel xz Url: http://www.gnu.org/software/coreutils/ License: GNU Free Documentation License, Version 1.2 (GFDL 1.2); GPL v2 or later; GPL v3 or later Group: System/Base -Version: 6.12 -Release: 32 +Version: 7.1 +Release: 1 Provides: fileutils sh-utils stat textutils mktemp Obsoletes: fileutils sh-utils stat textutils mktemp Obsoletes: libselinux <= 1.23.11-3 libselinux-32bit = 9 libselinux-64bit = 9 libselinux-x86 = 9 AutoReqProv: on PreReq: %{install_info_prereq} Requires: %{name}-lang = %version -Source: coreutils-%{version}.tar.gz +Source: coreutils-%{version}.tar.xz Source1: su.pamd Source2: su.default Patch: coreutils-%{version}.diff -Patch1: coreutils-xattr.diff -Patch30: coreutils-changelog.diff Patch4: coreutils-5.3.0-i18n-0.1.patch Patch5: i18n-uninit.diff Patch6: i18n-infloop.diff @@ -49,7 +47,6 @@ Patch20: coreutils-6.8-su.diff Patch21: coreutils-6.8.0-pie.diff Patch22: coreutils-5.3.0-sbin4su.diff Patch23: coreutils-getaddrinfo.diff -Patch24: utimens.diff Patch25: coreutils-cifs-afs.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -63,8 +60,8 @@ factor false fmt fold groups head id install join kill link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf sleep sort split -stat stty su sum sync tac tail tee test touch tr true tsort tty uname -unexpand uniq unlink uptime users vdir wc who whoami yes +stat stty su sum sync tac tail tee test timeout touch tr true tsort tty +uname unexpand uniq unlink uptime users vdir wc who whoami yes @@ -107,7 +104,6 @@ Authors: %lang_package %prep %setup -q -%patch1 -p1 %patch4 -p1 %patch5 %patch6 @@ -121,11 +117,10 @@ Authors: %patch21 %patch22 %patch23 -p1 -%patch24 -p1 %patch25 %build -AUTOPOINT=true autoreconf -fi +#AUTOPOINT=true autoreconf -fi ./configure CFLAGS="$RPM_OPT_FLAGS -Wall" \ --prefix=%{_prefix} --mandir=%{_mandir} \ --infodir=%{_infodir} --without-included-regex \ @@ -138,13 +133,13 @@ make %{?jobs:-j%jobs} PAMLIBS="-lpam -ldl" %check if test $EUID -eq 0; then - su nobody -c make check VERBOSE=yes - make check-root VERBOSE=yes + su nobody -c make %{?jobs:-j%jobs} check VERBOSE=yes + make %{?jobs:-j%jobs} check-root VERBOSE=yes else %ifarch %arm - make -k check VERBOSE=yes || echo make check failed + make -k %{?jobs:-j%jobs} check VERBOSE=yes || echo make check failed %else - make check VERBOSE=yes + make %{?jobs:-j%jobs} check VERBOSE=yes %endif fi @@ -191,6 +186,53 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) %changelog +* Sun Feb 22 2009 schwab@suse.de +- Update to coreutils 7.1. + ** New features + Add extended attribute support available on certain filesystems like ext2 + and XFS. + cp: Tries to copy xattrs when --preserve=xattr or --preserve=all specified + mv: Always tries to copy xattrs + install: Never copies xattrs + cp and mv accept a new option, --no-clobber (-n): silently refrain + from overwriting any existing destination file + dd accepts iflag=cio and oflag=cio to open the file in CIO (concurrent I/O) + mode where this feature is available. + install accepts a new option, --compare (-C): compare each pair of source + and destination files, and if the destination has identical content and + any specified owner, group, permissions, and possibly SELinux context, then + do not modify the destination at all. + ls --color now highlights hard linked files, too + stat -f recognizes the Lustre file system type + ** Bug fixes + chgrp, chmod, chown --silent (--quiet, -f) no longer print some diagnostics + [bug introduced in coreutils-5.1] + cp uses much less memory in some situations + cp -a now correctly tries to preserve SELinux context (announced in 6.9.90), + doesn't inform about failure, unlike with --preserve=all + du --files0-from=FILE no longer reads all of FILE into RAM before + processing the first file name + seq 9223372036854775807 9223372036854775808 now prints only two numbers + on systems with extended long double support and good library support. + Even with this patch, on some systems, it still produces invalid output, + from 3 to at least 1026 lines long. [bug introduced in coreutils-6.11] + seq -w now accounts for a decimal point added to the last number + to correctly print all numbers to the same width. + wc --files0-from=FILE no longer reads all of FILE into RAM, before + processing the first file name, unless the list of names is known + to be small enough. + ** Changes in behavior + cp and mv: the --reply={yes,no,query} option has been removed. + Using it has elicited a warning for the last three years. + dd: user specified offsets that are too big are handled better. + Previously, erroneous parameters to skip and seek could result + in redundant reading of the file with no warnings or errors. + du: -H (initially equivalent to --si) is now equivalent to + --dereference-args, and thus works as POSIX requires + shred: now does 3 overwrite passes by default rather than 25. + ls -l now marks SELinux-only files with the less obtrusive '.', + rather than '+'. A file with any other combination of MAC and ACL + is still marked with a '+'. * Wed Nov 19 2008 werner@suse.de - Enable stat(1) to detect (k)AFS and CIFS network file systems * Tue Nov 18 2008 schwab@suse.de diff --git a/utimens.diff b/utimens.diff deleted file mode 100644 index 6067662..0000000 --- a/utimens.diff +++ /dev/null @@ -1,112 +0,0 @@ -2008-06-02 Eric Blake - - Provide fallback for older kernels. - * lib/utimens.c (gl_futimens) [HAVE_UTIMENSAT, HAVE_FUTIMENS]: - Provide runtime fallback if kernel lacks support. - Reported by Mike Frysinger. - -diff --git a/lib/utimens.c b/lib/utimens.c -index 25bc965..134310b 100644 ---- a/lib/utimens.c -+++ b/lib/utimens.c -@@ -96,20 +96,30 @@ gl_futimens (int fd ATTRIBUTE_UNUSED, - #endif - - /* POSIX 200x added two interfaces to set file timestamps with -- nanosecond resolution. */ -+ nanosecond resolution. We provide a fallback for ENOSYS (for -+ example, compiling against Linux 2.6.25 kernel headers and glibc -+ 2.7, but running on Linux 2.6.18 kernel). */ - #if HAVE_UTIMENSAT - if (fd < 0) -- return utimensat (AT_FDCWD, file, timespec, 0); -+ { -+ int result = utimensat (AT_FDCWD, file, timespec, 0); -+ if (result == 0 || errno != ENOSYS) -+ return result; -+ } - #endif - #if HAVE_FUTIMENS -- return futimens (fd, timespec); --#else -+ { -+ int result = futimens (fd, timespec); -+ if (result == 0 || errno != ENOSYS) -+ return result; -+ } -+#endif - - /* The platform lacks an interface to set file timestamps with - nanosecond resolution, so do the best we can, discarding any - fractional part of the timestamp. */ - { --# if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES -+#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES - struct timeval timeval[2]; - struct timeval const *t; - if (timespec) -@@ -125,9 +135,9 @@ gl_futimens (int fd ATTRIBUTE_UNUSED, - - if (fd < 0) - { --# if HAVE_FUTIMESAT -+# if HAVE_FUTIMESAT - return futimesat (AT_FDCWD, file, t); --# endif -+# endif - } - else - { -@@ -141,21 +151,21 @@ gl_futimens (int fd ATTRIBUTE_UNUSED, - worth optimizing, and who knows what other messed-up systems - are out there? So play it safe and fall back on the code - below. */ --# if HAVE_FUTIMESAT -+# if HAVE_FUTIMESAT - if (futimesat (fd, NULL, t) == 0) - return 0; --# elif HAVE_FUTIMES -+# elif HAVE_FUTIMES - if (futimes (fd, t) == 0) - return 0; --# endif -+# endif - } --# endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */ -+#endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */ - - if (!file) - { --# if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES)) -+#if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES)) - errno = ENOSYS; --# endif -+#endif - - /* Prefer EBADF to ENOSYS if both error numbers apply. */ - if (errno == ENOSYS) -@@ -170,9 +180,9 @@ gl_futimens (int fd ATTRIBUTE_UNUSED, - return -1; - } - --# if HAVE_WORKING_UTIMES -+#if HAVE_WORKING_UTIMES - return utimes (file, t); --# else -+#else - { - struct utimbuf utimbuf; - struct utimbuf const *ut; -@@ -187,9 +197,8 @@ gl_futimens (int fd ATTRIBUTE_UNUSED, - - return utime (file, ut); - } --# endif /* !HAVE_WORKING_UTIMES */ -+#endif /* !HAVE_WORKING_UTIMES */ - } --#endif /* !HAVE_FUTIMENS */ - } - - /* Set the access and modification time stamps of FILE to be --- -1.5.5.1