--- coreutils-5.97.orig/debian/patches/60_syntaxdeprecations +++ coreutils-5.97/debian/patches/60_syntaxdeprecations @@ -0,0 +1,31 @@ +--- coreutils-5.97/src/sort.c.orig 2006-05-27 09:14:40.522596720 -0400 ++++ coreutils-5.97/src/sort.c 2006-05-27 09:18:02.167849973 -0400 +@@ -2218,7 +2218,7 @@ + { + case 1: + key = NULL; +- if (obsolete_usage && optarg[0] == '+') ++ if (optarg[0] == '+') + { + /* Treat +POS1 [-POS2] as a key if possible; but silently + treat an operand as a file if it is not a valid +POS1. */ +@@ -2235,6 +2235,8 @@ + } + else + { ++ if (!obsolete_usage) ++ fprintf(stderr, "%s: Warning: \"+number\" syntax is deprecated, please use \"-k number\"\n", program_name); + if (optind != argc && argv[optind][0] == '-' + && ISDIGIT (argv[optind][1])) + { +--- coreutils-5.97/src/tail.c.orig 2006-05-27 09:08:25.594209539 -0400 ++++ coreutils-5.97/src/tail.c 2006-05-27 09:13:32.219736766 -0400 +@@ -1401,7 +1401,7 @@ + case '+': + /* Leading "+" is a file name in the non-obsolete form. */ + if (!obsolete_usage) +- return false; ++ fprintf(stderr, "%s: Warning: \"+number\" syntax is deprecated, please use \"-n +number\"\n", program_name); + + t_from_start = true; + break; --- coreutils-5.97.orig/debian/patches/99_pwd_long +++ coreutils-5.97/debian/patches/99_pwd_long @@ -0,0 +1,62 @@ +diff -ruN coreutils-5.97-old/tests/misc/pwd-long coreutils-5.97/tests/misc/pwd-long +--- coreutils-5.97-old/tests/misc/pwd-long 2006-06-05 22:51:23.000000000 -0500 ++++ coreutils-5.97/tests/misc/pwd-long 2007-01-23 14:22:37.000000000 -0600 +@@ -33,14 +33,39 @@ + # Show that pwd works even when the length of the resulting + # directory name is longer than PATH_MAX. + use strict; +-use Cwd; + + (my $ME = $ENV{ARGV_0}) =~ s|.*/||; + +-my $cwd = $ENV{CWD}; ++sub normalize_to_cwd_relative ($$$) ++{ ++ my ($dir, $dev, $ino) = @_; ++ my $slash = -1; ++ my $next_slash; ++ while (1) ++ { ++ $slash = index $dir, '/', $slash + 1; ++ $slash <= -1 ++ and die "$ME: $dir does not contain old CWD\n"; ++ my $dir_prefix = $slash ? substr ($dir, 0, $slash) : '/'; ++ my ($d, $i) = (stat $dir_prefix)[0, 1]; ++ $d == $dev && $i == $ino ++ and return substr $dir, $slash + 1; ++ } ++} ++ ++# Set up a safe, well-known environment ++delete @ENV{qw(BASH_ENV CDPATH ENV PATH)}; ++$ENV{IFS} = ''; ++ ++# Save CWD's device and inode numbers. ++my ($dev, $ino) = (stat '.')[0, 1]; ++ ++# Construct the expected "."-relative part of pwd's output. + my $z = 'z' x 31; + my $n = 256; +-my $expected = $cwd . ("/$z" x $n); ++my $expected = "/$z" x $n; ++# Remove the leading "/". ++substr ($expected, 0, 1) = ''; + + my $i = 0; + do +@@ -58,6 +83,15 @@ + -x $pwd_binary + or die "$ME: $pwd_binary is not an executable file\n"; + chomp (my $actual = `$pwd_binary`); ++ ++# Convert the absolute name from pwd into a $CWD-relative name. ++# This is necessary in order to avoid a spurious failure when run ++# from a directory in a bind-mounted partition. What happens is ++# pwd reads a ".." that contains two or more entries with identical ++# dev,ino that match the ones we're looking for, and it chooses a ++# name that does not correspond to the one already recorded in $CWD. ++$actual = normalize_to_cwd_relative $actual, $dev, $ino; ++ + $expected eq $actual + or die "$ME: $expected\n$actual\n"; + EOF --- coreutils-5.97.orig/debian/patches/99a_fix_cp_manpage +++ coreutils-5.97/debian/patches/99a_fix_cp_manpage @@ -0,0 +1,85 @@ +diff --exclude='*~' --exclude='*.orig' -ruN orig/coreutils-5.97/Makefile.am coreutils-5.96/Makefile.am +--- orig/coreutils-5.97/Makefile.am 2005-11-02 13:12:28.000000000 +0000 ++++ coreutils-5.97/Makefile.am 2006-07-04 18:45:25.000000000 +0100 +@@ -8,6 +8,7 @@ + .x-sc_unmarked_diagnostics \ + .x-sc_useless_cpp_parens \ + .x-sc_no_if_have_config_h \ ++ .x-sc_two_space_separator_in_usage \ + announce-gen \ + m4/ChangeLog \ + old/fileutils/ChangeLog \ +diff --exclude='*~' --exclude='*.orig' -ruN orig/coreutils-5.97/Makefile.maint coreutils-5.96/Makefile.maint +--- orig/coreutils-5.97/Makefile.maint 2006-02-13 12:50:29.000000000 +0000 ++++ coreutils-5.97/Makefile.maint 2006-07-04 18:44:52.000000000 +0100 +@@ -85,6 +85,7 @@ + sc_system_h_headers \ + sc_tight_scope \ + sc_trailing_blank \ ++ sc_two_space_separator_in_usage \ + sc_unmarked_diagnostics \ + sc_useless_cpp_parens + +@@ -255,6 +256,14 @@ + { echo '$(ME): found trailing blank(s)' \ + 1>&2; exit 1; } || : + ++sc_two_space_separator_in_usage: ++ @( $(CVS_LIST) ) > /dev/null 2>&1 || : && \ ++ grep '^ *--[a-z][0-9A-Za-z-]* [^ ].*\\$$' \ ++ $$($(CVS_LIST) | grep 'src/.*\.c$$' | grep -vEf .x-$@) && \ ++ { echo "$(ME): help2man requires at least two spaces between"; \ ++ echo "$(ME): an option and its description"; \ ++ 1>&2; exit 1; } || : ++ + # Look for diagnostics that aren't marked for translation. + # This won't find any for which error's format string is on a separate line. + sc_unmarked_diagnostics: +diff --exclude='*~' --exclude='*.orig' -ruN orig/coreutils-5.97/src/chgrp.c coreutils-5.96/src/chgrp.c +--- orig/coreutils-5.97/src/chgrp.c 2005-05-30 08:31:31.000000000 +0100 ++++ coreutils-5.97/src/chgrp.c 2006-07-04 18:44:52.000000000 +0100 +@@ -124,7 +124,7 @@ + ownership of a symlink)\n\ + "), stdout); + fputs (_("\ +- --no-preserve-root do not treat `/' specially (the default)\n\ ++ --no-preserve-root do not treat `/' specially (the default)\n\ + --preserve-root fail to operate recursively on `/'\n\ + "), stdout); + fputs (_("\ +diff --exclude='*~' --exclude='*.orig' -ruN orig/coreutils-5.97/src/chown.c coreutils-5.96/src/chown.c +--- orig/coreutils-5.97/src/chown.c 2005-05-14 08:58:36.000000000 +0100 ++++ coreutils-5.97/src/chown.c 2006-07-04 18:44:52.000000000 +0100 +@@ -117,7 +117,7 @@ + is not required for the omitted attribute.\n\ + "), stdout); + fputs (_("\ +- --no-preserve-root do not treat `/' specially (the default)\n\ ++ --no-preserve-root do not treat `/' specially (the default)\n\ + --preserve-root fail to operate recursively on `/'\n\ + "), stdout); + fputs (_("\ +diff --exclude='*~' --exclude='*.orig' -ruN orig/coreutils-5.97/src/rm.c coreutils-5.96/src/rm.c +--- orig/coreutils-5.97/src/rm.c 2005-08-29 22:13:32.000000000 +0100 ++++ coreutils-5.97/src/rm.c 2006-07-04 18:44:52.000000000 +0100 +@@ -144,7 +144,7 @@ + -i, --interactive prompt before any removal\n\ + "), stdout); + fputs (_("\ +- --no-preserve-root do not treat `/' specially (the default)\n\ ++ --no-preserve-root do not treat `/' specially (the default)\n\ + --preserve-root fail to operate recursively on `/'\n\ + -r, -R, --recursive remove directories and their contents recursively\n\ + -v, --verbose explain what is being done\n\ +diff --exclude='*~' --exclude='*.orig' -ruN orig/coreutils-5.97/src/unexpand.c coreutils-5.96/src/unexpand.c +--- orig/coreutils-5.97/src/unexpand.c 2005-08-12 08:16:25.000000000 +0100 ++++ coreutils-5.97/src/unexpand.c 2006-07-04 18:44:52.000000000 +0100 +@@ -132,7 +132,7 @@ + "), stdout); + fputs (_("\ + -a, --all convert all blanks, instead of just initial blanks\n\ +- --first-only convert only leading sequences of blanks (overrides -a)\n\ ++ --first-only convert only leading sequences of blanks (overrides -a)\n\ + -t, --tabs=N have tabs N characters apart instead of 8 (enables -a)\n\ + -t, --tabs=LIST use comma separated LIST of tab positions (enables -a)\n\ + "), stdout); --- coreutils-5.97.orig/debian/patches/70_sha2.patch +++ coreutils-5.97/debian/patches/70_sha2.patch @@ -0,0 +1,2235 @@ +diff -Nru coreutils-5.97.orig/AUTHORS coreutils-5.97/AUTHORS +--- coreutils-5.97.orig/AUTHORS 2004-11-04 00:10:50.000000000 +0100 ++++ coreutils-5.97/AUTHORS 2006-08-03 22:50:21.000000000 +0200 +@@ -39,7 +39,7 @@ + ln: Mike Parker, David MacKenzie + logname: FIXME: unknown + ls: Richard Stallman, David MacKenzie +-md5sum: Ulrich Drepper, Scott Miller ++md5sum: Ulrich Drepper, Scott Miller, David Madore + mkdir: David MacKenzie + mkfifo: David MacKenzie + mknod: David MacKenzie +@@ -60,7 +60,11 @@ + rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering + rmdir: David MacKenzie + seq: Ulrich Drepper +-sha1sum: Ulrich Drepper, Scott Miller ++sha1sum: Ulrich Drepper, Scott Miller, David Madore ++sha224sum: Ulrich Drepper, Scott Miller, David Madore ++sha256sum: Ulrich Drepper, Scott Miller, David Madore ++sha384sum: Ulrich Drepper, Scott Miller, David Madore ++sha512sum: Ulrich Drepper, Scott Miller, David Madore + shred: Colin Plumb + sleep: Jim Meyering, Paul Eggert + sort: Mike Haertel, Paul Eggert +diff -Nru coreutils-5.97.orig/README coreutils-5.97/README +--- coreutils-5.97.orig/README 2006-08-03 22:58:18.000000000 +0200 ++++ coreutils-5.97/README 2006-08-03 22:50:21.000000000 +0200 +@@ -11,8 +11,9 @@ + df dir dircolors dirname du echo env expand expr factor false fmt fold + ginstall groups head hostid hostname id join kill link ln logname ls + md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr +- printenv printf ptx pwd readlink rm rmdir runcon seq sha1sum shred sleep sort +- split stat stty su sum sync tac tail tee test touch tr true tsort tty ++ printenv printf ptx pwd readlink rm rmdir runcon seq sha1sum ++ sha224sum sha256sum sha384sum sha512sum shred sleep sort split stat ++ stty su sum sync tac tail tee test touch tr true tsort tty + uname unexpand uniq unlink uptime users vdir wc who whoami yes + + See the file NEWS for a list of major changes in the current release. +diff -Nru coreutils-5.97.orig/config/compile coreutils-5.97/config/compile +--- coreutils-5.97.orig/config/compile 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/config/compile 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,136 @@ ++#! /bin/sh ++# Wrapper for compilers which do not understand `-c -o'. ++ ++scriptversion=2003-11-09.00 ++ ++# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. ++# Written by Tom Tromey . ++# ++# 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. ++ ++# As a special exception to the GNU General Public License, if you ++# distribute this file as part of a program that contains a ++# configuration script generated by Autoconf, you may include it under ++# the same distribution terms that you use for the rest of that program. ++ ++# This file is maintained in Automake, please report ++# bugs to or send patches to ++# . ++ ++case $1 in ++ '') ++ echo "$0: No command. Try \`$0 --help' for more information." 1>&2 ++ exit 1; ++ ;; ++ -h | --h*) ++ cat <<\EOF ++Usage: compile [--help] [--version] PROGRAM [ARGS] ++ ++Wrapper for compilers which do not understand `-c -o'. ++Remove `-o dest.o' from ARGS, run PROGRAM with the remaining ++arguments, and rename the output as expected. ++ ++If you are trying to build a whole package this is not the ++right script to run: please start by reading the file `INSTALL'. ++ ++Report bugs to . ++EOF ++ exit 0 ++ ;; ++ -v | --v*) ++ echo "compile $scriptversion" ++ exit 0 ++ ;; ++esac ++ ++ ++prog=$1 ++shift ++ ++ofile= ++cfile= ++args= ++while test $# -gt 0; do ++ case "$1" in ++ -o) ++ # configure might choose to run compile as `compile cc -o foo foo.c'. ++ # So we do something ugly here. ++ ofile=$2 ++ shift ++ case "$ofile" in ++ *.o | *.obj) ++ ;; ++ *) ++ args="$args -o $ofile" ++ ofile= ++ ;; ++ esac ++ ;; ++ *.c) ++ cfile=$1 ++ args="$args $1" ++ ;; ++ *) ++ args="$args $1" ++ ;; ++ esac ++ shift ++done ++ ++if test -z "$ofile" || test -z "$cfile"; then ++ # If no `-o' option was seen then we might have been invoked from a ++ # pattern rule where we don't need one. That is ok -- this is a ++ # normal compilation that the losing compiler can handle. If no ++ # `.c' file was seen then we are probably linking. That is also ++ # ok. ++ exec "$prog" $args ++fi ++ ++# Name of file we expect compiler to create. ++cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` ++ ++# Create the lock directory. ++# Note: use `[/.-]' here to ensure that we don't use the same name ++# that we are using for the .o file. Also, base the name on the expected ++# object file name, since that is what matters with a parallel build. ++lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d ++while true; do ++ if mkdir $lockdir > /dev/null 2>&1; then ++ break ++ fi ++ sleep 1 ++done ++# FIXME: race condition here if user kills between mkdir and trap. ++trap "rmdir $lockdir; exit 1" 1 2 15 ++ ++# Run the compile. ++"$prog" $args ++status=$? ++ ++if test -f "$cofile"; then ++ mv "$cofile" "$ofile" ++fi ++ ++rmdir $lockdir ++exit $status ++ ++# Local Variables: ++# mode: shell-script ++# sh-indentation: 2 ++# eval: (add-hook 'write-file-hooks 'time-stamp) ++# time-stamp-start: "scriptversion=" ++# time-stamp-format: "%:y-%02m-%02d.%02H" ++# time-stamp-end: "$" ++# End: +diff -Nru coreutils-5.97.orig/configure.ac coreutils-5.97/configure.ac +--- coreutils-5.97.orig/configure.ac 2006-08-03 22:58:18.000000000 +0200 ++++ coreutils-5.97/configure.ac 2006-08-03 22:50:21.000000000 +0200 +@@ -299,6 +299,10 @@ + tests/rmdir/Makefile + tests/seq/Makefile + tests/sha1sum/Makefile ++ tests/sha224sum/Makefile ++ tests/sha256sum/Makefile ++ tests/sha384sum/Makefile ++ tests/sha512sum/Makefile + tests/shred/Makefile + tests/sort/Makefile + tests/stty/Makefile +diff -Nru coreutils-5.97.orig/lib/sha256.c coreutils-5.97/lib/sha256.c +--- coreutils-5.97.orig/lib/sha256.c 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/lib/sha256.c 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,552 @@ ++/* sha256.c - Functions to compute SHA256 and SHA224 message digest of files or ++ memory blocks according to the NIST specification FIPS-180-2. ++ ++ Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by the ++ 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ ++ ++/* Written by David Madore, considerably copypasting from ++ Scott G. Miller's sha1.c ++*/ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include "sha256.h" ++ ++#include ++#include ++ ++#if USE_UNLOCKED_IO ++# include "unlocked-io.h" ++#endif ++ ++/* SWAP does an endian swap on architectures that are little-endian, ++ as SHA256 needs some data in a big-endian form. */ ++ ++#ifdef WORDS_BIGENDIAN ++# define SWAP(n) (n) ++#else ++# define SWAP(n) \ ++ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) ++#endif ++ ++#define BLOCKSIZE 4096 ++#if BLOCKSIZE % 64 != 0 ++# error "invalid BLOCKSIZE" ++#endif ++ ++/* This array contains the bytes used to pad the buffer to the next ++ 64-byte boundary. */ ++static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; ++ ++ ++/* ++ Takes a pointer to a 256 bit block of data (eight 32 bit ints) and ++ intializes it to the start constants of the SHA256 algorithm. This ++ must be called before using hash in the call to sha256_hash ++*/ ++void ++sha256_init_ctx (struct sha256_ctx *ctx) ++{ ++ ctx->state[0] = 0x6a09e667UL; ++ ctx->state[1] = 0xbb67ae85UL; ++ ctx->state[2] = 0x3c6ef372UL; ++ ctx->state[3] = 0xa54ff53aUL; ++ ctx->state[4] = 0x510e527fUL; ++ ctx->state[5] = 0x9b05688cUL; ++ ctx->state[6] = 0x1f83d9abUL; ++ ctx->state[7] = 0x5be0cd19UL; ++ ++ ctx->total[0] = ctx->total[1] = 0; ++ ctx->buflen = 0; ++} ++ ++void ++sha224_init_ctx (struct sha256_ctx *ctx) ++{ ++ ctx->state[0] = 0xc1059ed8UL; ++ ctx->state[1] = 0x367cd507UL; ++ ctx->state[2] = 0x3070dd17UL; ++ ctx->state[3] = 0xf70e5939UL; ++ ctx->state[4] = 0xffc00b31UL; ++ ctx->state[5] = 0x68581511UL; ++ ctx->state[6] = 0x64f98fa7UL; ++ ctx->state[7] = 0xbefa4fa4UL; ++ ++ ctx->total[0] = ctx->total[1] = 0; ++ ctx->buflen = 0; ++} ++ ++/* Put result from CTX in first 32 bytes following RESBUF. The result ++ must be in little endian byte order. ++ ++ IMPORTANT: On some systems it is required that RESBUF is correctly ++ aligned for a 32 bits value. */ ++void * ++sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf) ++{ ++ int i; ++ ++ for ( i=0 ; i<8 ; i++ ) ++ ((md5_uint32 *) resbuf)[i] = SWAP (ctx->state[i]); ++ ++ return resbuf; ++} ++ ++void * ++sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf) ++{ ++ int i; ++ ++ for ( i=0 ; i<7 ; i++ ) ++ ((md5_uint32 *) resbuf)[i] = SWAP (ctx->state[i]); ++ ++ return resbuf; ++} ++ ++/* Process the remaining bytes in the internal buffer and the usual ++ prolog according to the standard and write the result to RESBUF. ++ ++ IMPORTANT: On some systems it is required that RESBUF is correctly ++ aligned for a 32 bits value. */ ++static void ++sha256_conclude_ctx (struct sha256_ctx *ctx) ++{ ++ /* Take yet unprocessed bytes into account. */ ++ md5_uint32 bytes = ctx->buflen; ++ size_t pad; ++ ++ /* Now count remaining bytes. */ ++ ctx->total[0] += bytes; ++ if (ctx->total[0] < bytes) ++ ++ctx->total[1]; ++ ++ pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; ++ memcpy (&ctx->buffer[bytes], fillbuf, pad); ++ ++ /* Put the 64-bit file length in *bits* at the end of the buffer. */ ++ *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP (ctx->total[0] << 3); ++ *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) | ++ (ctx->total[0] >> 29)); ++ ++ /* Process last bytes. */ ++ sha256_process_block (ctx->buffer, bytes + pad + 8, ctx); ++} ++ ++void * ++sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf) ++{ ++ sha256_conclude_ctx (ctx); ++ return sha256_read_ctx (ctx, resbuf); ++} ++ ++void * ++sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf) ++{ ++ sha256_conclude_ctx (ctx); ++ return sha224_read_ctx (ctx, resbuf); ++} ++ ++/* Compute SHA256 message digest for bytes read from STREAM. The ++ resulting message digest number will be written into the 32 bytes ++ beginning at RESBLOCK. */ ++int ++sha256_stream (FILE *stream, void *resblock) ++{ ++ struct sha256_ctx ctx; ++ char buffer[BLOCKSIZE + 72]; ++ size_t sum; ++ ++ /* Initialize the computation context. */ ++ sha256_init_ctx (&ctx); ++ ++ /* Iterate over full file contents. */ ++ while (1) ++ { ++ /* We read the file in blocks of BLOCKSIZE bytes. One call of the ++ computation function processes the whole buffer so that with the ++ next round of the loop another block can be read. */ ++ size_t n; ++ sum = 0; ++ ++ /* Read block. Take care for partial reads. */ ++ while (1) ++ { ++ n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); ++ ++ sum += n; ++ ++ if (sum == BLOCKSIZE) ++ break; ++ ++ if (n == 0) ++ { ++ /* Check for the error flag IFF N == 0, so that we don't ++ exit the loop after a partial read due to e.g., EAGAIN ++ or EWOULDBLOCK. */ ++ if (ferror (stream)) ++ return 1; ++ goto process_partial_block; ++ } ++ ++ /* We've read at least one byte, so ignore errors. But always ++ check for EOF, since feof may be true even though N > 0. ++ Otherwise, we could end up calling fread after EOF. */ ++ if (feof (stream)) ++ goto process_partial_block; ++ } ++ ++ /* Process buffer with BLOCKSIZE bytes. Note that ++ BLOCKSIZE % 64 == 0 ++ */ ++ sha256_process_block (buffer, BLOCKSIZE, &ctx); ++ } ++ ++ process_partial_block:; ++ ++ /* Process any remaining bytes. */ ++ if (sum > 0) ++ sha256_process_bytes (buffer, sum, &ctx); ++ ++ /* Construct result in desired memory. */ ++ sha256_finish_ctx (&ctx, resblock); ++ return 0; ++} ++ ++/* FIXME: Avoid code duplication */ ++int ++sha224_stream (FILE *stream, void *resblock) ++{ ++ struct sha256_ctx ctx; ++ char buffer[BLOCKSIZE + 72]; ++ size_t sum; ++ ++ /* Initialize the computation context. */ ++ sha224_init_ctx (&ctx); ++ ++ /* Iterate over full file contents. */ ++ while (1) ++ { ++ /* We read the file in blocks of BLOCKSIZE bytes. One call of the ++ computation function processes the whole buffer so that with the ++ next round of the loop another block can be read. */ ++ size_t n; ++ sum = 0; ++ ++ /* Read block. Take care for partial reads. */ ++ while (1) ++ { ++ n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); ++ ++ sum += n; ++ ++ if (sum == BLOCKSIZE) ++ break; ++ ++ if (n == 0) ++ { ++ /* Check for the error flag IFF N == 0, so that we don't ++ exit the loop after a partial read due to e.g., EAGAIN ++ or EWOULDBLOCK. */ ++ if (ferror (stream)) ++ return 1; ++ goto process_partial_block; ++ } ++ ++ /* We've read at least one byte, so ignore errors. But always ++ check for EOF, since feof may be true even though N > 0. ++ Otherwise, we could end up calling fread after EOF. */ ++ if (feof (stream)) ++ goto process_partial_block; ++ } ++ ++ /* Process buffer with BLOCKSIZE bytes. Note that ++ BLOCKSIZE % 64 == 0 ++ */ ++ sha256_process_block (buffer, BLOCKSIZE, &ctx); ++ } ++ ++ process_partial_block:; ++ ++ /* Process any remaining bytes. */ ++ if (sum > 0) ++ sha256_process_bytes (buffer, sum, &ctx); ++ ++ /* Construct result in desired memory. */ ++ sha224_finish_ctx (&ctx, resblock); ++ return 0; ++} ++ ++/* Compute SHA512 message digest for LEN bytes beginning at BUFFER. The ++ result is always in little endian byte order, so that a byte-wise ++ output yields to the wanted ASCII representation of the message ++ digest. */ ++void * ++sha256_buffer (const char *buffer, size_t len, void *resblock) ++{ ++ struct sha256_ctx ctx; ++ ++ /* Initialize the computation context. */ ++ sha256_init_ctx (&ctx); ++ ++ /* Process whole buffer but last len % 64 bytes. */ ++ sha256_process_bytes (buffer, len, &ctx); ++ ++ /* Put result in desired memory area. */ ++ return sha256_finish_ctx (&ctx, resblock); ++} ++ ++void * ++sha224_buffer (const char *buffer, size_t len, void *resblock) ++{ ++ struct sha256_ctx ctx; ++ ++ /* Initialize the computation context. */ ++ sha224_init_ctx (&ctx); ++ ++ /* Process whole buffer but last len % 64 bytes. */ ++ sha256_process_bytes (buffer, len, &ctx); ++ ++ /* Put result in desired memory area. */ ++ return sha224_finish_ctx (&ctx, resblock); ++} ++ ++void ++sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx) ++{ ++ /* When we already have some bits in our internal buffer concatenate ++ both inputs first. */ ++ if (ctx->buflen != 0) ++ { ++ size_t left_over = ctx->buflen; ++ size_t add = 128 - left_over > len ? len : 128 - left_over; ++ ++ memcpy (&ctx->buffer[left_over], buffer, add); ++ ctx->buflen += add; ++ ++ if (ctx->buflen > 64) ++ { ++ sha256_process_block (ctx->buffer, ctx->buflen & ~63, ctx); ++ ++ ctx->buflen &= 63; ++ /* The regions in the following copy operation cannot overlap. */ ++ memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], ++ ctx->buflen); ++ } ++ ++ buffer = (const char *) buffer + add; ++ len -= add; ++ } ++ ++ /* Process available complete blocks. */ ++ if (len >= 64) ++ { ++#if !_STRING_ARCH_unaligned ++# define alignof(type) offsetof (struct { char c; type x; }, x) ++# define UNALIGNED_P(p) (((size_t) p) % alignof (md5_uint32) != 0) ++ if (UNALIGNED_P (buffer)) ++ while (len > 64) ++ { ++ sha256_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); ++ buffer = (const char *) buffer + 64; ++ len -= 64; ++ } ++ else ++#endif ++ { ++ sha256_process_block (buffer, len & ~63, ctx); ++ buffer = (const char *) buffer + (len & ~63); ++ len &= 63; ++ } ++ } ++ ++ /* Move remaining bytes in internal buffer. */ ++ if (len > 0) ++ { ++ size_t left_over = ctx->buflen; ++ ++ memcpy (&ctx->buffer[left_over], buffer, len); ++ left_over += len; ++ if (left_over >= 64) ++ { ++ sha256_process_block (ctx->buffer, 64, ctx); ++ left_over -= 64; ++ memcpy (ctx->buffer, &ctx->buffer[64], left_over); ++ } ++ ctx->buflen = left_over; ++ } ++} ++ ++/* --- Code below is the primary difference between md5.c and sha256.c --- */ ++ ++/* SHA256 round constants */ ++#define K(I) sha256_round_constants[I] ++static const md5_uint32 sha256_round_constants[64] = { ++ 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, ++ 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, ++ 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, ++ 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, ++ 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, ++ 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, ++ 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, ++ 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, ++ 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, ++ 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, ++ 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, ++ 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, ++ 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, ++ 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, ++ 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, ++ 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL, ++}; ++ ++/* Round functions. */ ++#define F2(A,B,C) ( ( A & B ) | ( C & ( A | B ) ) ) ++#define F1(E,F,G) ( G ^ ( E & ( F ^ G ) ) ) ++ ++/* Process LEN bytes of BUFFER, accumulating context into CTX. ++ It is assumed that LEN % 64 == 0. ++ Most of this code comes from GnuPG's cipher/sha1.c. */ ++ ++void ++sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx) ++{ ++ const md5_uint32 *words = buffer; ++ size_t nwords = len / sizeof (md5_uint32); ++ const md5_uint32 *endp = words + nwords; ++ md5_uint32 x[16]; ++ md5_uint32 a = ctx->state[0]; ++ md5_uint32 b = ctx->state[1]; ++ md5_uint32 c = ctx->state[2]; ++ md5_uint32 d = ctx->state[3]; ++ md5_uint32 e = ctx->state[4]; ++ md5_uint32 f = ctx->state[5]; ++ md5_uint32 g = ctx->state[6]; ++ md5_uint32 h = ctx->state[7]; ++ ++ /* First increment the byte count. FIPS PUB 180-2 specifies the possible ++ length of the file up to 2^64 bits. Here we only compute the ++ number of bytes. Do a double word increment. */ ++ ctx->total[0] += len; ++ if (ctx->total[0] < len) ++ ++ctx->total[1]; ++ ++#define rol(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) ++ ++#define S0(x) (rol(x,25)^rol(x,14)^(x>>3)) ++#define S1(x) (rol(x,15)^rol(x,13)^(x>>10)) ++#define SS0(x) (rol(x,30)^rol(x,19)^rol(x,10)) ++#define SS1(x) (rol(x,26)^rol(x,21)^rol(x,7)) ++ ++#define M(I) ( tm = S1(x[(I-2)&0x0f]) + x[(I-7)&0x0f] \ ++ + S0(x[(I-15)&0x0f]) + x[I&0x0f] \ ++ , x[I&0x0f] = tm ) ++ ++#define R(A,B,C,D,E,F,G,H,K,M) do { t0 = SS0(A) + F2(A,B,C); \ ++ t1 = H + SS1(E) \ ++ + F1(E,F,G) \ ++ + K \ ++ + M; \ ++ D += t1; H = t0 + t1; \ ++ } while(0) ++ ++ while (words < endp) ++ { ++ md5_uint32 tm; ++ md5_uint32 t0, t1; ++ int t; ++ for (t = 0; t < 16; t++) ++ { ++ x[t] = SWAP (*words); ++ words++; ++ } ++ ++ R( a, b, c, d, e, f, g, h, K( 0), x[ 0] ); ++ R( h, a, b, c, d, e, f, g, K( 1), x[ 1] ); ++ R( g, h, a, b, c, d, e, f, K( 2), x[ 2] ); ++ R( f, g, h, a, b, c, d, e, K( 3), x[ 3] ); ++ R( e, f, g, h, a, b, c, d, K( 4), x[ 4] ); ++ R( d, e, f, g, h, a, b, c, K( 5), x[ 5] ); ++ R( c, d, e, f, g, h, a, b, K( 6), x[ 6] ); ++ R( b, c, d, e, f, g, h, a, K( 7), x[ 7] ); ++ R( a, b, c, d, e, f, g, h, K( 8), x[ 8] ); ++ R( h, a, b, c, d, e, f, g, K( 9), x[ 9] ); ++ R( g, h, a, b, c, d, e, f, K(10), x[10] ); ++ R( f, g, h, a, b, c, d, e, K(11), x[11] ); ++ R( e, f, g, h, a, b, c, d, K(12), x[12] ); ++ R( d, e, f, g, h, a, b, c, K(13), x[13] ); ++ R( c, d, e, f, g, h, a, b, K(14), x[14] ); ++ R( b, c, d, e, f, g, h, a, K(15), x[15] ); ++ R( a, b, c, d, e, f, g, h, K(16), M(16) ); ++ R( h, a, b, c, d, e, f, g, K(17), M(17) ); ++ R( g, h, a, b, c, d, e, f, K(18), M(18) ); ++ R( f, g, h, a, b, c, d, e, K(19), M(19) ); ++ R( e, f, g, h, a, b, c, d, K(20), M(20) ); ++ R( d, e, f, g, h, a, b, c, K(21), M(21) ); ++ R( c, d, e, f, g, h, a, b, K(22), M(22) ); ++ R( b, c, d, e, f, g, h, a, K(23), M(23) ); ++ R( a, b, c, d, e, f, g, h, K(24), M(24) ); ++ R( h, a, b, c, d, e, f, g, K(25), M(25) ); ++ R( g, h, a, b, c, d, e, f, K(26), M(26) ); ++ R( f, g, h, a, b, c, d, e, K(27), M(27) ); ++ R( e, f, g, h, a, b, c, d, K(28), M(28) ); ++ R( d, e, f, g, h, a, b, c, K(29), M(29) ); ++ R( c, d, e, f, g, h, a, b, K(30), M(30) ); ++ R( b, c, d, e, f, g, h, a, K(31), M(31) ); ++ R( a, b, c, d, e, f, g, h, K(32), M(32) ); ++ R( h, a, b, c, d, e, f, g, K(33), M(33) ); ++ R( g, h, a, b, c, d, e, f, K(34), M(34) ); ++ R( f, g, h, a, b, c, d, e, K(35), M(35) ); ++ R( e, f, g, h, a, b, c, d, K(36), M(36) ); ++ R( d, e, f, g, h, a, b, c, K(37), M(37) ); ++ R( c, d, e, f, g, h, a, b, K(38), M(38) ); ++ R( b, c, d, e, f, g, h, a, K(39), M(39) ); ++ R( a, b, c, d, e, f, g, h, K(40), M(40) ); ++ R( h, a, b, c, d, e, f, g, K(41), M(41) ); ++ R( g, h, a, b, c, d, e, f, K(42), M(42) ); ++ R( f, g, h, a, b, c, d, e, K(43), M(43) ); ++ R( e, f, g, h, a, b, c, d, K(44), M(44) ); ++ R( d, e, f, g, h, a, b, c, K(45), M(45) ); ++ R( c, d, e, f, g, h, a, b, K(46), M(46) ); ++ R( b, c, d, e, f, g, h, a, K(47), M(47) ); ++ R( a, b, c, d, e, f, g, h, K(48), M(48) ); ++ R( h, a, b, c, d, e, f, g, K(49), M(49) ); ++ R( g, h, a, b, c, d, e, f, K(50), M(50) ); ++ R( f, g, h, a, b, c, d, e, K(51), M(51) ); ++ R( e, f, g, h, a, b, c, d, K(52), M(52) ); ++ R( d, e, f, g, h, a, b, c, K(53), M(53) ); ++ R( c, d, e, f, g, h, a, b, K(54), M(54) ); ++ R( b, c, d, e, f, g, h, a, K(55), M(55) ); ++ R( a, b, c, d, e, f, g, h, K(56), M(56) ); ++ R( h, a, b, c, d, e, f, g, K(57), M(57) ); ++ R( g, h, a, b, c, d, e, f, K(58), M(58) ); ++ R( f, g, h, a, b, c, d, e, K(59), M(59) ); ++ R( e, f, g, h, a, b, c, d, K(60), M(60) ); ++ R( d, e, f, g, h, a, b, c, K(61), M(61) ); ++ R( c, d, e, f, g, h, a, b, K(62), M(62) ); ++ R( b, c, d, e, f, g, h, a, K(63), M(63) ); ++ ++ a = ctx->state[0] += a; ++ b = ctx->state[1] += b; ++ c = ctx->state[2] += c; ++ d = ctx->state[3] += d; ++ e = ctx->state[4] += e; ++ f = ctx->state[5] += f; ++ g = ctx->state[6] += g; ++ h = ctx->state[7] += h; ++ } ++} +diff -Nru coreutils-5.97.orig/lib/sha256.h coreutils-5.97/lib/sha256.h +--- coreutils-5.97.orig/lib/sha256.h 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/lib/sha256.h 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,88 @@ ++/* Declarations of functions and data types used for SHA256 and SHA224 sum ++ library functions. ++ Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by the ++ 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ ++ ++#ifndef SHA256_H ++# define SHA256_H 1 ++ ++# include ++# include "md5.h" ++ ++/* Structure to save state of computation between the single steps. */ ++struct sha256_ctx ++{ ++ md5_uint32 state[8]; ++ ++ md5_uint32 total[2]; ++ md5_uint32 buflen; ++ char buffer[128]; ++}; ++ ++ ++/* Initialize structure containing state of computation. */ ++extern void sha256_init_ctx (struct sha256_ctx *ctx); ++extern void sha224_init_ctx (struct sha256_ctx *ctx); ++ ++/* Starting with the result of former calls of this function (or the ++ initialization function update the context for the next LEN bytes ++ starting at BUFFER. ++ It is necessary that LEN is a multiple of 64!!! */ ++extern void sha256_process_block (const void *buffer, size_t len, ++ struct sha256_ctx *ctx); ++ ++/* Starting with the result of former calls of this function (or the ++ initialization function update the context for the next LEN bytes ++ starting at BUFFER. ++ It is NOT required that LEN is a multiple of 64. */ ++extern void sha256_process_bytes (const void *buffer, size_t len, ++ struct sha256_ctx *ctx); ++ ++/* Process the remaining bytes in the buffer and put result from CTX ++ in first 32 (28) bytes following RESBUF. The result is always in little ++ endian byte order, so that a byte-wise output yields to the wanted ++ ASCII representation of the message digest. ++ ++ IMPORTANT: On some systems it is required that RESBUF be correctly ++ aligned for a 32 bits value. */ ++extern void *sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf); ++extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf); ++ ++ ++/* Put result from CTX in first 32 (28) bytes following RESBUF. The result is ++ always in little endian byte order, so that a byte-wise output yields ++ to the wanted ASCII representation of the message digest. ++ ++ IMPORTANT: On some systems it is required that RESBUF is correctly ++ aligned for a 32 bits value. */ ++extern void *sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf); ++extern void *sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf); ++ ++ ++/* Compute SHA256 (SHA224) message digest for bytes read from STREAM. The ++ resulting message digest number will be written into the 32 (28) bytes ++ beginning at RESBLOCK. */ ++extern int sha256_stream (FILE *stream, void *resblock); ++extern int sha224_stream (FILE *stream, void *resblock); ++ ++/* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER. The ++ result is always in little endian byte order, so that a byte-wise ++ output yields to the wanted ASCII representation of the message ++ digest. */ ++extern void *sha256_buffer (const char *buffer, size_t len, void *resblock); ++extern void *sha224_buffer (const char *buffer, size_t len, void *resblock); ++ ++#endif +diff -Nru coreutils-5.97.orig/lib/sha512.c coreutils-5.97/lib/sha512.c +--- coreutils-5.97.orig/lib/sha512.c 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/lib/sha512.c 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,564 @@ ++/* sha512.c - Functions to compute SHA512 and SHA384 message digest of files or ++ memory blocks according to the NIST specification FIPS-180-2. ++ ++ Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by the ++ 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ ++ ++/* Written by David Madore, considerably copypasting from ++ Scott G. Miller's sha1.c ++*/ ++ ++#ifdef HAVE_CONFIG_H ++# include ++#endif ++ ++#include "sha512.h" ++ ++#include ++#include ++ ++#if USE_UNLOCKED_IO ++# include "unlocked-io.h" ++#endif ++ ++/* SWAP does an endian swap on architectures that are little-endian, ++ as SHA512 needs some data in a big-endian form. */ ++ ++#ifdef WORDS_BIGENDIAN ++# define SWAP(n) (n) ++#else ++# define SWAP(n) \ ++ (((n) << 56) | (((n) & 0xff00) << 40) | (((n) & 0xff0000UL) << 24) \ ++ | (((n) & 0xff000000UL) << 8) | (((n) >> 8) & 0xff000000UL) \ ++ | (((n) >> 24) & 0xff0000UL) | (((n) >> 40) & 0xff00UL) | ((n) >> 56)) ++#endif ++ ++#define BLOCKSIZE 4096 ++#if BLOCKSIZE % 128 != 0 ++# error "invalid BLOCKSIZE" ++#endif ++ ++/* This array contains the bytes used to pad the buffer to the next ++ 64-byte boundary. */ ++static const unsigned char fillbuf[128] = { 0x80, 0 /* , 0, 0, ... */ }; ++ ++ ++/* ++ Takes a pointer to a 512 bit block of data (eight 64 bit ints) and ++ intializes it to the start constants of the SHA512 algorithm. This ++ must be called before using hash in the call to sha512_hash ++*/ ++void ++sha512_init_ctx (struct sha512_ctx *ctx) ++{ ++ ctx->state[0] = 0x6a09e667f3bcc908ULL; ++ ctx->state[1] = 0xbb67ae8584caa73bULL; ++ ctx->state[2] = 0x3c6ef372fe94f82bULL; ++ ctx->state[3] = 0xa54ff53a5f1d36f1ULL; ++ ctx->state[4] = 0x510e527fade682d1ULL; ++ ctx->state[5] = 0x9b05688c2b3e6c1fULL; ++ ctx->state[6] = 0x1f83d9abfb41bd6bULL; ++ ctx->state[7] = 0x5be0cd19137e2179ULL; ++ ++ ctx->total[0] = ctx->total[1] = 0; ++ ctx->buflen = 0; ++} ++ ++void ++sha384_init_ctx (struct sha512_ctx *ctx) ++{ ++ ctx->state[0] = 0xcbbb9d5dc1059ed8ULL; ++ ctx->state[1] = 0x629a292a367cd507ULL; ++ ctx->state[2] = 0x9159015a3070dd17ULL; ++ ctx->state[3] = 0x152fecd8f70e5939ULL; ++ ctx->state[4] = 0x67332667ffc00b31ULL; ++ ctx->state[5] = 0x8eb44a8768581511ULL; ++ ctx->state[6] = 0xdb0c2e0d64f98fa7ULL; ++ ctx->state[7] = 0x47b5481dbefa4fa4ULL; ++ ++ ctx->total[0] = ctx->total[1] = 0; ++ ctx->buflen = 0; ++} ++ ++/* Put result from CTX in first 64 bytes following RESBUF. The result ++ must be in little endian byte order. ++ ++ IMPORTANT: On some systems it is required that RESBUF is correctly ++ aligned for a 64 bits value. */ ++void * ++sha512_read_ctx (const struct sha512_ctx *ctx, void *resbuf) ++{ ++ int i; ++ ++ for ( i=0 ; i<8 ; i++ ) ++ ((sha512_uint64 *) resbuf)[i] = SWAP (ctx->state[i]); ++ ++ return resbuf; ++} ++ ++void * ++sha384_read_ctx (const struct sha512_ctx *ctx, void *resbuf) ++{ ++ int i; ++ ++ for ( i=0 ; i<6 ; i++ ) ++ ((sha512_uint64 *) resbuf)[i] = SWAP (ctx->state[i]); ++ ++ return resbuf; ++} ++ ++/* Process the remaining bytes in the internal buffer and the usual ++ prolog according to the standard and write the result to RESBUF. ++ ++ IMPORTANT: On some systems it is required that RESBUF is correctly ++ aligned for a 64 bits value. */ ++static void ++sha512_conclude_ctx (struct sha512_ctx *ctx) ++{ ++ /* Take yet unprocessed bytes into account. */ ++ sha512_uint64 bytes = ctx->buflen; ++ size_t pad; ++ ++ /* Now count remaining bytes. */ ++ ctx->total[0] += bytes; ++ if (ctx->total[0] < bytes) ++ ++ctx->total[1]; ++ ++ pad = bytes >= 112 ? 128 + 112 - bytes : 112 - bytes; ++ memcpy (&ctx->buffer[bytes], fillbuf, pad); ++ ++ /* Put the 64-bit file length in *bits* at the end of the buffer. */ ++ *(sha512_uint64 *) &ctx->buffer[bytes + pad + 8] = SWAP (ctx->total[0] << 3); ++ *(sha512_uint64 *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) | ++ (ctx->total[0] >> 61)); ++ ++ /* Process last bytes. */ ++ sha512_process_block (ctx->buffer, bytes + pad + 16, ctx); ++} ++ ++void * ++sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf) ++{ ++ sha512_conclude_ctx (ctx); ++ return sha512_read_ctx (ctx, resbuf); ++} ++ ++void * ++sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf) ++{ ++ sha512_conclude_ctx (ctx); ++ return sha384_read_ctx (ctx, resbuf); ++} ++ ++/* Compute SHA512 message digest for bytes read from STREAM. The ++ resulting message digest number will be written into the 64 bytes ++ beginning at RESBLOCK. */ ++int ++sha512_stream (FILE *stream, void *resblock) ++{ ++ struct sha512_ctx ctx; ++ char buffer[BLOCKSIZE + 72]; ++ size_t sum; ++ ++ /* Initialize the computation context. */ ++ sha512_init_ctx (&ctx); ++ ++ /* Iterate over full file contents. */ ++ while (1) ++ { ++ /* We read the file in blocks of BLOCKSIZE bytes. One call of the ++ computation function processes the whole buffer so that with the ++ next round of the loop another block can be read. */ ++ size_t n; ++ sum = 0; ++ ++ /* Read block. Take care for partial reads. */ ++ while (1) ++ { ++ n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); ++ ++ sum += n; ++ ++ if (sum == BLOCKSIZE) ++ break; ++ ++ if (n == 0) ++ { ++ /* Check for the error flag IFF N == 0, so that we don't ++ exit the loop after a partial read due to e.g., EAGAIN ++ or EWOULDBLOCK. */ ++ if (ferror (stream)) ++ return 1; ++ goto process_partial_block; ++ } ++ ++ /* We've read at least one byte, so ignore errors. But always ++ check for EOF, since feof may be true even though N > 0. ++ Otherwise, we could end up calling fread after EOF. */ ++ if (feof (stream)) ++ goto process_partial_block; ++ } ++ ++ /* Process buffer with BLOCKSIZE bytes. Note that ++ BLOCKSIZE % 128 == 0 ++ */ ++ sha512_process_block (buffer, BLOCKSIZE, &ctx); ++ } ++ ++ process_partial_block:; ++ ++ /* Process any remaining bytes. */ ++ if (sum > 0) ++ sha512_process_bytes (buffer, sum, &ctx); ++ ++ /* Construct result in desired memory. */ ++ sha512_finish_ctx (&ctx, resblock); ++ return 0; ++} ++ ++/* FIXME: Avoid code duplication */ ++int ++sha384_stream (FILE *stream, void *resblock) ++{ ++ struct sha512_ctx ctx; ++ char buffer[BLOCKSIZE + 72]; ++ size_t sum; ++ ++ /* Initialize the computation context. */ ++ sha384_init_ctx (&ctx); ++ ++ /* Iterate over full file contents. */ ++ while (1) ++ { ++ /* We read the file in blocks of BLOCKSIZE bytes. One call of the ++ computation function processes the whole buffer so that with the ++ next round of the loop another block can be read. */ ++ size_t n; ++ sum = 0; ++ ++ /* Read block. Take care for partial reads. */ ++ while (1) ++ { ++ n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); ++ ++ sum += n; ++ ++ if (sum == BLOCKSIZE) ++ break; ++ ++ if (n == 0) ++ { ++ /* Check for the error flag IFF N == 0, so that we don't ++ exit the loop after a partial read due to e.g., EAGAIN ++ or EWOULDBLOCK. */ ++ if (ferror (stream)) ++ return 1; ++ goto process_partial_block; ++ } ++ ++ /* We've read at least one byte, so ignore errors. But always ++ check for EOF, since feof may be true even though N > 0. ++ Otherwise, we could end up calling fread after EOF. */ ++ if (feof (stream)) ++ goto process_partial_block; ++ } ++ ++ /* Process buffer with BLOCKSIZE bytes. Note that ++ BLOCKSIZE % 128 == 0 ++ */ ++ sha512_process_block (buffer, BLOCKSIZE, &ctx); ++ } ++ ++ process_partial_block:; ++ ++ /* Process any remaining bytes. */ ++ if (sum > 0) ++ sha512_process_bytes (buffer, sum, &ctx); ++ ++ /* Construct result in desired memory. */ ++ sha384_finish_ctx (&ctx, resblock); ++ return 0; ++} ++ ++/* Compute SHA512 message digest for LEN bytes beginning at BUFFER. The ++ result is always in little endian byte order, so that a byte-wise ++ output yields to the wanted ASCII representation of the message ++ digest. */ ++void * ++sha512_buffer (const char *buffer, size_t len, void *resblock) ++{ ++ struct sha512_ctx ctx; ++ ++ /* Initialize the computation context. */ ++ sha512_init_ctx (&ctx); ++ ++ /* Process whole buffer but last len % 128 bytes. */ ++ sha512_process_bytes (buffer, len, &ctx); ++ ++ /* Put result in desired memory area. */ ++ return sha512_finish_ctx (&ctx, resblock); ++} ++ ++void * ++sha384_buffer (const char *buffer, size_t len, void *resblock) ++{ ++ struct sha512_ctx ctx; ++ ++ /* Initialize the computation context. */ ++ sha384_init_ctx (&ctx); ++ ++ /* Process whole buffer but last len % 128 bytes. */ ++ sha512_process_bytes (buffer, len, &ctx); ++ ++ /* Put result in desired memory area. */ ++ return sha384_finish_ctx (&ctx, resblock); ++} ++ ++void ++sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx) ++{ ++ /* When we already have some bits in our internal buffer concatenate ++ both inputs first. */ ++ if (ctx->buflen != 0) ++ { ++ size_t left_over = ctx->buflen; ++ size_t add = 256 - left_over > len ? len : 256 - left_over; ++ ++ memcpy (&ctx->buffer[left_over], buffer, add); ++ ctx->buflen += add; ++ ++ if (ctx->buflen > 128) ++ { ++ sha512_process_block (ctx->buffer, ctx->buflen & ~63, ctx); ++ ++ ctx->buflen &= 127; ++ /* The regions in the following copy operation cannot overlap. */ ++ memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~127], ++ ctx->buflen); ++ } ++ ++ buffer = (const char *) buffer + add; ++ len -= add; ++ } ++ ++ /* Process available complete blocks. */ ++ if (len >= 128) ++ { ++#if !_STRING_ARCH_unaligned ++# define alignof(type) offsetof (struct { char c; type x; }, x) ++# define UNALIGNED_P(p) (((size_t) p) % alignof (sha512_uint64) != 0) ++ if (UNALIGNED_P (buffer)) ++ while (len > 128) ++ { ++ sha512_process_block (memcpy (ctx->buffer, buffer, 128), 128, ctx); ++ buffer = (const char *) buffer + 128; ++ len -= 128; ++ } ++ else ++#endif ++ { ++ sha512_process_block (buffer, len & ~127, ctx); ++ buffer = (const char *) buffer + (len & ~127); ++ len &= 127; ++ } ++ } ++ ++ /* Move remaining bytes in internal buffer. */ ++ if (len > 0) ++ { ++ size_t left_over = ctx->buflen; ++ ++ memcpy (&ctx->buffer[left_over], buffer, len); ++ left_over += len; ++ if (left_over >= 128) ++ { ++ sha512_process_block (ctx->buffer, 128, ctx); ++ left_over -= 128; ++ memcpy (ctx->buffer, &ctx->buffer[128], left_over); ++ } ++ ctx->buflen = left_over; ++ } ++} ++ ++/* --- Code below is the primary difference between md5.c and sha512.c --- */ ++ ++/* SHA512 round constants */ ++#define K(I) sha512_round_constants[I] ++static const sha512_uint64 sha512_round_constants[80] = { ++ 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, ++ 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, ++ 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, ++ 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, ++ 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, ++ 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, ++ 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, ++ 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, ++ 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, ++ 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL, ++}; ++ ++/* Round functions. */ ++#define F2(A,B,C) ( ( A & B ) | ( C & ( A | B ) ) ) ++#define F1(E,F,G) ( G ^ ( E & ( F ^ G ) ) ) ++ ++/* Process LEN bytes of BUFFER, accumulating context into CTX. ++ It is assumed that LEN % 128 == 0. ++ Most of this code comes from GnuPG's cipher/sha1.c. */ ++ ++void ++sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx) ++{ ++ const sha512_uint64 *words = buffer; ++ size_t nwords = len / sizeof (sha512_uint64); ++ const sha512_uint64 *endp = words + nwords; ++ sha512_uint64 x[16]; ++ sha512_uint64 a = ctx->state[0]; ++ sha512_uint64 b = ctx->state[1]; ++ sha512_uint64 c = ctx->state[2]; ++ sha512_uint64 d = ctx->state[3]; ++ sha512_uint64 e = ctx->state[4]; ++ sha512_uint64 f = ctx->state[5]; ++ sha512_uint64 g = ctx->state[6]; ++ sha512_uint64 h = ctx->state[7]; ++ ++ /* First increment the byte count. FIPS PUB 180-2 specifies the possible ++ length of the file up to 2^128 bits. Here we only compute the ++ number of bytes. Do a double word increment. */ ++ ctx->total[0] += len; ++ if (ctx->total[0] < len) ++ ++ctx->total[1]; ++ ++#define rol64(x,n) ( ((x) << (n)) | ((x) >> (64-(n))) ) ++ ++#define S0(x) (rol64(x,63)^rol64(x,56)^(x>>7)) ++#define S1(x) (rol64(x,45)^rol64(x,3)^(x>>6)) ++#define SS0(x) (rol64(x,36)^rol64(x,30)^rol64(x,25)) ++#define SS1(x) (rol64(x,50)^rol64(x,46)^rol64(x,23)) ++ ++#define M(I) ( tm = S1(x[(I-2)&0x0f]) + x[(I-7)&0x0f] \ ++ + S0(x[(I-15)&0x0f]) + x[I&0x0f] \ ++ , x[I&0x0f] = tm ) ++ ++#define R(A,B,C,D,E,F,G,H,K,M) do { t0 = SS0(A) + F2(A,B,C); \ ++ t1 = H + SS1(E) \ ++ + F1(E,F,G) \ ++ + K \ ++ + M; \ ++ D += t1; H = t0 + t1; \ ++ } while(0) ++ ++ while (words < endp) ++ { ++ sha512_uint64 tm; ++ sha512_uint64 t0, t1; ++ int t; ++ for (t = 0; t < 16; t++) ++ { ++ x[t] = SWAP (*words); ++ words++; ++ } ++ ++ R( a, b, c, d, e, f, g, h, K( 0), x[ 0] ); ++ R( h, a, b, c, d, e, f, g, K( 1), x[ 1] ); ++ R( g, h, a, b, c, d, e, f, K( 2), x[ 2] ); ++ R( f, g, h, a, b, c, d, e, K( 3), x[ 3] ); ++ R( e, f, g, h, a, b, c, d, K( 4), x[ 4] ); ++ R( d, e, f, g, h, a, b, c, K( 5), x[ 5] ); ++ R( c, d, e, f, g, h, a, b, K( 6), x[ 6] ); ++ R( b, c, d, e, f, g, h, a, K( 7), x[ 7] ); ++ R( a, b, c, d, e, f, g, h, K( 8), x[ 8] ); ++ R( h, a, b, c, d, e, f, g, K( 9), x[ 9] ); ++ R( g, h, a, b, c, d, e, f, K(10), x[10] ); ++ R( f, g, h, a, b, c, d, e, K(11), x[11] ); ++ R( e, f, g, h, a, b, c, d, K(12), x[12] ); ++ R( d, e, f, g, h, a, b, c, K(13), x[13] ); ++ R( c, d, e, f, g, h, a, b, K(14), x[14] ); ++ R( b, c, d, e, f, g, h, a, K(15), x[15] ); ++ R( a, b, c, d, e, f, g, h, K(16), M(16) ); ++ R( h, a, b, c, d, e, f, g, K(17), M(17) ); ++ R( g, h, a, b, c, d, e, f, K(18), M(18) ); ++ R( f, g, h, a, b, c, d, e, K(19), M(19) ); ++ R( e, f, g, h, a, b, c, d, K(20), M(20) ); ++ R( d, e, f, g, h, a, b, c, K(21), M(21) ); ++ R( c, d, e, f, g, h, a, b, K(22), M(22) ); ++ R( b, c, d, e, f, g, h, a, K(23), M(23) ); ++ R( a, b, c, d, e, f, g, h, K(24), M(24) ); ++ R( h, a, b, c, d, e, f, g, K(25), M(25) ); ++ R( g, h, a, b, c, d, e, f, K(26), M(26) ); ++ R( f, g, h, a, b, c, d, e, K(27), M(27) ); ++ R( e, f, g, h, a, b, c, d, K(28), M(28) ); ++ R( d, e, f, g, h, a, b, c, K(29), M(29) ); ++ R( c, d, e, f, g, h, a, b, K(30), M(30) ); ++ R( b, c, d, e, f, g, h, a, K(31), M(31) ); ++ R( a, b, c, d, e, f, g, h, K(32), M(32) ); ++ R( h, a, b, c, d, e, f, g, K(33), M(33) ); ++ R( g, h, a, b, c, d, e, f, K(34), M(34) ); ++ R( f, g, h, a, b, c, d, e, K(35), M(35) ); ++ R( e, f, g, h, a, b, c, d, K(36), M(36) ); ++ R( d, e, f, g, h, a, b, c, K(37), M(37) ); ++ R( c, d, e, f, g, h, a, b, K(38), M(38) ); ++ R( b, c, d, e, f, g, h, a, K(39), M(39) ); ++ R( a, b, c, d, e, f, g, h, K(40), M(40) ); ++ R( h, a, b, c, d, e, f, g, K(41), M(41) ); ++ R( g, h, a, b, c, d, e, f, K(42), M(42) ); ++ R( f, g, h, a, b, c, d, e, K(43), M(43) ); ++ R( e, f, g, h, a, b, c, d, K(44), M(44) ); ++ R( d, e, f, g, h, a, b, c, K(45), M(45) ); ++ R( c, d, e, f, g, h, a, b, K(46), M(46) ); ++ R( b, c, d, e, f, g, h, a, K(47), M(47) ); ++ R( a, b, c, d, e, f, g, h, K(48), M(48) ); ++ R( h, a, b, c, d, e, f, g, K(49), M(49) ); ++ R( g, h, a, b, c, d, e, f, K(50), M(50) ); ++ R( f, g, h, a, b, c, d, e, K(51), M(51) ); ++ R( e, f, g, h, a, b, c, d, K(52), M(52) ); ++ R( d, e, f, g, h, a, b, c, K(53), M(53) ); ++ R( c, d, e, f, g, h, a, b, K(54), M(54) ); ++ R( b, c, d, e, f, g, h, a, K(55), M(55) ); ++ R( a, b, c, d, e, f, g, h, K(56), M(56) ); ++ R( h, a, b, c, d, e, f, g, K(57), M(57) ); ++ R( g, h, a, b, c, d, e, f, K(58), M(58) ); ++ R( f, g, h, a, b, c, d, e, K(59), M(59) ); ++ R( e, f, g, h, a, b, c, d, K(60), M(60) ); ++ R( d, e, f, g, h, a, b, c, K(61), M(61) ); ++ R( c, d, e, f, g, h, a, b, K(62), M(62) ); ++ R( b, c, d, e, f, g, h, a, K(63), M(63) ); ++ R( a, b, c, d, e, f, g, h, K(64), M(64) ); ++ R( h, a, b, c, d, e, f, g, K(65), M(65) ); ++ R( g, h, a, b, c, d, e, f, K(66), M(66) ); ++ R( f, g, h, a, b, c, d, e, K(67), M(67) ); ++ R( e, f, g, h, a, b, c, d, K(68), M(68) ); ++ R( d, e, f, g, h, a, b, c, K(69), M(69) ); ++ R( c, d, e, f, g, h, a, b, K(70), M(70) ); ++ R( b, c, d, e, f, g, h, a, K(71), M(71) ); ++ R( a, b, c, d, e, f, g, h, K(72), M(72) ); ++ R( h, a, b, c, d, e, f, g, K(73), M(73) ); ++ R( g, h, a, b, c, d, e, f, K(74), M(74) ); ++ R( f, g, h, a, b, c, d, e, K(75), M(75) ); ++ R( e, f, g, h, a, b, c, d, K(76), M(76) ); ++ R( d, e, f, g, h, a, b, c, K(77), M(77) ); ++ R( c, d, e, f, g, h, a, b, K(78), M(78) ); ++ R( b, c, d, e, f, g, h, a, K(79), M(79) ); ++ ++ a = ctx->state[0] += a; ++ b = ctx->state[1] += b; ++ c = ctx->state[2] += c; ++ d = ctx->state[3] += d; ++ e = ctx->state[4] += e; ++ f = ctx->state[5] += f; ++ g = ctx->state[6] += g; ++ h = ctx->state[7] += h; ++ } ++} +diff -Nru coreutils-5.97.orig/lib/sha512.h coreutils-5.97/lib/sha512.h +--- coreutils-5.97.orig/lib/sha512.h 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/lib/sha512.h 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,91 @@ ++/* Declarations of functions and data types used for SHA512 and SHA384 sum ++ library functions. ++ Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify it ++ under the terms of the GNU General Public License as published by the ++ 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ ++ ++#ifndef SHA512_H ++# define SHA512_H 1 ++ ++# include ++# include ++ ++typedef uint64_t sha512_uint64; ++ ++ ++/* Structure to save state of computation between the single steps. */ ++struct sha512_ctx ++{ ++ sha512_uint64 state[8]; ++ ++ sha512_uint64 total[2]; ++ sha512_uint64 buflen; ++ char buffer[256]; ++}; ++ ++ ++/* Initialize structure containing state of computation. */ ++extern void sha512_init_ctx (struct sha512_ctx *ctx); ++extern void sha384_init_ctx (struct sha512_ctx *ctx); ++ ++/* Starting with the result of former calls of this function (or the ++ initialization function update the context for the next LEN bytes ++ starting at BUFFER. ++ It is necessary that LEN is a multiple of 128!!! */ ++extern void sha512_process_block (const void *buffer, size_t len, ++ struct sha512_ctx *ctx); ++ ++/* Starting with the result of former calls of this function (or the ++ initialization function update the context for the next LEN bytes ++ starting at BUFFER. ++ It is NOT required that LEN is a multiple of 128. */ ++extern void sha512_process_bytes (const void *buffer, size_t len, ++ struct sha512_ctx *ctx); ++ ++/* Process the remaining bytes in the buffer and put result from CTX ++ in first 64 (48) bytes following RESBUF. The result is always in little ++ endian byte order, so that a byte-wise output yields to the wanted ++ ASCII representation of the message digest. ++ ++ IMPORTANT: On some systems it is required that RESBUF be correctly ++ aligned for a 64 bits value. */ ++extern void *sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf); ++extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf); ++ ++ ++/* Put result from CTX in first 64 (48) bytes following RESBUF. The result is ++ always in little endian byte order, so that a byte-wise output yields ++ to the wanted ASCII representation of the message digest. ++ ++ IMPORTANT: On some systems it is required that RESBUF is correctly ++ aligned for a 32 bits value. */ ++extern void *sha512_read_ctx (const struct sha512_ctx *ctx, void *resbuf); ++extern void *sha384_read_ctx (const struct sha512_ctx *ctx, void *resbuf); ++ ++ ++/* Compute SHA512 (SHA384) message digest for bytes read from STREAM. The ++ resulting message digest number will be written into the 64 (48) bytes ++ beginning at RESBLOCK. */ ++extern int sha512_stream (FILE *stream, void *resblock); ++extern int sha384_stream (FILE *stream, void *resblock); ++ ++/* Compute SHA512 (SHA384) message digest for LEN bytes beginning at BUFFER. The ++ result is always in little endian byte order, so that a byte-wise ++ output yields to the wanted ASCII representation of the message ++ digest. */ ++extern void *sha512_buffer (const char *buffer, size_t len, void *resblock); ++extern void *sha384_buffer (const char *buffer, size_t len, void *resblock); ++ ++#endif +diff -Nru coreutils-5.97.orig/m4/prereq.m4 coreutils-5.97/m4/prereq.m4 +--- coreutils-5.97.orig/m4/prereq.m4 2005-09-22 09:00:24.000000000 +0200 ++++ coreutils-5.97/m4/prereq.m4 2006-08-03 22:50:21.000000000 +0200 +@@ -134,6 +134,8 @@ + AC_REQUIRE([gl_SAVE_CWD]) + AC_REQUIRE([gl_SETTIME]) + AC_REQUIRE([gl_SHA1]) ++ AC_REQUIRE([gl_SHA256]) ++ AC_REQUIRE([gl_SHA512]) + AC_REQUIRE([gl_STAT_MACROS]) + AC_REQUIRE([gl_STAT_TIME]) + AC_REQUIRE([gl_STDIO_SAFER]) +diff -Nru coreutils-5.97.orig/m4/sha256.m4 coreutils-5.97/m4/sha256.m4 +--- coreutils-5.97.orig/m4/sha256.m4 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/m4/sha256.m4 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,15 @@ ++# sha256.m4 serial 1 ++dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ++dnl This file is free software; the Free Software Foundation ++dnl gives unlimited permission to copy and/or distribute it, ++dnl with or without modifications, as long as this notice is preserved. ++ ++AC_DEFUN([gl_SHA256], ++[ ++ AC_LIBSOURCES([sha256.c, sha256.h]) ++ AC_LIBOBJ([sha256]) ++ ++ dnl Prerequisites of lib/sha256.c. ++ AC_REQUIRE([AC_C_BIGENDIAN]) ++ : ++]) +diff -Nru coreutils-5.97.orig/m4/sha512.m4 coreutils-5.97/m4/sha512.m4 +--- coreutils-5.97.orig/m4/sha512.m4 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/m4/sha512.m4 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,15 @@ ++# sha512.m4 serial 1 ++dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. ++dnl This file is free software; the Free Software Foundation ++dnl gives unlimited permission to copy and/or distribute it, ++dnl with or without modifications, as long as this notice is preserved. ++ ++AC_DEFUN([gl_SHA512], ++[ ++ AC_LIBSOURCES([sha512.c, sha512.h]) ++ AC_LIBOBJ([sha512]) ++ ++ dnl Prerequisites of lib/sha512.c. ++ AC_REQUIRE([AC_C_BIGENDIAN]) ++ : ++]) +diff -Nru coreutils-5.97.orig/man/Makefile.am coreutils-5.97/man/Makefile.am +--- coreutils-5.97.orig/man/Makefile.am 2006-08-03 22:58:18.000000000 +0200 ++++ coreutils-5.97/man/Makefile.am 2006-08-03 22:50:21.000000000 +0200 +@@ -7,7 +7,8 @@ + link.1 ln.1 logname.1 \ + ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nice.1 nl.1 nohup.1 od.1 \ + paste.1 pathchk.1 pinky.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \ +- rm.1 rmdir.1 seq.1 sha1sum.1 shred.1 sleep.1 sort.1 split.1 stat.1 stty.1 \ ++ rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \ ++ shred.1 sleep.1 sort.1 split.1 stat.1 stty.1 \ + su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \ + tty.1 uname.1 unexpand.1 uniq.1 unlink.1 uptime.1 users.1 vdir.1 wc.1 \ + who.1 whoami.1 yes.1 chcon.1 runcon.1 +@@ -83,6 +84,10 @@ + rmdir.1: $(common_dep) $(srcdir)/rmdir.x ../src/rmdir.c + seq.1: $(common_dep) $(srcdir)/seq.x ../src/seq.c + sha1sum.1: $(common_dep) $(srcdir)/sha1sum.x ../src/md5sum.c ++sha224sum.1: $(common_dep) $(srcdir)/sha224sum.x ../src/md5sum.c ++sha256sum.1: $(common_dep) $(srcdir)/sha256sum.x ../src/md5sum.c ++sha384sum.1: $(common_dep) $(srcdir)/sha384sum.x ../src/md5sum.c ++sha512sum.1: $(common_dep) $(srcdir)/sha512sum.x ../src/md5sum.c + shred.1: $(common_dep) $(srcdir)/shred.x ../src/shred.c + sleep.1: $(common_dep) $(srcdir)/sleep.x ../src/sleep.c + sort.1: $(common_dep) $(srcdir)/sort.x ../src/sort.c +diff -Nru coreutils-5.97.orig/man/sha224sum.x coreutils-5.97/man/sha224sum.x +--- coreutils-5.97.orig/man/sha224sum.x 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/man/sha224sum.x 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,4 @@ ++[NAME] ++sha224sum \- compute and check SHA224 message digest ++[DESCRIPTION] ++.\" Add any additional description here +diff -Nru coreutils-5.97.orig/man/sha256sum.x coreutils-5.97/man/sha256sum.x +--- coreutils-5.97.orig/man/sha256sum.x 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/man/sha256sum.x 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,4 @@ ++[NAME] ++sha256sum \- compute and check SHA256 message digest ++[DESCRIPTION] ++.\" Add any additional description here +diff -Nru coreutils-5.97.orig/man/sha384sum.x coreutils-5.97/man/sha384sum.x +--- coreutils-5.97.orig/man/sha384sum.x 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/man/sha384sum.x 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,4 @@ ++[NAME] ++sha384sum \- compute and check SHA384 message digest ++[DESCRIPTION] ++.\" Add any additional description here +diff -Nru coreutils-5.97.orig/man/sha512sum.x coreutils-5.97/man/sha512sum.x +--- coreutils-5.97.orig/man/sha512sum.x 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/man/sha512sum.x 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,4 @@ ++[NAME] ++sha512sum \- compute and check SHA512 message digest ++[DESCRIPTION] ++.\" Add any additional description here +diff -Nru coreutils-5.97.orig/src/Makefile.am coreutils-5.97/src/Makefile.am +--- coreutils-5.97.orig/src/Makefile.am 2006-08-03 22:58:18.000000000 +0200 ++++ coreutils-5.97/src/Makefile.am 2006-08-03 22:50:21.000000000 +0200 +@@ -24,7 +24,8 @@ + ginstall link ln dir vdir ls mkdir \ + mkfifo mknod mv nohup readlink rm rmdir shred stat sync touch unlink \ + cat cksum comm csplit cut expand fmt fold head join md5sum \ +- nl od paste pr ptx sha1sum sort split sum tac tail tr tsort unexpand uniq wc \ ++ nl od paste pr ptx sha1sum sha224sum sha256sum sha384sum sha512sum \ ++ sort split sum tac tail tr tsort unexpand uniq wc \ + basename date dirname echo env expr factor false \ + hostname id kill logname pathchk printenv printf pwd seq sleep tee \ + test true tty whoami yes \ +@@ -33,7 +34,7 @@ + noinst_PROGRAMS = setuidgid + + noinst_HEADERS = \ +- system.h checksum.h copy.h cp-hash.h ls.h dircolors.h remove.h \ ++ system.h copy.h cp-hash.h ls.h dircolors.h remove.h \ + chown-core.h fs.h \ + wheel.h wheel-size.h + EXTRA_DIST = dcgen dircolors.hin tac-pipe.c \ +@@ -176,8 +177,18 @@ + mv_SOURCES = mv.c copy.c cp-hash.c remove.c + rm_SOURCES = rm.c remove.c + +-md5sum_SOURCES = md5sum.c md5.c +-sha1sum_SOURCES = md5sum.c sha1sum.c ++md5sum_SOURCES = md5sum.c ++md5sum_CPPFLAGS = -DHASH_ALGO_MD5=1 $(AM_CPPFLAGS) ++sha1sum_SOURCES = md5sum.c ++sha1sum_CPPFLAGS = -DHASH_ALGO_SHA1=1 $(AM_CPPFLAGS) ++sha224sum_SOURCES = md5sum.c ++sha224sum_CPPFLAGS = -DHASH_ALGO_SHA224=1 $(AM_CPPFLAGS) ++sha256sum_SOURCES = md5sum.c ++sha256sum_CPPFLAGS = -DHASH_ALGO_SHA256=1 $(AM_CPPFLAGS) ++sha384sum_SOURCES = md5sum.c ++sha384sum_CPPFLAGS = -DHASH_ALGO_SHA384=1 $(AM_CPPFLAGS) ++sha512sum_SOURCES = md5sum.c ++sha512sum_CPPFLAGS = -DHASH_ALGO_SHA512=1 $(AM_CPPFLAGS) + + editpl = sed -e 's,@''PERL''@,$(PERL),g' + +diff -Nru coreutils-5.97.orig/src/checksum.h coreutils-5.97/src/checksum.h +--- coreutils-5.97.orig/src/checksum.h 2004-09-22 22:11:10.000000000 +0200 ++++ coreutils-5.97/src/checksum.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,7 +0,0 @@ +-enum +-{ +- ALG_MD5 = 1, +- ALG_SHA1 +-}; +- +-extern int algorithm; +diff -Nru coreutils-5.97.orig/src/md5.c coreutils-5.97/src/md5.c +--- coreutils-5.97.orig/src/md5.c 2004-07-30 02:54:02.000000000 +0200 ++++ coreutils-5.97/src/md5.c 1970-01-01 01:00:00.000000000 +0100 +@@ -1,2 +0,0 @@ +-#include "checksum.h" +-int algorithm = ALG_MD5; +diff -Nru coreutils-5.97.orig/src/md5sum.c coreutils-5.97/src/md5sum.c +--- coreutils-5.97.orig/src/md5sum.c 2005-10-27 18:22:14.000000000 +0200 ++++ coreutils-5.97/src/md5sum.c 2006-08-03 22:58:02.000000000 +0200 +@@ -1,5 +1,5 @@ +-/* Compute MD5 or SHA1 checksum of files or strings +- Copyright (C) 1995-2005 Free Software Foundation, Inc. ++/* Compute MD5, SHA1, SHA224, SHA256, SHA384 or SHA512 checksum of files or strings ++ Copyright (C) 1995-2006 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 +@@ -24,34 +24,79 @@ + + #include "system.h" + +-#include "md5.h" +-#include "sha1.h" +-#include "checksum.h" ++#if HASH_ALGO_MD5 ++# include "md5.h" ++#endif ++#if HASH_ALGO_SHA1 ++# include "sha1.h" ++#endif ++#if HASH_ALGO_SHA256 || HASH_ALGO_SHA224 ++# include "sha256.h" ++#endif ++#if HASH_ALGO_SHA512 || HASH_ALGO_SHA384 ++# include "sha512.h" ++#endif + #include "getline.h" + #include "error.h" + #include "quote.h" + #include "stdio--.h" + + /* The official name of this program (e.g., no `g' prefix). */ +-#define PROGRAM_NAME (algorithm == ALG_MD5 ? "md5sum" : "sha1sum") ++#if HASH_ALGO_MD5 ++# define PROGRAM_NAME "md5sum" ++# define DIGEST_TYPE_STRING "MD5" ++# define DIGEST_STREAM md5_stream ++# define DIGEST_BITS 128 ++# define DIGEST_REFERENCE "RFC 1321" ++# define DIGEST_ALIGN 4 ++#elif HASH_ALGO_SHA1 ++# define PROGRAM_NAME "sha1sum" ++# define DIGEST_TYPE_STRING "SHA1" ++# define DIGEST_STREAM sha1_stream ++# define DIGEST_BITS 160 ++# define DIGEST_REFERENCE "FIPS-180-1" ++# define DIGEST_ALIGN 4 ++#elif HASH_ALGO_SHA256 ++# define PROGRAM_NAME "sha256sum" ++# define DIGEST_TYPE_STRING "SHA256" ++# define DIGEST_STREAM sha256_stream ++# define DIGEST_BITS 256 ++# define DIGEST_REFERENCE "FIPS-180-2" ++# define DIGEST_ALIGN 4 ++#elif HASH_ALGO_SHA224 ++# define PROGRAM_NAME "sha224sum" ++# define DIGEST_TYPE_STRING "SHA224" ++# define DIGEST_STREAM sha224_stream ++# define DIGEST_BITS 224 ++# define DIGEST_REFERENCE "RFC 3874" ++# define DIGEST_ALIGN 4 ++#elif HASH_ALGO_SHA512 ++# define PROGRAM_NAME "sha512sum" ++# define DIGEST_TYPE_STRING "SHA512" ++# define DIGEST_STREAM sha512_stream ++# define DIGEST_BITS 512 ++# define DIGEST_REFERENCE "FIPS-180-2" ++# define DIGEST_ALIGN 8 ++#elif HASH_ALGO_SHA384 ++# define PROGRAM_NAME "sha384sum" ++# define DIGEST_TYPE_STRING "SHA384" ++# define DIGEST_STREAM sha384_stream ++# define DIGEST_BITS 384 ++# define DIGEST_REFERENCE "FIPS-180-2" ++# define DIGEST_ALIGN 8 ++#else ++# error "Can't decide which hash algorithm to compile." ++#endif + +-#define AUTHORS "Ulrich Drepper", "Scott Miller" ++#define DIGEST_HEX_BYTES (DIGEST_BITS / 4) ++#define DIGEST_BIN_BYTES (DIGEST_BITS / 8) + +- +-#define DIGEST_TYPE_STRING(Alg) ((Alg) == ALG_MD5 ? "MD5" : "SHA1") +-#define DIGEST_STREAM(Alg) ((Alg) == ALG_MD5 ? md5_stream : sha1_stream) +- +-#define DIGEST_BITS(Alg) ((Alg) == ALG_MD5 ? 128 : 160) +-#define DIGEST_HEX_BYTES(Alg) (DIGEST_BITS (Alg) / 4) +-#define DIGEST_BIN_BYTES(Alg) (DIGEST_BITS (Alg) / 8) +- +-#define MAX_DIGEST_BIN_BYTES MAX (DIGEST_BIN_BYTES (ALG_MD5), \ +- DIGEST_BIN_BYTES (ALG_SHA1)) ++#define AUTHORS "Ulrich Drepper", "Scott Miller", "David Madore" + + /* The minimum length of a valid digest line. This length does + not include any newline character at the end of a line. */ +-#define MIN_DIGEST_LINE_LENGTH(Alg) \ +- (DIGEST_HEX_BYTES (Alg) /* length of hexadecimal message digest */ \ ++#define MIN_DIGEST_LINE_LENGTH \ ++ (DIGEST_HEX_BYTES /* length of hexadecimal message digest */ \ + + 2 /* blank and binary indicator */ \ + + 1 /* minimum filename length */ ) + +@@ -72,9 +117,6 @@ + improperly formatted checksum line. */ + static bool warn = false; + +-/* Declared and set via one of the wrapper .c files. */ +-/* int algorithm = ALG_UNSPECIFIED; */ +- + /* The name this program was run with. */ + char *program_name; + +@@ -112,8 +154,8 @@ + \n\ + "), + program_name, +- DIGEST_TYPE_STRING (algorithm), +- DIGEST_BITS (algorithm)); ++ DIGEST_TYPE_STRING, ++ DIGEST_BITS); + if (O_BINARY) + fputs (_("\ + -b, --binary read in binary mode (default unless reading tty stdin)\n\ +@@ -124,7 +166,7 @@ + "), stdout); + printf (_("\ + -c, --check read %s sums from the FILEs and check them\n"), +- DIGEST_TYPE_STRING (algorithm)); ++ DIGEST_TYPE_STRING); + if (O_BINARY) + fputs (_("\ + -t, --text read in text mode (default if reading tty stdin)\n\ +@@ -148,7 +190,7 @@ + should be a former output of this program. The default mode is to print\n\ + a line with checksum, a character indicating type (`*' for binary, ` ' for\n\ + text), and name for each FILE.\n"), +- (algorithm == ALG_MD5 ? "RFC 1321" : "FIPS-180-1")); ++ DIGEST_REFERENCE); + printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT); + } + +@@ -211,8 +253,8 @@ + ++i; + + /* Check for BSD-style checksum line. */ +- algo_name_len = strlen (DIGEST_TYPE_STRING (algorithm)); +- if (strncmp (s + i, DIGEST_TYPE_STRING (algorithm), algo_name_len) == 0) ++ algo_name_len = strlen (DIGEST_TYPE_STRING); ++ if (strncmp (s + i, DIGEST_TYPE_STRING, algo_name_len) == 0) + { + if (strncmp (s + i + algo_name_len, " (", 2) == 0) + { +@@ -313,8 +355,7 @@ + return true; + } + +-/* An interface to the function, DIGEST_STREAM, +- (either md5_stream or sha1_stream). ++/* An interface to the function, DIGEST_STREAM. + Operate on FILENAME (it may be "-"). + + *BINARY indicates whether the file is binary. BINARY < 0 means it +@@ -322,12 +363,11 @@ + a terminal; in that case, clear *BINARY if the file was treated as + text because it was a terminal. + +- Put the checksum in *BIN_RESULT. ++ Put the checksum in *BIN_RESULT, which must be properly aligned. + Return true if successful. */ + + static bool +-digest_file (const char *filename, int *binary, unsigned char *bin_result, +- int (*digest_stream) (FILE *, void *)) ++digest_file (const char *filename, int *binary, unsigned char *bin_result) + { + FILE *fp; + int err; +@@ -355,7 +395,7 @@ + } + } + +- err = (*digest_stream) (fp, bin_result); ++ err = DIGEST_STREAM (fp, bin_result); + if (err) + { + error (0, errno, "%s", filename); +@@ -374,13 +414,15 @@ + } + + static bool +-digest_check (const char *checkfile_name, int (*digest_stream) (FILE *, void *)) ++digest_check (const char *checkfile_name) + { + FILE *checkfile_stream; + uintmax_t n_properly_formatted_lines = 0; + uintmax_t n_mismatched_checksums = 0; + uintmax_t n_open_or_read_failures = 0; +- unsigned char bin_buffer[MAX_DIGEST_BIN_BYTES]; ++ unsigned char bin_buffer_unaligned[DIGEST_BIN_BYTES + DIGEST_ALIGN]; ++ /* Make sure bin_buffer is properly aligned. */ ++ unsigned char *bin_buffer = ptr_align (bin_buffer_unaligned, DIGEST_ALIGN); + uintmax_t line_number; + char *line; + size_t line_chars_allocated; +@@ -439,7 +481,7 @@ + _("%s: %" PRIuMAX + ": improperly formatted %s checksum line"), + checkfile_name, line_number, +- DIGEST_TYPE_STRING (algorithm)); ++ DIGEST_TYPE_STRING); + } + } + else +@@ -452,7 +494,7 @@ + + ++n_properly_formatted_lines; + +- ok = digest_file (filename, &binary, bin_buffer, digest_stream); ++ ok = digest_file (filename, &binary, bin_buffer); + + if (!ok) + { +@@ -509,7 +551,7 @@ + { + /* Warn if no tests are found. */ + error (0, 0, _("%s: no properly formatted %s checksum lines found"), +- checkfile_name, DIGEST_TYPE_STRING (algorithm)); ++ checkfile_name, DIGEST_TYPE_STRING); + } + else + { +@@ -547,7 +589,9 @@ + int + main (int argc, char **argv) + { +- unsigned char bin_buffer[MAX_DIGEST_BIN_BYTES]; ++ unsigned char bin_buffer_unaligned[DIGEST_BIN_BYTES + DIGEST_ALIGN]; ++ /* Make sure bin_buffer is properly aligned. */ ++ unsigned char *bin_buffer = ptr_align (bin_buffer_unaligned, DIGEST_ALIGN); + bool do_check = false; + int opt; + bool ok = true; +@@ -588,8 +632,8 @@ + usage (EXIT_FAILURE); + } + +- min_digest_line_length = MIN_DIGEST_LINE_LENGTH (algorithm); +- digest_hex_bytes = DIGEST_HEX_BYTES (algorithm); ++ min_digest_line_length = MIN_DIGEST_LINE_LENGTH; ++ digest_hex_bytes = DIGEST_HEX_BYTES; + + if (0 <= binary && do_check) + { +@@ -623,13 +667,12 @@ + char *file = argv[optind]; + + if (do_check) +- ok &= digest_check (file, DIGEST_STREAM (algorithm)); ++ ok &= digest_check (file); + else + { + int file_is_binary = binary; + +- if (! digest_file (file, &file_is_binary, bin_buffer, +- DIGEST_STREAM (algorithm))) ++ if (! digest_file (file, &file_is_binary, bin_buffer)) + ok = false; + else + { +diff -Nru coreutils-5.97.orig/src/sha1sum.c coreutils-5.97/src/sha1sum.c +--- coreutils-5.97.orig/src/sha1sum.c 2004-07-30 02:54:20.000000000 +0200 ++++ coreutils-5.97/src/sha1sum.c 1970-01-01 01:00:00.000000000 +0100 +@@ -1,2 +0,0 @@ +-#include "checksum.h" +-int algorithm = ALG_SHA1; +diff -Nru coreutils-5.97.orig/tests/Makefile.am coreutils-5.97/tests/Makefile.am +--- coreutils-5.97.orig/tests/Makefile.am 2005-08-13 19:34:11.000000000 +0200 ++++ coreutils-5.97/tests/Makefile.am 2006-08-03 22:50:21.000000000 +0200 +@@ -21,7 +21,8 @@ + SUBDIRS = \ + basename chgrp chmod chown cp cut dd dircolors du expr factor \ + fmt head install join ln ls ls-2 md5sum misc mkdir mv od pr readlink \ +- rm rmdir seq sha1sum shred sort stty sum tac tail tail-2 tee test \ ++ rm rmdir seq sha1sum sha224sum sha256sum sha384sum sha512sum \ ++ shred sort stty sum tac tail tail-2 tee test \ + touch tr tsort unexpand uniq wc + + .PHONY: check-root +diff -Nru coreutils-5.97.orig/tests/sha224sum/Makefile.am coreutils-5.97/tests/sha224sum/Makefile.am +--- coreutils-5.97.orig/tests/sha224sum/Makefile.am 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/tests/sha224sum/Makefile.am 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,12 @@ ++## Process this file with automake to produce Makefile.in -*-Makefile-*-. ++ ++EXTRA_DIST = $(TESTS) ++ ++TESTS_ENVIRONMENT = \ ++ top_srcdir=$(top_srcdir) \ ++ srcdir=$(srcdir) \ ++ PERL="$(PERL)" \ ++ PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH" \ ++ PROG=sha224sum ++ ++TESTS = basic-1 +diff -Nru coreutils-5.97.orig/tests/sha224sum/basic-1 coreutils-5.97/tests/sha224sum/basic-1 +--- coreutils-5.97.orig/tests/sha224sum/basic-1 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/tests/sha224sum/basic-1 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,43 @@ ++#!/bin/sh ++ ++: ${PERL=perl} ++: ${srcdir=.} ++ ++$PERL -e 1 > /dev/null 2>&1 || { ++ echo 1>&2 "$0: configure didn't find a usable version of Perl," \ ++ "so can't run this test" ++ exit 77 ++} ++ ++exec $PERL -w -I$srcdir/.. -MCoreutils -- - <<\EOF ++require 5.003; ++use strict; ++ ++(my $program_name = $0) =~ s|.*/||; ++ ++# Turn off localisation of executable's ouput. ++@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; ++ ++my @Tests = ++ ( ++ ['s3', {IN=> {f=> 'abc'}}, ++ {OUT=>"23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7 f\n"}], ++ ['s4', ++ {IN=> {f=> 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq'}}, ++ {OUT=>"75388b16512776cc5dba5da1fd890150b0c6455cb4f58b1952522525 f\n"}], ++ ); ++ ++# Insert the `--text' argument for each test. ++my $t; ++foreach $t (@Tests) ++ { ++ splice @$t, 1, 0, '--text' unless @$t[1] =~ /--check/; ++ } ++ ++my $save_temps = $ENV{DEBUG}; ++my $verbose = $ENV{VERBOSE}; ++ ++my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n"; ++my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); ++exit $fail; ++EOF +diff -Nru coreutils-5.97.orig/tests/sha256sum/Makefile.am coreutils-5.97/tests/sha256sum/Makefile.am +--- coreutils-5.97.orig/tests/sha256sum/Makefile.am 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/tests/sha256sum/Makefile.am 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,12 @@ ++## Process this file with automake to produce Makefile.in -*-Makefile-*-. ++ ++EXTRA_DIST = $(TESTS) ++ ++TESTS_ENVIRONMENT = \ ++ top_srcdir=$(top_srcdir) \ ++ srcdir=$(srcdir) \ ++ PERL="$(PERL)" \ ++ PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH" \ ++ PROG=sha256sum ++ ++TESTS = basic-1 +diff -Nru coreutils-5.97.orig/tests/sha256sum/basic-1 coreutils-5.97/tests/sha256sum/basic-1 +--- coreutils-5.97.orig/tests/sha256sum/basic-1 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/tests/sha256sum/basic-1 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,49 @@ ++#!/bin/sh ++ ++: ${PERL=perl} ++: ${srcdir=.} ++ ++$PERL -e 1 > /dev/null 2>&1 || { ++ echo 1>&2 "$0: configure didn't find a usable version of Perl," \ ++ "so can't run this test" ++ exit 77 ++} ++ ++exec $PERL -w -I$srcdir/.. -MCoreutils -- - <<\EOF ++require 5.003; ++use strict; ++ ++(my $program_name = $0) =~ s|.*/||; ++ ++# Turn off localisation of executable's ouput. ++@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; ++ ++my $sha_degenerate = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; ++ ++my @Tests = ++ ( ++ ['s1', {IN=> {f=> ''}}, ++ {OUT=>"$sha_degenerate f\n"}], ++ ['s2', {IN=> {f=> 'a'}}, ++ {OUT=>"ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb f\n"}], ++ ['s3', {IN=> {f=> 'abc'}}, ++ {OUT=>"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad f\n"}], ++ ['s4', ++ {IN=> {f=> 'abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq'}}, ++ {OUT=>"248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1 f\n"}], ++ ); ++ ++# Insert the `--text' argument for each test. ++my $t; ++foreach $t (@Tests) ++ { ++ splice @$t, 1, 0, '--text' unless @$t[1] =~ /--check/; ++ } ++ ++my $save_temps = $ENV{DEBUG}; ++my $verbose = $ENV{VERBOSE}; ++ ++my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n"; ++my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); ++exit $fail; ++EOF +diff -Nru coreutils-5.97.orig/tests/sha384sum/Makefile.am coreutils-5.97/tests/sha384sum/Makefile.am +--- coreutils-5.97.orig/tests/sha384sum/Makefile.am 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/tests/sha384sum/Makefile.am 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,12 @@ ++## Process this file with automake to produce Makefile.in -*-Makefile-*-. ++ ++EXTRA_DIST = $(TESTS) ++ ++TESTS_ENVIRONMENT = \ ++ top_srcdir=$(top_srcdir) \ ++ srcdir=$(srcdir) \ ++ PERL="$(PERL)" \ ++ PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH" \ ++ PROG=sha384sum ++ ++TESTS = basic-1 +diff -Nru coreutils-5.97.orig/tests/sha384sum/basic-1 coreutils-5.97/tests/sha384sum/basic-1 +--- coreutils-5.97.orig/tests/sha384sum/basic-1 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/tests/sha384sum/basic-1 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,49 @@ ++#!/bin/sh ++ ++: ${PERL=perl} ++: ${srcdir=.} ++ ++$PERL -e 1 > /dev/null 2>&1 || { ++ echo 1>&2 "$0: configure didn't find a usable version of Perl," \ ++ "so can't run this test" ++ exit 77 ++} ++ ++exec $PERL -w -I$srcdir/.. -MCoreutils -- - <<\EOF ++require 5.003; ++use strict; ++ ++(my $program_name = $0) =~ s|.*/||; ++ ++# Turn off localisation of executable's ouput. ++@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; ++ ++my $sha_degenerate = "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b"; ++ ++my @Tests = ++ ( ++ ['s1', {IN=> {f=> ''}}, ++ {OUT=>"$sha_degenerate f\n"}], ++ ['s2', {IN=> {f=> 'a'}}, ++ {OUT=>"54a59b9f22b0b80880d8427e548b7c23abd873486e1f035dce9cd697e85175033caa88e6d57bc35efae0b5afd3145f31 f\n"}], ++ ['s3', {IN=> {f=> 'abc'}}, ++ {OUT=>"cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7 f\n"}], ++ ['s4', ++ {IN=> {f=> 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu'}}, ++ {OUT=>"09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712fcc7c71a557e2db966c3e9fa91746039 f\n"}], ++ ); ++ ++# Insert the `--text' argument for each test. ++my $t; ++foreach $t (@Tests) ++ { ++ splice @$t, 1, 0, '--text' unless @$t[1] =~ /--check/; ++ } ++ ++my $save_temps = $ENV{DEBUG}; ++my $verbose = $ENV{VERBOSE}; ++ ++my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n"; ++my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); ++exit $fail; ++EOF +diff -Nru coreutils-5.97.orig/tests/sha512sum/Makefile.am coreutils-5.97/tests/sha512sum/Makefile.am +--- coreutils-5.97.orig/tests/sha512sum/Makefile.am 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/tests/sha512sum/Makefile.am 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,12 @@ ++## Process this file with automake to produce Makefile.in -*-Makefile-*-. ++ ++EXTRA_DIST = $(TESTS) ++ ++TESTS_ENVIRONMENT = \ ++ top_srcdir=$(top_srcdir) \ ++ srcdir=$(srcdir) \ ++ PERL="$(PERL)" \ ++ PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH" \ ++ PROG=sha512sum ++ ++TESTS = basic-1 +diff -Nru coreutils-5.97.orig/tests/sha512sum/basic-1 coreutils-5.97/tests/sha512sum/basic-1 +--- coreutils-5.97.orig/tests/sha512sum/basic-1 1970-01-01 01:00:00.000000000 +0100 ++++ coreutils-5.97/tests/sha512sum/basic-1 2006-08-03 22:50:21.000000000 +0200 +@@ -0,0 +1,49 @@ ++#!/bin/sh ++ ++: ${PERL=perl} ++: ${srcdir=.} ++ ++$PERL -e 1 > /dev/null 2>&1 || { ++ echo 1>&2 "$0: configure didn't find a usable version of Perl," \ ++ "so can't run this test" ++ exit 77 ++} ++ ++exec $PERL -w -I$srcdir/.. -MCoreutils -- - <<\EOF ++require 5.003; ++use strict; ++ ++(my $program_name = $0) =~ s|.*/||; ++ ++# Turn off localisation of executable's ouput. ++@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; ++ ++my $sha_degenerate = "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"; ++ ++my @Tests = ++ ( ++ ['s1', {IN=> {f=> ''}}, ++ {OUT=>"$sha_degenerate f\n"}], ++ ['s2', {IN=> {f=> 'a'}}, ++ {OUT=>"1f40fc92da241694750979ee6cf582f2d5d7d28e18335de05abc54d0560e0f5302860c652bf08d560252aa5e74210546f369fbbbce8c12cfc7957b2652fe9a75 f\n"}], ++ ['s3', {IN=> {f=> 'abc'}}, ++ {OUT=>"ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f f\n"}], ++ ['s4', ++ {IN=> {f=> 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu'}}, ++ {OUT=>"8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909 f\n"}], ++ ); ++ ++# Insert the `--text' argument for each test. ++my $t; ++foreach $t (@Tests) ++ { ++ splice @$t, 1, 0, '--text' unless @$t[1] =~ /--check/; ++ } ++ ++my $save_temps = $ENV{DEBUG}; ++my $verbose = $ENV{VERBOSE}; ++ ++my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n"; ++my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); ++exit $fail; ++EOF --- coreutils-5.97.orig/debian/patches/64_mkdir-chmod-race.patch +++ coreutils-5.97/debian/patches/64_mkdir-chmod-race.patch @@ -0,0 +1,42 @@ +diff -uNrp coreutils-5.96/src/mkdir.c coreutils-5.96-kees/src/mkdir.c +--- coreutils-5.96/src/mkdir.c 2005-06-14 16:55:47.000000000 -0700 ++++ coreutils-5.97/src/mkdir.c 2006-09-17 10:37:43.000000000 -0700 +@@ -161,7 +161,7 @@ main (int argc, char **argv) + } + else + { +- ok = (mkdir (dir, newmode) == 0); ++ ok = (mkdir (dir, newmode | S_IRWXU ) == 0); + + if (! ok) + error (0, errno, _("cannot create directory %s"), quote (dir)); +@@ -177,12 +177,23 @@ main (int argc, char **argv) + /* Set the permissions only if this directory has just + been created. */ + +- if (ok && specified_mode +- && chmod (dir, newmode) != 0) +- { +- error (0, errno, _("cannot set permissions of directory %s"), +- quote (dir)); +- ok = false; ++ if (ok && specified_mode) ++ { ++ int fd = -1; ++ struct stat statbuf; ++ ++ if ( (fd = open (dir, O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_NONBLOCK)) < 0 || ++ fstat (fd, &statbuf) < 0 || ++ statbuf.st_uid != geteuid() || ++ !S_ISDIR(statbuf.st_mode) || ++ fchmod (fd, newmode) != 0) ++ { ++ error (0, errno, _("cannot set permissions of directory %s"), ++ quote (dir)); ++ ok = false; ++ } ++ ++ if ( fd != -1 ) close (fd); + } + } + --- coreutils-5.97.orig/debian/patches/59_dircolors-moreterms +++ coreutils-5.97/debian/patches/59_dircolors-moreterms @@ -0,0 +1,16 @@ +--- coreutils-5.97/src/dircolors.hin.orig 2006-04-15 21:29:07.602443942 -0400 ++++ coreutils-5.97/src/dircolors.hin 2006-04-15 21:32:57.715883348 -0400 +@@ -21,11 +21,13 @@ + TERM con80x60 + TERM cygwin + TERM dtterm ++TERM mlterm + TERM putty + TERM xterm + TERM xterm-color + TERM xterm-debian + TERM rxvt ++TERM rxvt-unicode + TERM screen + TERM screen-bce + TERM screen-w --- coreutils-5.97.orig/debian/patches/57_selinux-nonlinux.patch +++ coreutils-5.97/debian/patches/57_selinux-nonlinux.patch @@ -0,0 +1,146 @@ +diff -ruN coreutils-5.97-old/configure.ac coreutils-5.97/configure.ac +--- coreutils-5.97-old/configure.ac 2006-11-05 15:40:59.000000000 -0600 ++++ coreutils-5.97/configure.ac 2006-11-05 15:41:00.000000000 -0600 +@@ -31,7 +31,9 @@ + AC_ARG_ENABLE(selinux, dnl + [ --enable-selinux Enable use of the SELINUX libraries], + [AC_DEFINE(WITH_SELINUX, 1, [Define if you want to use SELINUX]) +-LIB_SELINUX="-lselinux" ++ LIB_SELINUX="-lselinux" ++ OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS chcon\$(EXEEXT) runcon\$(EXEEXT)" ++ MAN="$MAN chcon.1 runcon.1" + AC_SUBST(LIB_SELINUX)]) + + gl_DEFAULT_POSIX2_VERSION +diff -ruN coreutils-5.97-old/src/cp.c coreutils-5.97/src/cp.c +--- coreutils-5.97-old/src/cp.c 2006-11-05 15:40:59.000000000 -0600 ++++ coreutils-5.97/src/cp.c 2006-11-05 15:46:06.000000000 -0600 +@@ -832,17 +832,19 @@ + case PRESERVE_LINK: + x->preserve_links = on_off; + break; +- ++#ifdef WITH_SELINUX + case PRESERVE_CONTEXT: + x->preserve_security_context = on_off; + break; +- ++#endif + case PRESERVE_ALL: + x->preserve_mode = on_off; + x->preserve_timestamps = on_off; + x->preserve_ownership = on_off; + x->preserve_links = on_off; ++#ifdef WITH_SELINUX + x->preserve_security_context = on_off; ++#endif + break; + + default: +@@ -906,7 +908,9 @@ + x.preserve_ownership = true; + x.preserve_mode = true; + x.preserve_timestamps = true; ++#ifdef WITH_SELINUX + x.preserve_security_context = true; ++#endif + x.require_preserve = true; + x.recursive = true; + break; +diff -ruN coreutils-5.97-old/src/id.c coreutils-5.97/src/id.c +--- coreutils-5.97-old/src/id.c 2006-11-05 15:40:59.000000000 -0600 ++++ coreutils-5.97/src/id.c 2006-11-05 15:41:00.000000000 -0600 +@@ -72,7 +72,9 @@ + /* The SELinux context */ + /* Set `context' to a known invalid value so print_full_info() will * + * know when `context' has not been set to a meaningful value. */ ++#ifdef WITH_SELINUX + static security_context_t context=NULL; ++#endif + + static struct option const longopts[] = + { +@@ -122,7 +124,9 @@ + main (int argc, char **argv) + { + int optc; ++#ifdef WITH_SELINUX + int selinux_enabled=(is_selinux_enabled()>0); ++#endif + + /* If true, output the list of all group IDs. -G */ + bool just_group_list = false; +@@ -200,10 +204,13 @@ + error (1, 0, "can't get process context"); + } + #endif +- ++#ifdef WITH_SELINUX + if (just_user + just_group + just_group_list + just_context > 1) + error (EXIT_FAILURE, 0, _("cannot print \"only\" of more than one choice")); +- ++#else ++ if (just_user + just_group + just_group_list > 1) ++ error (EXIT_FAILURE, 0, _("cannot print \"only\" of more than one choice")); ++#endif + if (just_user + just_group + just_group_list == 0 && (use_real | use_name)) + error (EXIT_FAILURE, 0, + _("cannot print only names or real IDs in default format")); +diff -ruN coreutils-5.97-old/src/Makefile.am coreutils-5.97/src/Makefile.am +--- coreutils-5.97-old/src/Makefile.am 2006-11-05 15:40:59.000000000 -0600 ++++ coreutils-5.97/src/Makefile.am 2006-11-05 15:41:00.000000000 -0600 +@@ -17,16 +17,16 @@ + ## along with this program; if not, write to the Free Software Foundation, + ## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +-EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who ++EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who chcon runcon + + bin_SCRIPTS = groups +-bin_PROGRAMS = [ chgrp chown chmod chcon cp dd dircolors du \ ++bin_PROGRAMS = [ chgrp chown chmod cp dd dircolors du \ + ginstall link ln dir vdir ls mkdir \ + mkfifo mknod mv nohup readlink rm rmdir shred stat sync touch unlink \ + cat cksum comm csplit cut expand fmt fold head join md5sum \ + nl od paste pr ptx sha1sum sort split sum tac tail tr tsort unexpand uniq wc \ + basename date dirname echo env expr factor false \ +- hostname id kill logname pathchk printenv printf pwd runcon seq sleep tee \ ++ hostname id kill logname pathchk printenv printf pwd seq sleep tee \ + test true tty whoami yes \ + $(OPTIONAL_BIN_PROGS) $(DF_PROG) + +@@ -238,7 +238,7 @@ + $(EXTRA_PROGRAMS) + + all_programs.list: +- @echo $(all_programs) | tr ' ' '\n' | sed -e 's,$(EXEEXT)$$,,' \ ++ @echo $(bin_PROGRAMS) $(bin_SCRIPTS) | tr ' ' '\n' | sed -e 's,$(EXEEXT)$$,,' \ + | $(ASSORT) -u + + pm = progs-makefile +@@ -260,7 +260,7 @@ + au_dotdot = authors-dotdot + au_actual = authors-actual + .PHONY: check-AUTHORS +-check-AUTHORS: $(all_programs) ++check-AUTHORS: + rm -f $(au_actual) $(au_dotdot) + for i in `ls $(all_programs) | sed -e 's,$(EXEEXT)$$,,' \ + | $(ASSORT) -u`; do \ +diff -ruN coreutils-5.97-old/src/stat.c coreutils-5.97/src/stat.c +--- coreutils-5.97-old/src/stat.c 2006-11-05 15:40:59.000000000 -0600 ++++ coreutils-5.97/src/stat.c 2006-11-05 15:41:00.000000000 -0600 +@@ -979,9 +979,12 @@ + terse = true; + break; + case 'Z': ++#ifdef WITH_SELINUX + if((is_selinux_enabled()>0)) + secure = 1; +- else { ++ else ++#endif ++ { + error (0, 0, _("Kernel is not SELinux enabled")); + usage (EXIT_FAILURE); + } --- coreutils-5.97.orig/debian/patches/61_whoips +++ coreutils-5.97/debian/patches/61_whoips @@ -0,0 +1,120 @@ +--- coreutils-5.97/src/who.c.orig 2006-05-27 15:09:15.243817480 -0400 ++++ coreutils-5.97/src/who.c 2006-05-27 15:08:16.704965910 -0400 +@@ -29,6 +29,8 @@ + #include + + #include ++#include ++#include + #include "system.h" + + #include "canon-host.h" +@@ -107,6 +109,9 @@ + /* If true, attempt to canonicalize hostnames via a DNS lookup. */ + static bool do_lookup; + ++/* If true, display ips instead of hostnames */ ++static bool do_ips; ++ + /* If true, display only a list of usernames and count of + the users logged on. + Ignored for `who am i'. */ +@@ -162,7 +167,8 @@ + /* for long options with no corresponding short option, use enum */ + enum + { +- LOOKUP_OPTION = CHAR_MAX + 1 ++ LOOKUP_OPTION = CHAR_MAX + 1, ++ IPS_OPTION = CHAR_MAX + 2 + }; + + static struct option const longopts[] = { +@@ -172,6 +178,7 @@ + {"dead", no_argument, NULL, 'd'}, + {"heading", no_argument, NULL, 'H'}, + {"idle", no_argument, NULL, 'i'}, /* FIXME: deprecated: remove in late 2006 */ ++ {"ips", no_argument, NULL, IPS_OPTION}, + {"login", no_argument, NULL, 'l'}, + {"lookup", no_argument, NULL, LOOKUP_OPTION}, + {"message", no_argument, NULL, 'T'}, +@@ -422,6 +429,57 @@ + } + #endif + ++ /* Needs configure check for ut_addr_v6, etc */ ++ if (do_ips && ++ memcmp(utmp_ent->ut_addr_v6, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16)) ++ { ++ /* Following code is from sysvinit-2.86.ds1 ++ (GPL Copyright 1991-2004 Miquel van Smoorenburg) */ ++ struct sockaddr_in sin; ++ struct sockaddr_in6 sin6; ++ struct sockaddr *sa; ++ int salen, flags; ++ unsigned int topnibble; ++ int mapped = 0; ++ int *a = utmp_ent->ut_addr_v6; ++ ++ hoststr = xrealloc(hoststr, 256); ++ ++ flags = do_lookup ? 0 : NI_NUMERICHOST; ++ ++ /* ++ * IPv4 or IPv6 ? We use 2 heuristics: ++ * 1. Current IPv6 range uses 2000-3fff. Outside of ++ * that is illegal and must be IPv4. ++ * 2. If last 3 bytes are 0, must be IPv4 ++ * 3. If IPv6 in IPv4, handle as IPv4 ++ * ++ * Ugly. ++ */ ++ if (a[0] == 0 && a[1] == 0 && a[2] == htonl (0xffff)) ++ mapped = 1; ++ topnibble = ntohl((unsigned int)a[0]) >> 28; ++ if (topnibble < 2 || topnibble > 3 || mapped || ++ (a[1] == 0 && a[2] == 0 && a[3] == 0)) { ++ /* IPv4 */ ++ sin.sin_family = AF_INET; ++ sin.sin_port = 0; ++ sin.sin_addr.s_addr = mapped ? a[3] : a[0]; ++ sa = (struct sockaddr *)&sin; ++ salen = sizeof(sin); ++ } else { ++ /* IPv6 */ ++ memset(&sin6, 0, sizeof(sin6)); ++ sin6.sin6_family = AF_INET6; ++ sin6.sin6_port = 0; ++ memcpy(sin6.sin6_addr.s6_addr, a, 16); ++ sa = (struct sockaddr *)&sin6; ++ salen = sizeof(sin6); ++ } ++ ++ getnameinfo(sa, salen, hoststr, 256, NULL, 0, flags); ++ } ++ + print_line (sizeof UT_USER (utmp_ent), UT_USER (utmp_ent), mesg, + sizeof utmp_ent->ut_line, utmp_ent->ut_line, + time_string (utmp_ent), idlestr, pidstr, +@@ -641,6 +697,11 @@ + -H, --heading print line of column headings\n\ + "), stdout); + fputs (_("\ ++ --ips print ips instead of hostnames. with --lookup,\n\ ++ canonicalizes based on stored IP, if available,\n\ ++ rather than stored hostname\n\ ++"), stdout); ++ fputs (_("\ + -l, --login print system login processes\n\ + "), stdout); + fputs (_("\ +@@ -775,6 +836,10 @@ + do_lookup = true; + break; + ++ case IPS_OPTION: ++ do_ips = true; ++ break; ++ + case_GETOPT_HELP_CHAR; + + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); --- coreutils-5.97.orig/debian/patches/99_dircolors-shell +++ coreutils-5.97/debian/patches/99_dircolors-shell @@ -0,0 +1,11 @@ +--- coreutils-5.97/tests/dircolors/simple.orig 2006-03-02 14:33:03.647321310 -0500 ++++ coreutils-5.97/tests/dircolors/simple 2006-03-02 14:34:35.556053512 -0500 +@@ -18,6 +18,8 @@ + # Turn off localisation of executable's ouput. + @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + ++$ENV{'SHELL'} = '/bin/sh'; ++ + my @Tests = + ( + ['a', {IN => {k => "exec\n"}}, --- coreutils-5.97.orig/debian/patches/99_catranslations +++ coreutils-5.97/debian/patches/99_catranslations @@ -0,0 +1,4768 @@ +diff -u -r coreutils-5.97.bak/po/ca.po coreutils-5.97/po/ca.po +--- coreutils-5.97.bak/po/ca.po 2006-06-10 05:45:02.000000000 -0400 ++++ coreutils-5.97/po/ca.po 2006-08-21 08:23:08.000000000 -0400 +@@ -1,6 +1,6 @@ + # Catalan messages for GNU coreutils. + # Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. +-# Ivan Vilata i Balaguer , 1999, 2002, 2003, 2004, 2005. ++# Ivan Vilata i Balaguer , 1999, 2002, 2003, 2004, 2005, 2006. + # Jordi Mallach , 2001, 2002. + # Ernest Adrogué Calveras , 2002. + # +@@ -43,10 +43,10 @@ + # bonic, excepte quan quede realment horrend o porte a confusió). + msgid "" + msgstr "" +-"Project-Id-Version: coreutils 5.94\n" ++"Project-Id-Version: coreutils 5.97\n" + "Report-Msgid-Bugs-To: bug-coreutils@gnu.org\n" + "POT-Creation-Date: 2006-06-10 11:45+0200\n" +-"PO-Revision-Date: 2006-03-07 23:33+0100\n" ++"PO-Revision-Date: 2006-08-21 00:02+0200\n" + "Last-Translator: Ivan Vilata i Balaguer \n" + "Language-Team: Catalan \n" + "MIME-Version: 1.0\n" +@@ -142,7 +142,7 @@ + + #: lib/gai_strerror.c:46 + msgid "Temporary failure in name resolution" +-msgstr "Fallada temporal en la resolució de noms" ++msgstr "Fallada temporal a la resolució de noms" + + #: lib/gai_strerror.c:47 + msgid "Bad value for ai_flags" +@@ -150,7 +150,7 @@ + + #: lib/gai_strerror.c:48 + msgid "Non-recoverable failure in name resolution" +-msgstr "Fallada irrecuperable en la resolució de noms" ++msgstr "Fallada irrecuperable a la resolució de noms" + + #: lib/gai_strerror.c:49 + msgid "ai_family not supported" +@@ -406,8 +406,7 @@ + #: lib/version-etc.c:74 + msgid "" + "\n" +-"This is free software. You may redistribute copies of it under the terms " +-"of\n" ++"This is free software. You may redistribute copies of it under the terms of\n" + "the GNU General Public License .\n" + "There is NO WARRANTY, to the extent permitted by law.\n" + "\n" +@@ -668,7 +667,7 @@ + " -n, --number number all output lines\n" + " -s, --squeeze-blank never more than one single blank line\n" + msgstr "" +-"Concatena els FITXERs o l’entrada estàndard, i escriu el resultat en la\n" ++"Concatena els FITXERs o l’entrada estàndard, i escriu el resultat a la\n" + "sortida estàndard.\n" + "\n" + " -A, --show-all Equival a «-vET».\n" +@@ -689,8 +688,8 @@ + " -T, --show-tabs Mostra els caràcters de tabulació com a «^I».\n" + " -u (No es té en compte.)\n" + " -v, --show-nonprinting\n" +-" Usa la notació «^» i «M-», excepte pels caràcters de\n" +-" nova línia i per a les tabulacions.\n" ++" Empra la notació «^» i «M-», excepte per als caràcters\n" ++" de nova línia i per a les tabulacions.\n" + + #: src/cat.c:117 src/fmt.c:296 src/sum.c:71 + msgid "" +@@ -758,27 +757,23 @@ + "\n" + " -c, --changes like verbose but report only when a change is made\n" + " --dereference affect the referent of each symbolic link, rather\n" +-" than the symbolic link itself (this is the " +-"default)\n" ++" than the symbolic link itself (this is the default)\n" + msgstr "" + "Canvia la pertinença de grup de cada FITXER a GRUP.\n" + "Amb «--reference», canvia el grup de cada FITXER a aquell de FITXREF.\n" + "\n" + " -c, --changes Com «--verbose», però només informa quan es fa un\n" + " canvi.\n" +-" --dereference Afecta el fitxer apuntat per cada enllaç simbòlic, " +-"en\n" ++" --dereference Afecta el fitxer apuntat per cada enllaç simbòlic, en\n" + " lloc del propi enllaç simbòlic (per defecte).\n" + + #: src/chgrp.c:126 src/chown.c:107 + msgid "" +-" -h, --no-dereference affect each symbolic link instead of any " +-"referenced\n" ++" -h, --no-dereference affect each symbolic link instead of any referenced\n" + " file (useful only on systems that can change the\n" + " ownership of a symlink)\n" + msgstr "" +-" -h, --no-dereference Afecta cadascun dels enllaços simbòlics en lloc " +-"dels\n" ++" -h, --no-dereference Afecta cadascun dels enllaços simbòlics en lloc dels\n" + " fitxers apuntats (disponible només en sistemes que\n" + " puguen canviar el propietari d’un enllaç simbòlic).\n" + +@@ -802,7 +797,7 @@ + msgstr "" + " -f, --silent, --quiet No mostra la majoria de missatges d’error.\n" + " --reference=FITXREF\n" +-" Usa el grup del fitxer FITXREF en lloc del valor\n" ++" Empra el grup del fitxer FITXREF en lloc del valor\n" + " especificat de GRUP.\n" + " -R, --recursive Opera recursivament sobre fitxers i directoris.\n" + " -v, --verbose Mostra un missatge per cada fitxer processat.\n" +@@ -820,11 +815,9 @@ + " -P do not traverse any symbolic links (default)\n" + "\n" + msgstr "" +-"Les opcions següents modifiquen la forma de recórrer una jerarquia quan " +-"s’haja\n" +-"especificat també l’opció «-R». Si se n’especifica més d’una, només " +-"l’última\n" +-"d’elles tindrà efecte.\n" ++"Les opcions següents modifiquen la forma de recórrer una jerarquia quan s’haja\n" ++"especificat també l’opció «-R». Si se n’especifica més d’una, només la\n" ++"darrera d’elles tindrà efecte.\n" + "\n" + " -H Si un argument de la línia d’ordres és un ellaç\n" + " simbòlic cap a un directori, aquest serà recorregut.\n" +@@ -955,13 +948,11 @@ + msgid "" + "Change the mode of each FILE to MODE.\n" + "\n" +-" -c, --changes like verbose but report only when a change is " +-"made\n" ++" -c, --changes like verbose but report only when a change is made\n" + msgstr "" + "Canvia el mode de cada FITXER a MODE.\n" + "\n" +-" -c, --changes Com «--verbose», però només informa quan es produeix " +-"un\n" ++" -c, --changes Com «--verbose», però només informa quan es produeix un\n" + " canvi.\n" + + #: src/chmod.c:337 +@@ -983,7 +974,7 @@ + " -f, --silent, --quiet No mostra la majoria dels missatges d’error.\n" + " -v, --verbose Mostra un missatge per cada fitxer processat.\n" + " --reference=FITXREF\n" +-" Usa el mode de FITXREF en lloc dels valors de MODE.\n" ++" Empra el mode de FITXREF en lloc dels valors de MODE.\n" + " -R, --recursive Canvia recursivament fitxers i directoris.\n" + + #: src/chmod.c:349 +@@ -1087,13 +1078,11 @@ + #: src/chown.c:99 + msgid "" + "Change the owner and/or group of each FILE to OWNER and/or GROUP.\n" +-"With --reference, change the owner and group of each FILE to those of " +-"RFILE.\n" ++"With --reference, change the owner and group of each FILE to those of RFILE.\n" + "\n" + " -c, --changes like verbose but report only when a change is made\n" + " --dereference affect the referent of each symbolic link, rather\n" +-" than the symbolic link itself (this is the " +-"default)\n" ++" than the symbolic link itself (this is the default)\n" + msgstr "" + "Canvia el propietari o grup de cada FITXER a PROPIETARI o GRUP.\n" + "Amb «--reference», canvia el propietari i grup de cada FITXER a aquell de\n" +@@ -1101,25 +1090,20 @@ + "\n" + " -c, --changes Com «--verbose», però només informa quan es fa un\n" + " canvi.\n" +-" --dereference Afecta el fitxer apuntat per cada enllaç simbòlic, " +-"en\n" ++" --dereference Afecta el fitxer apuntat per cada enllaç simbòlic, en\n" + " lloc del propi enllaç simbòlic (per defecte).\n" + + #: src/chown.c:112 + msgid "" + " --from=CURRENT_OWNER:CURRENT_GROUP\n" + " change the owner and/or group of each file only if\n" +-" its current owner and/or group match those " +-"specified\n" +-" here. Either may be omitted, in which case a " +-"match\n" ++" its current owner and/or group match those specified\n" ++" here. Either may be omitted, in which case a match\n" + " is not required for the omitted attribute.\n" + msgstr "" + " --from=PROPIETARI_ACTUAL:GRUP_ACTUAL\n" +-" Canvia el propietari o grup de cada fitxer només si " +-"el\n" +-" seu propietari o grup actual coincideixen amb " +-"aquests.\n" ++" Canvia el propietari o grup de cada fitxer només si el\n" ++" seu propietari o grup actual coincideixen amb aquests.\n" + " Es pot ometre qualsevol dels dos; en aqueix cas no\n" + " caldrà que hi haja coincidència amb l’atribut omés.\n" + +@@ -1134,7 +1118,7 @@ + msgstr "" + " -f, --silent, --quiet No mostra la majoria de missatges d’error.\n" + " --reference=FITXREF\n" +-" Usa el propietari i grup del fitxer FITXERF en lloc\n" ++" Empra el propietari i grup del fitxer FITXERF en lloc\n" + " dels valors especificats de PROPIETARI:GRUP.\n" + " -R, --recursive Opera recursivament sobre fitxers i directoris.\n" + " -v, --verbose Mostra un missatge per cada fitxer processat.\n" +@@ -1148,8 +1132,7 @@ + msgstr "" + "\n" + "El propietari es manté si no s’especifica. El grup també es manté si no\n" +-"s’especifica, però és canviat al grup d’entrada si s’indica un «:» darrere " +-"del\n" ++"s’especifica, però és canviat al grup d’entrada si s’indica un «:» darrere del\n" + "PROPIETARI simbòlic. El PROPIETARI i el GRUP poden ser tant numèrics com\n" + "simbòlics.\n" + +@@ -1195,8 +1178,7 @@ + "If no command is given, run ``${SHELL} -i'' (default: /bin/sh).\n" + msgstr "" + "\n" +-"Si no s’especifica cap ordre s’executa «${SHELL} -i» (per defecte: /bin/" +-"sh).\n" ++"Si no s’especifica cap ordre s’executa «${SHELL} -i» (per defecte: /bin/sh).\n" + + # No usa quote(). ivb + #: src/chroot.c:89 +@@ -1254,9 +1236,8 @@ + msgstr "" + "\n" + "Sense opcions, produeix una eixida amb tres columnes. La primera conté les\n" +-"línies que només es troben en el FITXER1, la segona les que només es troben " +-"en\n" +-"el FITXER2, i la tercera les línies comunes a ambdós fitxers.\n" ++"línies que només es troben al FITXER1, la segona les que només es troben al\n" ++"FITXER2, i la tercera les línies comunes a ambdós fitxers.\n" + + #: src/comm.c:86 + msgid "" +@@ -1266,10 +1247,8 @@ + " -3 suppress lines that appear in both files\n" + msgstr "" + "\n" +-" -1 Elimina aquelles línies que només apareixen en el\n" +-" FITXER1.\n" +-" -2 Elimina aquelles línies que només apareixen en el\n" +-" FITXER2.\n" ++" -1 Elimina aquelles línies que només apareixen al FITXER1.\n" ++" -2 Elimina aquelles línies que només apareixen al FITXER2.\n" + " -3 Elimina aquelles línies que apareixen en ambdós\n" + " fitxers.\n" + +@@ -1430,8 +1409,7 @@ + #: src/copy.c:1124 + #, c-format + msgid "backing up %s would destroy source; %s not copied" +-msgstr "" +-"una còpia de seguretat de %s destruiria el fitxer origen; no es còpia %s" ++msgstr "una còpia de seguretat de %s destruiria el fitxer origen; no es còpia %s" + + # Els 2 usen quote(). ivb + #: src/copy.c:1143 src/ln.c:267 +@@ -1479,9 +1457,7 @@ + #: src/copy.c:1394 + #, c-format + msgid "inter-device move failed: %s to %s; unable to remove target" +-msgstr "" +-"no s’ha pogut moure entre dispositius: %s a %s; no s’ha pogut eliminar el " +-"destí" ++msgstr "no s’ha pogut moure entre dispositius: %s a %s; no s’ha pogut eliminar el destí" + + # Usa quote(). ivb + #: src/copy.c:1422 +@@ -1492,8 +1468,7 @@ + #: src/copy.c:1499 + #, c-format + msgid "%s: can make relative symbolic links only in current directory" +-msgstr "" +-"%s: només es poden fer enllaços simbòlics relatius en el directori actual" ++msgstr "%s: només es poden fer enllaços simbòlics relatius en el directori actual" + + # Usa quote() en els 2 arguments. ivb + #: src/copy.c:1506 +@@ -1589,8 +1564,7 @@ + #: src/pr.c:2777 src/ptx.c:1895 src/shred.c:161 src/sort.c:289 src/split.c:117 + #: src/tac.c:141 src/tail.c:236 src/touch.c:238 src/unexpand.c:130 + #: src/uniq.c:144 +-msgid "" +-"Mandatory arguments to long options are mandatory for short options too.\n" ++msgid "Mandatory arguments to long options are mandatory for short options too.\n" + msgstr "" + "Els arguments obligatoris per a les opcions llargues també ho són per a les\n" + "opcions curtes corresponents.\n" +@@ -1598,12 +1572,9 @@ + #: src/cp.c:169 + msgid "" + " -a, --archive same as -dpR\n" +-" --backup[=CONTROL] make a backup of each existing destination " +-"file\n" +-" -b like --backup but does not accept an " +-"argument\n" +-" --copy-contents copy contents of special files when " +-"recursive\n" ++" --backup[=CONTROL] make a backup of each existing destination file\n" ++" -b like --backup but does not accept an argument\n" ++" --copy-contents copy contents of special files when recursive\n" + " -d same as --no-dereference --preserve=link\n" + msgstr "" + " -a, --archive Equival a «-dpR».\n" +@@ -1611,8 +1582,7 @@ + " Crea una còpia de seguretat de cada fitxer destí\n" + " existent.\n" + " -b Com «--backup», però no accepta cap argument.\n" +-" --copy-contents Còpia el contingut dels fitxers especials quan " +-"actua\n" ++" --copy-contents Còpia el contingut dels fitxers especials quan actua\n" + " recursivament.\n" + " -d Equival a «--no-dereference --preserve=link».\n" + +@@ -1624,12 +1594,11 @@ + " -i, --interactive prompt before overwrite\n" + " -H follow command-line symbolic links\n" + msgstr "" +-" -f, --force Si no es pot obrir un fitxer destí existent, " +-"l’esborra\n" ++" -f, --force Si no es pot obrir un fitxer destí existent, l’esborra\n" + " i torna a provar.\n" + " -i, --interactive Pregunta abans de sobreescriure.\n" +-" -H Segueix els enllaços simbòlics que es troben en la\n" +-" línia d’ordres.\n" ++" -H Segueix els enllaços simbòlics que es troben a la línia\n" ++" d’ordres.\n" + + #: src/cp.c:182 + msgid "" +@@ -1653,12 +1622,9 @@ + msgstr "" + " -p Equival a «--preserve=mode,ownership,timestamps».\n" + " --preserve[=LLISTA_ATRS]\n" +-" Preserva els atributs indicats, si es pot; per " +-"defecte\n" +-" es prenen «mode» (permisos), «ownership» (propietari " +-"i\n" +-" grup) i «timestamps» (dates); altres atributs " +-"possibles\n" ++" Preserva els atributs indicats, si es pot; per defecte\n" ++" es prenen «mode» (permisos), «ownership» (propietari i\n" ++" grup) i «timestamps» (dates); altres atributs possibles\n" + " són «links» (enllaços) i «all» (tots els atributs).\n" + + #: src/cp.c:195 +@@ -1675,8 +1641,7 @@ + msgid "" + " -R, -r, --recursive copy directories recursively\n" + " --remove-destination remove each existing destination file before\n" +-" attempting to open it (contrast with --" +-"force)\n" ++" attempting to open it (contrast with --force)\n" + msgstr "" + " -R, -r, --recursive Còpia recursivament els directoris.\n" + " --remove-destination\n" +@@ -1698,8 +1663,7 @@ + msgid "" + " -s, --symbolic-link make symbolic links instead of copying\n" + " -S, --suffix=SUFFIX override the usual backup suffix\n" +-" -t, --target-directory=DIRECTORY copy all SOURCE arguments into " +-"DIRECTORY\n" ++" -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n" + " -T, --no-target-directory treat DEST as a normal file\n" + msgstr "" + " -s, --symbolic-link Crea enllaços simbòlics en lloc de copiar.\n" +@@ -1719,7 +1683,7 @@ + " -x, --one-file-system stay on this file system\n" + msgstr "" + " -u, --update Només còpia quan el fitxer ORIGEN és més nou que el\n" +-" fitxer destí o quan aquest últim no existeix.\n" ++" fitxer destí o quan aquest darrer no existeix.\n" + " -v, --verbose Explica què s’està fent.\n" + " -x, --one-file-system Es manté dins d’aquest sistema de fitxers.\n" + +@@ -1733,17 +1697,14 @@ + "By default, sparse SOURCE files are detected by a crude heuristic and the\n" + "corresponding DEST file is made sparse as well. That is the behavior\n" + "selected by --sparse=auto. Specify --sparse=always to create a sparse DEST\n" +-"file whenever the SOURCE file contains a long enough sequence of zero " +-"bytes.\n" ++"file whenever the SOURCE file contains a long enough sequence of zero bytes.\n" + "Use --sparse=never to inhibit creation of sparse files.\n" + "\n" + msgstr "" + "\n" + "Per defecte, els fitxers ORIGEN dispersos es detecten amb una heurística\n" +-"simple i els fitxers DESTÍ corresponents són creats dispersos. Aquest és " +-"el\n" +-"comportament indicat per «--sparse=auto». Amb «--sparse=always» es crearà " +-"un\n" ++"simple i els fitxers DESTÍ corresponents són creats dispersos. Aquest és el\n" ++"comportament indicat per «--sparse=auto». Amb «--sparse=always» es crearà un\n" + "fitxer DESTÍ dispers sempre que el fitxer ORIGEN continga una seqüència\n" + "suficientment llarga d’octets zero. Useu «--sparse=never» per a evitar la\n" + "creació de fitxers dispersos.\n" +@@ -1752,17 +1713,14 @@ + #: src/cp.c:233 + msgid "" + "The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n" +-"The version control method may be selected via the --backup option or " +-"through\n" ++"The version control method may be selected via the --backup option or through\n" + "the VERSION_CONTROL environment variable. Here are the values:\n" + "\n" + msgstr "" +-"El sufix de còpia de seguretat és «~», si no s’estableix amb «--suffix» o " +-"amb\n" +-"la variable d’entorn SIMPLE_BACKUP_SUFFIX. El mètode de control de " +-"versions\n" ++"El sufix de còpia de seguretat és «~», si no s’estableix amb «--suffix» o amb\n" ++"la variable d’entorn SIMPLE_BACKUP_SUFFIX. El mètode de control de versions\n" + "es pot establir amb l’opció «--backup» o fent servir la variable d’entorn\n" +-"VERSION_CONTROL. Es poden usar aquests valors:\n" ++"VERSION_CONTROL. Es poden emprar aquests valors:\n" + "\n" + + #: src/cp.c:239 src/install.c:681 src/ln.c:390 src/mv.c:339 +@@ -1774,8 +1732,7 @@ + msgstr "" + " none, off Mai fa còpies de seguretat (ni especificant «--backup»).\n" + " numbered, t Fa còpies de seguretat numerades.\n" +-" existing, nil Fa còpies de seguretat numerades si ja n’existeixen, les " +-"fa\n" ++" existing, nil Fa còpies de seguretat numerades si ja n’existeixen, les fa\n" + " simples en cas contrari.\n" + " simple, never Fa còpies de seguretat simples sempre.\n" + +@@ -1787,8 +1744,7 @@ + "regular file.\n" + msgstr "" + "\n" +-"Com a cas especial, «cp» fa una còpia de seguretat d’ORIGEN quan les " +-"opcions\n" ++"Com a cas especial, «cp» fa una còpia de seguretat d’ORIGEN quan les opcions\n" + "«--force» i «--backup» són actives i ORIGEN i DESTÍ són el mateix nom d’un\n" + "fitxer ordinari existent.\n" + +@@ -1839,16 +1795,15 @@ + + #: src/cp.c:515 src/install.c:322 src/mv.c:454 + msgid "Cannot combine --target-directory (-t) and --no-target-directory (-T)" +-msgstr "" +-"no es poden combinar «--target-directory» (-t) i «--no-target-directory» (-T)" ++msgstr "no es poden combinar «--target-directory» (-t) i «--no-target-directory» (-T)" + + #: src/cp.c:634 + msgid "with --parents, the destination must be a directory" +-msgstr "en usar «--parents», el destí ha de ser un directori" ++msgstr "en emprar «--parents», el destí ha de ser un directori" + + #: src/cp.c:910 src/mv.c:398 + msgid "the --reply option is deprecated; use -i or -f instead" +-msgstr "l’opció «--reply» està desaprovada; useu «-i» o «-f» en el seu lloc" ++msgstr "l’opció «--reply» està desaprovada; useu «-i» o «-f» al seu lloc" + + #: src/cp.c:926 src/ln.c:459 + msgid "symbolic links are not supported on this system" +@@ -1889,7 +1844,7 @@ + #: src/csplit.c:710 src/csplit.c:759 + #, c-format + msgid " on repetition %s\n" +-msgstr " en la %sa repetició\n" ++msgstr " a la %sa repetició\n" + + # Usa quote(). ivb + #: src/csplit.c:753 +@@ -1899,7 +1854,7 @@ + + #: src/csplit.c:817 src/csplit.c:857 src/nl.c:349 src/tac.c:274 + msgid "error in regular expression search" +-msgstr "error en la recerca de l’expressió regular" ++msgstr "error a la cerca de l’expressió regular" + + # Usa quote(). ivb + #: src/csplit.c:982 +@@ -1915,7 +1870,7 @@ + #: src/csplit.c:1074 + #, c-format + msgid "%s: `}' is required in repeat count" +-msgstr "%s: cal «}» en el nombre de repeticions" ++msgstr "%s: cal «}» al nombre de repeticions" + + #: src/csplit.c:1084 + #, c-format +@@ -1966,27 +1921,27 @@ + + #: src/csplit.c:1270 + msgid "missing conversion specifier in suffix" +-msgstr "manca l’especificació de conversió en el sufix" ++msgstr "manca l’especificació de conversió al sufix" + + #: src/csplit.c:1276 + #, c-format + msgid "invalid conversion specifier in suffix: %c" +-msgstr "l’especificació de conversió en el sufix no és vàlida: %c" ++msgstr "l’especificació de conversió al sufix no és vàlida: %c" + + #: src/csplit.c:1279 + #, c-format + msgid "invalid conversion specifier in suffix: \\%.3o" +-msgstr "l’especificació de conversió en el sufix no és vàlida: \\%.3o" ++msgstr "l’especificació de conversió al sufix no és vàlida: \\%.3o" + + #: src/csplit.c:1302 + #, c-format + msgid "too many %% conversion specifications in suffix" +-msgstr "sobren especificacions de conversió «%%» en el sufix" ++msgstr "sobren especificacions de conversió «%%» al sufix" + + #: src/csplit.c:1317 + #, c-format + msgid "missing %% conversion specification in suffix" +-msgstr "manca l’especificació de conversió «%%» en el sufix" ++msgstr "manca l’especificació de conversió «%%» al sufix" + + #: src/csplit.c:1361 + #, c-format +@@ -2005,8 +1960,7 @@ + "\n" + msgstr "" + "Divideix el FITXER en fragments separats pels patrons (PATRÓ) indicats, i\n" +-"escriu els fragments en fitxers anomenats «xx00», «xx01»… indicant en " +-"l’eixida\n" ++"escriu els fragments en fitxers anomenats «xx00», «xx01»… indicant a l’eixida\n" + "estàndard la mida en octets de cadascun d’ells.\n" + "\n" + +@@ -2018,8 +1972,8 @@ + " -k, --keep-files do not remove output files on errors\n" + msgstr "" + " -b, --suffix-format=FORMAT\n" +-" Usa aquest FORMAT d’sprintf() en lloc de «%02d».\n" +-" -f, --prefix=PREFIX Usa aquest PREFIX en lloc de «xx».\n" ++" Empra aquest FORMAT d’sprintf() en lloc de «%02d».\n" ++" -f, --prefix=PREFIX Empra aquest PREFIX en lloc de «xx».\n" + " -k, --keep-files No esborra els fitxer generats, en cas d’error.\n" + + #: src/csplit.c:1469 +@@ -2028,7 +1982,7 @@ + " -s, --quiet, --silent do not print counts of output file sizes\n" + " -z, --elide-empty-files remove empty output files\n" + msgstr "" +-" -n, --digits=DIGITS Usa el nombre de dígits especificat en lloc de 2.\n" ++" -n, --digits=DIGITS Empra el nombre de dígits especificat en lloc de 2.\n" + " -s, --quiet, --silent No mostra la mida dels fitxers resultants.\n" + " -z, --elide-empty-files\n" + " Esborra els fitxers resultants que estan buits.\n" +@@ -2053,16 +2007,12 @@ + "A line OFFSET is a required `+' or `-' followed by a positive integer.\n" + msgstr "" + "\n" +-" ENTER Copia fins a (però sense incloure) la línia " +-"especificada.\n" +-" /EXPREG/[DESPL] Copia fins a (però sense incloure) la línia " +-"coincident.\n" +-" %EXPREG%[DESPL] Salta fins a (però sense incloure) la línia " +-"coincident.\n" ++" ENTER Copia fins a (però sense incloure) la línia especificada.\n" ++" /EXPREG/[DESPL] Copia fins a (però sense incloure) la línia coincident.\n" ++" %EXPREG%[DESPL] Salta fins a (però sense incloure) la línia coincident.\n" + " {ENTER} Repeteix el patró anterior el nombre de vegades\n" + " especificat.\n" +-" {*} Repeteix el patró anterior tants cops com sigui " +-"possible.\n" ++" {*} Repeteix el patró anterior tants cops com sigui possible.\n" + "\n" + "Un desplaçament de línia (DESPL) és un «+» o «-» seguit d’un número enter\n" + "positiu.\n" +@@ -2080,7 +2030,7 @@ + "Print selected parts of lines from each FILE to standard output.\n" + "\n" + msgstr "" +-"Escriu parts seleccionades de les línies de cada FITXER en la sortida\n" ++"Escriu parts seleccionades de les línies de cada FITXER a la sortida\n" + "estàndard.\n" + "\n" + +@@ -2093,9 +2043,8 @@ + " -b, --bytes=LLISTA Només selecciona aquests octets.\n" + " -c, --characters=LLISTA\n" + " Només selecciona aquests caràcters.\n" +-" -d, --delimiter=DELIM Usa DELIM en lloc de la tabulació com a " +-"delimitador\n" +-" de camp.\n" ++" -d, --delimiter=DELIM Empra DELIM en lloc de la tabulació com a\n" ++" delimitador de camp.\n" + + #: src/cut.c:204 + msgid "" +@@ -2104,10 +2053,8 @@ + " the -s option is specified\n" + " -n (ignored)\n" + msgstr "" +-" -f, --fields=LLISTA Només selecciona aquests camps; també escriu totes " +-"les\n" +-" línies que no continguen el caràcter delimitador, " +-"tret\n" ++" -f, --fields=LLISTA Només selecciona aquests camps; també escriu totes les\n" ++" línies que no continguen el caràcter delimitador, tret\n" + " que s’especifique l’opció «-s».\n" + " -n (No es té en compte.)\n" + +@@ -2125,13 +2072,11 @@ + " --output-delimiter=STRING use STRING as the output delimiter\n" + " the default is to use the input delimiter\n" + msgstr "" +-" -s, --only-delimited No escriu les línies que no continguen el " +-"caràcter\n" ++" -s, --only-delimited No escriu les línies que no continguen el caràcter\n" + " delimitador.\n" + " --output-delimiter=CADENA\n" +-" Usa la CADENA com a delimitador de sortida; per " +-"defecte\n" +-" s’utilitza el delimitador d’entrada.\n" ++" Empra la CADENA com a delimitador de sortida; per\n" ++" defecte s’utilitza el delimitador d’entrada.\n" + + #: src/cut.c:221 + msgid "" +@@ -2149,10 +2094,8 @@ + "With no FILE, or when FILE is -, read standard input.\n" + msgstr "" + "\n" +-"No utilitzeu les opcions «-b», «-c» o «-f» conjuntament. Cada LLISTA " +-"consta\n" +-"d’un interval, o de diversos intervals separats per comes. L’entrada que " +-"és\n" ++"No utilitzeu les opcions «-b», «-c» o «-f» conjuntament. Cada LLISTA consta\n" ++"d’un interval, o de diversos intervals separats per comes. L’entrada que és\n" + "seleccionada és escrita en el mateix ordre que és llegida, i és escrita una\n" + "sola volta, exactament. Cada interval pot ser un de:\n" + "\n" +@@ -2195,15 +2138,13 @@ + + #: src/cut.c:828 + msgid "an input delimiter may be specified only when operating on fields" +-msgstr "" +-"només es pot especificar un delimitador d’entrada quan s’opere amb camps" ++msgstr "només es pot especificar un delimitador d’entrada quan s’opere amb camps" + + #: src/cut.c:832 + msgid "" + "suppressing non-delimited lines makes sense\n" + "\tonly when operating on fields" +-msgstr "" +-"eliminar les línies no delimitades només té sentit quan s’opera amb camps" ++msgstr "eliminar les línies no delimitades només té sentit quan s’opera amb camps" + + #: src/cut.c:848 + msgid "missing list of fields" +@@ -2235,11 +2176,9 @@ + " -d, --date=STRING display time described by STRING, not `now'\n" + " -f, --file=DATEFILE like --date once for each line of DATEFILE\n" + msgstr "" +-"Mostra la data actual en el FORMAT indicat, o estableix la data del " +-"sistema.\n" ++"Mostra la data actual en el FORMAT indicat, o estableix la data del sistema.\n" + "\n" +-" -d, --date=CADENA Mostra la data descrita en la CADENA en lloc de la " +-"data\n" ++" -d, --date=CADENA Mostra la data descrita a la CADENA en lloc de la data\n" + " actual («now», ara).\n" + " -f, --file=FITXER_DATES\n" + " Com aplicar «--date» una volta per cada línia de\n" +@@ -2256,14 +2195,13 @@ + " -u, --utc, --universal print or set Coordinated Universal Time\n" + msgstr "" + " -r, --reference=FITXER\n" +-" Mostra la data de l’última modificació del FITXER.\n" ++" Mostra la data de la darrera modificació del FITXER.\n" + " -R, --rfc-2822 Mostra la data conforme a l’RFC 2822.\n" + " --rfc-3339=PRECISIÓ\n" + " Mostra la data conforme a l’RFC 3339, fins a la\n" +-" PRECISIÓ indicada: «date» (data), «seconds» (segons) " +-"o\n" ++" PRECISIÓ indicada: «date» (data), «seconds» (segons) o\n" + " «ns» (nanosegons).\n" +-" -s, --set=CADENA Estableix la data descrita en la CADENA.\n" ++" -s, --set=CADENA Estableix la data descrita a la CADENA.\n" + " -u, --utc, --universal\n" + " Mostra o estableix el Temps Universal Coordinat.\n" + +@@ -2278,8 +2216,7 @@ + " %a locale's abbreviated weekday name (e.g., Sun)\n" + msgstr "" + "\n" +-"FORMAT controla l’eixida. L’única opció vàlida en la segona forma " +-"especifica\n" ++"FORMAT controla l’eixida. L’única opció vàlida a la segona forma especifica\n" + "el Temps Universal Coordinat. Les seqüències interpretades són:\n" + "\n" + " %% Un «%» literal.\n" +@@ -2306,8 +2243,7 @@ + " %D date; same as %m/%d/%y\n" + " %e day of month, space padded; same as %_d\n" + msgstr "" +-" %C Centúria, com «%Y» però sense els dos últims dígits, p. ex. " +-"«20».\n" ++" %C Centúria, com «%Y» però sense els dos darrers dígits, p. ex. «20».\n" + " %d Dia del mes, p. ex. «01».\n" + " %D Format de data equivalent a «%m/%d/%y».\n" + " %e Dia del mes replenat amb blancs, equival a «%_d».\n" +@@ -2320,7 +2256,7 @@ + " %G year of ISO week number (see %V); normally useful only with %V\n" + msgstr "" + " %F Data completa, equival a «%Y-%m-%d».\n" +-" %g Últims dos dígits de l’any, segons el número ISO de la setmana\n" ++" %g Darrers dos dígits de l’any, segons el número ISO de la setmana\n" + " (vegeu «%G»).\n" + " %G Any, segons el número ISO de la setmana (vegeu «%V»); a sovint\n" + " només és útil amb «%V».\n" +@@ -2363,9 +2299,8 @@ + " %N Nanosegons (000000000..999999999).\n" + " %p L’equivalent d’AM o PM del locale, buit si es desconeix.\n" + " %P Com «%p», però en minúscules.\n" +-" %r Hora del rellotge de 12 hores del locale, p. ex. «11:11:04 PM» " +-"en\n" +-" el locale C.\n" ++" %r Hora del rellotge de 12 hores del locale, p. ex. «11:11:04 PM» al\n" ++" locale C.\n" + " %R Hora i minuts del rellotge de 24 hores, equival a «%H:%M».\n" + " %s Segons des de l’1 de gener de 1970 a les 00:00:00 UTC.\n" + +@@ -2388,14 +2323,12 @@ + " %w day of week (0..6); 0 is Sunday\n" + " %W week number of year, with Monday as first day of week (00..53)\n" + msgstr "" +-" %U Número de la setmana dins l’any, amb el diumenge com a primer " +-"dia\n" ++" %U Número de la setmana dins l’any, amb el diumenge com a primer dia\n" + " de la setmana (00..53).\n" + " %V Número ISO de la setmana, amb el dilluns com a primer dia de la\n" + " setmana (01..53).\n" + " %w Dia de la setmana (0..6), on 0 és el diumenge.\n" +-" %W Número de la setmana dins l’any, amb el dilluns com a primer dia " +-"de\n" ++" %W Número de la setmana dins l’any, amb el dilluns com a primer dia de\n" + " la setmana (00..53).\n" + + #: src/date.c:212 +@@ -2407,7 +2340,7 @@ + msgstr "" + " %x Representació de la data del locale, p. ex. «31/12/99».\n" + " %X Representació de l’hora del locale, p. ex. «23:13:48».\n" +-" %y Últims dos dígits de l’any (00..99).\n" ++" %y Darrers dos dígits de l’any (00..99).\n" + " %Y Any.\n" + + #: src/date.c:218 +@@ -2415,8 +2348,7 @@ + " %z +hhmm numeric timezone (e.g., -0400)\n" + " %:z +hh:mm numeric timezone (e.g., -04:00)\n" + " %::z +hh:mm:ss numeric time zone (e.g., -04:00:00)\n" +-" %:::z numeric time zone with : to necessary precision (e.g., -04, " +-"+05:30)\n" ++" %:::z numeric time zone with : to necessary precision (e.g., -04, +05:30)\n" + " %Z alphabetic time zone abbreviation (e.g., EDT)\n" + "\n" + "By default, date pads numeric fields with zeroes.\n" +@@ -2436,12 +2368,12 @@ + " %Z Abreviatura alfanumèrica de la zona horària, p. ex. «EDT».\n" + "\n" + "Per defecte, «date» replena els camps numèrics amb zeros. Els senyaladors\n" +-"següents són opcionals i poden ser usats al darrere de «%»:\n" ++"següents són opcionals i poden ser emprats al darrere de «%»:\n" + "\n" + " «-» (menys) No replena el camp.\n" + " «_» (subratllat) Replena el camp amb espais.\n" + " «0» (zero) Replena el camp amb zeros.\n" +-" «^» Usa majúscules, si és possible.\n" ++" «^» Empra majúscules, si és possible.\n" + " «#» Intercanvia majúscules i minúscules, si és possible.\n" + + #: src/date.c:234 +@@ -2454,9 +2386,8 @@ + msgstr "" + "\n" + "Després dels senyaladors es pot indicar l’amplada del camp com a un número\n" +-"decimal; després es pot incloure el modificador opcional «E», per a usar " +-"les\n" +-"representacions alternatives del locale (si n’hi ha), o «O», per a usar els\n" ++"decimal; després es pot incloure el modificador opcional «E», per a emprar les\n" ++"representacions alternatives del locale (si n’hi ha), o «O», per a emprar els\n" + "símbols numèrics alternatius del locale (si n’hi ha).\n" + + #: src/date.c:262 src/dd.c:1614 src/head.c:840 src/md5sum.c:392 +@@ -2482,7 +2413,7 @@ + + #: src/date.c:420 + msgid "the options to print and set the time may not be used together" +-msgstr "no es pot usar alhora les opcions per a mostrar i per a establir dates" ++msgstr "no es poden emprar alhora les opcions per a mostrar i per a establir dates" + + # Usa quote(). ivb + #: src/date.c:441 +@@ -2491,10 +2422,7 @@ + "the argument %s lacks a leading `+';\n" + "When using an option to specify date(s), any non-option\n" + "argument must be a format string beginning with `+'." +-msgstr "" +-"manca un «+» al davant de l’argument %s; Quan useu una opció per a " +-"especificar dates, cal que qualsevol argument no‐opció siga una cadena de " +-"format que comence per «+»." ++msgstr "manca un «+» al davant de l’argument %s; Quan useu una opció per a especificar dates, cal que qualsevol argument no‐opció siga una cadena de format que comence per «+»." + + #: src/date.c:518 + msgid "cannot set date" +@@ -2530,9 +2458,8 @@ + " cbs=OCTETS Converteix aquest nombre d’OCTETS alhora.\n" + " conv=CONVERSIONS Converteix el fitxer d’acord amb la llista de\n" + " símbols separats per comes.\n" +-" count=BLOCS Només còpia aquest nombre de BLOCS de " +-"l’entrada.\n" +-" ibs=OCTETS Llig aquest nombre d’OCTETS alhora.\n" ++" count=BLOCS Només còpia aquest nombre de BLOCS de l’entrada.\n" ++" ibs=OCTETS Llegeix aquest nombre d’OCTETS alhora.\n" + + #: src/dd.c:415 + msgid "" +@@ -2545,16 +2472,14 @@ + " skip=BLOCKS skip BLOCKS ibs-sized blocks at start of input\n" + " status=noxfer suppress transfer statistics\n" + msgstr "" +-" if=FITXER Llig del FITXER en lloc de fer‐ho de l’entrada\n" ++" if=FITXER Llegeix del FITXER en lloc de fer‐ho de l’entrada\n" + " estàndard.\n" +-" iflag=SENYALADOR Llig d’acord amb la llista de símbols separats " +-"per\n" +-" comes.\n" ++" iflag=SENYALADOR Llegeix d’acord amb la llista de símbols separats\n" ++" per comes.\n" + " obs=OCTETS Escriu aquest nombre d’OCTETS alhora.\n" + " of=FITXER Escriu al FITXER en lloc de fer‐ho a l’eixida\n" + " estàndard.\n" +-" oflag=SENYALADOR Escriu d’acord amb la llista de símbols " +-"separats\n" ++" oflag=SENYALADOR Escriu d’acord amb la llista de símbols separats\n" + " per comes.\n" + " seek=BLOCS Salta aquest nombre de BLOCS de mida «obs» al\n" + " principi de l’eixida.\n" +@@ -2575,8 +2500,7 @@ + "\n" + "BLOCS i OCTETS poden estar seguits dels sufixos multiplicatius següents\n" + "(prefix valor): xM M, c 1, w 2, b 512, kB 1000, K 1024, MB 1000*1000,\n" +-"M 1024*1024, GB 1000*1000*1000, G 1024*1024*1024, i així per a T, P, E, Z, " +-"Y.\n" ++"M 1024*1024, GB 1000*1000*1000, G 1024*1024*1024, i així per a T, P, E, Z, Y.\n" + "\n" + "Cada símbol de CONVERSIONS pot ser:\n" + "\n" +@@ -2594,11 +2518,9 @@ + " ascii D’EBCDIC a ASCII.\n" + " ebcdic D’ASCII a EBCDIC.\n" + " ibm D’ASCII a EBCDIC alternat.\n" +-" block Emplena amb espais cada registre terminat en nova línia fins " +-"que\n" ++" block Emplena amb espais cada registre terminat en nova línia fins que\n" + " tinga la mida «cbs».\n" +-" unblock Substitueix els espais del final de cada registre de mida " +-"«cbs»\n" ++" unblock Substitueix els espais del final de cada registre de mida «cbs»\n" + " per un caràcter de nova línia.\n" + " lcase Transforma les majúscules en minúscules.\n" + +@@ -2622,11 +2544,9 @@ + " ucase Transforma les minúscules en majúscules.\n" + " swab Intercanvia cada parell d’octets de l’entrada.\n" + " noerror Continua després d’un error de lectura.\n" +-" sync Emplena cada bloc d’entrada amb NULs fins a la mida «ibs»; " +-"quan\n" +-" s’usa amb «block» o «unblock», emplena els blocs amb espais " +-"en\n" +-" lloc de NULs.\n" ++" sync Emplena cada bloc d’entrada amb NULs fins a la mida «ibs»; quan\n" ++" s’empra amb «block» o «unblock», emplena els blocs amb espais\n" ++" en lloc de NULs.\n" + " fdatasync Escriu físicament les dades del fitxer d’eixida abans de\n" + " terminar.\n" + " fsync El mateix, però també n’escriu les metadades.\n" +@@ -2645,11 +2565,11 @@ + + #: src/dd.c:461 + msgid " direct use direct I/O for data\n" +-msgstr " direct Usa E/S directa per a les dades.\n" ++msgstr " direct Empra E/S directa per a les dades.\n" + + #: src/dd.c:463 + msgid " dsync use synchronized I/O for data\n" +-msgstr " dsync Usa E/S sincronitzada per a les dades.\n" ++msgstr " dsync Empra E/S sincronitzada per a les dades.\n" + + #: src/dd.c:465 + msgid " sync likewise, but also for metadata\n" +@@ -2657,7 +2577,7 @@ + + #: src/dd.c:467 + msgid " nonblock use non-blocking I/O\n" +-msgstr " nonblock Usa E/S no blocadora.\n" ++msgstr " nonblock Empra E/S no blocadora.\n" + + #: src/dd.c:469 + msgid " nofollow do not follow symlinks\n" +@@ -2669,11 +2589,11 @@ + + #: src/dd.c:474 + msgid " binary use binary I/O for data\n" +-msgstr " binary Usa E/S binària per a les dades.\n" ++msgstr " binary Empra E/S binària per a les dades.\n" + + #: src/dd.c:476 + msgid " text use text I/O for data\n" +-msgstr " text Usa E/S textual per a les dades.\n" ++msgstr " text Empra E/S textual per a les dades.\n" + + # La substitució pot ser «USR1» o «INFO». ivb + #: src/dd.c:480 +@@ -2694,7 +2614,7 @@ + msgstr "" + "\n" + "Enviar un senyal %s a un procés «dd» en marxa fa que mostre una estadística\n" +-"d’entrada/eixida en l’eixida estàndard d’errors, i que després continue\n" ++"d’entrada/eixida a l’eixida estàndard d’errors, i que després continue\n" + "copiant.\n" + "\n" + " $ dd if=/dev/zero of=/dev/null& pid=$!\n" +@@ -2824,9 +2744,7 @@ + msgid "" + "warning: working around lseek kernel bug for file (%s)\n" + " of mt_type=0x%0lx -- see for the list of types" +-msgstr "" +-"avís: s’evita un error del nucli en lseek() pel fitxer «%s» de tipus " +-"mt_type=0x%0lx —vegeu per a la llista de tipus" ++msgstr "avís: s’evita un error del nucli en lseek() per al fitxer «%s» de tipus mt_type=0x%0lx —vegeu per a la llista de tipus" + + # El primer hauria de ser «no *es pot* desplaçar». ivb + #: src/dd.c:1161 src/dd.c:1218 +@@ -2842,9 +2760,7 @@ + + #: src/dd.c:1210 + msgid "warning: screwy file offset after failed read" +-msgstr "" +-"avís: després de la lectura fallada el desplaçament de fitxer no és " +-"acceptable" ++msgstr "avís: després de la lectura fallada el desplaçament de fitxer no és acceptable" + + #: src/dd.c:1214 + msgid "cannot work around kernel bug after all" +@@ -2878,19 +2794,15 @@ + + #: src/dd.c:1659 + #, c-format +-msgid "" +-"offset too large: cannot truncate to a length of seek=% (%lu-byte) " +-"blocks" +-msgstr "" +-"el desplaçament és massa gran: no es pot truncar a una longitud de %" +-" blocs de %lu octets" ++msgid "offset too large: cannot truncate to a length of seek=% (%lu-byte) blocks" ++msgstr "el desplaçament és massa gran: no es pot truncar a una longitud de % blocs de %lu octets" + + # Usa quote(). ivb + # Condició d'error. ivb + #: src/dd.c:1680 + #, c-format + msgid "truncating at % bytes in output file %s" +-msgstr "en truncar a % octets en el fitxer d’eixida %s" ++msgstr "en truncar a % octets al fitxer d’eixida %s" + + # FIXME: This arrangement is extremely language-dependent. ivb + # Ehemmm... AARGHHFSSS!! ivb +@@ -2906,7 +2818,7 @@ + #: src/df.c:155 + #, c-format + msgid " Inodes IUsed IFree IUse%%" +-msgstr " Nodes‐i Usats Lliures %%Ús" ++msgstr " Nodes‐i En ús Lliures %%Ús" + + # Format humà 2. ivb + #: src/df.c:159 +@@ -2924,18 +2836,18 @@ + #: src/df.c:164 + #, c-format + msgid " %4s-blocks Used Available Capacity" +-msgstr " Blocs %4s Usats Lliures Cabuda" ++msgstr " Blocs %4s En ús Lliures Cabuda" + + # Format habitual. ivb + #: src/df.c:195 + #, c-format + msgid " %4s-blocks Used Available Use%%" +-msgstr " Blocs %4s Usats Lliures %%Ús" ++msgstr " Blocs %4s En ús Lliures %%Ús" + + #: src/df.c:199 + #, c-format + msgid " Mounted on\n" +-msgstr " Muntat en\n" ++msgstr " Muntat a\n" + + #: src/df.c:449 + msgid "cannot get current directory" +@@ -2958,8 +2870,7 @@ + "or all file systems by default.\n" + "\n" + msgstr "" +-"Mostra informació sobre el sistema de fitxers on resideix cada FITXER, o " +-"(per\n" ++"Mostra informació sobre el sistema de fitxers on resideix cada FITXER, o (per\n" + "defecte) informació sobre tots els sistemes de fitxers.\n" + "\n" + +@@ -2968,24 +2879,21 @@ + msgid "" + " -a, --all include dummy file systems\n" + " -B, --block-size=SIZE use SIZE-byte blocks\n" +-" -h, --human-readable print sizes in human readable format (e.g., 1K 234M " +-"2G)\n" ++" -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\n" + " -H, --si likewise, but use powers of 1000 not 1024\n" + msgstr "" + " -a, --all Inclou els sistemes de fitxers virtuals.\n" +-" -B, --block-size=MIDA Usa blocs de MIDA octets.\n" +-" -h, --human-readable Mostra les mides en un format llegible pels " +-"humans\n" +-" (per exemple: 1K 234M 2G).\n" +-" -H, --si El mateix, però usa potències de 1000, no de 1024.\n" ++" -B, --block-size=MIDA Empra blocs de MIDA octets.\n" ++" -h, --human-readable Mostra les mides en un format llegible per als\n" ++" humans (per exemple: 1K 234M 2G).\n" ++" -H, --si El mateix, però empra potències de 1000, no de 1024.\n" + + #: src/df.c:736 + msgid "" + " -i, --inodes list inode information instead of block usage\n" + " -k like --block-size=1K\n" + " -l, --local limit listing to local file systems\n" +-" --no-sync do not invoke sync before getting usage info " +-"(default)\n" ++" --no-sync do not invoke sync before getting usage info (default)\n" + msgstr "" + " -i, --inodes Llista informació sobre els nodes índex en lloc de\n" + " sobre l’ús de blocs.\n" +@@ -3003,15 +2911,13 @@ + " -x, --exclude-type=TYPE limit listing to file systems not of type TYPE\n" + " -v (ignored)\n" + msgstr "" +-" -P, --portability Usa el format d’eixida POSIX.\n" +-" --sync Invoca sync() abans d’obtenir la informació sobre " +-"l’ús.\n" ++" -P, --portability Empra el format d’eixida POSIX.\n" ++" --sync Invoca sync() abans d’obtenir la informació sobre l’ús.\n" + " -t, --type=TIPUS Limita el llistat als sistemes de fitxers del TIPUS\n" + " especificat.\n" + " -T, --print-type Mostra el tipus de sistema de fitxers.\n" + " -x, --exclude-type=TIPUS\n" +-" Limita el llistat als sistemes de fitxers que no " +-"siguen\n" ++" Limita el llistat als sistemes de fitxers que no siguen\n" + " del TIPUS especificat.\n" + " -v (No es té en compte.)\n" + +@@ -3022,14 +2928,12 @@ + "kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.\n" + msgstr "" + "\n" +-"MIDA pot ser una de les següents: kB 1000, K 1024, MB 1000*1000, M " +-"1024*1024,\n" +-"i així per a G, T, P, E, Z, Y. També poden anar precedides d’un número " +-"enter.\n" ++"MIDA pot ser una de les següents: kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n" ++"i així per a G, T, P, E, Z, Y. També poden anar precedides d’un número enter.\n" + + #: src/df.c:813 src/du.c:755 src/ls.c:1541 + msgid "the --kilobytes option is deprecated; use -k instead" +-msgstr "l’opció «--kilobytes» està desaprovada; useu «-k» en el seu lloc" ++msgstr "l’opció «--kilobytes» està desaprovada; useu «-k» al seu lloc" + + # Usa quote(). ivb + #: src/df.c:872 +@@ -3078,13 +2982,10 @@ + "For details on the format of these files, run `dircolors --print-database'.\n" + msgstr "" + "\n" +-"Si s’especifica un FITXER, aquest es llig per a determinar quins colors " +-"usar\n" +-"per a quins tipus de fitxer i extensions. Altrament, s’usa una base de " +-"dades\n" +-"precompilada. Proveu «dircolors --print-database» per a obtenir detalls " +-"sobre\n" +-"el format d’aquests fitxers.\n" ++"Si s’especifica un FITXER, aquest es llegeix per a determinar quins colors\n" ++"emprar per a quins tipus de fitxer i extensions. Altrament, s’empra una base\n" ++"de dades precompilada. Proveu «dircolors --print-database» per a obtenir\n" ++"detalls sobre el format d’aquests fitxers.\n" + + #: src/dircolors.c:296 + #, c-format +@@ -3105,9 +3006,7 @@ + msgid "" + "the options to output dircolors' internal database and\n" + "to select a shell syntax are mutually exclusive" +-msgstr "" +-"l’opció que mostra la base de dades interna de «dircolors» i la que " +-"selecciona una sintaxi d’intèrpret són mútuament excloents" ++msgstr "l’opció que mostra la base de dades interna de «dircolors» i la que selecciona una sintaxi d’intèrpret són mútuament excloents" + + # Açò s'imprimeix després d'un missatge d'error. ivb + # Només es pot admetre un operand fitxer. ivb +@@ -3117,9 +3016,7 @@ + + #: src/dircolors.c:483 + msgid "no SHELL environment variable, and no shell type option given" +-msgstr "" +-"no hi ha variable d’entorn SHELL ni s’ha indicat cap opció de tipus " +-"d’intèrpret" ++msgstr "no hi ha variable d’entorn SHELL ni s’ha indicat cap opció de tipus d’intèrpret" + + #: src/dirname.c:49 + #, c-format +@@ -3137,8 +3034,7 @@ + "output `.' (meaning the current directory).\n" + "\n" + msgstr "" +-"Mostra el NOM sense el «/component» final; si el NOM no conté cap «/», " +-"mostra\n" ++"Mostra el NOM sense el «/component» final; si el NOM no conté cap «/», mostra\n" + "«.» (indicant així el directori actual).\n" + "\n" + +@@ -3169,14 +3065,13 @@ + "Summarize disk usage of each FILE, recursively for directories.\n" + "\n" + msgstr "" +-"Resumeix l’ús de disc de cada FITXER, de forma recursiva pels directoris.\n" ++"Resumeix l’ús de disc de cada FITXER, de forma recursiva per als directoris.\n" + "\n" + + #: src/du.c:291 + msgid "" + " -a, --all write counts for all files, not just directories\n" +-" --apparent-size print apparent sizes, rather than disk usage; " +-"although\n" ++" --apparent-size print apparent sizes, rather than disk usage; although\n" + " the apparent size is usually smaller, it may be\n" + " larger due to holes in (`sparse') files, internal\n" + " fragmentation, indirect blocks, and the like\n" +@@ -3185,15 +3080,13 @@ + " -c, --total produce a grand total\n" + " -D, --dereference-args dereference FILEs that are symbolic links\n" + msgstr "" +-" -a, --all Mostra recomptes per a tots els fitxers, no només " +-"pels\n" +-" directoris.\n" ++" -a, --all Mostra recomptes per a tots els fitxers, no només per\n" ++" als directoris.\n" + " --apparent-size Mostra les mides aparents en lloc de l’ús de disc;\n" +-" tot i que la mida aparent sol ser menor, pot ser " +-"major\n" ++" tot i que la mida aparent sol ser menor, pot ser major\n" + " pels forats dels fitxers dispersos, per fragmentació\n" + " interna, blocs indirectes…\n" +-" -B, --block-size=MIDA Usa blocs de MIDA octets.\n" ++" -B, --block-size=MIDA Empra blocs de MIDA octets.\n" + " -b, --bytes Equival a «--apparent-size --block-size=1».\n" + " -c, --total Produeix un recompte total.\n" + " -D, --dereference-args\n" +@@ -3204,49 +3097,39 @@ + " --files0-from=F summarize disk usage of the NUL-terminated file\n" + " names specified in file F\n" + " -H like --si, but also evokes a warning; will soon\n" +-" change to be equivalent to --dereference-args (-" +-"D)\n" +-" -h, --human-readable print sizes in human readable format (e.g., 1K 234M " +-"2G)\n" ++" change to be equivalent to --dereference-args (-D)\n" ++" -h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\n" + " --si like -h, but use powers of 1000 not 1024\n" + " -k like --block-size=1K\n" + " -l, --count-links count sizes many times if hard linked\n" + " -m like --block-size=1M\n" + msgstr "" + " --files0-from=FITXER\n" +-" Resumeix l’ús de disc dels fitxers els noms dels " +-"quals\n" +-" es troben llistats en el FITXER, terminats pel " +-"caràcter\n" ++" Resumeix l’ús de disc dels fitxers els noms dels quals\n" ++" es troben llistats al FITXER, terminats pel caràcter\n" + " NUL.\n" +-" -H Com «--si», però mostra un avís; aviat serà " +-"equivalent\n" ++" -H Com «--si», però mostra un avís; aviat serà equivalent\n" + " a «--dereference-args» (-D).\n" +-" -h, --human-readable Mostra les mides en un format llegible pels " +-"humans\n" +-" (per exemple: 1K 234M 2G).\n" +-" -H, --si El mateix, però usa potències de 1000, no de 1024\n" ++" -h, --human-readable Mostra les mides en un format llegible per als\n" ++" humans (per exemple: 1K 234M 2G).\n" ++" -H, --si El mateix, però empra potències de 1000, no de 1024\n" + " (opció desaprovada).\n" + " -k Equival a «--block-size=1K».\n" +-" -l, --count-links Compta les mides més d’una volta en el cas " +-"d’enllaços\n" ++" -l, --count-links Compta les mides més d’una volta en el cas d’enllaços\n" + " forts.\n" + " -m Equival a «--block-size=1M».\n" + + #: src/du.c:313 + msgid "" + " -L, --dereference dereference all symbolic links\n" +-" -P, --no-dereference don't follow any symbolic links (this is the " +-"default)\n" +-" -0, --null end each output line with 0 byte rather than " +-"newline\n" ++" -P, --no-dereference don't follow any symbolic links (this is the default)\n" ++" -0, --null end each output line with 0 byte rather than newline\n" + " -S, --separate-dirs do not include size of subdirectories\n" + " -s, --summarize display only a total for each argument\n" + msgstr "" + " -L, --dereference Segueix tots els enllaços simbòlics.\n" + " -P, --no-dereference No segueix cap enllaç simbòlic (per defecte).\n" +-" -0, --null Termina cada línia d’eixida amb un octet 0 en lloc " +-"d’un\n" ++" -0, --null Termina cada línia d’eixida amb un octet 0 en lloc d’un\n" + " caràcter de nova línia.\n" + " -S, --separate-dirs No inclou la mida dels subdirectoris.\n" + " -s, --summarize Només mostra un total per cada argument.\n" +@@ -3254,11 +3137,9 @@ + #: src/du.c:320 + msgid "" + " -x, --one-file-system skip directories on different file systems\n" +-" -X FILE, --exclude-from=FILE Exclude files that match any pattern in " +-"FILE.\n" ++" -X FILE, --exclude-from=FILE Exclude files that match any pattern in FILE.\n" + " --exclude=PATTERN Exclude files that match PATTERN.\n" +-" --max-depth=N print the total for a directory (or file, with --" +-"all)\n" ++" --max-depth=N print the total for a directory (or file, with --all)\n" + " only if it is N or fewer levels below the command\n" + " line argument; --max-depth=0 is the same as\n" + " --summarize\n" +@@ -3266,11 +3147,9 @@ + " -x, --one-file-system Exclou els directoris que es troben en altres\n" + " sistemes de fitxers diferents.\n" + " -X FITXER, --exclude-from=FITXER\n" +-" Exclou aquells fitxers que coincideixen amb algun " +-"dels\n" +-" patrons continguts en el FITXER.\n" +-" --exclude=PATRÓ Exclou aquells fitxers que coincideixen amb el " +-"PATRÓ.\n" ++" Exclou aquells fitxers que coincideixen amb algun dels\n" ++" patrons continguts al FITXER.\n" ++" --exclude=PATRÓ Exclou aquells fitxers que coincideixen amb el PATRÓ.\n" + " --max-depth=N Només mostra el total d’un directori (o fitxer, amb\n" + " «--all») si es troba N nivells o menys per sota de\n" + " l’argument de la línia d’ordres; «--max-depth=0»\n" +@@ -3280,8 +3159,7 @@ + # More creeping featurism. ivb + #: src/du.c:329 + msgid "" +-" --time show time of the last modification of any file in " +-"the\n" ++" --time show time of the last modification of any file in the\n" + " directory, or any of its subdirectories\n" + " --time=WORD show time as WORD instead of modification time:\n" + " atime, access, use, ctime or status\n" +@@ -3291,13 +3169,11 @@ + msgstr "" + " --time Mostra la data de modificació més recent de tots els\n" + " fitxers del directori i subdirectoris.\n" +-" --time=DATA Mostra la DATA indicada en lloc de la de " +-"modificació:\n" +-" accés (amb «atime», «access» o «use») o canvi " +-"d’estat\n" ++" --time=DATA Mostra la DATA indicada en lloc de la de modificació:\n" ++" accés (amb «atime», «access» o «use») o canvi d’estat\n" + " (amb «ctime» o «status»).\n" + " --time-style=ESTIL\n" +-" Mostra les dates usant l’ESTIL indicat: full-iso,\n" ++" Mostra les dates emprant l’ESTIL indicat: full-iso,\n" + " long-iso, iso, +FORMAT; FORMAT s’interpreta com en\n" + " «date».\n" + +@@ -3310,9 +3186,7 @@ + msgid "" + "WARNING: use --si, not -H; the meaning of the -H option will soon\n" + "change to be the same as that of --dereference-args (-D)" +-msgstr "" +-"avís: useu «--si», no «-H»; el significat de l’opció «-H» canviarà aviat al " +-"mateix que «--dereference-args» (-D)" ++msgstr "avís: useu «--si», no «-H»; el significat de l’opció «-H» canviarà aviat al mateix que «--dereference-args» (-D)" + + # Usa quote(). ivb + #: src/du.c:773 +@@ -3322,7 +3196,7 @@ + + #: src/du.c:782 + msgid "the --megabytes option is deprecated; use -m instead" +-msgstr "l’opció «--megabytes» està desaprovada; useu «-m» en el seu lloc" ++msgstr "l’opció «--megabytes» està desaprovada; useu «-m» al seu lloc" + + #: src/du.c:864 + msgid "cannot both summarize and show all entries" +@@ -3374,8 +3248,7 @@ + " -e enable interpretation of backslash escapes (default)\n" + " -E disable interpretation of backslash escapes\n" + msgstr "" +-" -e Habilita la interpretació de seqüències d’escapada " +-"amb\n" ++" -e Habilita la interpretació de seqüències d’escapada amb\n" + " barra invertida (per defecte).\n" + " -E Inhabilita la interpretació de seqüències d’escapada\n" + " amb barra invertida.\n" +@@ -3385,8 +3258,7 @@ + " -e enable interpretation of backslash escapes\n" + " -E disable interpretation of backslash escapes (default)\n" + msgstr "" +-" -e Habilita la interpretació de seqüències d’escapada " +-"amb\n" ++" -e Habilita la interpretació de seqüències d’escapada amb\n" + " barra invertida.\n" + " -E Inhabilita la interpretació de seqüències d’escapada\n" + " amb barra invertida (per defecte).\n" +@@ -3439,7 +3311,7 @@ + " -i, --ignore-environment start with an empty environment\n" + " -u, --unset=NAME remove variable from the environment\n" + msgstr "" +-"Estableix cada NOM a VALOR en l’entorn i executa l’ORDRE.\n" ++"Estableix cada NOM a VALOR a l’entorn i executa l’ORDRE.\n" + "\n" + " -i, --ignore-environment\n" + " Parteix d’un entorn buit.\n" +@@ -3461,8 +3333,7 @@ + "\n" + msgstr "" + "Converteix els caràcters de tabulació de cada FITXER a espais, i escriu el\n" +-"resultat a la sortida estàndard. Sense FITXER, o quan FITXER és «-», " +-"llegeix\n" ++"resultat a la sortida estàndard. Sense FITXER, o quan FITXER és «-», llegeix\n" + "l’entrada estàndard.\n" + "\n" + +@@ -3479,11 +3350,9 @@ + " de 8.\n" + + #: src/expand.c:127 +-msgid "" +-" -t, --tabs=LIST use comma separated list of explicit tab positions\n" ++msgid " -t, --tabs=LIST use comma separated list of explicit tab positions\n" + msgstr "" +-" -t, --tabs=LLISTA Especifica una llista de posicions explícites per " +-"cada\n" ++" -t, --tabs=LLISTA Especifica una llista de posicions explícites per cada\n" + " tabulació, separades per comes.\n" + + # És un enter correcte però massa gran. ivb +@@ -3532,13 +3401,12 @@ + " ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0\n" + msgstr "" + "\n" +-"Mostra el valor de l’EXPRESSIÓ en l’eixida estàndard. A sota, una línia en\n" ++"Mostra el valor de l’EXPRESSIÓ a l’eixida estàndard. A sota, una línia en\n" + "blanc separa grups amb precedència creixent. L’EXPRESSIÓ pot ser:\n" + "\n" + " ARG1 | ARG2 ARG1 si no és nul ni 0, ARG2 altrament.\n" + "\n" +-" ARG1 & ARG2 ARG1 si cap argument és nul ni 0, 0 " +-"altrament.\n" ++" ARG1 & ARG2 ARG1 si cap argument és nul ni 0, 0 altrament.\n" + + # El més llarg és «substr CADENA POS LONGITUD». ivb + #: src/expr.c:118 +@@ -3596,14 +3464,12 @@ + " length STRING length of STRING\n" + msgstr "" + "\n" +-" CADENA : EXPREG Resultat d’aplicar l’expressió regular " +-"EXPREG\n" ++" CADENA : EXPREG Resultat d’aplicar l’expressió regular EXPREG\n" + " sobre la CADENA.\n" + "\n" + " match CADENA EXPREG Equival a «CADENA : EXPREG».\n" + " substr CADENA POS LONGITUD Sub‐cadena de CADENA, comptant POS des d’1.\n" +-" index CADENA CARÀCTERS Índex de CADENA on hi ha algun CARÀCTER, o " +-"0.\n" ++" index CADENA CARÀCTERS Índex de CADENA on hi ha algun CARÀCTER, o 0.\n" + " length STRING Longitud de la CADENA.\n" + + # El més llarg és «substr CADENA POS LONGITUD». ivb +@@ -3615,8 +3481,7 @@ + " ( EXPRESSION ) value of EXPRESSION\n" + msgstr "" + " + COMPONENT Interpreta el COMPONENT com a una cadena,\n" +-" encara que siga una paraula clau com " +-"«match»\n" ++" encara que siga una paraula clau com «match»\n" + " o un operador com «/».\n" + " ( EXPRESSIÓ ) Valor de l’EXPRESSIÓ.\n" + +@@ -3626,30 +3491,24 @@ + "Beware that many operators need to be escaped or quoted for shells.\n" + "Comparisons are arithmetic if both ARGs are numbers, else lexicographical.\n" + "Pattern matches return the string matched between \\( and \\) or null; if\n" +-"\\( and \\) are not used, they return the number of characters matched or " +-"0.\n" ++"\\( and \\) are not used, they return the number of characters matched or 0.\n" + msgstr "" + "\n" +-"Teniu en compte que molts operadors han de ser escapats o entrecometats en " +-"els\n" ++"Teniu en compte que molts operadors han de ser escapats o entrecometats als\n" + "intèrprets d’ordres. Les comparacions són aritmètiques entre números,\n" +-"lexicogràfiques en altre cas. Les comparacions amb patrons retornen la " +-"cadena\n" +-"coincident entre «\\(» i «\\)» o la cadena buida; si no s’usa «\\(» i " +-"«\\)»,\n" ++"lexicogràfiques en altre cas. Les comparacions amb patrons retornen la cadena\n" ++"coincident entre «\\(» i «\\)» o la cadena buida; si no s’empra «\\(» i «\\)»,\n" + "retornen el nombre de caràcters coincidents o 0.\n" + + #: src/expr.c:160 + msgid "" + "\n" +-"Exit status is 0 if EXPRESSION is neither null nor 0, 1 if EXPRESSION is " +-"null\n" ++"Exit status is 0 if EXPRESSION is neither null nor 0, 1 if EXPRESSION is null\n" + "or 0, 2 if EXPRESSION is syntactically invalid, and 3 if an error occurred.\n" + msgstr "" + "\n" + "L’estat d’eixida és 0 si l’expressió no és nuŀla ni 0; 1 si l’expressió és\n" +-"nuŀla o 0; 2 si l’EXPRESSIÓ no és vàlida sintàcticament; 3 si ocorre un " +-"error.\n" ++"nuŀla o 0; 2 si l’EXPRESSIÓ no és vàlida sintàcticament; 3 si ocorre un error.\n" + + #: src/expr.c:174 + msgid "syntax error" +@@ -3661,13 +3520,11 @@ + msgid "" + "warning: unportable BRE: %s: using `^' as the first character\n" + "of the basic regular expression is not portable; it is being ignored" +-msgstr "" +-"avís: l’expressió %s no és portable: usar «^» com a primer caràcter d’una " +-"expressió regular bàsica no és portable; es descarta" ++msgstr "avís: l’expressió %s no és portable: emprar «^» com a primer caràcter d’una expressió regular bàsica no és portable; es descarta" + + #: src/expr.c:464 src/ptx.c:288 + msgid "error in regular expression matcher" +-msgstr "error en el cercador d’expressions regulars" ++msgstr "error al cercador d’expressions regulars" + + # És un missatge d'error (expr a + 3). ivb + #: src/expr.c:639 src/expr.c:681 +@@ -3702,9 +3559,8 @@ + "are specified on the command line, they are read from standard input.\n" + msgstr "" + "\n" +-"Mostra els factors primers de cada NÚMERO enter especificat. Si no " +-"s’indica\n" +-"cap argument en la línia d’ordres, es llegiran de l’entrada estàndard.\n" ++"Mostra els factors primers de cada NÚMERO enter especificat. Si no s’indica\n" ++"cap argument a la línia d’ordres, es llegiran de l’entrada estàndard.\n" + + # És un enter correcte però massa gran. ivb + #: src/factor.c:156 src/od.c:1678 src/od.c:1747 +@@ -3729,7 +3585,7 @@ + "If no FILE or if FILE is `-', read standard input.\n" + "\n" + msgstr "" +-"Reformata els paràgrafs de cada FITXER, i escriu en la sortida estàndard.\n" ++"Reformata els paràgrafs de cada FITXER, i escriu a la sortida estàndard.\n" + "Sense FITXER, o si el FITXER és «-», llegeix l’entrada estàndard.\n" + "\n" + +@@ -3746,8 +3602,7 @@ + " -p, --prefix=CADENA Només combina les línies que tenen la CADENA com a\n" + " prefix, tornant‐la a posar al principi de les línies\n" + " reformatades.\n" +-" -s, --split-only Només separa les línies llargues, no combina les " +-"línies\n" ++" -s, --split-only Només separa les línies llargues, no combina les línies\n" + " curtes.\n" + + #: src/fmt.c:289 +@@ -3757,12 +3612,10 @@ + " -w, --width=WIDTH maximum line width (default of 75 columns)\n" + msgstr "" + " -t, --tagged-paragraph\n" +-" La indentació de la primera línia és diferent de la " +-"de\n" ++" La indentació de la primera línia és diferent de la de\n" + " la segona.\n" + " -u, --uniform-spacing Un espai entre paraules, dos entre frases.\n" +-" -w, --width=AMPLADA Indica l’AMPLADA màxima de la línia (per defecte " +-"75\n" ++" -w, --width=AMPLADA Indica l’AMPLADA màxima de la línia (per defecte 75\n" + " columnes).\n" + + #: src/fmt.c:358 +@@ -3772,7 +3625,7 @@ + "option; use -w N instead" + msgstr "" + "l’opció «%c» no és vàlida; «-AMPLADA» només es reconeix quan és la primera\n" +-"opció; useu «-w AMPLADA» en el seu lloc" ++"opció; useu «-w AMPLADA» al seu lloc" + + # Usa quote(). ivb + #: src/fmt.c:400 +@@ -3786,9 +3639,8 @@ + "standard output.\n" + "\n" + msgstr "" +-"Ajusta les línies de cada FITXER (per defecte l’entrada estàndard), i " +-"escriu\n" +-"en la sortida estàndard.\n" ++"Ajusta les línies de cada FITXER (per defecte l’entrada estàndard), i escriu\n" ++"a la sortida estàndard.\n" + "\n" + + #: src/fold.c:82 +@@ -3798,7 +3650,7 @@ + " -w, --width=WIDTH use WIDTH columns instead of 80\n" + msgstr "" + " -b, --bytes Compta octets, i no columnes.\n" +-" -s, --spaces Només parteix les línies en els espais.\n" ++" -s, --spaces Només parteix les línies als espais.\n" + " -w, --width=AMPLADA Indica el nombre de columnes, en lloc de 80.\n" + + # Usa quote(). ivb +@@ -3814,10 +3666,8 @@ + "With no FILE, or when FILE is -, read standard input.\n" + "\n" + msgstr "" +-"Escriu les 10 primeres línies de cada FITXER en la sortida estàndard. Amb " +-"més\n" +-"d’un fitxer, els precedeix amb una capçalera amb el nom del fitxer. Sense " +-"cap\n" ++"Escriu les 10 primeres línies de cada FITXER a la sortida estàndard. Amb més\n" ++"d’un fitxer, els precedeix amb una capçalera amb el nom del fitxer. Sense cap\n" + "FITXER, o quan FITXER és «-», llegeix l’entrada estàndard.\n" + "\n" + +@@ -3830,13 +3680,12 @@ + " with the leading `-', print all but the last\n" + " N lines of each file\n" + msgstr "" +-" -c, --bytes=[-]N Escriu els N primers octets de cada fitxer; amb un " +-"«-»\n" ++" -c, --bytes=[-]N Escriu els N primers octets de cada fitxer; amb un «-»\n" + " al davant, escriu tots els octets de cada fitxer\n" +-" exceptuant‐ne els últims N.\n" ++" exceptuant‐ne els darrers N.\n" + " -n, --lines=[-]N Escriu les primeres N línies en lloc de les primeres\n" + " 10; amb un «-» al davant, escriu totes les línies de\n" +-" cada fitxer exceptuant‐ne les últimes N.\n" ++" cada fitxer exceptuant‐ne les darreres N.\n" + + #: src/head.c:130 + msgid "" +@@ -3844,8 +3693,7 @@ + " -v, --verbose always print headers giving file names\n" + msgstr "" + " -q, --quiet, --silent Omet les capçaleres amb els noms dels fitxers.\n" +-" -v, --verbose Sempre escriu les capçaleres amb els noms dels " +-"fitxers.\n" ++" -v, --verbose Sempre escriu les capçaleres amb els noms dels fitxers.\n" + + #: src/head.c:136 + msgid "" +@@ -3853,8 +3701,7 @@ + "N may have a multiplier suffix: b 512, k 1024, m 1024*1024.\n" + msgstr "" + "\n" +-"N pot tenir un sufix multiplicador: «b» per a 512 octets, «k» per a 1024, " +-"«m»\n" ++"N pot tenir un sufix multiplicador: «b» per a 512 octets, «k» per a 1024, «m»\n" + "per a 1024*1024.\n" + + # uniq no usa quote(). ivb +@@ -3958,7 +3805,7 @@ + + #: src/hostname.c:106 + msgid "cannot set hostname; this system lacks the functionality" +-msgstr "no es pot establir el nom d’estació; el sistema no ho suporta" ++msgstr "no es pot establir el nom d’estació; el sistema no ho admet" + + #: src/hostname.c:114 + msgid "cannot determine hostname" +@@ -3980,15 +3827,14 @@ + " -r, --real print the real ID instead of the effective ID, with -ugG\n" + " -u, --user print only the effective user ID\n" + msgstr "" +-"Mostra informació sobre NOM_USUARI, o sobre la usuària o usuari actual.\n" ++"Mostra informació sobre NOM_USUARI, o sobre l’usuari actual.\n" + "\n" + " -a No es té en compte, s’accepta per compatibilitat amb\n" + " altres versions.\n" + " -g, --group Només mostra l’identificador efectiu de grup.\n" + " -G, --groups Mostra tots els identificadors de grup.\n" + " -n, --name Mostra un nom en lloc d’un número, per a «-ugG».\n" +-" -r, --real Mostra l’identificador real en lloc de l’efectiu, " +-"per\n" ++" -r, --real Mostra l’identificador real en lloc de l’efectiu, per\n" + " «-ugG».\n" + " -u, --user Només mostra l’identificador efectiu d’usuari.\n" + +@@ -4006,7 +3852,7 @@ + + #: src/id.c:156 + msgid "cannot print only names or real IDs in default format" +-msgstr "no es pot mostrar només noms o ID reals en el format per defecte" ++msgstr "no es pot mostrar només noms o ID reals al format per defecte" + + #: src/id.c:168 + #, c-format +@@ -4033,7 +3879,7 @@ + + #: src/install.c:292 + msgid "the strip option may not be used when installing a directory" +-msgstr "no es pot usar l’opció «--strip» en instaŀlar un directori" ++msgstr "no es pot emprar l’opció «--strip» en instaŀlar un directori" + + # Es refereix a especificar l'opció «--target-directory». ivb + #: src/install.c:295 +@@ -4111,11 +3957,9 @@ + "In the 4th form, create all components of the given DIRECTORY(ies).\n" + "\n" + msgstr "" +-"En els tres primers formats es còpia un ORIGEN a un DESTÍ o diversos " +-"ORIGENs\n" +-"al DIRECTORI existent, i se n’estableixen els permisos i el propietari o " +-"grup.\n" +-"En el quart format es creen tots els components de cada DIRECTORI indicat.\n" ++"Als tres primers formats es còpia un ORIGEN a un DESTÍ o diversos ORIGENs al\n" ++"DIRECTORI existent, i se n’estableixen els permisos i el propietari o grup.\n" ++"Al quart format es creen tots els components de cada DIRECTORI indicat.\n" + "\n" + + #: src/install.c:649 +@@ -4131,40 +3975,32 @@ + " existent.\n" + " -b Com «--backup», però no accepta cap argument.\n" + " -c (No es té en compte.)\n" +-" -d, --directory Tracta tots els arguments com a noms de directori; " +-"crea\n" ++" -d, --directory Tracta tots els arguments com a noms de directori; crea\n" + " tots els components de cada directori especificat.\n" + + #: src/install.c:656 + msgid "" +-" -D create all leading components of DEST except the " +-"last,\n" ++" -D create all leading components of DEST except the last,\n" + " then copy SOURCE to DEST\n" +-" -g, --group=GROUP set group ownership, instead of process' current " +-"group\n" +-" -m, --mode=MODE set permission mode (as in chmod), instead of rwxr-xr-" +-"x\n" ++" -g, --group=GROUP set group ownership, instead of process' current group\n" ++" -m, --mode=MODE set permission mode (as in chmod), instead of rwxr-xr-x\n" + " -o, --owner=OWNER set ownership (super-user only)\n" + msgstr "" + " -D Crea tots els components que porten al DESTÍ excepte\n" +-" l’últim, i còpia ORIGEN a DESTÍ.\n" +-" -g, --group=GRUP Estableix la propietat de grup a GRUP, en lloc " +-"d’usar\n" +-" el grup actual del procés.\n" +-" -m, --mode=MODE Estableix els permisos a MODE (com fa «chmod»), en " +-"lloc\n" +-" d’usar «rwxr-xr-x».\n" +-" -o, --owner=OWNER Estableix el propietari (només pel superusuari).\n" ++" el darrer, i còpia ORIGEN a DESTÍ.\n" ++" -g, --group=GRUP Estableix la propietat de grup a GRUP, en comptes\n" ++" d’emprar el grup actual del procés.\n" ++" -m, --mode=MODE Estableix els permisos a MODE (com fa «chmod»), en lloc\n" ++" d’emprar «rwxr-xr-x».\n" ++" -o, --owner=OWNER Estableix el propietari (només per al superusuari).\n" + + #: src/install.c:663 + msgid "" +-" -p, --preserve-timestamps apply access/modification times of SOURCE " +-"files\n" ++" -p, --preserve-timestamps apply access/modification times of SOURCE files\n" + " to corresponding destination files\n" + " -s, --strip strip symbol tables\n" + " -S, --suffix=SUFFIX override the usual backup suffix\n" +-" -t, --target-directory=DIRECTORY copy all SOURCE arguments into " +-"DIRECTORY\n" ++" -t, --target-directory=DIRECTORY copy all SOURCE arguments into DIRECTORY\n" + " -T, --no-target-directory treat DEST as a normal file\n" + " -v, --verbose print the name of each directory as it is created\n" + msgstr "" +@@ -4178,24 +4014,21 @@ + " Còpia cada ORIGEN al DIRECTORI.\n" + " -T, --no-target-directory\n" + " Tracta el DESTÍ com a un fitxer normal.\n" +-" -v, --verbose Mostra el nom de cada directori segons es van " +-"creant.\n" ++" -v, --verbose Mostra el nom de cada directori segons es van creant.\n" + + #: src/install.c:674 src/ln.c:383 src/mv.c:332 + msgid "" + "\n" + "The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.\n" +-"The version control method may be selected via the --backup option or " +-"through\n" ++"The version control method may be selected via the --backup option or through\n" + "the VERSION_CONTROL environment variable. Here are the values:\n" + "\n" + msgstr "" + "\n" +-"El sufix de còpia de seguretat és «~», si no s’estableix amb «--suffix» o " +-"amb\n" ++"El sufix de còpia de seguretat és «~», si no s’estableix amb «--suffix» o amb\n" + "la variable SIMPLE_BACKUP_SUFFIX. El mètode de control de versions es pot\n" + "establir amb l’opció «--backup» o fent servir la variable d’entorn\n" +-"VERSION_CONTROL. Es poden usar aquests valors:\n" ++"VERSION_CONTROL. Es poden emprar aquests valors:\n" + "\n" + + #: src/join.c:138 +@@ -4208,15 +4041,13 @@ + " FILENUM is 1 or 2, corresponding to FILE1 or FILE2\n" + " -e EMPTY replace missing input fields with EMPTY\n" + msgstr "" +-"Escriu una línia en la sortida estàndard per cada parell de línies de\n" +-"l’entrada que continguin idèntics camps d’unió. El camp per defecte és el\n" +-"primer, delimitat per espais en blanc. Si o FITXER1 o FITXER2 (no els dos) " +-"és\n" +-"«-», llegeix l’entrada estàndard.\n" ++"Escriu una línia a la sortida estàndard per cada parell de línies de l’entrada\n" ++"que continguin idèntics camps d’unió. El camp per defecte és el primer,\n" ++"delimitat per espais en blanc. Si o FITXER1 o FITXER2 (no els dos) és «-»,\n" ++"llegeix l’entrada estàndard.\n" + "\n" +-" -a NUMFITXER Escriu les línies desaparellades del fitxer " +-"NUMFITXER,\n" +-" «1» pel FITXER1 o «2» pel FITXER2.\n" ++" -a NUMFITXER Escriu les línies desaparellades del fitxer NUMFITXER,\n" ++" «1» per al FITXER1 o «2» per al FITXER2.\n" + " -e CADENA Reemplaça els camps que manquen amb CADENA.\n" + + #: src/join.c:147 +@@ -4226,14 +4057,12 @@ + " -o FORMAT obey FORMAT while constructing output line\n" + " -t CHAR use CHAR as input and output field separator\n" + msgstr "" +-" -i, --ignore-case No té en compte les majúscules i minúscules en " +-"comparar\n" ++" -i, --ignore-case No té en compte les majúscules i minúscules en comparar\n" + " els camps.\n" + " -j CAMP Equival a «-1 CAMP -2 CAMP».\n" +-" -o FORMAT Usa el FORMAT per a construir la línia de sortida.\n" +-" -t CARÀCTER Usa el CARÀCTER com a separador dels camps d’entrada " +-"i\n" +-" de sortida.\n" ++" -o FORMAT Empra el FORMAT per a construir la línia de sortida.\n" ++" -t CARÀCTER Empra el CARÀCTER com a separador dels camps d’entrada\n" ++" i de sortida.\n" + + #: src/join.c:153 + msgid "" +@@ -4260,14 +4089,10 @@ + msgstr "" + "\n" + "Tret que especifiqueu «-t CARÀCTER», els separadors de camp són espais en\n" +-"blanc i no es tenen en compte; si no el separador és el CARÀCTER. Cada " +-"CAMP\n" +-"s’identifica amb un número, comptant des de 1. FORMAT és una especifiació, " +-"o\n" +-"diverses separades per espais o comes, del tipus «NUMFITXER.CAMP» o «0». " +-"El\n" +-"FORMAT per defecte escriu el camp d’unió, els camps restants del FITXER1 i " +-"els\n" ++"blanc i no es tenen en compte; si no el separador és el CARÀCTER. Cada CAMP\n" ++"s’identifica amb un número, comptant des de 1. FORMAT és una especifiació, o\n" ++"diverses separades per espais o comes, del tipus «NUMFITXER.CAMP» o «0». El\n" ++"FORMAT per defecte escriu el camp d’unió, els camps restants del FITXER1 i els\n" + "camps restants del FITXER2, tots separats pel CARÀCTER.\n" + "\n" + "Important: FITXER1 i FITXER2 han d’estar ordenats per llurs camps d’unió.\n" +@@ -4294,7 +4119,7 @@ + #: src/join.c:664 + #, c-format + msgid "invalid file number in field spec: %s" +-msgstr "el número de fitxer en l’especificació de camp no és vàlid: %s" ++msgstr "el número de fitxer a l’especificació de camp no és vàlid: %s" + + #: src/join.c:707 + #, c-format +@@ -4305,8 +4130,7 @@ + # I damunt no descriu bé l'error. ivb + #: src/join.c:833 + msgid "conflicting empty-field replacement strings" +-msgstr "" +-"s’han indicat dues cadenes distintes per a reemplaçar els camps mancants" ++msgstr "s’han indicat dues cadenes distintes per a reemplaçar els camps mancants" + + # No és necessàriament una tabulació, ho diu info. ivb + #: src/join.c:874 src/sort.c:2354 +@@ -4352,14 +4176,12 @@ + msgid "" + " -s, --signal=SIGNAL, -SIGNAL\n" + " specify the name or number of the signal to be sent\n" +-" -l, --list list signal names, or convert signal names to/from " +-"numbers\n" ++" -l, --list list signal names, or convert signal names to/from numbers\n" + " -t, --table print a table of signal information\n" + msgstr "" + " -s, --signal=SENYAL, -SENYAL\n" + " Especifica el nom o número del senyal a enviar.\n" +-" -l, --list Llista els noms dels senyals, o converteix els noms " +-"de\n" ++" -l, --list Llista els noms dels senyals, o converteix els noms de\n" + " senyals a números i a la inversa.\n" + " -t, --table Mostra una taula amb informació sobre els senyals.\n" + +@@ -4372,8 +4194,7 @@ + msgstr "" + "\n" + "SENYAL pot ser un nom de senyal com «HUP», un número de senyal com «1», o\n" +-"l’estat d’eixida d’un procés terminat per un senyal. PID és un número " +-"enter;\n" ++"l’estat d’eixida d’un procés terminat per un senyal. PID és un número enter;\n" + "si és negatiu identifica un grup de processos.\n" + + #: src/kill.c:165 +@@ -4422,8 +4243,7 @@ + "Call the link function to create a link named FILE2 to an existing FILE1.\n" + "\n" + msgstr "" +-"Crida la funció link() per a crear un enllaç anomenat FITXER2 que apunte cap " +-"a\n" ++"Crida la funció link() per a crear un enllaç anomenat FITXER2 que apunte cap a\n" + "un FITXER1 existent.\n" + "\n" + +@@ -4502,37 +4322,32 @@ + "When creating hard links, each TARGET must exist.\n" + "\n" + msgstr "" +-"En la 1a forma crea un enllaç anomenat NOM_ENLLAÇ que apunta al DESTÍ. En " +-"la\n" +-"2a forma crea un enllaç en el directori actual que apunta al DESTÍ. En les\n" +-"formes 3a i 4a crea enllaços en el DIRECTORI a cada DESTÍ. Per defecte es\n" +-"creen enllaços forts; es creen simbòlics fent servir «--symbolic». En " +-"crear\n" +-"enllaços forts, cal que existesca cadascun dels fitxers DESTÍ.\n" ++"A la 1a forma crea un enllaç anomenat NOM_ENLLAÇ que apunta al DESTÍ. A la 2a\n" ++"forma crea un enllaç al directori actual que apunta al DESTÍ. A les formes 3a\n" ++"i 4a crea enllaços al DIRECTORI a cada DESTÍ. Per defecte es creen enllaços\n" ++"forts; es creen simbòlics fent servir «--symbolic». En crear enllaços forts,\n" ++"cal que existesca cadascun dels fitxers DESTÍ.\n" + "\n" + + #: src/ln.c:360 + msgid "" +-" --backup[=CONTROL] make a backup of each existing destination " +-"file\n" ++" --backup[=CONTROL] make a backup of each existing destination file\n" + " -b like --backup but does not accept an argument\n" + " -d, -F, --directory allow the superuser to attempt to hard link\n" +-" directories (note: will probably fail due " +-"to\n" +-" system restrictions, even for the " +-"superuser)\n" ++" directories (note: will probably fail due to\n" ++" system restrictions, even for the superuser)\n" + " -f, --force remove existing destination files\n" + msgstr "" + " --backup[=CONTROL]\n" + " Crea una còpia de seguretat de cada fitxer destí\n" + " existent.\n" + " -b Com «--backup», però no accepta cap argument.\n" +-" -d, -F, --directory Crea enllaços forts cap als directoris (només pel\n" ++" -d, -F, --directory Crea enllaços forts cap als directoris (només per al\n" + " superusuari).\n" + " -d, -F, --directory Permet al superusuari provar de crear enllaços forts\n" +-" cap a directoris (Nota: probablement fallarà fins i " +-"tot\n" +-" pel superusuari degut a restriccions del sistema).\n" ++" cap a directoris (nota: probablement fallarà fins i tot\n" ++" per al superusuari a causa de restriccions del\n" ++" sistema).\n" + " -f, --force Elimina els fitxers destí existents.\n" + + #: src/ln.c:368 +@@ -4550,8 +4365,7 @@ + #: src/ln.c:374 + msgid "" + " -S, --suffix=SUFFIX override the usual backup suffix\n" +-" -t, --target-directory=DIRECTORY specify the DIRECTORY in which to " +-"create\n" ++" -t, --target-directory=DIRECTORY specify the DIRECTORY in which to create\n" + " the links\n" + " -T, --no-target-directory treat LINK_NAME as a normal file\n" + " -v, --verbose print name of each file before linking\n" +@@ -4578,7 +4392,7 @@ + "Print the name of the current user.\n" + "\n" + msgstr "" +-"Mostra el nom de la usuària o usuari actual.\n" ++"Mostra el nom de l’usuari actual.\n" + "\n" + + #: src/logname.c:89 +@@ -4598,20 +4412,17 @@ + #: src/ls.c:1428 + #, c-format + msgid "ignoring invalid value of environment variable QUOTING_STYLE: %s" +-msgstr "" +-"es descarta el valor no vàlid de la variable d’entorn QUOTING_STYLE: %s" ++msgstr "es descarta el valor no vàlid de la variable d’entorn QUOTING_STYLE: %s" + + #: src/ls.c:1455 + #, c-format + msgid "ignoring invalid width in environment variable COLUMNS: %s" +-msgstr "es descarta l’amplària no vàlida en la variable d’entorn COLUMNS: %s" ++msgstr "es descarta l’amplària no vàlida a la variable d’entorn COLUMNS: %s" + + #: src/ls.c:1485 + #, c-format + msgid "ignoring invalid tab size in environment variable TABSIZE: %s" +-msgstr "" +-"es descarta l’amplària no vàlida de tabulació en la variable d’entorn " +-"TABSIZE: %s" ++msgstr "es descarta l’amplària no vàlida de tabulació a la variable d’entorn TABSIZE: %s" + + #: src/ls.c:1601 src/ptx.c:2071 + #, c-format +@@ -4675,16 +4486,14 @@ + # 3.- Com és de _vital_ el moviment cap enrere de la pantalla de text + # (Déu els compila i ells s'enllacen!) ivb + #: src/ls.c:4101 +-#, fuzzy + msgid "" + "List information about the FILEs (the current directory by default).\n" + "Sort entries alphabetically if none of -cftuvSUX nor --sort.\n" + "\n" + msgstr "" +-"Llista informació sobre els cada FITXER (per defecte sobre el directori\n" +-"actual). Ordena les entrades alfabèticament si no s’indica cap de les " +-"opcions\n" +-"«-cftuSUX» o «--sort».\n" ++"Llista informació sobre cada FITXER (per defecte sobre el directori actual).\n" ++"Ordena les entrades alfabèticament si no s’indica cap de les opcions\n" ++"«-cftuvSUX» o «--sort».\n" + "\n" + + # Amb «implied» vol dir que no han estat indicats explícitament com a args. ivb +@@ -4698,24 +4507,21 @@ + " -a, --all No passa per alt les entrades que comencen amb «.».\n" + " -A, --almost-all No llista els directoris implícits «.» i «..».\n" + " --author Amb «-l», mostra l’autor de cada fitxer.\n" +-" -b, --escape Mostra seqüències d’escapada octals pels caràcters " +-"no\n" +-" gràfics.\n" ++" -b, --escape Mostra seqüències d’escapada octals per als caràcters\n" ++" no gràfics.\n" + + #: src/ls.c:4115 + msgid "" + " --block-size=SIZE use SIZE-byte blocks\n" + " -B, --ignore-backups do not list implied entries ending with ~\n" +-" -c with -lt: sort by, and show, ctime (time of " +-"last\n" ++" -c with -lt: sort by, and show, ctime (time of last\n" + " modification of file status information)\n" + " with -l: show ctime and sort by name\n" + " otherwise: sort by ctime\n" + msgstr "" +-" -B, --ignore-backups No mostra les entrades implícites acabades en " +-"«~».\n" ++" -B, --ignore-backups No mostra les entrades implícites acabades en «~».\n" + " -c Amb «-lt», ordena per (i mostra) la data de canvi\n" +-" (moment de l’última modificació de la informació\n" ++" (moment de la darrera modificació de la informació\n" + " d’estat del fitxer).\n" + " Amb «-l», mostra la data de canvi i ordena pel nom.\n" + " Altrament, ordena per la data de canvi.\n" +@@ -4723,21 +4529,18 @@ + #: src/ls.c:4123 + msgid "" + " -C list entries by columns\n" +-" --color[=WHEN] control whether color is used to distinguish " +-"file\n" +-" types. WHEN may be `never', `always', or " +-"`auto'\n" ++" --color[=WHEN] control whether color is used to distinguish file\n" ++" types. WHEN may be `never', `always', or `auto'\n" + " -d, --directory list directory entries instead of contents,\n" + " and do not dereference symbolic links\n" + " -D, --dired generate output designed for Emacs' dired mode\n" + msgstr "" + " -C Llista les entrades en columnes.\n" +-" --color[=QUAN] Controla quan s’usen colors per a distingir tipus " +-"de\n" ++" --color[=QUAN] Controla quan s’empren colors per a distingir tipus de\n" + " fitxers. QUAN pot ser «never», «always» o «auto».\n" + " -d, --directory Llista les entrades dels directoris en lloc de llurs\n" + " continguts, i no segueix els enllaços simbòlics.\n" +-" -D, --dired Genera eixida preparada pel mode «dired» d’Emacs.\n" ++" -D, --dired Genera eixida preparada per al mode «dired» d’Emacs.\n" + + #: src/ls.c:4131 + msgid "" +@@ -4749,10 +4552,9 @@ + " --full-time like -l --time-style=full-iso\n" + msgstr "" + " -f No ordena, activa «-aU» i desactiva «-lst».\n" +-" -F, --classify Afig un caràcter identificador del tipus d’entrada " +-"(un\n" +-" de «*/=@|»).\n" +-" --file-type Similar a l’anterior, però no afig «*».\n" ++" -F, --classify Afegeix un caràcter identificador del tipus d’entrada\n" ++" (un de «*/=@|»).\n" ++" --file-type Similar a l’anterior, però no afegeix «*».\n" + " --format=PARAULA Cada PARAULA equival a l’(opció): across (-x),\n" + " commas (-m), horizontal (-x), long (-l),\n" + " single-column (-1), verbose (-l), vertical (-C).\n" +@@ -4768,40 +4570,35 @@ + " (e.g., 1K 234M 2G)\n" + " --si likewise, but use powers of 1000 not 1024\n" + " -H, --dereference-command-line\n" +-" follow symbolic links listed on the command " +-"line\n" ++" follow symbolic links listed on the command line\n" + " --dereference-command-line-symlink-to-dir\n" + " follow each command line symbolic link\n" + " that points to a directory\n" +-" --hide=PATTERN do not list implied entries matching shell " +-"PATTERN\n" ++" --hide=PATTERN do not list implied entries matching shell PATTERN\n" + " (overridden by -a or -A)\n" + msgstr "" + " -g Com «-l», però no mostra el propietari.\n" + " -G, --no-group Com «-l», però no mostra el grup.\n" + " -h, --human-readable Amb «-l», mostra les mides en un format llegible\n" +-" pels humans (per exemple: 1K 234M 2G).\n" +-" --si El mateix, però usa potències de 1000, no de 1024.\n" ++" per als humans (per exemple: 1K 234M 2G).\n" ++" --si El mateix, però empra potències de 1000, no de 1024.\n" + " -H, --dereference-command-line\n" +-" Segueix els enllaços simbòlics que es troben en la\n" +-" línia d’ordres.\n" ++" Segueix els enllaços simbòlics que es troben a la línia\n" ++" d’ordres.\n" + " --dereference-command-line-symlink-to-dir\n" +-" Segueix els enllaços simbòlics que es troben en la\n" +-" línia d’ordres i apunten cap a un directori.\n" +-" --hide=PATRÓ No mostra les entrades implícites que coincideixen " +-"amb\n" ++" Segueix els enllaços simbòlics que es troben a la línia\n" ++" d’ordres i apunten cap a un directori.\n" ++" --hide=PATRÓ No mostra les entrades implícites que coincideixen amb\n" + " el PATRÓ d’intèrpret indicat (inhabilitada per les\n" + " opcions «-a» i «A»).\n" + + #: src/ls.c:4153 + msgid "" +-" --indicator-style=WORD append indicator with style WORD to entry " +-"names:\n" ++" --indicator-style=WORD append indicator with style WORD to entry names:\n" + " none (default), slash (-p),\n" + " file-type (--file-type), classify (-F)\n" + " -i, --inode with -l, print the index number of each file\n" +-" -I, --ignore=PATTERN do not list implied entries matching shell " +-"PATTERN\n" ++" -I, --ignore=PATTERN do not list implied entries matching shell PATTERN\n" + " -k like --block-size=1K\n" + msgstr "" + " --indicator-style=PARAULA\n" +@@ -4810,8 +4607,7 @@ + " file-type (--file-type), classify (-F).\n" + " -i, --inode Amb «-l», mostra el número de node índex de cada\n" + " fitxer.\n" +-" -I, --ignore=PATRÓ No llista les entrades implícites que coincideixen " +-"amb\n" ++" -I, --ignore=PATRÓ No llista les entrades implícites que coincideixen amb\n" + " el PATRÓ d’intèrpret indicat.\n" + " -k Equival a «--block-size=1K».\n" + +@@ -4821,61 +4617,50 @@ + " -L, --dereference when showing file information for a symbolic\n" + " link, show information for the file the link\n" + " references rather than for the link itself\n" +-" -m fill width with a comma separated list of " +-"entries\n" ++" -m fill width with a comma separated list of entries\n" + msgstr "" +-" -l Usa un format de llistat llarg.\n" ++" -l Empra un format de llistat llarg.\n" + " -L, --dereference En mostrar la informació de fitxer d’un enllaç\n" + " simbòlic, mostra la informació del fitxer referit en\n" + " lloc de la del propi fitxer.\n" +-" -m Plena a l’ample amb una llista d’entrades separades " +-"per\n" ++" -m Plena a l’ample amb una llista d’entrades separades per\n" + " comes.\n" + + #: src/ls.c:4168 + msgid "" + " -n, --numeric-uid-gid like -l, but list numeric user and group IDs\n" +-" -N, --literal print raw entry names (don't treat e.g. " +-"control\n" ++" -N, --literal print raw entry names (don't treat e.g. control\n" + " characters specially)\n" + " -o like -l, but do not list group information\n" + " -p, --indicator-style=slash\n" + " append / indicator to directories\n" + msgstr "" +-" -n, --numeric-uid-gid Com «-l», però llista els UID i GID " +-"numèricament.\n" +-" -N, --literal Mostra els noms de les entrades en brut (per " +-"exemple,\n" +-" sense tractar especialment els caràcters de " +-"control).\n" ++" -n, --numeric-uid-gid Com «-l», però llista els UID i GID numèricament.\n" ++" -N, --literal Mostra els noms de les entrades en brut (per exemple,\n" ++" sense tractar especialment els caràcters de control).\n" + " -o Com «-l», però no mostra la informació de grup.\n" + " -p, --indicator-style=slash\n" +-" Afig l’indicador «/» als directoris.\n" ++" Afegeix l’indicador «/» als directoris.\n" + + #: src/ls.c:4176 + msgid "" + " -q, --hide-control-chars print ? instead of non graphic characters\n" + " --show-control-chars show non graphic characters as-is (default\n" +-" unless program is `ls' and output is a " +-"terminal)\n" ++" unless program is `ls' and output is a terminal)\n" + " -Q, --quote-name enclose entry names in double quotes\n" + " --quoting-style=WORD use quoting style WORD for entry names:\n" +-" literal, locale, shell, shell-always, c, " +-"escape\n" ++" literal, locale, shell, shell-always, c, escape\n" + msgstr "" + " -q, --hide-control-chars\n" + " Mostra «?» en lloc dels caràcters no gràfics.\n" + " --show-control-chars\n" +-" Mostra els caràcters no gràfics tal qual (per " +-"defecte,\n" +-" a no ser que el programa siga «ls» i l’eixida siga " +-"un\n" ++" Mostra els caràcters no gràfics tal qual (per defecte,\n" ++" a no ser que el programa siga «ls» i l’eixida siga un\n" + " terminal).\n" + " -Q, --quote-name Tanca els noms de les entrades entre cometes dobles.\n" + " --quote-style=ESTIL\n" +-" Usa l’ESTIL indicat per a citar les paraules: " +-"literal,\n" +-" locale, shell, shell-always, c, escape.\n" ++" Empra l’ESTIL indicat per a citar les paraules:\n" ++" literal, locale, shell, shell-always, c, escape.\n" + + #: src/ls.c:4184 + msgid "" +@@ -4894,8 +4679,7 @@ + " --sort=WORD extension -X, none -U, size -S, time -t,\n" + " version -v, status -c, time -t, atime -u,\n" + " access -u, use -u\n" +-" --time=WORD with -l, show time as WORD instead of " +-"modification\n" ++" --time=WORD with -l, show time as WORD instead of modification\n" + " time: atime, access, use, ctime or status; use\n" + " specified time as sort key if --sort=time\n" + msgstr "" +@@ -4912,8 +4696,7 @@ + msgid "" + " --time-style=STYLE with -l, show times using style STYLE:\n" + " full-iso, long-iso, iso, locale, +FORMAT.\n" +-" FORMAT is interpreted like `date'; if FORMAT " +-"is\n" ++" FORMAT is interpreted like `date'; if FORMAT is\n" + " FORMAT1FORMAT2, FORMAT1 applies to\n" + " non-recent files and FORMAT2 to recent files;\n" + " if STYLE is prefixed with `posix-', STYLE\n" +@@ -4922,15 +4705,13 @@ + " -T, --tabsize=COLS assume tab stops at each COLS instead of 8\n" + msgstr "" + " --time-style=ESTIL\n" +-" Amb «-l», mostra les dates usant l’ESTIL indicat:\n" ++" Amb «-l», mostra les dates emprant l’ESTIL indicat:\n" + " full-iso, long-iso, iso, locale, +FORMAT; FORMAT\n" + " s’interpreta com en «date»; si FORMAT és\n" + " «FORMAT1FORMAT2», FORMAT1 s’aplica als\n" +-" fitxers no recents i FORMAT2 als recents; si es " +-"prefixa\n" +-" l’ESTIL amb «posix-», només s’usa l’ESTIL si el " +-"locale\n" +-" POSIX no es troba actiu.\n" ++" fitxers no recents i FORMAT2 als recents; si es prefixa\n" ++" l’ESTIL amb «posix-», només s’empra l’ESTIL si el\n" ++" locale POSIX no es troba actiu.\n" + " -t Ordena per la data de modificació.\n" + " -T, --tabsize=COLUMNES\n" + " Indica les COLUMNES entre tabulacions, en lloc de 8.\n" +@@ -4947,7 +4728,7 @@ + " Amb «-l», mostra la data d’accés i ordena pel nom.\n" + " Altrament, ordena per la data d’accés.\n" + " -U No ordena, mostra les entrades en l’ordre en què es\n" +-" troben en el directori.\n" ++" troben al directori.\n" + " -v Ordena per la versió.\n" + + #: src/ls.c:4216 +@@ -4957,8 +4738,7 @@ + " -X sort alphabetically by entry extension\n" + " -1 list one file per line\n" + msgstr "" +-" -w, --width=COLS Assumeix un altre ample de pantalla en lloc del " +-"valor\n" ++" -w, --width=COLS Assumeix un altre ample de pantalla en lloc del valor\n" + " actual.\n" + " -x Llista les entrades en línies en lloc d’en columnes.\n" + " -X Ordena alfabèticament segons l’extensió de cada\n" +@@ -4976,16 +4756,12 @@ + "colors, and can be set easily by the dircolors command.\n" + msgstr "" + "\n" +-"Per defecte no s’usen colors per a distingir tipus de fitxers. Açò equival " +-"a\n" +-"usar «--color=none» (cap). Usar l’opció «--color» sense l’argument " +-"opcional\n" +-"QUAN equival a usar «--color=always» (sempre). Amb «--color=auto», només " +-"es\n" +-"generen codis de color si l’eixida està connectada amb un terminal (tty). " +-"Es\n" +-"poden alterar els colors usant la variable d’entorn LS_COLORS, que pot ser\n" +-"establerta de forma senzilla usant l’ordre «dircolors».\n" ++"Per defecte no s’empren colors per a distingir tipus de fitxers. Açò equival\n" ++"a emprar «--color=none» (cap). Emprar l’opció «--color» sense l’argument\n" ++"opcional QUAN equival a emprar «--color=always» (sempre). Amb «--color=auto»,\n" ++"només es generen codis de color si l’eixida està connectada amb un terminal\n" ++"(tty). Es poden alterar els colors emprant la variable d’entorn LS_COLORS,\n" ++"que pot ser establerta de forma senzilla emprant l’ordre «dircolors».\n" + + #: src/ls.c:4237 + msgid "" +@@ -5010,34 +4786,29 @@ + "\n" + + #: src/md5sum.c:118 +-msgid "" +-" -b, --binary read in binary mode (default unless reading tty " +-"stdin)\n" ++msgid " -b, --binary read in binary mode (default unless reading tty stdin)\n" + msgstr "" +-" -b, --binary Llig en mode binari (per defecte, excepte quan es " +-"llig\n" +-" l’entrada estàndard d’un terminal).\n" ++" -b, --binary Llegeix en mode binari (per defecte, excepte quan es\n" ++" llegeix l’entrada estàndard d’un terminal).\n" + + #: src/md5sum.c:122 + msgid " -b, --binary read in binary mode\n" +-msgstr " -b, --binary Llig en mode binari.\n" ++msgstr " -b, --binary Llegeix en mode binari.\n" + + #: src/md5sum.c:125 + #, c-format + msgid " -c, --check read %s sums from the FILEs and check them\n" +-msgstr " -c, --check Llig i comprova la suma %s de cada FITXER.\n" ++msgstr " -c, --check Llegeix i comprova la suma %s de cada FITXER.\n" + + #: src/md5sum.c:129 +-msgid "" +-" -t, --text read in text mode (default if reading tty stdin)\n" ++msgid " -t, --text read in text mode (default if reading tty stdin)\n" + msgstr "" +-" -t, --text Llig en mode text (per defecte quan es llig " +-"l’entrada\n" +-" estàndard d’un terminal).\n" ++" -t, --text Llegeix en mode text (per defecte quan es llegeix\n" ++" l’entrada estàndard d’un terminal).\n" + + #: src/md5sum.c:133 + msgid " -t, --text read in text mode (default)\n" +-msgstr " -t, --text Llig en mode text (per defecte).\n" ++msgstr " -t, --text Llegeix en mode text (per defecte).\n" + + #: src/md5sum.c:136 + msgid "" +@@ -5050,8 +4821,7 @@ + "\n" + "Les dues opcions següents només són útils per a la comprovació de sumes:\n" + " --status No escriu res, el codi d’estat indica el resultat.\n" +-" -w, --warn Avisa de les línies de suma amb un format " +-"incorrecte.\n" ++" -w, --warn Avisa de les línies de suma amb un format incorrecte.\n" + "\n" + + #: src/md5sum.c:145 +@@ -5064,10 +4834,9 @@ + "text), and name for each FILE.\n" + msgstr "" + "\n" +-"El càlcul de les sumes es realitza com es descriu en el document %s.\n" +-"En les comprovacions, l’entrada hauria de ser una sortida anterior d’aquest\n" +-"mateix programa. Per defecte escriu una línia amb la suma de verificació, " +-"un\n" ++"El càlcul de les sumes es realitza com es descriu al document %s.\n" ++"A les comprovacions, l’entrada hauria de ser una sortida anterior d’aquest\n" ++"mateix programa. Per defecte escriu una línia amb la suma de verificació, un\n" + "caràcter indicant el tipus («*» per a binari, « » per a text), i el nom de\n" + "cada FITXER.\n" + +@@ -5110,30 +4879,26 @@ + msgid "WARNING: % of % listed file could not be read" + msgid_plural "WARNING: % of % listed files could not be read" + msgstr[0] "avís: % de % fitxer llistat no s’ha pogut llegir" +-msgstr[1] "" +-"avís: % de % fitxers llistats no s’han pogut llegir" ++msgstr[1] "avís: % de % fitxers llistats no s’han pogut llegir" + + #: src/md5sum.c:532 + #, c-format + msgid "WARNING: % of % computed checksum did NOT match" +-msgid_plural "" +-"WARNING: % of % computed checksums did NOT match" ++msgid_plural "WARNING: % of % computed checksums did NOT match" + msgstr[0] "avís: % de % suma calculada NO coincideix" + msgstr[1] "avís: % de % sumes calculades NO coincideixen" + + #: src/md5sum.c:596 +-msgid "" +-"the --binary and --text options are meaningless when verifying checksums" +-msgstr "" +-"les opcions «--binary» i «--text» no tenen sentit en la comprovació de sumes" ++msgid "the --binary and --text options are meaningless when verifying checksums" ++msgstr "les opcions «--binary» i «--text» no tenen sentit a la comprovació de sumes" + + #: src/md5sum.c:604 + msgid "the --status option is meaningful only when verifying checksums" +-msgstr "l’opció «--status» només té sentit en la comprovació sumes" ++msgstr "l’opció «--status» només té sentit a la comprovació sumes" + + #: src/md5sum.c:611 + msgid "the --warn option is meaningful only when verifying checksums" +-msgstr "l’opció «--warn» només té sentit en la comprovació de sumes" ++msgstr "l’opció «--warn» només té sentit a la comprovació de sumes" + + #: src/mkdir.c:58 + #, c-format +@@ -5150,8 +4915,7 @@ + + #: src/mkdir.c:66 + msgid "" +-" -m, --mode=MODE set permission mode (as in chmod), not rwxrwxrwx - " +-"umask\n" ++" -m, --mode=MODE set permission mode (as in chmod), not rwxrwxrwx - umask\n" + " -p, --parents no error if existing, make parent directories as needed\n" + " -v, --verbose print a message for each created directory\n" + msgstr "" +@@ -5187,8 +4951,7 @@ + "\n" + + #: src/mkfifo.c:63 src/mknod.c:64 +-msgid "" +-" -m, --mode=MODE set permission mode (as in chmod), not a=rw - umask\n" ++msgid " -m, --mode=MODE set permission mode (as in chmod), not a=rw - umask\n" + msgstr "" + " -m, --mode=MODE Estableix els permisos (com fa «chmod», no com\n" + " «a=rw» - umask).\n" +@@ -5229,12 +4992,9 @@ + "otherwise, as decimal. TYPE may be:\n" + msgstr "" + "\n" +-"Cal especificar MAJOR i MENOR quan el TIPUS siga «b», «c» o «u»; cal " +-"ometre’ls\n" +-"quan aquest siga «p». Si MAJOR o MENOR comença per «0x» o «0X», " +-"s’interpreta\n" +-"com a hexadecimal; si comença per «0», com a octal; altrament s’interpreta " +-"com\n" ++"Cal especificar MAJOR i MENOR quan el TIPUS siga «b», «c» o «u»; cal ometre’ls\n" ++"quan aquest siga «p». Si MAJOR o MENOR comença per «0x» o «0X», s’interpreta\n" ++"com a hexadecimal; si comença per «0», com a octal; altrament s’interpreta com\n" + "a decimal. El TIPUS pot ser:\n" + + #: src/mknod.c:76 +@@ -5307,10 +5067,8 @@ + + #: src/mv.c:311 + msgid "" +-" --backup[=CONTROL] make a backup of each existing destination " +-"file\n" +-" -b like --backup but does not accept an " +-"argument\n" ++" --backup[=CONTROL] make a backup of each existing destination file\n" ++" -b like --backup but does not accept an argument\n" + " -f, --force do not prompt before overwriting\n" + " -i, --interactive prompt before overwrite\n" + msgstr "" +@@ -5335,8 +5093,7 @@ + + #: src/mv.c:322 + msgid "" +-" -t, --target-directory=DIRECTORY move all SOURCE arguments into " +-"DIRECTORY\n" ++" -t, --target-directory=DIRECTORY move all SOURCE arguments into DIRECTORY\n" + " -T, --no-target-directory treat DEST as a normal file\n" + " -u, --update move only when the SOURCE file is newer\n" + " than the destination file or when the\n" +@@ -5366,13 +5123,12 @@ + " -n, --adjustment=N add integer N to the niceness (default 10)\n" + msgstr "" + "Executa l’ORDRE amb un valor de prioritat ajustat, cosa que afecta la\n" +-"planificació del procés. Sense l’ORDRE, mostra el valor actual de " +-"prioritat.\n" ++"planificació del procés. Sense l’ORDRE, mostra el valor actual de prioritat.\n" + "Els valors de prioritat van des de %d (planificació més favorable) a %d\n" + "(planificació menys favorable).\n" + "\n" +-" -n, --adjustment=N Afig l’enter N al valor de prioritat (10 per " +-"defecte).\n" ++" -n, --adjustment=N Afegeix l’enter N al valor de prioritat (10 per\n" ++" defecte).\n" + + # Usa quote(). ivb + #: src/nice.c:158 +@@ -5398,8 +5154,8 @@ + "With no FILE, or when FILE is -, read standard input.\n" + "\n" + msgstr "" +-"Escriu cada FITXER en la sortida estàndard, amb les línies numerades.\n" +-"Sense FITXER, o quan fitxer és «-», llegeix l’entrada estàndard.\n" ++"Escriu cada FITXER a la sortida estàndard, amb les línies numerades. Sense\n" ++"FITXER, o quan fitxer és «-», llegeix l’entrada estàndard.\n" + "\n" + + #: src/nl.c:184 +@@ -5411,7 +5167,7 @@ + " -b, --body-numbering=ESTIL\n" + " Enumera les línies del cos segons l’ESTIL.\n" + " -d, --section-delimiter=CC\n" +-" Usa CC per a separar les pàgines lògiques.\n" ++" Empra CC per a separar les pàgines lògiques.\n" + " -f, --footer-numbering=ESTIL\n" + " Enumera les línies del peu segons ESTIL.\n" + +@@ -5419,19 +5175,16 @@ + msgid "" + " -h, --header-numbering=STYLE use STYLE for numbering header lines\n" + " -i, --page-increment=NUMBER line number increment at each line\n" +-" -l, --join-blank-lines=NUMBER group of NUMBER empty lines counted as " +-"one\n" ++" -l, --join-blank-lines=NUMBER group of NUMBER empty lines counted as one\n" + " -n, --number-format=FORMAT insert line numbers according to FORMAT\n" +-" -p, --no-renumber do not reset line numbers at logical " +-"pages\n" ++" -p, --no-renumber do not reset line numbers at logical pages\n" + " -s, --number-separator=STRING add STRING after (possible) line number\n" + msgstr "" + " -h, --header-numbering=ESTIL\n" + " Enumera les línies de la capçalera segons l’ESTIL.\n" + " -i, --page-increment=NÚMERO\n" +-" Increment que es produeix per cada línia en el " +-"compte\n" +-" de línies.\n" ++" Increment que es produeix per cada línia al compte de\n" ++" línies.\n" + " -l, --join-blank-lines=NÚMERO\n" + " Compta NÚMERO línies en blanc com a una.\n" + " -n, --number-format=FORMAT\n" +@@ -5449,7 +5202,7 @@ + " -v, --first-page=NÚMERO\n" + " Primer NÚMERO de línia de cada pàgina lògica.\n" + " -w, --number-width=NÚMERO\n" +-" Usa NÚMERO columnes per cada número de línia.\n" ++" Empra NÚMERO columnes per cada número de línia.\n" + + #: src/nl.c:203 + msgid "" +@@ -5459,12 +5212,9 @@ + "second character implies :. Type \\\\ for \\. STYLE is one of:\n" + msgstr "" + "\n" +-"Les opcions per defecte són «-v1 -i1 -l1 -sTAB -w6 -nrn -hn -bt -fn». CC " +-"són\n" +-"dos caràcters delimitadors per a separar les pàgines lògiques, on " +-"l’absència\n" +-"del segon caràcter implica «:». Escriviu «\\\\» per a «\\». ESTIL pot " +-"ser:\n" ++"Les opcions per defecte són «-v1 -i1 -l1 -sTAB -w6 -nrn -hn -bt -fn». CC són\n" ++"dos caràcters delimitadors per a separar les pàgines lògiques, on l’absència\n" ++"del segon caràcter implica «:». Escriviu «\\\\» per a «\\». ESTIL pot ser:\n" + + #: src/nl.c:209 + msgid "" +@@ -5580,9 +5330,7 @@ + + #: src/nohup.c:155 + msgid "failed to set the copy of stderr to close on exec" +-msgstr "" +-"no s’ha pogut preparar la còpia de l’eixida estàndard d’errors per a que es " +-"tanque en fer exec()" ++msgstr "no s’ha pogut preparar la còpia de l’eixida estàndard d’errors per a que es tanque en fer exec()" + + #: src/nohup.c:161 + msgid "failed to redirect standard error" +@@ -5593,8 +5341,7 @@ + msgid "" + "Usage: %s [OPTION]... [FILE]...\n" + " or: %s [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]]\n" +-" or: %s --traditional [OPTION]... [FILE] [[+]OFFSET[.][b] [+][LABEL][.]" +-"[b]]\n" ++" or: %s --traditional [OPTION]... [FILE] [[+]OFFSET[.][b] [+][LABEL][.][b]]\n" + msgstr "" + "Forma d’ús: %s [OPCIÓ]… [FITXER]…\n" + " o bé: %s [-abcdfilosx]… [FITXER] [[+]DESPLAÇAMENT[.][b]]\n" +@@ -5610,9 +5357,8 @@ + "\n" + msgstr "" + "\n" +-"Escriu una representació inequívoca, d’octets en octal per defecte, del " +-"FITXER\n" +-"en la sortida estàndard. Amb diversos arguments FITXER, els concatena en\n" ++"Escriu una representació inequívoca, d’octets en octal per defecte, del FITXER\n" ++"a la sortida estàndard. Amb diversos arguments FITXER, els concatena en\n" + "l’ordre especificat per a formar l’entrada. Sense FITXER, o quan FITXER és\n" + "«-», llegeix l’entrada estàndard.\n" + "\n" +@@ -5629,17 +5375,14 @@ + " -j, --skip-bytes=BYTES skip BYTES input bytes first\n" + msgstr "" + " -A, --address-radix=BASE\n" +-" Indica la BASE amb què es mostraran els " +-"desplaçaments.\n" ++" Indica la BASE amb què es mostraran els desplaçaments.\n" + " -j, --skip-bytes=OCTETS\n" +-" Salta aquest nombre d’OCTETS al principi de " +-"l’entrada.\n" ++" Salta aquest nombre d’OCTETS al principi de l’entrada.\n" + + #: src/od.c:327 + msgid "" + " -N, --read-bytes=BYTES limit dump to BYTES input bytes\n" +-" -S, --strings[=BYTES] output strings of at least BYTES graphic " +-"chars\n" ++" -S, --strings[=BYTES] output strings of at least BYTES graphic chars\n" + " -t, --format=TYPE select output format or formats\n" + " -v, --output-duplicates do not use * to mark line suppression\n" + " -w, --width[=BYTES] output BYTES bytes per output line\n" +@@ -5652,7 +5395,7 @@ + " Escriu cadenes d’almenys OCTETS caràcters gràfics.\n" + " -t, --format=TIPUS Especifica el format (o formats) de sortida.\n" + " -v, --output-duplicates\n" +-" No usa «*» per a marcar la supressió de línies.\n" ++" No empra «*» per a marcar la supressió de línies.\n" + " -w, --width[=OCTETS] Escriu aquest nombre d’OCTETS per línia.\n" + " --traditional Accepta arguments en la forma tradicional.\n" + +@@ -5668,13 +5411,11 @@ + " -d same as -t u2, select unsigned decimal 2-byte units\n" + msgstr "" + "\n" +-"Les especificacions en format tradicional poden estar mesclades, acumulant‐" +-"se;\n" ++"Les especificacions en format tradicional poden estar mesclades, acumulant‐se;\n" + "són les següents:\n" + " -a Equival a «-t a», nom dels caràcters.\n" + " -b Equival a «-t oC», octets en octal.\n" +-" -c Equival a «-t c», caràcters ASCII o seqüències d’escapada amb " +-"barra\n" ++" -c Equival a «-t c», caràcters ASCII o seqüències d’escapada amb barra\n" + " invertida.\n" + " -d Equival a «-t u2», enters de 2 octets sense signe en decimal.\n" + +@@ -5714,11 +5455,9 @@ + msgstr "" + "\n" + "Si tant la primera com la segona formes d’ús són aplicables, s’assumeix la\n" +-"segona forma si l’últim operand comença per «+» o (si hi ha dos operands) " +-"per\n" +-"un dígit. Un operand DESPLAÇAMENT significa «-j DESPLAÇAMENT». ETIQUETA " +-"és\n" +-"la pseudoadreça del primer octet escrit, que s’incrementa a mesura que va\n" ++"segona forma si el darrer operand comença per «+» o (si hi ha dos operands)\n" ++"per un dígit. Un operand DESPLAÇAMENT significa «-j DESPLAÇAMENT». ETIQUETA\n" ++"és la pseudoadreça del primer octet escrit, que s’incrementa a mesura que va\n" + "progressant la transcripció. En DESPLAÇAMENT i ETIQUETA, un prefix «0x» o\n" + "«0X» indica hexadecimal. Els sufixs poden ser «.» per a octal i «b» com a\n" + "multiplicació per 512.\n" +@@ -5753,9 +5492,8 @@ + "for sizeof(double) or L for sizeof(long double).\n" + msgstr "" + "\n" +-"MIDA és un número. En els TIPUS «doux», MIDA també pot ser «C» per a\n" +-"«sizeof(char)», «S» per a «sizeof(short)», «I» per a «sizeof(int)» o «L» per " +-"a\n" ++"MIDA és un número. Als TIPUS «doux», MIDA també pot ser «C» per a\n" ++"«sizeof(char)», «S» per a «sizeof(short)», «I» per a «sizeof(int)» o «L» per a\n" + "«sizeof(long)». Si el TIPUS és «f», la MIDA pot ser també «F» per a\n" + "«sizeof(float)», «D» per a «sizeof(double)» o bé «L» per a\n" + "«sizeof(long double)».\n" +@@ -5772,10 +5510,8 @@ + msgstr "" + "\n" + "BASE és «d» per a decimal, «o» per a octal, «x» per a hexadecimal, o bé «n»\n" +-"per a cap. OCTETS és hexadecimal si té el prefix «0x» o «0X», i es " +-"multiplica\n" +-"per 512 amb el sufix «b», per 1024 amb «k» i per 1048576 amb «m». Afegint " +-"el\n" ++"per a cap. OCTETS és hexadecimal si té el prefix «0x» o «0X», i es multiplica\n" ++"per 512 amb el sufix «b», per 1024 amb «k» i per 1048576 amb «m». Afegint el\n" + "sufix «z» a qualsevol dels tipus, mostra també els caràcters imprimibles al\n" + "final de cada línia d’eixida. " + +@@ -5802,9 +5538,7 @@ + msgid "" + "invalid type string %s;\n" + "this system doesn't provide a %lu-byte integral type" +-msgstr "" +-"la cadena de tipus no és vàlida: %s; aquest sistema no proporciona un tipus " +-"enter de %lu octets" ++msgstr "la cadena de tipus no és vàlida: %s; aquest sistema no proporciona un tipus enter de %lu octets" + + # Usa quote(). ivb + #: src/od.c:810 +@@ -5812,9 +5546,7 @@ + msgid "" + "invalid type string %s;\n" + "this system doesn't provide a %lu-byte floating point type" +-msgstr "" +-"la cadena de tipus no és vàlida: %s; aquest sistema no proporciona un tipus " +-"de coma flotant de %lu octets" ++msgstr "la cadena de tipus no és vàlida: %s; aquest sistema no proporciona un tipus de coma flotant de %lu octets" + + # Usa quote() en la segona. ivb + #: src/od.c:869 +@@ -5829,8 +5561,7 @@ + #: src/od.c:1642 + #, c-format + msgid "invalid output address radix `%c'; it must be one character from [doxn]" +-msgstr "" +-"la base «%c» del desplaçament no és vàlida; ha de ser un caràcter de [doxn]" ++msgstr "la base «%c» del desplaçament no és vàlida; ha de ser un caràcter de [doxn]" + + # FIXME: xmalloc.h: _STRTOL_ERROR lacks i18n. ivb + # Açò quedarà com «invalid argument de salt `ARG'» mentre no ho facen. ivb +@@ -5873,7 +5604,7 @@ + #: src/od.c:1906 + #, c-format + msgid "warning: invalid width %lu; using %d instead" +-msgstr "atenció: l’amplada %lu no és vàlida; s’usarà %d" ++msgstr "atenció: l’amplada %lu no és vàlida; s’emprarà %d" + + # És una cadena de depuració. ivb + #: src/od.c:1922 +@@ -5892,10 +5623,8 @@ + "With no FILE, or when FILE is -, read standard input.\n" + "\n" + msgstr "" +-"Escriu línies consistents en les línies corresponents seqüencialment de " +-"cada\n" +-"FITXER, separades per caràcters de tabulació, en la sortida estàndard. " +-"Sense\n" ++"Escriu línies consistents en les línies corresponents seqüencialment de cada\n" ++"FITXER, separades per caràcters de tabulació, a la sortida estàndard. Sense\n" + "FITXER, o quan FITXER és «-», llegeix l’entrada estàndard.\n" + "\n" + +@@ -5905,8 +5634,8 @@ + " -s, --serial paste one file at a time instead of in parallel\n" + msgstr "" + " -d, --delimiters=LLISTA\n" +-" Usa els caràcters de la LLISTA, en lloc de " +-"tabulacions.\n" ++" Empra els caràcters de la LLISTA, en lloc de\n" ++" tabulacions.\n" + " -s, --serial Processa cada fitxer de cop, i no en paraŀlel.\n" + + #: src/pathchk.c:99 +@@ -5922,12 +5651,11 @@ + " -P check for empty names and leading \"-\"\n" + " --portability check for all POSIX systems (equivalent to -p -P)\n" + msgstr "" +-"Comprova si hi ha construccions no portables en el NOM.\n" ++"Comprova si hi ha construccions no portables al NOM.\n" + "\n" + " -p Prova amb la majoria de sistemes POSIX.\n" + " -P Comprova els noms buits o que comencen per «-».\n" +-" --portability Prova amb tots els sistemes POSIX (equival a «-p -" +-"P»).\n" ++" --portability Prova amb tots els sistemes POSIX (equival a «-p -P»).\n" + + # Usa quote(). ivb + #: src/pathchk.c:180 +@@ -5960,9 +5688,7 @@ + #: src/pathchk.c:421 + #, c-format + msgid "limit %lu exceeded by length %lu of file name component %s" +-msgstr "" +-"s’ha excedit el límit %lu per la longitud %lu del component de nom de fitxer " +-"%s" ++msgstr "s’ha excedit el límit %lu per la longitud %lu del component de nom de fitxer %s" + + # FIXME: This way of arranging output is language dependent. ivb + #: src/pinky.c:331 +@@ -6044,14 +5770,10 @@ + msgstr "" + "\n" + " -l Genera una eixida amb format llarg per cada USUARI.\n" +-" -b Omet el directori personal i intèrpret de la usuària " +-"o\n" +-" usuari en el format llarg.\n" +-" -h Omet el fitxer de projecte de la usuària o usuari en " +-"el\n" +-" format llarg.\n" +-" -p Omet el fitxer de pla de la usuària o usuari en el\n" ++" -b Omet el directori personal i intèrpret de l’usuari al\n" + " format llarg.\n" ++" -h Omet el fitxer de projecte de l’usuari al format llarg.\n" ++" -p Omet el fitxer de pla de l’usuari al format llarg.\n" + " -s Genera una eixida amb format curt (per defecte).\n" + + #: src/pinky.c:523 +@@ -6062,16 +5784,12 @@ + " -q omit the user's full name, remote host and idle time\n" + " in short format\n" + msgstr "" +-" -f Omet la línia de capçaleres de columna en el format\n" +-" curt.\n" +-" -w Omet el nom complet de la usuària o usuari en el " +-"format\n" +-" curt.\n" +-" -i Omet el nom complet i l’estació remota de la usuària " +-"o\n" +-" usuari en el format curt.\n" ++" -f Omet la línia de capçaleres de columna al format curt.\n" ++" -w Omet el nom complet de l’usuari al format curt.\n" ++" -i Omet el nom complet i l’estació remota de l’usuari al\n" ++" format curt.\n" + " -q Omet el nom complet, l’estació remota i el temps\n" +-" d’inactivitat (ociós) en el format curt.\n" ++" d’inactivitat (ociós) al format curt.\n" + + # No usa quote(). ivb + #: src/pinky.c:532 +@@ -6082,13 +5800,12 @@ + "The utmp file will be %s.\n" + msgstr "" + "\n" +-"Un programa de «finger» lleuger; mostra informació sobre les usuàries i\n" +-"usuaris. El fitxer «utmp» serà «%s».\n" ++"Un programa de «finger» lleuger; mostra informació sobre els usuaris. El\n" ++"fitxer «utmp» serà «%s».\n" + + #: src/pinky.c:616 + msgid "no username specified; at least one must be specified when using -l" +-msgstr "" +-"no s’ha indicat cap nom d’usuari; n’heu d’indicar almenys un si useu «-l»" ++msgstr "no s’ha indicat cap nom d’usuari; n’heu d’indicar almenys un si useu «-l»" + + # És un missatge d'error! Qui ho diria... ivb + # FIXME: ``pr`` messages are quite unconforming to other ones. ivb +@@ -6138,8 +5855,7 @@ + + #: src/pr.c:1102 + msgid "Cannot specify number of columns when printing in parallel." +-msgstr "" +-"no es pot especificar el nombre de columnes quan s’imprimeix en paraŀlel" ++msgstr "no es pot especificar el nombre de columnes quan s’imprimeix en paraŀlel" + + #: src/pr.c:1106 + msgid "Cannot specify both printing across and printing in parallel." +@@ -6158,9 +5874,7 @@ + #: src/pr.c:2377 + #, c-format + msgid "starting page number % exceeds page count %" +-msgstr "" +-"el número de pàgina inicial % excedeix el comptador de pàgines %" +-"" ++msgstr "el número de pàgina inicial % excedeix el comptador de pàgines %" + + #: src/pr.c:2407 + msgid "Page number overflow" +@@ -6190,11 +5904,9 @@ + " columns on each page.\n" + msgstr "" + " +PRIM_PÀG[:ÚLT_PÀG], --pages=PRIM_PÀG[:ÚLT_PÀG] \n" +-" Comença [i acaba] la paginació en PRIM_PÀG [i " +-"ÚLT_PÀG].\n" ++" Comença [i acaba] la paginació en PRIM_PÀG [i ÚLT_PÀG].\n" + " -COLUMNES, --columns=COLUMNES\n" +-" Disposa el text en les COLUMNES indicades i les " +-"escriu\n" ++" Disposa el text en les COLUMNES indicades i les escriu\n" + " en vertical, tret que especifiqueu «-a». Iguala el\n" + " nombre de línies de les columnes de cada pàgina.\n" + +@@ -6207,11 +5919,10 @@ + " -d, --double-space\n" + " double space the output\n" + msgstr "" +-" -a, --across Escriu les columnes de través en lloc de " +-"verticalment,\n" +-" usat juntament amb -COLUMNES.\n" ++" -a, --across Escriu les columnes de través en lloc de verticalment,\n" ++" emprat juntament amb -COLUMNES.\n" + " -c, --show-control-chars\n" +-" Usa la notació «^G» i la notació de seqüència\n" ++" Empra la notació «^G» i la notació de seqüència\n" + " d’escapada en octal amb barra invertida.\n" + " -d, --double-space Escriu el text amb espaiat doble.\n" + +@@ -6227,44 +5938,36 @@ + " and trailer without -F)\n" + msgstr "" + " -D, --date-format=FORMAT\n" +-" Formata la data de la capçalera usant aquest FORMAT.\n" ++" Formata la data de la capçalera emprant aquest FORMAT.\n" + " -e[CARÀCTER[NÚMERO]], --expand-tabs[=CARÀCTER[NÚMERO]]\n" +-" Converteix cada CARÀCTER de l’entrada en NÚMERO " +-"espais\n" +-" en l’eixida (per defecte CARÀCTER és la tabulació i\n" ++" Converteix cada CARÀCTER de l’entrada en NÚMERO espais\n" ++" a l’eixida (per defecte CARÀCTER és la tabulació i\n" + " NÚMERO és 8).\n" +-" -F, -f, --form-feed Usa un salt de pàgina, en lloc de caràcters de " +-"nova\n" ++" -F, -f, --form-feed Empra un salt de pàgina, en lloc de caràcters de nova\n" + " línia, per a separar cada pàgina (es separen amb una\n" +-" capçalera de 3 línies amb l’opció «-F»; amb 5 línies " +-"de\n" ++" capçalera de 3 línies amb l’opció «-F»; amb 5 línies de\n" + " capçalera i 5 de cua sense «-F»).\n" + + #: src/pr.c:2806 + msgid "" + " -h HEADER, --header=HEADER\n" +-" use a centered HEADER instead of filename in page " +-"header,\n" ++" use a centered HEADER instead of filename in page header,\n" + " -h \"\" prints a blank line, don't use -h\"\"\n" + " -i[CHAR[WIDTH]], --output-tabs[=CHAR[WIDTH]]\n" + " replace spaces with CHARs (TABs) to tab WIDTH (8)\n" +-" -J, --join-lines merge full lines, turns off -W line truncation, no " +-"column\n" ++" -J, --join-lines merge full lines, turns off -W line truncation, no column\n" + " alignment, --sep-string[=STRING] sets separators\n" + msgstr "" + " -h CAPÇALERA, --header=CAPÇALERA\n" + " Escriu una CAPÇALERA centrada de pàgina, en lloc del\n" +-" nom del fitxer; «-h \"\"» escriu una línia en blanc, " +-"no\n" ++" nom del fitxer; «-h \"\"» escriu una línia en blanc, no\n" + " useu «-h\"\"».\n" + " -i[CARÀCTER[NÚMERO], --output-tabs[=CARÀCTER[NÚMERO]]\n" + " Converteix cada grup de NÚMERO espais consecutius de\n" +-" l’entrada en un CARÀCTER en l’eixida (per defecte\n" ++" l’entrada en un CARÀCTER a l’eixida (per defecte\n" + " CARÀCTER és la tabulació i NÚMERO és 8).\n" +-" -J, --join-lines Ajunta les línies senceres, inhabilita el truncament " +-"de\n" +-" línies de l’opció «-W», no hi ha alineament de " +-"columna,\n" ++" -J, --join-lines Ajunta les línies senceres, inhabilita el truncament de\n" ++" línies de l’opció «-W», no hi ha alineament de columna,\n" + " i «--sep-string[=CADENA]» defineix els separadors.\n" + + #: src/pr.c:2815 +@@ -6276,13 +5979,11 @@ + " truncate lines, but join lines of full length with -J\n" + msgstr "" + " -l LLARG_PÀG, --length=LLARG_PÀG\n" +-" Defineix la llargada de pàgina en LLARG_PÀG (66) " +-"línies\n" ++" Defineix la llargada de pàgina en LLARG_PÀG (66) línies\n" + " (per defecte hi ha 56 línies de text, 63 amb «-F»).\n" + " -m, --merge Escriu els fitxers en paraŀlel, un en cada columna,\n" +-" amb truncament de línies, però ajuntant les que " +-"ocupen\n" +-" una línia sencera si s’usa l’opció «-J».\n" ++" amb truncament de línies, però ajuntant les que ocupen\n" ++" una línia sencera si s’empra l’opció «-J».\n" + + #: src/pr.c:2822 + msgid "" +@@ -6294,13 +5995,12 @@ + " page printed (see +FIRST_PAGE)\n" + msgstr "" + " -n[SEPARADOR[DÍGITS]], --number-lines[=SEPARADOR[DÍGITS]]\n" +-" Numera les línies usant DÍGITS dígits i un SEPARADOR " +-"a\n" +-" continuació, comptant per defecte des de la 1a línia\n" ++" Numera les línies emprant DÍGITS dígits i un SEPARADOR\n" ++" a continuació, comptant per defecte des de la 1a línia\n" + " del text (per defecte SEPARADOR és la tabulació i\n" + " DÍGITS és 5).\n" + " -N NÚMERO, --first-line-number=NÚMERO\n" +-" Comença la numeració amb NÚMERO en la 1a línia de la\n" ++" Comença la numeració amb NÚMERO a la 1a línia de la\n" + " primera pàgina escrita (vegeu «+PRIM_PÀG»).\n" + + #: src/pr.c:2830 +@@ -6322,18 +6022,15 @@ + #: src/pr.c:2837 + msgid "" + " -s[CHAR],--separator[=CHAR]\n" +-" separate columns by a single character, default for " +-"CHAR\n" ++" separate columns by a single character, default for CHAR\n" + " is the character without -w and 'no char' with -w\n" + " -s[CHAR] turns off line truncation of all 3 column\n" + " options (-COLUMN|-a -COLUMN|-m) except -w is set\n" + msgstr "" + " -s[CARÀCTER], --separator[=CARÀCTER]\n" +-" Separa les columnes amb un únic CARÀCTER; aquest és " +-"per\n" +-" defecte una tabulació si no s’usa «-w» i cap " +-"caràcter\n" +-" quan s’usa «-w». «-s[CARÀCTER]» inhabilita el\n" ++" Separa les columnes amb un únic CARÀCTER; aquest és per\n" ++" defecte una tabulació si no s’empra «-w» i cap caràcter\n" ++" quan s’empra «-w». «-s[CARÀCTER]» inhabilita el\n" + " truncament de línia de totes les opcions de columna\n" + " («-COLUMNES», «-a -COLUMNES» i «-m») tret que\n" + " especifiqueu «-w».\n" +@@ -6347,16 +6044,14 @@ + msgid "" + " separate columns by STRING,\n" + " without -S: Default separator with -J and \n" +-" otherwise (same as -S\" \"), no effect on column " +-"options\n" ++" otherwise (same as -S\" \"), no effect on column options\n" + " -t, --omit-header omit page headers and trailers\n" + msgstr "" +-" Separa les columnes amb aquesta CADENA; si no s’usa\n" +-" «-S» i sí s’usa «-J» el separador per defecte és la\n" +-" tabulació, altrament és l’espai (equival a «-S" +-"\"\"»).\n" +-" Aquesta opció no té efecte en les opcions de " +-"columna.\n" ++" Separa les columnes amb aquesta CADENA; si no s’empra\n" ++" «-S» i sí s’empra «-J» el separador per defecte és la\n" ++" tabulació, altrament és l’espai (equival a «-S\" \"»).\n" ++" Aquesta opció no té efecte sobre les opcions de\n" ++" columna.\n" + " -t, --omit-header Omet les capçaleres i cues de pàgina.\n" + + # FIXME: suggest using `just take a look at info, man!' for some option descriptions. ivb +@@ -6365,36 +6060,31 @@ + #: src/pr.c:2853 + msgid "" + " -T, --omit-pagination\n" +-" omit page headers and trailers, eliminate any " +-"pagination\n" ++" omit page headers and trailers, eliminate any pagination\n" + " by form feeds set in input files\n" + " -v, --show-nonprinting\n" + " use octal backslash notation\n" + " -w PAGE_WIDTH, --width=PAGE_WIDTH\n" + " set page width to PAGE_WIDTH (72) characters for\n" +-" multiple text-column output only, -s[char] turns off " +-"(72)\n" ++" multiple text-column output only, -s[char] turns off (72)\n" + msgstr "" + " -T, --omit-pagination Omet les capçaleres i cues de pàgina, i elimina\n" +-" tota paginació amb salts de pàgina que es trobe en " +-"els\n" ++" tota paginació amb salts de pàgina que es trobe als\n" + " fitxers de l’entrada.\n" + " -v, --show-nonprinting\n" +-" Usa la notació de seqüència d’escapada en octal amb\n" ++" Empra la notació de seqüència d’escapada en octal amb\n" + " barra invertida.\n" + " -w AMPLADA_PÀG, --width=AMPLADA_PÀG\n" + " Defineix l’amplada de pàgina a AMPLADA_PÀG caràcters\n" + " només per a la paginació per columnes (per defecte\n" +-" AMPLADA_PÀG és 72); l’opció «-s[CARÀCTER]» " +-"inhabilita\n" ++" AMPLADA_PÀG és 72); l’opció «-s[CARÀCTER]» inhabilita\n" + " l’amplada de pàgina per defecte.\n" + + #: src/pr.c:2863 + msgid "" + " -W PAGE_WIDTH, --page-width=PAGE_WIDTH\n" + " set page width to PAGE_WIDTH (72) characters always,\n" +-" truncate lines, except -J option is set, no " +-"interference\n" ++" truncate lines, except -J option is set, no interference\n" + " with -S or -s\n" + msgstr "" + " -W AMPLADA_PÀG, --page-width=AMPLADA_PÀG\n" +@@ -6411,7 +6101,7 @@ + msgstr "" + "\n" + "L’opció «-T» és implícita quan s’especifica «-l LLARG_PÀG» i LLARG_PÀG és\n" +-"menor o igual que 10, o menor o igual que 3 quan s’usa l’opció «-F». Sense\n" ++"menor o igual que 10, o menor o igual que 3 quan s’empra l’opció «-F». Sense\n" + "FITXER, o quan FITXER és «-», llegeix l’entrada estàndard.\n" + + #: src/printenv.c:61 +@@ -6429,10 +6119,8 @@ + + #: src/printf.c:87 + #, c-format +-msgid "" +-"warning: %s: character(s) following character constant have been ignored" +-msgstr "" +-"avís: %s: s’han descartat els caràcters que segueixen la constant caràcter" ++msgid "warning: %s: character(s) following character constant have been ignored" ++msgstr "avís: %s: s’han descartat els caràcters que segueixen la constant caràcter" + + #: src/printf.c:100 + #, c-format +@@ -6462,8 +6150,7 @@ + " \\\\ backslash\n" + msgstr "" + "\n" +-"FORMAT controla l’eixida com fa printf() en C. S’interpreten les " +-"seqüències:\n" ++"FORMAT controla l’eixida com fa printf() en C. S’interpreten les seqüències:\n" + "\n" + " \\\" Cometes dobles.\n" + " \\NNN Caràcter amb valor octal NNN (de 1 a 3 dígits).\n" +@@ -6503,11 +6190,9 @@ + " \\UHHHHHHHH Unicode character with hex value HHHHHHHH (8 digits)\n" + msgstr "" + " \\xHH Octet amb valor hexadecimal HH (d’1 a 2 dígits).\n" +-" \\uHHHH Caràcter Unicode (ISO/IEC 10646) amb valor hexadecimal " +-"HHHH\n" ++" \\uHHHH Caràcter Unicode (ISO/IEC 10646) amb valor hexadecimal HHHH\n" + " (4 dígits).\n" +-" \\UHHHHHHHH Caràcter Unicode amb valor hexadecimal HHHHHHHH (8 " +-"dígits).\n" ++" \\UHHHHHHHH Caràcter Unicode amb valor hexadecimal HHHHHHHH (8 dígits).\n" + + # El més llarg és «UHHHHHHHH». ivb + #: src/printf.c:136 +@@ -6525,8 +6210,8 @@ + " d’escapada octals hi tenen la forma «\\0» o «\\0NNN».\n" + "\n" + "i totes les especificacions de format C que acaben en un dels caràcters\n" +-"«diouxXfeEgGcs», on cada ARGUMENT serà convertit al tipus adequat. Es\n" +-"suporten les amplàries variables.\n" ++"«diouxXfeEgGcs», on cada ARGUMENT serà convertit al tipus adequat. S’admeten\n" ++"les amplàries variables.\n" + + #: src/printf.c:161 + #, c-format +@@ -6540,7 +6225,7 @@ + + #: src/printf.c:257 src/printf.c:284 + msgid "missing hexadecimal number in escape" +-msgstr "manca un número hexadecimal en la seqüència d’escapada" ++msgstr "manca un número hexadecimal a la seqüència d’escapada" + + #: src/printf.c:296 + #, c-format +@@ -6591,12 +6276,10 @@ + # Escriu les paraules del text seguides, començant cada colta per una. ivb + #: src/ptx.c:1891 + msgid "" +-"Output a permuted index, including context, of the words in the input " +-"files.\n" ++"Output a permuted index, including context, of the words in the input files.\n" + "\n" + msgstr "" +-"Escriu un índex permutat, incloent el context, amb les paraules dels " +-"fitxers\n" ++"Escriu un índex permutat, incloent el context, amb les paraules dels fitxers\n" + "que formen l’entrada.\n" + "\n" + +@@ -6611,8 +6294,8 @@ + " -C, --copyright Mostra el Copyright i les condicions de còpia.\n" + " -G, --traditional Es comporta com el «ptx» de System V.\n" + " -F, --flag-truncation=CADENA\n" +-" Usa la CADENA per a senyalar els truncaments de " +-"línia.\n" ++" Empra la CADENA per a senyalar els truncaments de\n" ++" línia.\n" + + #: src/ptx.c:1904 + msgid "" +@@ -6623,14 +6306,12 @@ + " -T, --format=tex generate output as TeX directives\n" + msgstr "" + " -M, --macro-name=CADENA\n" +-" Nom del macro a usar en lloc de «xx».\n" ++" Nom del macro a emprar en lloc de «xx».\n" + " -O, --format=roff Genera la sortida com a directives de «roff».\n" +-" -R, --right-side-refs Posa les referències a la dreta, i «-w» no les " +-"té\n" ++" -R, --right-side-refs Posa les referències a la dreta, i «-w» no les té\n" + " en compte.\n" + " -S, --sentence-regexp=EXPREG\n" +-" Identifica els finals de línia o de frase fent " +-"servir\n" ++" Identifica els finals de línia o de frase fent servir\n" + " l’expressió regular indicada.\n" + " -T, --format=tex Genera la sortida com a directives de TeX.\n" + +@@ -6650,26 +6331,22 @@ + " El FITXER conté els caràcters separadors de les\n" + " paraules clau.\n" + " -f, --ignore-case Passa a majúscules per a ordenar.\n" +-" -g, --gap-size=NÚMERO Mida (en columnes) de la separació entre els " +-"camps\n" ++" -g, --gap-size=NÚMERO Mida (en columnes) de la separació entre els camps\n" + " de la sortida.\n" + " -i, --ignore-file=FITXER\n" + " El FITXER conté una llista de paraules que mai seran\n" + " preses com a paraules clau.\n" + " -o, --only-file=FITXER\n" +-" El FITXER conté una llista de les úniques paraules " +-"que\n" ++" El FITXER conté una llista de les úniques paraules que\n" + " seran preses com a paraules clau.\n" + + #: src/ptx.c:1919 + msgid "" + " -r, --references first field of each line is a reference\n" + " -t, --typeset-mode - not implemented -\n" +-" -w, --width=NUMBER output width in columns, reference " +-"excluded\n" ++" -w, --width=NUMBER output width in columns, reference excluded\n" + msgstr "" +-" -r, --references Pren el primer camp de cada línia com a una " +-"referència.\n" ++" -r, --references Pren el primer camp de cada línia com a una referència.\n" + " -t, --typeset-mode (No es troba implementada.)\n" + " -w, --width=NÚMERO Amplada (en columnes) de la sortida (excloent‐ne la\n" + " referència).\n" +@@ -6680,9 +6357,8 @@ + "With no FILE or if FILE is -, read Standard Input. `-F /' by default.\n" + msgstr "" + "\n" +-"Sense cap FITXER o si FITXER és «-», llegeix l’entrada estàndard. Per " +-"defecte\n" +-"s’usa «-F /».\n" ++"Sense cap FITXER o si FITXER és «-», llegeix l’entrada estàndard. Per defecte\n" ++"s’empra «-F /».\n" + + #: src/ptx.c:2005 + msgid "" +@@ -6692,10 +6368,8 @@ + "any later version.\n" + "\n" + msgstr "" +-"Aquest és programari lliure; podeu redistribuir‐lo i/o modificar‐lo sota " +-"els\n" +-"termes de la Llicència Pública General GNU tal i com ha estat publicada per " +-"la\n" ++"Aquest és programari lliure; podeu redistribuir‐lo i/o modificar‐lo sota els\n" ++"termes de la Llicència Pública General GNU tal i com ha estat publicada per la\n" + "Free Software Foundation; bé sota la versió 2 de la Llicència o bé (si ho\n" + "preferiu) sota qualsevol versió posterior.\n" + "\n" +@@ -6708,10 +6382,8 @@ + "GNU General Public License for more details.\n" + "\n" + msgstr "" +-"Aquest programa es distribueix amb l’expectativa de que serà útil, però " +-"SENSE\n" +-"CAP GARANTIA; ni tan sols la garantia implícita de COMERCIABILITAT o " +-"ADEQUACIÓ\n" ++"Aquest programa es distribueix amb l’expectativa de que serà útil, però SENSE\n" ++"CAP GARANTIA; ni tan sols la garantia implícita de COMERCIABILITAT o ADEQUACIÓ\n" + "PER A UN PROPÒSIT PARTICULAR. Vegeu la Llicència Pública General GNU per\n" + "obtenir-ne més detalls.\n" + "\n" +@@ -6722,10 +6394,8 @@ + "along with this program; if not, write to the Free Software Foundation,\n" + "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n" + msgstr "" +-"Hauríeu d’haver rebut una còpia de la Llicència Pública General GNU " +-"juntament\n" +-"amb aquest programa; en cas contrari, escriviu a la Free Software " +-"Foundation,\n" ++"Hauríeu d’haver rebut una còpia de la Llicència Pública General GNU juntament\n" ++"amb aquest programa; en cas contrari, escriviu a la Free Software Foundation,\n" + "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n" + + # Usa quote(). ivb +@@ -6764,9 +6434,7 @@ + #: src/pwd.c:244 + #, c-format + msgid "couldn't find directory entry in %s with matching i-node" +-msgstr "" +-"no s’ha pogut trobar una entrada de directori en %s amb un node índex " +-"coincident" ++msgstr "no s’ha pogut trobar una entrada de directori en %s amb un node índex coincident" + + #: src/pwd.c:320 + msgid "ignoring non-option arguments" +@@ -6782,46 +6450,38 @@ + "Display value of a symbolic link on standard output.\n" + "\n" + msgstr "" +-"Mostra el valor d’un enllaç simbòlic en l’eixida estàndard.\n" ++"Mostra el valor d’un enllaç simbòlic a l’eixida estàndard.\n" + "\n" + + #: src/readlink.c:70 + msgid "" + " -f, --canonicalize canonicalize by following every symlink in\n" +-" every component of the given name " +-"recursively;\n" ++" every component of the given name recursively;\n" + " all but the last component must exist\n" + " -e, --canonicalize-existing canonicalize by following every symlink in\n" +-" every component of the given name " +-"recursively,\n" ++" every component of the given name recursively,\n" + " all components must exist\n" + " -m, --canonicalize-missing canonicalize by following every symlink in\n" +-" every component of the given name " +-"recursively,\n" +-" without requirements on components " +-"existence\n" ++" every component of the given name recursively,\n" ++" without requirements on components existence\n" + " -n, --no-newline do not output the trailing newline\n" + " -q, --quiet,\n" + " -s, --silent suppress most error messages\n" + " -v, --verbose report error messages\n" + msgstr "" +-" -f, --canonicalize Prova de trobar el nom canònic, seguint " +-"recursivament\n" ++" -f, --canonicalize Prova de trobar el nom canònic, seguint recursivament\n" + " cada enllaç simbòlic de cada component del camí\n" + " indicat; cal que existesquen tots els components del\n" +-" camí excepte l’últim.\n" ++" camí excepte el darrer.\n" + " -e, --canonicalize-existing\n" +-" Prova de trobar el nom canònic, seguint " +-"recursivament\n" ++" Prova de trobar el nom canònic, seguint recursivament\n" + " cada enllaç simbòlic de cada component del camí\n" + " indicat, cal que existesquen tots els components del\n" + " camí.\n" + " -m, --canonicalize-missing\n" +-" Prova de trobar el nom canònic, seguint " +-"recursivament\n" ++" Prova de trobar el nom canònic, seguint recursivament\n" + " cada enllaç simbòlic de cada component del camí\n" +-" indicat, sense requerir que existesquen els " +-"components\n" ++" indicat, sense requerir que existesquen els components\n" + " del camí.\n" + " -n, --no-newline No escriu un caràcter de nova línia al final.\n" + " -q, --quiet,\n" +@@ -6955,7 +6615,7 @@ + "Elimina (o deslliga) cada FITXER.\n" + "\n" + " -d, --directory Deslliga el FITXER, encara que siga un directori no\n" +-" buit (només pel superusuari; tan sols funciona si el\n" ++" buit (només per al superusuari; només funciona si el\n" + " sistema permet deslligar directoris no buits).\n" + " -f, --force Descarta els fitxers inexistents, i mai no pregunta.\n" + " -i, --interactive Pregunta abans d’esborrar.\n" +@@ -6978,14 +6638,11 @@ + msgid "" + "\n" + "By default, rm does not remove directories. Use the --recursive (-r or -R)\n" +-"option to remove each listed directory, too, along with all of its " +-"contents.\n" ++"option to remove each listed directory, too, along with all of its contents.\n" + msgstr "" + "\n" +-"Per defecte, «rm» no elimina els directoris. Useu l’opció «--recursive» («-" +-"r»\n" +-"o «-R») per a eliminar també cadascun dels directoris llistats, juntament " +-"amb\n" ++"Per defecte, «rm» no elimina els directoris. Useu l’opció «--recursive» («-r»\n" ++"o «-R») per a eliminar també cadascun dels directoris llistats, juntament amb\n" + "el seu contingut.\n" + + #: src/rm.c:159 +@@ -6999,8 +6656,7 @@ + " %s ./-foo\n" + msgstr "" + "\n" +-"Per a esborrar un fitxer amb un nom que comence per «-», per exemple «-" +-"mec»,\n" ++"Per a esborrar un fitxer amb un nom que comence per «-», per exemple «-mec»,\n" + "useu una d’aquestes ordres:\n" + " %s -- -mec\n" + "\n" +@@ -7010,14 +6666,13 @@ + msgid "" + "\n" + "Note that if you use rm to remove a file, it is usually possible to recover\n" +-"the contents of that file. If you want more assurance that the contents " +-"are\n" ++"the contents of that file. If you want more assurance that the contents are\n" + "truly unrecoverable, consider using shred.\n" + msgstr "" + "\n" + "Tingueu en compte que si useu «rm» per a eliminar un fitxer, normalment és\n" + "possible recuperar‐ne els continguts. Si voleu estar més segurs de que els\n" +-"continguts esdevinguen realment irrecuperables, considereu usar «shred».\n" ++"continguts esdevinguen realment irrecuperables, considereu emprar «shred».\n" + + # Cap dels 2 usa quote(). ivb + # Missatge informatiu. ivb +@@ -7047,14 +6702,12 @@ + + #: src/rmdir.c:147 + msgid "" +-" -p, --parents Remove DIRECTORY and its ancestors. E.g., `rmdir -p a/b/" +-"c' is\n" ++" -p, --parents Remove DIRECTORY and its ancestors. E.g., `rmdir -p a/b/c' is\n" + " similar to `rmdir a/b/c a/b a'.\n" + " -v, --verbose output a diagnostic for every directory processed\n" + msgstr "" + " -p, --parents Elimina el DIRECTORI i els seus ascendents. Per\n" +-" exemple, l’ordre «rmdir -p a/b/c» és similar a " +-"l’ordre\n" ++" exemple, l’ordre «rmdir -p a/b/c» és similar a l’ordre\n" + " «rmdir a/b/c a/b a».\n" + " -v, --verbose Mostra un missatge per cada directori processat.\n" + +@@ -7065,28 +6718,25 @@ + " or: %s [OPTION]... FIRST LAST\n" + " or: %s [OPTION]... FIRST INCREMENT LAST\n" + msgstr "" +-"Forma d’ús: %s [OPCIÓ]… ÚLTIM\n" +-" o bé: %s [OPCIÓ]… PRIMER ÚLTIM\n" +-" o bé: %s [OPCIÓ]… PRIMER INCREMENT ÚLTIM\n" ++"Forma d’ús: %s [OPCIÓ]… DARRER\n" ++" o bé: %s [OPCIÓ]… PRIMER DARRER\n" ++" o bé: %s [OPCIÓ]… PRIMER INCREMENT DARRER\n" + + #: src/seq.c:87 + #, c-format + msgid "" + "Print numbers from FIRST to LAST, in steps of INCREMENT.\n" + "\n" +-" -f, --format=FORMAT use printf style floating-point FORMAT (default: %" +-"g)\n" ++" -f, --format=FORMAT use printf style floating-point FORMAT (default: %g)\n" + " -s, --separator=STRING use STRING to separate numbers (default: \\n)\n" + " -w, --equal-width equalize width by padding with leading zeroes\n" + msgstr "" +-"Mostra els números del PRIMER a l’ÚLTIM, amb pas INCREMENT.\n" ++"Mostra els números del PRIMER al DARRER, amb pas INCREMENT.\n" + "\n" +-" -f, --format=FORMAT Usa el FORMAT indicat de coma flotat d’estil printf" +-"()\n" +-" (per defecte «%g»).\n" +-" -s, --separator=CADENA Usa aquesta CADENA per a separar els números " +-"(per\n" +-" defecte «\\n»).\n" ++" -f, --format=FORMAT Empra el FORMAT indicat de coma flotat d’estil\n" ++" printf() (per defecte «%g»).\n" ++" -s, --separator=CADENA Empra aquesta CADENA per a separar els números\n" ++" (per defecte «\\n»).\n" + " -w, --equal-width Iguala l’amplària replenant amb zeros al davant.\n" + + #: src/seq.c:96 +@@ -7102,16 +6752,13 @@ + "the printf-style, floating point output formats %e, %f, %g\n" + msgstr "" + "\n" +-"Si s’omet PRIMER o INCREMENT, es pren 1 per defecte. És a dir, un " +-"INCREMENT\n" +-"omés pren un valor per defecte d’1, fins i tot quan ÚLTIM és menor que " +-"PRIMER.\n" +-"PRIMER, INCREMENT i ÚLTIM s’interpreten com a valors reals en coma flotant.\n" +-"INCREMENT sol ser positiu si PRIMER és menor que ÚLTIM, i sol ser negatiu " +-"si\n" +-"PRIMER és major que ÚLTIM. Si s’indica un argument FORMAT, aquest ha de\n" +-"contenir exactament un dels formats de printf() d’eixida de flotants: «%e»,\n" +-"«%f» o «%g».\n" ++"Si s’omet PRIMER o INCREMENT, es pren 1 per defecte. És a dir, un INCREMENT\n" ++"omés pren un valor per defecte d’1, fins i tot quan DARRER és menor que\n" ++"PRIMER. PRIMER, INCREMENT i DARRER s’interpreten com a valors reals en coma\n" ++"flotant. INCREMENT sol ser positiu si PRIMER és menor que DARRER, i sol ser\n" ++"negatiu si PRIMER és major que DARRER. Si s’indica un argument FORMAT, aquest\n" ++"ha de contenir exactament un dels formats de printf() d’eixida de flotants:\n" ++"«%e», «%f» o «%g».\n" + + #: src/seq.c:121 + #, c-format +@@ -7126,7 +6773,7 @@ + + #: src/seq.c:399 + msgid "format string may not be specified when printing equal width strings" +-msgstr "no s’ha d’indicar una cadena de format quan s’usen amplàries igualades" ++msgstr "no s’ha d’indicar una cadena de format quan s’empren amplàries igualades" + + #: src/setuidgid.c:51 + #, c-format +@@ -7146,14 +6793,10 @@ + "This program is useful only when run by root (user ID zero).\n" + "\n" + msgstr "" +-"Abandona els grups suplementaris, assumeix els identificadors d’usuari i " +-"grup\n" +-"de NOM_USUARI, i executa l’ORDRE amb els ARGUMENTs especificats. Ix amb " +-"codi\n" +-"111 si no pot assumir els UID i GID requerits. En cas contrari ix amb el " +-"codi\n" +-"d’eixida de l’ORDRE. Aquest programa només és d’utilitat quan l’executa " +-"root\n" ++"Abandona els grups suplementaris, assumeix els identificadors d’usuari i grup\n" ++"de NOM_USUARI, i executa l’ORDRE amb els ARGUMENTs especificats. Ix amb codi\n" ++"111 si no pot assumir els UID i GID requerits. En cas contrari ix amb el codi\n" ++"d’eixida de l’ORDRE. Aquest programa només és d’utilitat quan l’executa root\n" + "(que té identificador d’usuari 0).\n" + "\n" + +@@ -7188,8 +6831,7 @@ + "for even very expensive hardware probing to recover the data.\n" + "\n" + msgstr "" +-"Sobreescriu cada FITER repetidament, per tal de fer més difícil recuperar " +-"les\n" ++"Sobreescriu cada FITER repetidament, per tal de fer més difícil recuperar les\n" + "dades, fins i tot per sondejos de maquinari molt cars.\n" + "\n" + +@@ -7204,8 +6846,7 @@ + " l’escriptura.\n" + " -n, --iterations=N Sobreescriu N voltes en lloc del nombre per defecte\n" + " (%d).\n" +-" -s, --size=N Sobreescriu aquest nombre d’octets (s’accepten " +-"sufixos\n" ++" -s, --size=N Sobreescriu aquest nombre d’octets (s’accepten sufixos\n" + " com «K», «M» i «G»).\n" + + #: src/shred.c:169 +@@ -7216,15 +6857,12 @@ + " this is the default for non-regular files\n" + " -z, --zero add a final overwrite with zeros to hide shredding\n" + msgstr "" +-" -u, --remove Trunca i elimina el fitxer després de " +-"sobreescriure’l.\n" ++" -u, --remove Trunca i elimina el fitxer després de sobreescriure’l.\n" + " -v, --verbose Mostra com progressa el procés.\n" + " -x, --exact No arrodoneix les mides de fitxer al següent bloc\n" +-" complet; aquest és el comportament per defecte per " +-"als\n" ++" complet; aquest és el comportament per defecte per als\n" + " fitxers no ordinaris.\n" +-" -z, --zero Afegeix una passada final de sobreescriptura amb " +-"zeros\n" ++" -z, --zero Afegeix una passada final de sobreescriptura amb zeros\n" + " per amagar la destrucció de les dades.\n" + + #: src/shred.c:178 +@@ -7244,8 +6882,8 @@ + "Si s’especifica «--remove» (-u) s’elimina cada FITXER. Per defecte no\n" + "s’eliminen aquests perquè és comú operar sobre fitxers dispositiu com\n" + "«/dev/hda», i normalment aquests fitxers no s’haurien d’eliminar. Quan\n" +-"s’opera sobre fitxers ordinaris la majoria de la gent usa l’opció «--" +-"remove».\n" ++"s’opera sobre fitxers ordinaris la majoria de la gent empra l’opció\n" ++"«--remove».\n" + "\n" + + #: src/shred.c:188 +@@ -7254,18 +6892,15 @@ + "that the file system overwrites data in place. This is the traditional\n" + "way to do things, but many modern file system designs do not satisfy this\n" + "assumption. The following are examples of file systems on which shred is\n" +-"not effective, or is not guaranteed to be effective in all file system " +-"modes:\n" ++"not effective, or is not guaranteed to be effective in all file system modes:\n" + "\n" + msgstr "" + "COMPTE: Teniu en compte que «shred» confia en una assumpció molt important:\n" +-"que el sistema de fitxers sobreescriu les dades en el mateix lloc. Aquesta " +-"és\n" +-"la foma tradicional de fer les coses, però molts sistemes de fitxers " +-"moderns\n" +-"no satisfan aquesta assumpció. Aquests són exemples de sistemes de fitxers\n" +-"sobre els quals «shred» no és efectiu, o no garanteix l’efectivitat en tots\n" +-"els modes del sistema de fitxers:\n" ++"que el sistema de fitxers sobreescriu les dades al mateix lloc. Aquesta és la\n" ++"foma tradicional de fer les coses, però molts sistemes de fitxers moderns no\n" ++"satisfan aquesta assumpció. Aquests són exemples de sistemes de fitxers sobre\n" ++"els quals «shred» no és efectiu, o no garanteix l’efectivitat a tots els modes\n" ++"del sistema de fitxers:\n" + "\n" + + #: src/shred.c:196 +@@ -7279,16 +6914,13 @@ + "* file systems that make snapshots, such as Network Appliance's NFS server\n" + "\n" + msgstr "" +-"* Sistemes de fitxers transaccionals o que usen diari, com els que es " +-"troben\n" ++"* Sistemes de fitxers transaccionals o que empren diari, com els que es troben\n" + " en AIX i Solaris (i JFS, ReiserFS, XFS, Ext3, etc.).\n" + "\n" +-"* Sistemes de fitxers que escriuen dades redundants i continuen fins i tot " +-"en\n" ++"* Sistemes de fitxers que escriuen dades redundants i continuen fins i tot en\n" + " fallar algunes escriptures, com els sistemes de fitxers basats en RAID.\n" + "\n" +-"* Sistemes de fitxers que creen instantànies, com el servidor NFS de " +-"Network\n" ++"* Sistemes de fitxers que creen instantànies, com el servidor NFS de Network\n" + " Appliances.\n" + "\n" + +@@ -7311,27 +6943,20 @@ + "of the file that cannot be removed, and that will allow a shredded file\n" + "to be recovered later.\n" + msgstr "" +-"* Sistemes de fitxers que usen ubicacions temporals com a memòria cau " +-"(cache),\n" +-" com els clients d’NFS versió 3.\n" ++"* Sistemes de fitxers que empren ubicacions temporals com a memòria cau\n" ++" (cache), com els clients d’NFS versió 3.\n" + "\n" + "* Sistemes de fitxers comprimits.\n" + "\n" +-"La nota anterior també és aplicable (i per tant «shred» hi té una " +-"efectivitat\n" +-"limitada) al cas dels sistemes de fitxers Ext3 muntats en mode " +-"«data=journal»,\n" +-"que no només usa el diari per a les metadades, sinò també per a les dades. " +-"En\n" +-"els modes «data=ordered» (mode per defecte) i «data=writeback», «shred»\n" +-"funciona normalment. Podeu canviar el mode de diari d’un sistema de " +-"fitxers\n" +-"Ext3 afegint l’opció «data=MODE» a les seues opcions de muntatge en el " +-"fitxer\n" +-"«/etc/fstab», com s’indica en el manual de «mount» (executeu «man mount»).\n" ++"La nota anterior també és aplicable (i per tant «shred» hi té una efectivitat\n" ++"limitada) al cas dels sistemes de fitxers Ext3 muntats en mode «data=journal»,\n" ++"que no només empra el diari per a les metadades, sinò també per a les dades.\n" ++"Als modes «data=ordered» (mode per defecte) i «data=writeback», «shred»\n" ++"funciona normalment. Podeu canviar el mode de diari d’un sistema de fitxers\n" ++"Ext3 afegint l’opció «data=MODE» a les seues opcions de muntatge al fitxer\n" ++"«/etc/fstab», com s’indica al manual de «mount» (executeu «man mount»).\n" + "\n" +-"A més a més, les còpies de seguretat i les rèpliques remotes dels sistemes " +-"de\n" ++"A més a més, les còpies de seguretat i les rèpliques remotes dels sistemes de\n" + "fitxers poden contenir còpies del fitxer que no poden ser eliminades, i que\n" + "podrien permetre recuperar més endavant el fitxer destruït.\n" + +@@ -7358,7 +6983,7 @@ + #: src/shred.c:836 + #, c-format + msgid "%s: error writing at offset %s" +-msgstr "%s: error en escriure en el desplaçament %s" ++msgstr "%s: error en escriure al desplaçament %s" + + #: src/shred.c:856 + #, c-format +@@ -7408,8 +7033,7 @@ + #: src/shred.c:1274 + #, c-format + msgid "%s: cannot shred append-only file descriptor" +-msgstr "" +-"%s: no es pot destruir el fitxer d’un descriptor obert només per afegir" ++msgstr "%s: no es pot destruir el fitxer d’un descriptor obert només per afegir" + + # Missatge informatiu, es refereix al nom, no a les dades. ivb + #: src/shred.c:1354 +@@ -7459,19 +7083,16 @@ + "Usage: %s NUMBER[SUFFIX]...\n" + " or: %s OPTION\n" + "Pause for NUMBER seconds. SUFFIX may be `s' for seconds (the default),\n" +-"`m' for minutes, `h' for hours or `d' for days. Unlike most " +-"implementations\n" ++"`m' for minutes, `h' for hours or `d' for days. Unlike most implementations\n" + "that require NUMBER be an integer, here NUMBER may be an arbitrary floating\n" + "point number.\n" + "\n" + msgstr "" + "Forma d’ús: %s NÚMERO[SUFIX]…\n" + " o bé: %s OPCIÓ\n" +-"Fa una pausa per NÚMERO segons. SUFIX pot ser «s» per a segons (per " +-"defecte),\n" ++"Fa una pausa per NÚMERO segons. SUFIX pot ser «s» per a segons (per defecte),\n" + "«m» per a minuts, «h» per a hores o «d» per a dies. Al contrari que la\n" +-"majoria de les implementacions, que requereixen que NÚMERO siga un enter, " +-"ací\n" ++"majoria de les implementacions, que requereixen que NÚMERO siga un enter, ací\n" + "NÚMERO pot ser un número real en coma flotant qualsevol.\n" + "\n" + +@@ -7490,8 +7111,7 @@ + "Write sorted concatenation of all FILE(s) to standard output.\n" + "\n" + msgstr "" +-"Escriu la concatenació ordenada de tots els FITXERs en la sortida " +-"estàndard.\n" ++"Escriu la concatenació ordenada de tots els FITXERs a la sortida estàndard.\n" + "\n" + + #: src/sort.c:292 +@@ -7505,15 +7125,13 @@ + #: src/sort.c:296 + msgid "" + " -b, --ignore-leading-blanks ignore leading blanks\n" +-" -d, --dictionary-order consider only blanks and alphanumeric " +-"characters\n" ++" -d, --dictionary-order consider only blanks and alphanumeric characters\n" + " -f, --ignore-case fold lower case to upper case characters\n" + msgstr "" + " -b, --ignore-leading-blanks\n" + " No té en compte els espais en blanc inicials.\n" + " -d, --dictionary-order\n" +-" Només té en compte els espais en blanc i els " +-"caràcters\n" ++" Només té en compte els espais en blanc i els caràcters\n" + " alfanumèrics.\n" + " -f, --ignore-case Converteix a majúscules.\n" + +@@ -7543,61 +7161,51 @@ + " -k, --key=POS1[,POS2] start a key at POS1, end it at POS2 (origin 1)\n" + " -m, --merge merge already sorted files; do not sort\n" + " -o, --output=FILE write result to FILE instead of standard output\n" +-" -s, --stable stabilize sort by disabling last-resort " +-"comparison\n" ++" -s, --stable stabilize sort by disabling last-resort comparison\n" + " -S, --buffer-size=SIZE use SIZE for main memory buffer\n" + msgstr "" + "Altres opcions:\n" + "\n" + " -c, --check Comprova si l’entrada està ordenada; no ordena.\n" +-" -k, --key=POS1[,POS2] Defineix com a clau d’ordenació allò que es " +-"troba\n" ++" -k, --key=POS1[,POS2] Defineix com a clau d’ordenació allò que es troba\n" + " entre POS1 i POS2 (començant per 1).\n" + " -m, --merge Mescla fitxers prèviament ordenats; no ordena.\n" +-" -o, --output=FITXER Escriu el resultat en el FITXER en lloc d’en " +-"l’eixida\n" ++" -o, --output=FITXER Escriu el resultat al FITXER i no a l’eixida\n" + " estàndard.\n" + " -s, --stable Dóna per acabada cada ordenació sense passar per la\n" +-" comparació usada com a últim recurs.\n" ++" comparació emprada com a darrer recurs.\n" + " -S, --buffer-size=MIDA\n" + " Defineix la MIDA de l’avantmemòria principal.\n" + + #: src/sort.c:319 + #, c-format + msgid "" +-" -t, --field-separator=SEP use SEP instead of non-blank to blank " +-"transition\n" +-" -T, --temporary-directory=DIR use DIR for temporaries, not $TMPDIR or %" +-"s;\n" ++" -t, --field-separator=SEP use SEP instead of non-blank to blank transition\n" ++" -T, --temporary-directory=DIR use DIR for temporaries, not $TMPDIR or %s;\n" + " multiple options specify multiple directories\n" + " -u, --unique with -c, check for strict ordering;\n" +-" without -c, output only the first of an equal " +-"run\n" ++" without -c, output only the first of an equal run\n" + msgstr "" + " -t, --field-separator=SEP\n" +-" Usa SEP com a separador de camp, en lloc de la\n" ++" Empra SEP com a separador de camp, en lloc de la\n" + " transició de caràcter no blanc a blanc.\n" + " -T, --temporary-directory=DIR\n" +-" Usa DIR com a directori temporal, en lloc de $TMPDIR " +-"o\n" +-" «%s»; se’n poden indicar més repetint l’opció.\n" +-" -u, --unique Amb «-c», comprova que l’ordenació és estricta; en " +-"cas\n" ++" Empra DIR com a directori temporal, en lloc de $TMPDIR\n" ++" o «%s»; se’n poden indicar més repetint l’opció.\n" ++" -u, --unique Amb «-c», comprova que l’ordenació és estricta; en cas\n" + " contrari només escriu la primera d’aquelles entrades\n" + " que resulten iguals.\n" + + #: src/sort.c:326 + msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" + msgstr "" +-" -z, --zero-terminated Escriu un octet 0 en lloc de cada caràcter de " +-"nova\n" ++" -z, --zero-terminated Escriu un octet 0 en lloc de cada caràcter de nova\n" + " línia.\n" + + #: src/sort.c:331 + msgid "" + "\n" +-"POS is F[.C][OPTS], where F is the field number and C the character " +-"position\n" ++"POS is F[.C][OPTS], where F is the field number and C the character position\n" + "in the field. OPTS is one or more single-letter ordering options, which\n" + "override global ordering options for that key. If no key is given, use the\n" + "entire line as the key.\n" +@@ -7605,12 +7213,10 @@ + "SIZE may be followed by the following multiplicative suffixes:\n" + msgstr "" + "\n" +-"POS és F[.C][OPCS], on F és el número del camp i C la posició del caràcter " +-"en\n" +-"el camp. OPCS és una més opcions d’ordenació, d’una única lletra, que " +-"tenen\n" ++"POS és F[.C][OPCS], on F és el número del camp i C la posició del caràcter al\n" ++"camp. OPCS és una més opcions d’ordenació, d’una única lletra, que tenen\n" + "preferència sobre les opcions globals d’ordenació per aquesta clau. Si no\n" +-"s’especifica cap clau, s’usa la línia sencera com a clau.\n" ++"s’especifica cap clau, s’empra la línia sencera com a clau.\n" + "\n" + "La MIDA pot anar seguida dels següent sufixs multiplicadors:\n" + +@@ -7626,15 +7232,13 @@ + "Set LC_ALL=C to get the traditional sort order that uses\n" + "native byte values.\n" + msgstr "" +-"% 1% de memòria, b 1, K 1024 (per defecte), i així per a M, G, T, P, E, Z, " +-"Y.\n" ++"% 1% de memòria, b 1, K 1024 (per defecte), i així per a M, G, T, P, E, Z, Y.\n" + "\n" + "Sense FITXER, o quan FITXER és «-», llegeix l’entrada estàndard.\n" + "\n" + "*** AVÍS ***\n" +-"El locale especificat en l’entorn afecta l’ordenació. Establiu LC_ALL a " +-"«C»\n" +-"per a obtenir l’ordenació tradicional que usa el valor numèric dels " ++"El locale especificat a l’entorn afecta l’ordenació. Establiu LC_ALL a «C»\n" ++"per a obtenir l’ordenació tradicional que empra el valor numèric dels\n" + "caràcters.\n" + + # Va seguit del nom del fitxer. ivb +@@ -7740,7 +7344,7 @@ + #: src/sort.c:2455 + #, c-format + msgid "extra operand %s not allowed with -c" +-msgstr "no es permet l’operand extra %s en usar l’opció «-c»" ++msgstr "no es permet l’operand extra %s en emprar l’opció «-c»" + + #: src/split.c:107 + #, c-format +@@ -7750,15 +7354,12 @@ + #: src/split.c:111 + msgid "" + "Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default\n" +-"size is 1000 lines, and default PREFIX is `x'. With no INPUT, or when " +-"INPUT\n" ++"size is 1000 lines, and default PREFIX is `x'. With no INPUT, or when INPUT\n" + "is -, read standard input.\n" + "\n" + msgstr "" +-"Escriu fragments de mida fixa de l’ENTRADA en fitxers «PREFIXaa», " +-"«PREFIXab»…\n" +-"La mida per defecte és de 1000 línies, i el PREFIX per defecte és «x». " +-"Sense\n" ++"Escriu fragments de mida fixa de l’ENTRADA en fitxers «PREFIXaa», «PREFIXab»…\n" ++"La mida per defecte és de 1000 línies, i el PREFIX per defecte és «x». Sense\n" + "ENTRADA, o quan ENTRADA és «-», llegeix l’entrada estàndard.\n" + "\n" + +@@ -7773,12 +7374,12 @@ + " -d, --numeric-suffixes use numeric suffixes instead of alphabetic\n" + " -l, --lines=NUMBER put NUMBER lines per output file\n" + msgstr "" +-" -a, --suffix-length=N Usa sufixs de longitud N (per defecte %d).\n" ++" -a, --suffix-length=N Empra sufixs de longitud N (per defecte %d).\n" + " -b, --bytes=MIDA Escriu MIDA octets per fitxer.\n" + " -C, --line-bytes=MIDA Escriu com a molt MIDA octets de línies senceres\n" + " per cada fitxer d’eixida.\n" + " -d, --numeric-suffixes\n" +-" Usa sufixs numèrics en lloc d’alfabètics.\n" ++" Empra sufixs numèrics en lloc d’alfabètics.\n" + " -l, --lines=NOMBRE Escriu aquest NOMBRE de línies per fitxer.\n" + + #: src/split.c:127 +@@ -7786,7 +7387,7 @@ + " --verbose print a diagnostic to standard error just\n" + " before each output file is opened\n" + msgstr "" +-" --verbose Mostra un missatge en la sortida estàndard d’errors\n" ++" --verbose Mostra un missatge a la sortida estàndard d’errors\n" + " abans d’obrir cada fitxer de sortida.\n" + + #: src/split.c:133 +@@ -7884,15 +7485,13 @@ + " If you want a newline, include \\n in FORMAT.\n" + " -t, --terse print the information in terse form\n" + msgstr "" +-" -c, --format=FORMAT Usa el FORMAT especificat en lloc de l’usat per\n" +-" defecte, i afig un caràcter de nova línia després de\n" ++" -c, --format=FORMAT Empra el FORMAT especificat en lloc de l’emprat per\n" ++" defecte, i afegeix un caràcter de nova línia després de\n" + " cada ús del FORMAT.\n" + " --printf=FORMAT Com «--format», però interpreta les seqüències\n" +-" d’escapada amb barres invertides, i no afig un " +-"caràcter\n" +-" de nova línia al final. Si en voleu un, incloeu " +-"«\\n»\n" +-" en el FORMAT.\n" ++" d’escapada amb barres invertides, i no afegeix un\n" ++" caràcter de nova línia al final. Si en voleu un,\n" ++" incloeu «\\n» al FORMAT.\n" + " -t, --terse Mostra la informació de forma pelada.\n" + + #: src/stat.c:793 +@@ -7910,7 +7509,7 @@ + "«--file-system»):\n" + "\n" + " %a Permisos d’accés en octal.\n" +-" %A Permisos d’accés en un format llegible pels humans.\n" ++" %A Permisos d’accés en un format llegible per als humans.\n" + " %b Nombre de blocs reservats (vegeu «%B»).\n" + " %B Mida en octets de cada bloc mostrat per «%b».\n" + +@@ -7966,13 +7565,12 @@ + msgstr "" + " %u Identificador d’usuari del propietari.\n" + " %U Nom d’usuari del propietari.\n" +-" %x Data de l’últim accés.\n" +-" %X Data de l’últim accés, en segons des de l’Època.\n" +-" %y Data de l’última modificació de les dades.\n" +-" %Y Data de l’última modificació de les dades, en segons des de " +-"l’Època.\n" +-" %z Data de l’últim canvi en el node índex.\n" +-" %Z Data de l’últim canvi en el node índex, en segons des de l’Època.\n" ++" %x Data del darrer accés.\n" ++" %X Data del darrer accés, en segons des de l’Època.\n" ++" %y Data de la darrera modificació de les dades.\n" ++" %Y Data de la darrera modificació de les dades, en segons des de l’Època.\n" ++" %z Data del darrer canvi al node índex.\n" ++" %Z Data del darrer canvi al node índex, en segons des de l’Època.\n" + "\n" + + #: src/stat.c:831 +@@ -8009,7 +7607,7 @@ + " %s Mida del bloc (per a transferències més ràpides).\n" + " %S Mida del bloc fonamental (per a recomptes de blocs).\n" + " %t Tipus del sistema de fitxers en hexadecimal.\n" +-" %T Tipus del sistema de fitxers en un format llegible pels humans.\n" ++" %T Tipus del sistema de fitxers en un format llegible per als humans.\n" + + #: src/stty.c:511 + #, c-format +@@ -8032,13 +7630,11 @@ + msgstr "" + "Mostra o canvia les característiques del terminal.\n" + "\n" +-" -a, --all Mostra totes les propietats actuals de forma " +-"llegible\n" +-" pels humans.\n" +-" -g, --save Mostra totes les propietats actuals de forma " +-"llegible\n" ++" -a, --all Mostra totes les propietats actuals de forma llegible\n" ++" per als humans.\n" ++" -g, --save Mostra totes les propietats actuals de forma llegible\n" + " per «stty».\n" +-" -F, --file=DISPOSITIU Obre i usa el DISPOSITIU especificat en lloc de\n" ++" -F, --file=DISPOSITIU Obre i empra el DISPOSITIU especificat en lloc de\n" + " l’entrada estàndard.\n" + + #: src/stty.c:526 +@@ -8048,10 +7644,8 @@ + "settings. The underlying system defines which settings are available.\n" + msgstr "" + "\n" +-"Un «-» opcional davant d’una PROPIETAT la nega. Un «*» marca les " +-"propietats\n" +-"no‐POSIX. Les propietats disponibles venen determinades pel sistema " +-"subjaent.\n" ++"Un «-» opcional davant d’una PROPIETAT la nega. Un «*» marca les propietats\n" ++"no‐POSIX. Les propietats disponibles venen determinades pel sistema subjaent.\n" + + # El més llarg és «werase CAR». ivb + #: src/stty.c:531 +@@ -8064,8 +7658,7 @@ + msgstr "" + "\n" + "Caràcters especials:\n" +-" * dsusp CAR El caràcter CAR enviarà un senyal de parada de terminal " +-"una\n" ++" * dsusp CAR El caràcter CAR enviarà un senyal d’aturada de terminal una\n" + " volta s’haja buidat l’entrada.\n" + " eof CAR CAR enviarà un final de fitxer (que termina l’entrada).\n" + " eol CAR CAR terminarà la línia.\n" +@@ -8078,7 +7671,7 @@ + " kill CHAR CHAR will erase the current line\n" + msgstr "" + " * eol2 CAR CAR indica un caràcter alternatiu de terminació de línia.\n" +-" erase CAR CAR esborrarà l’últim caràcter escrit.\n" ++" erase CAR CAR esborrarà el darrer caràcter escrit.\n" + " intr CAR CAR enviarà un senyal d’interrupció.\n" + " kill CAR CAR esborrarà la línia actual.\n" + +@@ -8092,7 +7685,7 @@ + " * lnext CAR CAR entrarà el caràcter següent entrecometat.\n" + " quit CAR CAR enviarà un senyal d’eixir.\n" + " * rprnt CAR CAR redibuixarà la línia actual.\n" +-" start CAR CAR reiniciarà l’eixida després d’haver‐la parat.\n" ++" start CAR CAR reiniciarà l’eixida després d’haver‐la aturat.\n" + + #: src/stty.c:550 + msgid "" +@@ -8101,10 +7694,10 @@ + " * swtch CHAR CHAR will switch to a different shell layer\n" + " * werase CHAR CHAR will erase the last word typed\n" + msgstr "" +-" stop CAR CAR pararà l’eixida.\n" +-" susp CAR CAR enviarà un senyal de parada de terminal.\n" ++" stop CAR CAR aturarà l’eixida.\n" ++" susp CAR CAR enviarà un senyal d’aturada de terminal.\n" + " * swtch CAR CAR canviarà a una capa d’intèrpret diferent.\n" +-" * werase CAR CAR esborrarà l’última paraula escrita.\n" ++" * werase CAR CAR esborrarà la darrera paraula escrita.\n" + + #: src/stty.c:556 + msgid "" +@@ -8124,12 +7717,11 @@ + msgid "" + " ispeed N set the input speed to N\n" + " * line N use line discipline N\n" +-" min N with -icanon, set N characters minimum for a completed " +-"read\n" ++" min N with -icanon, set N characters minimum for a completed read\n" + " ospeed N set the output speed to N\n" + msgstr "" + " ispeed N Estableix la velocitat d’entrada a N bauds.\n" +-" * line N Usa la disciplina de línia N.\n" ++" * line N Empra la disciplina de línia N.\n" + " min N Amb «-icanon», caldran almenys N caràcters per a fer una\n" + " lectura completa.\n" + " ospeed N Estableix la velocitat d’eixida a N bauds.\n" +@@ -8137,16 +7729,14 @@ + #: src/stty.c:569 + msgid "" + " * rows N tell the kernel that the terminal has N rows\n" +-" * size print the number of rows and columns according to the " +-"kernel\n" ++" * size print the number of rows and columns according to the kernel\n" + " speed print the terminal speed\n" + " time N with -icanon, set read timeout of N tenths of a second\n" + msgstr "" + " * rows N Anucia al nucli que el terminal té N files.\n" + " * size Mostra el nombre de files i columnes d’acord amb el nucli.\n" + " speed Mostra la velocitat del terminal.\n" +-" time N Amb «-icanon», l’expiració de la lectura esdevé d’N " +-"dècimes\n" ++" time N Amb «-icanon», l’expiració de la lectura esdevé d’N dècimes\n" + " de segon.\n" + + #: src/stty.c:575 +@@ -8170,17 +7760,16 @@ + " [-]cstopb use two stop bits per character (one with `-')\n" + " [-]hup send a hangup signal when the last process closes the tty\n" + " [-]hupcl same as [-]hup\n" +-" [-]parenb generate parity bit in output and expect parity bit in " +-"input\n" ++" [-]parenb generate parity bit in output and expect parity bit in input\n" + " [-]parodd set odd parity (even with `-')\n" + msgstr "" +-" [-]cstopb Usa dos bits de parada per caràcter (només un amb «-»).\n" +-" [-]hup S’envia un senyal de penjat quan l’últim procés tanque el\n" ++" [-]cstopb Empra dos bits d’aturada per caràcter (només un amb «-»).\n" ++" [-]hup S’envia un senyal de penjat quan el darrer procés tanque el\n" + " terminal.\n" + " [-]hupcl Equival a «[-]hup».\n" + " [-]parenb Genera un bit de paritat a l’eixida i n’espera un a\n" + " l’entrada.\n" +-" [-]parodd Usa paritat senar (parella amb «-»).\n" ++" [-]parodd Empra paritat senar (parella amb «-»).\n" + + #: src/stty.c:590 + msgid "" +@@ -8208,8 +7797,7 @@ + " [-]istrip clear high (8th) bit of input characters\n" + msgstr "" + " [-]ignpar Descarta els caràcters amb error de paritat.\n" +-" * [-]imaxbel Xiula i no buida un bloc de memòria intermèdia d’entrada " +-"ple\n" ++" * [-]imaxbel Xiula i no buida un bloc de memòria intermèdia d’entrada ple\n" + " quan arriba un caràcter.\n" + " [-]inlcr Tradueix les noves línies en retorns de carro.\n" + " [-]inpck Habilita la comprovació de paritat de l’entrada.\n" +@@ -8231,10 +7819,9 @@ + " [-]tandem same as [-]ixoff\n" + msgstr "" + " * [-]iuclc Tradueix els caràcters en majúscula a minúscula.\n" +-" * [-]ixany Permet que qualsevol caràcter reinicie l’eixida, no només " +-"el\n" ++" * [-]ixany Permet que qualsevol caràcter reinicie l’eixida, no només el\n" + " caràcter definit amb «start».\n" +-" [-]ixoff Habilita l’enviament de caràcters d’inici/parada.\n" ++" [-]ixoff Habilita l’enviament de caràcters d’inici/aturada.\n" + " [-]ixon Habilita el control de flux amb XON/XOFF.\n" + " [-]parmrk Marca els errors de paritat (amb la seqüència de caràcters\n" + " 255‐0‐caràcter).\n" +@@ -8266,8 +7853,8 @@ + " * [-]onlret newline performs a carriage return\n" + msgstr "" + " * [-]ocrnl Tradueix els retorns de carro a noves línies.\n" +-" * [-]ofdel Usa per a replenar caràcters d’esborrat en lloc de nuls.\n" +-" * [-]ofill Replena amb caràcters en lloc d’esperar en els retards.\n" ++" * [-]ofdel Empra per a replenar caràcters d’esborrat en lloc de nuls.\n" ++" * [-]ofill Replena amb caràcters en lloc d’esperar durant els retards.\n" + " * [-]olcuc Tradueix els caràcters en minúscula a majúscula.\n" + " * [-]onlcr Tradueix les noves línies a retorn de carro i nova línia.\n" + " * [-]onlret Fa que la nova línia provoque un retorn de carro.\n" +@@ -8281,7 +7868,7 @@ + " * -tabs same as tab3\n" + " * vtN vertical tab delay style, N in [0..1]\n" + msgstr "" +-" * [-]onocr No imprimeix retorns de carro en la primera columna.\n" ++" * [-]onocr No imprimeix retorns de carro a la primera columna.\n" + " [-]opost Postprocessa l’eixida.\n" + " * tabN Estil del retard de la tabulació horitzontal, N en [0..3].\n" + " * tabs Equival a «tab0».\n" +@@ -8316,8 +7903,7 @@ + " [-]echo Mostra els caràcters de l’entrada.\n" + " * [-]echoctl Equival a «[-]ctlecho».\n" + " [-]echoe Equival a «[-]crterase».\n" +-" [-]echok Mostra una nova línia després del caràcter d’esborrar " +-"línia.\n" ++" [-]echok Mostra una nova línia després del caràcter d’esborrar línia.\n" + + #: src/stty.c:654 + msgid "" +@@ -8332,27 +7918,24 @@ + " dels caràcters.\n" + " * [-]echoprt Mostra entre «\\\\» i «/» els caràcters esborrats amb el\n" + " retrocés.\n" +-" [-]icanon Habilita els caràcters especials d’esborrar, esborrar " +-"línia,\n" ++" [-]icanon Habilita els caràcters especials d’esborrar, esborrar línia,\n" + " esborrar paraula i redibuixar.\n" + " [-]iexten Habilita els caràcters especials no‐POSIX.\n" + + #: src/stty.c:661 + msgid "" + " [-]isig enable interrupt, quit, and suspend special characters\n" +-" [-]noflsh disable flushing after interrupt and quit special " +-"characters\n" ++" [-]noflsh disable flushing after interrupt and quit special characters\n" + " * [-]prterase same as [-]echoprt\n" + " * [-]tostop stop background jobs that try to write to the terminal\n" + " * [-]xcase with icanon, escape with `\\' for uppercase characters\n" + msgstr "" + " [-]isig Habilita els caràcters especials d’interrupció, eixida i\n" +-" parada de terminal.\n" ++" aturada de terminal.\n" + " [-]noflsh Inhabilita el buidat després d’haver rebut els caràcters\n" + " especials d’interrupció i eixida.\n" + " * [-]prterase Equival a «[-]echoprt».\n" +-" * [-]tostop Para els processos de fons que intenten escriure en el\n" +-" terminal.\n" ++" * [-]tostop Para els processos de fons que intenten escriure al terminal.\n" + " * [-]xcase Amb «icanon», escapa amb «\\\\» les majúscules.\n" + + #: src/stty.c:668 +@@ -8376,8 +7959,7 @@ + " -cooked same as raw\n" + " crt same as echoe echoctl echoke\n" + msgstr "" +-" cooked Posa a llurs valors per defecte els caràcters: brkint " +-"ignpar\n" ++" cooked Posa a llurs valors per defecte els caràcters: brkint ignpar\n" + " istrip icrnl ixon opost isig icanon eof eol.\n" + " -cooked Equival a «raw».\n" + " crt Equival a «echoe echoctl echoke».\n" +@@ -8449,12 +8031,10 @@ + " characters to their default values.\n" + msgstr "" + " sane Equival a «cread -ignbrk brkint -inlcr -igncr icrnl -iutf8\n" +-" -ixoff -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr -" +-"onocr\n" ++" -ixoff -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr -onocr\n" + " -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon\n" + " iexten echo echoe echok -echonl -noflsh -xcase -tostop\n" +-" -echoprt echoctl echoke», posant tots els caràcters " +-"especials\n" ++" -echoprt echoctl echoke», posant tots els caràcters especials\n" + " a llurs valors per defecte.\n" + + #: src/stty.c:717 +@@ -8470,7 +8050,7 @@ + "mostra la velocitat en bauds, la disciplina de línia i les diferències amb\n" + "«stty sane». En indicar propietats, el caràcter CAR ha de ser literal, o\n" + "codificat com «^c», «0x37», «0177» o «127»; els valors especials «^-» i\n" +-"«undef» s’usen per a inhabilitar caràcters especials.\n" ++"«undef» s’empren per a inhabilitar caràcters especials.\n" + + #: src/stty.c:786 + msgid "only one device may be specified" +@@ -8480,9 +8060,7 @@ + msgid "" + "the options for verbose and stty-readable output styles are\n" + "mutually exclusive" +-msgstr "" +-"les opcions per a mostrar les propietats de forma llegible per humans i per " +-"«stty» són mútuament excloents" ++msgstr "les opcions per a mostrar les propietats de forma llegible per humans i per «stty» són mútuament excloents" + + #: src/stty.c:822 + msgid "when specifying an output style, modes may not be set" +@@ -8603,7 +8181,7 @@ + #: src/su.c:538 + #, c-format + msgid "using restricted shell %s" +-msgstr "s’usa l’intèrpret restringit «%s»" ++msgstr "s’empra l’intèrpret restringit «%s»" + + # No usa quote(). ivb + #: src/su.c:546 +@@ -8611,7 +8189,7 @@ + msgid "warning: cannot change directory to %s" + msgstr "avís: no s’ha pogut canviar al directori «%s»" + +-# Això de «defeat» és que l'últim té preferència. ivb ++# Això de «defeat» és que el darrer té preferència. ivb + #: src/sum.c:63 + msgid "" + "Print checksum and block counts for each FILE.\n" +@@ -8621,9 +8199,8 @@ + msgstr "" + "Mostra la suma de verificació i el nombre de blocs de cada FITXER.\n" + "\n" +-" -r Usa l’algorisme de suma de BSD, amb blocs de 1 kB.\n" +-" -s, --sysv Usa l’algorisme de suma de System V, amb blocs de " +-"512\n" ++" -r Empra l’algorisme de suma de BSD, amb blocs de 1 kB.\n" ++" -s, --sysv Empra l’algorisme de suma de System V, amb blocs de 512\n" + " octets.\n" + + #: src/sync.c:46 +@@ -8648,8 +8225,7 @@ + msgstr "" + "\n" + "NOTA: Potser el vostre intèrpret d’ordres té la seua pròpia versió de «%s»,\n" +-"que preval sobre la descrita ací. Per favor, consulteu en la documentació " +-"del\n" ++"que preval sobre la descrita ací. Per favor, consulteu a la documentació del\n" + "vostre intèrpret quines opcions admet.\n" + + #: src/system.h:583 +@@ -8666,8 +8242,7 @@ + "With no FILE, or when FILE is -, read standard input.\n" + "\n" + msgstr "" +-"Escriu cada FITXER en la sortida estàndard, invertint l’ordre de les " +-"línies.\n" ++"Escriu cada FITXER a la sortida estàndard, invertint l’ordre de les línies.\n" + "Sense cap FITXER, o quan FITXER és «-», llegeix l’entrada estàndard.\n" + "\n" + +@@ -8680,8 +8255,7 @@ + " -b, --before Posa el separador abans, i no després.\n" + " -r, --regexp Interpreta el separador com a una expressió regular.\n" + " -s, --separator=CADENA\n" +-" Usa la CADENA com a separador en lloc del caràcter " +-"de\n" ++" Empra la CADENA com a separador en lloc del caràcter de\n" + " nova línia.\n" + + #: src/tac.c:235 src/tac.c:336 +@@ -8722,10 +8296,8 @@ + "With no FILE, or when FILE is -, read standard input.\n" + "\n" + msgstr "" +-"Escriu les últimes %d línies de cada FITXER en la sortida estàndard. Amb " +-"més\n" +-"d’un FITXER, les precedeix amb una capçalera amb el nom del fitxer. Sense " +-"cap\n" ++"Escriu les darreres %d línies de cada FITXER a la sortida estàndard. Amb més\n" ++"d’un FITXER, les precedeix amb una capçalera amb el nom del fitxer. Sense cap\n" + "FITXER, o quan FITXER és «-», llegeix l’entrada estàndard.\n" + "\n" + +@@ -8733,8 +8305,7 @@ + msgid "" + " --retry keep trying to open a file even if it is\n" + " inaccessible when tail starts or if it becomes\n" +-" inaccessible later; useful when following by " +-"name,\n" ++" inaccessible later; useful when following by name,\n" + " i.e., with --follow=name\n" + " -c, --bytes=N output the last N bytes\n" + msgstr "" +@@ -8742,7 +8313,7 @@ + " inaccessible al principi, o si després es torna\n" + " inaccessible; només és útil en seguir la pista d’un\n" + " nom, és a dir, amb «--follow=NOM».\n" +-" -c, --bytes=N Escriu els últims N octets.\n" ++" -c, --bytes=N Escriu els darrers N octets.\n" + + #: src/tail.c:246 + msgid "" +@@ -8768,14 +8339,11 @@ + " to see if it has been unlinked or renamed\n" + " (this is the usual case of rotated log files)\n" + msgstr "" +-" -n, --lines=N Escriu les últimes N línies, i no les últimes %d.\n" ++" -n, --lines=N Escriu les darreres N línies, i no les darreres %d.\n" + " --max-unchanged-stats=N\n" +-" Amb «--follow=NOM», reobre el FITXER que no ha " +-"canviat\n" +-" de mida després de N iteracions (per defecte %d), " +-"per\n" +-" veure si ha estat esborrat o reanomenat (com és el " +-"cas\n" ++" Amb «--follow=NOM», reobre el FITXER que no ha canviat\n" ++" de mida després d’N iteracions (per defecte %d), per\n" ++" veure si ha estat esborrat o reanomenat (com és el cas\n" + " habitual dels fitxers de registre en ser rotats).\n" + + #: src/tail.c:264 +@@ -8786,8 +8354,7 @@ + " (default 1.0) between iterations.\n" + " -v, --verbose always output headers giving file names\n" + msgstr "" +-" --pid=PID Amb «-f», acaba després que el procés identificat " +-"per\n" ++" --pid=PID Amb «-f», acaba després que el procés identificat per\n" + " aquest PID mori.\n" + " -q, --quiet, --silent Omet les capçaleres amb els noms dels fitxers.\n" + " -s, --sleep-interval=S\n" +@@ -8807,8 +8374,7 @@ + "\n" + "Si el primer caràcter d’N (nombre d’octets o línies) és un «+», escriu cada\n" + "fitxer començant pel seu Nè element, comptant des de l’inici; en altre cas,\n" +-"escriu els últims N elements del fitxer. N pot tenir un sufix " +-"multiplicador:\n" ++"escriu els darrers N elements del fitxer. N pot tenir un sufix multiplicador:\n" + "«b» per a 512, «k» per a 1024, «m» per a 1024*1024.\n" + "\n" + +@@ -8821,8 +8387,7 @@ + "means that even if a tail'ed file is renamed, tail will continue to track\n" + "its end. " + msgstr "" +-"Amb «--follow» (-f), es segueix per defecte el descriptor de fitxer, de " +-"manera\n" ++"Amb «--follow» (-f), es segueix per defecte el descriptor de fitxer, de manera\n" + "que encara que el fitxer siga reanomenat, es continuarà seguint el seu final." + + # aquesta entrada va junta amb l'anterior +@@ -8839,8 +8404,7 @@ + "Aquest comportament no és desitjable si el que voleu realment és seguir el\n" + "nom del fitxer, i no el seu descriptor (per exemple, durant la rotació d’un\n" + "registre). Useu «--follow=NOM» en aquest cas. Això fa que s’òbriga\n" +-"periòdicament el fitxer en qüestió per a veure si ha estat esborrat i " +-"recreat\n" ++"periòdicament el fitxer en qüestió per a veure si ha estat esborrat i recreat\n" + "per algun altre programa.\n" + + # No usa quote(). ivb +@@ -8873,9 +8437,7 @@ + #: src/tail.c:892 + #, c-format + msgid "%s has been replaced with an untailable file; giving up on this name" +-msgstr "" +-"%s ha estat substituït per un fitxer no seguible; s’abandona la pista " +-"d’aquest nom" ++msgstr "%s ha estat substituït per un fitxer no seguible; s’abandona la pista d’aquest nom" + + # Usa quote(). ivb + # FIXME: pretty_name() lacks i18n. ivb +@@ -8918,9 +8480,7 @@ + #: src/tail.c:1331 + #, c-format + msgid "%s: cannot follow end of this type of file; giving up on this name" +-msgstr "" +-"%s: no es pot seguir el final d’aquest tipus de fitxer; s’abandona la pista " +-"d’aquest nom" ++msgstr "%s: no es pot seguir el final d’aquest tipus de fitxer; s’abandona la pista d’aquest nom" + + # És un enter correcte però massa gran. ivb + # Usa quote(). ivb +@@ -8932,9 +8492,7 @@ + #: src/tail.c:1518 + #, c-format + msgid "%s: invalid maximum number of unchanged stats between opens" +-msgstr "" +-"%s: el nombre màxim d’iteracions sense alteracions entre obertures no és " +-"vàlid" ++msgstr "%s: el nombre màxim d’iteracions sense alteracions entre obertures no és vàlid" + + #: src/tail.c:1530 + #, c-format +@@ -9065,8 +8623,7 @@ + "EXPRESSION is true or false and sets exit status. It is one of:\n" + msgstr "" + "\n" +-"Una EXPRESSIÓ omesa és per defecte falsa. Altrament, l’EXPRESSIÓ és certa " +-"o\n" ++"Una EXPRESSIÓ omesa és per defecte falsa. Altrament, l’EXPRESSIÓ és certa o\n" + "falsa i estableix l’estat d’eixida. És una de:\n" + + # El més llarg és «EXPRESSIÓ1 -a EXPRESSIÓ2». ivb +@@ -9128,8 +8685,7 @@ + "\n" + " FITXER1 -ef FITXER2 El FITXER1 i el FITXER2 tenen els mateixos\n" + " números de dispositiu i node índex.\n" +-" FITXER1 -nt FITXER2 El FITXER1 és més nou (data de modificació) " +-"que\n" ++" FITXER1 -nt FITXER2 El FITXER1 és més nou (data de modificació) que\n" + " el FITXER2.\n" + " FITXER1 -ot FITXER2 El FITXER1 és més antic que el FITXER2.\n" + +@@ -9142,8 +8698,7 @@ + " -e FILE FILE exists\n" + msgstr "" + "\n" +-" -b FITXER El FITXER existeix i és un dispositiu de " +-"blocs.\n" ++" -b FITXER El FITXER existeix i és un dispositiu de blocs.\n" + " -c FITXER El FITXER existeix i és un dispositiu de\n" + " caràcters.\n" + " -d FITXER El FITXER existeix i és un directori.\n" +@@ -9178,12 +8733,10 @@ + msgstr "" + " -L FITXER El FITXER existeix i és un enllaç simbòlic\n" + " (equival a «-h»).\n" +-" -O FITXER El FITXER existeix i pertany a l’usuari " +-"efectiu.\n" ++" -O FITXER El FITXER existeix i pertany a l’usuari efectiu.\n" + " -p FITXER El FITXER existeix i és una canonada amb nom.\n" + " -r FITXER El FITXER existeix i té permís de lectura.\n" +-" -s FITXER El FITXER existeix i la seua mida és major " +-"que\n" ++" -s FITXER El FITXER existeix i la seua mida és major que\n" + " zero.\n" + + #: src/test.c:762 +@@ -9200,16 +8753,14 @@ + " -u FITXER El FITXER existeix i té activat el bit\n" + " d’establiment de l’ID d’usuari.\n" + " -w FITXER El FITXER existeix i té permís d’escriptura.\n" +-" -x FITXER El FITXER existeix i té permís d’execució (o " +-"de\n" +-" recerca).\n" ++" -x FITXER El FITXER existeix i té permís d’execució (o de\n" ++" cerca).\n" + + #: src/test.c:769 + msgid "" + "\n" + "Except for -h and -L, all FILE-related tests dereference symbolic links.\n" +-"Beware that parentheses need to be escaped (e.g., by backslashes) for " +-"shells.\n" ++"Beware that parentheses need to be escaped (e.g., by backslashes) for shells.\n" + "INTEGER may also be -l STRING, which evaluates to the length of STRING.\n" + msgstr "" + "\n" +@@ -9278,8 +8829,8 @@ + msgstr "" + " -a Només canvia la data d’accés.\n" + " -c, --no-create No crea cap fitxer.\n" +-" -d, --date=CADENA Interpreta la CADENA i l’usa en lloc de la data " +-"actual.\n" ++" -d, --date=CADENA Interpreta la CADENA i l’empra en lloc de la data\n" ++" actual.\n" + " -f (No es té en compte.)\n" + " -m Només canvia la data de modificació de les dades.\n" + +@@ -9293,16 +8844,13 @@ + " WORD is modify or mtime: equivalent to -m\n" + msgstr "" + " -r, --reference=FITXER\n" +-" Usa les dates d’aquest FITXER en lloc de la data\n" ++" Empra les dates d’aquest FITXER en lloc de la data\n" + " actual.\n" +-" -t DATA Usa la data [[CC]AA]MMDDhhmm[.ss] en lloc de la data\n" ++" -t DATA Empra la data [[CC]AA]MMDDhhmm[.ss] en lloc de la data\n" + " actual.\n" +-" --time=PARAULA Modifica la data indicada per la PARAULA: la " +-"d’accés\n" +-" amb «access», «atime» o «use» (equivalen a «-a»); la " +-"de\n" +-" modificació amb «modify» o «mtime» (equivalen a «-" +-"m»).\n" ++" --time=PARAULA Modifica la data indicada per la PARAULA: la d’accés\n" ++" amb «access», «atime» o «use» (equivalen a «-a»); la de\n" ++" modificació amb «modify» o «mtime» (equivalen a «-m»).\n" + + #: src/touch.c:257 + msgid "" +@@ -9323,10 +8871,8 @@ + + #: src/touch.c:389 + #, c-format +-msgid "" +-"warning: `touch %s' is obsolete; use `touch -t %04ld%02d%02d%02d%02d.%02d'" +-msgstr "" +-"avís: «touch %s» és obsoleta; useu «touch -t %04ld%02d%02d%02d%02d.%02d»" ++msgid "warning: `touch %s' is obsolete; use `touch -t %04ld%02d%02d%02d%02d.%02d'" ++msgstr "avís: «touch %s» és obsoleta; useu «touch -t %04ld%02d%02d%02d%02d.%02d»" + + #: src/tr.c:290 + #, c-format +@@ -9340,21 +8886,18 @@ + "\n" + " -c, -C, --complement first complement SET1\n" + " -d, --delete delete characters in SET1, do not translate\n" +-" -s, --squeeze-repeats replace each input sequence of a repeated " +-"character\n" ++" -s, --squeeze-repeats replace each input sequence of a repeated character\n" + " that is listed in SET1 with a single occurrence\n" + " of that character\n" + " -t, --truncate-set1 first truncate SET1 to length of SET2\n" + msgstr "" +-"Tradueix, redueix, o suprimeix caràcters de l’entrada estàndard, i escriu " +-"el\n" +-"resultat en la sortida estàndard.\n" ++"Tradueix, redueix, o suprimeix caràcters de l’entrada estàndard, i escriu el\n" ++"resultat a la sortida estàndard.\n" + "\n" + " -c, -C, --complement Complementa primer el JOC1.\n" + " -d, --delete Suprimeix els caràcters del JOC1, no tradueix.\n" + " -s, --squeeze-repeats Substitueix cada seqüència de repeticions d’un\n" +-" caràcter de JOC1 per una única ocurrència del " +-"caràcter.\n" ++" caràcter de JOC1 per una única ocurrència del caràcter.\n" + " -t, --truncate-set1 Trunca primer el JOC1 a la llargada del JOC2.\n" + + # El més llag és «[:xdigit:]». ivb +@@ -9400,8 +8943,7 @@ + msgstr "" + " \\v Tabulació vertical.\n" + " CAR1-CAR2 Tots els caràcters en ordre ascendent entre CAR1 i CAR2.\n" +-" [CAR*] En el JOC2, còpies de CAR fins a arribar a la llargada de\n" +-" JOC1.\n" ++" [CAR*] Al JOC2, còpies de CAR fins a arribar a la llargada de JOC1.\n" + " [CAR*REP] REP còpies de CAR; REP és octal si comença amb 0.\n" + " [:alnum:] Totes les lletres i dígits.\n" + " [:alpha:] Totes les lletres.\n" +@@ -9438,11 +8980,9 @@ + "SET1 by repeating its last character as necessary. " + msgstr "" + "\n" +-"La traducció es produeix si no s’indica «-d» i ambdós JOC1 i JOC2 " +-"apareixen.\n" +-"Només es pot usar «-t» quan es tradueix. El JOC2 s’expandeix a la llargada " +-"de\n" +-"JOC1 repetint l’últim caràcter tant com sigui necessari. " ++"La traducció es produeix si no s’indica «-d» i ambdós JOC1 i JOC2 apareixen.\n" ++"Només es pot emprar «-t» quan es tradueix. El JOC2 s’expandeix a la llargada\n" ++"de JOC1 repetint el darrer caràcter tant com sigui necessari. " + + #: src/tr.c:348 + msgid "" +@@ -9452,9 +8992,8 @@ + "only be used in pairs to specify case conversion. " + msgstr "" + "Els caràcters\n" +-"sobrants del JOC2 es descarten. Només s’assegura una expansió ascendent " +-"per\n" +-"les seqüències «[:lower:]» i «[:upper:]»; quan s’usen en JOC2 i s’estiga\n" ++"sobrants del JOC2 es descarten. Només s’assegura una expansió ascendent per\n" ++"les seqüències «[:lower:]» i «[:upper:]»; quan s’empren en JOC2 i s’estiga\n" + "traduint, només es poden utilitzar en parelles respecte JOC1, especificant\n" + "conversió de majúscules a minúscules (o a la inversa). " + +@@ -9464,8 +9003,8 @@ + "translating nor deleting; else squeezing uses SET2 and occurs after\n" + "translation or deletion.\n" + msgstr "" +-"«-s» usa el JOC1 si no\n" +-"s’està traduint ni suprimint; en la reducció s’usa el JOC2 i aquesta es\n" ++"«-s» empra el JOC1 si no\n" ++"s’està traduint ni suprimint; a la reducció s’empra el JOC2 i aquesta es\n" + "produeix després de traduïr o suprimir.\n" + + #: src/tr.c:518 +@@ -9473,9 +9012,7 @@ + msgid "" + "warning: the ambiguous octal escape \\%c%c%c is being\n" + "\tinterpreted as the 2-byte sequence \\0%c%c, %c" +-msgstr "" +-"avís: la seqüència ambígua d’escapada en octal «\\%c%c%c» s’interpreta com " +-"la seqüència de 2 octets «\\0%c%c», «%c»" ++msgstr "avís: la seqüència ambígua d’escapada en octal «\\%c%c%c» s’interpreta com la seqüència de 2 octets «\\0%c%c», «%c»" + + # que coi significa `cotejar'??? + #: src/tr.c:681 +@@ -9514,18 +9051,15 @@ + + #: src/tr.c:1423 + msgid "the [c*] repeat construct may not appear in string1" +-msgstr "" +-"la construcció de repetició «[c*]» no pot aparèixer en la primera cadena" ++msgstr "la construcció de repetició «[c*]» no pot aparèixer a la primera cadena" + + #: src/tr.c:1433 + msgid "only one [c*] repeat construct may appear in string2" +-msgstr "" +-"només pot aparèixer una construcció de repetició «[c*]» en la segona cadena" ++msgstr "només pot aparèixer una construcció de repetició «[c*]» a la segona cadena" + + #: src/tr.c:1441 + msgid "[=c=] expressions may not appear in string2 when translating" +-msgstr "" +-"en traduir, les expressions «[=c=]» no poden aparèixer en la segona cadena" ++msgstr "en traduir, les expressions «[=c=]» no poden aparèixer a la segona cadena" + + #: src/tr.c:1454 + msgid "when not truncating set1, string2 must be non-empty" +@@ -9535,22 +9069,17 @@ + msgid "" + "when translating with complemented character classes,\n" + "string2 must map all characters in the domain to one" +-msgstr "" +-"en traduir amb classes de caràcters complementàries, la segona cadena ha " +-"d’assignar tots els caràcters del domini a un de sol" ++msgstr "en traduir amb classes de caràcters complementàries, la segona cadena ha d’assignar tots els caràcters del domini a un de sol" + + #: src/tr.c:1470 + msgid "" + "when translating, the only character classes that may appear in\n" + "string2 are `upper' and `lower'" +-msgstr "" +-"en traduir, les úniques classes de caràcters que poden aparèixer en la " +-"segona cadena són «upper» i «lower»" ++msgstr "en traduir, les úniques classes de caràcters que poden aparèixer a la segona cadena són «upper» i «lower»" + + #: src/tr.c:1479 + msgid "the [c*] construct may appear in string2 only when translating" +-msgstr "" +-"en traduir, la construcció «[c*]» només pot aparèxier en la segona cadena" ++msgstr "en traduir, la construcció «[c*]» només pot aparèxier a la segona cadena" + + # Açò s'imprimeix després d'un missatge d'error. ivb + #: src/tr.c:1731 +@@ -9560,8 +9089,7 @@ + # Açò s'imprimeix després d'un missatge d'error. ivb + #: src/tr.c:1741 + msgid "Only one string may be given when deleting without squeezing repeats." +-msgstr "" +-"En eliminar sense reduir repeticions, només es pot especificar una cadena." ++msgstr "En eliminar sense reduir repeticions, només es pot especificar una cadena." + + #: src/tr.c:1844 + msgid "misaligned [:upper:] and/or [:lower:] construct" +@@ -9596,10 +9124,8 @@ + "\n" + msgstr "" + "Forma d’ús: %s [OPCIÓ] [FITXER]\n" +-"Escriu una llista totalment ordenada d’acord amb l’ordenació parcial " +-"descrita\n" +-"en FITXER. Sense FITXER, o quan FITXER és «-», llegeix l’entrada " +-"estàndard.\n" ++"Escriu una llista totalment ordenada d’acord amb l’ordenació parcial descrita\n" ++"en FITXER. Sense FITXER, o quan FITXER és «-», llegeix l’entrada estàndard.\n" + "\n" + + #: src/tsort.c:474 +@@ -9645,11 +9171,10 @@ + "Mostra alguna informació sobre el sistema. Si no s’indica cap OPCIÓ, fa el\n" + "mateix que amb «-s».\n" + "\n" +-" -a, --all Mostra tota la informació (excepte la de «-p» i «-i» " +-"si\n" ++" -a, --all Mostra tota la informació (excepte la de «-p» i «-i» si\n" + " és desconeguda), en l’ordre següent:\n" + " -s, --kernel-name Mostra el nom del nucli.\n" +-" -n, --nodename Mostra el nom de l’estació en la xarxa.\n" ++" -n, --nodename Mostra el nom de l’estació a la xarxa.\n" + " -r, --kernel-release Mostra el llançament del nucli.\n" + + # FIXME: “unknown” in ``uname.c`` lacks i18n. ivb +@@ -9681,8 +9206,7 @@ + "With no FILE, or when FILE is -, read standard input.\n" + "\n" + msgstr "" +-"Converteix els espais en blanc a tabulacions per cada FITXER, i escriu en " +-"la\n" ++"Converteix els espais en blanc a tabulacions per cada FITXER, i escriu a la\n" + "sortida estàndard. Sense FITXER, o quan FITXER és «-», llegeix l’entrada\n" + "estàndard.\n" + "\n" +@@ -9695,17 +9219,13 @@ + " -t, --tabs=N have tabs N characters apart instead of 8 (enables -a)\n" + " -t, --tabs=LIST use comma separated LIST of tab positions (enables -a)\n" + msgstr "" +-" -a, --all Converteix tots els espais en blanc, no només els " +-"que\n" ++" -a, --all Converteix tots els espais en blanc, no només els que\n" + " es troben a principi de línia.\n" +-" --first-only Només converteix les seqüències d’espais en blanc " +-"que\n" ++" --first-only Només converteix les seqüències d’espais en blanc que\n" + " es troben a principi de la línia (inhabilita «-a»).\n" +-" -t, --tabs=NÚMERO Tabula a una distància de NÚMERO caràcters, en lloc " +-"de\n" ++" -t, --tabs=NÚMERO Tabula a una distància de NÚMERO caràcters, en lloc de\n" + " 8 (habilita «-a»).\n" +-" -t, --tabs=LLISTA Especifica una llista de posicions explícites per " +-"cada\n" ++" -t, --tabs=LLISTA Especifica una llista de posicions explícites per cada\n" + " tabulació, separades per comes (habilita «-a»).\n" + + #: src/unexpand.c:161 +@@ -9728,9 +9248,8 @@ + "standard input), writing to OUTPUT (or standard output).\n" + "\n" + msgstr "" +-"Descarta totes tret d’una de successives línies idèntiques de l’ENTRADA (o " +-"de\n" +-"l’entrada estàndard) i escriu en la SORTIDA (o en la sortida estàndard).\n" ++"Descarta totes tret d’una de successives línies idèntiques de l’ENTRADA (o de\n" ++"l’entrada estàndard) i escriu a la SORTIDA (o a la sortida estàndard).\n" + "\n" + + #: src/uniq.c:147 +@@ -9754,8 +9273,7 @@ + " -D, --all-repeated[=MÈTODE_DELIMITACIÓ]\n" + " Escriu totes les línies duplicades, delimitant els\n" + " grups segons el MÈTODE: «none» (per defecte) no els\n" +-" separa; «prepend» els prefixa i «separate» els " +-"separa\n" ++" separa; «prepend» els prefixa i «separate» els separa\n" + " amb una línia buida.\n" + " -f, --skip-fields=N Evita la comparació dels primers N camps.\n" + " -i, --ignore-case No té en compte les diferències entre majúscules i\n" +@@ -9765,7 +9283,7 @@ + + #: src/uniq.c:160 + msgid " -w, --check-chars=N compare no more than N characters in lines\n" +-msgstr " -w, --check-chars=N No compara més de N caràcters per línia.\n" ++msgstr " -w, --check-chars=N No compara més d’N caràcters per línia.\n" + + # Hau! ivb + #: src/uniq.c:165 +@@ -9776,9 +9294,8 @@ + msgstr "" + "\n" + "Un camp és una sèrie d’espais en blanc, seguit de caràcters no en blanc.\n" +-"En usar «--skip-fields» i «--skip-chars», primer es salten els camps i " +-"després\n" +-"els caràcters.\n" ++"En emprar «--skip-fields» i «--skip-chars», primer es salten els camps i\n" ++"després els caràcters.\n" + + #: src/uniq.c:341 + msgid "too many repeated lines" +@@ -9798,8 +9315,7 @@ + + #: src/uniq.c:536 + msgid "printing all duplicated lines and repeat counts is meaningless" +-msgstr "" +-"escriure totes les línies duplicades i el nombre de repeticions és absurd" ++msgstr "escriure totes les línies duplicades i el nombre de repeticions és absurd" + + #: src/unlink.c:51 + #, c-format +@@ -9826,7 +9342,7 @@ + + #: src/uptime.c:109 + msgid "couldn't get boot time" +-msgstr "no s’ha pogut obtenir l’hora d’arrancada" ++msgstr "no s’ha pogut obtenir l’hora d’arrencada" + + #: src/uptime.c:117 + #, c-format +@@ -9888,10 +9404,9 @@ + "\n" + msgstr "" + "Mostra l’hora actual, quant temps ha estat el sistema en marxa, el nombre\n" +-"d’usuaris en el sistema i la mitjana de treballs en la cua d’execució " +-"durant\n" +-"els últims 1, 5 i 15 minuts. Si no s’indica el FITXER, s’usa «%s».\n" +-"És comú usar «%s» com a FITXER.\n" ++"d’usuaris en el sistema i la mitjana de treballs a la cua d’execució durant\n" ++"els darrers 1, 5 i 15 minuts. Si no s’indica el FITXER, s’empra «%s».\n" ++"És comú emprar «%s» com a FITXER.\n" + "\n" + + # No usa quote() en cap dels dos args. ivb +@@ -9902,9 +9417,8 @@ + "If FILE is not specified, use %s. %s as FILE is common.\n" + "\n" + msgstr "" +-"Mostra qui està connectat actualment, d’acord amb el contingut del FITXER. " +-"Si\n" +-"no s’indica el FITXER, s’usa «%s». És comú usar «%s»\n" ++"Mostra qui està connectat actualment, d’acord amb el contingut del FITXER. Si\n" ++"no s’indica el FITXER, s’empra «%s». És comú emprar «%s»\n" + "com a FITXER.\n" + "\n" + +@@ -9919,10 +9433,8 @@ + " -m, --chars print the character counts\n" + " -l, --lines print the newline counts\n" + msgstr "" +-"Escriu el nombre de caràcters de nova línia, paraules i octets de cada " +-"FITXER,\n" +-"i una línia de totals si especifiqueu més d’un FITXER. Sense FITXER, o " +-"quan\n" ++"Escriu el nombre de caràcters de nova línia, paraules i octets de cada FITXER,\n" ++"i una línia de totals si especifiqueu més d’un FITXER. Sense FITXER, o quan\n" + "FITXER és «-», llegeix l’entrada estàndard.\n" + "\n" + " -c, --bytes Escriu el nombre d’octets.\n" +@@ -9972,7 +9484,7 @@ + # Últim nivell d'execució. ivb + #: src/who.c:515 src/who.c:516 + msgid "last=" +-msgstr "últim=" ++msgstr "darrer=" + + #: src/who.c:547 + #, c-format +@@ -10032,7 +9544,7 @@ + msgstr "" + "\n" + " -a, --all Equival a «-b -d --login -p -r -t -T -u».\n" +-" -b, --boot Moment de l’última arrencada del sistema.\n" ++" -b, --boot Moment de la darrera arrencada del sistema.\n" + " -d, --dead Mostra els processos morts.\n" + " -H, --heading Mostra una línia de capçaleres de columna.\n" + +@@ -10058,12 +9570,10 @@ + " -s, --short print only name, line, and time (default)\n" + " -t, --time print last system clock change\n" + msgstr "" +-" -q, --count Mostra els noms i el nombre total d’usuàries i " +-"usuaris\n" +-" connectats.\n" ++" -q, --count Mostra els noms i el nombre total d’usuaris connectats.\n" + " -r, --runlevel Mostra el nivell d’execució actual.\n" + " -s, --short Només mostra el nom, línia i hora (per defecte).\n" +-" -t, --time Mostra el moment de l’últim canvi del rellotge del\n" ++" -t, --time Mostra el moment del darrer canvi del rellotge del\n" + " sistema.\n" + + #: src/who.c:657 +@@ -10073,10 +9583,9 @@ + " --message same as -T\n" + " --writable same as -T\n" + msgstr "" +-" -T, -w, --mesg Inclou l’estat de missatges dels usuaris com a «+», " +-"«-»\n" ++" -T, -w, --mesg Inclou l’estat de missatges dels usuaris com a «+», «-»\n" + " o «?».\n" +-" -u, --users Llista les usuàries i usuaris connectats.\n" ++" -u, --users Llista els usuaris connectats.\n" + " --message Equival a «-T».\n" + " --writable Equival a «-T».\n" + +@@ -10089,13 +9598,13 @@ + "If ARG1 ARG2 given, -m presumed: `am i' or `mom likes' are usual.\n" + msgstr "" + "\n" +-"Si no s’indica el FITXER, s’usa «%s». És comú usar «%s»\n" +-"com a FITXER. Si s’especifiquen ARG1 i ARG2, és com usar «-m»: és habitual\n" +-"usar «am i» o «és genial».\n" ++"Si no s’indica el FITXER, s’empra «%s». És comú emprar «%s»\n" ++"com a FITXER. Si s’especifiquen ARG1 i ARG2, és com emprar «-m»: és habitual\n" ++"emprar «am i» o «és genial».\n" + + #: src/who.c:765 + msgid "Warning: -i will be removed in a future release; use -u instead" +-msgstr "avís: s’eliminarà «-i» en una versió futura; useu «-u» en el seu lloc" ++msgstr "avís: s’eliminarà «-i» en una versió futura; useu «-u» al seu lloc" + + #: src/whoami.c:51 + msgid "" +@@ -10128,7 +9637,3 @@ + msgstr "" + "Mostra repetidament una línia amb totes les cadenes indicades, o «y».\n" + "\n" +- +-# Usa quote(). ivb +-#~ msgid "cannot overwrite directory %s" +-#~ msgstr "no es pot sobreescriure el directori %s" --- coreutils-5.97.orig/debian/patches/99_cu_futimens.patch +++ coreutils-5.97/debian/patches/99_cu_futimens.patch @@ -0,0 +1,56 @@ +--- coreutils-5.97.orig/lib/utimens.c 2006-06-11 09:14:31.000000000 +0200 ++++ coreutils-5.97/lib/utimens.c 2007-07-17 00:41:08.000000000 +0200 +@@ -75,7 +75,7 @@ + Return 0 on success, -1 (setting errno) on failure. */ + + int +-futimens (int fd ATTRIBUTE_UNUSED, ++cu_futimens (int fd ATTRIBUTE_UNUSED, + char const *file, struct timespec const timespec[2]) + { + /* There's currently no interface to set file timestamps with +@@ -168,5 +168,5 @@ + int + utimens (char const *file, struct timespec const timespec[2]) + { +- return futimens (-1, file, timespec); ++ return cu_futimens (-1, file, timespec); + } +--- coreutils-5.97.orig/lib/utimens.h 2004-11-23 21:41:51.000000000 +0100 ++++ coreutils-5.97/lib/utimens.h 2007-07-17 00:41:31.000000000 +0200 +@@ -1,3 +1,3 @@ + #include "timespec.h" +-int futimens (int, char const *, struct timespec const [2]); ++int cu_futimens (int, char const *, struct timespec const [2]); + int utimens (char const *, struct timespec const [2]); +--- coreutils-5.97.orig/src/copy.c 2007-07-16 23:18:42.000000000 +0200 ++++ coreutils-5.97/src/copy.c 2007-07-17 00:43:10.000000000 +0200 +@@ -429,7 +429,7 @@ + timespec[0] = get_stat_atime (src_sb); + timespec[1] = get_stat_mtime (src_sb); + +- if (futimens (dest_desc, dst_name, timespec) != 0) ++ if (cu_futimens (dest_desc, dst_name, timespec) != 0) + { + error (0, errno, _("preserving times for %s"), quote (dst_name)); + if (x->require_preserve) +--- coreutils-5.97.orig/src/touch.c 2005-11-02 11:01:07.000000000 +0100 ++++ coreutils-5.97/src/touch.c 2007-07-17 00:43:51.000000000 +0200 +@@ -167,7 +167,7 @@ + + if (amtime_now) + { +- /* Pass NULL to futimens so it will not fail if we have ++ /* Pass NULL to cu_futimens so it will not fail if we have + write access to the file, but don't own it. */ + t = NULL; + } +@@ -182,7 +182,7 @@ + t = timespec; + } + +- ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0); ++ ok = (cu_futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0); + + if (fd == STDIN_FILENO) + { --- coreutils-5.97.orig/debian/patches/54_coreutils-acl.patch +++ coreutils-5.97/debian/patches/54_coreutils-acl.patch @@ -0,0 +1,983 @@ +--- /dev/null 2005-10-10 09:36:06.437701000 +0100 ++++ coreutils-5.97/m4/posix_acl.m4 2005-10-27 11:44:29.000000000 +0100 +@@ -0,0 +1,28 @@ ++#serial 1 ++ ++dnl Written by Andreas Gruenbacher . ++ ++dnl Posix 1003.1e draft standard 17 (abandoned) and similar ++dnl access control list support ++AC_DEFUN([ag_POSIX_ACL], ++[ ++ AC_CHECK_HEADERS(sys/acl.h) ++ AC_CHECK_LIB(acl, main, cu_cv_lacl=yes, cu_cv_lacl=no) ++ if test "$cu_cv_lacl" = yes; then ++ LIBACL=-lacl ++ else ++ LIBACL= ++ fi ++ AC_SUBST(LIBACL) ++ OLDLIBS="$LIBS" ++ LIBS="$LIBS $LIBACL" ++ AC_CHECK_FUNCS(acl_get_file acl_set_file acl_free acl_to_text \ ++ acl_from_text acl_delete_def_file) ++ # Linux specific extensions: ++ AC_CHECK_FUNCS(acl_entries acl_extended_file) ++ LIBS="$OLDLIBS" ++ ++ if test $ac_cv_header_sys_acl_h = yes; then ++ AC_DEFINE(USE_ACL, 1, [Define if you want access control list support.]) ++ fi ++]) +--- coreutils-5.93/lib/acl.h.acl 2005-05-14 08:58:06.000000000 +0100 ++++ coreutils-5.97/lib/acl.h 2005-10-27 11:44:29.000000000 +0100 +@@ -18,11 +18,16 @@ + + Written by Paul Eggert. */ + +-#if HAVE_SYS_ACL_H && HAVE_ACL ++#if HAVE_SYS_ACL_H + # include + #endif ++#if HAVE_SYS_TYPES_H ++# include ++#endif + #if ! defined GETACLCNT && defined ACL_CNT + # define GETACLCNT ACL_CNT + #endif + + int file_has_acl (char const *, struct stat const *); ++int copy_acl (char const *, char const *, mode_t); ++int set_acl (char const *, mode_t); +--- coreutils-5.93/lib/acl.c.acl 2005-09-22 07:47:18.000000000 +0100 ++++ coreutils-5.97/lib/acl.c 2005-10-27 11:44:29.000000000 +0100 +@@ -22,18 +22,30 @@ + # include + #endif + ++#if ENABLE_NLS ++# include ++# define _(Text) gettext (Text) ++#else ++# define _(Text) Text ++#endif ++ + #include + #include + #ifndef S_ISLNK + # define S_ISLNK(Mode) 0 + #endif + ++#include ++ + #include "acl.h" + + #include + #ifndef ENOSYS + # define ENOSYS (-1) + #endif ++#ifndef ENOTSUP ++# define ENOTSUP (-1) ++#endif + + #ifndef MIN_ACL_ENTRIES + # define MIN_ACL_ENTRIES 4 +@@ -45,19 +57,201 @@ + int + file_has_acl (char const *file, struct stat const *filestat) + { +- /* FIXME: This implementation should work on recent-enough versions +- of HP-UX, Solaris, and Unixware, but it simply returns 0 with +- POSIX 1003.1e (draft 17 -- abandoned), AIX, GNU/Linux, Irix, and +- Tru64. Please see Samba's source/lib/sysacls.c file for +- fix-related ideas. */ +- + #if HAVE_ACL && defined GETACLCNT ++ /* This implementation should work on recent-enough versions of HP-UX, ++ Solaris, and Unixware. */ ++ + if (! S_ISLNK (filestat->st_mode)) + { + int n = acl (file, GETACLCNT, 0, NULL); + return n < 0 ? (errno == ENOSYS ? 0 : -1) : (MIN_ACL_ENTRIES < n); + } ++#elif HAVE_ACL_EXTENDED_FILE ++ ++ /* Linux specific. */ ++ ++ if (! S_ISLNK (filestat->st_mode)) ++ { ++ int ret = acl_extended_file (file); ++ if (ret < 0) ++ return (errno == ENOSYS || errno == ENOTSUP) ? 0 : -1; ++ return ret; ++ } ++#else ++ /* FIXME: Add support for AIX, Irix, and Tru64, FreeBSD, etc. ++ Please see Samba's source/lib/sysacls.c file for fix-related ideas. */ + #endif + + return 0; + } ++ ++/* Copy the permissions from SRC_PATH to DST_PATH, including access control ++ lists on systems where this is supported. MODE is the file mode for ++ DST_PATH, including the file type. ++ Also sets special bits in MODE on DST_PATH. */ ++ ++int ++copy_acl (char const *src_path, char const *dst_path, mode_t mode) ++{ ++#if HAVE_ACL_GET_FILE && HAVE_ACL_SET_FILE && HAVE_ACL_FREE && \ ++ HAVE_ACL_ENTRIES ++ ++ /* Linux specific. Will work on all POSIX 1003.1e draft 17 (abandoned) ++ compliant systems if the acl_entries() function is implemented. */ ++ ++ acl_t acl = acl_get_file (src_path, ACL_TYPE_ACCESS); ++ if (acl == NULL) ++ { ++ if (errno == ENOSYS || errno == ENOTSUP) ++ return set_acl (dst_path, mode); ++ else ++ { ++ error (0, errno, "%s", quote (src_path)); ++ return -1; ++ } ++ } ++ ++ if (acl_set_file (dst_path, ACL_TYPE_ACCESS, acl)) ++ { ++ int saved_errno = errno; ++ ++ if (errno == ENOSYS || errno == ENOTSUP) ++ { ++ int n = acl_entries (acl); ++ ++ acl_free (acl); ++ if (n == 3) ++ { ++ if (chmod (dst_path, mode)) ++ saved_errno = errno; ++ else ++ return 0; ++ } ++ else ++ chmod (dst_path, mode); ++ } ++ else ++ { ++ acl_free (acl); ++ chmod (dst_path, mode); ++ } ++ error (0, saved_errno, _("preserving permissions for %s"), ++ quote (dst_path)); ++ return -1; ++ } ++ acl_free (acl); ++ ++ if (mode & (S_ISUID | S_ISGID | S_ISVTX)) ++ { ++ /* We did not call chmod so far, so the special bits have not yet ++ been set. */ ++ ++ if (chmod (dst_path, mode)) ++ { ++ error (0, errno, _("preserving permissions for %s"), ++ quote (dst_path)); ++ return -1; ++ } ++ } ++ ++ if (S_ISDIR (mode)) ++ { ++ acl = acl_get_file (src_path, ACL_TYPE_DEFAULT); ++ if (acl == NULL) ++ { ++ error (0, errno, "%s", quote (src_path)); ++ return -1; ++ } ++ ++ if (acl_set_file (dst_path, ACL_TYPE_DEFAULT, acl)) ++ { ++ error (0, errno, _("preserving permissions for %s"), ++ quote (dst_path)); ++ acl_free(acl); ++ return -1; ++ } ++ else ++ acl_free(acl); ++ } ++ return 0; ++#else ++ int ret = chmod (dst_path, mode); ++ if (ret) ++ error (0, errno, _("preserving permissions for %s"), quote (dst_path)); ++ return ret; ++#endif ++} ++ ++/* Set the permissions of PATH, overwriting access control lists, on systems ++ where this is supported. MODE is the file mode for PATH, including the ++ file type. Also sets special bits in MODE on PATH. */ ++ ++int ++set_acl (char const *path, mode_t mode) ++{ ++#if HAVE_ACL_FROM_TEXT && HAVE_ACL_SET_FILE && HAVE_ACL_FREE && \ ++ HAVE_ACL_DELETE_DEF_FILE ++ char acl_text[] = "u::---,g::---,o::---"; ++ acl_t acl; ++ ++ if (mode & S_IRUSR) acl_text[ 3] = 'r'; ++ if (mode & S_IWUSR) acl_text[ 4] = 'w'; ++ if (mode & S_IXUSR) acl_text[ 5] = 'x'; ++ if (mode & S_IRGRP) acl_text[10] = 'r'; ++ if (mode & S_IWGRP) acl_text[11] = 'w'; ++ if (mode & S_IXGRP) acl_text[12] = 'x'; ++ if (mode & S_IROTH) acl_text[17] = 'r'; ++ if (mode & S_IWOTH) acl_text[18] = 'w'; ++ if (mode & S_IXOTH) acl_text[19] = 'x'; ++ ++ acl = acl_from_text(acl_text); ++ if (!acl) ++ { ++ error (0, errno, "%s", quote (path)); ++ return -1; ++ } ++ ++ if (acl_set_file(path, ACL_TYPE_ACCESS, acl)) ++ { ++ int saved_errno = errno; ++ acl_free (acl); ++ ++ if (errno == ENOTSUP || errno == ENOSYS) ++ { ++ if (chmod (path, mode)) ++ saved_errno = errno; ++ else ++ return 0; ++ } ++ error (0, saved_errno, _("setting permissions for %s"), quote (path)); ++ return -1; ++ } ++ acl_free (acl); ++ ++ if (mode & (S_ISUID | S_ISGID | S_ISVTX)) ++ { ++ /* We did not call chmod so far, so the special bits have not yet ++ been set. */ ++ ++ if (chmod (path, mode)) ++ { ++ error (0, errno, _("preserving permissions for %s"), ++ quote (path)); ++ return -1; ++ } ++ } ++ ++ if (S_ISDIR (mode) && acl_delete_def_file (path)) ++ { ++ error (0, errno, _("setting permissions for %s"), quote (path)); ++ return -1; ++ } ++ return 0; ++#else ++ int ret = chmod (path, mode); ++ if (ret) ++ error (0, errno, _("setting permissions for %s"), quote (path)); ++ return ret; ++#endif ++} ++ +--- coreutils-5.93/src/mv.c.acl 2005-07-03 17:55:19.000000000 +0100 ++++ coreutils-5.97/src/mv.c 2005-10-27 11:44:29.000000000 +0100 +@@ -135,12 +135,6 @@ + x->mode = 0; + x->stdin_tty = isatty (STDIN_FILENO); + +- /* Find out the current file creation mask, to knock the right bits +- when using chmod. The creation mask is set to be liberal, so +- that created directories can be written, even if it would not +- have been allowed with the mask this process was started with. */ +- x->umask_kill = ~ umask (0); +- + x->update = false; + x->verbose = false; + x->dest_info = NULL; +--- coreutils-5.93/src/ls.c.acl 2005-10-27 11:44:29.000000000 +0100 ++++ coreutils-5.97/src/ls.c 2005-10-27 11:44:29.000000000 +0100 +@@ -193,13 +193,13 @@ + + enum filetype filetype; + +-#if HAVE_ACL ++#if HAVE_ACL || USE_ACL + /* For long listings, true if the file has an access control list. */ + bool have_acl; + #endif + }; + +-#if HAVE_ACL ++#if HAVE_ACL || USE_ACL + # define FILE_HAS_ACL(F) ((F)->have_acl) + #else + # define FILE_HAS_ACL(F) 0 +@@ -334,7 +334,7 @@ + /* Whether any of the files has an ACL. This affects the width of the + mode column. */ + +-#if HAVE_ACL ++#if HAVE_ACL || USE_ACL + static bool any_has_acl; + #else + enum { any_has_acl = false }; +@@ -2582,7 +2582,7 @@ + return 0; + } + +-#if HAVE_ACL ++#if HAVE_ACL || USE_ACL + if (format == long_format) + { + int n = file_has_acl (absolute_name, &f->stat); +--- coreutils-5.93/src/install.c.acl 2005-09-23 21:58:37.000000000 +0100 ++++ coreutils-5.97/src/install.c 2005-10-27 11:44:29.000000000 +0100 +@@ -153,7 +153,6 @@ + x->mode = S_IRUSR | S_IWUSR; + x->stdin_tty = false; + +- x->umask_kill = 0; + x->update = false; + x->verbose = false; + x->dest_info = NULL; +--- coreutils-5.93/src/cp.c.acl 2005-09-16 08:51:01.000000000 +0100 ++++ coreutils-5.97/src/cp.c 2005-10-27 11:44:29.000000000 +0100 +@@ -56,7 +56,8 @@ + need to be fixed after copying. */ + struct dir_attr + { +- bool is_new_dir; ++ int mode_valid; ++ mode_t mode; + size_t slash_offset; + struct dir_attr *next; + }; +@@ -327,9 +328,14 @@ + } + } + +- if (x->preserve_mode | p->is_new_dir) +- { +- if (chmod (dst_name, src_sb.st_mode & x->umask_kill)) ++ if (x->preserve_mode) ++ { ++ if (copy_acl (src_name, dst_name, src_sb.st_mode)) ++ return 1; ++ } ++ else if (p->mode_valid) ++ { ++ if (chmod (dst_name, p->mode)) + { + error (0, errno, _("failed to preserve permissions for %s"), + quote (dst_name)); +@@ -347,8 +353,7 @@ + + SRC_OFFSET is the index in CONST_DIR (which is a destination + directory) of the beginning of the source directory name. +- Create any leading directories that don't already exist, +- giving them permissions MODE. ++ Create any leading directories that don't already exist. + If VERBOSE_FMT_STRING is nonzero, use it as a printf format + string for printing a message after successfully making a directory. + The format should take two string arguments: the names of the +@@ -364,15 +369,20 @@ + + static bool + make_dir_parents_private (char const *const_dir, size_t src_offset, +- mode_t mode, char const *verbose_fmt_string, ++ char const *verbose_fmt_string, + struct dir_attr **attr_list, bool *new_dst, +- int (*xstat) ()) ++ const struct cp_options *x) + { + struct stat stats; + char *dir; /* A copy of CONST_DIR we can change. */ + char *src; /* Source name in DIR. */ + char *dst_dir; /* Leading directory of DIR. */ + size_t dirlen; /* Length of DIR. */ ++ mode_t mode; ++ int (*xstat)() = (x->dereference == DEREF_COMMAND_LINE_ARGUMENTS ++ || x->dereference == DEREF_ALWAYS ++ ? stat ++ : lstat); + + ASSIGN_STRDUPA (dir, const_dir); + +@@ -407,12 +417,20 @@ + if ((*xstat) (dir, &stats)) + { + /* This component does not exist. We must set +- *new_dst and new->is_new_dir inside this loop because, ++ *new_dst inside this loop because, + for example, in the command `cp --parents ../a/../b/c e_dir', + make_dir_parents_private creates only e_dir/../a if + ./b already exists. */ + *new_dst = true; +- new->is_new_dir = true; ++ ++ if ((*xstat) (src, &stats)) ++ { ++ error (0, errno, _("failed to get attributes of %s"), ++ quote (src)); ++ return 1; ++ } ++ mode = stats.st_mode; ++ + if (mkdir (dir, mode)) + { + error (0, errno, _("cannot make directory %s"), +@@ -424,6 +442,46 @@ + if (verbose_fmt_string != NULL) + printf (verbose_fmt_string, src, dir); + } ++ ++ /* We need search and write permissions to the new directory ++ for adding the directory's contents. Check if these ++ permissions are already there. */ ++ ++ if (lstat (dir, &stats)) ++ { ++ error (0, errno, _("failed to get attributes of %s"), ++ quote (dir)); ++ return 1; ++ } ++ else ++ { ++ if (x->preserve_mode && mode != stats.st_mode) ++ { ++ new->mode = mode; ++ new->mode_valid = 1; ++ } ++ else ++ new->mode_valid = 0; ++ ++ if ((stats.st_mode & S_IRWXU) != S_IRWXU) ++ { ++ /* Make the new directory writable and searchable. The ++ original permissions will be restored later. */ ++ ++ if (!new->mode_valid) ++ { ++ new->mode = stats.st_mode; ++ new->mode_valid = 1; ++ } ++ ++ if (chmod (dir, stats.st_mode | S_IRWXU)) ++ { ++ error (0, errno, _("setting permissions for %s"), ++ quote (dir)); ++ return 1; ++ } ++ } ++ } + } + else if (!S_ISDIR (stats.st_mode)) + { +@@ -433,7 +491,7 @@ + } + else + { +- new->is_new_dir = false; ++ new->mode_valid = false; + *new_dst = false; + } + *slash++ = '/'; +@@ -536,10 +594,6 @@ + Copy the files `file1' through `filen' + to the existing directory `edir'. */ + int i; +- int (*xstat)() = (x->dereference == DEREF_COMMAND_LINE_ARGUMENTS +- || x->dereference == DEREF_ALWAYS +- ? stat +- : lstat); + + /* Initialize these hash tables only if we'll need them. + The problems they're used to detect can arise only if +@@ -585,9 +639,9 @@ + leading directories. */ + parent_exists = + (make_dir_parents_private +- (dst_name, arg_in_concat - dst_name, S_IRWXU, ++ (dst_name, arg_in_concat - dst_name, + (x->verbose ? "%s -> %s\n" : NULL), +- &attr_list, &new_dst, xstat)); ++ &attr_list, &new_dst, x)); + } + else + { +@@ -697,12 +751,6 @@ + /* Not used. */ + x->stdin_tty = false; + +- /* Find out the current file creation mask, to knock the right bits +- when using chmod. The creation mask is set to be liberal, so +- that created directories can be written, even if it would not +- have been allowed with the mask this process was started with. */ +- x->umask_kill = ~ umask (0); +- + x->update = false; + x->verbose = false; + x->dest_info = NULL; +@@ -987,9 +1035,6 @@ + version_control_string) + : no_backups); + +- if (x.preserve_mode) +- x.umask_kill = ~ (mode_t) 0; +- + if (x.dereference == DEREF_UNDEFINED) + { + if (x.recursive) +--- coreutils-5.93/src/copy.h.acl 2005-07-03 10:45:51.000000000 +0100 ++++ coreutils-5.97/src/copy.h 2005-10-27 11:44:29.000000000 +0100 +@@ -165,9 +165,6 @@ + Create destination directories as usual. */ + bool symbolic_link; + +- /* The bits to preserve in created files' modes. */ +- mode_t umask_kill; +- + /* If true, do not copy a nondirectory that has an existing destination + with the same or newer modification time. */ + bool update; +--- coreutils-5.93/src/copy.c.acl 2005-09-25 06:57:47.000000000 +0100 ++++ coreutils-5.97/src/copy.c 2005-10-27 11:57:41.000000000 +0100 +@@ -101,26 +101,6 @@ + /* The invocation name of this program. */ + extern char *program_name; + +-/* Encapsulate selection of the file mode to be applied to +- new non-directories. */ +- +-static mode_t +-get_dest_mode (const struct cp_options *option, mode_t mode) +-{ +- /* In some applications (e.g., install), use precisely the +- specified mode. */ +- if (option->set_mode) +- return option->mode; +- +- /* Honor the umask for `cp', but not for `mv' or `cp -p'. +- In addition, `cp' without -p must clear the set-user-ID and set-group-ID +- bits. POSIX requires it do that when creating new files. */ +- if (!option->move_mode && !option->preserve_mode) +- mode &= (option->umask_kill & ~(S_ISUID | S_ISGID)); +- +- return mode; +-} +- + /* FIXME: describe */ + /* FIXME: rewrite this to use a hash table so we avoid the quadratic + performance hit that's probably noticeable only on trees deeper +@@ -460,18 +440,41 @@ + succeeded, because the chown must have reset those bits. */ + if (!(*new_dst + && !(*chown_succeeded && (src_sb->st_mode & ~S_IRWXUGO))) +- && (x->preserve_mode || *new_dst) + && (x->copy_as_regular || S_ISREG (src_sb->st_mode))) + { +- if (fchmod (dest_desc, get_dest_mode (x, src_sb->st_mode)) != 0) ++ if (x->preserve_mode || x->move_mode) ++ { ++ if (copy_acl (src_name, dst_name, src_sb->st_mode)) ++ { ++ error (0, errno, _("preserving ACL for %s"), quote (dst_name)); ++ if (x->set_mode || x->require_preserve) ++ { ++ return_val = false; ++ goto close_src_and_dst_desc; ++ } ++ } ++ } ++ else if (x->set_mode) + { +- error (0, errno, _("setting permissions for %s"), quote (dst_name)); +- if (x->set_mode || x->require_preserve) ++ if (set_acl (dst_name, x->mode)) + { ++ error (0, errno, _("setting ACL for %s"), quote (dst_name)); + return_val = false; + goto close_src_and_dst_desc; + } + } ++ else if (src_sb->st_mode & (S_ISUID | S_ISGID)) ++ { ++ if (fchmod (dest_desc, sb.st_mode | (src_sb->st_mode & (S_ISUID | S_ISGID))) != 0) ++ { ++ error (0, errno, _("setting permissions for %s"), quote (dst_name)); ++ if (x->set_mode || x->require_preserve) ++ { ++ return_val = false; ++ goto close_src_and_dst_desc; ++ } ++ } ++ } + } + #endif + +@@ -908,13 +911,14 @@ + struct stat src_sb; + struct stat dst_sb; + mode_t src_mode; +- mode_t src_type; ++ mode_t dst_mode; + char *earlier_file = NULL; + char *dst_backup = NULL; + bool backup_succeeded = false; + bool delayed_ok; + bool copied_as_regular = false; + bool chown_succeeded = false; ++ bool dst_mode_valid = 0; + bool preserve_metadata; + + if (x->move_mode && rename_succeeded) +@@ -928,11 +932,9 @@ + return false; + } + +- src_type = src_sb.st_mode; +- + src_mode = src_sb.st_mode; + +- if (S_ISDIR (src_type) && !x->recursive) ++ if (S_ISDIR (src_mode) && !x->recursive) + { + error (0, 0, _("omitting directory %s"), quote (src_name)); + return false; +@@ -1001,7 +1003,7 @@ + + if (!S_ISDIR (dst_sb.st_mode)) + { +- if (S_ISDIR (src_type)) ++ if (S_ISDIR (src_mode)) + { + error (0, 0, + _("cannot overwrite non-directory %s with directory %s"), +@@ -1027,7 +1029,7 @@ + } + } + +- if (!S_ISDIR (src_type)) ++ if (!S_ISDIR (src_mode)) + { + if (S_ISDIR (dst_sb.st_mode)) + { +@@ -1067,7 +1069,7 @@ + This may be due to an interactive `negative' reply to the + prompt about the existing file. It may also be due to the + use of the --reply=no option. */ +- if (!S_ISDIR (src_type)) ++ if (!S_ISDIR (src_mode)) + { + /* cp and mv treat -i and -f differently. */ + if (x->move_mode) +@@ -1181,7 +1183,7 @@ + /* If the source is a directory, we don't always create the destination + directory. So --verbose should not announce anything until we're + sure we'll create a directory. */ +- if (x->verbose && !S_ISDIR (src_type)) ++ if (x->verbose && !S_ISDIR (src_mode)) + { + printf ("%s -> %s", quote_n (0, src_name), quote_n (1, dst_name)); + if (backup_succeeded) +@@ -1229,7 +1231,7 @@ + || (command_line_arg + && x->dereference == DEREF_COMMAND_LINE_ARGUMENTS) + || x->dereference == DEREF_ALWAYS)) +- || (x->recursive && S_ISDIR (src_type))) ++ || (x->recursive && S_ISDIR (src_mode))) + { + earlier_file = remember_copied (dst_name, src_sb.st_ino, src_sb.st_dev); + } +@@ -1242,7 +1244,7 @@ + /* Avoid damaging the destination file system by refusing to preserve + hard-linked directories (which are found at least in Netapp snapshot + directories). */ +- if (S_ISDIR (src_type)) ++ if (S_ISDIR (src_mode)) + { + /* If src_name and earlier_file refer to the same directory entry, + then warn about copying a directory into itself. */ +@@ -1292,7 +1294,7 @@ + { + if (rename (src_name, dst_name) == 0) + { +- if (x->verbose && S_ISDIR (src_type)) ++ if (x->verbose && S_ISDIR (src_mode)) + printf ("%s -> %s\n", quote_n (0, src_name), quote_n (1, dst_name)); + if (rename_succeeded) + *rename_succeeded = true; +@@ -1405,7 +1407,7 @@ + In such cases, set this variable to zero. */ + preserve_metadata = true; + +- if (S_ISDIR (src_type)) ++ if (S_ISDIR (src_mode)) + { + struct dir_list *dir; + +@@ -1430,16 +1432,38 @@ + + if (new_dst || !S_ISDIR (dst_sb.st_mode)) + { +- /* Create the new directory writable and searchable, so +- we can create new entries in it. */ +- +- if (mkdir (dst_name, (src_mode & x->umask_kill) | S_IRWXU) != 0) ++ if (mkdir (dst_name, src_mode) != 0) + { + error (0, errno, _("cannot create directory %s"), + quote (dst_name)); + goto un_backup; + } + ++ /* We need search and write permissions to the new directory ++ for adding the directory's contents. Check if these permissions ++ are already there. */ ++ ++ if (lstat (dst_name, &dst_sb)) ++ { ++ error (0, errno, _("cannot stat %s"), quote (dst_name)); ++ delayed_ok = false; ++ } ++ else if ((dst_sb.st_mode & S_IRWXU) != S_IRWXU) ++ { ++ /* Make the new directory writable and searchable. The original ++ permissions will be restored later. */ ++ ++ dst_mode_valid = 1; ++ dst_mode = dst_sb.st_mode; ++ ++ if (chmod (dst_name, dst_mode | S_IRWXU)) ++ { ++ error (0, errno, _("setting permissions for %s"), ++ quote (dst_name)); ++ goto un_backup; ++ } ++ } ++ + /* Insert the created directory's inode and device + numbers into the search structure, so that we can + avoid copying it again. */ +@@ -1515,23 +1539,24 @@ + goto un_backup; + } + } +- else if (S_ISREG (src_type) +- || (x->copy_as_regular && !S_ISLNK (src_type))) ++ else if (S_ISREG (src_mode) ++ || (x->copy_as_regular && !S_ISDIR (src_mode) ++ && !S_ISLNK (src_mode))) + { + copied_as_regular = true; + /* POSIX says the permission bits of the source file must be + used as the 3rd argument in the open call, but that's not consistent + with historical practice. */ + if (! copy_reg (src_name, dst_name, x, +- get_dest_mode (x, src_mode), &new_dst, &chown_succeeded, ++ src_mode, &new_dst, &chown_succeeded, + &src_sb, &dst_sb)) + goto un_backup; + } + else + #ifdef S_ISFIFO +- if (S_ISFIFO (src_type)) ++ if (S_ISFIFO (src_mode)) + { +- if (mkfifo (dst_name, get_dest_mode (x, src_mode))) ++ if (mkfifo (dst_name, src_mode)) + { + error (0, errno, _("cannot create fifo %s"), quote (dst_name)); + goto un_backup; +@@ -1539,10 +1564,10 @@ + } + else + #endif +- if (S_ISBLK (src_type) || S_ISCHR (src_type) +- || S_ISSOCK (src_type)) ++ if (S_ISBLK (src_mode) || S_ISCHR (src_mode) ++ || S_ISSOCK (src_mode)) + { +- if (mknod (dst_name, get_dest_mode (x, src_mode), src_sb.st_rdev)) ++ if (mknod (dst_name, src_mode, src_sb.st_rdev)) + { + error (0, errno, _("cannot create special file %s"), + quote (dst_name)); +@@ -1551,7 +1576,7 @@ + } + else + #ifdef S_ISLNK +- if (S_ISLNK (src_type)) ++ if (S_ISLNK (src_mode)) + { + char *src_link_val = xreadlink (src_name, src_sb.st_size); + if (src_link_val == NULL) +@@ -1654,6 +1679,25 @@ + if (!(copied_as_regular && HAVE_FCHOWN) && x->preserve_ownership + && (new_dst || !SAME_OWNER_AND_GROUP (src_sb, dst_sb))) + { ++ /* The chown() system call may clear the SUID and SGID bits, so we ++ need to set them again later. (But we don't care if we will ++ overwrite the permissions of the destination file anyway.) */ ++ ++ if ((src_mode & (S_ISUID | S_ISGID)) ++ && !x->preserve_mode && !x->move_mode && !x->set_mode) ++ { ++ if (lstat (dst_name, &dst_sb)) ++ { ++ error (0, errno, _("cannot stat %s"), quote (dst_name)); ++ delayed_ok = false; ++ } ++ else ++ { ++ dst_mode_valid = 1; ++ dst_mode = dst_sb.st_mode; ++ } ++ } ++ + if (chown (dst_name, src_sb.st_uid, src_sb.st_gid) == 0) + chown_succeeded = true; + else if (! chown_failure_ok (x)) +@@ -1682,21 +1726,23 @@ + } + #endif + +- /* Permissions of newly-created regular files are set by open and/or fchmod +- in copy_reg. But don't return early if there were any special bits and +- chown succeeded, because the chown must have reset those bits. */ +- if (copied_as_regular +- && (HAVE_FCHMOD +- || (new_dst && !(chown_succeeded && (src_mode & ~S_IRWXUGO))))) +- return delayed_ok; +- +- if ((x->preserve_mode || new_dst) +- && (x->copy_as_regular || S_ISREG (src_type) || S_ISDIR (src_type))) ++ if (x->preserve_mode || x->move_mode) + { +- if (chmod (dst_name, get_dest_mode (x, src_mode)) != 0) +- { +- error (0, errno, _("setting permissions for %s"), quote (dst_name)); +- if (x->set_mode || x->require_preserve) ++ if (copy_acl (src_name, dst_name, src_mode) && x->require_preserve) ++ return false; ++ } ++ else if (x->set_mode) ++ { ++ if (set_acl (dst_name, x->mode) && x->require_preserve) ++ return false; ++ } ++ else if (dst_mode_valid) ++ { ++ if (chmod (dst_name, dst_mode)) ++ { ++ error (0, errno, _("preserving permissions for %s"), ++ quote (dst_name)); ++ if (x->require_preserve) + return false; + } + } +--- coreutils-5.93/src/Makefile.am.acl 2005-09-29 11:28:37.000000000 +0100 ++++ coreutils-5.97/src/Makefile.am 2005-10-27 11:44:29.000000000 +0100 +@@ -50,9 +50,9 @@ + LDADD = ../lib/libcoreutils.a $(LIBINTL) ../lib/libcoreutils.a + + # for eaccess in lib/euidaccess.c. +-cp_LDADD = $(LDADD) $(LIB_EACCESS) +-ginstall_LDADD = $(LDADD) $(LIB_EACCESS) +-mv_LDADD = $(LDADD) $(LIB_EACCESS) ++cp_LDADD = $(LDADD) $(LIB_EACCESS) @LIBACL@ ++ginstall_LDADD = $(LDADD) $(LIB_EACCESS) @LIBACL@ ++mv_LDADD = $(LDADD) $(LIB_EACCESS) @LIBACL@ + pathchk_LDADD = $(LDADD) $(LIB_EACCESS) + rm_LDADD = $(LDADD) $(LIB_EACCESS) + test_LDADD = $(LDADD) $(LIB_EACCESS) +@@ -61,11 +61,11 @@ + + # for clock_gettime and fdatasync + dd_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC) +-dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) +-ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) ++dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBACL@ ++ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBACL@ + pr_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) + shred_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC) +-vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) ++vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBACL@ + + ## If necessary, add -lm to resolve use of pow in lib/strtod.c. + sort_LDADD = $(LDADD) $(POW_LIB) +--- coreutils-5.93/configure.ac.acl 2005-10-22 19:12:36.000000000 +0100 ++++ coreutils-5.97/configure.ac 2005-10-27 11:44:30.000000000 +0100 +@@ -251,6 +251,8 @@ + AM_GNU_GETTEXT([external], [need-ngettext]) + AM_GNU_GETTEXT_VERSION(0.13.1) + ++ag_POSIX_ACL ++ + AC_CONFIG_FILES( + Makefile + doc/Makefile +--- coreutils-5.93/config.hin.acl 2005-10-22 19:14:08.000000000 +0100 ++++ coreutils-5.97/config.hin 2005-10-27 11:44:30.000000000 +0100 +@@ -101,6 +101,30 @@ + /* Define to 1 if you have the `acl' function. */ + #undef HAVE_ACL + ++/* Define to 1 if you have the `acl_delete_def_file' function. */ ++#undef HAVE_ACL_DELETE_DEF_FILE ++ ++/* Define to 1 if you have the `acl_entries' function. */ ++#undef HAVE_ACL_ENTRIES ++ ++/* Define to 1 if you have the `acl_extended_file' function. */ ++#undef HAVE_ACL_EXTENDED_FILE ++ ++/* Define to 1 if you have the `acl_free' function. */ ++#undef HAVE_ACL_FREE ++ ++/* Define to 1 if you have the `acl_from_text' function. */ ++#undef HAVE_ACL_FROM_TEXT ++ ++/* Define to 1 if you have the `acl_get_file' function. */ ++#undef HAVE_ACL_GET_FILE ++ ++/* Define to 1 if you have the `acl_set_file' function. */ ++#undef HAVE_ACL_SET_FILE ++ ++/* Define to 1 if you have the `acl_to_text' function. */ ++#undef HAVE_ACL_TO_TEXT ++ + /* Define to 1 if you have the `alarm' function. */ + #undef HAVE_ALARM + +@@ -589,6 +613,9 @@ + /* Define to 1 if you have the `lchown' function. */ + #undef HAVE_LCHOWN + ++/* Define to 1 if you have the `acl' library (-lacl). */ ++#undef HAVE_LIBACL ++ + /* Define to 1 if you have the `dgc' library (-ldgc). */ + #undef HAVE_LIBDGC + +@@ -1496,6 +1523,9 @@ + safe for multithreaded apps. */ + #undef USE_UNLOCKED_IO + ++/* Define if you want access control list support. */ ++#undef USE_ACL ++ + /* Version number of package */ + #undef VERSION + --- coreutils-5.97.orig/debian/patches/56_ignorecifs +++ coreutils-5.97/debian/patches/56_ignorecifs @@ -0,0 +1,12 @@ +--- coreutils-5.93/lib/mountlist.c.orig 2005-11-12 20:38:33.905164421 -0500 ++++ coreutils-5.97/lib/mountlist.c 2005-11-12 20:41:31.828999253 -0500 +@@ -155,7 +155,8 @@ + (strchr (Fs_name, ':') != 0 \ + || ((Fs_name)[0] == '/' \ + && (Fs_name)[1] == '/' \ +- && strcmp (Fs_type, "smbfs") == 0)) ++ && ( strcmp (Fs_type, "smbfs") == 0 || \ ++ strcmp (Fs_type, "cifs") == 0 ) ) ) + #endif + + #if MOUNTED_GETMNTINFO --- coreutils-5.97.orig/debian/patches/62_remove-segfault +++ coreutils-5.97/debian/patches/62_remove-segfault @@ -0,0 +1,27 @@ +diff -u -p -r1.132.2.2 remove.c +--- coreutils-5.97/src/remove.c 6 May 2006 21:12:06 -0000 1.132.2.2 ++++ coreutils-5.97/src/remove.c 25 Jun 2006 19:23:35 -0000 +@@ -1,5 +1,5 @@ + /* remove.c -- core functions for removing files and directories +- Copyright (C) 88, 90, 91, 1994-2005 Free Software Foundation, Inc. ++ Copyright (C) 88, 90, 91, 1994-2006 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 +@@ -881,12 +881,9 @@ remove_cwd_entries (Dirstack_state *ds, + + if (dirp == NULL) + { +- if (errno != ENOENT || !x->ignore_missing_files) +- { +- error (0, errno, _("cannot open directory %s"), +- quote (full_filename ("."))); +- return RM_ERROR; +- } ++ error (0, errno, _("cannot open directory %s"), ++ quote (full_filename ("."))); ++ return RM_ERROR; + } + + while (1) + --- coreutils-5.97.orig/debian/patches/55_coreutils-selinux.patch +++ coreutils-5.97/debian/patches/55_coreutils-selinux.patch @@ -0,0 +1,2942 @@ +diff -ruN coreutils-5.97-old/config.hin coreutils-5.97/config.hin +--- coreutils-5.97-old/config.hin 2006-10-20 02:26:28.000000000 -0500 ++++ coreutils-5.97/config.hin 2006-10-20 02:27:28.000000000 -0500 +@@ -411,10 +411,6 @@ + don't. */ + #undef HAVE_DECL_TTYNAME + +-/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. +- */ +-#undef HAVE_DECL_TZNAME +- + /* Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise. + */ + #undef HAVE_DECL_WCWIDTH +@@ -519,6 +515,9 @@ + /* Define to 1 if you have the `getdelim' function. */ + #undef HAVE_GETDELIM + ++/* Define to 1 if you have the `getgrouplist' function. */ ++#undef HAVE_GETGROUPLIST ++ + /* Define to 1 if your system has a working `getgroups' function. */ + #undef HAVE_GETGROUPS + +@@ -613,9 +612,6 @@ + /* Define to 1 if you have the `lchown' function. */ + #undef HAVE_LCHOWN + +-/* Define to 1 if you have the `acl' library (-lacl). */ +-#undef HAVE_LIBACL +- + /* Define to 1 if you have the `dgc' library (-ldgc). */ + #undef HAVE_LIBDGC + +@@ -643,10 +639,6 @@ + /* Define if you have the 'long double' type. */ + #undef HAVE_LONG_DOUBLE + +-/* Define to 1 if the type `long double' works and has more range or precision +- than `double'. */ +-#undef HAVE_LONG_DOUBLE_WIDER +- + /* Define to 1 if you support file names longer than 14 characters. */ + #undef HAVE_LONG_FILE_NAMES + +@@ -1442,7 +1434,7 @@ + + /* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be +- automatically deduced at runtime. ++ automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +@@ -1546,6 +1538,9 @@ + /* Define if sys/ptem.h is required for struct winsize. */ + #undef WINSIZE_IN_PTEM + ++/* Define if you want to use SELINUX */ ++#undef WITH_SELINUX ++ + /* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ + #undef WORDS_BIGENDIAN +@@ -1691,7 +1686,7 @@ + /* Define to rpl_nanosleep if the replacement function should be used. */ + #undef nanosleep + +-/* Define to `long int' if does not define. */ ++/* Define to `long' if does not define. */ + #undef off_t + + /* Define to `int' if does not define. */ +@@ -1758,7 +1753,7 @@ + /* Define to empty if the C compiler doesn't support this keyword. */ + #undef signed + +-/* Define to `unsigned int' if does not define. */ ++/* Define to `unsigned' if does not define. */ + #undef size_t + + /* Map `socklen_t' to `int' if it is missing. */ +diff -ruN coreutils-5.97-old/configure.ac coreutils-5.97/configure.ac +--- coreutils-5.97-old/configure.ac 2006-10-20 02:26:28.000000000 -0500 ++++ coreutils-5.97/configure.ac 2006-10-20 02:27:28.000000000 -0500 +@@ -27,6 +27,13 @@ + AB_INIT() + AM_INIT_AUTOMAKE([1.8.3 gnits dist-bzip2]) + ++dnl Give the chance to enable SELINUX ++AC_ARG_ENABLE(selinux, dnl ++[ --enable-selinux Enable use of the SELINUX libraries], ++[AC_DEFINE(WITH_SELINUX, 1, [Define if you want to use SELINUX]) ++LIB_SELINUX="-lselinux" ++AC_SUBST(LIB_SELINUX)]) ++ + gl_DEFAULT_POSIX2_VERSION + gl_USE_SYSTEM_EXTENSIONS + gl_PERL +diff -ruN coreutils-5.97-old/man/chcon.1 coreutils-5.97/man/chcon.1 +--- coreutils-5.97-old/man/chcon.1 1969-12-31 18:00:00.000000000 -0600 ++++ coreutils-5.97/man/chcon.1 2006-10-20 02:27:28.000000000 -0500 +@@ -0,0 +1,64 @@ ++.TH CHCON 1 "July 2003" "chcon (coreutils) 5.0" "User Commands" ++.SH NAME ++chcon \- change security context ++.SH SYNOPSIS ++.B chcon ++[\fIOPTION\fR]...\fI CONTEXT FILE\fR... ++.br ++.B chcon ++[\fIOPTION\fR]...\fI --reference=RFILE FILE\fR... ++.SH DESCRIPTION ++.PP ++." Add any additional description here ++.PP ++Change the security context of each FILE to CONTEXT. ++.TP ++\fB\-c\fR, \fB\-\-changes\fR ++like verbose but report only when a change is made ++.TP ++\fB\-h\fR, \fB\-\-no\-dereference\fR ++affect symbolic links instead of any referenced file (available only on systems with lchown system call) ++.TP ++\fB\-f\fR, \fB\-\-silent\fR, \fB\-\-quiet\fR ++suppress most error messages ++.TP ++\fB\-l\fR, \fB\-\-range\fR ++set range RANGE in the target security context ++.TP ++\fB\-\-reference\fR=\fIRFILE\fR ++use RFILE's context instead of using a CONTEXT value ++.TP ++\fB\-R\fR, \fB\-\-recursive\fR ++change files and directories recursively ++.TP ++\fB\-r\fR, \fB\-\-role\fR ++set role ROLE in the target security context ++.TP ++\fB\-t\fR, \fB\-\-type\fR ++set type TYPE in the target security context ++.TP ++\fB\-u\fR, \fB\-\-user\fR ++set user USER in the target security context ++.TP ++\fB\-v\fR, \fB\-\-verbose\fR ++output a diagnostic for every file processed ++.TP ++\fB\-\-help\fR ++display this help and exit ++.TP ++\fB\-\-version\fR ++output version information and exit ++.SH "REPORTING BUGS" ++Report bugs to . ++.SH "SEE ALSO" ++The full documentation for ++.B chcon ++is maintained as a Texinfo manual. If the ++.B info ++and ++.B chcon ++programs are properly installed at your site, the command ++.IP ++.B info chcon ++.PP ++should give you access to the complete manual. +diff -ruN coreutils-5.97-old/man/chcon.x coreutils-5.97/man/chcon.x +--- coreutils-5.97-old/man/chcon.x 1969-12-31 18:00:00.000000000 -0600 ++++ coreutils-5.97/man/chcon.x 2006-10-20 02:27:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++[NAME] ++chcon \- change file security context ++[DESCRIPTION] ++.\" Add any additional description here +diff -ruN coreutils-5.97-old/man/cp.1 coreutils-5.97/man/cp.1 +--- coreutils-5.97-old/man/cp.1 2006-05-25 12:27:33.000000000 -0500 ++++ coreutils-5.97/man/cp.1 2006-10-20 02:27:28.000000000 -0500 +@@ -57,7 +57,7 @@ + .TP + \fB\-\-preserve\fR[=\fIATTR_LIST\fR] + preserve the specified attributes (default: +-mode,ownership,timestamps), if possible ++mode,ownership,timestamps) and security contexts, if possible + additional attributes: links, all + .TP + \fB\-\-no\-preserve\fR=\fIATTR_LIST\fR +@@ -105,6 +105,9 @@ + \fB\-\-help\fR + display this help and exit + .TP ++\fB\-Z\fR, \fB\-\-context\fR=\fICONTEXT\fR ++set security context of copy to CONTEXT ++.TP + \fB\-\-version\fR + output version information and exit + .PP +diff -ruN coreutils-5.97-old/man/dir.1 coreutils-5.97/man/dir.1 +--- coreutils-5.97-old/man/dir.1 2006-06-01 02:33:14.000000000 -0500 ++++ coreutils-5.97/man/dir.1 2006-10-20 02:27:28.000000000 -0500 +@@ -201,6 +201,20 @@ + .TP + \fB\-1\fR + list one file per line ++.PP ++SELINUX options: ++.TP ++\fB\-\-lcontext\fR ++Display security context. Enable \fB\-l\fR. Lines ++will probably be too wide for most displays. ++.TP ++\fB\-\-context\fR ++Display security context so it fits on most ++displays. Displays only mode, user, group, ++security context and file name. ++.TP ++\fB\-\-scontext\fR ++Display only security context and file name. + .TP + \fB\-\-help\fR + display this help and exit +diff -ruN coreutils-5.97-old/man/id.1 coreutils-5.97/man/id.1 +--- coreutils-5.97-old/man/id.1 2006-05-25 12:27:35.000000000 -0500 ++++ coreutils-5.97/man/id.1 2006-10-20 02:27:28.000000000 -0500 +@@ -13,6 +13,9 @@ + \fB\-a\fR + ignore, for compatibility with other versions + .TP ++\fB\-Z\fR, \fB\-\-context\fR ++print only the security context ++.TP + \fB\-g\fR, \fB\-\-group\fR + print only the effective group ID + .TP +diff -ruN coreutils-5.97-old/man/install.1 coreutils-5.97/man/install.1 +--- coreutils-5.97-old/man/install.1 2006-05-25 12:27:35.000000000 -0500 ++++ coreutils-5.97/man/install.1 2006-10-20 02:27:28.000000000 -0500 +@@ -65,6 +65,11 @@ + .TP + \fB\-v\fR, \fB\-\-verbose\fR + print the name of each directory as it is created ++.HP ++\fB\-P\fR, \fB\-\-preserve_context\fR (SELinux) Preserve security context ++.TP ++\fB\-Z\fR, \fB\-\-context\fR=\fICONTEXT\fR ++(SELinux) Set security context of files and directories + .TP + \fB\-\-help\fR + display this help and exit +diff -ruN coreutils-5.97-old/man/ls.1 coreutils-5.97/man/ls.1 +--- coreutils-5.97-old/man/ls.1 2006-06-01 02:33:14.000000000 -0500 ++++ coreutils-5.97/man/ls.1 2006-10-20 02:27:28.000000000 -0500 +@@ -201,6 +201,20 @@ + .TP + \fB\-1\fR + list one file per line ++.PP ++SELinux options: ++.TP ++\fB\-\-lcontext\fR ++Display security context. Enable \fB\-l\fR. Lines ++will probably be too wide for most displays. ++.TP ++\fB\-Z\fR, \fB\-\-context\fR ++Display security context so it fits on most ++displays. Displays only mode, user, group, ++security context and file name. ++.TP ++\fB\-\-scontext\fR ++Display only security context and file name. + .TP + \fB\-\-help\fR + display this help and exit +diff -ruN coreutils-5.97-old/man/Makefile.am coreutils-5.97/man/Makefile.am +--- coreutils-5.97-old/man/Makefile.am 2005-10-13 09:12:51.000000000 -0500 ++++ coreutils-5.97/man/Makefile.am 2006-10-20 02:27:28.000000000 -0500 +@@ -10,7 +10,7 @@ + rm.1 rmdir.1 seq.1 sha1sum.1 shred.1 sleep.1 sort.1 split.1 stat.1 stty.1 \ + su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \ + tty.1 uname.1 unexpand.1 uniq.1 unlink.1 uptime.1 users.1 vdir.1 wc.1 \ +- who.1 whoami.1 yes.1 ++ who.1 whoami.1 yes.1 chcon.1 runcon.1 + + man_aux = $(dist_man_MANS:.1=.x) + +@@ -112,6 +112,8 @@ + who.1: $(common_dep) $(srcdir)/who.x ../src/who.c + whoami.1: $(common_dep) $(srcdir)/whoami.x ../src/whoami.c + yes.1: $(common_dep) $(srcdir)/yes.x ../src/yes.c ++chcon.1: $(common_dep) $(srcdir)/chcon.x ../src/chcon.c ++runcon.1: $(common_dep) $(srcdir)/runcon.x ../src/runcon.c + + SUFFIXES = .x .1 + +diff -ruN coreutils-5.97-old/man/mkdir.1 coreutils-5.97/man/mkdir.1 +--- coreutils-5.97-old/man/mkdir.1 2006-05-25 12:27:35.000000000 -0500 ++++ coreutils-5.97/man/mkdir.1 2006-10-20 02:27:28.000000000 -0500 +@@ -12,6 +12,8 @@ + .PP + Mandatory arguments to long options are mandatory for short options too. + .TP ++\fB\-Z\fR, \fB\-\-context\fR=\fICONTEXT\fR (SELinux) set security context to CONTEXT ++.TP + \fB\-m\fR, \fB\-\-mode\fR=\fIMODE\fR + set permission mode (as in chmod), not rwxrwxrwx \- umask + .TP +diff -ruN coreutils-5.97-old/man/mkfifo.1 coreutils-5.97/man/mkfifo.1 +--- coreutils-5.97-old/man/mkfifo.1 2006-05-25 12:27:36.000000000 -0500 ++++ coreutils-5.97/man/mkfifo.1 2006-10-20 02:27:28.000000000 -0500 +@@ -12,6 +12,9 @@ + .PP + Mandatory arguments to long options are mandatory for short options too. + .TP ++\fB\-Z\fR, \fB\-\-context\fR=\fICONTEXT\fR ++set security context (quoted string) ++.TP + \fB\-m\fR, \fB\-\-mode\fR=\fIMODE\fR + set permission mode (as in chmod), not a=rw \- umask + .TP +diff -ruN coreutils-5.97-old/man/mknod.1 coreutils-5.97/man/mknod.1 +--- coreutils-5.97-old/man/mknod.1 2006-05-25 12:27:36.000000000 -0500 ++++ coreutils-5.97/man/mknod.1 2006-10-20 02:27:28.000000000 -0500 +@@ -12,6 +12,9 @@ + .PP + Mandatory arguments to long options are mandatory for short options too. + .TP ++\fB\-Z\fR, \fB\-\-context\fR=\fICONTEXT\fR ++set security context (quoted string) ++.TP + \fB\-m\fR, \fB\-\-mode\fR=\fIMODE\fR + set permission mode (as in chmod), not a=rw \- umask + .TP +diff -ruN coreutils-5.97-old/man/runcon.1 coreutils-5.97/man/runcon.1 +--- coreutils-5.97-old/man/runcon.1 1969-12-31 18:00:00.000000000 -0600 ++++ coreutils-5.97/man/runcon.1 2006-10-20 02:27:28.000000000 -0500 +@@ -0,0 +1,43 @@ ++.TH RUNCON "1" "February 2005" "runcon (coreutils) 5.0" "selinux" ++.SH NAME ++runcon \- run command with specified security context ++.SH SYNOPSIS ++.B runcon ++[\fI-c\fR] [\fI-t TYPE\fR] [\fI-l LEVEL\fR] [\fI-u USER\fR] [\fI-r ROLE\fR] \fICOMMAND\fR [\fIARGS...\fR] ++.PP ++or ++.PP ++.B runcon ++\fICONTEXT\fR \fICOMMAND\fR [\fIargs...\fR] ++.PP ++.br ++.SH DESCRIPTION ++.PP ++.\" Add any additional description here ++.PP ++Run COMMAND with completely-specified CONTEXT, or with current or ++transitioned security context modified by one or more of LEVEL, ++ROLE, TYPE, and USER. ++.TP ++\fB\-c\fR ++compute process transition before modifying context ++.TP ++\fB\-t\fR ++change current type to the specified type ++.TP ++\fB\-l\fR ++change current level range to the specified range ++.TP ++\fB\-r\fR ++change current role to the specified role ++.TP ++\fB\-u\fR ++change current user to the specified user ++.PP ++If none of \fI-c\fR, \fI-t\fR, \fI-u\fR, \fI-r\fR, or \fI-l\fR, is specified, ++the first argument is used as the complete context. Any additional ++arguments after \fICOMMAND\fR are interpreted as arguments to the ++command. ++.PP ++Note that only carefully-chosen contexts are likely to successfully ++run. +diff -ruN coreutils-5.97-old/man/runcon.x coreutils-5.97/man/runcon.x +--- coreutils-5.97-old/man/runcon.x 1969-12-31 18:00:00.000000000 -0600 ++++ coreutils-5.97/man/runcon.x 2006-10-20 02:27:28.000000000 -0500 +@@ -0,0 +1,14 @@ ++[NAME] ++runcon \- run command with specified security context ++[DESCRIPTION] ++Run COMMAND with completely-specified CONTEXT, or with current or ++transitioned security context modified by one or more of LEVEL, ++ROLE, TYPE, and USER. ++.PP ++If none of \fI-c\fR, \fI-t\fR, \fI-u\fR, \fI-r\fR, or \fI-l\fR, is specified, ++the first argument is used as the complete context. Any additional ++arguments after \fICOMMAND\fR are interpreted as arguments to the ++command. ++.PP ++Note that only carefully-chosen contexts are likely to successfully ++run. +diff -ruN coreutils-5.97-old/man/stat.1 coreutils-5.97/man/stat.1 +--- coreutils-5.97-old/man/stat.1 2006-05-25 12:27:38.000000000 -0500 ++++ coreutils-5.97/man/stat.1 2006-10-20 02:27:28.000000000 -0500 +@@ -28,6 +28,9 @@ + \fB\-t\fR, \fB\-\-terse\fR + print the information in terse form + .TP ++\fB\-Z\fR, \fB\-\-context\fR ++print security context information for SELinux if available. ++.TP + \fB\-\-help\fR + display this help and exit + .TP +@@ -51,6 +54,9 @@ + %d + Device number in decimal + .TP ++%C ++SELinux security context ++.TP + %D + Device number in hex + .TP +diff -ruN coreutils-5.97-old/man/vdir.1 coreutils-5.97/man/vdir.1 +--- coreutils-5.97-old/man/vdir.1 2006-06-01 02:33:14.000000000 -0500 ++++ coreutils-5.97/man/vdir.1 2006-10-20 02:27:28.000000000 -0500 +@@ -201,6 +201,20 @@ + .TP + \fB\-1\fR + list one file per line ++.PP ++SELINUX options: ++.TP ++\fB\-\-lcontext\fR ++Display security context. Enable \fB\-l\fR. Lines ++will probably be too wide for most displays. ++.TP ++\fB\-\-context\fR ++Display security context so it fits on most ++displays. Displays only mode, user, group, ++security context and file name. ++.TP ++\fB\-\-scontext\fR ++Display only security context and file name. + .TP + \fB\-\-help\fR + display this help and exit +diff -ruN coreutils-5.97-old/README coreutils-5.97/README +--- coreutils-5.97-old/README 2005-09-28 13:34:26.000000000 -0500 ++++ coreutils-5.97/README 2006-10-20 02:29:25.000000000 -0500 +@@ -7,11 +7,11 @@ + + The programs that can be built with this package are: + +- [ basename cat chgrp chmod chown chroot cksum comm cp csplit cut date dd ++ [ basename cat chcon chgrp chmod chown chroot cksum comm cp csplit cut date dd + df dir dircolors dirname du echo env expand expr factor false fmt fold + ginstall groups head hostid hostname id join kill link ln logname ls + md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr +- printenv printf ptx pwd readlink rm rmdir seq sha1sum shred sleep sort ++ printenv printf ptx pwd readlink rm rmdir runcon seq sha1sum shred sleep sort + split stat stty su sum sync tac tail tee test touch tr true tsort tty + uname unexpand uniq unlink uptime users vdir wc who whoami yes + +diff -ruN coreutils-5.97-old/src/chcon.c coreutils-5.97/src/chcon.c +--- coreutils-5.97-old/src/chcon.c 1969-12-31 18:00:00.000000000 -0600 ++++ coreutils-5.97/src/chcon.c 2006-10-20 02:27:28.000000000 -0500 +@@ -0,0 +1,421 @@ ++/* chcontext -- change security context of a pathname */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "system.h" ++#include "error.h" ++#include "savedir.h" ++#include "group-member.h" ++ ++enum Change_status ++{ ++ CH_SUCCEEDED, ++ CH_FAILED, ++ CH_NO_CHANGE_REQUESTED ++}; ++ ++enum Verbosity ++{ ++ /* Print a message for each file that is processed. */ ++ V_high, ++ ++ /* Print a message for each file whose attributes we change. */ ++ V_changes_only, ++ ++ /* Do not be verbose. This is the default. */ ++ V_off ++}; ++ ++static int change_dir_context (const char *dir, const struct stat *statp); ++ ++/* The name the program was run with. */ ++char *program_name; ++ ++/* If nonzero, and the systems has support for it, change the context ++ of symbolic links rather than any files they point to. */ ++static int change_symlinks; ++ ++/* If nonzero, change the context of directories recursively. */ ++static int recurse; ++ ++/* If nonzero, force silence (no error messages). */ ++static int force_silent; ++ ++/* Level of verbosity. */ ++static enum Verbosity verbosity = V_off; ++ ++/* The name of the context file is being given. */ ++static const char *specified_context; ++ ++/* Specific components of the context */ ++static const char *specified_user; ++static const char *specified_role; ++static const char *specified_range; ++static const char *specified_type; ++ ++/* The argument to the --reference option. Use the context of this file. ++ This file must exist. */ ++static char *reference_file; ++ ++/* If nonzero, display usage information and exit. */ ++static int show_help; ++ ++/* If nonzero, print the version on standard output and exit. */ ++static int show_version; ++ ++static struct option const long_options[] = ++{ ++ {"recursive", no_argument, 0, 'R'}, ++ {"changes", no_argument, 0, 'c'}, ++ {"no-dereference", no_argument, 0, 'h'}, ++ {"silent", no_argument, 0, 'f'}, ++ {"quiet", no_argument, 0, 'f'}, ++ {"reference", required_argument, 0, CHAR_MAX + 1}, ++ {"context", required_argument, 0, CHAR_MAX + 2}, ++ {"user", required_argument, 0, 'u'}, ++ {"role", required_argument, 0, 'r'}, ++ {"type", required_argument, 0, 't'}, ++ {"range", required_argument, 0, 'l'}, ++ {"verbose", no_argument, 0, 'v'}, ++ {"help", no_argument, &show_help, 1}, ++ {"version", no_argument, &show_version, 1}, ++ {0, 0, 0, 0} ++}; ++ ++/* Tell the user how/if the context of FILE has been changed. ++ CHANGED describes what (if anything) has happened. */ ++ ++static void ++describe_change (const char *file, security_context_t newcontext, enum Change_status changed) ++{ ++ const char *fmt; ++ switch (changed) ++ { ++ case CH_SUCCEEDED: ++ fmt = _("context of %s changed to %s\n"); ++ break; ++ case CH_FAILED: ++ fmt = _("failed to change context of %s to %s\n"); ++ break; ++ case CH_NO_CHANGE_REQUESTED: ++ fmt = _("context of %s retained as %s\n"); ++ break; ++ default: ++ abort (); ++ } ++ printf (fmt, file, newcontext); ++} ++ ++static int ++compute_context_from_mask (security_context_t context, context_t *ret) ++{ ++ context_t newcontext = context_new (context); ++ if (!newcontext) ++ return 1; ++#define SETCOMPONENT(comp) \ ++ do { \ ++ if (specified_ ## comp) \ ++ if (context_ ## comp ## _set (newcontext, specified_ ## comp)) \ ++ goto lose; \ ++ } while (0) ++ ++ SETCOMPONENT(user); ++ SETCOMPONENT(range); ++ SETCOMPONENT(role); ++ SETCOMPONENT(type); ++#undef SETCOMPONENT ++ ++ *ret = newcontext; ++ return 0; ++ lose: ++ context_free (newcontext); ++ return 1; ++} ++ ++/* Change the context of FILE, using specified components. ++ If it is a directory and -R is given, recurse. ++ Return 0 if successful, 1 if errors occurred. */ ++ ++static int ++change_file_context (const char *file) ++{ ++ struct stat file_stats; ++ security_context_t file_context=NULL; ++ context_t context; ++ security_context_t context_string; ++ int errors = 0; ++ int status = 0; ++ ++ if (change_symlinks) ++ status = lgetfilecon(file, &file_context); ++ else ++ status = getfilecon(file, &file_context); ++ ++ if ((status < 0) && (errno != ENODATA)) ++ { ++ if (force_silent == 0) ++ error (0, errno, "%s", file); ++ return 1; ++ } ++ ++ /* If the file doesn't have a context, and we're not setting all of ++ the context components, there isn't really an obvious default. ++ Thus, we just give up. */ ++ if (file_context == NULL && specified_context == NULL) ++ { ++ error (0, 0, _("can't apply partial context to unlabeled file %s"), file); ++ return 1; ++ } ++ ++ if (specified_context == NULL) ++ { ++ if (compute_context_from_mask (file_context, &context)) ++ { ++ error (0, 0, _("couldn't compute security context from %s"), file_context); ++ return 1; ++ } ++ } ++ else ++ { ++ context = context_new (specified_context); ++ if (!context) ++ error (1, 0,_("invalid context: %s"),specified_context); ++ } ++ ++ context_string = context_str (context); ++ ++ if (file_context == NULL || strcmp(context_string,file_context)!=0) ++ { ++ int fail; ++ ++ if (change_symlinks) ++ fail = lsetfilecon (file, context_string); ++ else ++ fail = setfilecon (file, context_string); ++ ++ if (verbosity == V_high || (verbosity == V_changes_only && !fail)) ++ describe_change (file, context_string, (fail ? CH_FAILED : CH_SUCCEEDED)); ++ ++ if (fail) ++ { ++ errors = 1; ++ if (force_silent == 0) ++ { ++ error (0, errno, _("failed to change context of %s to %s"), file, context_string); ++ } ++ } ++ } ++ else if (verbosity == V_high) ++ { ++ describe_change (file, context_string, CH_NO_CHANGE_REQUESTED); ++ } ++ ++ context_free(context); ++ freecon(file_context); ++ ++ if (recurse) { ++ if (lstat(file, &file_stats)==0) ++ if (S_ISDIR (file_stats.st_mode)) ++ errors |= change_dir_context (file, &file_stats); ++ } ++ return errors; ++} ++ ++/* Recursively change context of the files in directory DIR ++ using specified context components. ++ STATP points to the results of lstat on DIR. ++ Return 0 if successful, 1 if errors occurred. */ ++ ++static int ++change_dir_context (const char *dir, const struct stat *statp) ++{ ++ char *name_space, *namep; ++ char *path; /* Full path of each entry to process. */ ++ unsigned dirlength; /* Length of `dir' and '\0'. */ ++ unsigned filelength; /* Length of each pathname to process. */ ++ unsigned pathlength; /* Bytes allocated for `path'. */ ++ int errors = 0; ++ ++ errno = 0; ++ name_space = savedir (dir); ++ if (name_space == NULL) ++ { ++ if (errno) ++ { ++ if (force_silent == 0) ++ error (0, errno, "%s", dir); ++ return 1; ++ } ++ else ++ error (1, 0, _("virtual memory exhausted")); ++ } ++ ++ dirlength = strlen (dir) + 1; /* + 1 is for the trailing '/'. */ ++ pathlength = dirlength + 1; ++ /* Give `path' a dummy value; it will be reallocated before first use. */ ++ path = xmalloc (pathlength); ++ strcpy (path, dir); ++ path[dirlength - 1] = '/'; ++ ++ for (namep = name_space; *namep; namep += filelength - dirlength) ++ { ++ filelength = dirlength + strlen (namep) + 1; ++ if (filelength > pathlength) ++ { ++ pathlength = filelength * 2; ++ path = xrealloc (path, pathlength); ++ } ++ strcpy (path + dirlength, namep); ++ errors |= change_file_context (path); ++ } ++ free (path); ++ free (name_space); ++ return errors; ++} ++ ++static void ++usage (int status) ++{ ++ if (status != 0) ++ fprintf (stderr, _("Try `%s --help' for more information.\n"), ++ program_name); ++ else ++ { ++ printf (_("\ ++Usage: %s [OPTION]... CONTEXT FILE...\n\ ++ or: %s [OPTION]... [-u USER] [-r ROLE] [-l RANGE] [-t TYPE] FILE...\n\ ++ or: %s [OPTION]... --reference=RFILE FILE...\n\ ++"), ++ program_name, program_name, program_name); ++ printf (_("\ ++Change the security context of each FILE to CONTEXT.\n\ ++\n\ ++ -c, --changes like verbose but report only when a change is made\n\ ++ -h, --no-dereference affect symbolic links instead of any referenced file\n\ ++ (available only on systems with lchown system call)\n\ ++ -f, --silent, --quiet suppress most error messages\n\ ++ --reference=RFILE use RFILE's group instead of using a CONTEXT value\n\ ++ -u, --user=USER set user USER in the target security context\n\ ++ -r, --role=ROLE set role ROLE in the target security context\n\ ++ -t, --type=TYPE set type TYPE in the target security context\n\ ++ -l, --range=RANGE set range RANGE in the target security context\n\ ++ -R, --recursive change files and directories recursively\n\ ++ -v, --verbose output a diagnostic for every file processed\n\ ++ --help display this help and exit\n\ ++ --version output version information and exit\n\ ++")); ++ close_stdout (); ++ } ++ exit (status); ++} ++ ++int ++main (int argc, char **argv) ++{ ++ security_context_t ref_context = NULL; ++ int errors = 0; ++ int optc; ++ int component_specified = 0; ++ ++ program_name = argv[0]; ++ setlocale (LC_ALL, ""); ++ bindtextdomain (PACKAGE, LOCALEDIR); ++ textdomain (PACKAGE); ++ ++ recurse = force_silent = 0; ++ ++ while ((optc = getopt_long (argc, argv, "Rcfhvu:r:t:l:", long_options, NULL)) != -1) ++ { ++ switch (optc) ++ { ++ case 0: ++ break; ++ case 'u': ++ specified_user = optarg; ++ component_specified = 1; ++ break; ++ case 'r': ++ specified_role = optarg; ++ component_specified = 1; ++ break; ++ case 't': ++ specified_type = optarg; ++ component_specified = 1; ++ break; ++ case 'l': ++ specified_range = optarg; ++ component_specified = 1; ++ break; ++ case CHAR_MAX + 1: ++ reference_file = optarg; ++ break; ++ case 'R': ++ recurse = 1; ++ break; ++ case 'c': ++ verbosity = V_changes_only; ++ break; ++ case 'f': ++ force_silent = 1; ++ break; ++ case 'h': ++ change_symlinks = 1; ++ break; ++ case 'v': ++ verbosity = V_high; ++ break; ++ default: ++ usage (1); ++ } ++ } ++ ++ if (show_version) ++ { ++ printf ("chcon (%s) %s\n", GNU_PACKAGE, VERSION); ++ close_stdout (); ++ exit (0); ++ } ++ ++ if (show_help) ++ usage (0); ++ ++ ++ if (reference_file && component_specified) ++ { ++ error (0, 0, _("conflicting security context specifiers given")); ++ usage (1); ++ } ++ ++ if (!(((reference_file || component_specified) ++ && (argc - optind > 0)) ++ || (argc - optind > 1))) ++ { ++ error (0, 0, _("too few arguments")); ++ usage (1); ++ } ++ ++ if (reference_file) ++ { ++ if (getfilecon (reference_file, &ref_context)<0) ++ error (1, errno, "%s", reference_file); ++ ++ specified_context = ref_context; ++ } ++ else if (!component_specified) { ++ specified_context = argv[optind++]; ++ } ++ for (; optind < argc; ++optind) ++ errors |= change_file_context (argv[optind]); ++ ++ if (verbosity != V_off) ++ close_stdout (); ++ if (ref_context != NULL) ++ freecon(ref_context); ++ exit (errors); ++} +diff -ruN coreutils-5.97-old/src/copy.c coreutils-5.97/src/copy.c +--- coreutils-5.97-old/src/copy.c 2006-10-20 02:26:28.000000000 -0500 ++++ coreutils-5.97/src/copy.c 2006-10-20 02:27:28.000000000 -0500 +@@ -51,6 +51,11 @@ + #include "xreadlink.h" + #include "yesno.h" + ++#ifdef WITH_SELINUX ++#include /* for is_selinux_enabled() */ ++extern int selinux_enabled; ++#endif ++ + #ifndef HAVE_FCHMOD + # define HAVE_FCHMOD false + #endif +@@ -238,6 +243,30 @@ + { + dest_desc = open (dst_name, O_WRONLY | O_TRUNC | O_BINARY, dst_mode); + ++#ifdef WITH_SELINUX ++ if (dest_desc >= 0 && selinux_enabled && ++ (x->preserve_security_context || x->set_security_context)) ++ { ++ security_context_t con; ++ if(getfscreatecon(&con) == -1) ++ { ++ return_val = false; ++ goto close_src_desc; ++ } ++ ++ if (con) ++ { ++ if(fsetfilecon(dest_desc, con) == -1) ++ { ++ return_val = false; ++ freecon(con); ++ goto close_src_desc; ++ } ++ freecon(con); ++ } ++ } ++#endif ++ + if (dest_desc < 0 && x->unlink_dest_after_failed_open) + { + if (unlink (dst_name) != 0) +@@ -1410,6 +1439,32 @@ + In such cases, set this variable to zero. */ + preserve_metadata = true; + ++#ifdef WITH_SELINUX ++ if (x->preserve_security_context && selinux_enabled) ++ { ++ security_context_t con; ++ ++ if (lgetfilecon (src_name, &con) >= 0) ++ { ++ if (setfscreatecon(con) < 0) ++ { ++ error (0, errno, _("cannot set setfscreatecon %s"), quote (con)); ++ if (x->require_preserve) { ++ freecon(con); ++ return 1; ++ } ++ } ++ freecon(con); ++ } ++ else { ++ if (( errno != ENOTSUP ) && ( errno != ENODATA )) { ++ error (0, errno, _("cannot lgetfilecon %s"), quote (src_name)); ++ return 1; ++ } ++ } ++ } ++#endif ++ + if (S_ISDIR (src_mode)) + { + struct dir_list *dir; +@@ -1480,7 +1535,13 @@ + + /* Are we crossing a file system boundary? */ + if (x->one_file_system && device != 0 && device != src_sb.st_dev) +- return true; ++ { ++#ifdef WITH_SELINUX ++ if (x->preserve_security_context && selinux_enabled) ++ setfscreatecon(NULL); ++#endif ++ return true; ++ } + + /* Copy the contents of the directory. */ + +@@ -1616,6 +1677,11 @@ + } + } + ++#ifdef WITH_SELINUX ++ if (x->preserve_security_context && selinux_enabled) ++ setfscreatecon(NULL); ++#endif ++ + /* There's no need to preserve timestamps or permissions. */ + preserve_metadata = false; + +@@ -1754,6 +1820,11 @@ + + un_backup: + ++#ifdef WITH_SELINUX ++ if (x->preserve_security_context && selinux_enabled) ++ setfscreatecon(NULL); ++#endif ++ + /* We have failed to create the destination file. + If we've just added a dev/ino entry via the remember_copied + call above (i.e., unless we've just failed to create a hard link), +diff -ruN coreutils-5.97-old/src/copy.h coreutils-5.97/src/copy.h +--- coreutils-5.97-old/src/copy.h 2006-10-20 02:26:28.000000000 -0500 ++++ coreutils-5.97/src/copy.h 2006-10-20 02:27:28.000000000 -0500 +@@ -127,6 +127,10 @@ + bool preserve_ownership; + bool preserve_mode; + bool preserve_timestamps; ++#ifdef WITH_SELINUX ++ bool preserve_security_context; ++ bool set_security_context; ++#endif + + /* Enabled for mv, and for cp by the --preserve=links option. + If true, attempt to preserve in the destination files any +diff -ruN coreutils-5.97-old/src/cp.c coreutils-5.97/src/cp.c +--- coreutils-5.97-old/src/cp.c 2006-10-20 02:26:28.000000000 -0500 ++++ coreutils-5.97/src/cp.c 2006-10-20 02:27:28.000000000 -0500 +@@ -51,6 +51,11 @@ + + #define AUTHORS "Torbjorn Granlund", "David MacKenzie", "Jim Meyering" + ++#ifdef WITH_SELINUX ++#include /* for is_selinux_enabled() */ ++int selinux_enabled=0; ++#endif ++ + /* Used by do_copy, make_dir_parents_private, and re_protect + to keep a list of leading directories whose protections + need to be fixed after copying. */ +@@ -141,6 +146,9 @@ + {"target-directory", required_argument, NULL, 't'}, + {"update", no_argument, NULL, 'u'}, + {"verbose", no_argument, NULL, 'v'}, ++#ifdef WITH_SELINUX ++ {"context", required_argument, NULL, 'Z'}, ++#endif + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, + {NULL, 0, NULL, 0} +@@ -194,6 +202,9 @@ + additional attributes: links, all\n\ + "), stdout); + fputs (_("\ ++ -c same as --preserve=context\n\ ++"), stdout); ++ fputs (_("\ + --no-preserve=ATTR_LIST don't preserve the specified attributes\n\ + --parents use full source file name under DIRECTORY\n\ + "), stdout); +@@ -219,6 +230,7 @@ + destination file is missing\n\ + -v, --verbose explain what is being done\n\ + -x, --one-file-system stay on this file system\n\ ++ -Z, --context=CONTEXT set security context of copy to CONTEXT\n\ + "), stdout); + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); +@@ -741,6 +753,11 @@ + x->preserve_mode = false; + x->preserve_timestamps = false; + ++#ifdef WITH_SELINUX ++ x->preserve_security_context = false; ++ x->set_security_context = false; ++#endif ++ + x->require_preserve = false; + x->recursive = false; + x->sparse_mode = SPARSE_AUTO; +@@ -768,18 +785,19 @@ + PRESERVE_TIMESTAMPS, + PRESERVE_OWNERSHIP, + PRESERVE_LINK, ++ PRESERVE_CONTEXT, + PRESERVE_ALL + }; + static enum File_attribute const preserve_vals[] = + { + PRESERVE_MODE, PRESERVE_TIMESTAMPS, +- PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_ALL ++ PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_CONTEXT, PRESERVE_ALL + }; + /* Valid arguments to the `--preserve' option. */ + static char const* const preserve_args[] = + { + "mode", "timestamps", +- "ownership", "links", "all", NULL ++ "ownership", "links", "context", "all", NULL + }; + ARGMATCH_VERIFY (preserve_args, preserve_vals); + +@@ -815,11 +833,16 @@ + x->preserve_links = on_off; + break; + ++ case PRESERVE_CONTEXT: ++ x->preserve_security_context = on_off; ++ break; ++ + case PRESERVE_ALL: + x->preserve_mode = on_off; + x->preserve_timestamps = on_off; + x->preserve_ownership = on_off; + x->preserve_links = on_off; ++ x->preserve_security_context = on_off; + break; + + default: +@@ -844,6 +867,9 @@ + bool copy_contents = false; + char *target_directory = NULL; + bool no_target_directory = false; ++#ifdef WITH_SELINUX ++ selinux_enabled= (is_selinux_enabled()>0); ++#endif + + initialize_main (&argc, &argv); + program_name = argv[0]; +@@ -859,7 +885,11 @@ + we'll actually use backup_suffix_string. */ + backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); + ++#ifdef WITH_SELINUX ++ while ((c = getopt_long (argc, argv, "abcdfHilLprst:uvxPRS:TZ:", ++#else + while ((c = getopt_long (argc, argv, "abdfHilLprst:uvxPRS:T", ++#endif + long_opts, NULL)) + != -1) + { +@@ -870,12 +900,13 @@ + sparse_type_string, sparse_type); + break; + +- case 'a': /* Like -dpPR. */ ++ case 'a': /* Like -dpPRc. */ + x.dereference = DEREF_NEVER; + x.preserve_links = true; + x.preserve_ownership = true; + x.preserve_mode = true; + x.preserve_timestamps = true; ++ x.preserve_security_context = true; + x.require_preserve = true; + x.recursive = true; + break; +@@ -950,6 +981,36 @@ + case 'R': + x.recursive = true; + break; ++#ifdef WITH_SELINUX ++ case 'c': ++ if ( x.set_security_context ) { ++ (void) fprintf(stderr, "%s: cannot force target context and preserve it\n", argv[0]); ++ exit( 1 ); ++ } ++ else if (selinux_enabled) ++ x.preserve_security_context = true; ++ break; ++ ++ case 'Z': ++ /* politely decline if we're not on a selinux-enabled kernel. */ ++ if( !selinux_enabled ) { ++ fprintf( stderr, "Warning: ignoring --context (-Z). " ++ "It requires a SELinux enabled kernel.\n" ); ++ break; ++ } ++ if ( x.preserve_security_context ) { ++ (void) fprintf(stderr, "%s: cannot force target context to '%s' and preserve it\n", argv[0], optarg); ++ exit( 1 ); ++ } ++ x.set_security_context = true; ++ /* if there's a security_context given set new path ++ components to that context, too */ ++ if ( setfscreatecon(optarg) < 0 ) { ++ (void) fprintf(stderr, _("cannot set default security context %s\n"), optarg); ++ exit( 1 ); ++ } ++ break; ++#endif + + case REPLY_OPTION: /* Deprecated */ + x.interactive = XARGMATCH ("--reply", optarg, +diff -ruN coreutils-5.97-old/src/id.c coreutils-5.97/src/id.c +--- coreutils-5.97-old/src/id.c 2005-07-08 17:55:44.000000000 -0500 ++++ coreutils-5.97/src/id.c 2006-10-20 02:27:28.000000000 -0500 +@@ -37,6 +37,20 @@ + + int getugroups (); + ++#ifdef WITH_SELINUX ++#include ++static void print_context (char* context); ++/* Print the SELinux context */ ++static void ++print_context(char *context) ++{ ++ printf ("%s", context); ++} ++ ++/* If nonzero, output only the SELinux context. -Z */ ++static int just_context = 0; ++ ++#endif + static void print_user (uid_t uid); + static void print_group (gid_t gid); + static void print_group_list (const char *username); +@@ -55,8 +69,14 @@ + /* True unless errors have been encountered. */ + static bool ok = true; + ++/* The SELinux context */ ++/* Set `context' to a known invalid value so print_full_info() will * ++ * know when `context' has not been set to a meaningful value. */ ++static security_context_t context=NULL; ++ + static struct option const longopts[] = + { ++ {"context", no_argument, NULL, 'Z'}, + {"group", no_argument, NULL, 'g'}, + {"groups", no_argument, NULL, 'G'}, + {"name", no_argument, NULL, 'n'}, +@@ -80,6 +100,7 @@ + Print information for USERNAME, or the current user.\n\ + \n\ + -a ignore, for compatibility with other versions\n\ ++ -Z, --context print only the context\n\ + -g, --group print only the effective group ID\n\ + -G, --groups print all group IDs\n\ + -n, --name print a name instead of a number, for -ugG\n\ +@@ -101,6 +122,7 @@ + main (int argc, char **argv) + { + int optc; ++ int selinux_enabled=(is_selinux_enabled()>0); + + /* If true, output the list of all group IDs. -G */ + bool just_group_list = false; +@@ -119,13 +141,24 @@ + + atexit (close_stdout); + +- while ((optc = getopt_long (argc, argv, "agnruG", longopts, NULL)) != -1) ++ while ((optc = getopt_long (argc, argv, "agnruGZ", longopts, NULL)) != -1) + { + switch (optc) + { + case 'a': + /* Ignore -a, for compatibility with SVR4. */ + break; ++#ifdef WITH_SELINUX ++ case 'Z': ++ /* politely decline if we're not on a selinux-enabled kernel. */ ++ if( !selinux_enabled ) { ++ fprintf( stderr, "Sorry, --context (-Z) can be used only on " ++ "a selinux-enabled kernel.\n" ); ++ exit( 1 ); ++ } ++ just_context = 1; ++ break; ++#endif + case 'g': + just_group = true; + break; +@@ -148,8 +181,28 @@ + } + } + +- if (just_user + just_group + just_group_list > 1) +- error (EXIT_FAILURE, 0, _("cannot print only user and only group")); ++#ifdef WITH_SELINUX ++ if (argc - optind == 1) ++ selinux_enabled = 0; ++ ++ if( just_context && !selinux_enabled) ++ error (1, 0, _("\ ++cannot display context when selinux not enabled or when displaying the id\n\ ++of a different user")); ++ ++ /* If we are on a selinux-enabled kernel, get our context. * ++ * Otherwise, leave the context variable alone - it has * ++ * been initialized known invalid value; if we see this invalid * ++ * value later, we will know we are on a non-selinux kernel. */ ++ if( selinux_enabled ) ++ { ++ if (getcon(&context) && just_context) ++ error (1, 0, "can't get process context"); ++ } ++#endif ++ ++ if (just_user + just_group + just_group_list + just_context > 1) ++ error (EXIT_FAILURE, 0, _("cannot print \"only\" of more than one choice")); + + if (just_user + just_group + just_group_list == 0 && (use_real | use_name)) + error (EXIT_FAILURE, 0, +@@ -183,6 +236,10 @@ + print_group (use_real ? rgid : egid); + else if (just_group_list) + print_group_list (argv[optind]); ++#ifdef WITH_SELINUX ++ else if (just_context) ++ print_context (context); ++#endif + else + print_full_info (argv[optind]); + putchar ('\n'); +@@ -385,4 +442,9 @@ + free (groups); + } + #endif /* HAVE_GETGROUPS */ ++#ifdef WITH_SELINUX ++ if ( context != NULL ) { ++ printf(" context=%s",context); ++ } ++#endif + } +diff -ruN coreutils-5.97-old/src/install.c coreutils-5.97/src/install.c +--- coreutils-5.97-old/src/install.c 2006-10-20 02:26:28.000000000 -0500 ++++ coreutils-5.97/src/install.c 2006-10-20 02:27:28.000000000 -0500 +@@ -48,6 +48,43 @@ + # include + #endif + ++#ifdef WITH_SELINUX ++#include /* for is_selinux_enabled() */ ++int selinux_enabled=0; ++static int use_default_selinux_context = 1; ++/* Modify file context to match the specified policy, ++ If an error occurs the file will remain with the default directory ++ context.*/ ++static void setdefaultfilecon(const char *path) { ++ struct stat st; ++ security_context_t scontext=NULL; ++ if (selinux_enabled != 1) { ++ /* Indicate no context found. */ ++ return; ++ } ++ if (lstat(path, &st) != 0) ++ return; ++ ++ /* If there's an error determining the context, or it has none, ++ return to allow default context */ ++ if ((matchpathcon(path, st.st_mode, &scontext) != 0) || ++ (strcmp(scontext, "<>") == 0)) { ++ if (scontext != NULL) { ++ freecon(scontext); ++ } ++ return; ++ } ++ if (lsetfilecon(path, scontext) < 0) { ++ if (errno != ENOTSUP) { ++ error (0, errno, ++ _("warning: failed to change context of %s to %s"), path, scontext); ++ } ++ } ++ freecon(scontext); ++ return; ++} ++#endif ++ + #if ! HAVE_ENDGRENT + # define endgrent() ((void) 0) + #endif +@@ -109,12 +146,18 @@ + static struct option const long_options[] = + { + {"backup", optional_argument, NULL, 'b'}, ++#ifdef WITH_SELINUX ++ {"context", required_argument, NULL, 'Z'}, ++#endif + {"directory", no_argument, NULL, 'd'}, + {"group", required_argument, NULL, 'g'}, + {"mode", required_argument, NULL, 'm'}, + {"no-target-directory", no_argument, NULL, 'T'}, + {"owner", required_argument, NULL, 'o'}, + {"preserve-timestamps", no_argument, NULL, 'p'}, ++#ifdef WITH_SELINUX ++ {"preserve_context", no_argument, NULL, 'P'}, ++#endif + {"strip", no_argument, NULL, 's'}, + {"suffix", required_argument, NULL, 'S'}, + {"target-directory", required_argument, NULL, 't'}, +@@ -154,6 +197,10 @@ + x->stdin_tty = false; + + x->update = false; ++#ifdef WITH_SELINUX ++ x->preserve_security_context = false; ++ x->set_security_context = false; ++#endif + x->verbose = false; + x->dest_info = NULL; + x->src_info = NULL; +@@ -195,6 +242,10 @@ + bool no_target_directory = false; + int n_files; + char **file; ++#ifdef WITH_SELINUX ++ /* set iff kernel has extra selinux system calls */ ++ selinux_enabled = (is_selinux_enabled()>0); ++#endif + + initialize_main (&argc, &argv); + program_name = argv[0]; +@@ -216,7 +267,11 @@ + we'll actually use backup_suffix_string. */ + backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); + ++#ifdef WITH_SELINUX ++ while ((optc = getopt_long (argc, argv, "bcsDdg:m:o:pPt:TvS:Z:", long_options, ++#else + while ((optc = getopt_long (argc, argv, "bcsDdg:m:o:pt:TvS:", long_options, ++#endif + NULL)) != -1) + { + switch (optc) +@@ -278,6 +333,41 @@ + case 'T': + no_target_directory = true; + break; ++#ifdef WITH_SELINUX ++ case 'P': ++ /* politely decline if we're not on a selinux-enabled kernel. */ ++ if( !selinux_enabled ) { ++ fprintf( stderr, "Warning: ignoring --preserve_context (-P) " ++ "because the kernel is not selinux-enabled.\n" ); ++ break; ++ } ++ if ( x.set_security_context ) { ++ (void) fprintf(stderr, "%s: cannot force target context and preserve it\n", argv[0]); ++ exit( 1 ); ++ } ++ x.preserve_security_context = true; ++ use_default_selinux_context = 0; ++ break ; ++ case 'Z': ++ /* politely decline if we're not on a selinux-enabled kernel. */ ++ if( !selinux_enabled) { ++ fprintf( stderr, "Warning: ignoring --context (-Z) " ++ "because the kernel is not selinux-enabled.\n" ); ++ break; ++ } ++ if ( x.preserve_security_context ) { ++ ++ (void) fprintf(stderr, "%s: cannot force target context == '%s' and preserve it\n", argv[0], optarg); ++ exit( 1 ); ++ } ++ use_default_selinux_context = 0; ++ x.set_security_context = true; ++ if (setfscreatecon(optarg)) { ++ (void) fprintf(stderr, "%s: cannot setup default context == '%s'\n", argv[0], optarg); ++ exit(1); ++ } ++ break; ++#endif + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: +@@ -524,6 +614,10 @@ + ok = false; + } + ++#ifdef WITH_SELINUX ++ if (use_default_selinux_context) ++ setdefaultfilecon(name); ++#endif + return ok; + } + +@@ -668,6 +762,11 @@ + -T, --no-target-directory treat DEST as a normal file\n\ + -v, --verbose print the name of each directory as it is created\n\ + "), stdout); ++ fputs (_("\ ++ -P, --preserve_context (SELinux) Preserve security context\n\ ++ -Z, --context=CONTEXT (SELinux) Set security context of files and directories\n\ ++"), stdout); ++ + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); + fputs (_("\ +diff -ruN coreutils-5.97-old/src/ls.c coreutils-5.97/src/ls.c +--- coreutils-5.97-old/src/ls.c 2006-10-20 02:26:28.000000000 -0500 ++++ coreutils-5.97/src/ls.c 2006-10-20 02:27:28.000000000 -0500 +@@ -135,6 +135,18 @@ + + #define AUTHORS "Richard Stallman", "David MacKenzie" + ++#ifdef WITH_SELINUX ++#include ++ ++static int print_scontext = 0; ++ ++ ++ ++ ++ ++ ++#endif ++ + #define obstack_chunk_alloc malloc + #define obstack_chunk_free free + +@@ -170,7 +182,8 @@ + symbolic_link DT_INIT (DT_LNK), + sock DT_INIT (DT_SOCK), + arg_directory DT_INIT (2 * (DT_UNKNOWN | DT_FIFO | DT_CHR | DT_DIR | DT_BLK +- | DT_REG | DT_LNK | DT_SOCK)) ++ | DT_REG | DT_LNK | DT_SOCK)), ++ command_line + }; + + struct fileinfo +@@ -179,6 +192,7 @@ + char *name; + + struct stat stat; ++ int stat_failed; + + /* For symbolic link, name of the file linked to, otherwise zero. */ + char *linkname; +@@ -197,6 +211,10 @@ + /* For long listings, true if the file has an access control list. */ + bool have_acl; + #endif ++ ++#ifdef WITH_SELINUX ++ security_context_t scontext; ++#endif + }; + + #if HAVE_ACL || USE_ACL +@@ -232,7 +250,8 @@ + static bool file_ignored (char const *name); + static uintmax_t gobble_file (char const *name, enum filetype type, + bool command_line_arg, char const *dirname); +-static void print_color_indicator (const char *name, mode_t mode, int linkok); ++static void print_color_indicator (const char *name, mode_t mode, int linkok, ++ int stat_failed); + static void put_indicator (const struct bin_str *ind); + static void add_ignore_pattern (const char *pattern); + static void attach (char *dest, const char *dirname, const char *name); +@@ -253,7 +272,7 @@ + static void print_long_format (const struct fileinfo *f); + static void print_many_per_line (void); + static void print_name_with_quoting (const char *p, mode_t mode, +- int linkok, ++ int linkok, int stat_failed, + struct obstack *stack); + static void prep_non_filename_text (void); + static void print_type_indicator (mode_t mode); +@@ -263,6 +282,9 @@ + static void sort_files (void); + static void parse_ls_color (void); + void usage (int status); ++#ifdef WITH_SELINUX ++static void print_scontext_format (const struct fileinfo *f); ++#endif + + /* The name this program was run with. */ + char *program_name; +@@ -371,7 +393,11 @@ + one_per_line, /* -1 */ + many_per_line, /* -C */ + horizontal, /* -x */ +- with_commas /* -m */ ++ with_commas, /* -m */ ++#ifdef WITH_SELINUX ++ security_format, /* -Z */ ++#endif ++ invalid_format + }; + + static enum format format; +@@ -740,6 +766,11 @@ + SHOW_CONTROL_CHARS_OPTION, + SI_OPTION, + SORT_OPTION, ++#ifdef WITH_SELINUX ++ CONTEXT_OPTION, ++ LCONTEXT_OPTION, ++ SCONTEXT_OPTION, ++#endif + TIME_OPTION, + TIME_STYLE_OPTION + }; +@@ -784,6 +815,11 @@ + {"time-style", required_argument, NULL, TIME_STYLE_OPTION}, + {"color", optional_argument, NULL, COLOR_OPTION}, + {"block-size", required_argument, NULL, BLOCK_SIZE_OPTION}, ++#ifdef WITH_SELINUX ++ {"context", no_argument, 0, CONTEXT_OPTION}, ++ {"lcontext", no_argument, 0, LCONTEXT_OPTION}, ++ {"scontext", no_argument, 0, SCONTEXT_OPTION}, ++#endif + {"author", no_argument, NULL, AUTHOR_OPTION}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, +@@ -793,12 +829,19 @@ + static char const *const format_args[] = + { + "verbose", "long", "commas", "horizontal", "across", +- "vertical", "single-column", NULL ++ "vertical", "single-column", ++#ifdef WITH_SELINUX ++ "context", ++#endif ++ NULL + }; + static enum format const format_types[] = + { + long_format, long_format, with_commas, horizontal, horizontal, + many_per_line, one_per_line ++#ifdef WITH_SELINUX ++ , security_format ++#endif + }; + ARGMATCH_VERIFY (format_args, format_types); + +@@ -1222,6 +1265,9 @@ + + format_needs_stat = sort_type == sort_time || sort_type == sort_size + || format == long_format ++#ifdef WITH_SELINUX ++ || format == security_format || print_scontext ++#endif + || dereference == DEREF_ALWAYS + || print_block_size || print_inode; + format_needs_type = (!format_needs_stat +@@ -1251,7 +1297,7 @@ + } + else + do +- gobble_file (argv[i++], unknown, true, ""); ++ gobble_file (argv[i++], command_line, true, ""); + while (i < argc); + + if (files_index) +@@ -1414,6 +1460,9 @@ + ignore_mode = IGNORE_DEFAULT; + ignore_patterns = NULL; + hide_patterns = NULL; ++#ifdef WITH_SELINUX ++ print_scontext = 0; ++#endif + + /* FIXME: put this in a function. */ + { +@@ -1489,7 +1538,7 @@ + } + + while ((c = getopt_long (argc, argv, +- "abcdfghiklmnopqrstuvw:xABCDFGHI:LNQRST:UX1", ++ "abcdfghiklmnopqrstuvw:xABCDFGHI:LNQRST:UX1Z", + long_options, NULL)) != -1) + { + switch (c) +@@ -1608,6 +1657,13 @@ + format = horizontal; + break; + ++#ifdef WITH_SELINUX ++ case 'Z': ++ ++ print_scontext = 1; ++ format = security_format; ++ break; ++#endif + case 'A': + if (ignore_mode == IGNORE_DEFAULT) + ignore_mode = IGNORE_DOT_AND_DOTDOT; +@@ -1784,6 +1840,25 @@ + + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + ++#ifdef WITH_SELINUX ++ ++ case CONTEXT_OPTION: /* new security format */ ++ ++ print_scontext = 1; ++ format = security_format; ++ break; ++ case LCONTEXT_OPTION: /* long format plus security context */ ++ ++ print_scontext = 1; ++ format = long_format; ++ break; ++ case SCONTEXT_OPTION: /* short form of new security format */ ++ ++ print_scontext = 0; ++ format = security_format; ++ break; ++#endif ++ + default: + usage (LS_FAILURE); + } +@@ -2466,6 +2541,12 @@ + { + free (files[i].name); + free (files[i].linkname); ++#ifdef WITH_SELINUX ++ if (files[i].scontext) { ++ freecon (files[i].scontext); ++ files[i].scontext=NULL; ++ } ++#endif + } + + files_index = 0; +@@ -2504,11 +2585,14 @@ + f->linkname = NULL; + f->linkmode = 0; + f->linkok = false; ++#ifdef WITH_SELINUX ++ f->scontext = NULL; ++#endif + + if (command_line_arg + || format_needs_stat + || (format_needs_type +- && (type == unknown ++ && (type == unknown || type == command_line + + /* FIXME: remove this disjunct. + I don't think we care about symlinks here, but for now +@@ -2545,6 +2629,11 @@ + { + case DEREF_ALWAYS: + err = stat (absolute_name, &f->stat); ++#ifdef WITH_SELINUX ++ if (err>=0) ++ if (format == security_format || print_scontext) ++ getfilecon(absolute_name, &f->scontext); ++#endif + break; + + case DEREF_COMMAND_LINE_ARGUMENTS: +@@ -2553,6 +2642,11 @@ + { + bool need_lstat; + err = stat (absolute_name, &f->stat); ++#ifdef WITH_SELINUX ++ if (err>=0) ++ if (format == security_format || print_scontext) ++ getfilecon(absolute_name, &f->scontext); ++#endif + + if (dereference == DEREF_COMMAND_LINE_ARGUMENTS) + break; +@@ -2571,17 +2665,41 @@ + + default: /* DEREF_NEVER */ + err = lstat (absolute_name, &f->stat); ++#ifdef WITH_SELINUX ++ if (err>=0) ++ if (format == security_format || print_scontext) ++ lgetfilecon(absolute_name, &f->scontext); ++#endif + break; + } + +- if (err < 0) ++ f->stat_failed = (err < 0); ++ if (f->stat_failed) + { +- file_failure (command_line_arg, "%s", absolute_name); ++ /* We treat stat failures for files the user named special. ++ There is no guarantee that these files really exist so ++ we do not print any information. */ ++ if (type == command_line) ++ { ++ file_failure (1, "%s", absolute_name); ++ return 0; ++ } ++ ++ f->filetype = type; ++ memset (&f->stat, '\0', sizeof (f->stat)); ++ ++ f->name = xstrdup (absolute_name); ++ files_index++; ++ + return 0; + } + + #if HAVE_ACL || USE_ACL +- if (format == long_format) ++ if (format == long_format ++#ifdef WITH_SELINUX ++ || format == security_format ++#endif ++ ) + { + int n = file_has_acl (absolute_name, &f->stat); + f->have_acl = (0 < n); +@@ -3070,6 +3188,16 @@ + DIRED_PUTCHAR ('\n'); + } + break; ++ ++#ifdef WITH_SELINUX ++ case security_format: ++ for (i = 0; i < files_index; i++) ++ { ++ print_scontext_format (files + i); ++ DIRED_PUTCHAR ('\n'); ++ } ++ break; ++#endif + } + } + +@@ -3177,17 +3305,19 @@ + WIDTH. */ + + static void +-format_user (uid_t u, int width) ++format_user (uid_t u, int width, int stat_failed) + { +- format_user_or_group (numeric_ids ? NULL : getuser (u), u, width); ++ format_user_or_group (stat_failed ? "?" : ++ (numeric_ids ? NULL : getuser (u)), u, width); + } + + /* Likewise, for groups. */ + + static void +-format_group (gid_t g, int width) ++format_group (gid_t g, int width, int stat_failed) + { +- format_user_or_group (numeric_ids ? NULL : getgroup (g), g, width); ++ format_user_or_group (stat_failed ? "?" : ++ (numeric_ids ? NULL : getgroup (g)), g, width); + } + + /* Return the number of columns that format_user_or_group will print. */ +@@ -3277,7 +3407,7 @@ + { + char hbuf[INT_BUFSIZE_BOUND (uintmax_t)]; + sprintf (p, "%*s ", inode_number_width, +- umaxtostr (f->stat.st_ino, hbuf)); ++ f->stat_failed ? "?" : umaxtostr (f->stat.st_ino, hbuf)); + p += inode_number_width + 1; + } + +@@ -3285,8 +3415,10 @@ + { + char hbuf[LONGEST_HUMAN_READABLE + 1]; + char const *blocks = +- human_readable (ST_NBLOCKS (f->stat), hbuf, human_output_opts, +- ST_NBLOCKSIZE, output_block_size); ++ f->stat_failed ++ ? "?" ++ : human_readable (ST_NBLOCKS (f->stat), hbuf, human_output_opts, ++ ST_NBLOCKSIZE, output_block_size); + int pad; + for (pad = block_size_width - mbswidth (blocks, 0); 0 < pad; pad--) + *p++ = ' '; +@@ -3300,10 +3432,18 @@ + { + char hbuf[INT_BUFSIZE_BOUND (uintmax_t)]; + sprintf (p, "%s %*s ", modebuf, nlink_width, +- umaxtostr (f->stat.st_nlink, hbuf)); ++ f->stat_failed ? "?" : umaxtostr (f->stat.st_nlink, hbuf)); + } + p += sizeof modebuf - 2 + any_has_acl + 1 + nlink_width + 1; + ++#ifdef WITH_SELINUX ++ ++ if ( print_scontext ) { ++ sprintf (p, "%-32s ", f->scontext ?: ""); ++ p += strlen (p); ++ } ++#endif ++ + DIRED_INDENT (); + + if (print_owner | print_group | print_author) +@@ -3311,18 +3451,19 @@ + DIRED_FPUTS (buf, stdout, p - buf); + + if (print_owner) +- format_user (f->stat.st_uid, owner_width); ++ format_user (f->stat.st_uid, owner_width, f->stat_failed); + + if (print_group) +- format_group (f->stat.st_gid, group_width); ++ format_group (f->stat.st_gid, group_width, f->stat_failed); + + if (print_author) +- format_user (f->stat.st_author, author_width); ++ format_user (f->stat.st_author, author_width, f->stat_failed); + + p = buf; + } + +- if (S_ISCHR (f->stat.st_mode) || S_ISBLK (f->stat.st_mode)) ++ if (!f->stat_failed ++ && (S_ISCHR (f->stat.st_mode) || S_ISBLK (f->stat.st_mode))) + { + char majorbuf[INT_BUFSIZE_BOUND (uintmax_t)]; + char minorbuf[INT_BUFSIZE_BOUND (uintmax_t)]; +@@ -3340,8 +3481,10 @@ + { + char hbuf[LONGEST_HUMAN_READABLE + 1]; + char const *size = +- human_readable (unsigned_file_size (f->stat.st_size), +- hbuf, human_output_opts, 1, file_output_block_size); ++ f->stat_failed ++ ? "?" ++ : human_readable (unsigned_file_size (f->stat.st_size), ++ hbuf, human_output_opts, 1, file_output_block_size); + int pad; + for (pad = file_size_width - mbswidth (size, 0); 0 < pad; pad--) + *p++ = ' '; +@@ -3354,7 +3497,7 @@ + s = 0; + *p = '\1'; + +- if (when_local) ++ if (!f->stat_failed && when_local) + { + time_t six_months_ago; + bool recent; +@@ -3401,15 +3544,17 @@ + print it as a huge integer number of seconds. */ + char hbuf[INT_BUFSIZE_BOUND (intmax_t)]; + sprintf (p, "%*s ", long_time_expected_width (), +- (TYPE_SIGNED (time_t) +- ? imaxtostr (when, hbuf) +- : umaxtostr (when, hbuf))); ++ f->stat_failed ++ ? "?" ++ : (TYPE_SIGNED (time_t) ++ ? imaxtostr (when, hbuf) ++ : umaxtostr (when, hbuf))); + p += strlen (p); + } + + DIRED_FPUTS (buf, stdout, p - buf); + print_name_with_quoting (f->name, FILE_OR_LINK_MODE (f), f->linkok, +- &dired_obstack); ++ f->stat_failed, &dired_obstack); + + if (f->filetype == symbolic_link) + { +@@ -3417,7 +3562,7 @@ + { + DIRED_FPUTS_LITERAL (" -> ", stdout); + print_name_with_quoting (f->linkname, f->linkmode, f->linkok - 1, +- NULL); ++ f->stat_failed, NULL); + if (indicator_style != none) + print_type_indicator (f->linkmode); + } +@@ -3599,10 +3744,10 @@ + + static void + print_name_with_quoting (const char *p, mode_t mode, int linkok, +- struct obstack *stack) ++ int stat_failed, struct obstack *stack) + { + if (print_with_color) +- print_color_indicator (p, mode, linkok); ++ print_color_indicator (p, mode, linkok, stat_failed); + + if (stack) + PUSH_CURRENT_DIRED_POS (stack); +@@ -3650,7 +3795,8 @@ + human_readable (ST_NBLOCKS (f->stat), buf, human_output_opts, + ST_NBLOCKSIZE, output_block_size)); + +- print_name_with_quoting (f->name, FILE_OR_LINK_MODE (f), f->linkok, NULL); ++ print_name_with_quoting (f->name, FILE_OR_LINK_MODE (f), f->linkok, ++ f->stat_failed, NULL); + + if (indicator_style != none) + print_type_indicator (f->stat.st_mode); +@@ -3691,7 +3837,8 @@ + } + + static void +-print_color_indicator (const char *name, mode_t mode, int linkok) ++print_color_indicator (const char *name, mode_t mode, int linkok, ++ int stat_failed) + { + int type = C_FILE; + struct color_ext_type *ext; /* Color extension */ +@@ -3730,6 +3877,8 @@ + type = C_CHR; + else if (S_ISDOOR (mode)) + type = C_DOOR; ++ else if (stat_failed) ++ type = C_ORPHAN; + + if (type == C_FILE) + { +@@ -4219,6 +4368,16 @@ + -X sort alphabetically by entry extension\n\ + -1 list one file per line\n\ + "), stdout); ++#ifdef WITH_SELINUX ++printf(_("\nSELINUX options:\n\n\ ++ --lcontext Display security context. Enable -l. Lines\n\ ++ will probably be too wide for most displays.\n\ ++ -Z, --context Display security context so it fits on most\n\ ++ displays. Displays only mode, user, group,\n\ ++ security context and file name.\n\ ++ --scontext Display only security context and file name.\n\ ++\n\n")); ++#endif + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); + fputs (_("\n\ +@@ -4242,3 +4401,70 @@ + } + exit (status); + } ++ ++#ifdef WITH_SELINUX ++ ++static void ++print_scontext_format (const struct fileinfo *f) ++{ ++ char modebuf[12]; ++ ++ /* 7 fields that may require LONGEST_HUMAN_READABLE bytes, ++ 1 10-byte mode string, ++ 9 spaces, one following each of these fields, and ++ 1 trailing NUL byte. */ ++ ++ char init_bigbuf[7 * LONGEST_HUMAN_READABLE + 10 + 9 + 1]; ++ char *buf = init_bigbuf; ++ size_t bufsize = sizeof (init_bigbuf); ++ size_t s; ++ char *p; ++ const char *fmt; ++ char *user_name; ++ char *group_name; ++ int rv; ++ char *scontext; ++ ++ p = buf; ++ ++ if ( print_scontext ) { /* zero means terse listing */ ++ mode_string (f->stat.st_mode, modebuf); ++ modebuf[10] = (FILE_HAS_ACL (f) ? '+' : ' '); ++ modebuf[11] = '\0'; ++ ++ /* print mode */ ++ ++ (void) sprintf (p, "%s ", modebuf); ++ p += strlen (p); ++ ++ /* print standard user and group */ ++ ++ DIRED_FPUTS (buf, stdout, p - buf); ++ format_user (f->stat.st_uid, owner_width, f->stat_failed); ++ format_group (f->stat.st_gid, group_width, f->stat_failed); ++ p = buf; ++ } ++ ++ (void) sprintf (p, "%-32s ", f->scontext ?: ""); ++ p += strlen (p); ++ ++ DIRED_INDENT (); ++ DIRED_FPUTS (buf, stdout, p - buf); ++ print_name_with_quoting (f->name, f->stat.st_mode, f->linkok, ++ f->stat_failed, &dired_obstack); ++ ++ if (f->filetype == symbolic_link) { ++ if (f->linkname) { ++ DIRED_FPUTS_LITERAL (" -> ", stdout); ++ print_name_with_quoting (f->linkname, f->linkmode, f->linkok - 1, ++ f->stat_failed, NULL); ++ if (indicator_style != none) ++ print_type_indicator (f->linkmode); ++ } ++ } ++ else { ++ if (indicator_style != none) ++ print_type_indicator (f->stat.st_mode); ++ } ++} ++#endif +diff -ruN coreutils-5.97-old/src/Makefile.am coreutils-5.97/src/Makefile.am +--- coreutils-5.97-old/src/Makefile.am 2006-10-20 02:26:28.000000000 -0500 ++++ coreutils-5.97/src/Makefile.am 2006-10-20 02:30:41.000000000 -0500 +@@ -20,13 +20,13 @@ + EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who + + bin_SCRIPTS = groups +-bin_PROGRAMS = [ chgrp chown chmod cp dd dircolors du \ ++bin_PROGRAMS = [ chgrp chown chmod chcon cp dd dircolors du \ + ginstall link ln dir vdir ls mkdir \ + mkfifo mknod mv nohup readlink rm rmdir shred stat sync touch unlink \ + cat cksum comm csplit cut expand fmt fold head join md5sum \ + nl od paste pr ptx sha1sum sort split sum tac tail tr tsort unexpand uniq wc \ + basename date dirname echo env expr factor false \ +- hostname id kill logname pathchk printenv printf pwd seq sleep tee \ ++ hostname id kill logname pathchk printenv printf pwd runcon seq sleep tee \ + test true tty whoami yes \ + $(OPTIONAL_BIN_PROGS) $(DF_PROG) + +@@ -50,9 +50,9 @@ + LDADD = ../lib/libcoreutils.a $(LIBINTL) ../lib/libcoreutils.a + + # for eaccess in lib/euidaccess.c. +-cp_LDADD = $(LDADD) $(LIB_EACCESS) @LIBACL@ +-ginstall_LDADD = $(LDADD) $(LIB_EACCESS) @LIBACL@ +-mv_LDADD = $(LDADD) $(LIB_EACCESS) @LIBACL@ ++cp_LDADD = $(LDADD) $(LIB_EACCESS) @LIBACL@ @LIB_SELINUX@ ++ginstall_LDADD = $(LDADD) $(LIB_EACCESS) @LIBACL@ @LIB_SELINUX@ ++mv_LDADD = $(LDADD) $(LIB_EACCESS) @LIBACL@ @LIB_SELINUX@ + pathchk_LDADD = $(LDADD) $(LIB_EACCESS) + rm_LDADD = $(LDADD) $(LIB_EACCESS) + test_LDADD = $(LDADD) $(LIB_EACCESS) +@@ -61,11 +61,18 @@ + + # for clock_gettime and fdatasync + dd_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC) +-dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBACL@ +-ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBACL@ ++dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBACL@ @LIB_SELINUX@ ++ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBACL@ @LIB_SELINUX@ + pr_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) + shred_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC) +-vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBACL@ ++vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBACL@ @LIB_SELINUX@ ++chcon_LDADD = $(LDADD) @LIB_SELINUX@ ++id_LDADD = $(LDADD) @LIB_SELINUX@ ++mkdir_LDADD = $(LDADD) @LIB_SELINUX@ ++mkfifo_LDADD = $(LDADD) @LIB_SELINUX@ ++mknod_LDADD = $(LDADD) @LIB_SELINUX@ ++stat_LDADD = $(LDADD) @LIB_SELINUX@ ++runcon_LDADD = $(LDADD) @LIB_SELINUX@ + + ## If necessary, add -lm to resolve use of pow in lib/strtod.c. + sort_LDADD = $(LDADD) $(POW_LIB) +diff -ruN coreutils-5.97-old/src/mkdir.c coreutils-5.97/src/mkdir.c +--- coreutils-5.97-old/src/mkdir.c 2005-06-14 18:55:47.000000000 -0500 ++++ coreutils-5.97/src/mkdir.c 2006-10-20 02:27:28.000000000 -0500 +@@ -34,11 +34,18 @@ + + #define AUTHORS "David MacKenzie" + ++#ifdef WITH_SELINUX ++#include /* for is_selinux_enabled() */ ++#endif ++ + /* The name this program was run with. */ + char *program_name; + + static struct option const longopts[] = + { ++#ifdef WITH_SELINUX ++ {"context", required_argument, NULL, 'Z'}, ++#endif + {"mode", required_argument, NULL, 'm'}, + {"parents", no_argument, NULL, 'p'}, + {"verbose", no_argument, NULL, 'v'}, +@@ -60,6 +67,11 @@ + Create the DIRECTORY(ies), if they do not already exist.\n\ + \n\ + "), stdout); ++#ifdef WITH_SELINUX ++ printf (_("\ ++ -Z, --context=CONTEXT (SELinux) set security context to CONTEXT\n\ ++")); ++#endif + fputs (_("\ + Mandatory arguments to long options are mandatory for short options too.\n\ + "), stdout); +@@ -95,7 +107,11 @@ + + atexit (close_stdout); + ++#ifdef WITH_SELINUX ++ while ((optc = getopt_long (argc, argv, "pm:vZ:", longopts, NULL)) != -1) ++#else + while ((optc = getopt_long (argc, argv, "pm:v", longopts, NULL)) != -1) ++#endif + { + switch (optc) + { +@@ -108,6 +124,20 @@ + case 'v': /* --verbose */ + verbose_fmt_string = _("created directory %s"); + break; ++#ifdef WITH_SELINUX ++ case 'Z': ++ /* politely decline if we're not on a selinux-enabled kernel. */ ++ if( !(is_selinux_enabled()>0)) { ++ fprintf( stderr, "Sorry, --context (-Z) can be used only on " ++ "a selinux-enabled kernel.\n" ); ++ exit( 1 ); ++ } ++ if (setfscreatecon(optarg)) { ++ fprintf( stderr, "Sorry, cannot set default context to %s.\n", optarg); ++ exit( 1 ); ++ } ++ break; ++#endif + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: +diff -ruN coreutils-5.97-old/src/mkfifo.c coreutils-5.97/src/mkfifo.c +--- coreutils-5.97-old/src/mkfifo.c 2005-05-14 02:58:37.000000000 -0500 ++++ coreutils-5.97/src/mkfifo.c 2006-10-20 02:27:28.000000000 -0500 +@@ -32,11 +32,18 @@ + + #define AUTHORS "David MacKenzie" + ++#ifdef WITH_SELINUX ++#include /* for is_selinux_enabled() */ ++#endif ++ + /* The name this program was run with. */ + char *program_name; + + static struct option const longopts[] = + { ++#ifdef WITH_SELINUX ++ {"context", required_argument, NULL, 'Z'}, ++#endif + {"mode", required_argument, NULL, 'm'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, +@@ -57,6 +64,11 @@ + Create named pipes (FIFOs) with the given NAMEs.\n\ + \n\ + "), stdout); ++#ifdef WITH_SELINUX ++ fputs (_("\ ++ -Z, --context=CONTEXT set security context (quoted string)\n\ ++"), stdout); ++#endif + fputs (_("\ + Mandatory arguments to long options are mandatory for short options too.\n\ + "), stdout); +@@ -92,13 +104,30 @@ + #ifndef S_ISFIFO + error (EXIT_FAILURE, 0, _("fifo files not supported")); + #else ++#ifdef WITH_SELINUX ++ while ((optc = getopt_long (argc, argv, "m:Z:", longopts, NULL)) != -1) ++#else + while ((optc = getopt_long (argc, argv, "m:", longopts, NULL)) != -1) ++#endif + { + switch (optc) + { + case 'm': + specified_mode = optarg; + break; ++#ifdef WITH_SELINUX ++ case 'Z': ++ if( !(is_selinux_enabled()>0)) { ++ fprintf( stderr, "Sorry, --context (-Z) can be used only on " ++ "a selinux-enabled kernel.\n" ); ++ exit( 1 ); ++ } ++ if (setfscreatecon(optarg)) { ++ fprintf( stderr, "Sorry, cannot set default context to %s.\n", optarg); ++ exit( 1 ); ++ } ++ break; ++#endif + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: +diff -ruN coreutils-5.97-old/src/mknod.c coreutils-5.97/src/mknod.c +--- coreutils-5.97-old/src/mknod.c 2005-05-14 02:58:37.000000000 -0500 ++++ coreutils-5.97/src/mknod.c 2006-10-20 02:27:28.000000000 -0500 +@@ -36,8 +36,15 @@ + /* The name this program was run with. */ + char *program_name; + ++#ifdef WITH_SELINUX ++#include ++#endif ++ + static struct option const longopts[] = + { ++#ifdef WITH_SELINUX ++ {"context", required_argument, NULL, 'Z'}, ++#endif + {"mode", required_argument, NULL, 'm'}, + {GETOPT_HELP_OPTION_DECL}, + {GETOPT_VERSION_OPTION_DECL}, +@@ -58,6 +65,11 @@ + Create the special file NAME of the given TYPE.\n\ + \n\ + "), stdout); ++#ifdef WITH_SELINUX ++ fputs(_("\ ++ -Z, --context=CONTEXT set security context (quoted string)\n\ ++"), stdout); ++#endif + fputs (_("\ + Mandatory arguments to long options are mandatory for short options too.\n\ + "), stdout); +@@ -103,13 +115,31 @@ + + specified_mode = NULL; + ++#ifdef WITH_SELINUX ++ while ((optc = getopt_long (argc, argv, "m:Z:", longopts, NULL)) != -1) ++#else + while ((optc = getopt_long (argc, argv, "m:", longopts, NULL)) != -1) ++#endif + { + switch (optc) + { + case 'm': + specified_mode = optarg; + break; ++#ifdef WITH_SELINUX ++ case 'Z': ++ /* politely decline if we're not on a selinux-enabled kernel. */ ++ if( !(is_selinux_enabled()>0)) { ++ fprintf( stderr, "Sorry, --context (-Z) can be used only on " ++ "a selinux-enabled kernel.\n" ); ++ exit( 1 ); ++ } ++ if (setfscreatecon(optarg)) { ++ fprintf( stderr, "Sorry, cannot set default context to %s.\n", optarg); ++ exit( 1 ); ++ } ++ break; ++#endif + case_GETOPT_HELP_CHAR; + case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); + default: +diff -ruN coreutils-5.97-old/src/mv.c coreutils-5.97/src/mv.c +--- coreutils-5.97-old/src/mv.c 2006-10-20 02:26:28.000000000 -0500 ++++ coreutils-5.97/src/mv.c 2006-10-20 02:27:28.000000000 -0500 +@@ -34,6 +34,11 @@ + #include "quote.h" + #include "remove.h" + ++#ifdef WITH_SELINUX ++#include /* for is_selinux_enabled() */ ++int selinux_enabled=0; ++#endif ++ + /* The official name of this program (e.g., no `g' prefix). */ + #define PROGRAM_NAME "mv" + +@@ -127,6 +132,10 @@ + x->preserve_links = true; + x->preserve_mode = true; + x->preserve_timestamps = true; ++#ifdef WITH_SELINUX ++ x->preserve_security_context = true; ++ x->set_security_context = false; ++#endif + x->require_preserve = false; /* FIXME: maybe make this an option */ + x->recursive = true; + x->sparse_mode = SPARSE_AUTO; /* FIXME: maybe make this an option */ +@@ -365,6 +374,10 @@ + + cp_option_init (&x); + ++#ifdef WITH_SELINUX ++ selinux_enabled= (is_selinux_enabled()>0); ++#endif ++ + /* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless + we'll actually use backup_suffix_string. */ + backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX"); +diff -ruN coreutils-5.97-old/src/runcon.c coreutils-5.97/src/runcon.c +--- coreutils-5.97-old/src/runcon.c 1969-12-31 18:00:00.000000000 -0600 ++++ coreutils-5.97/src/runcon.c 2006-10-20 02:27:28.000000000 -0500 +@@ -0,0 +1,253 @@ ++/* ++ * runcon [ context | ++ * ( [ -c ] [ -r role ] [-t type] [ -u user ] [ -l levelrange ] ) ++ * command [arg1 [arg2 ...] ] ++ * ++ * attempt to run the specified command with the specified context. ++ * ++ * -r role : use the current context with the specified role ++ * -t type : use the current context with the specified type ++ * -u user : use the current context with the specified user ++ * -l level : use the current context with the specified level range ++ * -c : compute process transition context before modifying ++ * ++ * Contexts are interpreted as follows: ++ * ++ * Number of MLS ++ * components system? ++ * ++ * 1 - type ++ * 2 - role:type ++ * 3 Y role:type:range ++ * 3 N user:role:type ++ * 4 Y user:role:type:range ++ * 4 N error ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "system.h" ++extern int errno; ++ ++/* The name the program was run with. */ ++char *program_name; ++ ++/* If nonzero, display usage information and exit. */ ++static int show_help; ++ ++/* If nonzero, print the version on standard output and exit. */ ++static int show_version; ++ ++void ++usage(int status) ++{ ++ printf(_("Usage: %s CONTEXT COMMAND [args]\n" ++ " or: %s [ -c ] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [args]\n" ++ "Run a program in a different security context.\n\n" ++ " CONTEXT Complete security context\n" ++ " -c, --compute compute process transition context before modifying\n" ++ " -t, --type=TYPE type (for same role as parent)\n" ++ " -u, --user=USER user identity\n" ++ " -r, --role=ROLE role\n" ++ " -l, --range=RANGE levelrange\n" ++ " --help display this help and exit\n" ++ " --version output version information and exit\n"), ++ program_name, program_name); ++ exit(status); ++} ++ ++int ++main(int argc,char **argv,char **envp ) ++{ ++ char *role = 0; ++ char *range = 0; ++ char *user = 0; ++ char *type = 0; ++ char *context = NULL; ++ security_context_t cur_context = NULL; ++ security_context_t file_context = NULL; ++ security_context_t new_context = NULL; ++ int compute_trans = 0; ++ ++ context_t con; ++ ++ program_name = argv[0]; ++ setlocale (LC_ALL, ""); ++ bindtextdomain (PACKAGE, LOCALEDIR); ++ textdomain (PACKAGE); ++ ++ while (1) { ++ int c; ++ int this_option_optind = optind ? optind : 1; ++ int option_index = 0; ++ static struct option long_options[] = { ++ { "role", 1, 0, 'r' }, ++ { "type", 1, 0, 't' }, ++ { "user", 1, 0, 'u' }, ++ { "range", 1, 0, 'l' }, ++ { "compute", 0, 0, 'c' }, ++ { "help", 0, &show_help, 1 }, ++ { "version", 0, &show_version, 1 }, ++ { 0, 0, 0, 0 } ++ }; ++ c = getopt_long(argc, argv, "r:t:u:l:c", long_options, &option_index); ++ if ( c == -1 ) { ++ break; ++ } ++ switch ( c ) { ++ case 0: ++ break; ++ case 'r': ++ if ( role ) { ++ fprintf(stderr,_("multiple roles\n")); ++ exit(1); ++ } ++ role = optarg; ++ break; ++ case 't': ++ if ( type ) { ++ fprintf(stderr,_("multiple types\n")); ++ exit(1); ++ } ++ type = optarg; ++ break; ++ case 'u': ++ if ( user ) { ++ fprintf(stderr,_("multiple users\n")); ++ exit(1); ++ } ++ user = optarg; ++ break; ++ case 'l': ++ if ( range ) { ++ fprintf(stderr,_("multiple levelranges\n")); ++ exit(1); ++ } ++ range = optarg; ++ break; ++ case 'c': ++ compute_trans = 1; ++ break; ++ default: ++ usage(1); ++ break; ++ } ++ } ++ ++ if (show_version) { ++ printf("runcon (%s) %s\n", GNU_PACKAGE, VERSION); ++ exit(0); ++ } ++ ++ if (show_help) ++ usage(0); ++ ++ if ( !(user || role || type || range || compute_trans)) { ++ if ( optind >= argc ) { ++ fprintf(stderr,_("must specify -c, -t, -u, -l, -r, or context\n")); ++ usage(1); ++ } ++ context = argv[optind++]; ++ } ++ ++ if ( optind >= argc ) { ++ fprintf(stderr,_("no command found\n")); ++ usage(1); ++ } ++ ++ if( is_selinux_enabled() != 1 ) { ++ fprintf( stderr, ++ _("runcon may be used only on a SELinux kernel.\n") ); ++ exit(-1); ++ } ++ ++ if ( context ) { ++ con = context_new(context); ++ if (!con) { ++ fprintf(stderr,_("%s is not a valid context\n"), context); ++ exit(1); ++ } ++ } ++ else { ++ if (getcon(&cur_context) < 0) { ++ fprintf(stderr,_("Couldn't get current context.\n")); ++ exit(1); ++ } ++ ++ /* We will generate context based on process transition */ ++ if ( compute_trans ) { ++ /* Get context of file to be executed */ ++ if (getfilecon(argv[optind], &file_context) == -1) { ++ fprintf(stderr,_("unable to retrieve attributes of %s\n"), ++ argv[optind]); ++ exit(1); ++ } ++ /* compute result of process transition */ ++ if (security_compute_create(cur_context, file_context, ++ SECCLASS_PROCESS, &new_context) != 0) { ++ fprintf(stderr,_("unable to compute a new context\n")); ++ exit(1); ++ } ++ /* free contexts */ ++ freecon(file_context); ++ freecon(cur_context); ++ ++ /* set cur_context equal to new_context */ ++ cur_context = new_context; ++ } ++ ++ con = context_new(cur_context); ++ if (!con) { ++ fprintf(stderr,_("%s is not a valid context\n"), cur_context); ++ exit(1); ++ } ++ if ( user ) { ++ if ( context_user_set(con,user)) { ++ fprintf(stderr,_("failed to set new user %s\n"),user); ++ exit(1); ++ } ++ } ++ if ( type ) { ++ if ( context_type_set(con,type)) { ++ fprintf(stderr,_("failed to set new type %s\n"),type); ++ exit(1); ++ } ++ } ++ if ( range ) { ++ if ( context_range_set(con,range)) { ++ fprintf(stderr,_("failed to set new range %s\n"),range); ++ exit(1); ++ } ++ } ++ if ( role ) { ++ if (context_role_set(con,role)) { ++ fprintf(stderr,_("failed to set new role %s\n"),role); ++ exit(1); ++ } ++ } ++ } ++ ++ if (security_check_context(context_str(con)) < 0) { ++ fprintf(stderr, _("%s is not a valid context\n"), context_str(con)); ++ exit(1); ++ } ++ ++ if (setexeccon(context_str(con))!=0) { ++ fprintf(stderr,_("unable to setup security context %s\n"), context_str(con)); ++ exit(1); ++ } ++ if (cur_context!=NULL) ++ freecon(cur_context); ++ ++ if ( execvp(argv[optind],argv+optind) ) { ++ perror("execvp"); ++ exit(1); ++ } ++ return 1; /* can't reach this statement.... */ ++} +diff -ruN coreutils-5.97-old/src/stat.c coreutils-5.97/src/stat.c +--- coreutils-5.97-old/src/stat.c 2005-12-15 15:25:53.000000000 -0600 ++++ coreutils-5.97/src/stat.c 2006-10-20 02:27:28.000000000 -0500 +@@ -42,6 +42,13 @@ + # endif + #endif + ++#ifdef WITH_SELINUX ++#include ++#define SECURITY_ID_T security_context_t ++#else ++#define SECURITY_ID_T char * ++#endif ++ + #include "system.h" + + #include "error.h" +@@ -112,6 +119,7 @@ + }; + + static struct option const long_options[] = { ++ {"context", no_argument, 0, 'Z'}, + {"dereference", no_argument, NULL, 'L'}, + {"file-system", no_argument, NULL, 'f'}, + {"filesystem", no_argument, NULL, 'f'}, /* obsolete and undocumented alias */ +@@ -331,7 +339,7 @@ + /* print statfs info */ + static void + print_statfs (char *pformat, size_t buf_len, char m, char const *filename, +- void const *data) ++ void const *data, SECURITY_ID_T scontext) + { + STRUCT_STATVFS const *statfsbuf = data; + +@@ -403,7 +411,10 @@ + xstrcat (pformat, buf_len, PRIdMAX); + printf (pformat, (intmax_t) (statfsbuf->f_ffree)); + break; +- ++ case 'C': ++ strcat (pformat, "s"); ++ printf(scontext); ++ break; + default: + xstrcat (pformat, buf_len, "c"); + printf (pformat, m); +@@ -414,7 +425,7 @@ + /* print stat info */ + static void + print_stat (char *pformat, size_t buf_len, char m, +- char const *filename, void const *data) ++ char const *filename, void const *data, SECURITY_ID_T scontext) + { + struct stat *statbuf = (struct stat *) data; + struct passwd *pw_ent; +@@ -548,6 +559,10 @@ + xstrcat (pformat, buf_len, TYPE_SIGNED (time_t) ? "ld" : "lu"); + printf (pformat, (unsigned long int) statbuf->st_ctime); + break; ++ case 'C': ++ strcat (pformat, "s"); ++ printf(pformat,scontext); ++ break; + default: + xstrcat (pformat, buf_len, "c"); + printf (pformat, m); +@@ -595,8 +610,9 @@ + + static void + print_it (char const *format, char const *filename, +- void (*print_func) (char *, size_t, char, char const *, void const *), +- void const *data) ++ void (*print_func) (char *, size_t, char, char const *, void const *, ++ SECURITY_ID_T ), ++ void const *data, SECURITY_ID_T scontext) + { + /* Add 2 to accommodate our conversion of the stat `%s' format string + to the longer printf `%llu' one. */ +@@ -627,7 +643,7 @@ + putchar ('%'); + break; + default: +- print_func (dest, n_alloc, *fmt_char, filename, data); ++ print_func (dest, n_alloc, *fmt_char, filename, data, scontext); + break; + } + break; +@@ -690,9 +706,17 @@ + + /* Stat the file system and print what we find. */ + static bool +-do_statfs (char const *filename, bool terse, char const *format) ++do_statfs (char const *filename, bool terse, bool secure, char const *format) + { + STRUCT_STATVFS statfsbuf; ++ SECURITY_ID_T scontext = NULL; ++#ifdef WITH_SELINUX ++ if(secure) ++ if (getfilecon(filename,&scontext)<0) { ++ perror (filename); ++ return false; ++ } ++#endif + + if (STATFS (filename, &statfsbuf) != 0) + { +@@ -703,25 +727,46 @@ + + if (format == NULL) + { +- format = (terse +- ? "%n %i %l %t %s %S %b %f %a %c %d\n" +- : " File: \"%n\"\n" +- " ID: %-8i Namelen: %-7l Type: %T\n" +- "Block size: %-10s Fundamental block size: %S\n" +- "Blocks: Total: %-10b Free: %-10f Available: %a\n" +- "Inodes: Total: %-10c Free: %d\n"); ++ if (terse) ++ { ++ if (secure) ++ format = "%n %i %l %t %s %S %b %f %a %c %d %C\n"; ++ else ++ format = "%n %i %l %t %s %S %b %f %a %c %d\n"; ++ } ++ else ++ { ++ if (secure) ++ format = " File: \"%n\"\n" ++ " ID: %-8i Namelen: %-7l Type: %T\n" ++ "Block size: %-10s Fundamental block size: %S\n" ++ "Blocks: Total: %-10b Free: %-10f Available: %a\n" ++ "Inodes: Total: %-10c Free: %d\n" ++ " S_Context: %C\n"; ++ else ++ format = " File: \"%n\"\n" ++ " ID: %-8i Namelen: %-7l Type: %T\n" ++ "Block size: %-10s Fundamental block size: %S\n" ++ "Blocks: Total: %-10b Free: %-10f Available: %a\n" ++ "Inodes: Total: %-10c Free: %d\n"; ++ } + } + +- print_it (format, filename, print_statfs, &statfsbuf); ++ print_it (format, filename, print_statfs, &statfsbuf, scontext); ++#ifdef WITH_SELINUX ++ if (scontext != NULL) ++ freecon(scontext); ++#endif + return true; + } + + /* stat the file and print what we find */ + static bool +-do_stat (char const *filename, bool follow_links, bool terse, ++do_stat (char const *filename, bool follow_links, bool terse, bool secure, + char const *format) + { + struct stat statbuf; ++ SECURITY_ID_T scontext = NULL; + + if ((follow_links ? stat : lstat) (filename, &statbuf) != 0) + { +@@ -729,11 +774,29 @@ + return false; + } + ++#ifdef WITH_SELINUX ++ if(secure) { ++ int i; ++ if (!follow_links) ++ i=lgetfilecon(filename, &scontext); ++ else ++ i=getfilecon(filename, &scontext); ++ if (i == -1) ++ { ++ perror (filename); ++ return false; ++ } ++ } ++#endif ++ + if (format == NULL) + { + if (terse) + { +- format = "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\n"; ++ if (secure) ++ format = "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o %C\n"; ++ else ++ format = "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o\n"; + } + else + { +@@ -751,16 +814,30 @@ + } + else + { +- format = +- " File: %N\n" +- " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" +- "Device: %Dh/%dd\tInode: %-10i Links: %h\n" +- "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" +- "Access: %x\n" "Modify: %y\n" "Change: %z\n"; ++ if (secure) ++ format = ++ " File: %N\n" ++ " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" ++ "Device: %Dh/%dd\tInode: %-10i Links: %-5h" ++ " Device type: %t,%T\n" ++ "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" ++ " S_Context: %C\n" ++ "Access: %x\n" "Modify: %y\n" "Change: %z\n"; ++ else ++ format = ++ " File: %N\n" ++ " Size: %-10s\tBlocks: %-10b IO Block: %-6o %F\n" ++ "Device: %Dh/%dd\tInode: %-10i Links: %h\n" ++ "Access: (%04a/%10.10A) Uid: (%5u/%8U) Gid: (%5g/%8G)\n" ++ "Access: %x\n" "Modify: %y\n" "Change: %z\n"; + } + } + } +- print_it (format, filename, print_stat, &statbuf); ++ print_it (format, filename, print_stat, &statbuf, scontext); ++#ifdef WITH_SELINUX ++ if (scontext) ++ freecon(scontext); ++#endif + return true; + } + +@@ -777,6 +854,7 @@ + Display file or file system status.\n\ + \n\ + -L, --dereference follow links\n\ ++ -Z, --context print the security context \n\ + -f, --file-system display file system status instead of file status\n\ + "), stdout); + fputs (_("\ +@@ -836,6 +914,7 @@ + %c Total file nodes in file system\n\ + %d Free file nodes in file system\n\ + %f Free blocks in file system\n\ ++ %C - Security context in SELinux\n\ + "), stdout); + fputs (_("\ + %i File System ID in hex\n\ +@@ -860,6 +939,7 @@ + bool follow_links = false; + bool fs = false; + bool terse = false; ++ bool secure = false; + char *format = NULL; + bool ok = true; + +@@ -871,7 +951,7 @@ + + atexit (close_stdout); + +- while ((c = getopt_long (argc, argv, "c:fLt", long_options, NULL)) != -1) ++ while ((c = getopt_long (argc, argv, "c:fLtZ", long_options, NULL)) != -1) + { + switch (c) + { +@@ -898,6 +978,14 @@ + case 't': + terse = true; + break; ++ case 'Z': ++ if((is_selinux_enabled()>0)) ++ secure = 1; ++ else { ++ error (0, 0, _("Kernel is not SELinux enabled")); ++ usage (EXIT_FAILURE); ++ } ++ break; + + case_GETOPT_HELP_CHAR; + +@@ -916,8 +1004,8 @@ + + for (i = optind; i < argc; i++) + ok &= (fs +- ? do_statfs (argv[i], terse, format) +- : do_stat (argv[i], follow_links, terse, format)); ++ ? do_statfs (argv[i], terse, secure, format) ++ : do_stat (argv[i], follow_links, terse, secure, format)); + + exit (ok ? EXIT_SUCCESS : EXIT_FAILURE); + } +diff -ruN coreutils-5.97-old/tests/help-version coreutils-5.97/tests/help-version +--- coreutils-5.97-old/tests/help-version 2006-06-01 02:26:09.000000000 -0500 ++++ coreutils-5.97/tests/help-version 2006-10-20 02:27:28.000000000 -0500 +@@ -46,6 +46,8 @@ + + # Skip `test'; it doesn't accept --help or --version. + test $i = test && continue; ++ test $i = chcon && continue; ++ test $i = runcon && continue; + + # false fails even when invoked with --help or --version. + if test $i = false; then +@@ -161,7 +163,7 @@ + + for i in $all_programs; do + # Skip these. +- case $i in chroot|stty|tty|false) continue;; esac ++ case $i in chroot|stty|tty|false|chcon|runcon) continue;; esac + + rm -rf $tmp_in $tmp_in2 $tmp_dir $tmp_out + echo > $tmp_in --- coreutils-5.97.orig/debian/patches/99_s390noshas +++ coreutils-5.97/debian/patches/99_s390noshas @@ -0,0 +1,28 @@ +diff -u -r coreutils-5.97.bak/tests/sha384sum/basic-1 coreutils-5.97/tests/sha384sum/basic-1 +--- coreutils-5.97.bak/tests/sha384sum/basic-1 2006-08-25 19:44:38.677990000 -0400 ++++ coreutils-5.97/tests/sha384sum/basic-1 2006-08-25 20:00:28.711265183 -0400 +@@ -3,6 +3,10 @@ + : ${PERL=perl} + : ${srcdir=.} + ++if [ `dpkg-architecture -qDEB_HOST_ARCH` = s390 ] ; then ++ exit 77 ++fi ++ + $PERL -e 1 > /dev/null 2>&1 || { + echo 1>&2 "$0: configure didn't find a usable version of Perl," \ + "so can't run this test" +diff -u -r coreutils-5.97.bak/tests/sha512sum/basic-1 coreutils-5.97/tests/sha512sum/basic-1 +--- coreutils-5.97.bak/tests/sha512sum/basic-1 2006-08-25 19:44:38.677990000 -0400 ++++ coreutils-5.97/tests/sha512sum/basic-1 2006-08-25 20:00:40.435288251 -0400 +@@ -3,6 +3,10 @@ + : ${PERL=perl} + : ${srcdir=.} + ++if [ `dpkg-architecture -qDEB_HOST_ARCH` = s390 ] ; then ++ exit 77 ++fi ++ + $PERL -e 1 > /dev/null 2>&1 || { + echo 1>&2 "$0: configure didn't find a usable version of Perl," \ + "so can't run this test" --- coreutils-5.97.orig/debian/patches/60_ubuntu-force-clobber-specials.patch +++ coreutils-5.97/debian/patches/60_ubuntu-force-clobber-specials.patch @@ -0,0 +1,60 @@ +--- /tmp/copy.c 2006-11-22 17:42:35.000000000 +0100 ++++ coreutils-5.97/src/copy.c 2006-11-22 17:51:17.000000000 +0100 +@@ -1617,26 +1617,46 @@ + goto un_backup; + } + else ++#define CALL_PERHAPS_UNLINK(call,errormsg) do{ \ ++ if (call) \ ++ { \ ++ if (errno != EEXIST || !x->unlink_dest_after_failed_open) \ ++ { \ ++ errormsg \ ++ goto un_backup; \ ++ } \ ++ if (unlink (dst_name) != 0) \ ++ { \ ++ error (0, errno, _("cannot remove %s"), quote (dst_name)); \ ++ goto un_backup; \ ++ } \ ++ if (call) \ ++ { \ ++ errormsg \ ++ goto un_backup; \ ++ } \ ++ } \ ++ }while(0) + #ifdef S_ISFIFO + if (S_ISFIFO (src_mode)) + { +- if (mkfifo (dst_name, src_mode)) +- { +- error (0, errno, _("cannot create fifo %s"), quote (dst_name)); +- goto un_backup; +- } ++ CALL_PERHAPS_UNLINK ++ ( ++ mkfifo (dst_name, src_mode), ++ error (0, errno, _("cannot create fifo %s"), quote (dst_name)); ++ ); + } + else + #endif + if (S_ISBLK (src_mode) || S_ISCHR (src_mode) + || S_ISSOCK (src_mode)) + { +- if (mknod (dst_name, src_mode, src_sb.st_rdev)) +- { +- error (0, errno, _("cannot create special file %s"), +- quote (dst_name)); +- goto un_backup; +- } ++ CALL_PERHAPS_UNLINK ++ ( ++ mknod (dst_name, src_mode, src_sb.st_rdev), ++ error (0, errno, _("cannot create special file %s"), ++ quote (dst_name)); ++ ); + } + else + #ifdef S_ISLNK --- coreutils-5.97.orig/debian/patches/98_fix_chmod_manpage +++ coreutils-5.97/debian/patches/98_fix_chmod_manpage @@ -0,0 +1,15 @@ +--- coreutils-5.93-old/man/chmod.x 2001-10-20 16:41:23.000000000 +0200 ++++ coreutils-5.97/man/chmod.x 2005-12-07 17:59:33.000000000 +0100 +@@ -62,8 +62,8 @@ + On some systems, only the superuser can set the sticky bit on files. + .SH STICKY DIRECTORIES + When the sticky bit is set on a directory, files in that directory may +-be unlinked or renamed only by root or their owner. Without the +-sticky bit, anyone able to write to the directory can delete or rename +-files. The sticky bit is commonly found on directories, such as /tmp, +-that are world-writable. ++be unlinked or renamed only by the directory owner as well as by root ++or the file owner. Without the sticky bit, anyone able to write to the ++directory can delete or rename files. The sticky bit is commonly found ++on directories, such as /tmp, that are world-writable. + .SH OPTIONS --- coreutils-5.97.orig/debian/patches/63_dd-appenderrors +++ coreutils-5.97/debian/patches/63_dd-appenderrors @@ -0,0 +1,12 @@ +--- coreutils-5.97/src/dd.c.orig 2006-06-26 10:17:02.143014002 -0400 ++++ coreutils-5.97/src/dd.c 2006-06-26 10:20:17.456920048 -0400 +@@ -954,6 +954,9 @@ + error (EXIT_FAILURE, 0, _("cannot combine lcase and ucase")); + if (multiple_bits_set (conversions_mask & (C_EXCL | C_NOCREAT))) + error (EXIT_FAILURE, 0, _("cannot combine excl and nocreat")); ++ if ((output_flags & O_APPEND) && ++ ((conversions_mask & C_NOTRUNC) != C_NOTRUNC)) ++ error (0, 0, _("you probably want conv=notrunc with oflag=append")); + } + + /* Fix up translation table. */ --- coreutils-5.97.orig/debian/coreutils.README.Debian +++ coreutils-5.97/debian/coreutils.README.Debian @@ -0,0 +1,11 @@ +The new coreutils package combines the previous fileutils, shellutils, +and textutils packages. + +Be aware that the following modifications have not been accepted +upstream and should be avoided in portable applications: +* uniq: --separator and --check-fields +* cat: --reversible +* tsort: cycle breaking +* join: -n +* paste: --first-eof + --- coreutils-5.97.orig/debian/rules +++ coreutils-5.97/debian/rules @@ -0,0 +1,190 @@ +#!/usr/bin/make -f +# This file is public domain software, originally written by Joey Hess. + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +export DH_COMPAT=4 + +TAR_DIR = coreutils-5.97 + +# the dbs rules +include /usr/share/dbs/dbs-build.mk +include /usr/share/dbs/dpkg-arch.mk + +# work around dpkg changes +DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null) +DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) +ifeq ($(DEB_HOST_ARCH_CPU),) + DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) + ifeq ($(DEB_HOST_ARCH_CPU),x86_64) + DEB_HOST_ARCH_CPU := amd64 + endif +endif +ifeq ($(DEB_HOST_ARCH_OS),) + DEB_HOST_ARCH_OS := $(subst -gnu,,$(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)) + ifeq ($(DEB_HOST_ARCH_OS),gnu) + DEB_HOST_ARCH_OS := hurd + endif +endif + +# implement no optimization build option +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) +CFLAGS = "-g -DSYSLOG_SUCCESS -DSYSLOG_FAILURE -DSYSLOG_NON_ROOT -O0" +else +CFLAGS = "-g -DSYSLOG_SUCCESS -DSYSLOG_FAILURE -DSYSLOG_NON_ROOT -O2" +endif +LDFLAGS = + +# determine whether to build with SELinux +ifeq ($(DEB_HOST_ARCH_OS),linux) + SELINUX_OPTS := --enable-selinux +else + SELINUX_OPTS := +endif + +BIN_PROGS = cat chgrp chmod chown cp date dd df dir echo false ln ls mkdir \ + mknod mv pwd readlink rm rmdir vdir sleep stty sync touch true uname +d=debian/coreutils + +default: binary + +configure: configure-stamp +configure-stamp: $(patched) + dh_testdir + + cd $(BUILD_TREE) && autoreconf + + cd $(BUILD_TREE) && CFLAGS=$(CFLAGS) \ + LDFLAGS=$(LDFLAGS) ./configure \ + --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \ + --prefix=/usr -v \ + --infodir=/usr/share/info --mandir=/usr/share/man \ + $(SELINUX_OPTS) + + touch configure-stamp +ifeq ($(DEB_HOST_ARCH_OS),hurd) + touch $(BUILD_TREE)/man/{ch,run}con.1 +endif + +build: configure-stamp build-stamp +build-stamp: $(patched) + dh_testdir + + cd $(BUILD_TREE) && $(MAKE) +ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) + # mstone patch doesn't set these executable, tests break + chmod +x $(BUILD_TREE)/tests/sha{224,256,384,512}sum/basic-1 + cd $(BUILD_TREE) && $(MAKE) check +endif + + touch build-stamp + +clean: + dh_testdir + rm -f build-stamp configure-stamp + + rm -rf $(STAMP_DIR) $(SOURCE_DIR) debian/buildinfo + + dh_clean + +install: +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + cd $(BUILD_TREE) && $(MAKE) install DESTDIR=$(CURDIR)/$(d) + + # some things go in root rather than usr + for f in $(BIN_PROGS); do \ + mv $(d)/usr/bin/$$f $(d)/bin/$$f; \ + done + + # backward compatability + ln -s /usr/bin/md5sum $(d)/usr/bin/md5sum.textutils + ln -s /usr/share/man/man1/md5sum.1 $(d)/usr/share/man/man1/md5sum.textutils.1 + + # some things we don't do for hurd +ifneq ($(DEB_HOST_ARCH_OS),hurd) + # touch used to be in /usr/bin, don't break scripts + ln -s /bin/touch $(d)/usr/bin/touch +endif + + # remove stuff provided by other packages +ifeq ($(DEB_HOST_ARCH_OS),linux) + # kill from procps is linux-specific + rm -f $(d)/usr/bin/kill $(d)/usr/share/man/man1/kill.1 +endif +ifneq ($(DEB_HOST_ARCH_OS),hurd) + rm -f $(d)/usr/bin/su $(d)/usr/share/man/man1/su.1 +endif +ifeq ($(DEB_HOST_ARCH_CPU),s390) + rm -f $(d)/usr/{bin,share/man/man1}/sha{384,512}sum* +endif + rm -f $(d)/usr/bin/hostname $(d)/usr/share/man/man1/hostname.1 + rm -f $(d)/usr/bin/uptime $(d)/usr/share/man/man1/uptime.1 + + # the [ program doesn't have its own man page yet + ln -s test.1 $(d)/usr/share/man/man1/[.1 + + # gnu thinks chroot is in bin, debian thinks it's in sbin + install -d $(d)/usr/sbin $(d)/usr/share/man/man8 + mv $(d)/usr/bin/chroot $(d)/usr/sbin/chroot + sed s/\"1\"/\"8\"/1 $(d)/usr/share/man/man1/chroot.1 > $(d)/usr/share/man/man8/chroot.8 + rm $(d)/usr/share/man/man1/chroot.1 + + cp $(BUILD_TREE)/AUTHORS \ + $(BUILD_TREE)/NEWS $(BUILD_TREE)/README \ + $(BUILD_TREE)/THANKS \ + $(BUILD_TREE)/THANKS-to-translators $(BUILD_TREE)/TODO \ + $(d)/usr/share/doc/coreutils + + dh_install + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir -i + dh_testroot -i + dh_installchangelogs -i + dh_installdocs -i + dh_buildinfo + dh_installexamples -i + dh_installinfo -i + dh_installman -i + dh_link -i + dh_compress -i + dh_fixperms -i + dh_installdeb -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir -a + dh_testroot -a + dh_installchangelogs -a $(BUILD_TREE)/doc/ChangeLog + dh_installdocs -a + dh_buildinfo -a + dh_installexamples -a + dh_installinfo -a $(BUILD_TREE)/doc/coreutils.info + dh_installman -a +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + dh_strip -a +endif + dh_link -a + dh_compress -a + dh_fixperms -a +ifeq ($(DEB_HOST_ARCH_OS),gnu) + chmod u+s $(d)/usr/bin/su +endif + dh_installdeb -a + dh_shlibdeps -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- coreutils-5.97.orig/debian/changelog +++ coreutils-5.97/debian/changelog @@ -0,0 +1,719 @@ +coreutils (5.97-5.3ubuntu3) gutsy; urgency=low + + * Trigger rebuild for hppa. + + -- LaMont Jones Fri, 28 Sep 2007 10:45:28 -0600 + +coreutils (5.97-5.3ubuntu2) gutsy; urgency=low + + * Add patches/99_cu_futimens.patch to rename the internal futimens + function, so it doesn't conflict with the same from glibc-2.6. + + -- Adam Conrad Mon, 30 Jul 2007 07:50:46 +0000 + +coreutils (5.97-5.3ubuntu1) gutsy; urgency=low + + * Merge to Debian unstable. Remaining Ubuntu changes: + - 60_ubuntu-force-clobber-specials.patch: Cause cp to replace special + files when "-a -f" is specified, and the special already exists; instead + of just erroring. (Reported upstream in + http://lists.gnu.org/archive/html/bug-coreutils/2006-07/msg00018.html) + - 64_mkdir-chmod-race.patch: Avoid --mode race when using mkdir in a + world-writable directory. Another local user could use the race + condition to gain unintended permissions to files. (Debian #304556, + fixed upstream in 6.1). [CVE-2005-1039] + - 98_fix_chmod_manpage: Fix description of the sticky bit for directories. + (Debian #376745, LP #24896, fix applied upstream) + - 99a_fix_cp_manpage: Fix formatting of 'mv' and 'cp' manpages. (Debian + #351601, fix applied upstream). + + -- Martin Pitt Wed, 16 May 2007 14:51:05 +0200 + +coreutils (5.97-5.3) unstable; urgency=high + + * This is a non-maintainer upload done with the maintainer's blessing, + to fix a FTBS bug, and to get the SELinux changes in through to Etch. + * Bug fix: "coreutils - FTBFS", thanks to Bastian Blank and Andreas + Barth. The problem is with a build time test suite, which did not + take into account that there could be two directory names with the + same inode, which is what happens if there is a bind mount. So this + is not anything s390 specific, nor is it a problem with the coreutils + package itself, just with the build time test. Applied a version of + the patch being used by upstream to fix the test. + (Closes: #380552, #407628). + + -- Manoj Srivastava Tue, 23 Jan 2007 15:00:28 -0600 + +coreutils (5.97-5.2ubuntu3) feisty; urgency=low + + * Rebuild for changes in the amd64 toolchain. + * Set Ubuntu maintainer address. + + -- Matthias Klose Mon, 5 Mar 2007 01:13:59 +0000 + +coreutils (5.97-5.2ubuntu2) feisty; urgency=low + + * fix incorrect merge of '60_ubuntu-force-clobber-specials.patch' + + -- Michael Vogt Wed, 22 Nov 2006 17:39:23 +0100 + +coreutils (5.97-5.2ubuntu1) feisty; urgency=low + + * Merge from debian unstable. + * Update `60_ubuntu-force-clobber-specials.patch' + * Update `64_mkdir-chmod-race.patch' + * Update `98_fix_chmod_manpage' + * Update `99a_fix_cp_manpage' + + -- Michael Vogt Wed, 22 Nov 2006 07:49:16 +0100 + +coreutils (5.97-5.2) unstable; urgency=low + + * This is an follow up non-maintainer upload to fix an issue introduced + in my last NMU. This fixes an FTBS bugs when building for non-SELinux + environments, for example, for non Linux architectures. + * Bug fix: "coreutils: FTBFS on hurd and kfreebsd: Unguarded usage of + SELinux code", thanks to Michael Banck. I missed out on guarding + assignments one. Rather than use the suggested patch (which adds two + members to a struct on non-selinux machines that would never get used, + I went back and corrected the non-selinux patch, since that is the + correct location to add this fix. The version of the patch included + in this version should do the right thing. (Closes: #396655). + + -- Manoj Srivastava Sun, 5 Nov 2006 16:04:08 -0600 + +coreutils (5.97-5.1) unstable; urgency=low + + * With permission from the maintainer, this upload (from a non-maintainer) + updates the SELinux patch, synchronizing with the latest patches from + fedora core (:pserver:anonymous@cvs.fedora.redhat.com:/cvs/dist, + repository rpms/coreutils/devel). The patches had to be tweaked for + Debian. This bring coreutils into compatibility with the latest + version of SELinux now in Debian. + * Bug fix: "coreutils: Updated SELinux patch", thanks to Manoj + Srivastava. The NMU patch is available in that bug report, + essentially, this is a minimal change upload. (Closes: #394287). + + -- Manoj Srivastava Fri, 20 Oct 2006 15:11:27 -0500 + +coreutils (5.97-5) unstable; urgency=medium + + * Actually kill sha384 and sha512 on s390. Finally got logged into an s390 + system, which makes debugging easier. (Conversely, buildds that fail a + build without providing a log make debugging harder.) Note to debian + developers: if you want introduce a dependency on sha384 or sha512, talk + to me first. + + -- Michael Stone Thu, 31 Aug 2006 07:38:19 -0400 + +coreutils (5.97-4) unstable; urgency=medium + + * s390 just doesn't seem to like sha384 (tests fail). I'm gonna kill that & + sha512 on s390 until someone with access to that arch & interest in the + problem steps up. + * add new catalan translation Closes: #384563 + + -- Michael Stone Thu, 03 Aug 2006 20:53:46 -0400 + +coreutils (5.97-3) unstable; urgency=low + + * Update sha2 patch to fix alignment issue on sparc + (Thanks David Madore) + + -- Michael Stone Thu, 03 Aug 2006 20:53:46 -0400 + +coreutils (5.97-2) unstable; urgency=low + + * Update sha2 patch to fix FTBFS on various architectures + (Thanks David Madore) + + -- Michael Stone Tue, 01 Aug 2006 20:21:05 -0400 + +coreutils (5.97-1) unstable; urgency=low + + * New upstream version + - cat options work in /proc Closes: 370583 + * [70] add sha2 utilities Closes: 325205 + * remove spurious removal of /usr/share/man/man1/md5sum.textutils + in preinst + + -- Michael Stone Wed, 26 Jul 2006 07:34:44 -0400 + +coreutils (5.96-5ubuntu4) edgy; urgency=low + + * Add '64_mkdir-chmod-race.patch' to solve --mode race when using + mkdir in a world-writable directory. Another local user could + use the race condition to gain unintended permissions to files. + This is discussed in Debian bug #304556. Also solved in + upstream version 6.1. + * CVE-2005-1039 + + -- Kees Cook Sun, 17 Sep 2006 12:29:30 -0700 + +coreutils (5.96-5ubuntu3) edgy; urgency=low + + * Revert 64_chmod-race.patch, which causes the testsuite to fail. I'm + assured that a better patch is in the works, which should work better. + + -- Adam Conrad Wed, 23 Aug 2006 17:44:59 +1000 + +coreutils (5.96-5ubuntu2) edgy; urgency=low + + * Add '64_chmod-race.patch' to solve --mode race when working in a + world-writable directory. Another local user could use the race + condition to gain unintended permissions to files. (Solves Debian + bug #304556) + * CVE-2005-1039 + + -- Kees Cook Fri, 11 Aug 2006 18:59:15 -0700 + +coreutils (5.96-5ubuntu1) edgy; urgency=low + + * Merge from debian unstable. + * Update `60_ubuntu-force-clobber-specials.patch' to 1. work + on fifos too and 2. not have a race which can make it overwrite + things when -f (or equivalent) is not supplied. + * Replace `99a_fix_cp_manpage': the old patch edited an cp.1 which is an + an output file. Instead, use the patch from Jim Meyering's message of + 6.2.2006 in Debian #351601. + * Remaining Ubuntu differences: + - 60_ubuntu-force-clobber-specials.patch (improved; reported upstream). + - 99a_fix_cp_manpage (improved; Debian #351606, Malone #30155). + - 98_fix_chmod_manpage (Malone #24896) + - Slight improvement to references for md5sum diversion in + coreutils.preinst (See comments in Debian #340119). + * Differences incorporated by Debian so no longer carried by Ubuntu: + - Mad md5sum diversion fixups. (5.93-5ubuntu5 and earlier.) + + -- Ian Jackson Tue, 4 Jul 2006 18:32:28 +0100 + +coreutils (5.96-5) unstable; urgency=low + + * [62] fix segfault when diropen fails on remove Closes: #375333 + * [63] warn on append with trunc Closes: #373736 + * fix idiotic typo in build rules for hurd Closes: #344166 + + -- Michael Stone Sun, 25 Jun 2006 13:30:21 -0400 + +coreutils (5.96-4) unstable; urgency=low + + * Fix deprecation messages Closes: #375335 + * Try to clobber chcon man page build on hurd Closes: #344166 + + -- Michael Stone Sun, 25 Jun 2006 13:30:21 -0400 + +coreutils (5.96-3) unstable; urgency=low + + * Follow strategy from Ian Jackson to better deal with the dpkg md5sum + mess. Only remove dpkg's mad md5sum diversion `once' (ie, on upgrade + from non-/usr/bin/md5sum-supplying coreutils). This preserves any later + sysadmin-installed diversions of md5sum.textutils. + * Add NEWS.Debian notes on the POSIX2_VERSION change + * add who --ips option to display IPs instead of hostnames. Code taken + from last.c in sysvinit-2.86.ds1. + Closes: #363126 + + -- Michael Stone Sat, 27 May 2006 14:05:44 -0400 + +coreutils (5.96-2) unstable; urgency=low + + * [60] Add deprecation warnings for tail +n and sort +n, but allow that + syntax + * Build-depend on autoconf 2.59.cvs.2006.05.25-1 to avoid bug that could + affect coreutils performance. Backporters may be able to weaken that + dependency. + + -- Michael Stone Sat, 27 May 2006 09:21:43 -0400 + +coreutils (5.96-1) unstable; urgency=low + + * New upstream version + * Don't override posix version at build time anymore. Upstream has + made this less painful; is this viable for etch? + * Update copyright file (Closes: #356532) + + -- Michael Stone Tue, 23 May 2006 21:08:13 -0400 + +coreutils (5.94-2) unstable; urgency=low + + * Reorder 55_coreutils.selinux.patch to fix builds on hurd + (Closes: #344166) + * [58_getcwd-chroot] fix pwd failure on certain bind mounts + (Closes: #355810) + * [59_dircolors-moreterms] add rxvt-unicode & mlterm to dircolors + (Closes: #270139, #317503) + * Update copyright file (thanks Joost van Baal) (Closes: #356532) + * Extend the diversion hackery (Closes: #361799) + + -- Michael Stone Sat, 15 Apr 2006 21:48:43 -0400 + +coreutils (5.94-1) unstable; urgency=low + + * New upstream version (Closes: #349530, #273781, #332779, #341912) + - upstream has reverted the behavior for stat --format + and added a new --printf option with the new behavior + (Closes: #339136) + - tail -f works on append-only files again (Closes: #339400) + - tail -c 3 works again (Closes: #340364) + - tail -0f work for multiple files (but use -n 0 -f instead) + (Closes: #341785) + * [99_dircolors-shell] dircolors test doesn't depend on the shell + * Fix md5sum diversion problems with a hacksaw (Closes: #340119) + + -- Michael Stone Wed, 15 Feb 2006 14:11:23 -0500 + +coreutils (5.93-5ubuntu5) edgy; urgency=low + + * Mad md5sum diversion fix fix: Remove man1/md5sum.textutils.1.gz + not (mistakenly) the always-nonexistent man1/md5sum.textutils. + + -- Ian Jackson Tue, 27 Jun 2006 12:28:39 +0100 + +coreutils (5.93-5ubuntu4) dapper; urgency=low + + * Only remove dpkg's mad md5sum diversion `once' (ie, on upgrade from + non-/usr/bin/md5sum-supplying corutils). This preserves any later + sysadmin-installed diversions of md5sum.textutils. + * Fix md5sum diversion problems with a hacksaw (Closes: #340119) + (change imported from Debian 5.94-1: some additional rm -f's to make + the diversion removal more aggressive^Wrobust). + + -- Ian Jackson Fri, 5 May 2006 16:39:05 +0100 + +coreutils (5.93-5ubuntu3) dapper; urgency=low + + * debian/patches/99a_fix_cp_manpage fix cp manpage formatting + malone #30155, thanks to Chris Moore + + -- Oliver Grawert Tue, 4 Apr 2006 17:24:02 +0200 + +coreutils (5.93-5ubuntu2) dapper; urgency=low + + * debian/patches/60_ubuntu-force-clobber-specials.patch: + - causes cp to replace special files when "-a -f" is specified, and + the special already exists; instead of just erroring + + -- Scott James Remnant Wed, 1 Feb 2006 16:24:00 +0000 + +coreutils (5.93-5ubuntu1) dapper; urgency=low + + * debian/patches/98_fix_chmod_manpage: + - change suggested by Chris Moore (Ubuntu: #18771) + + -- Daniel Holbach Wed, 7 Dec 2005 18:04:14 +0100 + +coreutils (5.93-5) unstable; urgency=low + + * Actually conflict with apt-move instead of just thinking about it + (Closes: #339136) + * Drop help2man build-dep (we're actually using one in the build tree) + + -- Michael Stone Wed, 16 Nov 2005 07:46:45 -0500 + +coreutils (5.93-4) unstable; urgency=low + + * Conflict with apt-move expecting particular stat syntax (Closes: #339136) + I need to think more about what to do with upstream changes to stat -c + * For now, add upstream patch so that stat -c "%whatever\n" actually works + + -- Michael Stone Tue, 15 Nov 2005 09:30:56 -0500 + +coreutils (5.93-3) unstable; urgency=low + + * Remove --enable-pam from selinux rules (we don't use our su for selinux) + * [99] Revert change to POSIX version override (I forgot about +n usage) + I once again *strongly* urge people to convert to more portable syntax. + (search NEWS for POSIX 1003.1-2001) + (Closes: #339085) + * [57] Patch from Petr Salinger to fix selinux build problems on non-linux + systems (Closes: #338821) + + -- Michael Stone Mon, 14 Nov 2005 20:55:57 -0500 + +coreutils (5.93-2) unstable; urgency=low + + * Change section to utils (base ain't what it used to be) + * Trust the autoreconf wrapper because things are too complicated otherwise + * [56] Recognize cifs as remote so it can be ignored, e.g., in df -l + (Closes: #324934) + + -- Michael Stone Sat, 12 Nov 2005 20:28:53 -0500 + +coreutils (5.93-1) unstable; urgency=low + + * New upstream version + - tail's --allow-missing option has been removed. Use --retry instead + - stat's --link and -l options have been removed. Use --dereference + - support things like head -NUM when conforming to POSIX 1003.1-2001. + because of this, debian no longer forces POSIX version 199209 + - many other changes documented in /usr/share/doc/coreutils/NEWS.gz + * Need automake 1.9 now + * Allow build check to be skipped with nocheck option (Closes: #278915) + * Work around dpkg changes (Closes: #314713) + * Try to recover from badly planned move on part of dpkg maintainer to + put a *local* diversion on md5sum. There is no good way to handle this; + hopefully nobody will do something so stupid in the future. + * Remove some ancient debian-specific patches + - install no longer calls strip with special options + - no more --reversible option to cat + - no more --first-eof option to paste + - no more field seperator option to uniq + * [54] Update acl patch using fedora devel patch + * [55] Add selinux support from fedora devel & Manoj Srivastava + (Closes: #312426) + + -- Michael Stone Sat, 12 Nov 2005 13:34:05 -0500 + +coreutils (5.2.1-3) unstable; urgency=low + + * fix info install + * install the right upstream changelog + + -- Michael Stone Fri, 16 Jul 2004 07:28:41 -0400 + +coreutils (5.2.1-2) unstable; urgency=low + + * remove su for kfreebsd (Closes: #225131) + * add yacc to build depends. forgot that the date patch [31] forced a + rebuild from getdate.y (Closes: #259563) + + -- Michael Stone Fri, 16 Jul 2004 07:28:41 -0400 + +coreutils (5.2.1-1) unstable; urgency=low + + * New upstream version (Closes: #245360, #244784, #259282, #246509) + - Fixes ls --block-size="1" (Closes: #237330) + - `chown user.group file' now has its traditional meaning even when + conforming to POSIX 1003.1-2001, so long as no user has a name + containing `.' that happens to equal `user.group'. + - time stamps output by stat now include actual fractional seconds, + when available -- or .0000000 for files without that information. + - rmdir -p exits with status 1 on error; formerly it sometimes exited + with status 0 when given more than one argument. + - chgrp and chown now accept POSIX-mandated -L, -H, and -P options + - du can now process hierarchies of virtually unlimited depth. + - du's -H option will soon have the meaning required by POSIX + (--dereference-args, aka -D) rather then the current meaning of --si. + Now, using -H elicits a warning to that effect. + * [53] Update acl patch for 5.2.1. Now based on FC2 coreutils patch. + * Removed xattr patch. AFAICT this isn't particularly useful for anything + except selinux, and other selinux support isn't included. Also, the + option added with this patch isn't being used consistently between + different linux distributions and I'd rather not support something that + will cause incompatibilities. If anyone was depending on this support + please contact me with details. (Closes: #244603) + * fix minor typo in README.Debian (Closes: #218333) + * [31] seconds defaults to 0 when using something like + date -d '21:04 +0100' (Closes: #238046) + * rebuild should fix hppa problem (Closes: #219458) + * remove join -n + * update documentation for test so that the FD parameter to test -t is + mandatory (Closes: #255694) + + -- Michael Stone Wed, 14 Jul 2004 06:13:38 -0400 + +coreutils (5.0.91-2) unstable; urgency=low + + * add bzip2 to build-deps (Closes: #214094) + * fix stupid typo in preinst info cleanup script (Closes: #214134) + * make sure /usr/share/info doesn't contain a dir file + (Closes: #214050, #214138) + + -- Michael Stone Sat, 04 Oct 2003 18:35:32 -0400 + +coreutils (5.0.91-1) unstable; urgency=low + + * New upstream version + - date accepts a new option --rfc-2822, an alias for --rfc-822 + - split accepts a new option -d or --numeric-suffixes + - cp, install, mv, and touch now preserve microsecond resolution + - sort now supports the zero byte (NUL) as a field separator; use -t '\0' + The -t '' option, which formerly had no effect, is now an error + - sort option order no longer matters for -S, -d, -i, -o, and -t + - tail --allow-missing option is deprecated; use --retry instead + - `sha1sum --check' now accepts the BSD format for SHA1 message digests + - who -l now means `who --login', not `who --lookup', per POSIX. Feature + was deprecated in woody + - mv renaming file onto differently-cased form of the same name no longer + causes data loss on case-insensitive filesystem like vfat. Name-mapping + filesystems such as ntfs or hpfs can still have problems, see NEWS file + for details. (Closes: #189319) + - seq's default step is 1, even if LAST < FIRST (Closes: #208494) + * [30] upstream patch for du -D with symlinks (Closes: #211591) + * make sure buildinfo is cleaned up + * debian/newfiles aren't used any more + * old {file,shell,text}utils info doc indices are cleaned up (Closes: #209160) + * add sha1sum to description (Closes: #211724) + + -- Michael Stone Fri, 03 Oct 2003 23:01:28 -0400 + +coreutils (5.0.90-3) unstable; urgency=low + + * [28,29] don't hang in who or pinky trying to look up the fake + host entries that screen puts in utmp + * [50,51] acl support + - libacl1-dev build dependency + - probably won't work on non-linux, patches welcome for hurd et al. if + they break + * [52] extended attribute support + - libattr1-dev build dependency (still necessary with new libc?) + - not sure about this one, it might come out (is it always valid to + preserve ea's even if we don't know what they are for?) + + -- Michael Stone Mon, 18 Aug 2003 19:47:29 -0400 + +coreutils (5.0.90-2) unstable; urgency=medium + + * [27] tail -n 0 -f no longer causes busy wait/hang (Closes: #205251) + + -- Michael Stone Wed, 13 Aug 2003 22:46:30 -0400 + +coreutils (5.0.90-1) unstable; urgency=low + + * New upstream version + - `test -t', `test --help', and `test --version' now silently exit + with status 0. To test whether standard output is a terminal, use + `test -t 1'. To get help and version info for `test', use + `[ --help' and `[ --version'. + `test' now exits with status 2 (not 1) if there is an error. + - rm without --recursive (aka -r or -R) no longer prompts regarding + unwritable directories, as required by POSIX. + - uniq -c now uses a SPACE, not a TAB between the count and the + corresponding line, as required by POSIX. + - expr now exits with status 2 if the expression is syntactically valid, + and with status 3 if an error occurred. POSIX requires this. + - md5sum --check now accepts the output of the BSD/OpenSSL md5sum program + - chown: `.' is no longer recognized as a separator when POSIX2 version + is >= 200112 + * [26] split-fail test doesn't fail + * revert 17, patch doesn't work anyway. 26 is a new patch for the problem + of building as non-root in a chroot owned by the builder. + (Closes: #204778) + * use dh_buildinfo + * standards-version 3.6.0 + * add readlink to description (Closes: #204974) + * temporarily override posix version to 199209 so I can upload this package. + need a transition plan. try setting the environment variable + _POSIX2_VERSION on your system to "200112" and see how much breaks. + I encourage debian developers to update their packages so the above works. + + -- Michael Stone Mon, 11 Aug 2003 17:31:34 -0400 + +coreutils (5.0-5) unstable; urgency=low + + * [23] upstream patch to make split --verbose actually verbose + (Closes: #199205) + * enable kill & su for freebsd (Closes: #194743) + * [24] upstream fix for du not displaying / on last line of du / + (Closes: #200542) + * Build-conflict on automake1.4 (Closes: #200378) + * [25] chown no longer preserves setuid bits (Closes: #112597) + + -- Michael Stone Sat, 12 Jul 2003 09:11:08 -0400 + +coreutils (5.0-4) unstable; urgency=medium + + * upstream patch to prevent fd leak (Closes: #197655) + + -- Michael Stone Mon, 16 Jun 2003 17:34:51 -0400 + +coreutils (5.0-3) unstable; urgency=low + + * More hurd stuff, again (Closes: 190738) + * uname -i and -p don't exist anymore, stop complaining + + -- Michael Stone Tue, 13 May 2003 16:57:55 -0400 + +coreutils (5.0-2) unstable; urgency=low + + * Cope with symlinks at LC_TIME for woody upgrades (Closes: 191338) + * Upstream patch to fix FTBFS on hurd (Closes: 190738) + + -- Michael Stone Sun, 11 May 2003 10:29:21 -0400 + +coreutils (5.0-1) unstable; urgency=low + + * New upstream version + - false --help now exits nonzero + - a number of printf fixes + - a couple of seq fixes + + -- Michael Stone Mon, 14 Apr 2003 20:03:36 -0400 + +coreutils (4.5.10-1) unstable; urgency=low + + * New upstream version + - printf no longer segfaults for a negative field width or precision + - shred now always enables --exact for non-regular files + - du no longer lists hard-linked files more than once + - du no longer dumps core on some systems due to `infinite' recursion + via nftw's use of the buggy replacement function in getcwd.c + (Closes: #183962) + - portability patches for a few vendor compilers and 64-bit systems + - du -S *really* now works like it did before the change in 4.5.5 + * make it clearer that {file,shell,text}utils are obsolete + (Closes: #184191, #183631) + + -- Michael Stone Tue, 18 Mar 2003 19:35:23 -0500 + +coreutils (4.5.9-1) unstable; urgency=low + + * New upstream version + - du no longer truncates file sizes or sums to fit in 32-bit size_t + - work around Linux kernel bug in getcwd (fixed in 2.4.21-pre4), so that pwd + now fails if the name of the working directory is so long that getcwd + truncates it. Before it would print the truncated name and exit successfully. + - `df /some/mount-point' no longer hangs on a GNU libc system when another + hard-mounted NFS file system (preceding /some/mount-point in /proc/mounts) + is inaccessible. + - rm -rf now gives an accurate diagnostic when failing to remove a file + under certain unusual conditions + - mv and `cp --preserve=links' now preserve multiple hard links even under + certain unusual conditions where they used to fail + + -- Michael Stone Thu, 06 Mar 2003 07:09:05 -0500 + +coreutils (4.5.8-2) unstable; urgency=medium + + * Fix typesize problem in du that caused wrapping at 2G + (Closes: #183210, #183393) + * Added upstream patch to fix behavior where mv would fail to move files + under certain (rare) conditions + * Added upstream patch to fix error message "cannot chdir" when rm -rf fails + to remove a file because of insufficient permission (Closes: #178471) + + -- Michael Stone Tue, 04 Mar 2003 20:33:14 -0500 + +coreutils (4.5.8-1) unstable; urgency=low + + * New upstream version + - du -S once again works like it did before the change in 4.5.5 + - stat accepts a new file format, %B, for the size of each block + reported by %b + - du accepts new option: --apparent-size + - du --bytes (-b) works the same way it did in fileutils-3.16 and before + - du reports proper sizes for directories (not zero) + - df now always displays under `Filesystem', the device file name + corresponding to the listed mount point. Before, for a block- or + character- special file command line argument, df would display that + argument. E.g., `df /dev/hda' would list `/dev/hda' as the + `Filesystem', rather than say /dev/hda3 (the device on which `/' is + mounted), as it does now. + - test now works properly when invoked from a set user ID or set group ID + context and when testing access to files subject to alternate protection + mechanisms. For example, without this change, a set-UID program that + invoked `test -w F' (to see if F is writable) could mistakenly report + that it *was* writable, even though F was on a read-only file system, or + F had an ACL prohibiting write access, or F was marked as immutable. + * Add ipv6 support for name resolution (from "J.H.M. Dassen (Ray)" + ) (Closes: 181817) + * Provide readlink (Replaces: debianutils <= 2.3.1) + + -- Michael Stone Sun, 02 Mar 2003 11:34:07 -0500 + +coreutils (4.5.7-1) unstable; urgency=low + + * New upstream version + - Includes upstream's fix for 175135 + * {shell,text,file}utils now priority extra, section misc + * putty added to dircolors known terminal list (Closes: #180312) + * split will not terminate prematurely on non-full buffer read + (Closes: #177559) + + -- Michael Stone Sun, 09 Feb 2003 09:09:19 -0500 + +coreutils (4.5.6-2) unstable; urgency=medium + + * du behaves properly when multiple relative paths are specified on the + command line (Closes: #180228) + + -- Michael Stone Sat, 08 Feb 2003 11:01:53 -0500 + +coreutils (4.5.6-1) unstable; urgency=low + + * New upstream version + - Fixes coloring of executables on ext2 (Closes: #175135) + - uses new dirent format for info doc (currently reverted + pending dpkg install-info update) + * dd closes output before printing stats (Closes: #178400) + + -- Michael Stone Fri, 07 Feb 2003 07:49:42 -0500 + +coreutils (4.5.4-1) unstable; urgency=low + + * New upstream version + * touch gives correct error message when trying to update the time of an + unowned file + * Upstream is using newer config.{sub,guess} (Closes: #171498) + * touch test succeeds if unprivileged user can write to / (Closes: #171893) + * again with ls -s of symlink--covered all the cases yet? + also fixes ls -i of symlink (Closes: #173793) + * shred -z no longer expects argument (Closes: #172019) + + -- Michael Stone Wed, 01 Jan 2003 13:25:48 -0500 + +coreutils (4.5.3-4) unstable; urgency=low + + * ls on explicit symlink to directory properly shows directory contents + (Closes: #171459) + * ls -L on broken symlink generates error again + * run make check on package build again + + -- Michael Stone Tue, 03 Dec 2002 17:41:46 -0500 + +coreutils (4.5.3-3) unstable; urgency=low + + * printf %b works (Closes: #170983) + * remove cycle breaking patch in tsort (Closes: #168914) + + -- Michael Stone Wed, 27 Nov 2002 17:50:59 -0500 + +coreutils (4.5.3-2) unstable; urgency=low + + * ls --color works properly with -d on directories (Closes: #168203) + * explicit ls for broken symlink works (Closes: #168203) + * explicit ls -s of symlink works (Closes: #167964) + * document du -m (Closes: #167769) + + -- Michael Stone Sat, 09 Nov 2002 22:39:10 -0500 + +coreutils (4.5.3-1) unstable; urgency=low + + * New upstream version + * backed out more specific uname processor output + - Closes: #164691, #164710, #165530, #166621 + - basically no positive feedback :) + * remove /usr/share/doc/coreutils/ABOUT-NLS.gz (Closes: #164920) + * printf with a trailing \ doesn't cause end-of-string to be ignored + (Closes: #166201) + + -- Michael Stone Thu, 31 Oct 2002 21:20:37 -0500 + +coreutils (4.5.2-1) unstable; urgency=low + + * New upstream version + - translations fixed (Closes: #161629, #163712) + * .jar color fixed (Closes: #163838) + * dired test doesn't break for non-english locale (Closes: #161069) + * more specific uname processor output (Closes: #88070) + - let's see how people react to this one :) + + -- Michael Stone Tue, 08 Oct 2002 21:42:27 -0400 + +coreutils (4.5.1-2) unstable; urgency=high + + * don't provide stat (causes nasty upgrade problem) + (Closes: #161245, #161249) + * bump standards-version + * register info file properly + * DEB_BUILD_OPTIONS (Closes: #152189) + + -- Michael Stone Tue, 17 Sep 2002 21:40:51 -0400 + +coreutils (4.5.1-1) unstable; urgency=low + + * New upstream release + * Replaces fileutils, shellutils, and textutils + + -- Michael Stone Fri, 13 Sep 2002 21:00:15 -0400 + --- coreutils-5.97.orig/debian/coreutils.dirs +++ coreutils-5.97/debian/coreutils.dirs @@ -0,0 +1,3 @@ +bin +sbin +usr/share/doc/coreutils --- coreutils-5.97.orig/debian/copyright +++ coreutils-5.97/debian/copyright @@ -0,0 +1,4 @@ +The empty packages fileutils, textutils, and shellutils are created by +Michael Stone and are either too trivial to copyright +or are released into the public domain. + --- coreutils-5.97.orig/debian/coreutils.preinst +++ coreutils-5.97/debian/coreutils.preinst @@ -0,0 +1,42 @@ +#!/bin/sh + +set -e + +# shellutils in woody contained symlinks for these items. On upgrade, dpkg +# doesn't cope well with the transition from those symlinks to the current +# directories. +for i in /usr/share/locale/cs /usr/share/locale/da /usr/share/locale/de /usr/share/locale/el /usr/share/locale/es /usr/share/locale/fr /usr/share/locale/gl /usr/share/locale/it /usr/share/locale/ja /usr/share/locale/ko /usr/share/locale/nl /usr/share/locale/no /usr/share/locale/pl /usr/share/locale/pt /usr/share/locale/pt_BR /usr/share/locale/ru /usr/share/locale/sk /usr/share/locale/sl /usr/share/locale/sv /usr/share/locale/zh ; do + test -L $i/LC_TIME && rm -f $i/LC_TIME + test -L $i/LC_MESSAGES/coreutils.mo && rm -f $i/LC_MESSAGES/coreutils.mo +done + +# make sure old info files are cleaned up +for i in sh-utils fileutils textutils ; do + if grep -qs $i /usr/info/dir /usr/share/info/dir ; then + install-info --quiet --remove /usr/share/info/$i.info + fi +done + +# work around stupid dpkg diversion of md5sum +# Debian #340119, #289369, #313258; Ubuntu (Malone) #26886 +case "$2" in +'' | 4.* | 5.?.*) + # coreutils 5.93-1 onwards do this, so we can avoid doing + # it if we know it's already been done. That avoids trashing + # any real local diversion subsequently introduced by the sysadmin. + # (There are no coreutils versions between 5.2.1 and 5.93.) + rm -f /usr/bin/md5sum.textutils + rm -f /usr/share/man/man1/md5sum.1.gz + rm -f /usr/share/man/man1/md5sum.textutils.1.gz + dpkg-divert --remove /usr/share/man/man1/md5sum.textutils.1.gz + dpkg-divert --remove /usr/bin/md5sum.textutils + # Possibly this can be removed at some distant point, when we're + # sure that all of the systems infected with the diversion (ie, + # systems which were running the wrong version of sid, breezy or + # dapper) have been fixed. + ;; +esac + +#DEBHELPER# + +exit 0 --- coreutils-5.97.orig/debian/README.Debian +++ coreutils-5.97/debian/README.Debian @@ -0,0 +1,3 @@ +The empty fileutils, shellutils, and textutils packages are present only +for transitional purposes, and can be safely removed when no package +continues to depend on them. --- coreutils-5.97.orig/debian/coreutils.NEWS +++ coreutils-5.97/debian/coreutils.NEWS @@ -0,0 +1,14 @@ +coreutils (5.96-3) unstable; urgency=low + + * The POSIX compatability level is now set to POSIX 1003.1-2001, + which affects the syntax for several commands. For transition + purposes, "sort +number" and "tail +number" will be supported + for the etch release. Note that these usages are deprecated, and + will be removed in etch+1; the recommended usage is "sort -k number" + and "tail -n +number". Also, "uniq +number" should be replaced with + "uniq -s number" and "touch number filename" should be replaced with + "touch -t number filename". To revert to the older syntax, set the + environment variable _POSIX2_VERSION to "199209". + + -- Michael Stone Sat, 27 May 2006 12:56:18 -0400 + --- coreutils-5.97.orig/debian/README.build +++ coreutils-5.97/debian/README.build @@ -0,0 +1,20 @@ +This package uses a build system called DBS (Doogie's Build System). +To extract the upstream source, run "debian/rules setup". This will +extract the pristine source in build-tree/, and apply patches from +debian/patches/. + +Note that source modifications in build-tree/ will not be preserved +after the "clean" target is run. + +To create patches for the source, remember the following steps: There +are two targets for handling source. The "unpacked" target will +simply unpack the tarball(s) into build-tree/; the "patched" target +will apply all patches from debian/patches/. If you make any changes, +you can generate a new patch using the "make_patch" target. This will +move your current sources under build-tree/, unpack the source+patches +again, and then generate a diff between the two. Note that you should +run the "clean" target in the build-tree/ source before doing this to +get a clean patch. + +Tollef Fog Heen +(modified by Colin Walters ) --- coreutils-5.97.orig/debian/control +++ coreutils-5.97/debian/control @@ -0,0 +1,50 @@ +Source: coreutils +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Michael Stone +Section: utils +Priority: required +Standards-Version: 3.6.2.0 +Build-Depends: gettext (>= 0.10.37), debhelper, dh-buildinfo, perl-base, texinfo (>= 4.2), groff, dbs, libattr1-dev | not+linux-gnu, libacl1-dev | not+linux-gnu, bzip2, autoconf (>= 2.59.cvs.2006.05.25-1), automake1.9, libselinux1-dev (>= 1.32) | not+linux-gnu +Build-Conflicts: automake1.4 + +Package: coreutils +Architecture: any +Pre-Depends: ${shlibs:Depends} +Provides: textutils, shellutils, fileutils +Replaces: textutils, shellutils, fileutils, stat, debianutils (<= 2.3.1), dpkg (<< 1.13.2) +Conflicts: stat +Essential: yes +Description: The GNU core utilities + This package contains the essential basic system utilities. + . + Specifically, this package includes: + basename cat chgrp chmod chown chroot cksum comm cp csplit cut date dd df dir + dircolors dirname du echo env expand expr factor false fmt fold groups head + hostid id install join link ln logname ls md5sum mkdir mkfifo mknod mv nice nl + nohup od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir + sha1sum seq shred sleep sort split stat stty sum sync tac tail tee test touch + tr true tsort tty uname unexpand uniq unlink users vdir wc who whoami yes + +Package: textutils +Pre-Depends: coreutils +Architecture: all +Priority: extra +Section: oldlibs +Description: The GNU text file processing utilities (transitional package) + Empty package to facilitate upgrades, can be safely removed. + +Package: fileutils +Pre-Depends: coreutils +Architecture: all +Priority: extra +Section: oldlibs +Description: The GNU file management utilities (transitional package) + Empty package to facilitate upgrades, can be safely removed. + +Package: shellutils +Pre-Depends: coreutils +Architecture: all +Priority: extra +Section: oldlibs +Description: The GNU shell programming utilities (transitional package) + Empty package to facilitate upgrades, can be safely removed. --- coreutils-5.97.orig/debian/coreutils.prerm +++ coreutils-5.97/debian/coreutils.prerm @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +#DEBHELPER# + --- coreutils-5.97.orig/debian/coreutils.postinst +++ coreutils-5.97/debian/coreutils.postinst @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +#DEBHELPER# + --- coreutils-5.97.orig/debian/coreutils.copyright +++ coreutils-5.97/debian/coreutils.copyright @@ -0,0 +1,190 @@ +This is the Debian GNU/Linux packaged version of the GNU core +utilities. + +This package is maintained by Michael Stone and +built from sources obtained from: + ftp://ftp.gnu.org/gnu/coreutils/coreutils-5.96.tar.bz2 + +This debian package was first put together by Michael Stone +, from coreutils 4.5.1. + +Changes: + * added Debian GNU/Linux package maintenance system files + * at times, bug fixes awaiting inclusion in the upstream source + + +Authors +======= + +See the file AUTHORS. + + +Copyright Holders and License +============================= + +lib/fts.c +--------- + + Copyright (C) 2004, 2005, 2006 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 [...] + +/*- + * Copyright (c) 1990, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +lib/fts_.h +---------- + + Copyright (C) 2004, 2005 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License [...] + +/* + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + + +m4/autobuild.m4 +--------------- + + # Copyright (C) 2004 Simon Josefsson + # + # This file is free software, distributed under the terms of the GNU + # General Public License. As a special exception to the GNU General + # Public License, this file may be distributed as part of a program + # that contains a configuration script generated by Autoconf, under + # the same distribution terms as the rest of that program. + # + # This file can can be used in projects which are not available under + # the GNU General Public License or the GNU Library General Public + # License but which still want to provide support for Autobuild. + + +src/cut.c +--------- + + Copyright (C) 1997-2005 Free Software Foundation, Inc. + Copyright (C) 1984 David M. Ihnat + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License [...] + + +src/dircolors.c +--------------- + + Copyright (C) 1996-2005 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000 H. Peter Anvin + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License [...] + + +src/paste.c +----------- + + Copyright (C) 1997-2005 Free Software Foundation, Inc. + Copyright (C) 1984 David M. Ihnat + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License [...] + + +src/shred.c +----------- + + Copyright (C) 1999-2005 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999 Colin Plumb. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License [...] + + +doc/coreutils.texi (The GNU Coreutils Manual) +--------------------------------------------- + +Copyright (C) 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with no Front-Cover Texts, and with no Back-Cover +Texts. A copy of the license is included in the section entitled ``GNU +Free Documentation License''. + + +all other files +--------------- + +Copyright (C) 1984-2006 Free Software Foundation, Inc. + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package 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 package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'.