make possible to disable capability in ls due to performance impact when

not cached(#467508), do not patch generated manpages - generate them at
    build time, do not mistakenly display -g and -G runuser option in su
    --help output
This commit is contained in:
Ondrej Vasik 2008-10-22 11:07:44 +00:00
parent 3a1addac9b
commit 893c38877c
9 changed files with 235 additions and 500 deletions

View File

@ -1,16 +1,3 @@
diff -urNp coreutils-6.12-orig/man/chcon.1 coreutils-6.12/man/chcon.1
--- coreutils-6.12-orig/man/chcon.1 2008-10-08 14:45:59.000000000 +0200
+++ coreutils-6.12/man/chcon.1 2008-10-08 16:35:55.000000000 +0200
@@ -17,9 +17,6 @@ chcon \- change file SELinux security co
Change the SELinux security context of each FILE to CONTEXT.
With \fB\-\-reference\fR, change the security context of each FILE to that of RFILE.
.TP
-\fB\-c\fR, \fB\-\-changes\fR
-like verbose but report only when a change is made
-.TP
\fB\-h\fR, \fB\-\-no\-dereference\fR
affect symbolic links instead of any referenced file
.TP
diff -urNp coreutils-6.12-orig/src/chcon.c coreutils-6.12/src/chcon.c
--- coreutils-6.12-orig/src/chcon.c 2008-10-08 14:45:59.000000000 +0200
+++ coreutils-6.12/src/chcon.c 2008-10-08 16:28:36.000000000 +0200

View File

@ -1,16 +1,29 @@
--- coreutils-6.10/tests/misc/help-version.runuser
+++ coreutils-6.10/tests/misc/help-version
@@ -168,6 +168,7 @@
seq_args=10
sleep_args=0
su_args=--version
+runuser_args=--version
# I'd rather not run sync, since it spins up disks that I've
# deliberately caused to spin down (but not unmounted).
--- coreutils-6.10/README.runuser
+++ coreutils-6.10/README
@@ -11,8 +11,8 @@
diff -urNp coreutils-6.12-orig/AUTHORS coreutils-6.12/AUTHORS
--- coreutils-6.12-orig/AUTHORS 2008-10-21 14:58:31.000000000 +0200
+++ coreutils-6.12/AUTHORS 2008-10-21 15:00:05.000000000 +0200
@@ -63,6 +63,7 @@ pwd: Jim Meyering
readlink: Dmitry V. Levin
rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering
rmdir: David MacKenzie
+runuser: David MacKenzie, Dan Walsh
runcon: Russell Coker
seq: Ulrich Drepper
sha1sum: Ulrich Drepper, Scott Miller, David Madore
diff -urNp coreutils-6.12-orig/man/Makefile.am coreutils-6.12/man/Makefile.am
--- coreutils-6.12-orig/man/Makefile.am 2008-05-06 11:28:24.000000000 +0200
+++ coreutils-6.12/man/Makefile.am 2008-10-21 15:00:13.000000000 +0200
@@ -93,6 +93,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-6.12-orig/README coreutils-6.12/README
--- coreutils-6.12-orig/README 2008-05-15 20:44:37.000000000 +0200
+++ coreutils-6.12/README 2008-10-21 14:59:29.000000000 +0200
@@ -12,8 +12,8 @@ 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
od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir
@ -19,11 +32,44 @@
+ runcon runuser seq sha1sum sha224sum sha256sum sha384sum sha512sum shred
+ shuf sleep sort split stat stty su sum sync tac tail tee test touch tr true
tsort tty uname unexpand uniq unlink uptime users vdir wc who whoami yes
See the file NEWS for a list of major changes in the current release.
--- 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
@@ -110,9 +110,15 @@
diff -urNp coreutils-6.12-orig/src/Makefile.am coreutils-6.12/src/Makefile.am
--- coreutils-6.12-orig/src/Makefile.am 2008-10-21 14:58:31.000000000 +0200
+++ coreutils-6.12/src/Makefile.am 2008-10-21 14:59:58.000000000 +0200
@@ -38,7 +38,7 @@ EXTRA_PROGRAMS = \
shuf sort split sum tac tail tr tsort unexpand uniq wc \
basename date dirname echo env expr factor false \
id kill logname pathchk printenv printf pwd \
- runcon seq sleep tee \
+ runcon runuser seq sleep tee \
test true tty whoami yes \
base64
@@ -142,6 +142,10 @@ cp_LDADD += $(LIB_ACL)
mv_LDADD += $(LIB_ACL)
ginstall_LDADD += $(LIB_ACL)
+runuser_SOURCES = su.c
+runuser_CFLAGS = -DRUNUSER -DAUTHORS="\"David MacKenzie, Dan Walsh\""
+runuser_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
+
stat_LDADD = $(LDADD) $(LIB_SELINUX)
# Append $(LIBICONV) to each program that uses proper_name_utf8.
@@ -159,7 +163,7 @@ RELEASE_YEAR = \
`sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
$(top_srcdir)/lib/version-etc.c`
-all-local: su$(EXEEXT)
+all-local: su$(EXEEXT) runuser
installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
diff -urNp coreutils-6.12-orig/src/su.c coreutils-6.12/src/su.c
--- coreutils-6.12-orig/src/su.c 2008-10-21 14:58:31.000000000 +0200
+++ coreutils-6.12/src/su.c 2008-10-21 15:07:05.000000000 +0200
@@ -109,9 +109,15 @@
#include "error.h"
/* The official name of this program (e.g., no `g' prefix). */
@ -39,7 +85,7 @@
#if HAVE_PATHS_H
# include <paths.h>
@@ -150,6 +156,10 @@
@@ -149,6 +155,10 @@
#ifndef USE_PAM
char *crypt ();
#endif
@ -50,7 +96,7 @@
char *getusershell ();
void endusershell ();
void setusershell ();
@@ -157,7 +167,11 @@
@@ -156,7 +166,11 @@ void setusershell ();
extern char **environ;
static void run_shell (char const *, char const *, char **, size_t,
@ -63,7 +109,7 @@
#ifdef USE_PAM
;
#else
@@ -187,6 +201,10 @@
@@ -186,6 +200,10 @@ static struct option const longopts[] =
{"login", no_argument, NULL, 'l'},
{"preserve-environment", no_argument, NULL, 'p'},
{"shell", required_argument, NULL, 's'},
@ -74,7 +120,7 @@
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
@@ -288,10 +306,12 @@
@@ -287,10 +305,12 @@ correct_password (const struct passwd *p
retval = pam_start(PROGRAM_NAME, pw->pw_name, &conv, &pamh);
PAM_BAIL_P;
@ -87,7 +133,7 @@
caller = getpwuid(getuid());
if(caller != NULL && caller->pw_name != NULL) {
@@ -308,6 +328,11 @@
@@ -307,6 +327,11 @@ correct_password (const struct passwd *p
retval = pam_set_item(pamh, PAM_TTY, tty_name);
PAM_BAIL_P;
}
@ -99,7 +145,7 @@
retval = pam_authenticate(pamh, 0);
PAM_BAIL_P;
retval = pam_acct_mgmt(pamh, 0);
@@ -317,6 +342,7 @@
@@ -316,6 +341,7 @@ correct_password (const struct passwd *p
PAM_BAIL_P;
}
PAM_BAIL_P;
@ -107,7 +153,7 @@
/* must be authenticated if this point was reached */
return 1;
#else /* !USE_PAM */
@@ -398,11 +424,22 @@
@@ -397,11 +423,22 @@ modify_environment (const struct passwd
/* Become the user and group(s) specified by PW. */
static void
@ -132,7 +178,7 @@
#ifdef USE_PAM
pam_close_session(pamh, 0);
pam_end(pamh, PAM_ABORT);
@@ -449,7 +486,11 @@
@@ -448,7 +485,11 @@ pam_copyenv (pam_handle_t *pamh)
static void
run_shell (char const *shell, char const *command, char **additional_args,
@ -145,7 +191,7 @@
{
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 @@
@@ -479,7 +520,11 @@ run_shell (char const *shell, char const
child = fork();
if (child == 0) { /* child shell */
@ -158,7 +204,42 @@
pam_end(pamh, 0);
if (!same_session)
setsid ();
@@ -657,6 +702,12 @@
@@ -623,6 +668,26 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... [-] [USER [ARG]...]\n"), program_name);
+#ifdef RUNUSER
+ fputs (_("\
+Change the effective user id and group id to that of USER. No PAM hooks\n\
+are run, and there will be no password prompt. This command is useful\n\
+when run as the root user. If run as a non-root user without privilege\n\
+to set user ID, the command will fail.\n\
+\n\
+ -, -l, --login make the shell a login shell, uses runuser-l\n\
+ PAM file instead of default one\n\
+ -g --group=group specify the primary group\n\
+ -G --supp-group=group specify a supplemental group\n\
+ -c, --command=COMMAND pass a single COMMAND to the shell with -c\n\
+ --session-command=COMMAND pass a single COMMAND to the shell with -c\n\
+ and do not create a new session\n\
+ -f, --fast pass -f to the shell (for csh or tcsh)\n\
+ -m, --preserve-environment do not reset environment variables\n\
+ -p same as -m\n\
+ -s, --shell=SHELL run SHELL if /etc/shells allows it\n\
+"), stdout);
+#else
fputs (_("\
Change the effective user id and group id to that of USER.\n\
\n\
@@ -635,6 +700,7 @@ Change the effective user id and group i
-p same as -m\n\
-s, --shell=SHELL run SHELL if /etc/shells allows it\n\
"), stdout);
+#endif
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
fputs (_("\
@@ -656,6 +722,12 @@ main (int argc, char **argv)
char *shell = NULL;
struct passwd *pw;
struct passwd pw_copy;
@ -171,7 +252,7 @@
initialize_main (&argc, &argv);
program_name = argv[0];
@@ -671,7 +722,11 @@
@@ -670,7 +742,11 @@ main (int argc, char **argv)
simulate_login = false;
change_environment = true;
@ -184,7 +265,7 @@
{
switch (optc)
{
@@ -701,6 +756,28 @@
@@ -700,6 +776,28 @@ main (int argc, char **argv)
shell = optarg;
break;
@ -213,7 +294,7 @@
case_GETOPT_HELP_CHAR;
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
@@ -739,7 +816,20 @@
@@ -738,7 +836,20 @@ main (int argc, char **argv)
: DEFAULT_SHELL);
endpwent ();
@ -235,7 +316,7 @@
{
#ifdef SYSLOG_FAILURE
log_su (pw, false);
@@ -771,8 +861,16 @@
@@ -770,8 +881,16 @@ main (int argc, char **argv)
modify_environment (pw, shell);
#ifndef USE_PAM
@ -254,132 +335,29 @@
+#endif
+ );
}
--- coreutils-6.10/src/Makefile.am.runuser
+++ coreutils-6.10/src/Makefile.am
@@ -38,7 +38,7 @@
shuf sort split sum tac tail tr tsort unexpand uniq wc \
basename date dirname echo env expr factor false \
id kill logname pathchk printenv printf pwd \
- runcon seq sleep tee \
+ runcon runuser seq sleep tee \
test true tty whoami yes \
base64
@@ -112,6 +112,10 @@
mv_LDADD += $(LIB_ACL)
ginstall_LDADD += $(LIB_ACL)
diff -urNp coreutils-6.12-orig/tests/misc/help-version coreutils-6.12/tests/misc/help-version
--- coreutils-6.12-orig/tests/misc/help-version 2008-05-27 13:39:18.000000000 +0200
+++ coreutils-6.12/tests/misc/help-version 2008-10-21 14:59:16.000000000 +0200
@@ -146,6 +146,7 @@ printf_args=foo
seq_args=10
sleep_args=0
su_args=--version
+runuser_args=--version
+runuser_SOURCES = su.c
+runuser_CFLAGS = -DRUNUSER -DAUTHORS="\"David MacKenzie, Dan Walsh\""
+runuser_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
+
stat_LDADD = $(LDADD) $(LIB_SELINUX)
# Append $(LIBICONV) to each program that uses proper_name_utf8.
@@ -126,7 +130,7 @@
`sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
$(top_srcdir)/lib/version-etc.c`
-all-local: su$(EXEEXT)
+all-local: su$(EXEEXT) runuser
installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
--- coreutils-6.10/AUTHORS.runuser
+++ coreutils-6.10/AUTHORS
@@ -60,6 +60,7 @@
readlink: Dmitry V. Levin
rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering
rmdir: David MacKenzie
+runuser: David MacKenzie, Dan Walsh
runcon: Russell Coker
seq: Ulrich Drepper
sha1sum: Ulrich Drepper, Scott Miller, David Madore
--- coreutils-6.10/man/Makefile.am.runuser
+++ coreutils-6.10/man/Makefile.am
@@ -92,6 +92,7 @@
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
# I'd rather not run sync, since it spins up disks that I've
# deliberately caused to spin down (but not unmounted).
--- /dev/null 2007-01-09 09:38:07.860075128 +0000
+++ coreutils-6.7/man/runuser.x 2007-01-09 17:27:56.000000000 +0000
@@ -0,0 +1,4 @@
@@ -0,0 +1,12 @@
+[NAME]
+runuser \- run a shell with substitute user and group IDs
+[DESCRIPTION]
+.\" Add any additional description here
--- /dev/null 2007-01-09 09:38:07.860075128 +0000
+++ coreutils-6.10/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.
+[SEE ALSO]
+.TP
+-, \fB\-l\fR, \fB\-\-login\fR
+make the shell a login shell, uses runuser-l PAM file instead of default one.
+More detailed Texinfo documentation could be found by command
+.TP
+\fB\-c\fR, \fB\-\-command\fR=\fICOMMAND\fR
+pass a single COMMAND to the shell with \fB\-c\fR
+\t\fBinfo su invocation\fR\t
+.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.
+since the command \fBrunuser\fR is trimmed down version of command \fBrunuser\fR.
+.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.

View File

@ -1,35 +1,35 @@
diff -urp coreutils-6.10-orig/man/md5sum.1 coreutils-6.10/man/md5sum.1
--- coreutils-6.10-orig/man/md5sum.1 2008-01-28 14:33:16.000000000 +0100
+++ coreutils-6.10/man/md5sum.1 2008-01-28 14:54:29.000000000 +0100
@@ -19,6 +19,8 @@ read MD5 sums from the FILEs and check t
.TP
\fB\-t\fR, \fB\-\-text\fR
read in text mode (default)
+.br
+\fBNote:\fR There is no difference between binary and text mode option on GNU system.
.SS "The following two options are useful only when verifying checksums:"
.TP
\fB\-\-status\fR
diff -urp coreutils-6.10-orig/man/sort.1 coreutils-6.10/man/sort.1
--- coreutils-6.10-orig/man/sort.1 2008-01-28 14:33:17.000000000 +0100
+++ coreutils-6.10/man/sort.1 2008-01-28 16:02:28.000000000 +0100
@@ -56,7 +56,7 @@ compress temporaries with PROG;
decompress them with PROG \fB\-d\fR
.TP
\fB\-k\fR, \fB\-\-key\fR=\fIPOS1[\fR,POS2]
-start a key at POS1, end it at POS2 (origin 1)
+start a key at POS1, end it at POS2 (origin 1) - when no POS2 is specified, end of line is used
.TP
\fB\-m\fR, \fB\-\-merge\fR
merge already sorted files; do not sort
@@ -103,8 +103,8 @@ With no FILE, or when FILE is \-, read s
.PP
*** WARNING ***
The locale specified by the environment affects sort order.
-Set LC_ALL=C to get the traditional sort order that uses
-native byte values.
+Set LC_ALL=C (by "export LC_ALL=C") to get the traditional
+sort order that uses native byte values.
.SH AUTHOR
Written by Mike Haertel and Paul Eggert.
.SH "REPORTING BUGS"
diff -urNp coreutils-6.12-orig/src/md5sum.c coreutils-6.12/src/md5sum.c
--- coreutils-6.12-orig/src/md5sum.c 2008-05-26 08:40:33.000000000 +0200
+++ coreutils-6.12/src/md5sum.c 2008-10-21 16:07:28.000000000 +0200
@@ -175,6 +175,9 @@ With no FILE, or when FILE is -, read st
fputs (_("\
-t, --text read in text mode (default)\n\
"), stdout);
+ fputs (_("\
+ Note: There is no difference between binary and text mode option on GNU system.\n\
+"), stdout);
fputs (_("\
\n\
The following two options are useful only when verifying checksums:\n\
diff -urNp coreutils-6.12-orig/src/sort.c coreutils-6.12/src/sort.c
--- coreutils-6.12-orig/src/sort.c 2008-10-21 16:04:50.000000000 +0200
+++ coreutils-6.12/src/sort.c 2008-10-22 10:52:30.000000000 +0200
@@ -375,7 +375,8 @@ Other options:\n\
-C, --check=quiet, --check=silent like -c, but do not report first bad line\n\
--compress-program=PROG compress temporaries with PROG;\n\
decompress them with PROG -d\n\
- -k, --key=POS1[,POS2] start a key at POS1, end it at POS2 (origin 1)\n\
+ -k, --key=POS1[,POS2] start a key at POS1, end it at POS2 (origin 1) -\n\
+ when no POS2 specified, end of line is used\n\
-m, --merge merge already sorted files; do not sort\n\
"), stdout);
fputs (_("\
@@ -412,7 +413,7 @@ With no FILE, or when FILE is -, read st
\n\
*** WARNING ***\n\
The locale specified by the environment affects sort order.\n\
-Set LC_ALL=C to get the traditional sort order that uses\n\
+Set LC_ALL=C (by \"export LC_LL=C\") to get the traditional sort order that uses\n\
native byte values.\n\
"), stdout );
emit_bug_reporting_address ();

View File

@ -64,7 +64,16 @@ index ead9574..1b620df 100644
{"", 0}
};
@@ -762,6 +767,27 @@ iread (int fd, char *buf, size_t size)
@@ -496,6 +496,8 @@ Each FLAG symbol may be:\n\
fputs (_(" dsync use synchronized I/O for data\n"), stdout);
if (O_SYNC)
fputs (_(" sync likewise, but also for metadata\n"), stdout);
+ fputs (_(" fullblock accumulate full blocks of input (iflag only)\n"),
+ stdout);
if (O_NONBLOCK)
fputs (_(" nonblock use non-blocking I/O\n"), stdout);
if (O_NOATIME)
@@ -762,6 +769,27 @@ iread (int fd, char *buf, size_t size)
}
}
@ -92,7 +101,7 @@ index ead9574..1b620df 100644
/* Write to FD the buffer BUF of size SIZE, processing any signals
that arrive. Return the number of bytes written, setting errno if
this is less than SIZE. Keep trying if there are partial
@@ -1000,6 +1026,15 @@ scanargs (int argc, char *const *argv)
@@ -1000,6 +1028,15 @@ scanargs (int argc, char *const *argv)
if (input_flags & (O_DSYNC | O_SYNC))
input_flags |= O_RSYNC;
@ -108,7 +117,7 @@ index ead9574..1b620df 100644
if (multiple_bits_set (conversions_mask & (C_ASCII | C_EBCDIC | C_IBM)))
error (EXIT_FAILURE, 0, _("cannot combine any two of {ascii,ebcdic,ibm}"));
if (multiple_bits_set (conversions_mask & (C_BLOCK | C_UNBLOCK)))
@@ -1197,7 +1232,7 @@ skip (int fdesc, char const *file, uintmax_t records, size_t blocksize,
@@ -1197,7 +1234,7 @@ skip (int fdesc, char const *file, uintmax_t records, size_t blocksize,
do
{
@ -117,7 +126,7 @@ index ead9574..1b620df 100644
if (nread < 0)
{
if (fdesc == STDIN_FILENO)
@@ -1508,7 +1543,7 @@ dd_copy (void)
@@ -1508,7 +1545,7 @@ dd_copy (void)
(conversions_mask & (C_BLOCK | C_UNBLOCK)) ? ' ' : '\0',
input_blocksize);
@ -162,20 +171,3 @@ diff -ruN coreutils-6.12.old/doc/coreutils.info coreutils-6.12/doc/coreutils.inf
These flags are not supported on all systems, and `dd' rejects
attempts to use them when they are not supported. When reading
diff -ruN coreutils-6.12.old/man/dd.1 coreutils-6.12/man/dd.1
--- coreutils-6.12.old/man/dd.1 2008-07-24 12:51:06.000000000 +0200
+++ coreutils-6.12/man/dd.1 2008-07-24 12:59:06.000000000 +0200
@@ -111,6 +111,13 @@
.TP
direct
use direct I/O for data
+.PP
+FLAG symbols only for iflag option:
+.TP
+fullblock
+Read full blocks from input if possible. read() may return early
+if a full block is not available, so retry until data is available
+or end of file is reached.
.IP
directory fail unless a directory
dsync use synchronized I/O for data

View File

@ -139,7 +139,7 @@ index 4b69f7d..9bc66a1 100644
{ LEN_STR_PAIR ("37;44") }, /* st: sticky: black on blue */
{ LEN_STR_PAIR ("34;42") }, /* ow: other-writable: blue on green */
{ LEN_STR_PAIR ("30;42") }, /* tw: ow w/ sticky: black on green */
+ { LEN_STR_PAIR ("30;41") }, /* capability: black on red */
+ { LEN_STR_PAIR ("30;41") }, /* ca: black on red */
};
/* FIXME: comment */
@ -186,7 +186,7 @@ index 4b69f7d..9bc66a1 100644
type = C_SETUID;
else if ((mode & S_ISGID) != 0)
type = C_SETGID;
+ else if (has_capability (name))
+ else if (is_colored (C_CAP) && has_capability (name))
+ type = C_CAP;
else if ((mode & S_IXUGO) != 0)
type = C_EXEC;

View File

@ -15,222 +15,25 @@ diff -urp coreutils-6.10-orig/configure.ac coreutils-6.10/configure.ac
AC_FUNC_FORK
optional_bin_progs=
diff -urp coreutils-6.10-orig/man/cp.1 coreutils-6.10/man/cp.1
--- coreutils-6.10-orig/man/cp.1 2008-01-25 12:34:23.000000000 +0100
+++ coreutils-6.10/man/cp.1 2008-01-25 14:42:25.000000000 +0100
@@ -58,7 +58,7 @@ same as \fB\-\-preserve\fR=\fImode\fR,ow
\fB\-\-preserve\fR[=\fIATTR_LIST\fR]
preserve the specified attributes (default:
mode,ownership,timestamps), if possible
-additional attributes: context, links, all
+additional attributes: security context, links, all
.TP
\fB\-\-no\-preserve\fR=\fIATTR_LIST\fR
don't preserve the specified attributes
@@ -102,6 +102,9 @@ explain what is being done
.TP
\fB\-x\fR, \fB\-\-one\-file\-system\fR
stay on this file system
+.TP
+\fB\-Z\fR, \fB\-\-context\fR=\fICONTEXT\fR
+(SELinux) set SELinux security context of copy to CONTEXT
.TP
\fB\-\-help\fR
display this help and exit
diff -urp coreutils-6.10-orig/man/dir.1 coreutils-6.10/man/dir.1
--- coreutils-6.10-orig/man/dir.1 2008-01-25 12:34:23.000000000 +0100
+++ coreutils-6.10/man/dir.1 2008-01-25 14:46:19.000000000 +0100
@@ -203,11 +203,24 @@ list entries by lines instead of by colu
\fB\-X\fR
sort alphabetically by entry extension
.TP
-\fB\-Z\fR, \fB\-\-context\fR
-print any SELinux security context of each file
-.TP
\fB\-1\fR
list one file per line
+.PP
+SELINUX options:
+.TP
+\fB\-\-lcontext\fR
+Display SELinux security context.
+Enable \fB\-l\fR. Lines will probably be too
+wide for most displays.
+.TP
+\fB\-\-context\fR
+Display SELinux security context so it fits
+on most displays. Displays only mode, user,
+group, security context and file name.
+.TP
+\fB\-\-scontext\fR
+Display only SELinux security context and
+file name.
.TP
\fB\-\-help\fR
display this help and exit
diff -urp coreutils-6.10-orig/man/chcon.1 coreutils-6.10/man/chcon.1
--- coreutils-6.10-orig/man/chcon.1 2008-01-25 12:34:22.000000000 +0100
+++ coreutils-6.10/man/chcon.1 2008-01-25 14:15:52.000000000 +0100
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35.
.TH CHCON "1" "May 2008" "GNU coreutils 6.12" "User Commands"
.SH NAME
diff -urNp coreutils-6.12-orig/man/chcon.x coreutils-6.12/man/chcon.x
--- coreutils-6.12-orig/man/chcon.x 2008-03-07 17:05:53.000000000 +0100
+++ coreutils-6.12/man/chcon.x 2008-10-21 15:53:43.000000000 +0200
@@ -1,4 +1,4 @@
[NAME]
-chcon \- change file security context
+chcon \- change file SELinux security context
.SH SYNOPSIS
.B chcon
[\fIOPTION\fR]... \fICONTEXT FILE\fR...
@@ -14,7 +14,7 @@ chcon \- change file security context
.SH DESCRIPTION
[DESCRIPTION]
.\" Add any additional description here
.PP
-Change the security context of each FILE to CONTEXT.
+Change the SELinux security context of each FILE to CONTEXT.
With \fB\-\-reference\fR, change the security context of each FILE to that of RFILE.
.TP
\fB\-c\fR, \fB\-\-changes\fR
diff -urp coreutils-6.10-orig/man/id.1 coreutils-6.10/man/id.1
--- coreutils-6.10-orig/man/id.1 2008-01-25 12:34:24.000000000 +0100
+++ coreutils-6.10/man/id.1 2008-01-25 14:40:22.000000000 +0100
@@ -14,7 +14,7 @@ Print information for USERNAME, or the c
ignore, for compatibility with other versions
.TP
\fB\-Z\fR, \fB\-\-context\fR
-print only the security context of the current user
+print only the SELinux security context of the current user
.TP
\fB\-g\fR, \fB\-\-group\fR
print only the effective group ID
diff -urp coreutils-6.10-orig/man/install.1 coreutils-6.10/man/install.1
--- coreutils-6.10-orig/man/install.1 2008-01-25 12:34:23.000000000 +0100
+++ coreutils-6.10/man/install.1 2008-01-25 14:32:47.000000000 +0100
@@ -68,11 +68,11 @@ treat DEST as a normal file
\fB\-v\fR, \fB\-\-verbose\fR
print the name of each directory as it is created
.TP
-\fB\-\-preserve\-context\fR
-preserve SELinux security context
+\fB\-P\fR, \fB\-\-preserve_context\fR \fB\-\-preserve\-context\fR
+(SELinux) preserve SELinux security context
.TP
\fB\-Z\fR, \fB\-\-context\fR=\fICONTEXT\fR
-set SELinux security context of files and directories
+(SELinux) set SELinux security context of files and directories
.TP
\fB\-\-help\fR
display this help and exit
diff -urp coreutils-6.10-orig/man/ls.1 coreutils-6.10/man/ls.1
--- coreutils-6.10-orig/man/ls.1 2008-01-25 12:34:23.000000000 +0100
+++ coreutils-6.10/man/ls.1 2008-01-25 14:39:10.000000000 +0100
@@ -203,11 +203,24 @@ list entries by lines instead of by colu
\fB\-X\fR
sort alphabetically by entry extension
.TP
-\fB\-Z\fR, \fB\-\-context\fR
-print any SELinux security context of each file
-.TP
\fB\-1\fR
list one file per line
+.PP
+SELinux options:
+.TP
+\fB\-\-lcontext\fR
+Display SELinux security context.
+Enable \fB\-l\fR. Lines will probably be too
+wide for most displays.
+.TP
+\fB\-Z\fR, \fB\-\-context\fR
+Display SELinux security context so it fits
+on most displays. Displays only mode, user,
+group, security context and file name.
+.TP
+\fB\-\-scontext\fR
+Display only SELinux security context and
+file name.
.TP
\fB\-\-help\fR
display this help and exit
diff -urp coreutils-6.10-orig/man/mkdir.1 coreutils-6.10/man/mkdir.1
--- coreutils-6.10-orig/man/mkdir.1 2008-01-25 12:34:23.000000000 +0100
+++ coreutils-6.10/man/mkdir.1 2008-01-25 14:36:44.000000000 +0100
@@ -21,9 +21,9 @@ no error if existing, make parent direct
\fB\-v\fR, \fB\-\-verbose\fR
print a message for each created directory
.TP
-\fB\-Z\fR, \fB\-\-context\fR=\fICTX\fR
-set the SELinux security context of each created
-directory to CTX
+\fB\-Z\fR, \fB\-\-context\fR=\fICONTEXT\fR
+(SELinux) set the SELinux security context of each
+created directory to CONTEXT
.TP
\fB\-\-help\fR
display this help and exit
diff -urp coreutils-6.10-orig/man/mkfifo.1 coreutils-6.10/man/mkfifo.1
--- coreutils-6.10-orig/man/mkfifo.1 2008-01-25 12:34:23.000000000 +0100
+++ coreutils-6.10/man/mkfifo.1 2008-01-25 14:43:27.000000000 +0100
@@ -10,8 +10,8 @@ mkfifo \- make FIFOs (named pipes)
.PP
Create named pipes (FIFOs) with the given NAMEs.
.TP
-\fB\-Z\fR, \fB\-\-context\fR=\fICTX\fR
-set the SELinux security context of each NAME to CTX
+\fB\-Z\fR, \fB\-\-context\fR=\fICONTEXT\fR
+set the SELinux security context of each NAME to CONTEXT(quoted string)
.PP
Mandatory arguments to long options are mandatory for short options too.
.TP
diff -urp coreutils-6.10-orig/man/mknod.1 coreutils-6.10/man/mknod.1
--- coreutils-6.10-orig/man/mknod.1 2008-01-25 12:34:23.000000000 +0100
+++ coreutils-6.10/man/mknod.1 2008-01-25 14:39:49.000000000 +0100
@@ -10,8 +10,8 @@ mknod \- make block or character special
.PP
Create the special file NAME of the given TYPE.
.TP
-\fB\-Z\fR, \fB\-\-context\fR=\fICTX\fR
-set the SELinux security context of NAME to CTX
+\fB\-Z\fR, \fB\-\-context\fR=\fICONTEXT\fR
+set the SELinux security context of NAME to CONTEXT
.PP
Mandatory arguments to long options are mandatory for short options too.
.TP
diff -urp coreutils-6.10-orig/man/stat.1 coreutils-6.10/man/stat.1
--- coreutils-6.10-orig/man/stat.1 2008-01-25 12:34:23.000000000 +0100
+++ coreutils-6.10/man/stat.1 2008-01-25 14:11:23.000000000 +0100
@@ -28,6 +28,9 @@ If you want a newline, include \en in FO
\fB\-t\fR, \fB\-\-terse\fR
print the information in terse form
.TP
+\fB\-Z\fR, \fB\-\-context\fR
+print security context information for SELinux if available.
+.TP
\fB\-\-help\fR
display this help and exit
.TP
diff -urp coreutils-6.10-orig/man/vdir.1 coreutils-6.10/man/vdir.1
--- coreutils-6.10-orig/man/vdir.1 2008-01-25 12:34:23.000000000 +0100
+++ coreutils-6.10/man/vdir.1 2008-01-25 14:35:10.000000000 +0100
@@ -208,6 +208,20 @@ print any SELinux security context of ea
.TP
\fB\-1\fR
list one file per line
+.PP
+SELINUX options:
+.TP
+\fB\-\-lcontext\fR
+Display SELinux security context. Enable \fB\-l\fR.
+Lines will probably be too wide for most displays.
+.TP
+\fB\-\-context\fR
+Display SELinux security context so it fits
+on most displays. Displays only mode, user,
+group, SELinux security context and file name.
+.TP
+\fB\-\-scontext\fR
+Display only SELinux security context and file name.
.TP
\fB\-\-help\fR
display this help and exit
diff -urNp coreutils-6.12-orig/man/runcon.x coreutils-6.12/man/runcon.x
--- coreutils-6.12-orig/man/runcon.x 2008-03-07 17:05:53.000000000 +0100
+++ coreutils-6.12/man/runcon.x 2008-10-21 15:54:01.000000000 +0200
@@ -1,5 +1,5 @@
[NAME]
-runcon \- run command with specified security context
+runcon \- run command with specified SELinux security context
[DESCRIPTION]
Run COMMAND with completely-specified CONTEXT, or with current or
transitioned security context modified by one or more of LEVEL,
diff -urNp coreutils-6.12-orig/src/chcon.c coreutils-6.12/src/chcon.c
--- coreutils-6.12-orig/src/chcon.c 2008-05-26 08:40:32.000000000 +0200
+++ coreutils-6.12/src/chcon.c 2008-06-16 14:43:24.000000000 +0200
@ -248,6 +51,15 @@ diff -urNp coreutils-6.12-orig/src/chcon.c coreutils-6.12/src/chcon.c
if (change_file_context (fts->fts_cwd_fd, file) != 0)
ok = false;
@@ -352,7 +352,7 @@ Usage: %s [OPTION]... CONTEXT FILE...\n\
"),
program_name, program_name, program_name);
fputs (_("\
-Change the security context of each FILE to CONTEXT.\n\
+Change the SELinux security context of each FILE to CONTEXT.\n\
With --reference, change the security context of each FILE to that of RFILE.\n\
\n\
-h, --no-dereference affect symbolic links instead of any referenced file\n\
diff -urp coreutils-6.10-orig/src/copy.c coreutils-6.10/src/copy.c
--- coreutils-6.10-orig/src/copy.c 2008-01-05 23:59:11.000000000 +0100
+++ coreutils-6.10/src/copy.c 2008-01-25 17:23:17.000000000 +0100
@ -813,7 +625,7 @@ diff -urp coreutils-6.10-orig/src/ls.c coreutils-6.10/src/ls.c
- -Z, --context print any SELinux security context of each file\n\
-1 list one file per line\n\
"), stdout);
+ fputs(_("\nSELINUX options:\n\n\
+ fputs(_("\nSELinux options:\n\n\
+ --lcontext Display security context. Enable -l. Lines\n\
+ will probably be too wide for most displays.\n\
+ -Z, --context Display security context so it fits on most\n\
@ -903,30 +715,6 @@ diff -urp coreutils-6.10-orig/src/mkdir.c coreutils-6.10/src/mkdir.c
{"mode", required_argument, NULL, 'm'},
{"parents", no_argument, NULL, 'p'},
{"verbose", no_argument, NULL, 'v'},
@@ -69,8 +70,8 @@ Mandatory arguments to long options are
-m, --mode=MODE set file mode (as in chmod), not a=rwx - umask\n\
-p, --parents no error if existing, make parent directories as needed\n\
-v, --verbose print a message for each created directory\n\
- -Z, --context=CTX set the SELinux security context of each created\n\
- directory to CTX\n\
+ -Z, --context=CONTEXT set the SELinux security context of each created\n\
+ createddirectory to CONTEXT\n\
"), stdout);
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
diff -urp coreutils-6.10-orig/src/mkfifo.c coreutils-6.10/src/mkfifo.c
--- coreutils-6.10-orig/src/mkfifo.c 2008-01-05 23:58:25.000000000 +0100
+++ coreutils-6.10/src/mkfifo.c 2008-01-25 16:58:15.000000000 +0100
@@ -58,7 +58,8 @@ Create named pipes (FIFOs) with the give
\n\
"), stdout);
fputs (_("\
- -Z, --context=CTX set the SELinux security context of each NAME to CTX\n\
+ -Z, --context=CONTEXT set the SELinux security context \n\
+ of each NAME to CONTEXT(quoted string)\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
diff -urp coreutils-6.10-orig/src/mknod.c coreutils-6.10/src/mknod.c
--- coreutils-6.10-orig/src/mknod.c 2008-01-05 23:58:25.000000000 +0100
+++ coreutils-6.10/src/mknod.c 2008-01-25 17:01:11.000000000 +0100
@ -939,16 +727,6 @@ diff -urp coreutils-6.10-orig/src/mknod.c coreutils-6.10/src/mknod.c
{"mode", required_argument, NULL, 'm'},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
@@ -60,7 +60,8 @@ Create the special file NAME of the give
\n\
"), stdout);
fputs(_("\
- -Z, --context=CTX set the SELinux security context of NAME to CTX\n\
+ -Z, --context=CONTEXT set the SELinux security context \n\
+ of NAME to CONTEXT(quoted string)\n\
"), stdout);
fputs (_("\
Mandatory arguments to long options are mandatory for short options too.\n\
diff -urp coreutils-6.10-orig/src/mv.c coreutils-6.10/src/mv.c
--- coreutils-6.10-orig/src/mv.c 2008-01-05 23:59:11.000000000 +0100
+++ coreutils-6.10/src/mv.c 2008-01-25 17:11:50.000000000 +0100
@ -960,6 +738,18 @@ diff -urp coreutils-6.10-orig/src/mv.c coreutils-6.10/src/mv.c
x->require_preserve = false; /* FIXME: maybe make this an option */
x->require_preserve_context = false;
x->recursive = true;
diff -urNp coreutils-6.12-orig/src/runcon.c coreutils-6.12/src/runcon.c
--- coreutils-6.12-orig/src/runcon.c 2008-05-26 12:10:20.000000000 +0200
+++ coreutils-6.12/src/runcon.c 2008-10-21 15:57:30.000000000 +0200
@@ -88,7 +88,7 @@ Usage: %s CONTEXT COMMAND [args]\n\
or: %s [ -c ] [-u USER] [-r ROLE] [-t TYPE] [-l RANGE] COMMAND [args]\n\
"), program_name, program_name);
fputs (_("\
-Run a program in a different security context.\n\
+Run a program in a different SELinux security context.\n\
With neither CONTEXT nor COMMAND, print the current security context.\n\
\n\
CONTEXT Complete security context\n\
diff -urp coreutils-6.10-orig/src/stat.c coreutils-6.10/src/stat.c
--- coreutils-6.10-orig/src/stat.c 2008-01-05 23:59:11.000000000 +0100
+++ coreutils-6.10/src/stat.c 2008-01-25 16:50:24.000000000 +0100

View File

@ -1,25 +1,3 @@
diff -urNp coreutils-6.10-orig/man/cp.1 coreutils-6.10/man/cp.1
--- coreutils-6.10-orig/man/cp.1 2008-04-07 14:46:37.000000000 +0200
+++ coreutils-6.10/man/cp.1 2008-04-07 15:34:17.000000000 +0200
@@ -19,7 +19,7 @@ Copy SOURCE to DEST, or multiple SOURCE(
Mandatory arguments to long options are mandatory for short options too.
.TP
\fB\-a\fR, \fB\-\-archive\fR
-same as \fB\-dpR\fR
+same as \fB\-cdpR\fR
.TP
\fB\-\-backup\fR[=\fICONTROL\fR]
make a backup of each existing destination file
@@ -55,6 +55,9 @@ never follow symbolic links in SOURCE
\fB\-p\fR
same as \fB\-\-preserve\fR=\fImode\fR,ownership,timestamps
.TP
+\fB\-c\fR
+same as \fB\-\-preserve\fR=context\fR
+.TP
\fB\-\-preserve\fR[=\fIATTR_LIST\fR]
preserve the specified attributes (default:
mode,ownership,timestamps), if possible
diff -urNp coreutils-6.10-orig/doc/coreutils.info coreutils-6.10/doc/coreutils.info
--- coreutils-6.10-orig/doc/coreutils.info 2008-04-07 17:52:11.000000000 +0200
+++ coreutils-6.10/doc/coreutils.info 2008-04-07 18:03:27.000000000 +0200

View File

@ -1,7 +1,7 @@
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils
Version: 6.12
Release: 15%{?dist}
Release: 16%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -54,7 +54,7 @@ Patch912: coreutils-overflow.patch
Patch915: coreutils-split-pam.patch
Patch916: coreutils-getfacl-exit-code.patch
#SELINUX Patch - implements Redhat changes
#SELINUX Patch - implements Redhat changes
#(upstream did some SELinux implementation unlike with RedHat patch)
Patch950: coreutils-selinux.patch
Patch951: coreutils-selinuxmanpages.patch
@ -71,7 +71,7 @@ BuildRequires: texinfo >= 4.3
BuildRequires: lzma
BuildRequires: autoconf >= 2.58
#dist-lzma required
BuildRequires: automake >= 1.10.1
BuildRequires: automake >= 1.10.1
%{?!nopam:BuildRequires: pam-devel}
BuildRequires: libcap-devel >= 2.0.6
@ -181,6 +181,10 @@ automake --copy --add-missing
--enable-selinux \
--enable-install-program=su,hostname,arch \
DEFAULT_POSIX2_VERSION=200112 alternative=199209 || :
# Regenerate manpages
touch man/*.x
make all %{?_smp_mflags} \
%{?!nopam:CPPFLAGS="-DUSE_PAM"} \
su_LDFLAGS="-pie %{?!nopam:-lpam -lpam_misc}"
@ -334,6 +338,14 @@ fi
/sbin/runuser
%changelog
* Wed Oct 21 2008 Ondrej Vasik <ovasik@redhat.com> - 6.12-16
- make possible to disable capability in ls due to
performance impact when not cached(#467508)
- do not patch generated manpages - generate them at build
time
- do not mistakenly display -g and -G runuser option in su
--help output
* Mon Oct 13 2008 Ondrej Vasik <ovasik@redhat.com> - 6.12-15
- fix several date issues(e.g. countable dayshifts, ignoring
some cases of relative offset, locales conversions...)

View File

@ -1,14 +1,12 @@
--- coreutils-5.92/man/date.1.dateman 2005-10-22 19:14:46.000000000 +0100
+++ coreutils-5.92/man/date.1 2005-10-24 17:57:38.000000000 +0100
@@ -214,6 +214,11 @@
diff -urNp coreutils-5.97-orig/man/date.x coreutils-5.97/man/date.x
--- coreutils-5.97-orig/man/date.x 1999-11-02 15:07:36.000000000 +0100
+++ coreutils-5.97/man/date.x 2008-10-15 10:13:31.000000000 +0200
@@ -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.
+.SH ENVIRONMENT
+[ENVIRONMENT]
+.TP
+TZ
+Specifies the timezone, unless overridden by command line parameters.
+If neither is specified, the setting from /etc/localtime is used.
.SH AUTHOR
Written by David MacKenzie.
.SH "REPORTING BUGS"