--- /dev/null
+# Configuration file for the color ls utility
+# This file goes in the /etc directory and must be world readable.
+# You can copy this file to .dir_colors in your $HOME directory to override
+# the system defaults.
+
+# NOTE:
+# The keywords COLOR, OPTIONS and EIGHTBIT (honored by the slackware version
+# of dircolors) are recognized but ignored.
+
+# COLOR keyword is recognized by PLD fileutils.(c)sh script (which is located
+# in /etc/shrc.d directory and needs one of these arguments:
+# 'auto', 'tty', 'if-tty' - colorizes output to ttys, but not pipes,
+# 'always', 'yes', 'force' - adds color characters to all output,
+# 'never', 'no', 'none' - shuts colorization off.
+COLOR tty
+
+# Below, there should be one TERM entry for each termtype that is colorizable
+TERM linux
+TERM console
+TERM con132x25
+TERM con132x30
+TERM con132x43
+TERM con132x60
+TERM con80x25
+TERM con80x28
+TERM con80x30
+TERM con80x43
+TERM con80x50
+TERM con80x60
+TERM cons25
+TERM rxvt
+TERM xterm
+TERM xterm-color
+TERM color-xterm
+TERM color_xterm
+TERM vt100
+TERM dtterm
+
+# Below are the color init strings for the basic file types. A color init
+# string consists of one or more of the following numeric codes:
+# Attribute codes:
+# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
+# Text color codes:
+# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
+# Background color codes:
+# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
+NORMAL 00 # global default, although everything should be something.
+FILE 00 # normal file
+DIR 01;34 # directory
+LINK 01;36 # symbolic link
+FIFO 33 # pipe
+SOCK 01;35 # socket
+BLK 01;33 # block device driver
+CHR 01;33 # character device driver
+ORPHAN 01;05;37;41 # orphaned symlinks
+MISSING 01;05;37;41 # ... and the files they point to
+
+# This is for files with execute permission:
+EXEC 32
+
+# List any file extensions like '.gz' or '.tar' that you would like ls
+# to colorize below. Put the extension, a space, and the color init string.
+# (and any comments you want to add after a '#')
+
+# executables (bright green)
+
+.sh 01;32
+.csh 01;32
+.bat 01;32
+.btm 01;32
+.cmd 01;32
+.com 01;32
+.exe 01;32
+
+# archives or compressed (bright red)
+
+.7z 01;31
+.7zip 01;31
+.arj 01;31
+.bz 01;31
+.bz2 01;31
+.cpio 01;31
+.deb 01;31
+.gz 01;31
+.img 01;31
+.lha 01;31
+.lzh 01;31
+.lzma 01;31
+.rar 01;31
+.rpm 01;31
+.tar 01;31
+.taz 01;31
+.tgz 01;31
+.tpz 01;31
+.trpm 01;31
+.tz 01;31
+.xz 01;31
+.z 01;31
+.Z 01;31
+.zip 01;31
+.zoo 01;31
+
+# image formats (bright magenta)
+
+.bmp 01;35
+.cdr 01;35
+.gif 01;35
+.jpeg 01;35
+.jpg 01;35
+.JPG 01;35
+.mng 01;35
+.pbm 01;35
+.pcx 01;35
+.pgm 01;35
+.png 01;35
+.ppm 01;35
+.svg 01;35
+.tga 01;35
+.tif 01;35
+.tiff 01;35
+.xbm 01;35
+.xcf 01;35
+.xpm 01;35
+
+# multimedia files (bright white)
+
+.asf 01;37
+.asx 01;37
+.au 01;37
+.avi 01;37
+.m1v 01;37
+.mid 01;37
+.mkv 01;37
+.mp3 01;37
+.mp4 01;37
+.mpg 01;37
+.mpe 01;37
+.mpeg 01;37
+.mod 01;37
+.mov 01;37
+.ogg 01;37
+.qt 01;37
+.rm 01;37
+.ram 01;37
+.s3m 01;37
+.vob 01;37
+.voc 01;37
+.wav 01;37
+.wma 01;37
+.wmv 01;37
+.xm 01;37
+
+# documents (cyan)
+.abw 36
+.bib 36
+.doc 36
+.dot 36
+.dvi 36
+.eps 36
+.info 36
+.kpr 36
+.me 36
+.ms 36
+.ods 36
+.odt 36
+.ps 36
+.pdf 36
+.pps 36
+.ppt 36
+.rtf 36
+.stw 36
+.sxc 36
+.sxw 36
+.tex 36
+.texi 36
+.texinfo 36
+.tm 36
+.txt 36
+.wri 36
+.xls 36
+.xlw 36
+
+# web (yellow)
+.cgi 33
+.css 33
+.htm 33
+.html 33
+.php 33
+.phtml 33
+
+# devel (bright yellow)
+
+.ac 01;33
+.am 01;33
+.c 01;33
+.cc 01;33
+.cpp 01;33
+.diff 01;33
+.f 01;33
+.h 01;33
+.in 01;33
+.o 01;33
+.patch 01;33
+.po 01;33
+.pot 01;33
+.s 01;33
+.spec 01;33
--- /dev/null
+diff -urNp coreutils-7.4-orig/src/stty.c coreutils-7.4/src/stty.c
+--- coreutils-7.4-orig/src/stty.c 2009-04-24 14:41:19.000000000 +0200
++++ coreutils-7.4/src/stty.c 2009-06-11 10:15:41.000000000 +0200
+@@ -1001,7 +1001,7 @@ main (int argc, char **argv)
+ spurious difference in an uninitialized portion of the structure. */
+ DECLARE_ZEROED_AGGREGATE (struct termios, new_mode);
+
+- if (tcsetattr (STDIN_FILENO, TCSADRAIN, &mode))
++ if (tcsetattr (STDIN_FILENO, TCSANOW, &mode))
+ error (EXIT_FAILURE, errno, "%s", device_name);
+
+ /* POSIX (according to Zlotnick's book) tcsetattr returns zero if
--- /dev/null
+diff -ru coreutils-8.4.orig/src/copy.c coreutils-8.4/src/copy.c
+--- coreutils-8.4.orig/src/copy.c 2010-01-25 16:03:29.606930239 +0100
++++ coreutils-8.4/src/copy.c 2010-01-26 15:37:24.544158220 +0100
+@@ -457,6 +457,56 @@
+ return lchmod (name, mode);
+ }
+
++/* BEGIN progress mod */
++static void file_progress_bar ( char * _cDest, int _iBarLength, int _iProgress, int _iTotal )
++{
++ // write number to progress bar
++ float fPercent = ( float ) _iProgress / ( float ) _iTotal * 100.f;
++ sprintf ( _cDest + ( _iBarLength - 6 ), "%4.1f", fPercent );
++ // remove zero
++ _cDest[_iBarLength - 2] = ' ';
++
++ // fill rest with '-'
++ int i;
++ for ( i = 1; i <= _iBarLength - 9; i++ )
++ {
++ if ( fPercent > ( float ) ( i - 1 ) / ( _iBarLength - 10 ) * 100.f )
++ _cDest[i] = '|';
++ else
++ _cDest[i] = '-';
++ }
++}
++
++int file_size_format ( char * _cDst, int _iSize, int _iCounter )
++{
++ int iCounter = _iCounter;
++ double dSize = ( double ) _iSize;
++ while ( dSize >= 1000. )
++ {
++ dSize /= 1024.;
++ iCounter++;
++ }
++
++ /* get unit */
++ char * sUnit;
++ if ( iCounter == 0 )
++ sUnit = "B";
++ else if ( iCounter == 1 )
++ sUnit = "KiB";
++ else if ( iCounter == 2 )
++ sUnit = "MiB";
++ else if ( iCounter == 3 )
++ sUnit = "GiB";
++ else if ( iCounter == 4 )
++ sUnit = "TiB";
++ else
++ sUnit = "N/A";
++
++ /* write number */
++ return sprintf ( _cDst, "%5.1f %s", dSize, sUnit );
++}
++/* END progress mod */
++
+ /* Copy a regular file from SRC_NAME to DST_NAME.
+ If the source file contains holes, copies holes and blocks of zeros
+ in the source file as holes in the destination file.
+@@ -706,8 +756,146 @@
+ buf_alloc = xmalloc (buf_size + buf_alignment_slop);
+ buf = ptr_align (buf_alloc, buf_alignment);
+
++ /* BEGIN progress mod */
++ /* create a field of 6 lines */
++ char ** cProgressField = ( char ** ) calloc ( 6, sizeof ( char * ) );
++ /* get console width */
++ int iBarLength = 80;
++ struct winsize win;
++ if ( ioctl (STDOUT_FILENO, TIOCGWINSZ, (char *) &win) == 0 && win.ws_col > 0 )
++ iBarLength = win.ws_col;
++ /* create rows */
++ int it;
++ for ( it = 0; it < 6; it++ )
++ {
++ cProgressField[it] = ( char * ) malloc ( iBarLength + 1 );
++ /* init with spaces */
++ int j;
++ for ( j = 0; j < iBarLength; j++ )
++ cProgressField[it][j] = ' ';
++ cProgressField[it][iBarLength] = '\0';
++ }
++
++ /* global progress bar? */
++ if ( g_iTotalSize )
++ {
++ /* init global progress bar */
++ cProgressField[2][0] = '[';
++ cProgressField[2][iBarLength - 8] = ']';
++ cProgressField[2][iBarLength - 7] = ' ';
++ cProgressField[2][iBarLength - 1] = '%';
++
++ /* total size */
++ cProgressField[1][iBarLength - 11] = '/';
++ file_size_format ( cProgressField[1] + iBarLength - 9, g_iTotalSize, 1 );
++
++ /* show how many files were written */
++ int sum_length = sprintf ( cProgressField[1], "%d files copied so far...", g_iFilesCopied );
++ cProgressField[1][sum_length] = ' ';
++ }
++
++ /* truncate filename? */
++ int fn_length;
++ if ( strlen ( src_name ) > iBarLength - 22 )
++ fn_length =
++ sprintf ( cProgressField[4], "...%s", src_name + ( strlen ( src_name ) - iBarLength + 25 ) );
++ else
++ fn_length = sprintf ( cProgressField[4], "%s", src_name );
++ cProgressField[4][fn_length] = ' ';
++
++ /* filesize */
++ cProgressField[4][iBarLength - 11] = '/';
++ file_size_format ( cProgressField[4] + iBarLength - 9, src_open_sb.st_size, 0 );
++
++ int iCountDown = 1;
++ char * sProgressBar = cProgressField[5];
++ sProgressBar[0] = '[';
++ sProgressBar[iBarLength - 8] = ']';
++ sProgressBar[iBarLength - 7] = ' ';
++ sProgressBar[iBarLength - 1] = '%';
++
++ /* this will always save the time in between */
++ struct timeval last_time;
++ gettimeofday ( & last_time, NULL );
++ int last_size = g_iTotalWritten;
++ /* END progress mod */
++
+ while (true)
+ {
++ if (progress) {
++ /* BEGIN progress mod */
++ /* update countdown */
++ iCountDown--;
++ if ( iCountDown < 0 )
++ iCountDown = 100;
++
++ /* just print one line with the percentage, but not always */
++ if ( iCountDown == 0 )
++ {
++ /* calculate current speed */
++ struct timeval cur_time;
++ gettimeofday ( & cur_time, NULL );
++ int cur_size = g_iTotalWritten + n_read_total / 1024;
++ int usec_elapsed = cur_time.tv_usec - last_time.tv_usec;
++ double sec_elapsed = ( double ) usec_elapsed / 1000000.f;
++ sec_elapsed += ( double ) ( cur_time.tv_sec - last_time.tv_sec );
++ int copy_speed = ( int ) ( ( double ) ( cur_size - last_size )
++ / sec_elapsed );
++ char s_copy_speed[20];
++ file_size_format ( s_copy_speed, copy_speed, 1 );
++ /* update vars */
++ last_time = cur_time;
++ last_size = cur_size;
++
++ /* how many time has passed since the start? */
++ int isec_elapsed = cur_time.tv_sec - g_oStartTime.tv_sec;
++ int sec_remaining = ( int ) ( ( double ) isec_elapsed / cur_size
++ * g_iTotalSize ) - isec_elapsed;
++ int min_remaining = sec_remaining / 60;
++ sec_remaining -= min_remaining * 60;
++ int hours_remaining = min_remaining / 60;
++ min_remaining -= hours_remaining * 60;
++ /* print out */
++ sprintf ( cProgressField[3],
++ "Copying at %s/s (about %dh %dm %ds remaining)", s_copy_speed,
++ hours_remaining, min_remaining, sec_remaining );
++
++ int fs_len;
++ if ( g_iTotalSize )
++ {
++ /* global progress bar */
++ file_progress_bar ( cProgressField[2], iBarLength,
++ g_iTotalWritten + n_read_total / 1024, g_iTotalSize );
++
++ /* print the global status */
++ fs_len = file_size_format ( cProgressField[1] + iBarLength - 21,
++ g_iTotalWritten + n_read_total / 1024, 1 );
++ cProgressField[1][iBarLength - 21 + fs_len] = ' ';
++ }
++
++ /* current progress bar */
++ file_progress_bar ( sProgressBar, iBarLength, n_read_total, src_open_sb.st_size );
++
++ /* print the status */
++ fs_len = file_size_format ( cProgressField[4] + iBarLength - 21, n_read_total, 0 );
++ cProgressField[4][iBarLength - 21 + fs_len] = ' ';
++
++ /* print the field */
++ for ( it = g_iTotalSize ? 0 : 3; it < 6; it++ )
++ {
++ printf ( "\033[K%s\n", cProgressField[it] );
++ if ( strlen ( cProgressField[it] ) < iBarLength )
++ printf ( "" );
++ }
++ if ( g_iTotalSize )
++ printf ( "\r\033[6A" );
++ else
++ printf ( "\r\033[3A" );
++ fflush ( stdout );
++ }
++ /* END progress mod */
++ }
++
+ word *wp = NULL;
+
+ ssize_t n_read = read (source_desc, buf, buf_size);
+@@ -788,6 +976,19 @@
+ /proc with linux kernels from at least 2.6.9 .. 2.6.29. */
+ }
+ }
++if (progress) {
++ /* BEGIN progress mod */
++ /* update total size */
++ g_iTotalWritten += n_read_total / 1024;
++ g_iFilesCopied++;
++
++ int i;
++ for ( i = 0; i < 6; i++ )
++ free ( cProgressField[i] );
++ free ( cProgressField );
++ /* END progress mod */
++}
++
+
+ /* If the file ends with a `hole', we need to do something to record
+ the length of the file. On modern systems, calling ftruncate does
+diff -ru coreutils-8.4.orig/src/copy.h coreutils-8.4/src/copy.h
+--- coreutils-8.4.orig/src/copy.h 2010-01-25 16:03:29.606930239 +0100
++++ coreutils-8.4/src/copy.h 2010-01-26 15:35:30.934163303 +0100
+@@ -222,6 +222,9 @@
+ Create destination directories as usual. */
+ bool symbolic_link;
+
++ /* if true, draw a nice progress bar on screen */
++ bool progress_bar;
++
+ /* If true, do not copy a nondirectory that has an existing destination
+ with the same or newer modification time. */
+ bool update;
+@@ -280,4 +283,15 @@
+ bool chown_failure_ok (struct cp_options const *);
+ mode_t cached_umask (void);
+
++/* BEGIN progress mod */
++int file_size_format ( char * _cDst, int _iSize, int _iCounter );
++
++long g_iTotalSize;
++long g_iTotalWritten;
++int g_iFilesCopied;
++struct timeval g_oStartTime;
++int g_iTotalFiles;
++bool progress;
++/* END progress mod */
++
+ #endif
+--- coreutils-8.9/src/cp.c.orig 2011-01-01 22:19:23.000000000 +0100
++++ coreutils-8.9/src/cp.c 2011-01-09 13:07:02.769898177 +0100
+@@ -141,6 +141,7 @@
+ {"target-directory", required_argument, NULL, 't'},
+ {"update", no_argument, NULL, 'u'},
+ {"verbose", no_argument, NULL, 'v'},
++ {"progress-bar", no_argument, NULL, 'g'},
+ {GETOPT_HELP_OPTION_DECL},
+ {GETOPT_VERSION_OPTION_DECL},
+ {NULL, 0, NULL, 0}
+@@ -181,6 +182,7 @@
+ opened, remove it and try again (redundant if\
+ \n\
+ the -n option is used)\n\
++ -g, --progress-bar add progress-bar\n\
+ -i, --interactive prompt before overwrite (overrides a previous -n\
+ \n\
+ option)\n\
+@@ -621,6 +623,57 @@
+ quote (file[n_files - 1]));
+ }
+
++ struct timeval start_time;
++if (progress) {
++ /* BEGIN progress mod */
++ g_iTotalSize = 0;
++ g_iFilesCopied = 0;
++ g_iTotalWritten = 0;
++
++ /* save time */
++ gettimeofday ( & start_time, NULL );
++ g_oStartTime = start_time;
++
++ printf ( "Calculating total size... \r" );
++ fflush ( stdout );
++ long iTotalSize = 0;
++ int iFiles = n_files;
++ if ( ! target_directory )
++ iFiles = n_files - 1;
++ int j;
++ for (j = 0; j < iFiles; j++)
++ {
++ /* call du -s for each file */
++ /* create command */
++ char command[1024];
++ sprintf ( command, "du -s \"%s\"", file[j] );
++ /* TODO: replace all quote signs in file[i] */
++
++ FILE *fp;
++ char output[1024];
++
++ /* run command */
++ fp = popen(command, "r");
++ if (fp == NULL || fgets(output, sizeof(output)-1, fp) == NULL) {
++ printf("failed to run du.\n" );
++ }
++ else
++ {
++ /* isolate size */
++ strchr ( output, '\t' )[0] = '\0';
++ iTotalSize += atol ( output );
++
++ printf ( "Calculating total size... %d\r", iTotalSize );
++ fflush ( stdout );
++ }
++
++ /* close */
++ pclose(fp);
++ }
++ g_iTotalSize = iTotalSize;
++ /* END progress mod */
++}
++
+ if (target_directory)
+ {
+ /* cp file1...filen edir
+@@ -763,6 +816,46 @@
+ ok = copy (source, new_dest, 0, x, &unused, NULL);
+ }
+
++if (progress) {
++ /* BEGIN progress mod */
++ /* remove everything */
++ int i;
++ if ( g_iTotalSize )
++ {
++ for ( i = 0; i < 6; i++ )
++ printf ( "\033[K\n" );
++ printf ( "\r\033[6A" );
++ }
++ else
++ {
++ for ( i = 0; i < 3; i++ )
++ printf ( "\033[K\n" );
++ printf ( "\r\033[3A" );
++ }
++
++ /* save time */
++ struct timeval end_time;
++ gettimeofday ( & end_time, NULL );
++ int usec_elapsed = end_time.tv_usec - start_time.tv_usec;
++ double sec_elapsed = ( double ) usec_elapsed / 1000000.f;
++ sec_elapsed += ( double ) ( end_time.tv_sec - start_time.tv_sec );
++
++ /* get total size */
++ char sTotalWritten[20];
++ file_size_format ( sTotalWritten, g_iTotalSize, 1 );
++ /* TODO: using g_iTotalWritten would be more correct, but is less accurate */
++
++ /* calculate speed */
++ int copy_speed = ( int ) ( ( double ) g_iTotalWritten / sec_elapsed );
++ char s_copy_speed[20];
++ file_size_format ( s_copy_speed, copy_speed, 1 );
++
++ /* good-bye message */
++ printf ( "%d files (%s) copied in %.1f seconds (%s/s).\n", g_iFilesCopied, sTotalWritten,
++ sec_elapsed, s_copy_speed );
++ /* END progress mod */
++}
++
+ return ok;
+ }
+
+@@ -795,6 +888,7 @@
+ x->recursive = false;
+ x->sparse_mode = SPARSE_AUTO;
+ x->symbolic_link = false;
++ x->progress_bar = false;
+ x->set_mode = false;
+ x->mode = 0;
+
+@@ -933,7 +1027,7 @@
+ we'll actually use backup_suffix_string. */
+ backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
+
+- while ((c = getopt_long (argc, argv, "abdfHilLnprst:uvxPRS:T",
++ while ((c = getopt_long (argc, argv, "abdfgHilLnprst:uvxPRS:T",
+ long_opts, NULL))
+ != -1)
+ {
+@@ -990,6 +1084,10 @@
+ x.unlink_dest_after_failed_open = true;
+ break;
+
++ case 'g':
++ progress = true;
++ break;
++
+ case 'H':
+ x.dereference = DEREF_COMMAND_LINE_ARGUMENTS;
+ break;
--- /dev/null
+--- coreutils-4.5.3.orig/man/date.x Tue Nov 2 15:07:36 1999
++++ coreutils-4.5.3/man/date.x Sun Oct 27 22:37:24 2002
+@@ -11,3 +11,8 @@
+ relative date, and numbers. An empty string indicates the beginning
+ of the day. The date string format is more complex than is easily
+ documented here but is fully described in the info documentation.
++[ENVIRONMENT]
++.TP
++TZ
++Specifies the timezone, unless overridden by command line parameters.
++If neither is specified, the setting from /etc/localtime is used.
--- /dev/null
+--- coreutils-8.9/po/pl.po.orig 2011-01-09 12:30:07.000000000 +0100
++++ coreutils-8.9/po/pl.po 2011-01-09 13:01:57.685902367 +0100
+@@ -4380,12 +4380,14 @@
+ #: src/fmt.c:286
+ msgid ""
+ " -t, --tagged-paragraph indentation of first line different from second\n"
+-" -u, --uniform-spacing one space between words, two after sentences\n"
++" -u, --uniform-spacing one space between words, two between sentences\n"
++" -n, --single-spaces single spaces between sentences\n"
+ " -w, --width=WIDTH maximum line width (default of 75 columns)\n"
+ msgstr ""
+ " -t, --tagged-paragraph wcięcie pierwszej linii inne niż drugiej\n"
+ " -u, --uniform-spacing jedna spacja między słowami, dwie między "
+ "zdaniami\n"
++" -n, --single-spaces pojedyncze spacje między zdaniami\n"
+ " -w, --width=ILE maksymalna szerokość linii (domyślnie 75 "
+ "kolumn)\n"
+
+diff -ur coreutils-7.6.org/src/fmt.c coreutils-7.6/src/fmt.c
+--- coreutils-7.6.org/src/fmt.c 2009-09-01 13:01:16.000000000 +0200
++++ coreutils-7.6/src/fmt.c 2009-09-12 20:25:11.894693234 +0200
+@@ -17,6 +17,7 @@
+ /* Written by Ross Paterson <rap@doc.ic.ac.uk>. */
+
+ #include <config.h>
++#include <wchar.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <getopt.h>
+@@ -38,7 +39,7 @@
+ /* The following parameters represent the program's idea of what is
+ "best". Adjust to taste, subject to the caveats given. */
+
+-/* Default longest permitted line length (max_width). */
++/* Default longest permitted line width (max_width). */
+ #define WIDTH 75
+
+ /* Prefer lines to be LEEWAY % shorter than the maximum width, giving
+@@ -50,7 +51,7 @@
+ #define DEF_INDENT 3
+
+ /* Costs and bonuses are expressed as the equivalent departure from the
+- optimal line length, multiplied by 10. e.g. assigning something a
++ optimal line width, multiplied by 10. e.g. assigning something a
+ cost of 50 means that it is as bad as a line 5 characters too short
+ or too long. The definition of SHORT_COST(n) should not be changed.
+ However, EQUIV(n) may need tuning. */
+@@ -77,11 +78,11 @@
+ #define LINE_COST EQUIV (70)
+
+ /* Cost of breaking a line after the first word of a sentence, where
+- the length of the word is N. */
++ the width of the word is N. */
+ #define WIDOW_COST(n) (EQUIV (200) / ((n) + 2))
+
+ /* Cost of breaking a line before the last word of a sentence, where
+- the length of the word is N. */
++ the width of the word is N. */
+ #define ORPHAN_COST(n) (EQUIV (150) / ((n) + 2))
+
+ /* Bonus for breaking a line at the end of a sentence. */
+@@ -113,11 +114,30 @@
+ #define MAXWORDS 1000
+ #define MAXCHARS 5000
+
++/* Wide character support */
++
++static wint_t
++xgetwc (FILE *stream)
++{
++ wint_t c = getwc (stream);
++ if (c == WEOF && ferror (stream))
++ error (EXIT_FAILURE, errno, _("read error"));
++ return c;
++}
++
++static inline int
++xwcwidth (wchar_t wc)
++{
++ int w = wcwidth (wc);
++ return w < 0 ? 0 : w;
++}
++
+ /* Extra ctype(3)-style macros. */
+
+-#define isopen(c) (strchr ("([`'\"", c) != NULL)
+-#define isclose(c) (strchr (")]'\"", c) != NULL)
+-#define isperiod(c) (strchr (".?!", c) != NULL)
++#define isopen(c) \
++ (wcschr (L"([`'\"\u2018\u201A\u201B\u201C\u201E\u201F", c) != NULL)
++#define isclose(c) (wcschr (L")]'\"\u2018\u2019\u201C\u201D", c) != NULL)
++#define isperiod(c) (wcschr (L".?!", c) != NULL)
+
+ /* Size of a tab stop, for expansion on input and re-introduction on
+ output. */
+@@ -132,8 +152,9 @@
+
+ /* Static attributes determined during input. */
+
+- const char *text; /* the text of the word */
+- int length; /* length of this word */
++ const wchar_t *text; /* the text of the word */
++ int length; /* length of this word, in characters */
++ int width; /* width of this word, in columns */
+ int space; /* the size of the following space */
+ unsigned int paren:1; /* starts with open paren */
+ unsigned int period:1; /* ends in [.?!])* */
+@@ -142,7 +163,7 @@
+
+ /* The remaining fields are computed during the optimization. */
+
+- int line_length; /* length of the best line starting here */
++ int line_width; /* width of the best line starting here */
+ COST best_cost; /* cost of best paragraph starting here */
+ WORD *next_break; /* break which achieves best_cost */
+ };
+@@ -152,16 +173,16 @@
+ static void set_prefix (char *p);
+ static void fmt (FILE *f);
+ static bool get_paragraph (FILE *f);
+-static int get_line (FILE *f, int c);
+-static int get_prefix (FILE *f);
+-static int get_space (FILE *f, int c);
+-static int copy_rest (FILE *f, int c);
+-static bool same_para (int c);
++static wint_t get_line (FILE *f, wint_t c);
++static wint_t get_prefix (FILE *f);
++static wint_t get_space (FILE *f, wint_t c);
++static wint_t copy_rest (FILE *f, wint_t c);
++static bool same_para (wint_t c);
+ static void flush_paragraph (void);
+ static void fmt_paragraph (void);
+ static void check_punctuation (WORD *w);
+ static COST base_cost (WORD *this);
+-static COST line_cost (WORD *next, int len);
++static COST line_cost (WORD *next, int wid);
+ static void put_paragraph (WORD *finish);
+ static void put_line (WORD *w, int indent);
+ static void put_word (WORD *w);
+@@ -181,8 +202,11 @@
+ /* If true, don't preserve inter-word spacing (default false). */
+ static bool uniform;
+
++/* How many spaces to put after a sentence (1 or 2). */
++static int sentence_space;
++
+ /* Prefix minus leading and trailing spaces (default ""). */
+-static const char *prefix;
++static wchar_t *prefix;
+
+ /* User-supplied maximum line width (default WIDTH). The only output
+ lines longer than this will each comprise a single word. */
+@@ -190,14 +214,14 @@
+
+ /* Values derived from the option values. */
+
+-/* The length of prefix minus leading space. */
+-static int prefix_full_length;
++/* The width of prefix minus leading space. */
++static int prefix_full_width;
+
+-/* The length of the leading space trimmed from the prefix. */
++/* The width of the leading space trimmed from the prefix. */
+ static int prefix_lead_space;
+
+-/* The length of prefix minus leading and trailing space. */
+-static int prefix_length;
++/* The width of prefix minus leading and trailing space. */
++static int prefix_width;
+
+ /* The preferred width of text lines, set to LEEWAY % less than max_width. */
+ static int best_width;
+@@ -212,10 +236,10 @@
+
+ /* Space for the paragraph text -- longer paragraphs are handled neatly
+ (cf. flush_paragraph()). */
+-static char parabuf[MAXCHARS];
++static wchar_t parabuf[MAXCHARS];
+
+ /* A pointer into parabuf, indicating the first unused character position. */
+-static char *wptr;
++static wchar_t *wptr;
+
+ /* The words of a paragraph -- longer paragraphs are handled neatly
+ (cf. flush_paragraph()). */
+@@ -247,16 +271,16 @@
+ prefix (next_prefix_indent). See get_paragraph() and copy_rest(). */
+
+ /* The last character read from the input file. */
+-static int next_char;
++static wint_t next_char;
+
+ /* The space before the trimmed prefix (or part of it) on the next line
+ after the current paragraph. */
+ static int next_prefix_indent;
+
+-/* If nonzero, the length of the last line output in the current
++/* If nonzero, the width of the last line output in the current
+ paragraph, used to charge for raggedness at the split point for long
+ paragraphs chosen by fmt_paragraph(). */
+-static int last_line_length;
++static int last_line_width;
+
+ void
+ usage (int status)
+@@ -284,7 +308,8 @@
+ stdout);
+ fputs (_("\
+ -t, --tagged-paragraph indentation of first line different from second\n\
+- -u, --uniform-spacing one space between words, two after sentences\n\
++ -u, --uniform-spacing one space between words, two between sentences\n\
++ -n, --single-spaces single spaces between sentences\n\
+ -w, --width=WIDTH maximum line width (default of 75 columns)\n\
+ "), stdout);
+ fputs (HELP_OPTION_DESCRIPTION, stdout);
+@@ -307,6 +332,7 @@
+ {"split-only", no_argument, NULL, 's'},
+ {"tagged-paragraph", no_argument, NULL, 't'},
+ {"uniform-spacing", no_argument, NULL, 'u'},
++ {"single-spaces", no_argument, NULL, 'n'},
+ {"width", required_argument, NULL, 'w'},
+ {GETOPT_HELP_OPTION_DECL},
+ {GETOPT_VERSION_OPTION_DECL},
+@@ -329,9 +355,10 @@
+ atexit (close_stdout);
+
+ crown = tagged = split = uniform = false;
++ sentence_space = 2;
+ max_width = WIDTH;
+- prefix = "";
+- prefix_length = prefix_lead_space = prefix_full_length = 0;
++ prefix = L"";
++ prefix_width = prefix_lead_space = prefix_full_width = 0;
+
+ if (argc > 1 && argv[1][0] == '-' && ISDIGIT (argv[1][1]))
+ {
+@@ -344,7 +371,7 @@
+ argc--;
+ }
+
+- while ((optchar = getopt_long (argc, argv, "0123456789cstuw:p:",
++ while ((optchar = getopt_long (argc, argv, "0123456789cstunw:p:",
+ long_options, NULL))
+ != -1)
+ switch (optchar)
+@@ -372,6 +399,10 @@
+ uniform = true;
+ break;
+
++ case 'n':
++ sentence_space = 1;
++ break;
++
+ case 'w':
+ max_width_option = optarg;
+ break;
+@@ -436,26 +467,32 @@
+ }
+
+ /* Trim space from the front and back of the string P, yielding the prefix,
+- and record the lengths of the prefix and the space trimmed. */
++ and record the widths of the prefix and the space trimmed. */
+
+ static void
+ set_prefix (char *p)
+ {
+- char *s;
++ size_t len;
++ wchar_t *s;
+
+ prefix_lead_space = 0;
+- while (*p == ' ')
++ while (*p == L' ')
+ {
+ prefix_lead_space++;
+ p++;
+ }
+- prefix = p;
+- prefix_full_length = strlen (p);
+- s = p + prefix_full_length;
+- while (s > p && s[-1] == ' ')
+- s--;
+- *s = '\0';
+- prefix_length = s - p;
++ len = mbsrtowcs (NULL, (const char **) &p, 0, NULL);
++ prefix = xmalloc (len * sizeof (wchar_t));
++ mbsrtowcs (prefix, (const char **) &p, len, NULL);
++ for (s = prefix; *s; s++)
++ prefix_full_width += xwcwidth (*s);
++ prefix_width = prefix_full_width;
++ while (s > prefix && s[-1] == L' ')
++ {
++ s--;
++ prefix_width--;
++ }
++ *s = L'\0';
+ }
+
+ /* read file F and send formatted output to stdout. */
+@@ -524,24 +561,24 @@
+ static bool
+ get_paragraph (FILE *f)
+ {
+- int c;
++ wint_t c;
+
+- last_line_length = 0;
++ last_line_width = 0;
+ c = next_char;
+
+ /* Scan (and copy) blank lines, and lines not introduced by the prefix. */
+
+- while (c == '\n' || c == EOF
++ while (c == L'\n' || c == WEOF
+ || next_prefix_indent < prefix_lead_space
+- || in_column < next_prefix_indent + prefix_full_length)
++ || in_column < next_prefix_indent + prefix_full_width)
+ {
+ c = copy_rest (f, c);
+- if (c == EOF)
++ if (c == WEOF)
+ {
+- next_char = EOF;
++ next_char = WEOF;
+ return false;
+ }
+- putchar ('\n');
++ putwchar (L'\n');
+ c = get_prefix (f);
+ }
+
+@@ -597,26 +634,26 @@
+ that failed to match the prefix. In the latter, C is \n or EOF.
+ Return the character (\n or EOF) ending the line. */
+
+-static int
+-copy_rest (FILE *f, int c)
++static wint_t
++copy_rest (FILE *f, wint_t c)
+ {
+- const char *s;
++ const wchar_t *s;
+
+ out_column = 0;
+- if (in_column > next_prefix_indent || (c != '\n' && c != EOF))
++ if (in_column > next_prefix_indent || (c != L'\n' && c != WEOF))
+ {
+ put_space (next_prefix_indent);
+ for (s = prefix; out_column != in_column && *s; out_column++)
+- putchar (*s++);
+- if (c != EOF && c != '\n')
++ putwchar (*s++);
++ if (c != WEOF && c != L'\n')
+ put_space (in_column - out_column);
+- if (c == EOF && in_column >= next_prefix_indent + prefix_length)
+- putchar ('\n');
++ if (c == WEOF && in_column >= next_prefix_indent + prefix_width)
++ putwchar (L'\n');
+ }
+- while (c != '\n' && c != EOF)
++ while (c != L'\n' && c != WEOF)
+ {
+- putchar (c);
+- c = getc (f);
++ putwchar (c);
++ c = xgetwc (f);
+ }
+ return c;
+ }
+@@ -626,11 +663,11 @@
+ otherwise false. */
+
+ static bool
+-same_para (int c)
++same_para (wint_t c)
+ {
+ return (next_prefix_indent == prefix_indent
+- && in_column >= next_prefix_indent + prefix_full_length
+- && c != '\n' && c != EOF);
++ && in_column >= next_prefix_indent + prefix_full_width
++ && c != L'\n' && c != WEOF);
+ }
+
+ /* Read a line from input file F, given first non-blank character C
+@@ -641,11 +678,11 @@
+
+ Return the first non-blank character of the next line. */
+
+-static int
+-get_line (FILE *f, int c)
++static wint_t
++get_line (FILE *f, wint_t c)
+ {
+ int start;
+- char *end_of_parabuf;
++ wchar_t *end_of_parabuf;
+ WORD *end_of_word;
+
+ end_of_parabuf = ¶buf[MAXCHARS];
+@@ -657,6 +694,7 @@
+ /* Scan word. */
+
+ word_limit->text = wptr;
++ word_limit->width = 0;
+ do
+ {
+ if (wptr == end_of_parabuf)
+@@ -665,10 +703,12 @@
+ flush_paragraph ();
+ }
+ *wptr++ = c;
+- c = getc (f);
++ word_limit->width += xwcwidth (c);
++ c = xgetwc (f);
+ }
+- while (c != EOF && !isspace (c));
+- in_column += word_limit->length = wptr - word_limit->text;
++ while (c != WEOF && !isspace (c));
++ word_limit->length = wptr - word_limit->text;
++ in_column += word_limit->width;
+ check_punctuation (word_limit);
+
+ /* Scan inter-word space. */
+@@ -676,11 +716,11 @@
+ start = in_column;
+ c = get_space (f, c);
+ word_limit->space = in_column - start;
+- word_limit->final = (c == EOF
++ word_limit->final = (c == WEOF
+ || (word_limit->period
+- && (c == '\n' || word_limit->space > 1)));
+- if (c == '\n' || c == EOF || uniform)
+- word_limit->space = word_limit->final ? 2 : 1;
++ && (c == L'\n' || word_limit->space > 1)));
++ if (c == L'\n' || c == WEOF || uniform)
++ word_limit->space = word_limit->final ? sentence_space : 1;
+ if (word_limit == end_of_word)
+ {
+ set_other_indent (true);
+@@ -688,34 +728,34 @@
+ }
+ word_limit++;
+ }
+- while (c != '\n' && c != EOF);
++ while (c != L'\n' && c != WEOF);
+ return get_prefix (f);
+ }
+
+ /* Read a prefix from input file F. Return either first non-matching
+ character, or first non-blank character after the prefix. */
+
+-static int
++static wint_t
+ get_prefix (FILE *f)
+ {
+- int c;
++ wint_t c;
+
+ in_column = 0;
+- c = get_space (f, getc (f));
+- if (prefix_length == 0)
++ c = get_space (f, xgetwc (f));
++ if (prefix_width == 0)
+ next_prefix_indent = prefix_lead_space < in_column ?
+ prefix_lead_space : in_column;
+ else
+ {
+- const char *p;
++ const wchar_t *p;
+ next_prefix_indent = in_column;
+- for (p = prefix; *p != '\0'; p++)
++ for (p = prefix; *p != L'\0'; p++)
+ {
+- unsigned char pc = *p;
++ wchar_t pc = *p;
+ if (c != pc)
+ return c;
+ in_column++;
+- c = getc (f);
++ c = xgetwc (f);
+ }
+ c = get_space (f, c);
+ }
+@@ -725,21 +765,21 @@
+ /* Read blank characters from input file F, starting with C, and keeping
+ in_column up-to-date. Return first non-blank character. */
+
+-static int
+-get_space (FILE *f, int c)
++static wint_t
++get_space (FILE *f, wint_t c)
+ {
+ while (true)
+ {
+- if (c == ' ')
++ if (c == L' ')
+ in_column++;
+- else if (c == '\t')
++ else if (c == L'\t')
+ {
+ tabs = true;
+ in_column = (in_column / TABWIDTH + 1) * TABWIDTH;
+ }
+ else
+ return c;
+- c = getc (f);
++ c = xgetwc (f);
+ }
+ }
+
+@@ -748,9 +788,9 @@
+ static void
+ check_punctuation (WORD *w)
+ {
+- char const *start = w->text;
+- char const *finish = start + (w->length - 1);
+- unsigned char fin = *finish;
++ wchar_t const *start = w->text;
++ wchar_t const *finish = start + (w->length - 1);
++ wchar_t fin = *finish;
+
+ w->paren = isopen (*start);
+ w->punct = !! ispunct (fin);
+@@ -774,7 +814,9 @@
+
+ if (word_limit == word)
+ {
+- fwrite (parabuf, sizeof *parabuf, wptr - parabuf, stdout);
++ wchar_t *outptr;
++ for (outptr = parabuf; outptr < wptr; outptr++)
++ putwchar (*outptr);
+ wptr = parabuf;
+ return;
+ }
+@@ -806,7 +848,8 @@
+ /* Copy text of words down to start of parabuf -- we use memmove because
+ the source and target may overlap. */
+
+- memmove (parabuf, split_point->text, wptr - split_point->text);
++ memmove (parabuf, split_point->text,
++ (wptr - split_point->text) * sizeof (wchar_t));
+ shift = split_point->text - parabuf;
+ wptr -= shift;
+
+@@ -830,53 +873,53 @@
+ fmt_paragraph (void)
+ {
+ WORD *start, *w;
+- int len;
++ int wid;
+ COST wcost, best;
+- int saved_length;
++ int saved_width;
+
+ word_limit->best_cost = 0;
+- saved_length = word_limit->length;
+- word_limit->length = max_width; /* sentinel */
++ saved_width = word_limit->width;
++ word_limit->width = max_width; /* sentinel */
+
+ for (start = word_limit - 1; start >= word; start--)
+ {
+ best = MAXCOST;
+- len = start == word ? first_indent : other_indent;
++ wid = start == word ? first_indent : other_indent;
+
+ /* At least one word, however long, in the line. */
+
+ w = start;
+- len += w->length;
++ wid += w->width;
+ do
+ {
+ w++;
+
+ /* Consider breaking before w. */
+
+- wcost = line_cost (w, len) + w->best_cost;
+- if (start == word && last_line_length > 0)
+- wcost += RAGGED_COST (len - last_line_length);
++ wcost = line_cost (w, wid) + w->best_cost;
++ if (start == word && last_line_width > 0)
++ wcost += RAGGED_COST (wid - last_line_width);
+ if (wcost < best)
+ {
+ best = wcost;
+ start->next_break = w;
+- start->line_length = len;
++ start->line_width = wid;
+ }
+
+- /* This is a kludge to keep us from computing `len' as the
+- sum of the sentinel length and some non-zero number.
+- Since the sentinel w->length may be INT_MAX, adding
++ /* This is a kludge to keep us from computing `wid' as the
++ sum of the sentinel width and some non-zero number.
++ Since the sentinel w->width may be INT_MAX, adding
+ to that would give a negative result. */
+ if (w == word_limit)
+ break;
+
+- len += (w - 1)->space + w->length; /* w > start >= word */
++ wid += (w - 1)->space + w->width; /* w > start >= word */
+ }
+- while (len < max_width);
++ while (wid < max_width);
+ start->best_cost = best + base_cost (start);
+ }
+
+- word_limit->length = saved_length;
++ word_limit->width = saved_width;
+ }
+
+ /* Return the constant component of the cost of breaking before the
+@@ -901,33 +944,33 @@
+ else if ((this - 1)->punct)
+ cost -= PUNCT_BONUS;
+ else if (this > word + 1 && (this - 2)->final)
+- cost += WIDOW_COST ((this - 1)->length);
++ cost += WIDOW_COST ((this - 1)->width);
+ }
+
+ if (this->paren)
+ cost -= PAREN_BONUS;
+ else if (this->final)
+- cost += ORPHAN_COST (this->length);
++ cost += ORPHAN_COST (this->width);
+
+ return cost;
+ }
+
+ /* Return the component of the cost of breaking before word NEXT that
+- depends on LEN, the length of the line beginning there. */
++ depends on WID, the width of the line beginning there. */
+
+ static COST
+-line_cost (WORD *next, int len)
++line_cost (WORD *next, int wid)
+ {
+ int n;
+ COST cost;
+
+ if (next == word_limit)
+ return 0;
+- n = best_width - len;
++ n = best_width - wid;
+ cost = SHORT_COST (n);
+ if (next->next_break != word_limit)
+ {
+- n = len - next->line_length;
++ n = wid - next->line_width;
+ cost += RAGGED_COST (n);
+ }
+ return cost;
+@@ -956,8 +999,8 @@
+
+ out_column = 0;
+ put_space (prefix_indent);
+- fputs (prefix, stdout);
+- out_column += prefix_length;
++ fputws (prefix, stdout);
++ out_column += prefix_width;
+ put_space (indent - out_column);
+
+ endline = w->next_break - 1;
+@@ -967,8 +1010,8 @@
+ put_space (w->space);
+ }
+ put_word (w);
+- last_line_length = out_column;
+- putchar ('\n');
++ last_line_width = out_column;
++ putwchar (L'\n');
+ }
+
+ /* Output to stdout the word W. */
+@@ -976,13 +1019,13 @@
+ static void
+ put_word (WORD *w)
+ {
+- const char *s;
++ const wchar_t *s;
+ int n;
+
+ s = w->text;
+ for (n = w->length; n != 0; n--)
+- putchar (*s++);
+- out_column += w->length;
++ putwchar (*s++);
++ out_column += w->width;
+ }
+
+ /* Output to stdout SPACE spaces, or equivalent tabs. */
+@@ -999,13 +1042,13 @@
+ if (out_column + 1 < tab_target)
+ while (out_column < tab_target)
+ {
+- putchar ('\t');
++ putwchar (L'\t');
+ out_column = (out_column / TABWIDTH + 1) * TABWIDTH;
+ }
+ }
+ while (out_column < space_target)
+ {
+- putchar (' ');
++ putwchar (L' ');
+ out_column++;
+ }
+ }
--- /dev/null
+--- coreutils-6.10/man/Makefile.am.orig 2008-01-11 11:34:22.000000000 +0100
++++ coreutils-6.10/man/Makefile.am 2008-03-02 02:14:20.884410857 +0100
+@@ -59,6 +59,7 @@
+ false.1: $(common_dep) $(srcdir)/false.x ../src/false.c
+ fmt.1: $(common_dep) $(srcdir)/fmt.x ../src/fmt.c
+ fold.1: $(common_dep) $(srcdir)/fold.x ../src/fold.c
++getgid.1: $(common_dep) $(srcdir)/getgid.x ../src/getgid.c
+ groups.1: $(common_dep) $(srcdir)/groups.x ../src/groups.c
+ head.1: $(common_dep) $(srcdir)/head.x ../src/head.c
+ hostid.1: $(common_dep) $(srcdir)/hostid.x ../src/hostid.c
+diff -Nur coreutils-4.5.3.orig/man/getgid.1 coreutils-4.5.3/man/getgid.1
+--- coreutils-4.5.3.orig/man/getgid.1 Thu Jan 1 01:00:00 1970
++++ coreutils-4.5.3/man/getgid.1 Sun Oct 27 21:40:54 2002
+@@ -0,0 +1,22 @@
++.TH GETGID "1" "October 2002" "getgid (coreutils) 4.5.3" "User Commands"
++.SH NAME
++getgid \- print ID of given group
++.SH SYNOPSIS
++.B getgid
++\fIGROUPNAME\fR
++.SH DESCRIPTION
++.PP
++Print group ID for GROUPNAME.
++.PP
++Without any OPTION, print usage information.
++.SH AUTHOR
++Written by Artur Frysiak.
++.SH "REPORTING BUGS"
++Report bugs to <feedback@pld-linux.org>.
++.SH COPYRIGHT
++Copyright \(co 1999 Artur Frysiak.
++.br
++This is free software; see the source for copying conditions. There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++.SH "SEE ALSO"
++.BR id (1)
+--- coreutils-4.5.3.orig/man/getgid.x 2007-02-13 17:29:53.000000000 +0100
++++ coreutils-4.5.3.orig/man/getgid.x 2008-08-08 20:54:14.890808765 +0200
+@@ -0,0 +1,4 @@
++[NAME]
++getgid \- print ID of given group
++[DESCRIPTION]
++.\" Add any additional description here
+diff -Nur coreutils-4.5.3.orig/man/pl/getgid.1 coreutils-4.5.3/man/pl/getgid.1
+--- coreutils-4.5.3.orig/man/pl/getgid.1 Thu Jan 1 01:00:00 1970
++++ coreutils-4.5.3/man/pl/getgid.1 Sun Oct 27 21:46:48 2002
+@@ -0,0 +1,22 @@
++.TH GETGID "1" "Pa¼dziernik 2002" "getgid (coreutils) 4.5.3" "Polecenia u¿ytkownika"
++.SH NAZWA
++getgid \- wypisuje identyfikator podanej grupy
++.SH SK£ADNIA
++.B getgid
++\fINAZWA-GRUPY\fR
++.SH OPIS
++.PP
++Wypisuje identyfikator grupy NAZWA-GRUPY.
++.PP
++Bez ¿adnych opcji podaje sposób u¿ycia.
++.SH AUTOR
++Napisane przez Artura Frysiaka.
++.SH "ZG£ASZANIE B£ÊDÓW"
++B³êdy proszê zg³aszaæ (w jêz. polskim lub angielskim) pod <feedback@pld-linux.org>.
++.SH COPYRIGHT
++Copyright \(co 1999 Artur Frysiak.
++.br
++This is free software; see the source for copying conditions. There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++.SH ZOBACZ TAK¯E
++.BR id (1)
+--- coreutils-6.10/src/Makefile.am.orig 2008-03-02 02:12:29.418058752 +0100
++++ coreutils-6.10/src/Makefile.am 2008-03-02 02:14:46.205853844 +0100
+@@ -69,6 +69,7 @@
+ false \
+ fmt \
+ fold \
++ getgid \
+ ginstall \
+ groups \
+ head \
+diff -Nur coreutils-4.5.3.orig/src/getgid.c coreutils-4.5.3/src/getgid.c
+--- coreutils-4.5.3.orig/src/getgid.c Thu Jan 1 01:00:00 1970
++++ coreutils-4.5.3/src/getgid.c Sun Oct 27 21:52:01 2002
+@@ -0,0 +1,106 @@
++/* getgid - print GID of given group
++ Copyright (C) 1999 Artur Frysiak <wiget@pld-linux.org>
++
++ 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. */
++
++#include <config.h>
++#include <grp.h>
++#include <sys/types.h>
++#include <getopt.h>
++#include "system.h"
++#include "quote.h"
++#include "error.h"
++
++#define PROGRAM_NAME "getgid"
++
++#define AUTHORS proper_name ("Artur Frysiak")
++
++/* The name by which this program was run. */
++const char *program_name;
++
++static struct option const longopts[] =
++{
++ {GETOPT_HELP_OPTION_DECL},
++ {GETOPT_VERSION_OPTION_DECL},
++ {NULL, 0, NULL, 0}
++};
++
++void
++usage (int status)
++{
++ if (status != EXIT_SUCCESS)
++ fprintf (stderr, _("Try `%s --help' for more information.\n"),
++ program_name);
++ else
++ {
++ printf (_("\
++Usage: %s [OPTION]... [GROUPNAME]...\n\
++"),
++ program_name);
++ fputs (_("\
++Prints ID of given group name.\
++\n\
++"), stdout);
++ fputs (HELP_OPTION_DESCRIPTION, stdout);
++ fputs (VERSION_OPTION_DESCRIPTION, stdout);
++ emit_bug_reporting_address ();
++ }
++ exit (status);
++}
++
++int main(int argc, char **argv)
++{
++ struct group *gr;
++ int optc;
++
++ initialize_main (&argc, &argv);
++ program_name = argv[0];
++
++ setlocale (LC_ALL, "");
++ bindtextdomain (PACKAGE, LOCALEDIR);
++ textdomain (PACKAGE);
++
++ atexit (close_stdout);
++
++ while ((optc = getopt_long (argc, argv, "+", longopts, NULL)) != -1) {
++ switch (optc) {
++ case_GETOPT_HELP_CHAR;
++ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
++ default:
++ usage (EXIT_FAILURE);
++ }
++ }
++
++ if (argc < optind + 1)
++ {
++ error (0, 0, _("missing operand"));
++ usage (EXIT_FAILURE);
++ }
++
++ if (optind + 2 < argc)
++ {
++ error (0, 0, _("extra operand %s"), quote (argv[optind + 2]));
++ usage (EXIT_FAILURE);
++ }
++
++ gr = getgrnam(argv[optind]);
++ if (gr == NULL) {
++ error (0, 0, _("cannot find group name %s"), quote(argv[optind]));
++ exit(EXIT_FAILURE);
++ } else
++ printf("%lu\n", (unsigned long int) gr->gr_gid);
++ exit(EXIT_SUCCESS);
++}
++
+--- coreutils-4.5.3/po/POTFILES.in.orig Mon Jul 1 23:26:55 2002
++++ coreutils-4.5.3/po/POTFILES.in Fri Nov 1 02:25:41 2002
+@@ -61,6 +61,7 @@
+ src/false.c
+ src/fmt.c
+ src/fold.c
++src/getgid.c
+ src/getlimits.c
+ src/group-list.c
+ src/groups.c
+--- coreutils-6.10/po/pl.po.orig 2008-03-02 02:12:29.526064907 +0100
++++ coreutils-6.10/po/pl.po 2008-03-02 02:15:20.139787629 +0100
+@@ -4152,6 +4152,15 @@
+ msgid "invalid number of columns: %s"
+ msgstr "b³êdna liczba kolumn: %s"
+
++#: src/getgid.c:37
++#, c-format
++msgid ""
++"Usage:\n"
++"\t%s groupname\n"
++msgstr ""
++"Składnia:\n"
++"\t%s nazwa-grupy\n"
++
+ #. This is a proper name. See the gettext manual, section Names.
+ #: src/getlimits.c:29 src/timeout.c:74 src/truncate.c:42
+ msgid "Padraig Brady"
+
+--- coreutils-8.6/README~ 2010-10-17 21:37:11.589739007 +0200
++++ coreutils-8.6/README 2010-10-17 21:42:27.222782339 +0200
+@@ -9,7 +9,7 @@
+
+ [ arch base64 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 groups head hostid hostname id install join kill
++ factor false fmt fold getgid groups head hostid hostname id install join kill
+ link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
+ nproc od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir
+ runcon runuser seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf
--- /dev/null
+--- coreutils-8.9/doc/coreutils.texi.orig 2011-01-01 22:19:23.000000000 +0100
++++ coreutils-8.9/doc/coreutils.texi 2011-01-09 12:28:09.837901529 +0100
+@@ -20,119 +20,111 @@
+ @syncodeindex pg cp
+ @syncodeindex vr cp
+
+-@dircategory Basics
++@dircategory Core utilities:
+ @direntry
+-* Coreutils: (coreutils). Core GNU (file, text, shell) utilities.
+-* Common options: (coreutils)Common options. Common options.
+-* File permissions: (coreutils)File permissions. Access modes.
++* Coreutils: (coreutils). Core GNU (file, text, shell) utilities
++* Common options: (coreutils)Common options. Common options
++* File permissions: (coreutils)File permissions. Access modes
+ * Date input formats: (coreutils)Date input formats.
+-@end direntry
+-
+-@c FIXME: the following need documentation
+-@c * [: (coreutils)[ invocation. File/string tests.
+-@c * pinky: (coreutils)pinky invocation. FIXME.
+-
+-@dircategory Individual utilities
+-@direntry
+-* arch: (coreutils)arch invocation. Print machine hardware name.
+-* base64: (coreutils)base64 invocation. Base64 encode/decode data.
+-* basename: (coreutils)basename invocation. Strip directory and suffix.
+-* cat: (coreutils)cat invocation. Concatenate and write files.
+-* chcon: (coreutils)chcon invocation. Change SELinux CTX of files.
+-* chgrp: (coreutils)chgrp invocation. Change file groups.
+-* chmod: (coreutils)chmod invocation. Change file permissions.
+-* chown: (coreutils)chown invocation. Change file owners/groups.
+-* chroot: (coreutils)chroot invocation. Specify the root directory.
+-* cksum: (coreutils)cksum invocation. Print POSIX CRC checksum.
+-* comm: (coreutils)comm invocation. Compare sorted files by line.
+-* cp: (coreutils)cp invocation. Copy files.
+-* csplit: (coreutils)csplit invocation. Split by context.
+-* cut: (coreutils)cut invocation. Print selected parts of lines.
+-* date: (coreutils)date invocation. Print/set system date and time.
+-* dd: (coreutils)dd invocation. Copy and convert a file.
+-* df: (coreutils)df invocation. Report file system disk usage.
+-* dir: (coreutils)dir invocation. List directories briefly.
+-* dircolors: (coreutils)dircolors invocation. Color setup for ls.
+-* dirname: (coreutils)dirname invocation. Strip last file name component.
+-* du: (coreutils)du invocation. Report on disk usage.
+-* echo: (coreutils)echo invocation. Print a line of text.
+-* env: (coreutils)env invocation. Modify the environment.
+-* expand: (coreutils)expand invocation. Convert tabs to spaces.
+-* expr: (coreutils)expr invocation. Evaluate expressions.
+-* factor: (coreutils)factor invocation. Print prime factors
+-* false: (coreutils)false invocation. Do nothing, unsuccessfully.
+-* fmt: (coreutils)fmt invocation. Reformat paragraph text.
+-* fold: (coreutils)fold invocation. Wrap long input lines.
+-* groups: (coreutils)groups invocation. Print group names a user is in.
+-* head: (coreutils)head invocation. Output the first part of files.
+-* hostid: (coreutils)hostid invocation. Print numeric host identifier.
+-* hostname: (coreutils)hostname invocation. Print or set system name.
+-* id: (coreutils)id invocation. Print user identity.
+-* install: (coreutils)install invocation. Copy and change attributes.
+-* join: (coreutils)join invocation. Join lines on a common field.
+-* kill: (coreutils)kill invocation. Send a signal to processes.
+-* link: (coreutils)link invocation. Make hard links between files.
+-* ln: (coreutils)ln invocation. Make links between files.
+-* logname: (coreutils)logname invocation. Print current login name.
+-* ls: (coreutils)ls invocation. List directory contents.
+-* md5sum: (coreutils)md5sum invocation. Print or check MD5 digests.
+-* mkdir: (coreutils)mkdir invocation. Create directories.
+-* mkfifo: (coreutils)mkfifo invocation. Create FIFOs (named pipes).
+-* mknod: (coreutils)mknod invocation. Create special files.
+-* mktemp: (coreutils)mktemp invocation. Create temporary files.
+-* mv: (coreutils)mv invocation. Rename files.
+-* nice: (coreutils)nice invocation. Modify niceness.
+-* nl: (coreutils)nl invocation. Number lines and write files.
+-* nohup: (coreutils)nohup invocation. Immunize to hangups.
+-* nproc: (coreutils)nproc invocation. Print the number of processors.
+-* od: (coreutils)od invocation. Dump files in octal, etc.
+-* paste: (coreutils)paste invocation. Merge lines of files.
+-* pathchk: (coreutils)pathchk invocation. Check file name portability.
+-* pr: (coreutils)pr invocation. Paginate or columnate files.
+-* printenv: (coreutils)printenv invocation. Print environment variables.
+-* printf: (coreutils)printf invocation. Format and print data.
+-* ptx: (coreutils)ptx invocation. Produce permuted indexes.
+-* pwd: (coreutils)pwd invocation. Print working directory.
+-* readlink: (coreutils)readlink invocation. Print referent of a symlink.
+-* rm: (coreutils)rm invocation. Remove files.
+-* rmdir: (coreutils)rmdir invocation. Remove empty directories.
+-* runcon: (coreutils)runcon invocation. Run in specified SELinux CTX.
+-* seq: (coreutils)seq invocation. Print numeric sequences
+-* sha1sum: (coreutils)sha1sum invocation. Print or check SHA-1 digests.
+-* sha2: (coreutils)sha2 utilities. Print or check SHA-2 digests.
+-* shred: (coreutils)shred invocation. Remove files more securely.
+-* shuf: (coreutils)shuf invocation. Shuffling text files.
+-* sleep: (coreutils)sleep invocation. Delay for a specified time.
+-* sort: (coreutils)sort invocation. Sort text files.
+-* split: (coreutils)split invocation. Split into pieces.
+-* stat: (coreutils)stat invocation. Report file(system) status.
+-* stdbuf: (coreutils)stdbuf invocation. Modify stdio buffering.
+-* stty: (coreutils)stty invocation. Print/change terminal settings.
+-* su: (coreutils)su invocation. Modify user and group ID.
+-* sum: (coreutils)sum invocation. Print traditional checksum.
+-* sync: (coreutils)sync invocation. Synchronize memory and disk.
+-* tac: (coreutils)tac invocation. Reverse files.
+-* tail: (coreutils)tail invocation. Output the last part of files.
+-* tee: (coreutils)tee invocation. Redirect to multiple files.
+-* test: (coreutils)test invocation. File/string tests.
+-* timeout: (coreutils)timeout invocation. Run with time limit.
+-* touch: (coreutils)touch invocation. Change file timestamps.
+-* tr: (coreutils)tr invocation. Translate characters.
+-* true: (coreutils)true invocation. Do nothing, successfully.
+-* truncate: (coreutils)truncate invocation. Shrink/extend size of a file.
+-* tsort: (coreutils)tsort invocation. Topological sort.
+-* tty: (coreutils)tty invocation. Print terminal name.
+-* uname: (coreutils)uname invocation. Print system information.
+-* unexpand: (coreutils)unexpand invocation. Convert spaces to tabs.
+-* uniq: (coreutils)uniq invocation. Uniquify files.
+-* unlink: (coreutils)unlink invocation. Removal via unlink(2).
+-* uptime: (coreutils)uptime invocation. Print uptime and load.
+-* users: (coreutils)users invocation. Print current user names.
+-* vdir: (coreutils)vdir invocation. List directories verbosely.
+-* wc: (coreutils)wc invocation. Line, word, and byte counts.
+-* who: (coreutils)who invocation. Print who is logged in.
+-* whoami: (coreutils)whoami invocation. Print effective user ID.
+-* yes: (coreutils)yes invocation. Print a string indefinitely.
++* arch: (coreutils)arch. Print machine hardware name
++* base64: (coreutils)base64. Base64 encode/decode data
++* basename: (coreutils)basename. Strip directory and suffix
++* cat: (coreutils)cat. Concatenate and write files
++* chcon: (coreutils)chcon. Change SELinux CTX of files
++* chgrp: (coreutils)chgrp. Change file groups
++* chmod: (coreutils)chmod. Change file permissions
++* chown: (coreutils)chown. Change file owners/groups
++* chroot: (coreutils)chroot. Specify the root directory
++* cksum: (coreutils)cksum. Print POSIX CRC checksum
++* comm: (coreutils)comm. Compare sorted files by line
++* cp: (coreutils)cp. Copy files
++* csplit: (coreutils)csplit. Split by context
++* cut: (coreutils)cut. Print selected parts of lines
++* date: (coreutils)date. Print/set system date and time
++* dd: (coreutils)dd. Copy and convert a file
++* df: (coreutils)df. Report file system disk usage
++* dir: (coreutils)dir. List directories briefly
++* dircolors: (coreutils)dircolors. Color setup for ls
++* dirname: (coreutils)dirname. Strip last file name component
++* du: (coreutils)du. Report on disk usage
++* echo: (coreutils)echo. Print a line of text
++* env: (coreutils)env. Modify the environment
++* expand: (coreutils)expand. Convert tabs to spaces
++* expr: (coreutils)expr. Evaluate expressions
++* factor: (coreutils)factor. Print prime factors
++* false: (coreutils)false. Do nothing, unsuccessfully
++* fmt: (coreutils)fmt. Reformat paragraph text
++* fold: (coreutils)fold. Wrap long input lines
++* groups: (coreutils)groups. Print group names a user is in
++* head: (coreutils)head. Output the first part of files
++* hostid: (coreutils)hostid. Print numeric host identifier
++* hostname: (coreutils)hostname. Print or set system name
++* id: (coreutils)id. Print user identity
++* install: (coreutils)install. Copy and change attributes
++* join: (coreutils)join. Join lines on a common field
++* kill: (coreutils)kill. Send a signal to processes
++* link: (coreutils)link. Make hard links between files
++* ln: (coreutils)ln. Make links between files
++* logname: (coreutils)logname. Print current login name
++* ls: (coreutils)ls. List directory contents
++* md5sum: (coreutils)md5sum. Print or check MD5 digests
++* mkdir: (coreutils)mkdir. Create directories
++* mkfifo: (coreutils)mkfifo. Create FIFOs (named pipes)
++* mknod: (coreutils)mknod. Create special files
++* mktemp: (coreutils)mktemp. Create temporary files
++* mv: (coreutils)mv. Rename files
++* nice: (coreutils)nice. Modify niceness
++* nl: (coreutils)nl. Number lines and write files
++* nohup: (coreutils)nohup. Immunize to hangups
++* nproc: (coreutils)nproc. Print the number of processors
++* od: (coreutils)od. Dump files in octal, etc.
++* paste: (coreutils)paste. Merge lines of files
++* pathchk: (coreutils)pathchk. Check file name portability
++* pr: (coreutils)pr. Paginate or columnate files
++* printenv: (coreutils)printenv. Print environment variables
++* printf: (coreutils)printf. Format and print data
++* ptx: (coreutils)ptx. Produce permuted indexes
++* pwd: (coreutils)pwd. Print working directory
++* readlink: (coreutils)readlink. Print referent of a symlink
++* rm: (coreutils)rm. Remove files
++* rmdir: (coreutils)rmdir. Remove empty directories
++* runcon: (coreutils)runcon. Run in specified SELinux CTX
++* seq: (coreutils)seq. Print numeric sequences
++* sha1sum: (coreutils)sha1sum. Print or check SHA-1 digests
++* sha2: (coreutils)sha2 utilities. Print or check SHA-2 digests
++* shred: (coreutils)shred. Remove files more securely
++* shuf: (coreutils)shuf. Shuffling text files
++* sleep: (coreutils)sleep. Delay for a specified time
++* sort: (coreutils)sort. Sort text files
++* split: (coreutils)split. Split into pieces
++* stat: (coreutils)stat. Report file(system) status
++* stdbuf: (coreutils)stdbuf. Modify stdio buffering
++* stty: (coreutils)stty. Print/change terminal settings
++* su: (coreutils)su. Modify user and group ID
++* sum: (coreutils)sum. Print traditional checksum
++* sync: (coreutils)sync. Synchronize memory and disk
++* tac: (coreutils)tac. Reverse files
++* tail: (coreutils)tail. Output the last part of files
++* tee: (coreutils)tee. Redirect to multiple files
++* test: (coreutils)test. File/string tests
++* timeout: (coreutils)timeout. Run with time limit
++* touch: (coreutils)touch. Change file timestamps
++* tr: (coreutils)tr. Translate characters
++* true: (coreutils)true. Do nothing, successfully
++* truncate: (coreutils)truncate. Shrink/extend size of a file
++* tsort: (coreutils)tsort. Topological sort
++* tty: (coreutils)tty. Print terminal name
++* uname: (coreutils)uname. Print system information
++* unexpand: (coreutils)unexpand. Convert spaces to tabs
++* uniq: (coreutils)uniq. Uniquify files
++* unlink: (coreutils)unlink. Removal via unlink(2)
++* uptime: (coreutils)uptime. Print uptime and load
++* users: (coreutils)users. Print current user names
++* vdir: (coreutils)vdir. List directories verbosely
++* wc: (coreutils)wc. Line, word, and byte counts
++* who: (coreutils)who. Print who is logged in
++* whoami: (coreutils)whoami. Print effective user ID
++* yes: (coreutils)yes. Print a string indefinitely
+ @end direntry
+
+ @copying
+@@ -197,10 +189,9 @@
+ * File name manipulation:: dirname basename pathchk mktemp
+ * Working context:: pwd stty printenv tty
+ * User information:: id logname whoami groups users who
+-* System context:: date arch nproc uname hostname hostid uptime
++* System context:: date arch nproc uname hostid
+ * SELinux context:: chcon runcon
+ * Modified command invocation:: chroot env nice nohup stdbuf su timeout
+-* Process control:: kill
+ * Delaying:: sleep
+ * Numeric operations:: factor seq
+ * File permissions:: Access modes
+@@ -228,42 +219,42 @@
+
+ Output of entire files
+
+-* cat invocation:: Concatenate and write files
+-* tac invocation:: Concatenate and write files in reverse
+-* nl invocation:: Number lines and write files
+-* od invocation:: Write files in octal or other formats
+-* base64 invocation:: Transform data into printable data
++* cat:: Concatenate and write files
++* tac:: Concatenate and write files in reverse
++* nl:: Number lines and write files
++* od:: Write files in octal or other formats
++* base64:: Transform data into printable data
+
+ Formatting file contents
+
+-* fmt invocation:: Reformat paragraph text
+-* pr invocation:: Paginate or columnate files for printing
+-* fold invocation:: Wrap input lines to fit in specified width
++* fmt:: Reformat paragraph text
++* pr:: Paginate or columnate files for printing
++* fold:: Wrap input lines to fit in specified width
+
+ Output of parts of files
+
+-* head invocation:: Output the first part of files
+-* tail invocation:: Output the last part of files
+-* split invocation:: Split a file into fixed-size pieces
+-* csplit invocation:: Split a file into context-determined pieces
++* head:: Output the first part of files
++* tail:: Output the last part of files
++* split:: Split a file into fixed-size pieces
++* csplit:: Split a file into context-determined pieces
+
+ Summarizing files
+
+-* wc invocation:: Print newline, word, and byte counts
+-* sum invocation:: Print checksum and block counts
+-* cksum invocation:: Print CRC checksum and byte counts
+-* md5sum invocation:: Print or check MD5 digests
+-* sha1sum invocation:: Print or check SHA-1 digests
++* wc:: Print newline, word, and byte counts
++* sum:: Print checksum and block counts
++* cksum:: Print CRC checksum and byte counts
++* md5sum:: Print or check MD5 digests
++* sha1sum:: Print or check SHA-1 digests
+ * sha2 utilities:: Print or check SHA-2 digests
+
+ Operating on sorted files
+
+-* sort invocation:: Sort text files
+-* shuf invocation:: Shuffle text files
+-* uniq invocation:: Uniquify files
+-* comm invocation:: Compare two sorted files line by line
+-* ptx invocation:: Produce a permuted index of file contents
+-* tsort invocation:: Topological sort
++* sort:: Sort text files
++* shuf:: Shuffle text files
++* uniq:: Uniquify files
++* comm:: Compare two sorted files line by line
++* ptx:: Produce a permuted index of file contents
++* tsort:: Topological sort
+
+ @command{ptx}: Produce permuted indexes
+
+@@ -275,15 +266,15 @@
+
+ Operating on fields
+
+-* cut invocation:: Print selected parts of lines
+-* paste invocation:: Merge lines of files
+-* join invocation:: Join lines on a common field
++* cut:: Print selected parts of lines
++* paste:: Merge lines of files
++* join:: Join lines on a common field
+
+ Operating on characters
+
+-* tr invocation:: Translate, squeeze, and/or delete characters
+-* expand invocation:: Convert tabs to spaces
+-* unexpand invocation:: Convert spaces to tabs
++* tr:: Translate, squeeze, and/or delete characters
++* expand:: Convert tabs to spaces
++* unexpand:: Convert spaces to tabs
+
+ @command{tr}: Translate, squeeze, and/or delete characters
+
+@@ -293,10 +284,10 @@
+
+ Directory listing
+
+-* ls invocation:: List directory contents
+-* dir invocation:: Briefly list directory contents
+-* vdir invocation:: Verbosely list directory contents
+-* dircolors invocation:: Color setup for @command{ls}
++* ls:: List directory contents
++* dir:: Briefly list directory contents
++* vdir:: Verbosely list directory contents
++* dircolors:: Color setup for @command{ls}
+
+ @command{ls}: List directory contents
+
+@@ -309,51 +300,51 @@
+
+ Basic operations
+
+-* cp invocation:: Copy files and directories
+-* dd invocation:: Convert and copy a file
+-* install invocation:: Copy files and set attributes
+-* mv invocation:: Move (rename) files
+-* rm invocation:: Remove files or directories
+-* shred invocation:: Remove files more securely
++* cp:: Copy files and directories
++* dd:: Convert and copy a file
++* install:: Copy files and set attributes
++* mv:: Move (rename) files
++* rm:: Remove files or directories
++* shred:: Remove files more securely
+
+ Special file types
+
+-* link invocation:: Make a hard link via the link syscall
+-* ln invocation:: Make links between files
+-* mkdir invocation:: Make directories
+-* mkfifo invocation:: Make FIFOs (named pipes)
+-* mknod invocation:: Make block or character special files
+-* readlink invocation:: Print value of a symlink or canonical file name
+-* rmdir invocation:: Remove empty directories
+-* unlink invocation:: Remove files via unlink syscall
++* link:: Make a hard link via the link syscall
++* ln:: Make links between files
++* mkdir:: Make directories
++* mkfifo:: Make FIFOs (named pipes)
++* mknod:: Make block or character special files
++* readlink:: Print value of a symlink or canonical file name
++* rmdir:: Remove empty directories
++* unlink:: Remove files via unlink syscall
+
+ Changing file attributes
+
+-* chown invocation:: Change file owner and group
+-* chgrp invocation:: Change group ownership
+-* chmod invocation:: Change access permissions
+-* touch invocation:: Change file timestamps
++* chown:: Change file owner and group
++* chgrp:: Change group ownership
++* chmod:: Change access permissions
++* touch:: Change file timestamps
+
+ Disk usage
+
+-* df invocation:: Report file system disk space usage
+-* du invocation:: Estimate file space usage
+-* stat invocation:: Report file or file system status
+-* sync invocation:: Synchronize data on disk with memory
+-* truncate invocation:: Shrink or extend the size of a file
++* df:: Report file system disk space usage
++* du:: Estimate file space usage
++* stat:: Report file or file system status
++* sync:: Synchronize data on disk with memory
++* truncate:: Shrink or extend the size of a file
+
+ Printing text
+
+-* echo invocation:: Print a line of text
+-* printf invocation:: Format and print data
+-* yes invocation:: Print a string until interrupted
++* echo:: Print a line of text
++* printf:: Format and print data
++* yes:: Print a string until interrupted
+
+ Conditions
+
+-* false invocation:: Do nothing, unsuccessfully
+-* true invocation:: Do nothing, successfully
+-* test invocation:: Check file types and compare values
+-* expr invocation:: Evaluate expressions
++* false:: Do nothing, unsuccessfully
++* true:: Do nothing, successfully
++* test:: Check file types and compare values
++* expr:: Evaluate expressions
+
+ @command{test}: Check file types and compare values
+
+@@ -372,21 +363,21 @@
+
+ Redirection
+
+-* tee invocation:: Redirect output to multiple files or processes
++* tee:: Redirect output to multiple files or processes
+
+ File name manipulation
+
+-* basename invocation:: Strip directory and suffix from a file name
+-* dirname invocation:: Strip last file name component
+-* pathchk invocation:: Check file name validity and portability
+-* mktemp invocation:: Create temporary file or directory
++* basename:: Strip directory and suffix from a file name
++* dirname:: Strip last file name component
++* pathchk:: Check file name validity and portability
++* mktemp:: Create temporary file or directory
+
+ Working context
+
+-* pwd invocation:: Print working directory
+-* stty invocation:: Print or change terminal characteristics
+-* printenv invocation:: Print all or some environment variables
+-* tty invocation:: Print file name of terminal on standard input
++* pwd:: Print working directory
++* stty:: Print or change terminal characteristics
++* printenv:: Print all or some environment variables
++* tty:: Print file name of terminal on standard input
+
+ @command{stty}: Print or change terminal characteristics
+
+@@ -400,22 +391,20 @@
+
+ User information
+
+-* id invocation:: Print user identity
+-* logname invocation:: Print current login name
+-* whoami invocation:: Print effective user ID
+-* groups invocation:: Print group names a user is in
+-* users invocation:: Print login names of users currently logged in
+-* who invocation:: Print who is currently logged in
++* id:: Print user identity
++* logname:: Print current login name
++* whoami:: Print effective user ID
++* groups:: Print group names a user is in
++* users:: Print login names of users currently logged in
++* who:: Print who is currently logged in
+
+ System context
+
+-* arch invocation:: Print machine hardware name
+-* date invocation:: Print or set system date and time
+-* nproc invocation:: Print the number of processors
+-* uname invocation:: Print system information
+-* hostname invocation:: Print or set system name
+-* hostid invocation:: Print numeric host identifier
+-* uptime invocation:: Print system uptime and load
++* arch:: Print machine hardware name
++* date:: Print or set system date and time
++* nproc:: Print the number of processors
++* uname:: Print system information
++* hostid:: Print numeric host identifier
+
+ @command{date}: Print or set system date and time
+
+@@ -430,31 +419,27 @@
+
+ SELinux context
+
+-* chcon invocation:: Change SELinux context of file
+-* runcon invocation:: Run a command in specified SELinux context
++* chcon:: Change SELinux context of file
++* runcon:: Run a command in specified SELinux context
+
+ Modified command invocation
+
+-* chroot invocation:: Run a command with a different root directory
+-* env invocation:: Run a command in a modified environment
+-* nice invocation:: Run a command with modified niceness
+-* nohup invocation:: Run a command immune to hangups
+-* stdbuf invocation:: Run a command with modified I/O buffering
+-* su invocation:: Run a command with substitute user and group ID
+-* timeout invocation:: Run a command with a time limit
+-
+-Process control
+-
+-* kill invocation:: Sending a signal to processes.
++* chroot:: Run a command with a different root directory
++* env:: Run a command in a modified environment
++* nice:: Run a command with modified niceness
++* nohup:: Run a command immune to hangups
++* stdbuf:: Run a command with modified I/O buffering
++* su:: Run a command with substitute user and group ID
++* timeout:: Run a command with a time limit
+
+ Delaying
+
+-* sleep invocation:: Delay for a specified time
++* sleep:: Delay for a specified time
+
+ Numeric operations
+
+-* factor invocation:: Print prime factors
+-* seq invocation:: Print numeric sequences
++* factor:: Print prime factors
++* seq:: Print numeric sequences
+
+ File permissions
+
+@@ -1443,14 +1428,14 @@
+ in some way.
+
+ @menu
+-* cat invocation:: Concatenate and write files.
+-* tac invocation:: Concatenate and write files in reverse.
+-* nl invocation:: Number lines and write files.
+-* od invocation:: Write files in octal or other formats.
+-* base64 invocation:: Transform data into printable data.
++* cat:: Concatenate and write files.
++* tac:: Concatenate and write files in reverse.
++* nl:: Number lines and write files.
++* od:: Write files in octal or other formats.
++* base64:: Transform data into printable data.
+ @end menu
+
+-@node cat invocation
++@node cat
+ @section @command{cat}: Concatenate and write files
+
+ @pindex cat
+@@ -1550,7 +1535,7 @@
+ @end smallexample
+
+
+-@node tac invocation
++@node tac
+ @section @command{tac}: Concatenate and write files in reverse
+
+ @pindex tac
+@@ -1599,7 +1584,7 @@
+ @exitstatus
+
+
+-@node nl invocation
++@node nl
+ @section @command{nl}: Number lines and write files
+
+ @pindex nl
+@@ -1762,7 +1747,7 @@
+ @exitstatus
+
+
+-@node od invocation
++@node od
+ @section @command{od}: Write files in octal or other formats
+
+ @pindex od
+@@ -2016,7 +2001,7 @@
+
+ @exitstatus
+
+-@node base64 invocation
++@node base64
+ @section @command{base64}: Transform data into printable data
+
+ @pindex base64
+@@ -2084,13 +2069,13 @@
+ These commands reformat the contents of files.
+
+ @menu
+-* fmt invocation:: Reformat paragraph text.
+-* pr invocation:: Paginate or columnate files for printing.
+-* fold invocation:: Wrap input lines to fit in specified width.
++* fmt:: Reformat paragraph text.
++* pr:: Paginate or columnate files for printing.
++* fold:: Wrap input lines to fit in specified width.
+ @end menu
+
+
+-@node fmt invocation
++@node fmt
+ @section @command{fmt}: Reformat paragraph text
+
+ @pindex fmt
+@@ -2189,7 +2174,7 @@
+ @exitstatus
+
+
+-@node pr invocation
++@node pr
+ @section @command{pr}: Paginate or columnate files for printing
+
+ @pindex pr
+@@ -2329,7 +2314,7 @@
+ @cindex time formats
+ @cindex formatting times
+ Format header dates using @var{format}, using the same conventions as
+-for the command @samp{date +@var{format}}; @xref{date invocation}.
++for the command @samp{date +@var{format}}; @xref{date}.
+ Except for directives, which start with
+ @samp{%}, characters in @var{format} are printed unchanged. You can use
+ this option to specify an arbitrary string in place of the header date,
+@@ -2556,7 +2541,7 @@
+ @exitstatus
+
+
+-@node fold invocation
++@node fold
+ @section @command{fold}: Wrap input lines to fit in specified width
+
+ @pindex fold
+@@ -2623,13 +2608,13 @@
+ These commands output pieces of the input.
+
+ @menu
+-* head invocation:: Output the first part of files.
+-* tail invocation:: Output the last part of files.
+-* split invocation:: Split a file into pieces.
+-* csplit invocation:: Split a file into context-determined pieces.
++* head:: Output the first part of files.
++* tail:: Output the last part of files.
++* split:: Split a file into pieces.
++* csplit:: Split a file into context-determined pieces.
+ @end menu
+
+-@node head invocation
++@node head
+ @section @command{head}: Output the first part of files
+
+ @pindex head
+@@ -2706,7 +2691,7 @@
+ @exitstatus
+
+
+-@node tail invocation
++@node tail
+ @section @command{tail}: Output the last part of files
+
+ @pindex tail
+@@ -2922,7 +2907,7 @@
+ @exitstatus
+
+
+-@node split invocation
++@node split
+ @section @command{split}: Split a file into pieces.
+
+ @pindex split
+@@ -3112,7 +3097,7 @@
+ @end example
+
+
+-@node csplit invocation
++@node csplit
+ @section @command{csplit}: Split a file into context-determined pieces
+
+ @pindex csplit
+@@ -3303,16 +3288,16 @@
+ contents of files.
+
+ @menu
+-* wc invocation:: Print newline, word, and byte counts.
+-* sum invocation:: Print checksum and block counts.
+-* cksum invocation:: Print CRC checksum and byte counts.
+-* md5sum invocation:: Print or check MD5 digests.
+-* sha1sum invocation:: Print or check SHA-1 digests.
++* wc:: Print newline, word, and byte counts.
++* sum:: Print checksum and block counts.
++* cksum:: Print CRC checksum and byte counts.
++* md5sum:: Print or check MD5 digests.
++* sha1sum:: Print or check SHA-1 digests.
+ * sha2 utilities:: Print or check SHA-2 digests.
+ @end menu
+
+
+-@node wc invocation
++@node wc
+ @section @command{wc}: Print newline, word, and byte counts
+
+ @pindex wc
+@@ -3430,7 +3415,7 @@
+ @exitstatus
+
+
+-@node sum invocation
++@node sum
+ @section @command{sum}: Print checksum and block counts
+
+ @pindex sum
+@@ -3481,7 +3466,7 @@
+ @exitstatus
+
+
+-@node cksum invocation
++@node cksum
+ @section @command{cksum}: Print CRC checksum and byte counts
+
+ @pindex cksum
+@@ -3515,7 +3500,7 @@
+ @exitstatus
+
+
+-@node md5sum invocation
++@node md5sum
+ @section @command{md5sum}: Print or check MD5 digests
+
+ @pindex md5sum
+@@ -3643,7 +3628,7 @@
+ @exitstatus
+
+
+-@node sha1sum invocation
++@node sha1sum
+ @section @command{sha1sum}: Print or check SHA-1 digests
+
+ @pindex sha1sum
+@@ -3655,7 +3640,7 @@
+
+ @command{sha1sum} computes a 160-bit checksum for each specified
+ @var{file}. The usage and options of this command are precisely the
+-same as for @command{md5sum}. @xref{md5sum invocation}.
++same as for @command{md5sum}. @xref{md5sum}.
+
+ Note: The SHA-1 digest is more secure than MD5, and no collisions of
+ it are known (different files having the same fingerprint). However,
+@@ -3695,7 +3680,7 @@
+ various lengths (respectively 224, 256, 384 and 512 bits),
+ collectively known as the SHA-2 hashes. The usage and options of
+ these commands are precisely the same as for @command{md5sum}.
+-@xref{md5sum invocation}.
++@xref{md5sum}.
+
+ Note: The SHA384 and SHA512 digests are considerably slower to
+ compute, especially on 32-bit computers, than SHA224 or SHA256.
+@@ -3710,16 +3695,16 @@
+ These commands work with (or produce) sorted files.
+
+ @menu
+-* sort invocation:: Sort text files.
+-* shuf invocation:: Shuffle text files.
+-* uniq invocation:: Uniquify files.
+-* comm invocation:: Compare two sorted files line by line.
+-* ptx invocation:: Produce a permuted index of file contents.
+-* tsort invocation:: Topological sort.
++* sort:: Sort text files.
++* shuf:: Shuffle text files.
++* uniq:: Uniquify files.
++* comm:: Compare two sorted files line by line.
++* ptx:: Produce a permuted index of file contents.
++* tsort:: Topological sort.
+ @end menu
+
+
+-@node sort invocation
++@node sort
+ @section @command{sort}: Sort text files
+
+ @pindex sort
+@@ -4008,7 +3993,7 @@
+ Sort by hashing the input keys and then sorting the hash values.
+ Choose the hash function at random, ensuring that it is free of
+ collisions so that differing keys have differing hash values. This is
+-like a random permutation of the inputs (@pxref{shuf invocation}),
++like a random permutation of the inputs (@pxref{shuf}),
+ except that keys with the same value sort together.
+
+ If multiple random sort fields are specified, the same random hash
+@@ -4196,7 +4181,7 @@
+ @var{n} is set to the number of available processors, but limited
+ to 8, as there are diminishing performance gains after that.
+ Note also that using @var{n} threads increases the memory usage by
+-a factor of log @var{n}. Also see @ref{nproc invocation}.
++a factor of log @var{n}. Also see @ref{nproc}.
+
+ @item -u
+ @itemx --unique
+@@ -4214,7 +4199,7 @@
+ this equivalence does not extend to arbitrary @command{sort} options.
+ For example, @code{sort -n -u} inspects only the value of the initial
+ numeric string when checking for uniqueness, whereas @code{sort -n |
+-uniq} inspects the entire line. @xref{uniq invocation}.
++uniq} inspects the entire line. @xref{uniq}.
+
+ @macro zeroTerminatedOption
+ @item -z
+@@ -4437,7 +4422,7 @@
+ @end itemize
+
+
+-@node shuf invocation
++@node shuf
+ @section @command{shuf}: Shuffling text
+
+ @pindex shuf
+@@ -4567,7 +4552,7 @@
+ @exitstatus
+
+
+-@node uniq invocation
++@node uniq
+ @section @command{uniq}: Uniquify files
+
+ @pindex uniq
+@@ -4589,7 +4574,7 @@
+ The input need not be sorted, but repeated input lines are detected
+ only if they are adjacent. If you want to discard non-adjacent
+ duplicate lines, perhaps you want to use @code{sort -u}.
+-@xref{sort invocation}.
++@xref{sort}.
+
+ @vindex LC_COLLATE
+ Comparisons honor the rules specified by the @env{LC_COLLATE}
+@@ -4716,7 +4701,7 @@
+ @exitstatus
+
+
+-@node comm invocation
++@node comm
+ @section @command{comm}: Compare two sorted files line by line
+
+ @pindex comm
+@@ -4792,7 +4777,7 @@
+
+ @end table
+
+-@node ptx invocation
++@node ptx
+ @section @command{ptx}: Produce permuted indexes
+
+ @pindex ptx
+@@ -5249,7 +5234,7 @@
+ @end itemize
+
+
+-@node tsort invocation
++@node tsort
+ @section @command{tsort}: Topological sort
+
+ @pindex tsort
+@@ -5411,13 +5396,13 @@
+ @chapter Operating on fields
+
+ @menu
+-* cut invocation:: Print selected parts of lines.
+-* paste invocation:: Merge lines of files.
+-* join invocation:: Join lines on a common field.
++* cut:: Print selected parts of lines.
++* paste:: Merge lines of files.
++* join:: Join lines on a common field.
+ @end menu
+
+
+-@node cut invocation
++@node cut
+ @section @command{cut}: Print selected parts of lines
+
+ @pindex cut
+@@ -5522,7 +5507,7 @@
+ @exitstatus
+
+
+-@node paste invocation
++@node paste
+ @section @command{paste}: Merge lines of files
+
+ @pindex paste
+@@ -5592,7 +5577,7 @@
+ @exitstatus
+
+
+-@node join invocation
++@node join
+ @section @command{join}: Join lines on a common field
+
+ @pindex join
+@@ -5757,13 +5742,13 @@
+ This commands operate on individual characters.
+
+ @menu
+-* tr invocation:: Translate, squeeze, and/or delete characters.
+-* expand invocation:: Convert tabs to spaces.
+-* unexpand invocation:: Convert spaces to tabs.
++* tr:: Translate, squeeze, and/or delete characters.
++* expand:: Convert tabs to spaces.
++* unexpand:: Convert spaces to tabs.
+ @end menu
+
+
+-@node tr invocation
++@node tr
+ @section @command{tr}: Translate, squeeze, and/or delete characters
+
+ @pindex tr
+@@ -6142,7 +6127,7 @@
+ @end itemize
+
+
+-@node expand invocation
++@node expand
+ @section @command{expand}: Convert tabs to spaces
+
+ @pindex expand
+@@ -6195,7 +6180,7 @@
+ @exitstatus
+
+
+-@node unexpand invocation
++@node unexpand
+ @section @command{unexpand}: Convert spaces to tabs
+
+ @pindex unexpand
+@@ -6256,14 +6241,14 @@
+ and @command{vdir}, which list information about files.
+
+ @menu
+-* ls invocation:: List directory contents.
+-* dir invocation:: Briefly ls.
+-* vdir invocation:: Verbosely ls.
+-* dircolors invocation:: Color setup for ls, etc.
++* ls:: List directory contents.
++* dir:: Briefly ls.
++* vdir:: Verbosely ls.
++* dircolors:: Color setup for ls, etc.
+ @end menu
+
+
+-@node ls invocation
++@node ls
+ @section @command{ls}: List directory contents
+
+ @pindex ls
+@@ -7101,7 +7086,7 @@
+ @item +@var{format}
+ @vindex LC_TIME
+ List timestamps using @var{format}, where @var{format} is interpreted
+-like the format argument of @command{date} (@pxref{date invocation}).
++like the format argument of @command{date} (@pxref{date}).
+ For example, @option{--time-style="+%Y-%m-%d %H:%M:%S"} causes
+ @command{ls} to list timestamps like @samp{2002-03-30 23:45:56}. As
+ with @command{date}, @var{format}'s interpretation is affected by the
+@@ -7293,7 +7278,7 @@
+ @end table
+
+
+-@node dir invocation
++@node dir
+ @section @command{dir}: Briefly list directory contents
+
+ @pindex dir
+@@ -7303,10 +7288,10 @@
+ -b}; that is, by default files are listed in columns, sorted vertically,
+ and special characters are represented by backslash escape sequences.
+
+-@xref{ls invocation, @command{ls}}.
++@xref{ls, @command{ls}}.
+
+
+-@node vdir invocation
++@node vdir
+ @section @command{vdir}: Verbosely list directory contents
+
+ @pindex vdir
+@@ -7316,7 +7301,7 @@
+ -b}; that is, by default files are listed in long format and special
+ characters are represented by backslash escape sequences.
+
+-@node dircolors invocation
++@node dircolors
+ @section @command{dircolors}: Color setup for @command{ls}
+
+ @pindex dircolors
+@@ -7403,16 +7388,16 @@
+ copying, moving (renaming), and deleting (removing).
+
+ @menu
+-* cp invocation:: Copy files.
+-* dd invocation:: Convert and copy a file.
+-* install invocation:: Copy files and set attributes.
+-* mv invocation:: Move (rename) files.
+-* rm invocation:: Remove files or directories.
+-* shred invocation:: Remove files more securely.
++* cp:: Copy files.
++* dd:: Convert and copy a file.
++* install:: Copy files and set attributes.
++* mv:: Move (rename) files.
++* rm:: Remove files or directories.
++* shred:: Remove files more securely.
+ @end menu
+
+
+-@node cp invocation
++@node cp
+ @section @command{cp}: Copy files and directories
+
+ @pindex cp
+@@ -7861,7 +7846,7 @@
+ @exitstatus
+
+
+-@node dd invocation
++@node dd
+ @section @command{dd}: Convert and copy a file
+
+ @pindex dd
+@@ -8226,7 +8211,7 @@
+ @exitstatus
+
+
+-@node install invocation
++@node install
+ @section @command{install}: Copy files and set attributes
+
+ @pindex install
+@@ -8407,7 +8392,7 @@
+ @exitstatus
+
+
+-@node mv invocation
++@node mv
+ @section @command{mv}: Move (rename) files
+
+ @pindex mv
+@@ -8538,7 +8523,7 @@
+ @exitstatus
+
+
+-@node rm invocation
++@node rm
+ @section @command{rm}: Remove files or directories
+
+ @pindex rm
+@@ -8693,7 +8678,7 @@
+ @exitstatus
+
+
+-@node shred invocation
++@node shred
+ @section @command{shred}: Remove files more securely
+
+ @pindex shred
+@@ -8703,7 +8688,7 @@
+ @command{shred} overwrites devices or files, to help prevent even
+ very expensive hardware from recovering the data.
+
+-Ordinarily when you remove a file (@pxref{rm invocation}), the data is
++Ordinarily when you remove a file (@pxref{rm}), the data is
+ not actually destroyed. Only the index listing where the file is
+ stored is destroyed, and the storage is made available for reuse.
+ There are undelete utilities that will attempt to reconstruct the index
+@@ -8936,18 +8921,18 @@
+ (FIFOs), symbolic links, sockets, and so-called @dfn{special files}.
+
+ @menu
+-* link invocation:: Make a hard link via the link syscall
+-* ln invocation:: Make links between files.
+-* mkdir invocation:: Make directories.
+-* mkfifo invocation:: Make FIFOs (named pipes).
+-* mknod invocation:: Make block or character special files.
+-* readlink invocation:: Print value of a symlink or canonical file name.
+-* rmdir invocation:: Remove empty directories.
+-* unlink invocation:: Remove files via the unlink syscall
++* link:: Make a hard link via the link syscall
++* ln:: Make links between files.
++* mkdir:: Make directories.
++* mkfifo:: Make FIFOs (named pipes).
++* mknod:: Make block or character special files.
++* readlink:: Print value of a symlink or canonical file name.
++* rmdir:: Remove empty directories.
++* unlink:: Remove files via the unlink syscall
+ @end menu
+
+
+-@node link invocation
++@node link
+ @section @command{link}: Make a hard link via the link syscall
+
+ @pindex link
+@@ -8960,7 +8945,7 @@
+ @code{link} function. @xref{Hard Links, , , libc,
+ The GNU C Library Reference Manual}.
+ It avoids the bells and whistles of the more commonly-used
+-@command{ln} command (@pxref{ln invocation}).
++@command{ln} command (@pxref{ln}).
+ Synopsis:
+
+ @example
+@@ -8986,7 +8971,7 @@
+ @exitstatus
+
+
+-@node ln invocation
++@node ln
+ @section @command{ln}: Make links between files
+
+ @pindex ln
+@@ -9215,7 +9200,7 @@
+ @end smallexample
+
+
+-@node mkdir invocation
++@node mkdir
+ @section @command{mkdir}: Make directories
+
+ @pindex mkdir
+@@ -9294,7 +9279,7 @@
+ @exitstatus
+
+
+-@node mkfifo invocation
++@node mkfifo
+ @section @command{mkfifo}: Make FIFOs (named pipes)
+
+ @pindex mkfifo
+@@ -9341,7 +9326,7 @@
+ @exitstatus
+
+
+-@node mknod invocation
++@node mknod
+ @section @command{mknod}: Make block or character special files
+
+ @pindex mknod
+@@ -9424,7 +9409,7 @@
+ @exitstatus
+
+
+-@node readlink invocation
++@node readlink
+ @section @command{readlink}: Print value of a symlink or canonical file name
+
+ @pindex readlink
+@@ -9520,7 +9505,7 @@
+ @exitstatus
+
+
+-@node rmdir invocation
++@node rmdir
+ @section @command{rmdir}: Remove empty directories
+
+ @pindex rmdir
+@@ -9568,12 +9553,12 @@
+
+ @end table
+
+-@xref{rm invocation}, for how to remove non-empty directories (recursively).
++@xref{rm}, for how to remove non-empty directories (recursively).
+
+ @exitstatus
+
+
+-@node unlink invocation
++@node unlink
+ @section @command{unlink}: Remove files via the unlink syscall
+
+ @pindex unlink
+@@ -9584,7 +9569,7 @@
+ @code{unlink} function. @xref{Deleting Files, , , libc,
+ The GNU C Library Reference Manual}. Synopsis:
+ It avoids the bells and whistles of the more commonly-used
+-@command{rm} command (@pxref{rm invocation}).
++@command{rm} command (@pxref{rm}).
+
+ @example
+ unlink @var{filename}
+@@ -9618,14 +9603,14 @@
+ These commands change file attributes.
+
+ @menu
+-* chgrp invocation:: Change file groups.
+-* chmod invocation:: Change access permissions.
+-* chown invocation:: Change file owners and groups.
+-* touch invocation:: Change file timestamps.
++* chgrp:: Change file groups.
++* chmod:: Change access permissions.
++* chown:: Change file owners and groups.
++* touch:: Change file timestamps.
+ @end menu
+
+
+-@node chown invocation
++@node chown
+ @section @command{chown}: Change file owner and group
+
+ @pindex chown
+@@ -9843,7 +9828,7 @@
+ @end smallexample
+
+
+-@node chgrp invocation
++@node chgrp
+ @section @command{chgrp}: Change group ownership
+
+ @pindex chgrp
+@@ -9966,7 +9951,7 @@
+ @end smallexample
+
+
+-@node chmod invocation
++@node chmod
+ @section @command{chmod}: Change access permissions
+
+ @pindex chmod
+@@ -10066,7 +10051,7 @@
+ @exitstatus
+
+
+-@node touch invocation
++@node touch
+ @section @command{touch}: Change file timestamps
+
+ @pindex touch
+@@ -10243,15 +10228,15 @@
+ file status information, and write buffers to disk.
+
+ @menu
+-* df invocation:: Report file system disk space usage.
+-* du invocation:: Estimate file space usage.
+-* stat invocation:: Report file or file system status.
+-* sync invocation:: Synchronize memory and disk.
+-* truncate invocation:: Shrink or extend the size of a file.
++* df:: Report file system disk space usage.
++* du:: Estimate file space usage.
++* stat:: Report file or file system status.
++* sync:: Synchronize memory and disk.
++* truncate:: Shrink or extend the size of a file.
+ @end menu
+
+
+-@node df invocation
++@node df
+ @section @command{df}: Report file system disk space usage
+
+ @pindex df
+@@ -10464,7 +10449,7 @@
+ @samp{ext3} or @samp{reiserfs}.
+
+
+-@node du invocation
++@node du
+ @section @command{du}: Estimate file space usage
+
+ @pindex du
+@@ -10662,7 +10647,7 @@
+ @item +@var{format}
+ @vindex LC_TIME
+ List timestamps using @var{format}, where @var{format} is interpreted
+-like the format argument of @command{date} (@pxref{date invocation}).
++like the format argument of @command{date} (@pxref{date}).
+ For example, @option{--time-style="+%Y-%m-%d %H:%M:%S"} causes
+ @command{du} to list timestamps like @samp{2002-03-30 23:45:56}. As
+ with @command{date}, @var{format}'s interpretation is affected by the
+@@ -10730,7 +10715,7 @@
+ @exitstatus
+
+
+-@node stat invocation
++@node stat
+ @section @command{stat}: Report file or file system status
+
+ @pindex stat
+@@ -10914,7 +10899,7 @@
+ @exitstatus
+
+
+-@node sync invocation
++@node sync
+ @section @command{sync}: Synchronize data on disk with memory
+
+ @pindex sync
+@@ -10941,7 +10926,7 @@
+ @exitstatus
+
+
+-@node truncate invocation
++@node truncate
+ @section @command{truncate}: Shrink or extend the size of a file
+
+ @pindex truncate
+@@ -11017,13 +11002,13 @@
+ This section describes commands that display text strings.
+
+ @menu
+-* echo invocation:: Print a line of text.
+-* printf invocation:: Format and print data.
+-* yes invocation:: Print a string until interrupted.
++* echo:: Print a line of text.
++* printf:: Format and print data.
++* yes:: Print a string until interrupted.
+ @end menu
+
+
+-@node echo invocation
++@node echo
+ @section @command{echo}: Print a line of text
+
+ @pindex echo
+@@ -11110,12 +11095,12 @@
+ @var{string} contains a backslash or if the first argument is
+ @option{-n}. Portable programs can use the @command{printf} command
+ if they need to omit trailing newlines or output control characters or
+-backslashes. @xref{printf invocation}.
++backslashes. @xref{printf}.
+
+ @exitstatus
+
+
+-@node printf invocation
++@node printf
+ @section @command{printf}: Format and print data
+
+ @pindex printf
+@@ -11264,7 +11249,7 @@
+ @exitstatus
+
+
+-@node yes invocation
++@node yes
+ @section @command{yes}: Print a string until interrupted
+
+ @pindex yes
+@@ -11295,14 +11280,14 @@
+ pipeline.
+
+ @menu
+-* false invocation:: Do nothing, unsuccessfully.
+-* true invocation:: Do nothing, successfully.
+-* test invocation:: Check file types and compare values.
+-* expr invocation:: Evaluate expressions.
++* false:: Do nothing, unsuccessfully.
++* true:: Do nothing, successfully.
++* test:: Check file types and compare values.
++* expr:: Evaluate expressions.
+ @end menu
+
+
+-@node false invocation
++@node false
+ @section @command{false}: Do nothing, unsuccessfully
+
+ @pindex false
+@@ -11332,7 +11317,7 @@
+ non-@acronym{GNU} hosts.
+
+
+-@node true invocation
++@node true
+ @section @command{true}: Do nothing, successfully
+
+ @pindex true
+@@ -11368,7 +11353,7 @@
+ more secure and faster than a shell script implementation, and may safely
+ be used as a dummy shell for the purpose of disabling accounts.
+
+-@node test invocation
++@node test
+ @section @command{test}: Check file types and compare values
+
+ @pindex test
+@@ -11696,7 +11681,7 @@
+ @end table
+
+
+-@node expr invocation
++@node expr
+ @section @command{expr}: Evaluate expressions
+
+ @pindex expr
+@@ -11973,11 +11958,11 @@
+ it's described here.
+
+ @menu
+-* tee invocation:: Redirect output to multiple files or processes.
++* tee:: Redirect output to multiple files or processes.
+ @end menu
+
+
+-@node tee invocation
++@node tee
+ @section @command{tee}: Redirect output to multiple files or processes
+
+ @pindex tee
+@@ -12138,14 +12123,14 @@
+ This section describes commands that manipulate file names.
+
+ @menu
+-* basename invocation:: Strip directory and suffix from a file name.
+-* dirname invocation:: Strip last file name component.
+-* pathchk invocation:: Check file name validity and portability.
+-* mktemp invocation:: Create temporary file or directory.
++* basename:: Strip directory and suffix from a file name.
++* dirname:: Strip last file name component.
++* pathchk:: Check file name validity and portability.
++* mktemp:: Create temporary file or directory.
+ @end menu
+
+
+-@node basename invocation
++@node basename
+ @section @command{basename}: Strip directory and suffix from a file name
+
+ @pindex basename
+@@ -12199,7 +12184,7 @@
+ @end smallexample
+
+
+-@node dirname invocation
++@node dirname
+ @section @command{dirname}: Strip last file name component
+
+ @pindex dirname
+@@ -12244,7 +12229,7 @@
+ @end smallexample
+
+
+-@node pathchk invocation
++@node pathchk
+ @section @command{pathchk}: Check file name validity and portability
+
+ @pindex pathchk
+@@ -12320,7 +12305,7 @@
+ 1 otherwise.
+ @end display
+
+-@node mktemp invocation
++@node mktemp
+ @section @command{mktemp}: Create temporary file or directory
+
+ @pindex mktemp
+@@ -12506,14 +12491,14 @@
+ so forth. See also the user-related commands in the next section.
+
+ @menu
+-* pwd invocation:: Print working directory.
+-* stty invocation:: Print or change terminal characteristics.
+-* printenv invocation:: Print environment variables.
+-* tty invocation:: Print file name of terminal on standard input.
++* pwd:: Print working directory.
++* stty:: Print or change terminal characteristics.
++* printenv:: Print environment variables.
++* tty:: Print file name of terminal on standard input.
+ @end menu
+
+
+-@node pwd invocation
++@node pwd
+ @section @command{pwd}: Print working directory
+
+ @pindex pwd
+@@ -12560,7 +12545,7 @@
+ @exitstatus
+
+
+-@node stty invocation
++@node stty
+ @section @command{stty}: Print or change terminal characteristics
+
+ @pindex stty
+@@ -13244,7 +13229,7 @@
+ @end table
+
+
+-@node printenv invocation
++@node printenv
+ @section @command{printenv}: Print all or some environment variables
+
+ @pindex printenv
+@@ -13279,7 +13264,7 @@
+ @end display
+
+
+-@node tty invocation
++@node tty
+ @section @command{tty}: Print file name of terminal on standard input
+
+ @pindex tty
+@@ -13329,16 +13314,16 @@
+ logins, groups, and so forth.
+
+ @menu
+-* id invocation:: Print user identity.
+-* logname invocation:: Print current login name.
+-* whoami invocation:: Print effective user ID.
+-* groups invocation:: Print group names a user is in.
+-* users invocation:: Print login names of users currently logged in.
+-* who invocation:: Print who is currently logged in.
++* id:: Print user identity.
++* logname:: Print current login name.
++* whoami:: Print effective user ID.
++* groups:: Print group names a user is in.
++* users:: Print login names of users currently logged in.
++* who:: Print who is currently logged in.
+ @end menu
+
+
+-@node id invocation
++@node id
+ @section @command{id}: Print user identity
+
+ @pindex id
+@@ -13424,7 +13409,7 @@
+ @end macro
+ @primaryAndSupplementaryGroups{id,user argument}
+
+-@node logname invocation
++@node logname
+ @section @command{logname}: Print current login name
+
+ @pindex logname
+@@ -13445,7 +13430,7 @@
+ @exitstatus
+
+
+-@node whoami invocation
++@node whoami
+ @section @command{whoami}: Print effective user ID
+
+ @pindex whoami
+@@ -13461,7 +13446,7 @@
+ @exitstatus
+
+
+-@node groups invocation
++@node groups
+ @section @command{groups}: Print group names a user is in
+
+ @pindex groups
+@@ -13489,7 +13474,7 @@
+ @exitstatus
+
+
+-@node users invocation
++@node users
+ @section @command{users}: Print login names of users currently logged in
+
+ @pindex users
+@@ -13520,7 +13505,7 @@
+ @exitstatus
+
+
+-@node who invocation
++@node who
+ @section @command{who}: Print who is currently logged in
+
+ @pindex who
+@@ -13679,16 +13664,14 @@
+ information.
+
+ @menu
+-* date invocation:: Print or set system date and time.
+-* arch invocation:: Print machine hardware name.
+-* nproc invocation:: Print the number of processors.
+-* uname invocation:: Print system information.
+-* hostname invocation:: Print or set system name.
+-* hostid invocation:: Print numeric host identifier.
+-* uptime invocation:: Print system uptime and load.
++* date:: Print or set system date and time.
++* arch:: Print machine hardware name.
++* nproc:: Print the number of processors.
++* uname:: Print system information.
++* hostid:: Print numeric host identifier.
+ @end menu
+
+-@node date invocation
++@node date
+ @section @command{date}: Print or set system date and time
+
+ @pindex date
+@@ -14321,7 +14304,7 @@
+ @end itemize
+
+
+-@node arch invocation
++@node arch
+ @section @command{arch}: Print machine hardware name
+
+ @pindex arch
+@@ -14341,7 +14324,7 @@
+ @exitstatus
+
+
+-@node nproc invocation
++@node nproc
+ @section @command{nproc}: Print the number of available processors
+
+ @pindex nproc
+@@ -14378,7 +14361,7 @@
+ @exitstatus
+
+
+-@node uname invocation
++@node uname
+ @section @command{uname}: Print system information
+
+ @pindex uname
+@@ -14508,31 +14491,7 @@
+ @exitstatus
+
+
+-@node hostname invocation
+-@section @command{hostname}: Print or set system name
+-
+-@pindex hostname
+-@cindex setting the hostname
+-@cindex printing the hostname
+-@cindex system name, printing
+-@cindex appropriate privileges
+-
+-With no arguments, @command{hostname} prints the name of the current host
+-system. With one argument, it sets the current host name to the
+-specified string. You must have appropriate privileges to set the host
+-name. Synopsis:
+-
+-@example
+-hostname [@var{name}]
+-@end example
+-
+-The only options are @option{--help} and @option{--version}. @xref{Common
+-options}.
+-
+-@exitstatus
+-
+-
+-@node hostid invocation
++@node hostid
+ @section @command{hostid}: Print numeric host identifier
+
+ @pindex hostid
+@@ -14556,37 +14515,6 @@
+
+ @exitstatus
+
+-@node uptime invocation
+-@section @command{uptime}: Print system uptime and load
+-
+-@pindex uptime
+-@cindex printing the system uptime and load
+-
+-@command{uptime} prints the current time, the system's uptime, the
+-number of logged-in users and the current load average.
+-
+-If an argument is specified, it is used as the file to be read
+-to discover how many users are logged in. If no argument is
+-specified, a system default is used (@command{uptime --help} indicates
+-the default setting).
+-
+-The only options are @option{--help} and @option{--version}.
+-@xref{Common options}.
+-
+-For example, here's what it prints right now on one system I use:
+-
+-@example
+-$ uptime
+- 14:07 up 3:35, 3 users, load average: 1.39, 1.15, 1.04
+-@end example
+-
+-The precise method of calculation of load average varies somewhat
+-between systems. Some systems calculate it as the average number of
+-runnable processes over the last 1, 5 and 15 minutes, but some systems
+-also include processes in the uninterruptible sleep state (that is,
+-those processes which are waiting for disk I/O). The Linux kernel
+-includes uninterruptible processes.
+-
+ @node SELinux context
+ @chapter SELinux context
+
+@@ -14598,11 +14526,11 @@
+ contexts.
+
+ @menu
+-* chcon invocation:: Change SELinux context of file
+-* runcon invocation:: Run a command in specified SELinux context
++* chcon:: Change SELinux context of file
++* runcon:: Run a command in specified SELinux context
+ @end menu
+
+-@node chcon invocation
++@node chcon
+ @section @command{chcon}: Change SELinux context of file
+
+ @pindex chcon
+@@ -14689,7 +14617,7 @@
+
+ @exitstatus
+
+-@node runcon invocation
++@node runcon
+ @section @command{runcon}: Run a command in specified SELinux context
+
+ @pindex runcon
+@@ -14774,17 +14702,17 @@
+ user, etc.
+
+ @menu
+-* chroot invocation:: Modify the root directory.
+-* env invocation:: Modify environment variables.
+-* nice invocation:: Modify niceness.
+-* nohup invocation:: Immunize to hangups.
+-* stdbuf invocation:: Modify buffering of standard streams.
+-* su invocation:: Modify user and group ID.
+-* timeout invocation:: Run with time limit.
++* chroot:: Modify the root directory.
++* env:: Modify environment variables.
++* nice:: Modify niceness.
++* nohup:: Immunize to hangups.
++* stdbuf:: Modify buffering of standard streams.
++* su:: Modify user and group ID.
++* timeout:: Run with time limit.
+ @end menu
+
+
+-@node chroot invocation
++@node chroot
+ @section @command{chroot}: Run a command with a different root directory
+
+ @pindex chroot
+@@ -14872,7 +14800,7 @@
+ @end display
+
+
+-@node env invocation
++@node env
+ @section @command{env}: Run a command in a modified environment
+
+ @pindex env
+@@ -15022,7 +14950,7 @@
+ @end display
+
+
+-@node nice invocation
++@node nice
+ @section @command{nice}: Run a command with modified niceness
+
+ @pindex nice
+@@ -15145,7 +15073,7 @@
+ @end example
+
+
+-@node nohup invocation
++@node nohup
+ @section @command{nohup}: Run a command immune to hangups
+
+ @pindex nohup
+@@ -15218,7 +15146,7 @@
+ instead of 125.
+
+
+-@node stdbuf invocation
++@node stdbuf
+ @section @command{stdbuf}: Run a command with modified I/O stream buffering
+
+ @pindex stdbuf
+@@ -15297,7 +15225,7 @@
+ @end display
+
+
+-@node su invocation
++@node su
+ @section @command{su}: Run a command with substitute user and group ID
+
+ @pindex su
+@@ -15454,7 +15382,7 @@
+ might find this idea strange at first.
+
+
+-@node timeout invocation
++@node timeout
+ @section @command{timeout}: Run a command with a time limit
+
+ @pindex timeout
+@@ -15515,89 +15443,6 @@
+ @end display
+
+
+-@node Process control
+-@chapter Process control
+-
+-@cindex processes, commands for controlling
+-@cindex commands for controlling processes
+-
+-@menu
+-* kill invocation:: Sending a signal to processes.
+-@end menu
+-
+-
+-@node kill invocation
+-@section @command{kill}: Send a signal to processes
+-
+-@pindex kill
+-@cindex send a signal to processes
+-
+-The @command{kill} command sends a signal to processes, causing them
+-to terminate or otherwise act upon receiving the signal in some way.
+-Alternatively, it lists information about signals. Synopses:
+-
+-@example
+-kill [-s @var{signal} | --signal @var{signal} | -@var{signal}] @var{pid}@dots{}
+-kill [-l | --list | -t | --table] [@var{signal}]@dots{}
+-@end example
+-
+-@mayConflictWithShellBuiltIn{kill}
+-
+-The first form of the @command{kill} command sends a signal to all
+-@var{pid} arguments. The default signal to send if none is specified
+-is @samp{TERM}. The special signal number @samp{0} does not denote a
+-valid signal, but can be used to test whether the @var{pid} arguments
+-specify processes to which a signal could be sent.
+-
+-If @var{pid} is positive, the signal is sent to the process with the
+-process ID @var{pid}. If @var{pid} is zero, the signal is sent to all
+-processes in the process group of the current process. If @var{pid}
+-is @minus{}1, the signal is sent to all processes for which the user has
+-permission to send a signal. If @var{pid} is less than @minus{}1, the signal
+-is sent to all processes in the process group that equals the absolute
+-value of @var{pid}.
+-
+-If @var{pid} is not positive, a system-dependent set of system
+-processes is excluded from the list of processes to which the signal
+-is sent.
+-
+-If a negative @var{pid} argument is desired as the first one, it
+-should be preceded by @option{--}. However, as a common extension to
+-@acronym{POSIX}, @option{--} is not required with @samp{kill
+--@var{signal} -@var{pid}}. The following commands are equivalent:
+-
+-@example
+-kill -15 -1
+-kill -TERM -1
+-kill -s TERM -- -1
+-kill -- -1
+-@end example
+-
+-The first form of the @command{kill} command succeeds if every @var{pid}
+-argument specifies at least one process that the signal was sent to.
+-
+-The second form of the @command{kill} command lists signal information.
+-Either the @option{-l} or @option{--list} option, or the @option{-t}
+-or @option{--table} option must be specified. Without any
+-@var{signal} argument, all supported signals are listed. The output
+-of @option{-l} or @option{--list} is a list of the signal names, one
+-per line; if @var{signal} is already a name, the signal number is
+-printed instead. The output of @option{-t} or @option{--table} is a
+-table of signal numbers, names, and descriptions. This form of the
+-@command{kill} command succeeds if all @var{signal} arguments are valid
+-and if there is no output error.
+-
+-The @command{kill} command also supports the @option{--help} and
+-@option{--version} options. @xref{Common options}.
+-
+-A @var{signal} may be a signal name like @samp{HUP}, or a signal
+-number like @samp{1}, or an exit status of a process terminated by the
+-signal. A signal name can be given in canonical form or prefixed by
+-@samp{SIG}. The case of the letters is ignored, except for the
+-@option{-@var{signal}} option which must use upper case to avoid
+-ambiguity with lower case option letters. For a list of supported
+-signal names and numbers see @xref{Signal specifications}.
+-
+ @node Delaying
+ @chapter Delaying
+
+@@ -15607,11 +15452,11 @@
+ @c Perhaps @command{wait} or other commands should be described here also?
+
+ @menu
+-* sleep invocation:: Delay for a specified time.
++* sleep:: Delay for a specified time.
+ @end menu
+
+
+-@node sleep invocation
++@node sleep
+ @section @command{sleep}: Delay for a specified time
+
+ @pindex sleep
+@@ -15662,12 +15507,12 @@
+ These programs do numerically-related operations.
+
+ @menu
+-* factor invocation:: Show factors of numbers.
+-* seq invocation:: Print sequences of numbers.
++* factor:: Show factors of numbers.
++* seq:: Print sequences of numbers.
+ @end menu
+
+
+-@node factor invocation
++@node factor
+ @section @command{factor}: Print prime factors
+
+ @pindex factor
+@@ -15723,7 +15568,7 @@
+ @exitstatus
+
+
+-@node seq invocation
++@node seq
+ @section @command{seq}: Print numeric sequences
+
+ @pindex seq
--- /dev/null
+--- coreutils-4.5.3/lib/physmem.c.orig Fri Nov 16 10:20:25 2001
++++ coreutils-4.5.3/lib/physmem.c Sun Oct 27 22:35:25 2002
+@@ -31,6 +31,14 @@
+ # include <sys/pstat.h>
+ #endif
+
++/* Cap physical memory to something sane */
++static double
++physmem_cap (double mem)
++{
++ double max = 1 << (sizeof(void *)*8 - 4);
++ return mem > max ? max : mem;
++}
++
+ /* Return the total amount of physical memory. */
+ double
+ physmem_total (void)
+@@ -40,7 +48,7 @@
+ double pages = sysconf (_SC_PHYS_PAGES);
+ double pagesize = sysconf (_SC_PAGESIZE);
+ if (0 <= pages && 0 <= pagesize)
+- return pages * pagesize;
++ return physmem_cap(pages * pagesize);
+ }
+ #endif
+
+@@ -106,7 +106,7 @@
+ double pages = pss.physical_memory;
+ double pagesize = pss.page_size;
+ if (0 <= pages && 0 <= pagesize)
+- return pages * pagesize;
++ return physmem_cap(pages * pagesize);
+ }
+ }
+ #endif
+
--- /dev/null
+--- coreutils-6.7/src/Makefile.am.pam 2006-11-24 21:28:10.000000000 +0000
++++ coreutils-6.7/src/Makefile.am 2007-01-09 17:00:01.000000000 +0000
+@@ -359,7 +359,7 @@
+ uptime_LDADD += $(GETLOADAVG_LIBS)
+
+ # for crypt
+-su_LDADD += $(LIB_CRYPT)
++su_LDADD += $(LIB_CRYPT) $(LIB_PAM)
+
+ # for various ACL functions
+ copy_LDADD += $(LIB_ACL)
+--- coreutils-6.10/src/su.c.orig 2007-11-25 14:23:31.000000000 +0100
++++ coreutils-6.10/src/su.c 2008-03-02 02:07:13.568059486 +0100
+@@ -37,6 +37,16 @@
+ restricts who can su to UID 0 accounts. RMS considers that to
+ be fascist.
+
++#ifdef USE_PAM
++
++ Actually, with PAM, su has nothing to do with whether or not a
++ wheel group is enforced by su. RMS tries to restrict your access
++ to a su which implements the wheel group, but PAM considers that
++ to be fascist, and gives the user/sysadmin the opportunity to
++ enforce a wheel group by proper editing of /etc/pam.conf
++
++#endif
++
+ Compile-time options:
+ -DSYSLOG_SUCCESS Log successful su's (by default, to root) with syslog.
+ -DSYSLOG_FAILURE Log failed su's (by default, to root) with syslog.
+@@ -58,6 +68,15 @@
+ prototype (returning `int') in <unistd.h>. */
+ #define getusershell _getusershell_sys_proto_
+
++#ifdef USE_PAM
++# include <signal.h>
++# include <sys/wait.h>
++# include <sys/fsuid.h>
++# include <unistd.h>
++# include <security/pam_appl.h>
++# include <security/pam_misc.h>
++#endif /* USE_PAM */
++
+ #include "system.h"
+ #include "getpass.h"
+
+@@ -130,10 +130,17 @@
+ /* The user to become if none is specified. */
+ #define DEFAULT_USER "root"
+
++#ifndef USE_PAM
+ char *crypt (char const *key, char const *salt);
++#endif
+
+-static void run_shell (char const *, char const *, char **, size_t)
++static void run_shell (char const *, char const *, char **, size_t,
++ const struct passwd *)
++#ifdef USE_PAM
++ ;
++#else
+ ATTRIBUTE_NORETURN;
++#endif
+
+ /* If true, pass the `-f' option to the subshell. */
+ static bool fast_startup;
+@@ -215,7 +241,26 @@
+ }
+ #endif
+
++#ifdef USE_PAM
++static pam_handle_t *pamh = NULL;
++static int retval;
++static struct pam_conv conv = {
++ misc_conv,
++ NULL
++};
++
++#define PAM_BAIL_P if (retval) { \
++ pam_end(pamh, PAM_SUCCESS); \
++ return 0; \
++}
++#define PAM_BAIL_P_VOID if (retval) { \
++ pam_end(pamh, PAM_SUCCESS); \
++return; \
++}
++#endif
++
+ /* Ask the user for a password.
++ If PAM is in use, let PAM ask for the password if necessary.
+ Return true if the user gives the correct password for entry PW,
+ false if not. Return true without asking for a password if run by UID 0
+ or if PW has an empty password. */
+@@ -223,6 +268,44 @@
+ static bool
+ correct_password (const struct passwd *pw)
+ {
++#ifdef USE_PAM
++ struct passwd *caller;
++ char *tty_name, *ttyn;
++ retval = pam_start(PROGRAM_NAME, pw->pw_name, &conv, &pamh);
++ PAM_BAIL_P;
++
++ if (getuid() != 0 && !isatty(0)) {
++ fprintf(stderr, _("standard in must be a tty\n"));
++ exit(1);
++ }
++
++ caller = getpwuid(getuid());
++ if(caller != NULL && caller->pw_name != NULL) {
++ retval = pam_set_item(pamh, PAM_RUSER, caller->pw_name);
++ PAM_BAIL_P;
++ }
++
++ ttyn = ttyname(0);
++ if (ttyn) {
++ if (strncmp(ttyn, "/dev/", 5) == 0)
++ tty_name = ttyn+5;
++ else
++ tty_name = ttyn;
++ retval = pam_set_item(pamh, PAM_TTY, tty_name);
++ PAM_BAIL_P;
++ }
++ retval = pam_authenticate(pamh, 0);
++ PAM_BAIL_P;
++ retval = pam_acct_mgmt(pamh, 0);
++ if (retval == PAM_NEW_AUTHTOK_REQD && getuid()) {
++ /* password has expired. Offer option to change it. */
++ retval = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
++ PAM_BAIL_P;
++ }
++ PAM_BAIL_P;
++ /* must be authenticated if this point was reached */
++ return 1;
++#else /* !USE_PAM */
+ char *unencrypted, *encrypted, *correct;
+ #if HAVE_GETSPNAM && HAVE_STRUCT_SPWD_SP_PWDP
+ /* Shadow passwd stuff for SVR3 and maybe other systems. */
+@@ -247,6 +330,7 @@
+ encrypted = crypt (unencrypted, correct);
+ memset (unencrypted, 0, strlen (unencrypted));
+ return STREQ (encrypted, correct);
++#endif /* !USE_PAM */
+ }
+
+ /* Update `environ' for the new shell based on PW, with SHELL being
+@@ -260,12 +344,18 @@
+ /* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH.
+ Unset all other environment variables. */
+ char const *term = getenv ("TERM");
++ char const *display = getenv ("DISPLAY");
++ char const *xauthority = getenv ("XAUTHORITY");
+ if (term)
+ term = xstrdup (term);
+ environ = xmalloc ((6 + !!term) * sizeof (char *));
+ environ[0] = NULL;
+ if (term)
+ xsetenv ("TERM", term);
++ if (display)
++ xsetenv ("DISPLAY", display);
++ if (xauthority)
++ xsetenv ("XAUTHORITY", xauthority);
+ xsetenv ("HOME", pw->pw_dir);
+ xsetenv ("SHELL", shell);
+ xsetenv ("USER", pw->pw_name);
+@@ -373,8 +373,13 @@
+ {
+ #ifdef HAVE_INITGROUPS
+ errno = 0;
+- if (initgroups (pw->pw_name, pw->pw_gid) == -1)
++ if (initgroups (pw->pw_name, pw->pw_gid) == -1) {
++#ifdef USE_PAM
++ pam_close_session(pamh, 0);
++ pam_end(pamh, PAM_ABORT);
++#endif
+ error (EXIT_CANCELED, errno, _("cannot set groups"));
++ }
+ endgrent ();
+ #endif
+ if (setgid (pw->pw_gid))
+@@ -308,6 +403,31 @@
+ error (EXIT_FAILURE, errno, _("cannot set user id"));
+ }
+
++#ifdef USE_PAM
++static int caught=0;
++/* Signal handler for parent process later */
++static void su_catch_sig(int sig)
++{
++ ++caught;
++}
++
++int
++pam_copyenv (pam_handle_t *pamh)
++{
++ char **env;
++
++ env = pam_getenvlist(pamh);
++ if(env) {
++ while(*env) {
++ if (putenv (*env))
++ xalloc_die ();
++ env++;
++ }
++ }
++ return(0);
++}
++#endif
++
+ /* Run SHELL, or DEFAULT_SHELL if SHELL is empty.
+ If COMMAND is nonzero, pass it to the shell with the -c option.
+ Pass ADDITIONAL_ARGS to the shell as more arguments; there
+@@ -315,17 +435,49 @@
+
+ static void
+ run_shell (char const *shell, char const *command, char **additional_args,
+- size_t n_additional_args)
++ size_t n_additional_args, const struct passwd *pw)
+ {
+ size_t n_args = 1 + fast_startup + 2 * !!command + n_additional_args + 1;
+ char const **args = xnmalloc (n_args, sizeof *args);
+ size_t argno = 1;
++#ifdef USE_PAM
++ int child;
++ sigset_t ourset;
++ int status;
++
++ retval = pam_open_session(pamh,0);
++ if (retval != PAM_SUCCESS) {
++ fprintf (stderr, _("could not open session\n"));
++ exit (1);
++ }
++
++/* do this at the last possible moment, because environment variables may
++ be passed even in the session phase
++*/
++ if(pam_copyenv(pamh) != PAM_SUCCESS)
++ fprintf (stderr, _("error copying PAM environment\n"));
++
++ /* Credentials should be set in the parent */
++ if (pam_setcred(pamh, PAM_ESTABLISH_CRED) != PAM_SUCCESS) {
++ pam_close_session(pamh, 0);
++ fprintf(stderr, _("could not set PAM credentials\n"));
++ exit(1);
++ }
++
++ child = fork();
++ if (child == 0) { /* child shell */
++ change_identity (pw);
++ pam_end(pamh, 0);
++#endif
+
+ if (simulate_login)
+ {
+ char *arg0;
+ char *shell_basename;
+
++ if(chdir(pw->pw_dir))
++ error(0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
++
+ shell_basename = last_component (shell);
+ arg0 = xmalloc (strlen (shell_basename) + 2);
+ arg0[0] = '-';
+@@ -350,6 +502,66 @@
+ error (0, errno, "%s", shell);
+ exit (exit_status);
+ }
++#ifdef USE_PAM
++ } else if (child == -1) {
++ fprintf(stderr, _("can not fork user shell: %s"), strerror(errno));
++ pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT);
++ pam_close_session(pamh, 0);
++ pam_end(pamh, PAM_ABORT);
++ exit(1);
++ }
++ /* parent only */
++ sigfillset(&ourset);
++ if (sigprocmask(SIG_BLOCK, &ourset, NULL)) {
++ fprintf(stderr, _("%s: signal malfunction\n"), PROGRAM_NAME);
++ caught = 1;
++ }
++ if (!caught) {
++ struct sigaction action;
++ action.sa_handler = su_catch_sig;
++ sigemptyset(&action.sa_mask);
++ action.sa_flags = 0;
++ sigemptyset(&ourset);
++ if (sigaddset(&ourset, SIGTERM)
++ || sigaddset(&ourset, SIGALRM)
++ || sigaction(SIGTERM, &action, NULL)
++ || sigprocmask(SIG_UNBLOCK, &ourset, NULL)) {
++ fprintf(stderr, _("%s: signal masking malfunction\n"), PROGRAM_NAME);
++ caught = 1;
++ }
++ }
++ if (!caught) {
++ do {
++ int pid;
++
++ pid = waitpid(-1, &status, WUNTRACED);
++
++ if (WIFSTOPPED(status)) {
++ kill(getpid(), SIGSTOP);
++ /* once we get here, we must have resumed */
++ kill(pid, SIGCONT);
++ }
++ } while (WIFSTOPPED(status));
++ }
++
++ if (caught) {
++ fprintf(stderr, _("\nSession terminated, killing shell..."));
++ kill (child, SIGTERM);
++ }
++ /* Not checking retval on this because we need to call close session */
++ pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT);
++ retval = pam_close_session(pamh, 0);
++ PAM_BAIL_P_VOID;
++ retval = pam_end(pamh, PAM_SUCCESS);
++ PAM_BAIL_P_VOID;
++ if (caught) {
++ sleep(2);
++ kill(child, SIGKILL);
++ fprintf(stderr, _(" ...killed.\n"));
++ exit(-1);
++ }
++ exit (WEXITSTATUS(status));
++#endif /* USE_PAM */
+ }
+
+ /* Return true if SHELL is a restricted shell (one not returned by
+@@ -714,9 +714,9 @@
+ shell = xstrdup (shell ? shell : pw->pw_shell);
+ modify_environment (pw, shell);
+
++#ifndef USE_PAM
+ change_identity (pw);
+- if (simulate_login && chdir (pw->pw_dir) != 0)
+- error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
++#endif
+
+ /* error() flushes stderr, but does not check for write failure.
+ Normally, we would catch this via our atexit() hook of
+@@ -726,5 +726,5 @@
+ if (ferror (stderr))
+ exit (EXIT_CANCELED);
+
+- run_shell (shell, command, argv + optind, MAX (0, argc - optind));
++ run_shell (shell, command, argv + optind, MAX (0, argc - optind), pw);
+ }
+--- coreutils-6.7/doc/coreutils.texi.pam 2006-10-27 15:30:48.000000000 +0100
++++ coreutils-6.7/doc/coreutils.texi 2007-01-09 17:00:01.000000000 +0000
+@@ -13395,8 +13395,11 @@
+ @findex syslog
+ @command{su} can optionally be compiled to use @code{syslog} to report
+ failed, and optionally successful, @command{su} attempts. (If the system
+-supports @code{syslog}.) However, GNU @command{su} does not check if the
+-user is a member of the @code{wheel} group; see below.
++supports @code{syslog}.)
++
++This version of @command{su} has support for using PAM for
++authentication. You can edit @file{/etc/pam.d/su} to customize its
++behaviour.
+
+ The program accepts the following options. Also see @ref{Common options}.
+
+@@ -11892,32 +11892,6 @@
+ the exit status of the subshell otherwise
+ @end display
+
+-@cindex wheel group, not supported
+-@cindex group wheel, not supported
+-@cindex fascism
+-@subsection Why GNU @command{su} does not support the @samp{wheel} group
+-
+-(This section is by Richard Stallman.)
+-
+-@cindex Twenex
+-@cindex MIT AI lab
+-Sometimes a few of the users try to hold total power over all the
+-rest. For example, in 1984, a few users at the MIT AI lab decided to
+-seize power by changing the operator password on the Twenex system and
+-keeping it secret from everyone else. (I was able to thwart this coup
+-and give power back to the users by patching the kernel, but I
+-wouldn't know how to do that in Unix.)
+-
+-However, occasionally the rulers do tell someone. Under the usual
+-@command{su} mechanism, once someone learns the root password who
+-sympathizes with the ordinary users, he or she can tell the rest. The
+-``wheel group'' feature would make this impossible, and thus cement the
+-power of the rulers.
+-
+-I'm on the side of the masses, not that of the rulers. If you are
+-used to supporting the bosses and sysadmins in whatever they do, you
+-might find this idea strange at first.
+-
+
+ @node Delaying
+ @chapter Delaying
+--- coreutils-6.10/configure.ac.orig 2008-01-13 09:14:23.000000000 +0100
++++ coreutils-6.10/configure.ac 2008-03-02 02:08:10.027276914 +0100
+@@ -44,6 +44,13 @@
+ gl_INIT
+ coreutils_MACROS
+
++dnl Give the chance to enable PAM
++AC_ARG_ENABLE(pam, dnl
++[ --enable-pam Enable use of the PAM libraries],
++AC_DEFINE(USE_PAM, 1, [Define if you want to use PAM])
++LIB_PAM="-ldl -lpam -lpam_misc"
++)
++
+ AC_FUNC_FORK
+
+ optional_bin_progs=
+@@ -332,6 +339,13 @@
+ AM_GNU_GETTEXT([external], [need-formatstring-macros])
+ AM_GNU_GETTEXT_VERSION([0.15])
+
++# just in case we want PAM
++AC_SUBST(LIB_PAM)
++# with PAM su doesn't need libcrypt
++if test -n "$LIB_PAM" ; then
++ LIB_CRYPT=
++fi
++
+ AC_CONFIG_FILES(
+ Makefile
+ doc/Makefile
+--- coreutils-6.10/po/pl.po.orig 2008-01-16 21:22:08.000000000 +0100
++++ coreutils-6.10/po/pl.po 2008-03-02 02:09:23.671473657 +0100
+@@ -8875,6 +8875,49 @@
+ msgid "Usage: %s [OPTION]... [-] [USER [ARG]...]\n"
+ msgstr "Składnia: %s [OPCJA]... [-] [UŻYTKOWNIK [ARGUMENT]...]\n"
+
++#: src/su.c:300
++msgid "standard in must be a tty\n\n"
++msgstr "standardowe wejście musi być terminalem\n"
++
++#: src/su.c:425
++msgid "could not open session\n"
++msgstr "nie można otworzyć sesji\n"
++
++#: src/su.c:433
++msgid "error copying PAM environment\n"
++msgstr "błąd podczas kopiowania środowiska PAM\n"
++
++#: src/su.c:450
++msgid "could not set PAM credentials\n"
++msgstr "błąd podczas ustawiania uwierzytelnienia PAM\n"
++
++#: src/su.c:471
++#, c-format
++msgid "cannot fork user shell: %s"
++msgstr "nie można utworzyć procesu powłoki użytkownika: %s"
++
++#: src/su.c:477
++#, c-format
++msgid "%s: signal malfunction\n"
++msgstr "%s: błędne działanie sygnałów\n"
++
++#: src/su.c:490
++#, c-format
++msgid "%s: signal masking malfunction\n"
++msgstr "%s: błędne działanie maskowania sygnałów\n"
++
++#: src/su.c:509
++msgid ""
++"\n"
++"Session terminated, killing shell..."
++msgstr ""
++"\n"
++"Sesja zakończona, zabijanie powłoki..."
++
++#: src/su.c:519
++msgid " killed.\n"
++msgstr " zabito.\n"
++
+ #: src/su.c:382
+ msgid ""
+ "Change the effective user id and group id to that of USER.\n"
+diff -Nur coreutils-5.2.1.orig/man/es/su.1 coreutils-5.2.1/man/es/su.1
+--- coreutils-5.2.1.orig/man/es/su.1 Mon Apr 12 14:26:19 1999
++++ coreutils-5.2.1/man/es/su.1 Thu Mar 18 17:05:55 2004
+@@ -47,13 +47,6 @@
+ puede ser compilado para reportar fallo, y opcionalmente éxito en syslog.
+ .B su
+ intentará utilizar syslog.
+-.PP
+-Este programa no soporta el grupo "wheel", el cual restringe quien podrá
+-ejecutar
+-.B su
+-hacia la cuenta de root (el superusuario) ya que esta política podría
+-ayudar a los administradores de máquinas a facilitar un uso inadecuado a otros
+-usuarios.
+ .SS OPCIONES
+ .TP
+ .I "\-c COMANDO, \-\-command=COMANDO"
+@@ -118,22 +111,3 @@
+ .I "\-\-version"
+ Escribe información sobre la versión en la salida estándar y acaba sin
+ provocar error.
+-
+-.SH Por que GNU no soporta el grupo "wheel" (por Richard Stallman)
+-A veces, algunos listillos intentan hacerse con el poder total
+-sobre el resto de usuarios. Por ejemplo, en 1984, un grupo de usuarios del
+-laboratorio de Inteligencia Artificial del MIT decidieron tomar el poder
+-cambiando el password de operador del sistema Twenex y manteniendolo secreto
+-para el resto de usuarios. (De todas maneras, hubiera sido posible desbaratar
+-la situación y devolver el control a los usuarios legítimos parcheando el
+-kernel, pero no sabría como realizar esta operación en un sistema Unix.)
+-.PP
+-Sin embargo, casualmente alguien contó el secreto. Mediante el uso habitual de
+-.B su
+-una vez que alguien conoce el password de root puede contarselo al resto de
+-usuarios. El grupo "wheel" hará que esto sea imposible, protegiendo así el poder
+-de los superusuarios.
+-.PP
+-Yo estoy del lado de las masas, no de los superusuarios. Si eres de los que
+-estan de acuerdo con los jefes y los administradores de sistemas en cualquier
+-cosa que hagan, al principio encontrarás esta idea algo extraña.
+diff -Nur coreutils-5.2.1.orig/man/fr/su.1 coreutils-5.2.1/man/fr/su.1
+--- coreutils-5.2.1.orig/man/fr/su.1 Sun Aug 10 12:00:00 2003
++++ coreutils-5.2.1/man/fr/su.1 Thu Mar 18 17:05:55 2004
+@@ -54,13 +54,6 @@
+ peut être compilé afin de fournir des rapports d'échec, et éventuellement
+ de réussite des tentatives d'utilisation de
+ .BR su .
+-.PP
+-Ce programme ne gère pas le "groupe wheel" utilisé pour restreindre
+-l'accès par
+-.B su
+-au compte Super-Utilisateur, car il pourrait aider des administrateurs
+-système fascistes à disposer d'un pouvoir incontrôlé
+-sur les autres utilisateurs.
+ .SS OPTIONS
+ .TP
+ .I "\-c COMMANDE, \-\-command=COMMANDE"
+@@ -119,25 +112,5 @@
+ .I "\-\-version"
+ Afficher un numéro de version sur la sortie standard et se terminer normalement.
+
+-.SH Pourquoi GNU SU ne gère-t-il pas le groupe `wheel' (par Richard Stallman)
+-Il peut arriver qu'un petit groupe d'utilisateurs essayent de s'approprier
+-l'ensemble du système. Par exemple, en 1984, quelques utilisateurs du
+-laboratoire d'I.A du MIT ont tentés de prendre le pouvoir en modifiant
+-le mot de passe de l'opérateur sur le système Twenex, et en
+-gardant ce mot de passe secret. (J'ai pu les en empêcher en modifiant le noyau, et
+-restaurer ainsi les autres accès, mais je ne saurais pas en faire autant
+-sous Unix).
+-.PP
+-Néanmoins, il arrive parfois que les chefs fournissent le mot
+-de passe de root à un utilisateur ordinaire.
+-Avec le mécanisme habituel de \fBsu\fP,
+-une fois que quelqu'un connaît ce mot de passe, il peut le transmettre
+-à ses amis. Le principe du "groupe wheel" rend ce partage impossible,
+-ce qui renforce la puissance des chefs.
+-.PP
+-Je me situe du cote du peuple, pas du côté des chefs. Si vous avez l'habitude
+-de soutenir les patrons et les administrateurs systèmes quoi qu'ils fassent,
+-cette idée peut vous paraître étrange au premier abord.
+-
+ .SH TRADUCTION
+ Christophe Blaess, 1997-2003.
+diff -Nur coreutils-5.2.1.orig/man/hu/su.1 coreutils-5.2.1/man/hu/su.1
+--- coreutils-5.2.1.orig/man/hu/su.1 Sun Jul 9 14:19:12 2000
++++ coreutils-5.2.1/man/hu/su.1 Thu Mar 18 17:05:55 2004
+@@ -151,33 +151,6 @@
+ .B "\-\-version"
+ A program verziójáról ír ki információt a standard kimenetre, majd
+ sikeres visszatérési értékkel kilép.
+-.SH Miért nem támogatja a GNU su a wheel csoportot? (Richard Stallman)
+-
+-Néha a rendszer fölötti teljes ellenõrzést egy néhány emberbõl
+-álló csoport akarja kézbe venni. Például 1984-ben pár user a MIT AI
+-laborban úgy döntött, hogy átveszik az irányítást a Twenex rendszer
+-operátori jelszavának megváltoztatásával, és annak titokban tartásával.
+-(A puccsot sikerült leverni, és a felhasználókat jogaikba visszahelyezni
+-egy kernel patch segítségével, de Unix alatt ezt nem tudtam volna megcsinálni.)
+-(A fordító megj.: a wheel csoportot ezzel a módszerrel könnyen
+-önkényesen is leszûkíthetik a csoporttagok , így tulajdonképpen nincs sok értelme.)
+-.PP
+-Néha az uralmon levõk elárulják a root jelszót. A szokásos su
+-mechanizmus szerint, ha valaki megtudja a root jelszót, és
+-szimpatizál a többi közönséges felhasználóval, elárulhatja nekik
+-is. A wheel csoport ezt lehetetlenné tenné, és így bebetonozná az
+-uralmon levõ hatalmát.
+-.PP
+-Én a tömegek oldalán állok, nem az uralkodókén. Ha te mindig a
+-fõnökök és a rendszergazdák oldalán állsz, bármit is tesznek, akkor
+-valószínûleg furcsálni fogod ezt a hozzáállást.
+-.PP
+-A fordító megjegyzése:
+-Valami jó azért mégis lenne a wheel csoportban: az, hogy ha a root
+-jelszó kitudódna azzal nem tudna bármelyik felhasználó közvetlenül
+-visszaélni. A wheel csoporthoz hasonló dolgot lehet elérni a
+-.B sudo
+-csomaggal.
+ .SH MEGJEGYZÉS
+ A hibákat a bug-sh-utils@gnu.org címen lehet jelenteni.
+ Az oldalt Ragnar Hojland Espinosa <ragnar@macula.net> frissítette.
+diff -Nur coreutils-5.2.1.orig/man/it/su.1 coreutils-5.2.1/man/it/su.1
+--- coreutils-5.2.1.orig/man/it/su.1 Mon Jul 1 23:09:38 2002
++++ coreutils-5.2.1/man/it/su.1 Thu Mar 18 17:05:55 2004
+@@ -52,11 +52,6 @@
+ .B su
+ può essere compilato per riportare tramite syslog gli errori, ed
+ eventualmente anche i successi che ottiene.
+-.PP
+-Questo programma non supporta un "gruppo wheel" che limita chi può fare
+-.B su
+-agli account del superuser, poiché ciò può aiutare amministratori di
+-sistema "fascisti" a tenere un potere inautorizzato sugli altri utenti.
+ .SS OPZIONI
+ .TP
+ .I "\-c COMANDO, \-\-command=COMANDO"
+@@ -117,21 +112,3 @@
+ .I "\-\-version"
+ Stampa in standard output informazioni sulla versione e esce (con
+ successo).
+-.SH Perché GNU su non supporta il gruppo wheel (di Richard Stallman)
+-Qualche volta pochi utenti provano a tenere il potere assoluto sul
+-resto degli utenti. Per esempio, nel 1984, alcuni utenti nel
+-laboratorio di AI del MIT decisero impossessarsi del potere cambiando
+-la password dell'operatore su un sistema Twenex e tenendola segreta a
+-tutti gli altri (fui in grado di contrastare questo colpaccio e
+-restituire il potere agli utenti ``patch-ando'' il kernel, ma non
+-saprei come fare ciò in Unix).
+-.PP
+-Comunque, occasionalmente i sovrani lo fanno. Tramite l'usuale
+-meccanismo su, una volta che qualcuno che simpatizzi con gli
+-utenti normali, abbia imparato la password di root può dirla anche
+-agli altri. La caratteristica del "gruppo wheel" renderebbe ciò
+-impossibile, consolidando quindi il potere dei sovrani.
+-.PP
+-Io sono dalla parte delle masse, non da quella dei sovrani. Se tu sei
+-abituato a sostenere i capi e gli amministratori di sistema in tutto
+-quello che fanno, potresti trovare questa idea strana all'inizio.
+diff -Nur coreutils-5.2.1.orig/man/ja/su.1 coreutils-5.2.1/man/ja/su.1
+--- coreutils-5.2.1.orig/man/ja/su.1 Sun Dec 14 16:06:54 2003
++++ coreutils-5.2.1/man/ja/su.1 Thu Mar 18 17:05:55 2004
+@@ -83,12 +83,6 @@
+ .B su
+ ¤¬¼ºÇÔ¤·¤¿¤È¤ syslog ¤Ë¥ì¥Ý¡¼¥È¤¹¤ë¤è¤¦¤Ë¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤³¤È
+ ¤¬¤Ç¤¤ë¡ÊÀ®¸ù¤ò¥ì¥Ý¡¼¥È¤¹¤ë¤è¤¦¤Ë¤â¤Ç¤¤ë¡Ë¡£
+-.PP
+-¤³¤Î¥×¥í¥°¥é¥à¤Ï "wheel group" ¤Îµ¡Ç½¡Ê
+-.B su
+-¤Ë¤è¤Ã¤Æ¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¥¢¥«¥¦¥ó¥È¤Ë¤Ê¤ì¤ë¥æ¡¼¥¶¤òÀ©¸Â¤¹¤ëµ¡Ç½¡Ë¤ò¥µ¥Ý¡¼
+-¥È¤·¤Ê¤¤¡£¤³¤ì¤ÏÀìÀ©Åª¤Ê¥·¥¹¥Æ¥à´ÉÍý¼Ô¤¬Â¾¤Î¥æ¡¼¥¶¡¼¤ËÉÔÅö¤Ê¸¢ÎϤò¿¶¤ë
+-¤¨¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ç¤¢¤ë¡£
+ .SS OPTIONS
+ .TP
+ .I "\-c COMMAND, \-\-command=COMMAND"
+@@ -151,19 +145,3 @@
+ .TP
+ .I "\-\-version"
+ ¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɸ½à½ÐÎϤËɽ¼¨¤·¡¢¼Â¹ÔÀ®¸ù¤òÊÖ¤·¤Æ½ªÎ»¤¹¤ë¡£
+-.SH GNU su ¤Ç wheel ¥°¥ë¡¼¥×¤ò¥µ¥Ý¡¼¥È¤·¤Ê¤¤¤ï¤±¡ÊRichard Stallman¡Ë
+-¤È¤¤ª¤ê¡¢¾¯¿ô¤Î¥æ¡¼¥¶¡¼¤Ë¤è¤Ã¤Æ¡¢Â¾¤Î¥æ¡¼¥¶¡¼¤ËÂФ¹¤ëÁ´¸¢¤ò¾¸°®¤·¤è¤¦
+-¤È¤¹¤ë»î¤ß¤¬¤Ê¤µ¤ì¤ë¤³¤È¤¬¤¢¤ë¡£Î㤨¤Ð 1984 ǯ¡¢ MIT AI ¥é¥Ü¤Î¾¯¿ô¤Î¥æ¡¼
+-¥¶¡¼¤Ï Twenex ¥·¥¹¥Æ¥à¤Î¥ª¥Ú¥ì¡¼¥¿¡¼¥Ñ¥¹¥ï¡¼¥É¤ÎÊѹ¹¸¢¸Â¤ò¶¯Ã¥¤·¡¢¤³¤ì
+-¤ò¾¤Î¥æ¡¼¥¶¡¼¤«¤éÈëÆ¿¤¹¤ë¤³¤È¤Ë·èÄꤷ¤¿¡Ê¤³¤ÎºÝ¤Ë¤Ï»ä¤Ï¤³¤Î¥¯¡¼¥Ç¥¿¡¼
+-¤Î΢¤ò¤«¤¡¢¥«¡¼¥Í¥ë¤Ë¥Ñ¥Ã¥Á¤òÅö¤Æ¤Æ¸¢¸Â¤ò¼è¤êÊÖ¤¹¤³¤È¤ËÀ®¸ù¤·¤¿¡£¤·¤«
+-¤·¤³¤ì¤¬ Unix ¤Ç¤¢¤Ã¤¿¤é¡¢»ä¤Ë¤Ï¤É¤¦¤¹¤ì¤Ð¤è¤¤¤«¤ï¤«¤é¤Ê¤«¤Ã¤¿¤À¤í¤¦¡Ë¡£
+-.PP
+-¤·¤«¤·¤Ê¤¬¤é¡¢»þ¤Ë¤ÏÀìÀ©¼Ô¤âÈëÌ©¤òϳ¤é¤¹¤â¤Î¤Ç¤¢¤ë¡£Ä̾ï¤Î su ¤Î¥á¥«¥Ë
+-¥º¥à¤Ç¤Ï¡¢°ìÈ̥桼¥¶¡¼¤Î¦¤ËΩ¤Ä¼Ô¤¬ root ¤Î¥Ñ¥¹¥ï¡¼¥É¤òÃΤì¤Ð¡¢¤³¤ì¤ò
+-¾¤Î¥æ¡¼¥¶¡¼¤Ë¤âÃΤ餻¤ë¤³¤È¤¬¤Ç¤¤ë¡£¤·¤«¤· "wheel group" µ¡Ç½¤Ï¤³¤ì
+-¤òÉÔ²Äǽ¤Ë¤·¡¢·ë²Ì¤È¤·¤ÆÀìÀ©¼Ôã¤Î¸¢¸Â¤ò¶¯¸Ç¤¿¤ë¤â¤Î¤Ë¤·¤Æ¤·¤Þ¤¦¡£
+-.PP
+-»ä¤ÏÂç½°¤Î¦¤ËΩ¤Ä¤â¤Î¤Ç¤¢¤ê¡¢ÀìÀ©Åª¤ÊΩ¾ì¤Ë¤ÏÈ¿ÂФ¹¤ë¡£¤¢¤Ê¤¿¤Ï¥Ü¥¹¤ä
+-¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Î¤ä¤ê¸ý¤Ë½¾¤¦¤³¤È¤Ë´·¤ì¤Æ¤¤¤ë¤«¤âÃΤì¤Ê¤¤¤¬¡¢¤½¤Î¾ì¹ç¤Ï
+-¤Þ¤º¤½¤Î¤³¤È¼«¿È¤òÉԻ׵Ĥ˻פ¦¤Ù¤¤Ç¤Ï¤Ê¤¤¤À¤í¤¦¤«¡£
+diff -Nur coreutils-5.2.1.orig/man/pl/su.1 coreutils-5.2.1/man/pl/su.1
+--- coreutils-5.2.1.orig/man/pl/su.1 Tue Jun 20 16:07:31 2000
++++ coreutils-5.2.1/man/pl/su.1 Thu Mar 18 17:05:55 2004
+@@ -78,8 +78,6 @@
+ mo¿e zostaæ tak skompilowane, by raportowa³o nieudane, lub opcjonalnie
+ równie¿ udane próby zmiany id przy u¿yciu
+ .BR su .
+-Jednak \fBsu\fP w wersji GNU nie sprawdza czy u¿ytkownik jest cz³onkiem grupy
+-`wheel' -- patrz poni¿ej.
+ .SH OPCJE
+ .TP
+ .BR \-c " \fIpolecenie\fP, " \-\-command= \fIpolecenie
+@@ -139,25 +137,6 @@
+ .TP
+ .B \-\-version
+ Wy¶wietla numer wersji programu i koñczy pracê.
+-.SH Dlaczego GNU `su' nie obs³uguje grupy `wheel'
+-
+-(Sekcjê tê napisa³ Richard Stallman)
+-
+-Czasami kilku u¿ytkowników usi³uje sprawowaæ nieograniczon± w³adzê nad
+-pozosta³ymi. Na przyk³ad, w 1984, kilku u¿ytkowników w laboratorium AI MIT
+-zdecydowa³o siê `przej±æ w³adzê' zmieniaj±c has³o operatora systemu Twenex
+-i trzymaj±c je w tajemnicy przed wszystkimi innymi. (Uda³o mi siê
+-udaremniæ ten zamach i przywróciæ w³adzê u¿ytkownikom ³ataj±c j±dro, lecz
+-nie wiedzia³bym jak zrobiæ to w Uniksie.)
+-
+-Jednak, od czasu do czasu panuj±cy wyjawiaj± komu¶. Przy zwyk³ym
+-mechanizmie `su', kto¶, kto pozna³ has³o root'a i sympatyzuje ze zwyk³ymi
+-u¿ytkownikami, mo¿e przekazaæ je pozosta³ym. Funkcja "grupy wheel"
+-uniemo¿liwia³aby to, i w ten sposób umacnia³a w³adzê rz±dz±cych.
+-
+-Jestem po stronie mas, nie po stronie rz±dz±cych. Je¿eli zwyk³e¶ popieraæ
+-szefów i administratorów systemów we wszystkim, co robi±, podej¶cie to mo¿e
+-pocz±tkowo wydaæ Ci siê dziwne.
+ .SH "ZG£ASZANIE B£ÊDÓW"
+ B³êdy proszê zg³aszaæ, w jêz.ang., do <bug-sh-utils@gnu.org>.
+ .SH COPYRIGHT
--- /dev/null
+--- coreutils-8.12/po/pl.po.orig 2011-04-26 16:10:25.000000000 +0200
++++ coreutils-8.12/po/pl.po 2011-05-01 08:09:42.640292210 +0200
+@@ -14,10 +14,10 @@
+ # 2 format strings: Jakub Bogusz <qboosh@pld-linux.org>, 2007.
+ msgid ""
+ msgstr ""
+-"Project-Id-Version: coreutils 8.11-pre1\n"
++"Project-Id-Version: coreutils 8.12\n"
+ "Report-Msgid-Bugs-To: bug-coreutils@gnu.org\n"
+ "POT-Creation-Date: 2011-04-26 16:10+0200\n"
+-"PO-Revision-Date: 2011-03-30 16:05+0200\n"
++"PO-Revision-Date: 2011-04-27 20:15+0200\n"
+ "Last-Translator: Rafał Maszkowski <rzm@icm.edu.pl>\n"
+ "Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
+ "Language: pl\n"
+@@ -1923,9 +1923,9 @@
+ msgstr "nie można utworzyć zwykłego pliku %s"
+
+ #: src/copy.c:977
+-#, fuzzy, c-format
++#, c-format
+ msgid "failed to clone %s from %s"
+-msgstr "nie udało się sklonować %s"
++msgstr "nie udało się sklonować %s z %s"
+
+ #: src/copy.c:1088 src/copy.c:2427
+ #, c-format
+@@ -10368,7 +10368,6 @@
+ " nazwy, np. z --follow=name\n"
+
+ #: src/tail.c:302
+-#, fuzzy
+ msgid ""
+ " -s, --sleep-interval=N with -f, sleep for approximately N seconds\n"
+ " (default 1.0) between iterations.\n"
+@@ -10378,6 +10377,8 @@
+ msgstr ""
+ " -s, --sleep-interval=N z -f - odczekanie po N sekund (domyślnie 1,0 s)\n"
+ " między iteracjami\n"
++" Z inotify i --pid=P - sprawdzanie procesu P co\n"
++" najmniej co N sekund.\n"
+ " -v, --verbose wypisywanie zawsze nagłówków z nazwami plików\n"
+
+ #: src/tail.c:311
+@@ -11940,9 +11941,3 @@
+ msgstr ""
+ "Powtarzanie na wyjściu linii ze wszystkimi podanymi NAPIS(AMI) albo `y'\n"
+ "\n"
+-
+-#~ msgid ""
+-#~ "WARNING: --preserve_context is deprecated; use --preserve-context instead"
+-#~ msgstr ""
+-#~ "UWAGA: opcja --preserve_context jest przestarzała, zamiast niej używaj --"
+-#~ "preserve-context"
--- /dev/null
+diff -urNp coreutils-8.7-orig/README coreutils-8.7/README
+--- coreutils-8.7-orig/README 2010-10-11 19:35:11.000000000 +0200
++++ coreutils-8.7/README 2010-11-15 10:10:43.002922253 +0100
+@@ -12,10 +12,10 @@ The programs that can be built with this
+ factor false fmt fold groups head hostid hostname id install join kill
+ link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
+ nproc od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir
+- runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf
+- sleep sort split stat stdbuf stty su sum sync tac tail tee test timeout
+- touch tr true truncate tsort tty uname unexpand uniq unlink uptime users
+- vdir wc who whoami yes
++ runcon runuser seq sha1sum sha224sum sha256sum sha384sum sha512sum shred
++ shuf sleep sort split stat stdbuf stty su sum sync tac tail tee test
++ timeout touch tr true truncate 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 -urNp coreutils-8.7-orig/AUTHORS coreutils-8.7/AUTHORS
+--- coreutils-8.7-orig/AUTHORS 2010-10-11 19:35:11.000000000 +0200
++++ coreutils-8.7/AUTHORS 2010-11-15 10:08:04.222078001 +0100
+@@ -65,6 +65,7 @@ readlink: Dmitry V. Levin
+ rm: Paul Rubin, David MacKenzie, Richard M. Stallman, Jim Meyering
+ rmdir: David MacKenzie
+ runcon: Russell Coker
++runuser: David MacKenzie, Dan Walsh
+ seq: Ulrich Drepper
+ sha1sum: Ulrich Drepper, Scott Miller, David Madore
+ sha224sum: Ulrich Drepper, Scott Miller, David Madore
+diff -urNp coreutils-8.7-orig/man/help2man coreutils-8.7/man/help2man
+--- coreutils-8.7-orig/man/help2man 2010-10-11 19:35:11.000000000 +0200
++++ coreutils-8.7/man/help2man 2010-11-15 10:08:51.331054884 +0100
+@@ -555,6 +555,9 @@ while (length)
+ $include{$sect} .= $content;
+ }
+
++# There is no info documentation for runuser (shared with su).
++$opt_no_info = 1 if $program eq 'runuser';
++
+ # Refer to the real documentation.
+ unless ($opt_no_info)
+ {
+--- coreutils-6.7/src/su.c.runuser 2007-01-09 17:27:56.000000000 +0000
++++ coreutils-6.7/src/su.c 2007-01-09 17:30:12.000000000 +0000
+@@ -109,9 +109,15 @@
+ #include "error.h"
+
+ /* The official name of this program (e.g., no `g' prefix). */
++#ifndef RUNUSER
+ #define PROGRAM_NAME "su"
++#else
++#define PROGRAM_NAME "runuser"
++#endif
+
++#ifndef AUTHORS
+ #define AUTHORS proper_name ("David MacKenzie")
++#endif
+
+ #if HAVE_PATHS_H
+ # include <paths.h>
+@@ -149,6 +149,10 @@
+ char *crypt (char const *key, char const *salt);
+ #endif
+
++#ifndef CHECKPASSWD
++#define CHECKPASSWD 1
++#endif
++
+ static void run_shell (char const *, char const *, char **, size_t,
+ const struct passwd *)
+ #ifdef USE_PAM
+@@ -154,7 +154,11 @@
+ #endif
+
+ static void run_shell (char const *, char const *, char **, size_t,
+- const struct passwd *)
++ const struct passwd *
++#ifdef RUNUSER
++ , gid_t *groups, int num_groups
++#endif
++ )
+ #ifdef USE_PAM
+ ;
+ #else
+@@ -187,6 +201,10 @@
+ {"login", no_argument, NULL, 'l'},
+ {"preserve-environment", no_argument, NULL, 'p'},
+ {"shell", required_argument, NULL, 's'},
++#ifdef RUNUSER
++ {"group", required_argument, NULL, 'g'},
++ {"supp-group", required_argument, NULL, 'G'},
++#endif
+ {GETOPT_HELP_OPTION_DECL},
+ {GETOPT_VERSION_OPTION_DECL},
+ {NULL, 0, NULL, 0}
+@@ -288,10 +306,12 @@
+ retval = pam_start(PROGRAM_NAME, pw->pw_name, &conv, &pamh);
+ PAM_BAIL_P;
+
++#ifndef RUNUSER
+ if (getuid() != 0 && !isatty(0)) {
+ fprintf(stderr, _("standard in must be a tty\n"));
+ exit(1);
+ }
++#endif
+
+ caller = getpwuid(getuid());
+ if(caller != NULL && caller->pw_name != NULL) {
+@@ -308,6 +328,11 @@
+ retval = pam_set_item(pamh, PAM_TTY, tty_name);
+ PAM_BAIL_P;
+ }
++#ifdef RUNUSER
++ if (getuid() != geteuid())
++ /* safety net: deny operation if we are suid by accident */
++ error(EXIT_FAILURE, 1, "runuser may not be setuid");
++#else
+ retval = pam_authenticate(pamh, 0);
+ PAM_BAIL_P;
+ retval = pam_acct_mgmt(pamh, 0);
+@@ -317,6 +342,7 @@
+ PAM_BAIL_P;
+ }
+ PAM_BAIL_P;
++#endif
+ /* must be authenticated if this point was reached */
+ return 1;
+ #else /* !USE_PAM */
+@@ -398,11 +424,22 @@
+ /* Become the user and group(s) specified by PW. */
+
+ static void
+-change_identity (const struct passwd *pw)
++change_identity (const struct passwd *pw
++#ifdef RUNUSER
++ , gid_t *groups, int num_groups
++#endif
++ )
+ {
+ #ifdef HAVE_INITGROUPS
++ int rc = 0;
+ errno = 0;
+- if (initgroups (pw->pw_name, pw->pw_gid) == -1) {
++#ifdef RUNUSER
++ if (num_groups)
++ rc = setgroups(num_groups, groups);
++ else
++#endif
++ rc = initgroups(pw->pw_name, pw->pw_gid);
++ if (rc == -1) {
+ #ifdef USE_PAM
+ pam_close_session(pamh, 0);
+ pam_end(pamh, PAM_ABORT);
+@@ -449,7 +486,11 @@
+
+ static void
+ run_shell (char const *shell, char const *command, char **additional_args,
+- size_t n_additional_args, const struct passwd *pw)
++ size_t n_additional_args, const struct passwd *pw
++#ifdef RUNUSER
++ , gid_t *groups, int num_groups
++#endif
++ )
+ {
+ size_t n_args = 1 + fast_startup + 2 * !!command + n_additional_args + 1;
+ char const **args = xnmalloc (n_args, sizeof *args);
+@@ -480,7 +521,11 @@
+
+ child = fork();
+ if (child == 0) { /* child shell */
+- change_identity (pw);
++ change_identity (pw
++#ifdef RUNUSER
++ , groups, num_groups
++#endif
++ );
+ pam_end(pamh, 0);
+ if (!same_session)
+ setsid ();
+@@ -657,6 +702,12 @@
+ char *shell = NULL;
+ struct passwd *pw;
+ struct passwd pw_copy;
++#ifdef RUNUSER
++ struct group *gr;
++ gid_t groups[NGROUPS_MAX];
++ int num_supp_groups = 0;
++ int use_gid = 0;
++#endif
+
+ initialize_main (&argc, &argv);
+ program_name = argv[0];
+@@ -671,7 +722,11 @@
+ simulate_login = false;
+ change_environment = true;
+
+- while ((optc = getopt_long (argc, argv, "c:flmps:", longopts, NULL)) != -1)
++ while ((optc = getopt_long (argc, argv, "c:flmps:"
++#ifdef RUNUSER
++ "g:G:"
++#endif
++ , longopts, NULL)) != -1)
+ {
+ switch (optc)
+ {
+@@ -701,6 +756,28 @@
+ shell = optarg;
+ break;
+
++#ifdef RUNUSER
++ case 'g':
++ gr = getgrnam(optarg);
++ if (!gr)
++ error (EXIT_FAILURE, 0, _("group %s does not exist"), optarg);
++ use_gid = 1;
++ groups[0] = gr->gr_gid;
++ break;
++
++ case 'G':
++ num_supp_groups++;
++ if (num_supp_groups >= NGROUPS_MAX)
++ error (EXIT_FAILURE, 0,
++ _("Can't specify more than %d supplemental groups"),
++ NGROUPS_MAX - 1);
++ gr = getgrnam(optarg);
++ if (!gr)
++ error (EXIT_FAILURE, 0, _("group %s does not exist"), optarg);
++ groups[num_supp_groups] = gr->gr_gid;
++ break;
++#endif
++
+ case_GETOPT_HELP_CHAR;
+
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
+@@ -739,7 +816,20 @@
+ : DEFAULT_SHELL);
+ endpwent ();
+
+- if (!correct_password (pw))
++#ifdef RUNUSER
++ if (num_supp_groups && !use_gid)
++ {
++ pw->pw_gid = groups[1];
++ memmove (groups, groups + 1, sizeof(gid_t) * num_supp_groups);
++ }
++ else if (use_gid)
++ {
++ pw->pw_gid = groups[0];
++ num_supp_groups++;
++ }
++#endif
++
++ if (CHECKPASSWD && !correct_password (pw))
+ {
+ #ifdef SYSLOG_FAILURE
+ log_su (pw, false);
+@@ -814,7 +814,11 @@
+ modify_environment (pw, shell);
+
+ #ifndef USE_PAM
+- change_identity (pw);
++ change_identity (pw
++#ifdef RUNUSER
++ , groups, num_supp_groups
++#endif
++ );
+ #endif
+
+ /* error() flushes stderr, but does not check for write failure.
+@@ -825,5 +829,9 @@
+ if (ferror (stderr))
+ exit (EXIT_CANCELED);
+
+- run_shell (shell, command, argv + optind, MAX (0, argc - optind), pw);
++ run_shell (shell, command, argv + optind, MAX (0, argc - optind), pw
++#ifdef RUNUSER
++ , groups, num_supp_groups
++#endif
++ );
+ }
+diff -urNp coreutils-8.7-orig/src/Makefile.am coreutils-8.7/src/Makefile.am
+--- coreutils-8.7-orig/src/Makefile.am 2010-11-15 10:07:07.339171659 +0100
++++ coreutils-8.7/src/Makefile.am 2010-11-15 10:12:14.847094550 +0100
+@@ -100,6 +100,7 @@ EXTRA_PROGRAMS = \
+ rm \
+ rmdir \
+ runcon \
++ runuser \
+ seq \
+ sha1sum \
+ sha224sum \
+@@ -300,6 +301,10 @@ cp_LDADD += $(copy_LDADD)
+ ginstall_LDADD += $(copy_LDADD)
+ mv_LDADD += $(copy_LDADD)
+
++runuser_SOURCES = su.c
++runuser_CFLAGS = -DRUNUSER -DAUTHORS="\"David MacKenzie, Dan Walsh\""
++runuser_LDADD = $(LDADD) $(LIB_CRYPT) $(LIB_PAM)
++
+ remove_LDADD =
+ mv_LDADD += $(remove_LDADD)
+ rm_LDADD += $(remove_LDADD)
+@@ -395,7 +400,7 @@ RELEASE_YEAR = \
+ `sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
+ $(top_srcdir)/lib/version-etc.c`
+
+-all-local: su$(EXEEXT)
++all-local: su$(EXEEXT) runuser$(EXEEXT)
+
+ installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
+
+diff -urNp coreutils-8.7-orig/man/Makefile.am coreutils-8.7/man/Makefile.am
+--- coreutils-8.7-orig/man/Makefile.am 2010-10-11 19:35:11.000000000 +0200
++++ coreutils-8.7/man/Makefile.am 2010-11-15 10:09:21.768922182 +0100
+@@ -94,6 +94,7 @@ readlink.1: $(common_dep) $(srcdir)/read
+ rm.1: $(common_dep) $(srcdir)/rm.x ../src/rm.c
+ rmdir.1: $(common_dep) $(srcdir)/rmdir.x ../src/rmdir.c
+ runcon.1: $(common_dep) $(srcdir)/runcon.x ../src/runcon.c
++runuser.1: $(common_dep) $(srcdir)/runuser.x ../src/su.c
+ seq.1: $(common_dep) $(srcdir)/seq.x ../src/seq.c
+ sha1sum.1: $(common_dep) $(srcdir)/sha1sum.x ../src/md5sum.c
+ sha224sum.1: $(common_dep) $(srcdir)/sha224sum.x ../src/md5sum.c
+diff -urNp coreutils-8.7-orig/man/runuser.x coreutils-8.7/man/runuser.x
+--- coreutils-8.7-orig/man/runuser.x 1970-01-01 01:00:00.000000000 +0100
++++ coreutils-8.7/man/runuser.x 2010-11-15 10:09:57.437939015 +0100
+@@ -0,0 +1,12 @@
++[NAME]
++runuser \- run a shell with substitute user and group IDs
++[DESCRIPTION]
++.\" Add any additional description here
++[SEE ALSO]
++.TP
++More detailed Texinfo documentation could be found by command
++.TP
++\t\fBinfo coreutils \(aqsu invocation\(aq\fR\t
++.TP
++since the command \fBrunuser\fR is trimmed down version of command \fBsu\fR.
++.br
+--- /dev/null 2007-01-09 09:38:07.860075128 +0000
++++ coreutils-6.7/man/runuser.1 2007-01-09 17:27:56.000000000 +0000
+@@ -0,0 +1,68 @@
++.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.33.
++.TH RUNUSER "1" "September 2004" "runuser (coreutils) 5.2.1" "User Commands"
++.SH NAME
++runuser \- run a shell with substitute user and group IDs, similar to su, but will not run PAM hooks
++.SH SYNOPSIS
++.B runuser
++[\fIOPTION\fR]... [\fI-\fR] [\fIUSER \fR[\fIARG\fR]...]
++.SH DESCRIPTION
++.\" Add any additional description here
++.PP
++Change the effective user id and group id to that of USER. No PAM hooks
++are run, and there will be no password prompt. This command is useful
++when run as the root user. If run as a non-root user without privilege
++to set user ID, the command will fail.
++.TP
++-, \fB\-l\fR, \fB\-\-login\fR
++make the shell a login shell
++.TP
++\fB\-c\fR, \fB\-\-commmand\fR=\fICOMMAND\fR
++pass a single COMMAND to the shell with \fB\-c\fR
++.TP
++\fB\-f\fR, \fB\-\-fast\fR
++pass \fB\-f\fR to the shell (for csh or tcsh)
++.TP
++\fB\-g\fR, \fB\-\-group\fR=\fIGROUP\fR
++specify the primary group
++.TP
++\fB\-G\fR, \fB\-\-supp-group\fR=\fIGROUP\fR
++specify a supplemental group
++.TP
++\fB\-m\fR, \fB\-\-preserve\-environment\fR
++do not reset environment variables
++.TP
++\fB\-p\fR
++same as \fB\-m\fR
++.TP
++\fB\-s\fR, \fB\-\-shell\fR=\fISHELL\fR
++run SHELL if /etc/shells allows it
++.TP
++\fB\-\-help\fR
++display this help and exit
++.TP
++\fB\-\-version\fR
++output version information and exit
++.PP
++A mere - implies \fB\-l\fR. If USER not given, assume root.
++.SH AUTHOR
++Written by David MacKenzie, Dan Walsh.
++.SH "REPORTING BUGS"
++Report bugs to <bug-coreutils@gnu.org>.
++.SH COPYRIGHT
++Copyright \(co 2004 Free Software Foundation, Inc.
++.br
++This is free software; see the source for copying conditions. There is NO
++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++.SH "SEE ALSO"
++Since this command is trimmed down version of su use you can use the su manual.
++The full documentation for
++.B su
++is maintained as a Texinfo manual. If the
++.B info
++and
++.B su
++programs are properly installed at your site, the command
++.IP
++.B info coreutils su
++.PP
++should give you access to the complete manual.
+--- coreutils-6.10/po/pl.po.orig 2008-03-02 14:22:54.123486386 +0100
++++ coreutils-6.10/po/pl.po 2008-03-02 14:28:35.858960780 +0100
+@@ -8986,6 +8986,16 @@
+ msgid "warning: cannot change directory to %s"
+ msgstr "uwaga: nie można zmienić katalogu na %s"
+
++#: src/su.c:runuser
++#, c-format
++msgid "group %s does not exist"
++msgstr "grupa %s nie istnieje"
++
++#: src/su.c:runuser
++#, c-format
++msgid "Can't specify more than %d supplemental groups"
++msgstr "Nie można określić więcej niż %d grup dodatkowych"
++
+ #. This is a proper name. See the gettext manual, section Names.
+ #: src/sum.c:36
+ msgid "Kayvan Aghaiepour"
+diff -urNp coreutils-8.7-orig/tests/misc/help-version coreutils-8.7/tests/misc/help-version
+--- coreutils-8.7-orig/tests/misc/help-version 2010-10-11 19:35:11.000000000 +0200
++++ coreutils-8.7/tests/misc/help-version 2010-11-15 10:45:18.473682325 +0100
+@@ -32,6 +32,7 @@ expected_failure_status_nohup=125
+ expected_failure_status_stdbuf=125
+ expected_failure_status_su=125
+ expected_failure_status_timeout=125
++expected_failure_status_runuser=125
+ expected_failure_status_printenv=2
+ expected_failure_status_tty=3
+ expected_failure_status_sort=2
+@@ -209,6 +210,7 @@ seq_setup () { args=10; }
+ sleep_setup () { args=0; }
+ su_setup () { args=--version; }
+ stdbuf_setup () { args="-oL true"; }
++runuser_setup () { args=--version; }
+ timeout_setup () { args=--version; }
+
+ # I'd rather not run sync, since it spins up disks that I've
+diff -urNp coreutils-8.7-orig/tests/misc/invalid-opt coreutils-8.7/tests/misc/invalid-opt
+--- coreutils-8.7-orig/tests/misc/invalid-opt 2010-10-11 19:35:11.000000000 +0200
++++ coreutils-8.7/tests/misc/invalid-opt 2010-11-15 10:45:46.451938873 +0100
+@@ -37,6 +37,7 @@ my %exit_status =
+ sort => 2,
+ stdbuf => 125,
+ su => 125,
++ runuser => 125,
+ test => 0,
+ timeout => 125,
+ true => 0,
--- /dev/null
+--- coreutils-6.10/src/Makefile.am.orig 2008-04-11 17:38:22.000000000 +0000
++++ coreutils-6.10/src/Makefile.am 2008-04-11 17:40:55.000000000 +0000
+@@ -135,6 +135,9 @@
+
+ stat_LDADD = $(LDADD) $(LIB_SELINUX)
+
++# stupid sparc64 workaround
++tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
++
+ runuser_SOURCES = su.c
+ runuser_CFLAGS = -DRUNUSER -DAUTHORS="\"David MacKenzie, Dan Walsh\""
+ runuser_LDADD = $(LDADD) $(LIB_CRYPT) $(LIB_PAM)
--- /dev/null
+diff -uNrp -x '*~' coreutils-5.97-orig/src/su.c coreutils-5.97/src/su.c
+--- coreutils-5.97-orig/src/su.c 2006-07-13 12:14:40.000000000 +0100
++++ coreutils-5.97/src/su.c 2006-07-13 12:24:33.000000000 +0100
+@@ -131,11 +131,15 @@
+
+ #include "error.h"
+
+-/* The official name of this program (e.g., no `g' prefix). */
++/* The official name of this program (e.g., no `g' prefix).
++ * - Add a "-l" to the name passed to PAM if this is a login simulation
++ */
+ #ifndef RUNUSER
+ #define PROGRAM_NAME "su"
++#define PROGRAM_NAME_L "su-l"
+ #else
+ #define PROGRAM_NAME "runuser"
++#define PROGRAM_NAME_L "runuser-l"
+ #endif
+
+ #ifndef AUTHORS
+@@ -310,7 +314,8 @@ correct_password (const struct passwd *p
+ #ifdef USE_PAM
+ struct passwd *caller;
+ char *tty_name, *ttyn;
+- retval = pam_start(PROGRAM_NAME, pw->pw_name, &conv, &pamh);
++ retval = pam_start(simulate_login ? PROGRAM_NAME_L : PROGRAM_NAME,
++ pw->pw_name, &conv, &pamh);
+ PAM_BAIL_P;
+
+ #ifndef RUNUSER
--- /dev/null
+--- coreutils-4.5.3/src/su.c.orig Sun Oct 27 21:57:03 2002
++++ coreutils-4.5.3/src/su.c Sun Oct 27 22:15:05 2002
+@@ -154,6 +154,15 @@
+ # define DEFAULT_ROOT_LOGIN_PATH "/usr/ucb:/bin:/usr/bin:/etc"
+ #endif
+
++/* The default paths which get set are both bogus and oddly influenced
++ by <paths.h> and -D on the commands line. Just to be clear, we'll set
++ these explicitly. -ewt */
++#undef DEFAULT_LOGIN_PATH
++#undef DEFAULT_ROOT_LOGIN_PATH
++#define DEFAULT_LOGIN_PATH "/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin"
++#define DEFAULT_ROOT_LOGIN_PATH \
++ "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin:/usr/X11R6/sbin"
++
+ /* The shell to run if none is given in the user's passwd entry. */
+ #define DEFAULT_SHELL "/bin/sh"
+
--- /dev/null
+diff -urN coreutils-5.2.1-orig/src/uname.c coreutils-5.2.1/src/uname.c
+--- coreutils-5.2.1-orig/src/uname.c 2005-01-15 19:15:36.193346304 +0100
++++ coreutils-5.2.1/src/uname.c 2005-01-15 19:19:06.918311240 +0100
+@@ -77,6 +77,8 @@
+ /* Operating system. */
+ #define PRINT_OPERATING_SYSTEM 128
+
++void __sysinfo_processor_type(char*);
++
+ static struct option const uname_long_options[] =
+ {
+ {"all", no_argument, NULL, 'a'},
+@@ -243,13 +245,9 @@
+ if (toprint & PRINT_PROCESSOR)
+ {
+ char const *element = unknown;
+-#if HAVE_SYSINFO && defined SI_ARCHITECTURE
+- {
+- static char processor[257];
+- if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
+- element = processor;
+- }
+-#endif
++ char processor[BUFSIZ];
++ __sysinfo_processor_type(processor);
++ element = processor;
+ #ifdef UNAME_PROCESSOR
+ if (element == unknown)
+ {
+@@ -294,3 +292,38 @@
+
+ exit (EXIT_SUCCESS);
+ }
++
++
++/* Carlos E. Gorges
++return vendor_id from proc cpuinfo
++*/
++
++void
++__sysinfo_processor_type (char* proc_info) {
++ FILE *ffd;
++ char *p,temp_string[BUFSIZ],final_string[BUFSIZ]="unknown";
++
++ if ((ffd=fopen("/proc/cpuinfo", "r") )!=NULL) {
++ while ( fscanf(ffd, "%s : ", temp_string) != EOF)
++ #ifdef __PPC__
++ if (!(strcmp(temp_string, "machine")))
++ #endif /* __PPC__ */
++ #ifdef __sparc__
++ if (!(strcmp(temp_string, "cpu")))
++ #endif /* __sparc__ */
++ #if defined(__i386__) || defined(__x86_64__)
++ if (!(strcmp(temp_string, "name")))
++ #endif /* __x86__ */
++ #ifdef __alpha__
++ if (!(strcmp(temp_string, "model")))
++ #endif /* __alpha__ */
++ {
++ fgets(final_string, 64, ffd);
++ while (p=strchr(final_string, ' ')) *p='_';
++ while (p=strchr(final_string, '\n')) *p=0;
++ break;
++ }
++ fclose(ffd);
++ }
++ strncpy(proc_info,final_string,BUFSIZ);
++}
--- /dev/null
+# Conditional build:
+%bcond_with advcopy # progress bar in cp (orphaned patch)
+%bcond_without tests # do not perform "make test check"
+#
+Summary: GNU Core-utils - basic command line utilities
+Summary(pl.UTF-8): GNU Core-utils - podstawowe narzędzia działające z linii poleceń
+Name: coreutils
+Version: 8.13
+Release: 1
+License: GPL v3+
+Group: Applications/System
+Source0: http://ftp.gnu.org/gnu/coreutils/%{name}-%{version}.tar.xz
+# Source0-md5: 8e1675c6c336ff55557c698706a63d6c
+Source1: %{name}-non-english-man-pages.tar.bz2
+# Source1-md5: f7c986ebc74ccb8d08ed70141063f14c
+Source2: DIR_COLORS
+Source3: fileutils.sh
+Source4: fileutils.csh
+Source5: su.pamd
+Source6: su-l.pamd
+Source7: runuser.pamd
+Source8: runuser-l.pamd
+Source9: mktemp.1.pl
+Patch0: %{name}-info.patch
+Patch1: %{name}-pam.patch
+Patch2: %{name}-getgid.patch
+Patch3: %{name}-su-paths.patch
+Patch4: %{name}-uname-cpuinfo.patch
+Patch5: %{name}-date-man.patch
+Patch6: %{name}-mem.patch
+Patch7: %{name}-7.4-sttytcsadrain.patch
+
+Patch9: %{name}-fmt-wchars.patch
+Patch10: %{name}-runuser.patch
+Patch11: %{name}-split-pam.patch
+Patch12: %{name}-sparc64.patch
+# http://translationproject.org/latest/coreutils/pl.po (pass through msgcat to generate shorter diff)
+Patch13: %{name}-pl.po-update.patch
+# from http://www.beatex.org/web/advancedcopy.html, edited by shadzik
+Patch14: %{name}-advcopy.patch
+URL: http://www.gnu.org/software/coreutils/
+BuildRequires: acl-devel
+BuildRequires: attr-devel
+BuildRequires: autoconf >= 2.64
+BuildRequires: automake >= 1:1.11.1
+BuildRequires: gcc >= 5:3.2
+BuildRequires: gettext-devel >= 0.18.1
+BuildRequires: gmp-devel
+BuildRequires: help2man
+BuildRequires: libcap-devel
+BuildRequires: libselinux-devel
+BuildRequires: pam-devel
+BuildRequires: rpmbuild(find_lang) >= 1.24
+BuildRequires: tar >= 1:1.22
+BuildRequires: texinfo >= 4.2
+BuildRequires: xz
+%if %{with tests}
+BuildRequires: strace
+%endif
+Requires: pam >= 0.77.3
+Requires: setup >= 2.4.6-2
+Provides: coreutils-su
+Provides: fileutils
+Provides: mktemp = %{version}-%{release}
+Provides: sh-utils
+Provides: stat
+Provides: textutils
+Obsoletes: coreutils-su
+Obsoletes: fileutils
+Obsoletes: mktemp
+Obsoletes: sh-utils
+Obsoletes: stat
+Obsoletes: textutils
+Conflicts: shadow < 1:4.0.3-6
+Conflicts: tetex < 1:2.0.2
+Conflicts: util-linux < 2.13-0.pre7
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+These are the GNU core utilities. This package is the union of the GNU
+fileutils, sh-utils, and textutils packages.
+
+Most of these programs have significant advantages over their Unix
+counterparts, such as greater speed, additional options, and fewer
+arbitrary limits.
+
+The programs that can be built with this package are:
+
+ [ 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 install groups head hostid id join link ln logname ls md5sum
+ mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr printenv
+ printf ptx pwd rm rmdir runuser seq sha1sum shred sleep sort split
+ stat stty su sum sync tac tail tee test touch tr true tsort tty uname
+ unexpand uniq unlink users vdir wc who whoami yes
+
+%description -l pl.UTF-8
+Narzędzia podstawowe (core utilities) GNU to połączone paczki GNU
+fileutils, sh-utils i textutils.
+
+Większość z zawartych programów jest znacznie ulepszona w porównaniu
+z ich uniksowymi odpowiednikami, np. szybciej działają, mają dodatkowe
+opcje i mniej ograniczeń.
+
+Programy zawarte w tym pakiecie to:
+
+ [ basename cat chgrp chmod chown chroot cksum comm cp csplit cut date
+ dd df dir dircolors dirname du echo env expand expr factor false fmt
+ fold ginstall groups head hostid id join link ln logname ls md5sum
+ mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr printenv
+ printf ptx pwd rm rmdir runuser seq sha1sum shred sleep sort split
+ stat stty su sum sync tac tail tee test touch tr true tsort tty uname
+ unexpand uniq unlink users vdir wc who whoami yes
+
+%prep
+%setup -q -a1
+#%patch13 -p1
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%ifarch sparc64
+%patch12 -p1
+%endif
+%if %{with advcopy}
+# progress-bar patch, -g,--progress-bar //if in doubt, comment it out
+%patch14 -p1
+%endif
+
+%{__perl} -pi -e 's@GNU/Linux@TLD Linux@' m4/host-os.m4
+
+# allow rebuilding *.gmo
+%{__rm} po/stamp-po
+
+# fails under C locale:
+# LC_ALL=C echo -e "ça\nçb\n"|LC_ALL=C fmt -p 'ç'
+# fmt: memory exhausted
+%{__sed} -i -e 25,27d tests/misc/fmt
+
+# /etc/resolv.conf is blocked in pld builders, try some other file
+%{__sed} -i -e 's,/etc/resolv.conf,/etc/hosts,' gnulib-tests/test-read-file.c
+
+# getgid needs to be fixed:
+# getgid: missing operand
+# Try `getgid --help' for more information.
+%{__rm} tests/misc/help-version
+%{__sed} -i -e '/misc\/help-version/d' tests/Makefile.am
+
+%build
+%{__gettextize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+ CFLAGS="%{rpmcflags} -DSYSLOG_SUCCESS -DSYSLOG_FAILURE -DSYSLOG_NON_ROOT" \
+ DEFAULT_POSIX2_VERSION=199209 \
+ --disable-silent-rules \
+ --enable-install-program=arch \
+ --enable-no-install-program=hostname,kill,uptime \
+ --enable-pam
+
+%{__make}
+
+%if %{with tests}
+sed -i -e 's#COLUMNS##g' tests/envvar-check
+%{__make} -j1 tests check
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{/bin,/sbin,%{_bindir},%{_sbindir},/etc/pam.d,/etc/shrc.d}
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+mv -f $RPM_BUILD_ROOT%{_bindir}/{arch,basename,cat,chgrp,chmod,chown,cp,date,dd,\
+df,echo,false,id,link,ln,ls,mkdir,mknod,mktemp,mv,nice,printf,pwd,rm,rmdir,\
+sleep,sort,stat,stty,sync,touch,true,unlink,uname} $RPM_BUILD_ROOT/bin
+
+mv -f $RPM_BUILD_ROOT%{_bindir}/chroot $RPM_BUILD_ROOT%{_sbindir}
+
+# su is missed by "make install" called by non-root
+install -p src/su $RPM_BUILD_ROOT/bin
+install -p src/runuser $RPM_BUILD_ROOT/sbin
+
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}
+cp -p %{SOURCE3} %{SOURCE4} $RPM_BUILD_ROOT/etc/shrc.d
+cp -p %{SOURCE5} $RPM_BUILD_ROOT/etc/pam.d/su
+cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/pam.d/su-l
+cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/pam.d/runuser
+cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/pam.d/runuser-l
+
+cp -a man/pt_BR man/pt
+for d in cs da de es fi fr hu id it ja ko nl pl pt ru zh_CN; do
+ install -d $RPM_BUILD_ROOT%{_mandir}/$d/man1
+ cp -p man/$d/*.1 $RPM_BUILD_ROOT%{_mandir}/$d/man1
+done
+install %{SOURCE9} $RPM_BUILD_ROOT%{_mandir}/pl/man1/mktemp.1
+# unwanted (-f left intentionally - some manuals could have no translations)
+rm -f $RPM_BUILD_ROOT%{_mandir}/*/man1/{hostname,kill,uptime}.1
+# always remove, never packaged but sometimes installed
+rm -f $RPM_BUILD_ROOT%{_infodir}/dir
+
+%find_lang %{name}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/postshell
+-/usr/sbin/fix-info-dir -c %{_infodir}
+
+%postun -p /sbin/postshell
+-/usr/sbin/fix-info-dir -c %{_infodir}
+
+%files -f %{name}.lang
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog NEWS README THANKS THANKS-to-translators TODO
+%attr(755,root,root) /bin/[!s]*
+%attr(755,root,root) /bin/s[!u]*
+%attr(4755,root,root) /bin/su
+%attr(755,root,root) /sbin/runuser
+%attr(755,root,root) %{_bindir}/*
+%attr(755,root,root) %{_sbindir}/chroot
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/DIR_COLORS
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/su
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/su-l
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/runuser
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/runuser-l
+%config(noreplace) /etc/shrc.d/fileutils.*sh
+%dir %{_libdir}/coreutils
+%attr(755,root,root) %{_libdir}/coreutils/libstdbuf.so
+%{_mandir}/man1/*
+%lang(cs) %{_mandir}/cs/man1/*
+%lang(da) %{_mandir}/da/man1/*
+%lang(de) %{_mandir}/de/man1/*
+%lang(es) %{_mandir}/es/man1/*
+%lang(fi) %{_mandir}/fi/man1/*
+%lang(fr) %{_mandir}/fr/man1/*
+%lang(hu) %{_mandir}/hu/man1/*
+%lang(id) %{_mandir}/id/man1/*
+%lang(it) %{_mandir}/it/man1/*
+%lang(ja) %{_mandir}/ja/man1/*
+%lang(ko) %{_mandir}/ko/man1/*
+%lang(nl) %{_mandir}/nl/man1/*
+%lang(pl) %{_mandir}/pl/man1/*
+%lang(pt) %{_mandir}/pt/man1/*
+%lang(ru) %{_mandir}/ru/man1/*
+%lang(zh_CN) %{_mandir}/zh_CN/man1/*
+%{_infodir}/coreutils.info*
--- /dev/null
+set SYS_RC_FILE=/etc/DIR_COLORS
+set USER_RC_FILE=$HOME/.dir_colors
+set DEF_COLOR_MODE=tty
+
+set COLOR_MODE=`awk '/^COLOR/{c=$2} END{print c}' $SYS_RC_FILE`
+
+test -r $USER_RC_FILE
+if ($status == 0) then
+ set COLOR_MODE=`awk '/^COLOR/{c=$2} END{print c}' $USER_RC_FILE`
+endif
+
+# 'all' argument for 'ls --color=' is no longer valid
+test "$COLOR_MODE" = all
+if ($status == 0) then
+ set COLOR_MODE=always
+endif
+
+test -z "$COLOR_MODE"
+if ($status == 0) then
+ set COLOR_MODE=$DEF_COLOR_MODE
+endif
+
+alias ls "ls --color=$COLOR_MODE"
+
+test -r $USER_RC_FILE
+if ($status == 0) then
+ eval `/usr/bin/dircolors -c $USER_RC_FILE`
+else
+ eval `/usr/bin/dircolors -c $SYS_RC_FILE`
+endif
+
+unset SYS_RC_FILE USER_RC_FILE DEF_COLOR_MODE
--- /dev/null
+SYS_RC_FILE=/etc/DIR_COLORS
+USER_RC_FILE=$HOME/.dir_colors
+DEF_COLOR_MODE=tty
+
+COLOR_MODE=`awk '/^COLOR/{c=$2} END{print c}' $SYS_RC_FILE`
+
+[ -r $USER_RC_FILE ] && COLOR_MODE=`awk '/^COLOR/{c=$2} END{print c}' $USER_RC_FILE`
+
+# 'all' argument for 'ls --color=' is no longer valid
+[ "$COLOR_MODE" = all ] && COLOR_MODE=always
+
+[ -z "$COLOR_MODE" ] && COLOR_MODE=$DEF_COLOR_MODE
+
+alias ls="ls --color=$COLOR_MODE"
+
+if [ -r $USER_RC_FILE ]; then
+ eval `/usr/bin/dircolors -b $USER_RC_FILE`
+else
+ eval `/usr/bin/dircolors -b $SYS_RC_FILE`
+fi
+
+unset SYS_RC_FILE USER_RC_FILE DEF_COLOR_MODE COLOR_MODE
--- /dev/null
+.\" {PTM/WK/1999-11-22}
+.\" $OpenBSD: mktemp.1,v 1.5 1997/06/17 15:34:27 millert Exp $
+.\"
+.\" Copyright (c) 1989, 1991, 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.
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed by the University of
+.\" California, Berkeley and its contributors.
+.\" 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.
+.\"
+.Dd November, 20, 1996
+.Dt MKTEMP 1
+.Os
+.Sh NAZWA
+.Nm mktemp
+.Nd twórz unikaln± nazwê pliku tymczasowego
+.Sh SK£ADNIA
+.Nm mktemp
+.Op Fl d
+.Op Fl q
+.Op Fl u
+.Ar wzorzec
+.Sh OPIS
+Narzêdzie
+.Nm mktemp
+pobiera zadany wzorzec nazwy i zastêpuje jego czê¶æ by stworzyæ
+nazwê pliku. Wynikowa nazwa jest unikalna i nadaje siê do u¿ywania jako
+nazwa pliku.
+Wzorzec mo¿e byæ
+.\" ---- Nie jest prawd± dla Linuksa, ale w libc z OpenBSD
+.\" dowolna nazwa pliku z pewn± liczb±
+dowoln± nazw± pliku z dodanymi do niej dok³adnie sze¶cioma znakami
+.\" ----
+.Ql X ,
+na przyk³ad
+.\" .Pa /tmp/temp.XXXX .
+.Pa /tmp/temp.XXXXXX .
+Koñcowe
+.Ql X
+zastêpowane s± przez numer bie¿±cego procesu i/lub unikaln± kombinacjê liter.
+
+Liczba unikalnych nazw plików, jakie mo¿e zwróciæ
+.Nm
+.\" ---- Nie jest prawd± dla Linuksa, ale dla libc z OpenBSD
+.\" mo¿e zwróciæ zale¿y od liczby dodanych
+.\" .Ql X ów;
+.\" sze¶æ
+.\" .Ql X ów
+.\" da przetestowanie oko³o 26 ** 6 kombinacji.
+daje oko³o 26 ** 6 kombinacji.
+.\" ----
+.Pp
+Je¶li
+.Nm
+mo¿e pomy¶lnie utworzyæ unikaln± nazwê pliku, to tworzony jest plik
+z prawami 0600 (chyba ¿e podano flagê
+.Fl u )
+za¶ nazwa pliku wy¶wietlana jest na standardowym wyj¶ciu.
+.Sh OPCJE
+.Bl -tag -width indent
+Dostêpne s± nastêpuj±ce opcje:
+.It Fl d
+Utwórz katalog zamiast pliku.
+.It Fl q
+Ciche zakoñczenie dzia³ania w przypadku b³êdu. Przydatne, gdy skrypt nie
+chce by komunikat o b³êdzie trafi³ na standardowe wyj¶cie b³êdów.
+.It Fl u
+Dzia³aj w trybie
+.Dq unsafe
+(ryzykownym).
+Plik tymczasowy bêdzie skasowany (unlinked) przed zakoñczeniem pracy
+.Nm mktemp .
+Jest to nieco lepsze ni¿
+.Fn mktemp 3 ,
+ale nadal wprowadza `race condition' [t³um: ``wy¶cig'' procesów
+pomiêdzy uzyskiwaniem unikalnych nazw i nadawaniem ich plikom].
+Nie zaleca siê u¿ywania tej opcji.
+.Sh ZWRACANE WARTO¦CI
+Narzêdzie
+.Nm
+koñczy pracê z warto¶ci± 0 w przypadku powodzenia, za¶ 1 przy b³êdzie.
+.Sh PRZYK£ADY
+Poni¿szy fragment w
+.Xr sh 1
+ilustruje proste zastosowanie
+.Nm mktemp ,
+gdzie skrypt winien zakoñczyæ pracê je¶li nie mo¿e utworzyæ bezpiecznego
+pliku tymczasowego.
+.Bd -literal -offset indent
+TMPFILE=`mktemp /tmp/$0.XXXXXX` || exit 1
+echo "program output" >> $TMPFILE
+.Ed
+.Pp
+W tym przypadku chcemy, by skrypt sam obs³ugiwa³ b³±d.
+.Bd -literal -offset indent
+TMPFILE=`mktemp -q /tmp/$0.XXXXXX`
+if [ $? -ne 0 ]; then
+ echo "$0: Can't create temp file, exiting..."
+ exit 1
+fi
+.Ed
+.Pp
+Zauwa¿, ¿e mo¿na te¿ zamiast sprawdzania $? sprawdzaæ,
+czy $TMPFILE ma d³ugo¶æ zerow±. Pozwala to na wykonanie
+sprawdzenia w dalszej czê¶ci skryptu (gdy¿ $? zostanie
+nadpisane przez nastêpne polecenie pow³oki).
+.Sh ZOBACZ TAK¯E
+.Xr mkstemp 3 ,
+.Xr mktemp 3 .
+.Sh HISTORIA
+Narzêdzie
+.Nm
+pojawi³o siê w
+.Bx Open .
--- /dev/null
+#%PAM-1.0
+auth include runuser
+session optional pam_keyinit.so force revoke
+session include runuser
--- /dev/null
+#%PAM-1.0
+auth sufficient pam_rootok.so
+session include system-auth
--- /dev/null
+#%PAM-1.0
+auth include su
+account include su
+password include su
+session optional pam_keyinit.so force revoke
+session include su
--- /dev/null
+#%PAM-1.0
+auth sufficient pam_rootok.so
+auth required pam_wheel.so group=wheel use_uid
+auth include system-auth
+account sufficient pam_succeed_if.so uid = 0 use_uid quiet
+account include system-auth
+password include system-auth
+session optional pam_xauth.so
+session include system-auth