rpms/coreutils/devel coreutils-dircolors.patch, NONE, 1.1 coreutils-mkdir.patch, NONE, 1.1 coreutils-mkdir2.patch, NONE, 1.1 coreutils-tac.patch, NONE, 1.1 .cvsignore, 1.4, 1.5 coreutils-4.5.3-langinfo.patch, 1.1, 1.2 coreutils-5.2.1-runuser.patch, 1.5, 1.6 coreutils-acl.patch, 1.1, 1.2 coreutils-getgrouplist.patch, 1.1, 1.2 coreutils-i18n.patch, 1.10, 1.11 coreutils-pam.patch, 1.6, 1.7 coreutils-selinux.patch, 1.16, 1.17 coreutils.spec, 1.84, 1.85 sh-utils-2.0.11-dateman.patch, 1.1, 1.2 sources, 1.4, 1.5 coreutils-4.5.3-printf-ll.patch, 1.3, NONE coreutils-5.0-allow_old_options.patch, 1.2, NONE coreutils-brokentest.patch, 1.1, NONE coreutils-chown.patch, 1.1, NONE coreutils-copy.patch, 1.1, NONE coreutils-dateseconds.patch, 1.1, NONE coreutils-fchown.patch, 1.1, NONE coreutils-gcc4.patch, 1.2, NONE coreutils-jday.patch, 1.1, NONE coreutils-no-sign-extend.patch, 1.3, NONE coreutils-rmaccess.patch, 1.1, NONE coreutils-stale-utmp.patch, 1.6, NONE coreutils-zh_CN.patch, 1.1, NONE fileutils-4.1-dircolors_c.patch, 1.2, NONE fil! eutils-4.1.10-utmp.patch,1.1,NONE fileutils-4.1.5-afs.patch,1.2,NONE
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Thu Oct 27 15:05:33 UTC 2005
Author: twaugh
Update of /cvs/dist/rpms/coreutils/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv16986
Modified Files:
.cvsignore coreutils-4.5.3-langinfo.patch
coreutils-5.2.1-runuser.patch coreutils-acl.patch
coreutils-getgrouplist.patch coreutils-i18n.patch
coreutils-pam.patch coreutils-selinux.patch coreutils.spec
sh-utils-2.0.11-dateman.patch sources
Added Files:
coreutils-dircolors.patch coreutils-mkdir.patch
coreutils-mkdir2.patch coreutils-tac.patch
Removed Files:
coreutils-4.5.3-printf-ll.patch
coreutils-5.0-allow_old_options.patch
coreutils-brokentest.patch coreutils-chown.patch
coreutils-copy.patch coreutils-dateseconds.patch
coreutils-fchown.patch coreutils-gcc4.patch
coreutils-jday.patch coreutils-no-sign-extend.patch
coreutils-rmaccess.patch coreutils-stale-utmp.patch
coreutils-zh_CN.patch fileutils-4.1-dircolors_c.patch
fileutils-4.1.10-utmp.patch fileutils-4.1.5-afs.patch
Log Message:
* Mon Oct 24 2005 Tim Waugh <twaugh at redhat.com> 5.92-0.1
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
coreutils-dircolors.patch:
dircolors.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
--- NEW FILE coreutils-dircolors.patch ---
> Summary: Missing comma causes mismatch between slack_codes and ls_codes
...
> Details:
>
> Due to a missing comma in dircolors.c, there is a mismatch between some
> entries in slack_codes and ls_codes, causing all sorts of problems when you
> try to use your own colors for a few file types. Patch attached.
Here's how I've fixed it:
2005-10-24 Jim Meyering <jim at meyering.net>
* src/dircolors.c (ls_codes): Add missing comma.
Anonymous report and patch from
http://savannah.gnu.org/bugs/?func=detailitem&item_id=14849
* src/dircolors.c: Add compile-time assertion that the slack_codes
and ls_codes arrays have the same number of elements. This would
have prevented the above-fixed bug.
Index: src/dircolors.c
===================================================================
RCS file: /fetish/cu/src/dircolors.c,v
retrieving revision 1.94
retrieving revision 1.97
diff -u -p -r1.94 -r1.97
--- src/dircolors.c 19 Oct 2005 07:32:14 -0000 1.94
+++ src/dircolors.c 24 Oct 2005 10:39:46 -0000 1.97
@@ -62,7 +62,6 @@ enum Shell_syntax
variable. */
static struct obstack lsc_obstack;
-/* FIXME: associate with ls_codes? */
static const char *const slack_codes[] =
{
"NORMAL", "NORM", "FILE", "DIR", "LNK", "LINK",
@@ -75,9 +74,11 @@ static const char *const slack_codes[] =
static const char *const ls_codes[] =
{
"no", "no", "fi", "di", "ln", "ln", "ln", "or", "mi", "pi", "pi",
- "so", "bd", "bd", "cd", "cd", "do", "ex", "lc", "lc", "rc", "rc", "ec", "ec"
+ "so", "bd", "bd", "cd", "cd", "do", "ex", "lc", "lc", "rc", "rc", "ec", "ec",
"su", "su", "sg", "sg", "st", "ow", "ow", "tw", "tw", NULL
};
+#define array_len(Array) (sizeof (Array) / sizeof *(Array))
+verify (array_len (slack_codes) == array_len (ls_codes));
static struct option const long_options[] =
{
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils at gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils
coreutils-mkdir.patch:
mkdir-p.c | 37 +++++++++++++++++++++++++++++++------
1 files changed, 31 insertions(+), 6 deletions(-)
--- NEW FILE coreutils-mkdir.patch ---
Thanks for the quick report!
I've just fixed it with the patch below.
I will add a test, too, of course.
Matthias Andree <savannah-bounces at gnu.org> wrote:
> URL:
> <http://savannah.gnu.org/bugs/?func=detailitem&item_id=14848>
...
> Details:
>
> As of coreutils 5.92, there is a regression over previous versions:
>
> $ rm -rf /tmp/test$$
> # this fails:
> $ mkdir -p /tmp/test$$/new/.
> mkdir: cannot create directory `/tmp/test12097/new/.': File exists
> # it works however if the directory exists
> $ mkdir -p /tmp/test$$/new/. # now works as new exists
>
> The first mkdir -p command shown used to work with older coreutils, and there
> is no reason why it should fail today.
2005-10-24 Jim Meyering <jim at meyering.net>
* mkdir-p.c (make_dir_parents): Make the preceding fix a little
more robust, e.g., when the final component is created as a non-
directory by another process just before `mkdir -p's final mkdir.
A command like `mkdir -p nonexistent/.' would create the
directory but exit nonzero with a diagnostic. This could also be
triggered with a non-`.' component, e.g., in a race with another
process running the same `mkdir -p nonexistent/sub' command.
* mkdir-p.c (make_dir_parents): Handle the case of an
existing final component.
Reported by Matthias Andree here:
http://savannah.gnu.org/bugs/?func=detailitem&item_id=14848
Index: lib/mkdir-p.c
===================================================================
RCS file: /fetish/cu/lib/mkdir-p.c,v
retrieving revision 1.12
retrieving revision 1.14
diff -u -p -r1.12 -r1.14
--- lib/mkdir-p.c 13 Oct 2005 19:05:13 -0000 1.12
+++ lib/mkdir-p.c 24 Oct 2005 10:22:10 -0000 1.14
@@ -264,17 +264,42 @@ make_dir_parents (char const *arg,
Create the final component of the file name. */
if (retval)
{
- if (mkdir (basename_dir, mode) != 0)
- {
- error (0, errno, _("cannot create directory %s"), quote (dir));
- retval = false;
- }
- else
+ bool just_created = (mkdir (basename_dir, mode) == 0);
+ if (just_created)
{
if (verbose_fmt_string)
error (0, 0, verbose_fmt_string, quote (dir));
fixup_permissions_dir = basename_dir;
}
+ else
+ {
+ if (errno != EEXIST)
+ {
+ error (0, errno, _("cannot create directory %s"), quote (dir));
+ retval = false;
+ }
+ else
+ {
+ /* basename_dir exists.
+ This is highly unlikely, but not impossible in a race.
+ You can exercise this code by running a very slow
+ mkdir -p a/nonexistent/c process and e.g., running
+ touch a/nonexistent/c after a/nonexistent is created
+ but before mkdir attempts to create `c'.
+
+ If it's a directory, we're done.
+ Otherwise, we must fail. */
+ struct stat sbuf;
+ /* The stat may fail for a dangling link. */
+ if (stat (basename_dir, &sbuf) != 0
+ || ! S_ISDIR (sbuf.st_mode))
+ {
+ error (0, 0, _("%s exists but is not a directory"),
+ quote (basename_dir));
+ retval = false;
+ }
+ }
+ }
}
}
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils at gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils
coreutils-mkdir2.patch:
mkdir-p.c | 46 +++++++++++++++-------------------------------
1 files changed, 15 insertions(+), 31 deletions(-)
--- NEW FILE coreutils-mkdir2.patch ---
"Dmitry V. Levin" <ldv at altlinux.org> wrote:
> "mkdir -p" and "install -d" now fail when creating final component
> of the file name when it already exists.
> Proposed patch with testcase is attached.
>
> 2005-10-24 Dmitry V. Levin <ldv at altlinux.org>
>
> * lib/mkdir-p.c (make_dir_parents): When creating final component
> of the file name, do not fail when it already exists.
> * tests/install/d-slashdot: New test, for "install -d" failure.
> * tests/install/Makefile.am (TESTS): Add d-slashdot.
> * tests/mkdir/p-slashdot: New test, for "mkdir -p" failure.
> * tests/mkdir/Makefile.am (TESTS): Add p-slashdot.
Thanks for the patch and test cases.
I'd already fixed it, but with code relying on an errno == EEXIST test.
So I've made yet another change (mostly your patch, with slightly
different scoping):
2005-10-24 Jim Meyering <jim at meyering.net>
* mkdir-p.c (make_dir_parents): Like the code above it, don't
rely on mkdir failing with a particular errno value (EEXIST).
Based on a patch by Dmitry V. Levin.
Index: lib/mkdir-p.c
===================================================================
RCS file: /fetish/cu/lib/mkdir-p.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -p -u -r1.14 -r1.15
--- lib/mkdir-p.c 24 Oct 2005 10:22:10 -0000 1.14
+++ lib/mkdir-p.c 24 Oct 2005 13:35:59 -0000 1.15
@@ -264,41 +264,25 @@ make_dir_parents (char const *arg,
Create the final component of the file name. */
if (retval)
{
- bool just_created = (mkdir (basename_dir, mode) == 0);
- if (just_created)
+ bool dir_known_to_exist = (mkdir (basename_dir, mode) == 0);
+ int mkdir_errno = errno;
+ struct stat sbuf;
+
+ if ( ! dir_known_to_exist)
+ dir_known_to_exist = (stat (basename_dir, &sbuf) == 0
+ && S_ISDIR (sbuf.st_mode));
+
+ if ( ! dir_known_to_exist)
{
- if (verbose_fmt_string)
- error (0, 0, verbose_fmt_string, quote (dir));
- fixup_permissions_dir = basename_dir;
+ error (0, mkdir_errno,
+ _("cannot create directory %s"), quote (dir));
+ retval = false;
}
else
{
- if (errno != EEXIST)
- {
- error (0, errno, _("cannot create directory %s"), quote (dir));
- retval = false;
- }
- else
- {
- /* basename_dir exists.
- This is highly unlikely, but not impossible in a race.
- You can exercise this code by running a very slow
- mkdir -p a/nonexistent/c process and e.g., running
- touch a/nonexistent/c after a/nonexistent is created
- but before mkdir attempts to create `c'.
-
- If it's a directory, we're done.
- Otherwise, we must fail. */
- struct stat sbuf;
- /* The stat may fail for a dangling link. */
- if (stat (basename_dir, &sbuf) != 0
- || ! S_ISDIR (sbuf.st_mode))
- {
- error (0, 0, _("%s exists but is not a directory"),
- quote (basename_dir));
- retval = false;
- }
- }
+ if (verbose_fmt_string)
+ error (0, 0, verbose_fmt_string, quote (dir));
+ fixup_permissions_dir = basename_dir;
}
}
}
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils at gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils
coreutils-tac.patch:
tac.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
--- NEW FILE coreutils-tac.patch ---
Peter Fales <psfales at lucent.com> wrote:
> On Solaris, tac is failing when reading from stdin and stdin is a terminal.
> (it works on Linux) E.g. a command like this works:
>
> $ echo 'a\nb' | tac
> b
> a
>
> But simply running tac from the command line results in getting a shell
> prompt back (no chance to type anything):
>
> $ tac
> $
>
>
> The problem seems to be around line 548 in tac.c
>
> 548 file_size = lseek (fd, (off_t) 0, SEEK_END);
> 549
> 550 ok = (0 <= file_size
> 551 ? tac_seekable (fd, filename)
> 552 : tac_nonseekable (fd, filename));
>
> On linux lseeking on stdin returns -1, resulting in a call to
> tac_nonseekable. But, on Solaris, lseek returns 0.
Thanks for the detailed report.
Here's a patch:
2005-10-24 Jim Meyering <jim at meyering.net>
* src/tac.c (tac_file): When determining whether a file is seekable,
also test whether it is a tty. Using only the lseek-based test would
give a false positive on Solaris. Reported by Peter Fales.
Index: src/tac.c
===================================================================
RCS file: /fetish/cu/src/tac.c,v
retrieving revision 1.125
diff -u -p -r1.125 tac.c
--- src/tac.c 9 Sep 2005 21:11:36 -0000 1.125
+++ src/tac.c 24 Oct 2005 16:01:53 -0000
@@ -547,9 +547,9 @@ tac_file (const char *filename)
file_size = lseek (fd, (off_t) 0, SEEK_END);
- ok = (0 <= file_size
- ? tac_seekable (fd, filename)
- : tac_nonseekable (fd, filename));
+ ok = (file_size < 0 || isatty (fd)
+ ? tac_nonseekable (fd, filename)
+ : tac_seekable (fd, filename));
if (!is_stdin && close (fd) != 0)
{
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils at gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils
Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/.cvsignore,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- .cvsignore 9 Sep 2004 03:58:39 -0000 1.4
+++ .cvsignore 27 Oct 2005 15:05:07 -0000 1.5
@@ -1 +1,2 @@
coreutils-5.2.1.tar.bz2
+coreutils-5.92.tar.bz2
coreutils-4.5.3-langinfo.patch:
date.c | 9 +--------
1 files changed, 1 insertion(+), 8 deletions(-)
Index: coreutils-4.5.3-langinfo.patch
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/coreutils-4.5.3-langinfo.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- coreutils-4.5.3-langinfo.patch 9 Sep 2004 03:55:45 -0000 1.1
+++ coreutils-4.5.3-langinfo.patch 27 Oct 2005 15:05:07 -0000 1.2
@@ -1,18 +1,18 @@
---- coreutils-4.5.3/src/date.c.langinfo 2002-11-28 18:02:47.000000000 +0000
-+++ coreutils-4.5.3/src/date.c 2002-11-28 18:04:04.000000000 +0000
-@@ -509,14 +509,7 @@
- else
+--- coreutils-5.92/src/date.c.langinfo 2005-09-16 09:06:57.000000000 +0100
++++ coreutils-5.92/src/date.c 2005-10-24 18:09:16.000000000 +0100
+@@ -451,14 +451,7 @@
+ format = DATE_FMT_LANGINFO ();
+ if (! *format)
{
- char *date_fmt = DATE_FMT_LANGINFO ();
- /* Do not wrap the following literal format string with _(...).
- For example, suppose LC_ALL is unset, LC_TIME="POSIX",
-- and LANG="ko_KR". In that case, POSIX says that LC_TIME
+- and LANG="ko_KR". In that case, POSIX says that LC_TIME
- determines the format and contents of date and time strings
- written by date, which means "date" must generate output
- using the POSIX locale; but adding _() would cause "date"
- to use a Korean translation of the format. */
-- format = *date_fmt ? date_fmt : "%a %b %e %H:%M:%S %Z %Y";
-+ format = *date_fmt ? date_fmt : dcgettext(NULL, N_("%a %b %e %H:%M:%S %Z %Y"), LC_TIME);
+- format = "%a %b %e %H:%M:%S %Z %Y";
++ format = dcgettext(NULL, N_("%a %b %e %H:%M:%S %Z %Y"), LC_TIME);
}
}
- else if (*format == '\0')
+
coreutils-5.2.1-runuser.patch:
AUTHORS | 1
README | 2 -
man/Makefile.am | 3 +-
man/runuser.1 | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++
man/runuser.x | 4 +++
src/Makefile.am | 5 ++--
src/runuser.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
src/su.c | 8 ++++++-
tests/help-version | 1
9 files changed, 132 insertions(+), 5 deletions(-)
Index: coreutils-5.2.1-runuser.patch
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/coreutils-5.2.1-runuser.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- coreutils-5.2.1-runuser.patch 5 Oct 2004 14:31:29 -0000 1.5
+++ coreutils-5.2.1-runuser.patch 27 Oct 2005 15:05:08 -0000 1.6
@@ -1,5 +1,122 @@
---- /dev/null 2004-09-30 04:21:43.103661032 -0400
-+++ coreutils-5.2.1/man/runuser.1 2004-10-05 09:56:25.919169327 -0400
+--- coreutils-5.92/src/su.c.runuser 2005-10-27 09:13:53.000000000 +0100
++++ coreutils-5.92/src/su.c 2005-10-27 09:17:11.000000000 +0100
+@@ -134,7 +134,9 @@
+ /* The official name of this program (e.g., no `g' prefix). */
+ #define PROGRAM_NAME "su"
+
++#ifndef AUTHORS
+ #define AUTHORS "David MacKenzie"
++#endif
+
+ #if HAVE_PATHS_H
+ # include <paths.h>
+@@ -172,6 +174,10 @@
+ #ifndef USE_PAM
+ char *crypt ();
+ #endif
++#ifndef CHECKPASSWD
++#define CHECKPASSWD 1
++#endif
++
+ char *getpass ();
+ char *getusershell ();
+ void endusershell ();
+@@ -730,7 +736,7 @@
+ : DEFAULT_SHELL);
+ endpwent ();
+
+- if (!correct_password (pw))
++ if (CHECKPASSWD && !correct_password (pw))
+ {
+ #ifdef SYSLOG_FAILURE
+ log_su (pw, false);
+--- coreutils-5.92/src/Makefile.am.runuser 2005-10-27 09:13:53.000000000 +0100
++++ coreutils-5.92/src/Makefile.am 2005-10-27 09:13:53.000000000 +0100
+@@ -17,7 +17,7 @@
+ ## along with this program; if not, write to the Free Software Foundation,
+ ## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+-EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who
++EXTRA_PROGRAMS = chroot df hostid nice pinky stty su runuser uname uptime users who
+
+ bin_SCRIPTS = groups
+ bin_PROGRAMS = [ chgrp chown chmod cp dd dircolors du \
+@@ -91,6 +91,7 @@
+ uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS)
+
+ su_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
++runuser_LDADD = $(LDADD) $(LIB_CRYPT)
+
+ $(PROGRAMS): ../lib/libcoreutils.a
+
+@@ -106,7 +107,7 @@
+ chmod +x $@-t
+ mv $@-t $@
+
+-all-local: su$(EXEEXT)
++all-local: su$(EXEEXT) runuser
+
+ installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
+
+--- /dev/null 2005-10-10 09:36:06.437701000 +0100
++++ coreutils-5.92/src/runuser.c 2005-10-27 09:17:34.000000000 +0100
+@@ -0,0 +1,54 @@
++#define CHECKPASSWD 0
++#define pam_start my_pam_start
++#define pam_end my_pam_end
++#define pam_setcred my_pam_setcred
++#define pam_open_session my_pam_open_session
++#define pam_close_session my_pam_close_session
++#define pam_strerror my_pam_strerror
++#define pam_getenvlist my_pam_getenvlist
++#define AUTHORS "David MacKenzie, Dan Walsh"
++#include "su.c"
++int pam_start(const char *service_name, const char *user,
++ const struct pam_conv *pam_conversation,
++ pam_handle_t **pamh) {
++ return PAM_SUCCESS;
++}
++int pam_end(pam_handle_t *pamh, int pam_status) {
++ return PAM_SUCCESS;
++}
++int pam_setcred(pam_handle_t *pamh, int flags){
++ return PAM_SUCCESS;
++}
++int pam_open_session(pam_handle_t *pamh, int flags){
++ return PAM_SUCCESS;
++}
++int pam_close_session(pam_handle_t *pamh, int flags){
++ return PAM_SUCCESS;
++}
++const char *pam_strerror(pam_handle_t *pamh, int err){
++ return "";
++}
++char **pam_getenvlist(pam_handle_t *pamh){
++ return NULL;
++}
++
++int misc_conv(int num_msg, const struct pam_message **msgm,
++ struct pam_response **response, void *appdata_ptr) {
++ return PAM_SUCCESS;
++}
++
++int pam_authenticate(pam_handle_t *pamh, int flags) {
++ return PAM_SUCCESS;
++}
++
++int pam_acct_mgmt(pam_handle_t *pamh, int flags) {
++ return PAM_SUCCESS;
++}
++
++int pam_chauthtok (pam_handle_t *pamh, int flags) {
++ return PAM_SUCCESS;
++}
++
++int pam_set_item(pam_handle_t *pamh, int item_type, const void *item) {
++ return PAM_SUCCESS;
++}
+--- /dev/null 2005-10-10 09:36:06.437701000 +0100
++++ coreutils-5.92/man/runuser.1 2005-10-27 09:13:53.000000000 +0100
@@ -0,0 +1,59 @@
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.33.
+.TH RUNUSER "1" "September 2004" "runuser (coreutils) 5.2.1" "User Commands"
@@ -60,8 +177,8 @@
+.B info coreutils su
+.PP
+should give you access to the complete manual.
---- coreutils-5.2.1/man/Makefile.am.runuser 2004-01-23 10:54:23.000000000 -0500
-+++ coreutils-5.2.1/man/Makefile.am 2004-10-05 09:56:25.921169102 -0400
+--- coreutils-5.92/man/Makefile.am.runuser 2005-10-13 15:12:26.000000000 +0100
++++ coreutils-5.92/man/Makefile.am 2005-10-27 09:13:53.000000000 +0100
@@ -7,7 +7,7 @@
link.1 ln.1 logname.1 \
ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nice.1 nl.1 nohup.1 od.1 \
@@ -79,15 +196,25 @@
seq.1: $(common_dep) $(srcdir)/seq.x ../src/seq.c
sha1sum.1: $(common_dep) $(srcdir)/sha1sum.x ../src/md5sum.c
shred.1: $(common_dep) $(srcdir)/shred.x ../src/shred.c
---- /dev/null 2004-09-30 04:21:43.103661032 -0400
-+++ coreutils-5.2.1/man/runuser.x 2004-10-05 09:56:25.922168989 -0400
+--- /dev/null 2005-10-10 09:36:06.437701000 +0100
++++ coreutils-5.92/man/runuser.x 2005-10-27 09:13:53.000000000 +0100
@@ -0,0 +1,4 @@
+[NAME]
+runuser \- run a shell with substitute user and group IDs
+[DESCRIPTION]
+.\" Add any additional description here
---- coreutils-5.2.1/README.runuser 2004-01-18 02:59:41.000000000 -0500
-+++ coreutils-5.2.1/README 2004-10-05 09:56:25.925168651 -0400
+--- coreutils-5.92/tests/help-version.runuser 2005-01-05 22:08:48.000000000 +0000
++++ coreutils-5.92/tests/help-version 2005-10-27 09:13:53.000000000 +0100
+@@ -136,6 +136,7 @@
+ seq_args=10
+ sleep_args=0
+ su_args=--version
++runuser_args=--version
+ test_args=foo
+
+ # This is necessary in the unusual event that there is
+--- coreutils-5.92/README.runuser 2005-09-28 19:34:03.000000000 +0100
++++ coreutils-5.92/README 2005-10-27 09:13:53.000000000 +0100
@@ -11,7 +11,7 @@
df dir dircolors dirname du echo env expand expr factor false fmt fold
ginstall groups head hostid hostname id join kill link ln logname ls
@@ -97,127 +224,13 @@
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
---- coreutils-5.2.1/tests/help-version.runuser 2004-02-17 11:04:23.000000000 -0500
-+++ coreutils-5.2.1/tests/help-version 2004-10-05 09:56:25.924168764 -0400
-@@ -130,6 +130,7 @@
- seq_args=10
- sleep_args=0
- su_args=--version
-+runuser_args=--version
- test_args=foo
-
- # This is necessary in the unusual event that there is
---- coreutils-5.2.1/src/su.c.runuser 2004-10-05 09:56:25.680196251 -0400
-+++ coreutils-5.2.1/src/su.c 2004-10-05 09:56:25.915169778 -0400
-@@ -171,6 +171,10 @@
- #ifndef USE_PAM
- char *crypt ();
- #endif
-+#ifndef CHECKPASSWD
-+#define CHECKPASSWD 1
-+#endif
-+
- char *getpass ();
- char *getusershell ();
- void endusershell ();
-@@ -740,7 +744,7 @@
- pw->pw_dir = xstrdup (pw->pw_dir);
- pw->pw_shell = xstrdup (pw->pw_shell);
-
-- if (!correct_password (pw))
-+ if (CHECKPASSWD && !correct_password (pw))
- {
- #ifdef SYSLOG_FAILURE
- log_su (pw, 0);
---- coreutils-5.2.1/src/Makefile.am.runuser 2004-10-05 09:56:25.677196589 -0400
-+++ coreutils-5.2.1/src/Makefile.am 2004-10-05 09:56:25.916169665 -0400
-@@ -1,6 +1,6 @@
- ## Process this file with automake to produce Makefile.in -*-Makefile-*-
-
--EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who
-+EXTRA_PROGRAMS = chroot df hostid nice pinky stty su runuser uname uptime users who
-
- bin_SCRIPTS = groups
- bin_PROGRAMS = [ chgrp chown chmod cp dd dircolors du \
-@@ -67,6 +67,7 @@
- uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS)
-
- su_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
-+runuser_LDADD = $(LDADD) $(LIB_CRYPT)
-
- $(PROGRAMS): ../lib/libfetish.a
-
-@@ -84,7 +85,7 @@
- chmod +x $@-t
- mv $@-t $@
-
--all-local: su$(EXEEXT)
-+all-local: su$(EXEEXT) runuser
-
- installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
-
-@@ -100,7 +101,7 @@
- chmod $(setuid_root_mode) $(installed_su)
-
- install-root: su$(EXEEXT)
-- @$(INSTALL_SU)
-+ @$(INSTALL_SU)
-
- install-exec-local: su$(EXEEXT)
- @TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \
---- /dev/null 2004-09-30 04:21:43.103661032 -0400
-+++ coreutils-5.2.1/src/runuser.c 2004-10-05 10:04:28.835490381 -0400
-@@ -0,0 +1,53 @@
-+#define CHECKPASSWD 0
-+#define pam_start my_pam_start
-+#define pam_end my_pam_end
-+#define pam_setcred my_pam_setcred
-+#define pam_open_session my_pam_open_session
-+#define pam_close_session my_pam_close_session
-+#define pam_strerror my_pam_strerror
-+#define pam_getenvlist my_pam_getenvlist
-+#include "su.c"
-+int pam_start(const char *service_name, const char *user,
-+ const struct pam_conv *pam_conversation,
-+ pam_handle_t **pamh) {
-+ return PAM_SUCCESS;
-+}
-+int pam_end(pam_handle_t *pamh, int pam_status) {
-+ return PAM_SUCCESS;
-+}
-+int pam_setcred(pam_handle_t *pamh, int flags){
-+ return PAM_SUCCESS;
-+}
-+int pam_open_session(pam_handle_t *pamh, int flags){
-+ return PAM_SUCCESS;
-+}
-+int pam_close_session(pam_handle_t *pamh, int flags){
-+ return PAM_SUCCESS;
-+}
-+const char *pam_strerror(pam_handle_t *pamh, int err){
-+ return "";
-+}
-+char **pam_getenvlist(pam_handle_t *pamh){
-+ return NULL;
-+}
-+
-+int misc_conv(int num_msg, const struct pam_message **msgm,
-+ struct pam_response **response, void *appdata_ptr) {
-+ return PAM_SUCCESS;
-+}
-+
-+int pam_authenticate(pam_handle_t *pamh, int flags) {
-+ return PAM_SUCCESS;
-+}
-+
-+int pam_acct_mgmt(pam_handle_t *pamh, int flags) {
-+ return PAM_SUCCESS;
-+}
-+
-+int pam_chauthtok (pam_handle_t *pamh, int flags) {
-+ return PAM_SUCCESS;
-+}
-+
-+int pam_set_item(pam_handle_t *pamh, int item_type, const void *item) {
-+ return PAM_SUCCESS;
-+}
+--- coreutils-5.92/AUTHORS.runuser 2004-11-03 23:10:50.000000000 +0000
++++ coreutils-5.92/AUTHORS 2005-10-27 09:13:53.000000000 +0100
+@@ -59,6 +59,7 @@
+ readlink: Dmitry V. Levin
+ rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering
+ rmdir: David MacKenzie
++runuser: David MacKenzie, Dan Walsh
+ seq: Ulrich Drepper
+ sha1sum: Ulrich Drepper, Scott Miller
+ shred: Colin Plumb
coreutils-acl.patch:
ChangeLog | 45 ++++++++++++
NEWS | 3
config.hin | 30 ++++++++
configure.ac | 2
lib/acl.c | 206 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
lib/acl.h | 7 +
m4/posix_acl.m4 | 28 +++++++
src/Makefile.am | 12 +--
src/copy.c | 172 +++++++++++++++++++++++++++++-----------------
src/copy.h | 3
src/cp.c | 97 +++++++++++++++++++-------
src/install.c | 1
src/ls.c | 8 +-
src/mv.c | 6 -
14 files changed, 504 insertions(+), 116 deletions(-)
Index: coreutils-acl.patch
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/coreutils-acl.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- coreutils-acl.patch 9 Sep 2004 03:58:39 -0000 1.1
+++ coreutils-acl.patch 27 Oct 2005 15:05:08 -0000 1.2
@@ -1,5 +1,5 @@
---- /dev/null 2004-02-23 21:02:56.000000000 +0000
-+++ coreutils-5.2.1/m4/posix_acl.m4 2004-03-13 11:50:03.000000000 +0000
+--- /dev/null 2005-10-10 09:36:06.437701000 +0100
++++ coreutils-5.92/m4/posix_acl.m4 2005-10-27 11:44:29.000000000 +0100
@@ -0,0 +1,28 @@
+#serial 1
+
@@ -29,18 +29,8 @@
+ AC_DEFINE(USE_ACL, 1, [Define if you want access control list support.])
+ fi
+])
---- coreutils-5.2.1/m4/Makefile.am.acl 2004-03-08 09:56:31.000000000 +0000
-+++ coreutils-5.2.1/m4/Makefile.am 2004-03-13 11:50:03.000000000 +0000
-@@ -108,6 +108,7 @@
- EXTRA_DIST += path-concat.m4
- EXTRA_DIST += pathmax.m4
- EXTRA_DIST += perl.m4
-+EXTRA_DIST += posix_acl.m4
- EXTRA_DIST += physmem.m4
- EXTRA_DIST += po.m4
- EXTRA_DIST += posixtm.m4
---- coreutils-5.2.1/lib/acl.h.acl 2004-02-02 08:13:21.000000000 +0000
-+++ coreutils-5.2.1/lib/acl.h 2004-03-13 11:50:03.000000000 +0000
+--- coreutils-5.92/lib/acl.h.acl 2005-05-14 08:58:06.000000000 +0100
++++ coreutils-5.92/lib/acl.h 2005-10-27 11:44:29.000000000 +0100
@@ -18,11 +18,16 @@
Written by Paul Eggert. */
@@ -59,8 +49,8 @@
int file_has_acl (char const *, struct stat const *);
+int copy_acl (char const *, char const *, mode_t);
+int set_acl (char const *, mode_t);
---- coreutils-5.2.1/lib/acl.c.acl 2004-02-02 08:13:21.000000000 +0000
-+++ coreutils-5.2.1/lib/acl.c 2004-03-13 11:50:03.000000000 +0000
+--- coreutils-5.92/lib/acl.c.acl 2005-09-22 07:47:18.000000000 +0100
++++ coreutils-5.92/lib/acl.c 2005-10-27 11:44:29.000000000 +0100
@@ -22,18 +22,30 @@
# include <config.h>
#endif
@@ -94,7 +84,7 @@
# define MIN_ACL_ENTRIES 4
@@ -45,19 +57,201 @@
int
- file_has_acl (char const *path, struct stat const *pathstat)
+ file_has_acl (char const *file, struct stat const *filestat)
{
- /* FIXME: This implementation should work on recent-enough versions
- of HP-UX, Solaris, and Unixware, but it simply returns 0 with
@@ -106,18 +96,18 @@
+ /* This implementation should work on recent-enough versions of HP-UX,
+ Solaris, and Unixware. */
+
- if (! S_ISLNK (pathstat->st_mode))
+ if (! S_ISLNK (filestat->st_mode))
{
- int n = acl (path, GETACLCNT, 0, NULL);
+ int n = acl (file, GETACLCNT, 0, NULL);
return n < 0 ? (errno == ENOSYS ? 0 : -1) : (MIN_ACL_ENTRIES < n);
}
+#elif HAVE_ACL_EXTENDED_FILE
+
+ /* Linux specific. */
+
-+ if (! S_ISLNK (pathstat->st_mode))
++ if (! S_ISLNK (filestat->st_mode))
+ {
-+ int ret = acl_extended_file (path);
++ int ret = acl_extended_file (file);
+ if (ret < 0)
+ return (errno == ENOSYS || errno == ENOTSUP) ? 0 : -1;
+ return ret;
@@ -300,9 +290,9 @@
+#endif
+}
+
---- coreutils-5.2.1/src/mv.c.acl 2004-02-07 15:41:02.000000000 +0000
-+++ coreutils-5.2.1/src/mv.c 2004-03-13 11:50:03.000000000 +0000
-@@ -132,12 +132,6 @@
+--- coreutils-5.92/src/mv.c.acl 2005-07-03 17:55:19.000000000 +0100
++++ coreutils-5.92/src/mv.c 2005-10-27 11:44:29.000000000 +0100
+@@ -135,12 +135,6 @@
x->mode = 0;
x->stdin_tty = isatty (STDIN_FILENO);
@@ -312,12 +302,12 @@
- have been allowed with the mask this process was started with. */
- x->umask_kill = ~ umask (0);
-
- x->update = 0;
- x->verbose = 0;
+ x->update = false;
+ x->verbose = false;
x->dest_info = NULL;
---- coreutils-5.2.1/src/ls.c.acl 2004-03-13 11:50:03.000000000 +0000
-+++ coreutils-5.2.1/src/ls.c 2004-03-13 11:50:03.000000000 +0000
-@@ -188,13 +188,13 @@
+--- coreutils-5.92/src/ls.c.acl 2005-10-27 11:44:29.000000000 +0100
++++ coreutils-5.92/src/ls.c 2005-10-27 11:44:29.000000000 +0100
+@@ -193,13 +193,13 @@
enum filetype filetype;
@@ -333,7 +323,16 @@
# define FILE_HAS_ACL(F) ((F)->have_acl)
#else
# define FILE_HAS_ACL(F) 0
-@@ -2409,7 +2409,7 @@
+@@ -334,7 +334,7 @@
+ /* Whether any of the files has an ACL. This affects the width of the
+ mode column. */
+
+-#if HAVE_ACL
++#if HAVE_ACL || USE_ACL
+ static bool any_has_acl;
+ #else
+ enum { any_has_acl = false };
+@@ -2582,7 +2582,7 @@
return 0;
}
@@ -341,91 +340,91 @@
+#if HAVE_ACL || USE_ACL
if (format == long_format)
{
- int n = file_has_acl (path, &f->stat);
---- coreutils-5.2.1/src/install.c.acl 2004-03-13 11:50:03.000000000 +0000
-+++ coreutils-5.2.1/src/install.c 2004-03-13 11:50:03.000000000 +0000
-@@ -242,7 +242,6 @@
+ int n = file_has_acl (absolute_name, &f->stat);
+--- coreutils-5.92/src/install.c.acl 2005-09-23 21:58:37.000000000 +0100
++++ coreutils-5.92/src/install.c 2005-10-27 11:44:29.000000000 +0100
+@@ -153,7 +153,6 @@
x->mode = S_IRUSR | S_IWUSR;
- x->stdin_tty = 0;
+ x->stdin_tty = false;
- x->umask_kill = 0;
- x->update = 0;
- x->verbose = 0;
+ x->update = false;
+ x->verbose = false;
x->dest_info = NULL;
---- coreutils-5.2.1/src/cp.c.acl 2004-02-07 15:55:09.000000000 +0000
-+++ coreutils-5.2.1/src/cp.c 2004-03-13 11:50:03.000000000 +0000
-@@ -58,7 +58,8 @@
+--- coreutils-5.92/src/cp.c.acl 2005-09-16 08:51:01.000000000 +0100
++++ coreutils-5.92/src/cp.c 2005-10-27 11:44:29.000000000 +0100
+@@ -56,7 +56,8 @@
need to be fixed after copying. */
struct dir_attr
{
-- int is_new_dir;
+- bool is_new_dir;
+ int mode_valid;
+ mode_t mode;
- int slash_offset;
+ size_t slash_offset;
struct dir_attr *next;
};
-@@ -333,9 +334,14 @@
+@@ -327,9 +328,14 @@
}
}
-- if (x->preserve_mode || p->is_new_dir)
+- if (x->preserve_mode | p->is_new_dir)
- {
-- if (chmod (dst_path, src_sb.st_mode & x->umask_kill))
+- if (chmod (dst_name, src_sb.st_mode & x->umask_kill))
+ if (x->preserve_mode)
+ {
-+ if (copy_acl (src_path, dst_path, src_sb.st_mode))
++ if (copy_acl (src_name, dst_name, src_sb.st_mode))
+ return 1;
+ }
+ else if (p->mode_valid)
+ {
-+ if (chmod (dst_path, p->mode))
++ if (chmod (dst_name, p->mode))
{
error (0, errno, _("failed to preserve permissions for %s"),
- quote (dst_path));
-@@ -353,8 +359,7 @@
+ quote (dst_name));
+@@ -347,8 +353,7 @@
- SRC_OFFSET is the index in CONST_DIRPATH (which is a destination
- path) of the beginning of the source directory name.
+ SRC_OFFSET is the index in CONST_DIR (which is a destination
+ directory) of the beginning of the source directory name.
- Create any leading directories that don't already exist,
- giving them permissions MODE.
+ Create any leading directories that don't already exist.
If VERBOSE_FMT_STRING is nonzero, use it as a printf format
string for printing a message after successfully making a directory.
The format should take two string arguments: the names of the
-@@ -369,15 +374,20 @@
- /* FIXME: find a way to synch this function with the one in lib/makepath.c. */
+@@ -364,15 +369,20 @@
- static int
--make_path_private (const char *const_dirpath, int src_offset, int mode,
-+make_path_private (const char *const_dirpath, int src_offset,
- const char *verbose_fmt_string, struct dir_attr **attr_list,
-- int *new_dst, int (*xstat)())
-+ int *new_dst, const struct cp_options *x)
+ static bool
+ make_dir_parents_private (char const *const_dir, size_t src_offset,
+- mode_t mode, char const *verbose_fmt_string,
++ char const *verbose_fmt_string,
+ struct dir_attr **attr_list, bool *new_dst,
+- int (*xstat) ())
++ const struct cp_options *x)
{
struct stat stats;
- char *dirpath; /* A copy of CONST_DIRPATH we can change. */
- char *src; /* Source name in `dirpath'. */
- char *dst_dirname; /* Leading path of `dirpath'. */
- size_t dirlen; /* Length of leading path of `dirpath'. */
+ char *dir; /* A copy of CONST_DIR we can change. */
+ char *src; /* Source name in DIR. */
+ char *dst_dir; /* Leading directory of DIR. */
+ size_t dirlen; /* Length of DIR. */
+ mode_t mode;
+ int (*xstat)() = (x->dereference == DEREF_COMMAND_LINE_ARGUMENTS
+ || x->dereference == DEREF_ALWAYS
+ ? stat
+ : lstat);
- ASSIGN_STRDUPA (dirpath, const_dirpath);
+ ASSIGN_STRDUPA (dir, const_dir);
-@@ -412,12 +422,20 @@
- if ((*xstat) (dirpath, &stats))
+@@ -407,12 +417,20 @@
+ if ((*xstat) (dir, &stats))
{
- /* This element of the path does not exist. We must set
+ /* This component does not exist. We must set
- *new_dst and new->is_new_dir inside this loop because,
+ *new_dst inside this loop because,
for example, in the command `cp --parents ../a/../b/c e_dir',
- make_path_private creates only e_dir/../a if ./b already
- exists. */
- *new_dst = 1;
-- new->is_new_dir = 1;
+ make_dir_parents_private creates only e_dir/../a if
+ ./b already exists. */
+ *new_dst = true;
+- new->is_new_dir = true;
+
+ if ((*xstat) (src, &stats))
+ {
@@ -435,22 +434,22 @@
+ }
+ mode = stats.st_mode;
+
- if (mkdir (dirpath, mode))
+ if (mkdir (dir, mode))
{
error (0, errno, _("cannot make directory %s"),
-@@ -429,6 +447,46 @@
+@@ -424,6 +442,46 @@
if (verbose_fmt_string != NULL)
- printf (verbose_fmt_string, src, dirpath);
+ printf (verbose_fmt_string, src, dir);
}
+
+ /* We need search and write permissions to the new directory
+ for adding the directory's contents. Check if these
+ permissions are already there. */
+
-+ if (lstat (dirpath, &stats))
++ if (lstat (dir, &stats))
+ {
+ error (0, errno, _("failed to get attributes of %s"),
-+ quote (dirpath));
++ quote (dir));
+ return 1;
+ }
+ else
@@ -474,10 +473,10 @@
+ new->mode_valid = 1;
+ }
+
-+ if (chmod (dirpath, stats.st_mode | S_IRWXU))
++ if (chmod (dir, stats.st_mode | S_IRWXU))
+ {
+ error (0, errno, _("setting permissions for %s"),
-+ quote (dirpath));
++ quote (dir));
+ return 1;
+ }
+ }
@@ -485,16 +484,16 @@
}
else if (!S_ISDIR (stats.st_mode))
{
-@@ -438,7 +496,7 @@
+@@ -433,7 +491,7 @@
}
else
{
-- new->is_new_dir = 0;
-+ new->mode_valid = 0;
- *new_dst = 0;
+- new->is_new_dir = false;
++ new->mode_valid = false;
+ *new_dst = false;
}
*slash++ = '/';
-@@ -552,10 +610,6 @@
+@@ -536,10 +594,6 @@
Copy the files `file1' through `filen'
to the existing directory `edir'. */
int i;
@@ -503,24 +502,23 @@
- ? stat
- : lstat);
- for (i = 0; i < n_files; i++)
- {
-@@ -593,11 +647,9 @@
+ /* Initialize these hash tables only if we'll need them.
+ The problems they're used to detect can arise only if
+@@ -585,9 +639,9 @@
leading directories. */
- parent_exists = !make_path_private (dst_path,
- arg_in_concat - dst_path,
-- S_IRWXU,
- (x->verbose
- ? "%s -> %s\n" : NULL),
-- &attr_list, &new_dst,
-- xstat);
-+ &attr_list, &new_dst, x);
+ parent_exists =
+ (make_dir_parents_private
+- (dst_name, arg_in_concat - dst_name, S_IRWXU,
++ (dst_name, arg_in_concat - dst_name,
+ (x->verbose ? "%s -> %s\n" : NULL),
+- &attr_list, &new_dst, xstat));
++ &attr_list, &new_dst, x));
}
else
{
-@@ -731,12 +783,6 @@
+@@ -697,12 +751,6 @@
/* Not used. */
- x->stdin_tty = 0;
+ x->stdin_tty = false;
- /* Find out the current file creation mask, to knock the right bits
- when using chmod. The creation mask is set to be liberal, so
@@ -528,34 +526,34 @@
- have been allowed with the mask this process was started with. */
- x->umask_kill = ~ umask (0);
-
- x->update = 0;
- x->verbose = 0;
+ x->update = false;
+ x->verbose = false;
x->dest_info = NULL;
-@@ -1011,9 +1057,6 @@
+@@ -987,9 +1035,6 @@
version_control_string)
- : none);
+ : no_backups);
-- if (x.preserve_mode == 1)
+- if (x.preserve_mode)
- x.umask_kill = ~ (mode_t) 0;
-
if (x.dereference == DEREF_UNDEFINED)
{
if (x.recursive)
---- coreutils-5.2.1/src/copy.h.acl 2004-02-07 16:00:59.000000000 +0000
-+++ coreutils-5.2.1/src/copy.h 2004-03-13 11:50:03.000000000 +0000
-@@ -143,9 +143,6 @@
+--- coreutils-5.92/src/copy.h.acl 2005-07-03 10:45:51.000000000 +0100
++++ coreutils-5.92/src/copy.h 2005-10-27 11:44:29.000000000 +0100
+@@ -165,9 +165,6 @@
Create destination directories as usual. */
- int symbolic_link;
+ bool symbolic_link;
- /* The bits to preserve in created files' modes. */
- mode_t umask_kill;
-
- /* If nonzero, do not copy a nondirectory that has an existing destination
+ /* If true, do not copy a nondirectory that has an existing destination
with the same or newer modification time. */
- int update;
---- coreutils-5.2.1/src/copy.c.acl 2004-03-12 11:48:59.000000000 +0000
-+++ coreutils-5.2.1/src/copy.c 2004-03-13 11:50:43.000000000 +0000
-@@ -95,26 +95,6 @@
+ bool update;
+--- coreutils-5.92/src/copy.c.acl 2005-09-25 06:57:47.000000000 +0100
++++ coreutils-5.92/src/copy.c 2005-10-27 11:57:41.000000000 +0100
+@@ -101,26 +101,6 @@
/* The invocation name of this program. */
extern char *program_name;
@@ -582,7 +580,53 @@
/* FIXME: describe */
/* FIXME: rewrite this to use a hash table so we avoid the quadratic
performance hit that's probably noticeable only on trees deeper
-@@ -817,13 +797,13 @@
+@@ -460,18 +440,41 @@
+ succeeded, because the chown must have reset those bits. */
+ if (!(*new_dst
+ && !(*chown_succeeded && (src_sb->st_mode & ~S_IRWXUGO)))
+- && (x->preserve_mode || *new_dst)
+ && (x->copy_as_regular || S_ISREG (src_sb->st_mode)))
+ {
+- if (fchmod (dest_desc, get_dest_mode (x, src_sb->st_mode)) != 0)
++ if (x->preserve_mode || x->move_mode)
++ {
++ if (copy_acl (src_name, dst_name, src_sb->st_mode))
++ {
++ error (0, errno, _("preserving ACL for %s"), quote (dst_name));
++ if (x->set_mode || x->require_preserve)
++ {
++ return_val = false;
++ goto close_src_and_dst_desc;
++ }
++ }
++ }
++ else if (x->set_mode)
+ {
+- error (0, errno, _("setting permissions for %s"), quote (dst_name));
+- if (x->set_mode || x->require_preserve)
++ if (set_acl (dst_name, x->mode))
+ {
++ error (0, errno, _("setting ACL for %s"), quote (dst_name));
+ return_val = false;
+ goto close_src_and_dst_desc;
+ }
+ }
++ else if (src_sb->st_mode & (S_ISUID | S_ISGID))
++ {
++ if (fchmod (dest_desc, sb.st_mode | (src_sb->st_mode & (S_ISUID | S_ISGID))) != 0)
++ {
++ error (0, errno, _("setting permissions for %s"), quote (dst_name));
++ if (x->set_mode || x->require_preserve)
++ {
++ return_val = false;
++ goto close_src_and_dst_desc;
++ }
++ }
++ }
+ }
+ #endif
+
+@@ -908,13 +911,14 @@
struct stat src_sb;
struct stat dst_sb;
mode_t src_mode;
@@ -590,16 +634,16 @@
+ mode_t dst_mode;
char *earlier_file = NULL;
char *dst_backup = NULL;
- int backup_succeeded = 0;
- int delayed_fail;
- int copied_as_regular = 0;
-- int ran_chown = 0;
-+ int dst_mode_valid = 0;
- int preserve_metadata;
+ bool backup_succeeded = false;
+ bool delayed_ok;
+ bool copied_as_regular = false;
+ bool chown_succeeded = false;
++ bool dst_mode_valid = 0;
+ bool preserve_metadata;
if (x->move_mode && rename_succeeded)
-@@ -837,11 +817,9 @@
- return 1;
+@@ -928,11 +932,9 @@
+ return false;
}
- src_type = src_sb.st_mode;
@@ -609,9 +653,9 @@
- if (S_ISDIR (src_type) && !x->recursive)
+ if (S_ISDIR (src_mode) && !x->recursive)
{
- error (0, 0, _("omitting directory %s"), quote (src_path));
- return 1;
-@@ -909,7 +887,7 @@
+ error (0, 0, _("omitting directory %s"), quote (src_name));
+ return false;
+@@ -1001,7 +1003,7 @@
if (!S_ISDIR (dst_sb.st_mode))
{
@@ -620,7 +664,7 @@
{
error (0, 0,
_("cannot overwrite non-directory %s with directory %s"),
-@@ -935,7 +913,7 @@
+@@ -1027,7 +1029,7 @@
}
}
@@ -629,7 +673,7 @@
{
if (S_ISDIR (dst_sb.st_mode))
{
-@@ -963,7 +941,7 @@
+@@ -1067,7 +1069,7 @@
This may be due to an interactive `negative' reply to the
prompt about the existing file. It may also be due to the
use of the --reply=no option. */
@@ -638,63 +682,63 @@
{
/* cp and mv treat -i and -f differently. */
if (x->move_mode)
-@@ -1084,7 +1062,7 @@
+@@ -1181,7 +1183,7 @@
/* If the source is a directory, we don't always create the destination
directory. So --verbose should not announce anything until we're
sure we'll create a directory. */
- if (x->verbose && !S_ISDIR (src_type))
+ if (x->verbose && !S_ISDIR (src_mode))
{
- printf ("%s -> %s", quote_n (0, src_path), quote_n (1, dst_path));
+ printf ("%s -> %s", quote_n (0, src_name), quote_n (1, dst_name));
if (backup_succeeded)
-@@ -1132,7 +1110,7 @@
+@@ -1229,7 +1231,7 @@
|| (command_line_arg
&& x->dereference == DEREF_COMMAND_LINE_ARGUMENTS)
|| x->dereference == DEREF_ALWAYS))
- || (x->recursive && S_ISDIR (src_type)))
+ || (x->recursive && S_ISDIR (src_mode)))
{
- earlier_file = remember_copied (dst_path, src_sb.st_ino, src_sb.st_dev);
+ earlier_file = remember_copied (dst_name, src_sb.st_ino, src_sb.st_dev);
}
-@@ -1145,7 +1123,7 @@
- /* Avoid damaging the destination filesystem by refusing to preserve
+@@ -1242,7 +1244,7 @@
+ /* Avoid damaging the destination file system by refusing to preserve
hard-linked directories (which are found at least in Netapp snapshot
directories). */
- if (S_ISDIR (src_type))
+ if (S_ISDIR (src_mode))
{
- /* If src_path and earlier_file refer to the same directory entry,
+ /* If src_name and earlier_file refer to the same directory entry,
then warn about copying a directory into itself. */
-@@ -1197,7 +1175,7 @@
+@@ -1292,7 +1294,7 @@
{
- if (rename (src_path, dst_path) == 0)
+ if (rename (src_name, dst_name) == 0)
{
- if (x->verbose && S_ISDIR (src_type))
+ if (x->verbose && S_ISDIR (src_mode))
- printf ("%s -> %s\n", quote_n (0, src_path), quote_n (1, dst_path));
+ printf ("%s -> %s\n", quote_n (0, src_name), quote_n (1, dst_name));
if (rename_succeeded)
- *rename_succeeded = 1;
-@@ -1310,7 +1288,7 @@
+ *rename_succeeded = true;
+@@ -1405,7 +1407,7 @@
In such cases, set this variable to zero. */
- preserve_metadata = 1;
+ preserve_metadata = true;
- if (S_ISDIR (src_type))
+ if (S_ISDIR (src_mode))
{
struct dir_list *dir;
-@@ -1335,16 +1313,38 @@
+@@ -1430,16 +1432,38 @@
if (new_dst || !S_ISDIR (dst_sb.st_mode))
{
- /* Create the new directory writable and searchable, so
- we can create new entries in it. */
-
-- if (mkdir (dst_path, (src_mode & x->umask_kill) | S_IRWXU))
-+ if (mkdir (dst_path, src_mode))
+- if (mkdir (dst_name, (src_mode & x->umask_kill) | S_IRWXU) != 0)
++ if (mkdir (dst_name, src_mode) != 0)
{
error (0, errno, _("cannot create directory %s"),
- quote (dst_path));
+ quote (dst_name));
goto un_backup;
}
@@ -702,10 +746,10 @@
+ for adding the directory's contents. Check if these permissions
+ are already there. */
+
-+ if (lstat (dst_path, &dst_sb))
++ if (lstat (dst_name, &dst_sb))
+ {
-+ error (0, errno, _("cannot stat %s"), quote (dst_path));
-+ delayed_fail = 1;
++ error (0, errno, _("cannot stat %s"), quote (dst_name));
++ delayed_ok = false;
+ }
+ else if ((dst_sb.st_mode & S_IRWXU) != S_IRWXU)
+ {
@@ -715,10 +759,10 @@
+ dst_mode_valid = 1;
+ dst_mode = dst_sb.st_mode;
+
-+ if (chmod (dst_path, dst_mode | S_IRWXU))
++ if (chmod (dst_name, dst_mode | S_IRWXU))
+ {
+ error (0, errno, _("setting permissions for %s"),
-+ quote (dst_path));
++ quote (dst_name));
+ goto un_backup;
+ }
+ }
@@ -726,24 +770,24 @@
/* Insert the created directory's inode and device
numbers into the search structure, so that we can
avoid copying it again. */
-@@ -1420,23 +1420,22 @@
+@@ -1515,23 +1539,24 @@
goto un_backup;
}
}
- else if (S_ISREG (src_type)
-- || (x->copy_as_regular && !S_ISDIR (src_type)
-- && !S_ISLNK (src_type)))
+- || (x->copy_as_regular && !S_ISLNK (src_type)))
+ else if (S_ISREG (src_mode)
+ || (x->copy_as_regular && !S_ISDIR (src_mode)
+ && !S_ISLNK (src_mode)))
{
- copied_as_regular = 1;
+ copied_as_regular = true;
/* POSIX says the permission bits of the source file must be
used as the 3rd argument in the open call, but that's not consistent
with historical practice. */
-- if (copy_reg (src_path, dst_path, x,
-- get_dest_mode (x, src_mode), &new_dst, &src_sb))
-+ if (copy_reg (src_path, dst_path, x, src_mode, &new_dst, &src_sb))
+ if (! copy_reg (src_name, dst_name, x,
+- get_dest_mode (x, src_mode), &new_dst, &chown_succeeded,
++ src_mode, &new_dst, &chown_succeeded,
+ &src_sb, &dst_sb))
goto un_backup;
}
else
@@ -751,12 +795,12 @@
- if (S_ISFIFO (src_type))
+ if (S_ISFIFO (src_mode))
{
-- if (mkfifo (dst_path, get_dest_mode (x, src_mode)))
-+ if (mkfifo (dst_path, src_mode))
+- if (mkfifo (dst_name, get_dest_mode (x, src_mode)))
++ if (mkfifo (dst_name, src_mode))
{
- error (0, errno, _("cannot create fifo %s"), quote (dst_path));
+ error (0, errno, _("cannot create fifo %s"), quote (dst_name));
goto un_backup;
-@@ -1444,10 +1443,10 @@
+@@ -1539,10 +1564,10 @@
}
else
#endif
@@ -765,25 +809,24 @@
+ if (S_ISBLK (src_mode) || S_ISCHR (src_mode)
+ || S_ISSOCK (src_mode))
{
-- if (mknod (dst_path, get_dest_mode (x, src_mode), src_sb.st_rdev))
-+ if (mknod (dst_path, src_mode, src_sb.st_rdev))
+- if (mknod (dst_name, get_dest_mode (x, src_mode), src_sb.st_rdev))
++ if (mknod (dst_name, src_mode, src_sb.st_rdev))
{
error (0, errno, _("cannot create special file %s"),
- quote (dst_path));
-@@ -1456,7 +1455,7 @@
+ quote (dst_name));
+@@ -1551,7 +1576,7 @@
}
else
#ifdef S_ISLNK
- if (S_ISLNK (src_type))
+ if (S_ISLNK (src_mode))
{
- char *src_link_val = xreadlink (src_path);
+ char *src_link_val = xreadlink (src_name, src_sb.st_size);
if (src_link_val == NULL)
-@@ -1560,7 +1559,25 @@
- if (x->preserve_ownership
+@@ -1654,6 +1679,25 @@
+ if (!(copied_as_regular && HAVE_FCHOWN) && x->preserve_ownership
&& (new_dst || !SAME_OWNER_AND_GROUP (src_sb, dst_sb)))
{
-- ran_chown = 1;
+ /* The chown() system call may clear the SUID and SGID bits, so we
+ need to set them again later. (But we don't care if we will
+ overwrite the permissions of the destination file anyway.) */
@@ -791,10 +834,10 @@
+ if ((src_mode & (S_ISUID | S_ISGID))
+ && !x->preserve_mode && !x->move_mode && !x->set_mode)
+ {
-+ if (lstat (dst_path, &dst_sb))
++ if (lstat (dst_name, &dst_sb))
+ {
-+ error (0, errno, _("cannot stat %s"), quote (dst_path));
-+ delayed_fail = 1;
++ error (0, errno, _("cannot stat %s"), quote (dst_name));
++ delayed_ok = false;
+ }
+ else
+ {
@@ -803,78 +846,80 @@
+ }
+ }
+
- if (DO_CHOWN (chown, dst_path, src_sb.st_uid, src_sb.st_gid))
- {
- error (0, errno, _("failed to preserve ownership for %s"),
-@@ -1587,20 +1604,23 @@
+ if (chown (dst_name, src_sb.st_uid, src_sb.st_gid) == 0)
+ chown_succeeded = true;
+ else if (! chown_failure_ok (x))
+@@ -1682,21 +1726,23 @@
}
#endif
-- /* Permissions of newly-created regular files were set upon `open' in
-- copy_reg. But don't return early if there were any special bits and
-- we had to run chown, because the chown must have reset those bits. */
-- if ((new_dst && copied_as_regular)
-- && !(ran_chown && (src_mode & ~S_IRWXUGO)))
-- return delayed_fail;
+- /* Permissions of newly-created regular files are set by open and/or fchmod
+- in copy_reg. But don't return early if there were any special bits and
+- chown succeeded, because the chown must have reset those bits. */
+- if (copied_as_regular
+- && (HAVE_FCHMOD
+- || (new_dst && !(chown_succeeded && (src_mode & ~S_IRWXUGO)))))
+- return delayed_ok;
-
- if ((x->preserve_mode || new_dst)
- && (x->copy_as_regular || S_ISREG (src_type) || S_ISDIR (src_type)))
+ if (x->preserve_mode || x->move_mode)
{
-- if (chmod (dst_path, get_dest_mode (x, src_mode)))
+- if (chmod (dst_name, get_dest_mode (x, src_mode)) != 0)
- {
-- error (0, errno, _("setting permissions for %s"), quote (dst_path));
+- error (0, errno, _("setting permissions for %s"), quote (dst_name));
- if (x->set_mode || x->require_preserve)
-+ if (copy_acl (src_path, dst_path, src_mode) && x->require_preserve)
-+ return 1;
++ if (copy_acl (src_name, dst_name, src_mode) && x->require_preserve)
++ return false;
+ }
+ else if (x->set_mode)
+ {
-+ if (set_acl (dst_path, x->mode) && x->require_preserve)
-+ return 1;
++ if (set_acl (dst_name, x->mode) && x->require_preserve)
++ return false;
+ }
+ else if (dst_mode_valid)
+ {
-+ if (chmod (dst_path, dst_mode))
++ if (chmod (dst_name, dst_mode))
+ {
+ error (0, errno, _("preserving permissions for %s"),
-+ quote (dst_path));
++ quote (dst_name));
+ if (x->require_preserve)
- return 1;
+ return false;
}
}
---- coreutils-5.2.1/src/Makefile.am.acl 2004-02-02 08:12:57.000000000 +0000
-+++ coreutils-5.2.1/src/Makefile.am 2004-03-13 11:50:03.000000000 +0000
-@@ -32,10 +32,13 @@
- # replacement functions defined in libfetish.a.
- LDADD = ../lib/libfetish.a $(LIBINTL) ../lib/libfetish.a
+--- coreutils-5.92/src/Makefile.am.acl 2005-09-29 11:28:37.000000000 +0100
++++ coreutils-5.92/src/Makefile.am 2005-10-27 11:44:29.000000000 +0100
+@@ -50,9 +50,9 @@
+ LDADD = ../lib/libcoreutils.a $(LIBINTL) ../lib/libcoreutils.a
+
+ # for eaccess in lib/euidaccess.c.
+-cp_LDADD = $(LDADD) $(LIB_EACCESS)
+-ginstall_LDADD = $(LDADD) $(LIB_EACCESS)
+-mv_LDADD = $(LDADD) $(LIB_EACCESS)
++cp_LDADD = $(LDADD) $(LIB_EACCESS) @LIBACL@
++ginstall_LDADD = $(LDADD) $(LIB_EACCESS) @LIBACL@
++mv_LDADD = $(LDADD) $(LIB_EACCESS) @LIBACL@
+ pathchk_LDADD = $(LDADD) $(LIB_EACCESS)
+ rm_LDADD = $(LDADD) $(LIB_EACCESS)
+ test_LDADD = $(LDADD) $(LIB_EACCESS)
+@@ -61,11 +61,11 @@
+ # for clock_gettime and fdatasync
+ dd_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC)
-dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
-ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
+dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBACL@
+ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBACL@
- shred_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
+ pr_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
+ shred_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC)
-vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
+vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) @LIBACL@
-+cp_LDADD = $(LDADD) @LIBACL@
-+ginstall_LDADD = $(LDADD) @LIBACL@
-+mv_LDADD = $(LDADD) @LIBACL@
## If necessary, add -lm to resolve use of pow in lib/strtod.c.
sort_LDADD = $(LDADD) $(POW_LIB)
---- coreutils-5.2.1/configure.ac.acl 2004-03-02 22:47:31.000000000 +0000
-+++ coreutils-5.2.1/configure.ac 2004-03-13 11:50:03.000000000 +0000
-@@ -16,6 +16,9 @@
- AC_PROG_RANLIB
- AC_PROG_LN_S
- AC_CANONICAL_HOST
-+AM_C_PROTOTYPES
-+AC_PROG_YACC
-+AC_SUBST(YACC)
-
-
- AC_CHECK_FUNCS(uname,
-@@ -235,6 +238,8 @@
+--- coreutils-5.92/configure.ac.acl 2005-10-22 19:12:36.000000000 +0100
++++ coreutils-5.92/configure.ac 2005-10-27 11:44:30.000000000 +0100
+@@ -251,6 +251,8 @@
AM_GNU_GETTEXT([external], [need-ngettext])
AM_GNU_GETTEXT_VERSION(0.13.1)
@@ -883,9 +928,9 @@
AC_CONFIG_FILES(
Makefile
doc/Makefile
---- coreutils-5.2.1/config.hin.acl 2004-03-11 08:59:16.000000000 +0000
-+++ coreutils-5.2.1/config.hin 2004-03-13 11:50:03.000000000 +0000
-@@ -96,6 +96,30 @@
+--- coreutils-5.92/config.hin.acl 2005-10-22 19:14:08.000000000 +0100
++++ coreutils-5.92/config.hin 2005-10-27 11:44:30.000000000 +0100
+@@ -101,6 +101,30 @@
/* Define to 1 if you have the `acl' function. */
#undef HAVE_ACL
@@ -916,7 +961,7 @@
/* Define to 1 if you have the `alarm' function. */
#undef HAVE_ALARM
-@@ -489,6 +513,9 @@
+@@ -589,6 +613,9 @@
/* Define to 1 if you have the `lchown' function. */
#undef HAVE_LCHOWN
@@ -926,9 +971,9 @@
/* Define to 1 if you have the `dgc' library (-ldgc). */
#undef HAVE_LIBDGC
-@@ -1335,6 +1362,9 @@
- <sys/cpustats.h>. */
- #undef UMAX4_3
+@@ -1496,6 +1523,9 @@
+ safe for multithreaded apps. */
+ #undef USE_UNLOCKED_IO
+/* Define if you want access control list support. */
+#undef USE_ACL
@@ -936,17 +981,17 @@
/* Version number of package */
#undef VERSION
---- coreutils-5.2.1/NEWS.acl 2004-03-12 19:04:30.000000000 +0000
-+++ coreutils-5.2.1/NEWS 2004-03-13 11:50:03.000000000 +0000
+--- coreutils-5.92/NEWS.acl 2005-10-22 19:11:56.000000000 +0100
++++ coreutils-5.92/NEWS 2005-10-27 11:44:30.000000000 +0100
@@ -1,3 +1,6 @@
+[4.5.3acl]
+* ACL framework and Linux ACL support.
+* `cp -p' and `mv' now preserve ACLs
GNU coreutils NEWS -*- outline -*-
- * Major changes in release 5.2.1 (2004-03-12) [stable]
---- coreutils-5.2.1/ChangeLog.acl 2004-03-12 19:03:44.000000000 +0000
-+++ coreutils-5.2.1/ChangeLog 2004-03-13 11:50:03.000000000 +0000
+ * Major changes in release 5.92 (2005-10-22) [stable]
+--- coreutils-5.92/ChangeLog.acl 2005-10-22 19:12:51.000000000 +0100
++++ coreutils-5.92/ChangeLog 2005-10-27 11:44:30.000000000 +0100
@@ -0,0 +1,45 @@
+2002-07-01 Bernhard Rosenkraenzer <bero at bero.org>
+ * Port the following patch to 4.1.9:
coreutils-getgrouplist.patch:
lib/getugroups.c | 4 ++++
m4/jm-macros.m4 | 1 +
src/id.c | 26 ++++++++++++++++++++++++--
3 files changed, 29 insertions(+), 2 deletions(-)
Index: coreutils-getgrouplist.patch
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/coreutils-getgrouplist.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- coreutils-getgrouplist.patch 5 Oct 2004 15:45:31 -0000 1.1
+++ coreutils-getgrouplist.patch 27 Oct 2005 15:05:08 -0000 1.2
@@ -1,16 +1,16 @@
---- coreutils-5.2.1/m4/jm-macros.m4.getgrouplist 2003-12-20 17:57:18.000000000 +0000
-+++ coreutils-5.2.1/m4/jm-macros.m4 2004-10-05 12:43:14.975401711 +0100
-@@ -83,6 +83,7 @@
- endpwent \
- fdatasync \
+--- coreutils-5.92/m4/jm-macros.m4.getgrouplist 2005-09-25 06:57:46.000000000 +0100
++++ coreutils-5.92/m4/jm-macros.m4 2005-10-25 14:28:45.000000000 +0100
+@@ -105,6 +105,7 @@
+ fchmod \
+ fchown \
ftruncate \
+ getgrouplist \
- gethrtime \
hasmntopt \
isascii \
---- coreutils-5.2.1/lib/getugroups.c.getgrouplist 2003-09-10 07:23:09.000000000 +0100
-+++ coreutils-5.2.1/lib/getugroups.c 2004-10-05 12:43:14.980400761 +0100
-@@ -21,6 +21,9 @@
+ iswspace \
+--- coreutils-5.92/lib/getugroups.c.getgrouplist 2005-09-22 07:47:18.000000000 +0100
++++ coreutils-5.92/lib/getugroups.c 2005-10-25 14:28:02.000000000 +0100
+@@ -23,6 +23,9 @@
# include <config.h>
#endif
@@ -20,15 +20,15 @@
#include <sys/types.h>
#include <stdio.h> /* grp.h on alpha OSF1 V2.0 uses "FILE *". */
#include <grp.h>
-@@ -95,3 +98,4 @@
+@@ -105,3 +108,4 @@
return count;
}
+#endif /* have getgrouplist */
---- coreutils-5.2.1/src/id.c.getgrouplist 2004-10-05 12:26:40.222539037 +0100
-+++ coreutils-5.2.1/src/id.c 2004-10-05 12:43:14.986399620 +0100
-@@ -316,14 +316,36 @@
- if (username == 0)
+--- coreutils-5.92/src/id.c.getgrouplist 2005-08-11 22:02:57.000000000 +0100
++++ coreutils-5.92/src/id.c 2005-10-25 14:30:41.000000000 +0100
+@@ -253,7 +253,14 @@
+ if (!username)
max_n_groups = getgroups (0, NULL);
else
- max_n_groups = getugroups (0, NULL, username, gid);
@@ -41,28 +41,29 @@
+#endif
+ }
- /* Add 1 just in case max_n_groups is zero. */
- g = xmalloc (max_n_groups * sizeof (GETGROUPS_T) + 1);
- if (username == 0)
- ng = getgroups (max_n_groups, g);
- else
-- ng = getugroups (max_n_groups, g, username, gid);
-+ {
-+#ifdef HAVE_GETGROUPLIST
-+ int e;
-+ ng = max_n_groups;
-+ while ((e = getgrouplist (username, gid, g, &ng)) == -1
-+ && ng > max_n_groups)
+ if (max_n_groups < 0)
+ ng = -1;
+@@ -263,7 +270,22 @@
+ if (!username)
+ ng = getgroups (max_n_groups, g);
+ else
+- ng = getugroups (max_n_groups, g, username, gid);
+ {
-+ max_n_groups = ng;
-+ g = xrealloc (g, max_n_groups * sizeof (GETGROUPS_T));
-+ }
-+ if (e == -1)
-+ ng = -1;
++#ifdef HAVE_GETGROUPLIST
++ int e;
++ ng = max_n_groups;
++ while ((e = getgrouplist (username, gid, g, &ng)) == -1
++ && ng > max_n_groups)
++ {
++ max_n_groups = ng;
++ g = xrealloc (g, max_n_groups * sizeof (GETGROUPS_T));
++ }
++ if (e == -1)
++ ng = -1;
+#else
-+ ng = getugroups (max_n_groups, g, username, gid);
++ ng = getugroups (max_n_groups, g, username, gid);
+#endif
-+ }
++ }
+ }
if (ng < 0)
- {
coreutils-i18n.patch:
lib/linebuffer.h | 8
src/cut.c | 420 +++++++++++++++++++++++++++++++++++++++++++--
src/expand.c | 161 +++++++++++++++++
src/fold.c | 317 +++++++++++++++++++++++++++++++---
src/join.c | 348 ++++++++++++++++++++++++++++++++-----
src/pr.c | 431 ++++++++++++++++++++++++++++++++++++++++++-----
src/unexpand.c | 226 ++++++++++++++++++++++++
src/uniq.c | 259 +++++++++++++++++++++++++++-
tests/sort/Makefile.am | 8
tests/sort/Makefile.in | 8
tests/sort/mb1.I | 4
tests/sort/mb1.X | 4
tests/sort/mb2.I | 4
tests/sort/mb2.X | 4
tests/sort/sort-mb-tests | 58 ++++++
15 files changed, 2101 insertions(+), 159 deletions(-)
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.10 -r 1.11 coreutils-i18n.patch
Index: coreutils-i18n.patch
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/coreutils-i18n.patch,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- coreutils-i18n.patch 9 Feb 2005 13:32:52 -0000 1.10
+++ coreutils-i18n.patch 27 Oct 2005 15:05:08 -0000 1.11
@@ -1,5 +1,5 @@
---- coreutils-5.1.3/lib/linebuffer.h.i18n 2003-06-18 07:58:01.000000000 +0100
-+++ coreutils-5.1.3/lib/linebuffer.h 2004-02-16 15:36:40.000000000 +0000
+--- coreutils-5.92/lib/linebuffer.h.i18n 2005-05-14 08:58:06.000000000 +0100
++++ coreutils-5.92/lib/linebuffer.h 2005-10-26 22:17:04.000000000 +0100
@@ -22,6 +22,11 @@
# include <stdio.h>
@@ -22,8 +22,8 @@
};
/* Initialize linebuffer LINEBUFFER for use. */
---- coreutils-5.1.3/src/cut.c.i18n 2004-01-21 22:27:02.000000000 +0000
-+++ coreutils-5.1.3/src/cut.c 2004-02-16 15:45:41.000000000 +0000
+--- coreutils-5.92/src/cut.c.i18n 2005-08-12 09:28:48.000000000 +0100
++++ coreutils-5.92/src/cut.c 2005-10-26 22:17:04.000000000 +0100
@@ -29,6 +29,11 @@
#include <assert.h>
#include <getopt.h>
@@ -56,7 +56,7 @@
#define PROGRAM_NAME "cut"
@@ -67,6 +84,52 @@
- } \
+ } \
while (0)
+/* Refill the buffer BUF to get a multibyte character. */
@@ -159,7 +159,7 @@
/* If true do not output lines containing no delimeter characters.
Otherwise, all such lines are printed. This option is valid only
with field mode. */
-@@ -128,6 +202,9 @@
+@@ -132,6 +206,9 @@
/* The delimeter character for field mode. */
static unsigned char delim;
@@ -169,16 +169,16 @@
/* True if the --output-delimiter=STRING option was specified. */
static bool output_delimiter_specified;
-@@ -199,7 +276,7 @@
- -f, --fields=LIST output only these fields; also print any line\n\
+@@ -205,7 +282,7 @@
+ -f, --fields=LIST select only these fields; also print any line\n\
that contains no delimiter character, unless\n\
the -s option is specified\n\
- -n (ignored)\n\
+ -n with -b: don't split multibyte characters\n\
"), stdout);
fputs (_("\
- -s, --only-delimited do not print lines not containing delimiters\n\
-@@ -327,7 +404,7 @@
+ --complement complement the set of selected bytes, characters\n\
+@@ -360,7 +437,7 @@
in_digits = false;
/* Starting a range. */
if (dash_found)
@@ -187,7 +187,7 @@
dash_found = true;
fieldstr++;
-@@ -352,14 +429,16 @@
+@@ -385,14 +462,16 @@
if (value == 0)
{
/* `n-'. From `initial' to end of line. */
@@ -206,7 +206,7 @@
/* Is there already a range going to end of line? */
if (eol_range_start != 0)
-@@ -434,6 +513,9 @@
+@@ -465,6 +544,9 @@
if (operating_mode == byte_mode)
error (0, 0,
_("byte offset %s is too large"), quote (bad_num));
@@ -216,7 +216,7 @@
else
error (0, 0,
_("field number %s is too large"), quote (bad_num));
-@@ -445,7 +527,7 @@
+@@ -475,7 +557,7 @@
fieldstr++;
}
else
@@ -225,16 +225,7 @@
}
max_range_endpoint = 0;
-@@ -515,7 +597,7 @@
- print_delimiter = false;
- while (1)
- {
-- register int c; /* Each character from the file. */
-+ int c; /* Each character from the file. */
-
- c = getc (stream);
-
-@@ -549,6 +631,63 @@
+@@ -568,6 +650,63 @@
}
}
@@ -298,7 +289,7 @@
/* Read from stream STREAM, printing to standard output any selected fields. */
static void
-@@ -669,13 +808,192 @@
+@@ -689,13 +828,192 @@
}
}
@@ -494,8 +485,8 @@
}
/* Process file FILE to standard output.
-@@ -724,6 +1042,8 @@
- int optc, exit_status = 0;
+@@ -745,6 +1063,8 @@
+ bool ok;
bool delim_specified = false;
char *spec_list_string IF_LINT(= NULL);
+ char mbdelim[MB_LEN_MAX + 1];
@@ -503,15 +494,15 @@
initialize_main (&argc, &argv);
program_name = argv[0];
-@@ -749,7 +1069,6 @@
- break;
-
+@@ -767,7 +1087,6 @@
+ switch (optc)
+ {
case 'b':
- case 'c':
/* Build the byte list. */
if (operating_mode != undefined_mode)
FATAL_ERROR (_("only one type of list may be specified"));
-@@ -757,6 +1076,14 @@
+@@ -775,6 +1094,14 @@
spec_list_string = optarg;
break;
@@ -526,7 +517,7 @@
case 'f':
/* Build the field list. */
if (operating_mode != undefined_mode)
-@@ -768,10 +1095,35 @@
+@@ -786,10 +1113,35 @@
case 'd':
/* New delimiter. */
/* Interpret -d '' to mean `use the NUL byte as the delimiter.' */
@@ -566,7 +557,7 @@
break;
case OUTPUT_DELIMITER_OPTION:
-@@ -784,6 +1136,7 @@
+@@ -802,6 +1154,7 @@
break;
case 'n':
@@ -574,7 +565,7 @@
break;
case 's':
-@@ -802,7 +1155,7 @@
+@@ -824,7 +1177,7 @@
if (operating_mode == undefined_mode)
FATAL_ERROR (_("you must specify a list of bytes, characters, or fields"));
@@ -583,7 +574,7 @@
FATAL_ERROR (_("an input delimiter may be specified only\
when operating on fields"));
-@@ -829,15 +1182,34 @@
+@@ -851,15 +1204,34 @@
}
if (!delim_specified)
@@ -624,10 +615,10 @@
}
if (optind == argc)
---- coreutils-5.1.3/src/pr.c.i18n 2004-01-21 22:27:02.000000000 +0000
-+++ coreutils-5.1.3/src/pr.c 2004-02-16 15:36:40.000000000 +0000
-@@ -314,12 +314,50 @@
- #include <stdio.h>
+--- coreutils-5.92/src/pr.c.i18n 2005-09-16 08:51:01.000000000 +0100
++++ coreutils-5.92/src/pr.c 2005-10-26 22:17:04.000000000 +0100
+@@ -313,6 +313,32 @@
+
#include <getopt.h>
[...2136 lines suppressed...]
++ error (EXIT_FAILURE, 0, _("incompatible tabs"));
+ }
+- if (0 <= tab && tab != newtab)
+- error (EXIT_FAILURE, 0, _("incompatible tabs"));
+ tab = newtab;
++ tablen = newtablen;
+ }
break;
- case 1: /* Non-option argument. */
---- coreutils-5.1.3/src/unexpand.c.i18n 2004-01-21 22:27:02.000000000 +0000
-+++ coreutils-5.1.3/src/unexpand.c 2004-02-16 15:36:40.000000000 +0000
-@@ -40,10 +40,27 @@
+--- coreutils-5.92/src/unexpand.c.i18n 2005-08-12 09:28:48.000000000 +0100
++++ coreutils-5.92/src/unexpand.c 2005-10-26 22:18:37.000000000 +0100
+@@ -39,11 +39,28 @@
#include <stdio.h>
#include <getopt.h>
#include <sys/types.h>
@@ -3854,7 +2824,8 @@
+
#include "system.h"
#include "error.h"
- #include "posixver.h"
+ #include "quote.h"
+ #include "xstrndup.h"
+/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
+ installation; work around this configuration error. */
@@ -3870,20 +2841,12 @@
/* The official name of this program (e.g., no `g' prefix). */
#define PROGRAM_NAME "unexpand"
-@@ -348,7 +365,8 @@
- }
- else
- {
-- ++column;
-+ if (!ISCNTRL (c))
-+ ++column;
- if (convert_entire_line == 0)
- convert = 0;
- }
-@@ -366,6 +384,210 @@
- }
- }
+@@ -110,6 +127,208 @@
+ {NULL, 0, NULL, 0}
+ };
++static FILE *next_file (FILE *fp);
++
+#if HAVE_MBRTOWC
+static void
+unexpand_multibyte (void)
@@ -3911,9 +2874,6 @@
+ if (fp == NULL)
+ return;
+
-+ /* Binary I/O will preserve the original EOL style (DOS/Unix) of files. */
-+ SET_BINARY2 (fileno (fp), STDOUT_FILENO);
-+
+ memset (&o_state, '\0', sizeof(mbstate_t));
+ memset (&i_state, '\0', sizeof(mbstate_t));
+
@@ -3944,7 +2904,7 @@
+ wc = L'\0';
+ }
+
-+ if (wc == L' ' && convert && column < TAB_STOP_SENTINEL)
++ if (wc == L' ' && convert && column < INT_MAX)
+ {
+ ++pending;
+ ++column;
@@ -4029,7 +2989,6 @@
+ else
+ {
+ memset (&i_state, '\0', sizeof(mbstate_t));
-+ SET_BINARY2 (fileno (fp), STDOUT_FILENO);
+ continue;
+ }
+ }
@@ -4091,7 +3050,7 @@
void
usage (int status)
{
-@@ -488,7 +710,12 @@
+@@ -532,7 +751,12 @@
file_list = (optind < argc ? &argv[optind] : stdin_argv);
@@ -4103,10 +3062,10 @@
+#endif
+ unexpand ();
- if (have_read_stdin && fclose (stdin) == EOF)
+ if (have_read_stdin && fclose (stdin) != 0)
error (EXIT_FAILURE, errno, "-");
---- coreutils-5.2.1/tests/sort/sort-mb-tests.jj 2005-02-09 07:34:40.000000000 -0500
-+++ coreutils-5.2.1/tests/sort/sort-mb-tests 2005-02-09 07:34:40.000000000 -0500
+--- /dev/null 2005-10-10 09:36:06.437701000 +0100
++++ coreutils-5.92/tests/sort/sort-mb-tests 2005-10-26 22:17:04.000000000 +0100
@@ -0,0 +1,58 @@
+#! /bin/sh
+case $# in
@@ -4166,37 +3125,37 @@
+fi
+test $errors = 0 || errors=1
+exit $errors
---- coreutils-5.2.1/tests/sort/mb1.I.jj 2005-02-09 07:34:40.000000000 -0500
-+++ coreutils-5.2.1/tests/sort/mb1.I 2005-02-09 07:34:40.000000000 -0500
+--- /dev/null 2005-10-10 09:36:06.437701000 +0100
++++ coreutils-5.92/tests/sort/mb1.I 2005-10-26 22:17:04.000000000 +0100
@@ -0,0 +1,4 @@
+Appleï¼ 10
+Bananaï¼ 5
+Citrusï¼ 20
+Cherryï¼ 30
---- coreutils-5.2.1/tests/sort/mb2.I.jj 2005-02-09 07:34:40.000000000 -0500
-+++ coreutils-5.2.1/tests/sort/mb2.I 2005-02-09 07:34:40.000000000 -0500
+--- /dev/null 2005-10-10 09:36:06.437701000 +0100
++++ coreutils-5.92/tests/sort/mb2.I 2005-10-26 22:17:04.000000000 +0100
@@ -0,0 +1,4 @@
+Appleï¼ ï¼¡ï¼¡10ï¼ ï¼ 20
+Bananaï¼ ï¼¡ï¼¡5ï¼ ï¼ 30
+Citrusï¼ ï¼¡ï¼¡20ï¼ ï¼ 5
+Cherryï¼ ï¼¡ï¼¡30ï¼ ï¼ 10
---- coreutils-5.2.1/tests/sort/mb1.X.jj 2005-02-09 07:34:40.000000000 -0500
-+++ coreutils-5.2.1/tests/sort/mb1.X 2005-02-09 07:34:40.000000000 -0500
+--- /dev/null 2005-10-10 09:36:06.437701000 +0100
++++ coreutils-5.92/tests/sort/mb1.X 2005-10-26 22:17:04.000000000 +0100
@@ -0,0 +1,4 @@
+Bananaï¼ 5
+Appleï¼ 10
+Citrusï¼ 20
+Cherryï¼ 30
---- coreutils-5.2.1/tests/sort/mb2.X.jj 2005-02-09 07:34:40.000000000 -0500
-+++ coreutils-5.2.1/tests/sort/mb2.X 2005-02-09 07:34:40.000000000 -0500
+--- /dev/null 2005-10-10 09:36:06.437701000 +0100
++++ coreutils-5.92/tests/sort/mb2.X 2005-10-26 22:17:04.000000000 +0100
@@ -0,0 +1,4 @@
+Citrusï¼ ï¼¡ï¼¡20ï¼ ï¼ 5
+Cherryï¼ ï¼¡ï¼¡30ï¼ ï¼ 10
+Appleï¼ ï¼¡ï¼¡10ï¼ ï¼ 20
+Bananaï¼ ï¼¡ï¼¡5ï¼ ï¼ 30
---- coreutils-5.2.1/tests/sort/Makefile.am.jj 2004-02-11 06:54:14.000000000 -0500
-+++ coreutils-5.2.1/tests/sort/Makefile.am 2005-02-09 07:36:20.000000000 -0500
-@@ -43,12 +43,14 @@ o-no-file1.E create-empty.O create-empty
+--- coreutils-5.92/tests/sort/Makefile.am.i18n 2005-06-23 17:32:54.000000000 +0100
++++ coreutils-5.92/tests/sort/Makefile.am 2005-10-26 22:17:04.000000000 +0100
+@@ -43,14 +43,16 @@
nul-nls.E use-nl.O use-nl.E o2.O o2.E nul-tab.O nul-tab.E
##test-files-end
@@ -4205,30 +3164,35 @@
+run_gen += mb1.O mb2.O
+
+EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) mb1.I mb1.X mb2.I mb2.X
-+noinst_SCRIPTS = $x-tests $x-mb-tests
++noinst_SCRIPTS = $x-tests # $x-mb-tests
+ TESTS_ENVIRONMENT = \
+ PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
-TESTS = $x-tests
-+TESTS = $x-tests $x-mb-tests
++TESTS = $x-tests # $x-mb-tests
mk_script = $(srcdir)/../mk-script
- $(srcdir)/$x-tests: $(mk_script) Test.pm
---- coreutils-5.2.1/tests/sort/Makefile.in.jj 2004-03-11 03:58:06.000000000 -0500
-+++ coreutils-5.2.1/tests/sort/Makefile.in 2005-02-09 07:36:50.000000000 -0500
-@@ -301,10 +301,13 @@ n10b.E n11a.O n11a.E n11b.O n11b.E 01a.O
+ $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am
+--- coreutils-5.92/tests/sort/Makefile.in.i18n 2005-10-22 19:13:23.000000000 +0100
++++ coreutils-5.92/tests/sort/Makefile.in 2005-10-26 22:17:04.000000000 +0100
+@@ -338,13 +338,15 @@
o-no-file1.E create-empty.O create-empty.E neg-nls.O neg-nls.E nul-nls.O \
nul-nls.E use-nl.O use-nl.E o2.O o2.E nul-tab.O nul-tab.E
+-EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
+-noinst_SCRIPTS = $x-tests
+run_gen += mb1.O mb2.O
+
+EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) mb1.I mb1.X mb2.I mb2.X
- EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
--noinst_SCRIPTS = $x-tests
-+noinst_SCRIPTS = $x-tests $x-mb-tests
++noinst_SCRIPTS = $x-tests # $x-mb-tests
+ TESTS_ENVIRONMENT = \
+ PATH="`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
+
editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
-TESTS = $x-tests
-+TESTS = $x-tests $x-mb-tests
++TESTS = $x-tests # $x-mb-tests
mk_script = $(srcdir)/../mk-script
MAINTAINERCLEANFILES = $x-tests $(maint_gen)
CLEANFILES = $(run_gen)
coreutils-pam.patch:
config.hin | 3
configure.ac | 7 +
doc/coreutils.texi | 34 +-------
src/Makefile.am | 2
src/su.c | 218 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
5 files changed, 230 insertions(+), 34 deletions(-)
Index: coreutils-pam.patch
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/coreutils-pam.patch,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- coreutils-pam.patch 20 May 2005 12:10:24 -0000 1.6
+++ coreutils-pam.patch 27 Oct 2005 15:05:08 -0000 1.7
@@ -1,16 +1,16 @@
---- coreutils-5.2.1/src/Makefile.am.pam 2005-04-15 17:03:44.000000000 +0100
-+++ coreutils-5.2.1/src/Makefile.am 2005-04-15 17:03:44.000000000 +0100
-@@ -66,7 +66,7 @@
+--- coreutils-5.92/src/Makefile.am.pam 2005-10-24 17:58:21.000000000 +0100
++++ coreutils-5.92/src/Makefile.am 2005-10-24 17:58:21.000000000 +0100
+@@ -93,7 +93,7 @@
uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS)
-su_LDADD = $(LDADD) $(LIB_CRYPT)
+su_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
- $(PROGRAMS): ../lib/libfetish.a
+ $(PROGRAMS): ../lib/libcoreutils.a
---- coreutils-5.2.1/src/su.c.pam 2005-04-15 17:03:44.000000000 +0100
-+++ coreutils-5.2.1/src/su.c 2005-04-15 17:04:52.000000000 +0100
+--- coreutils-5.92/src/su.c.pam 2005-10-24 17:58:21.000000000 +0100
++++ coreutils-5.92/src/su.c 2005-10-24 18:06:22.000000000 +0100
@@ -38,6 +38,16 @@
restricts who can su to UID 0 accounts. RMS considers that to
be fascist.
@@ -54,21 +54,22 @@
char *getpass ();
char *getusershell ();
void endusershell ();
-@@ -158,8 +179,12 @@
+@@ -158,8 +179,13 @@
extern char **environ;
--static void run_shell (const char *, const char *, char **)
-+static void run_shell (const char *, const char *, char **, const struct passwd *)
+-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
/* The name this program was run with. */
char *program_name;
-@@ -271,7 +296,22 @@
+@@ -248,7 +274,22 @@
}
#endif
@@ -88,11 +89,11 @@
+
/* Ask the user for a password.
+ If PAM is in use, let PAM ask for the password if necessary.
- Return 1 if the user gives the correct password for entry PW,
- 0 if not. Return 1 without asking for a password if run by UID 0
+ 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. */
-@@ -279,6 +319,44 @@
- static int
+@@ -256,6 +297,44 @@
+ static bool
correct_password (const struct passwd *pw)
{
+#ifdef USE_PAM
@@ -136,41 +137,34 @@
char *unencrypted, *encrypted, *correct;
#if HAVE_GETSPNAM && HAVE_STRUCT_SPWD_SP_PWDP
/* Shadow passwd stuff for SVR3 and maybe other systems. */
-@@ -303,6 +381,7 @@
+@@ -280,6 +359,7 @@
encrypted = crypt (unencrypted, correct);
memset (unencrypted, 0, strlen (unencrypted));
- return strcmp (encrypted, correct) == 0;
+ return STREQ (encrypted, correct);
+#endif /* !USE_PAM */
}
/* Update `environ' for the new shell based on PW, with SHELL being
-@@ -312,16 +391,24 @@
- modify_environment (const struct passwd *pw, const char *shell)
- {
- char *term;
-+ char *display;
-+ char *xauthority;
-
- if (simulate_login)
- {
-- /* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH.
-+ /* Leave TERM, DISPLAY, XAUTHORITY unchanged. Set HOME, SHELL, USER, LOGNAME, PATH.
+@@ -293,12 +373,18 @@
+ /* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH.
Unset all other environment variables. */
- term = getenv ("TERM");
-+ display = getenv ("DISPLAY");
-+ xauthority = getenv ("XAUTHORITY");
- environ = xmalloc (2 * sizeof (char *));
- environ[0] = 0;
+ 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)
- xputenv (concat ("TERM", "=", term));
+ xsetenv ("TERM", term);
+ if (display)
-+ xputenv (concat ("DISPLAY", "=", display));
++ xsetenv ("DISPLAY", display);
+ if (xauthority)
-+ xputenv (concat ("XAUTHORITY", "=", xauthority));
- xputenv (concat ("HOME", "=", pw->pw_dir));
- xputenv (concat ("SHELL", "=", shell));
- xputenv (concat ("USER", "=", pw->pw_name));
-@@ -354,8 +441,13 @@
++ xsetenv ("XAUTHORITY", xauthority);
+ xsetenv ("HOME", pw->pw_dir);
+ xsetenv ("SHELL", shell);
+ xsetenv ("USER", pw->pw_name);
+@@ -331,8 +417,13 @@
{
#ifdef HAVE_INITGROUPS
errno = 0;
@@ -185,7 +179,7 @@
endgrent ();
#endif
if (setgid (pw->pw_gid))
-@@ -364,16 +456,69 @@
+@@ -341,6 +432,31 @@
error (EXIT_FAIL, errno, _("cannot set user id"));
}
@@ -205,7 +199,8 @@
+ env = pam_getenvlist(pamh);
+ if(env) {
+ while(*env) {
-+ xputenv(*env);
++ if (putenv (*env))
++ xalloc_die ();
+ env++;
+ }
+ }
@@ -215,15 +210,17 @@
+
/* Run SHELL, or DEFAULT_SHELL if SHELL is empty.
If COMMAND is nonzero, pass it to the shell with the -c option.
- If ADDITIONAL_ARGS is nonzero, pass it to the shell as more
- arguments. */
+ Pass ADDITIONAL_ARGS to the shell as more arguments; there
+@@ -348,17 +464,49 @@
static void
--run_shell (const char *shell, const char *command, char **additional_args)
-+run_shell (const char *shell, const char *command, char **additional_args, const struct passwd *pw)
+ 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)
{
- const char **args;
- int argno = 1;
+ 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;
@@ -254,9 +251,8 @@
+ pam_end(pamh, 0);
+#endif
- if (additional_args)
- args = xmalloc (sizeof (char *)
-@@ -385,6 +530,9 @@
+ if (simulate_login)
+ {
char *arg0;
char *shell_basename;
@@ -266,7 +262,7 @@
shell_basename = base_name (shell);
arg0 = xmalloc (strlen (shell_basename) + 2);
arg0[0] = '-';
-@@ -411,6 +559,66 @@
+@@ -383,6 +531,66 @@
error (0, errno, "%s", shell);
exit (exit_status);
}
@@ -332,24 +328,23 @@
+#endif /* USE_PAM */
}
- /* Return 1 if SHELL is a restricted shell (one not returned by
-@@ -586,9 +794,10 @@
- }
+ /* Return true if SHELL is a restricted shell (one not returned by
+@@ -550,9 +758,11 @@
+ shell = xstrdup (shell ? shell : pw->pw_shell);
modify_environment (pw, shell);
-+
+#ifndef USE_PAM
change_identity (pw);
-- if (simulate_login && chdir (pw->pw_dir))
-- error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
+#endif
+ if (simulate_login && chdir (pw->pw_dir) != 0)
+ error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
-- run_shell (shell, command, additional_args);
-+ run_shell (shell, command, additional_args, pw);
+- run_shell (shell, command, argv + optind, MAX (0, argc - optind));
++ run_shell (shell, command, argv + optind, MAX (0, argc - optind), pw);
}
---- coreutils-5.2.1/doc/coreutils.texi.pam 2005-04-15 17:03:44.000000000 +0100
-+++ coreutils-5.2.1/doc/coreutils.texi 2005-04-15 17:03:44.000000000 +0100
-@@ -11850,8 +11850,11 @@
+--- coreutils-5.92/doc/coreutils.texi.pam 2005-10-16 08:26:21.000000000 +0100
++++ coreutils-5.92/doc/coreutils.texi 2005-10-24 17:58:21.000000000 +0100
+@@ -12746,8 +12746,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
@@ -363,7 +358,7 @@
The program accepts the following options. Also see @ref{Common options}.
-@@ -11932,33 +11935,6 @@
+@@ -12828,33 +12831,6 @@
the exit status of the subshell otherwise
@end display
@@ -397,11 +392,11 @@
@node Process control
@chapter Process control
---- coreutils-5.2.1/configure.ac.pam 2005-04-15 17:03:44.000000000 +0100
-+++ coreutils-5.2.1/configure.ac 2005-04-15 17:03:44.000000000 +0100
-@@ -7,6 +7,13 @@
-
- AM_INIT_AUTOMAKE([1.8 gnits dist-bzip2])
+--- coreutils-5.92/configure.ac.pam 2005-10-24 17:58:21.000000000 +0100
++++ coreutils-5.92/configure.ac 2005-10-24 17:58:21.000000000 +0100
+@@ -28,6 +28,13 @@
+ AB_INIT()
+ AM_INIT_AUTOMAKE([1.8.3 gnits dist-bzip2])
+dnl Give the chance to enable PAM
+AC_ARG_ENABLE(pam, dnl
@@ -412,10 +407,10 @@
+
gl_DEFAULT_POSIX2_VERSION
gl_USE_SYSTEM_EXTENSIONS
- jm_PERL
---- coreutils-5.2.1/config.hin.pam 2005-04-15 17:03:44.000000000 +0100
-+++ coreutils-5.2.1/config.hin 2005-04-15 17:03:44.000000000 +0100
-@@ -1365,6 +1365,9 @@
+ gl_PERL
+--- coreutils-5.92/config.hin.pam 2005-10-24 17:58:21.000000000 +0100
++++ coreutils-5.92/config.hin 2005-10-24 17:58:21.000000000 +0100
+@@ -1526,6 +1526,9 @@
/* Define if you want access control list support. */
#undef USE_ACL
coreutils-selinux.patch:
README | 4
config.hin | 27 +--
configure.ac | 7
man/Makefile.am | 4
man/Makefile.in | 56 +++----
man/chcon.1 | 64 ++++++++
man/chcon.x | 4
man/cp.1 | 5
man/dir.1 | 14 +
man/id.1 | 3
man/install.1 | 5
man/ls.1 | 14 +
man/mkdir.1 | 2
man/mkfifo.1 | 3
man/mknod.1 | 3
man/runcon.1 | 43 +++++
man/runcon.x | 14 +
man/stat.1 | 6
man/vdir.1 | 14 +
src/Makefile.am | 23 +-
src/chcon.c | 421 +++++++++++++++++++++++++++++++++++++++++++++++++++++
src/copy.c | 49 ++++++
src/copy.h | 3
src/cp.c | 64 +++++++-
src/id.c | 68 ++++++++
src/install.c | 99 ++++++++++++
src/ls.c | 309 ++++++++++++++++++++++++++++++++++----
src/mkdir.c | 30 +++
src/mkfifo.c | 29 +++
src/mknod.c | 30 +++
src/mv.c | 12 +
src/runcon.c | 253 +++++++++++++++++++++++++++++++
src/stat.c | 142 ++++++++++++++---
tests/help-version | 4
34 files changed, 1704 insertions(+), 124 deletions(-)
View full diff with command:
/usr/bin/cvs -f diff -kk -u -N -r 1.16 -r 1.17 coreutils-selinux.patch
Index: coreutils-selinux.patch
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/coreutils-selinux.patch,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- coreutils-selinux.patch 9 Sep 2005 13:54:03 -0000 1.16
+++ coreutils-selinux.patch 27 Oct 2005 15:05:08 -0000 1.17
@@ -1,22 +1,5 @@
-unchanged:
---- coreutils-5.2.1/README.selinux 2004-12-29 12:24:03.260876459 -0500
-+++ coreutils-5.2.1/README 2004-12-29 12:24:03.417858780 -0500
-@@ -7,11 +7,11 @@
-
- The programs that can be built with this package are:
-
-- [ basename cat chgrp chmod chown chroot cksum comm cp csplit cut date dd
-+ [ basename cat chcon chgrp chmod chown chroot cksum comm cp csplit cut date dd
- df dir dircolors dirname du echo env expand expr factor false fmt fold
- ginstall groups head hostid hostname id join kill link ln logname ls
- md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr
-- printenv printf ptx pwd readlink rm rmdir runuser seq sha1sum shred sleep sort
-+ printenv printf ptx pwd readlink rm rmdir runcon 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 uptime users vdir wc who whoami yes
-
---- coreutils-5.2.1/src/stat.c.selinux 2004-02-05 08:46:12.000000000 -0500
-+++ coreutils-5.2.1/src/stat.c 2004-12-29 12:24:03.419858555 -0500
+--- coreutils-5.92/src/stat.c.selinux 2005-10-14 14:55:40.000000000 +0100
++++ coreutils-5.92/src/stat.c 2005-10-26 17:51:02.000000000 +0100
@@ -42,6 +42,13 @@
# endif
#endif
@@ -31,25 +14,25 @@
#include "system.h"
#include "error.h"
-@@ -95,6 +102,7 @@
- {"dereference", no_argument, 0, 'L'},
- {"format", required_argument, 0, 'c'},
- {"filesystem", no_argument, 0, 'f'},
+@@ -101,6 +108,7 @@
+ #define AUTHORS "Michael Meskes"
+
+ static struct option const long_options[] = {
+ {"context", no_argument, 0, 'Z'},
- {"terse", no_argument, 0, 't'},
- {GETOPT_HELP_OPTION_DECL},
- {GETOPT_VERSION_OPTION_DECL},
-@@ -345,7 +353,7 @@
+ {"dereference", no_argument, NULL, 'L'},
+ {"file-system", no_argument, NULL, 'f'},
+ {"filesystem", no_argument, NULL, 'f'}, /* obsolete and undocumented alias */
+@@ -311,7 +319,7 @@
/* print statfs info */
static void
- print_statfs (char *pformat, char m, char const *filename,
+ print_statfs (char *pformat, size_t buf_len, char m, char const *filename,
- void const *data)
-+ void const *data,SECURITY_ID_T scontext)
++ void const *data, SECURITY_ID_T scontext)
{
STRUCT_STATVFS const *statfsbuf = data;
-@@ -407,7 +415,10 @@
- strcat (pformat, PRIdMAX);
+@@ -383,7 +391,10 @@
+ xstrcat (pformat, buf_len, PRIdMAX);
printf (pformat, (intmax_t) (statfsbuf->f_ffree));
break;
-
@@ -58,54 +41,55 @@
+ printf(scontext);
+ break;
default:
- strcat (pformat, "c");
+ xstrcat (pformat, buf_len, "c");
printf (pformat, m);
-@@ -417,7 +428,7 @@
-
+@@ -394,7 +405,7 @@
/* print stat info */
static void
--print_stat (char *pformat, char m, char const *filename, void const *data)
-+print_stat (char *pformat, char m, char const *filename, void const *data, SECURITY_ID_T scontext)
+ print_stat (char *pformat, size_t buf_len, char m,
+- char const *filename, void const *data)
++ char const *filename, void const *data, SECURITY_ID_T scontext)
{
struct stat *statbuf = (struct stat *) data;
struct passwd *pw_ent;
-@@ -553,6 +564,10 @@
- strcat (pformat, "d");
- printf (pformat, (int) statbuf->st_ctime);
+@@ -528,6 +539,10 @@
+ xstrcat (pformat, buf_len, TYPE_SIGNED (time_t) ? "ld" : "lu");
+ printf (pformat, (unsigned long int) statbuf->st_ctime);
break;
+ case 'C':
+ strcat (pformat, "s");
+ printf(pformat,scontext);
+ break;
default:
- strcat (pformat, "c");
+ xstrcat (pformat, buf_len, "c");
printf (pformat, m);
-@@ -562,8 +577,8 @@
+@@ -537,8 +552,9 @@
static void
print_it (char const *masterformat, char const *filename,
-- void (*print_func) (char *, char, char const *, void const *),
+- void (*print_func) (char *, size_t, char, char const *, void const *),
- void const *data)
-+ void (*print_func) (char *, char, char const *, void const *,SECURITY_ID_T ),
-+ void const *data, SECURITY_ID_T scontext)
++ void (*print_func) (char *, size_t, char, char const *, void const *,
++ SECURITY_ID_T ),
++ void const *data, SECURITY_ID_T scontext)
{
char *b;
-@@ -598,7 +613,7 @@
+@@ -576,7 +592,7 @@
putchar ('%');
break;
default:
-- print_func (dest, *p, filename, data);
-+ print_func (dest, *p, filename, data,scontext);
+- print_func (dest, n_alloc, *p, filename, data);
++ print_func (dest, n_alloc, *p, filename, data, scontext);
break;
}
}
-@@ -615,9 +630,17 @@
+@@ -592,9 +608,17 @@
- /* stat the filesystem and print what we find */
- static void
--do_statfs (char const *filename, int terse, char const *format)
-+do_statfs (char const *filename, int terse, int secure, char const *format)
+ /* Stat the file system and print what we find. */
+ static bool
+-do_statfs (char const *filename, bool terse, char const *format)
++do_statfs (char const *filename, bool terse, bool secure, char const *format)
{
STRUCT_STATVFS statfsbuf;
+ SECURITY_ID_T scontext = NULL;
@@ -116,175 +100,170 @@
+ return;
+ }
+#endif
- int i = statfs (filename, &statfsbuf);
- if (i == -1)
-@@ -629,23 +652,40 @@
+ if (STATFS (filename, &statfsbuf) != 0)
+ {
+@@ -605,25 +629,46 @@
if (format == NULL)
{
- format = (terse
-- ? "%n %i %l %t %b %f %a %s %c %d"
+- ? "%n %i %l %t %s %S %b %f %a %c %d\n"
- : " File: \"%n\"\n"
- " ID: %-8i Namelen: %-7l Type: %T\n"
-- "Blocks: Total: %-10b Free: %-10f Available: %-10a Size: %s\n"
-- "Inodes: Total: %-10c Free: %-10d");
-- }
--
-- print_it (format, filename, print_statfs, &statfsbuf);
-+ if (terse) {
-+ if(secure)
-+ format = "%n %i %l %t %b %f %a %s %c %d %C";
-+ else
-+ format = "%n %i %l %t %b %f %a %s %c %d";
-+ }
-+ else
+- "Block size: %-10s Fundamental block size: %S\n"
+- "Blocks: Total: %-10b Free: %-10f Available: %a\n"
+- "Inodes: Total: %-10c Free: %d\n");
++ if (terse)
+ {
-+ if(secure)
++ if (secure)
++ format = "%n %i %l %t %s %S %b %f %a %c %d %C\n";
++ else
++ format = "%n %i %l %t %s %S %b %f %a %c %d\n";
++ }
++ else
++ {
++ if (secure)
+ format = " File: \"%n\"\n"
+ " ID: %-8i Namelen: %-7l Type: %T\n"
-+ "Blocks: Total: %-10b Free: %-10f Available: %-10a Size: %s\n"
-+ "Inodes: Total: %-10c Free: %-10d\n"
++ "Block size: %-10s Fundamental block size: %S\n"
++ "Blocks: Total: %-10b Free: %-10f Available: %a\n"
++ "Inodes: Total: %-10c Free: %d\n"
[...1798 lines suppressed...]
rm.1 rmdir.1 runuser.1 seq.1 sha1sum.1 shred.1 sleep.1 sort.1 split.1 stat.1 stty.1 \
su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
@@ -2760,8 +2799,8 @@
SUFFIXES = .x .1
---- coreutils-5.2.1/man/runcon.x 2004-12-29 12:24:03.467853150 -0500
-+++ coreutils-5.2.1/man/runcon.x 2005-05-16 14:18:12.000000000 -0400
+--- /dev/null 2005-10-10 09:36:06.437701000 +0100
++++ coreutils-5.92/man/runcon.x 2005-10-26 17:42:29.000000000 +0100
@@ -0,0 +1,14 @@
+[NAME]
+runcon \- run command with specified security context
@@ -2777,8 +2816,8 @@
+.PP
+Note that only carefully-chosen contexts are likely to successfully
+run.
---- coreutils-5.2.1/man/id.1.selinux 2004-03-02 17:52:27.000000000 -0500
-+++ coreutils-5.2.1/man/id.1 2004-12-29 12:24:03.469852925 -0500
+--- coreutils-5.92/man/id.1.selinux 2005-10-22 19:14:47.000000000 +0100
++++ coreutils-5.92/man/id.1 2005-10-26 17:42:29.000000000 +0100
@@ -13,6 +13,9 @@
\fB\-a\fR
ignore, for compatibility with other versions
@@ -2789,8 +2828,8 @@
\fB\-g\fR, \fB\-\-group\fR
print only the effective group ID
.TP
---- coreutils-5.2.1/man/cp.1.selinux 2004-03-02 17:51:05.000000000 -0500
-+++ coreutils-5.2.1/man/cp.1 2004-12-29 12:24:03.470852813 -0500
+--- coreutils-5.92/man/cp.1.selinux 2005-10-22 19:14:46.000000000 +0100
++++ coreutils-5.92/man/cp.1 2005-10-26 17:42:29.000000000 +0100
@@ -57,7 +57,7 @@
.TP
\fB\-\-preserve\fR[=\fIATTR_LIST\fR]
@@ -2800,7 +2839,7 @@
additional attributes: links, all
.TP
\fB\-\-no\-preserve\fR=\fIATTR_LIST\fR
-@@ -109,6 +109,9 @@
+@@ -105,6 +105,9 @@
\fB\-\-help\fR
display this help and exit
.TP
@@ -2810,9 +2849,9 @@
\fB\-\-version\fR
output version information and exit
.PP
---- coreutils-5.2.1/man/vdir.1.selinux 2004-03-02 17:52:33.000000000 -0500
-+++ coreutils-5.2.1/man/vdir.1 2004-12-29 12:24:03.471852700 -0500
-@@ -195,6 +195,20 @@
+--- coreutils-5.92/man/vdir.1.selinux 2005-10-22 19:14:51.000000000 +0100
++++ coreutils-5.92/man/vdir.1 2005-10-26 17:42:29.000000000 +0100
+@@ -201,6 +201,20 @@
.TP
\fB\-1\fR
list one file per line
@@ -2833,9 +2872,9 @@
.TP
\fB\-\-help\fR
display this help and exit
---- coreutils-5.2.1/tests/help-version.selinux 2004-12-29 12:24:03.261876346 -0500
-+++ coreutils-5.2.1/tests/help-version 2004-12-29 12:24:03.473852475 -0500
-@@ -42,6 +42,8 @@
+--- coreutils-5.92/tests/help-version.selinux 2005-10-26 17:42:29.000000000 +0100
++++ coreutils-5.92/tests/help-version 2005-10-26 17:42:29.000000000 +0100
+@@ -45,6 +45,8 @@
# Skip `test'; it doesn't accept --help or --version.
test $i = test && continue;
@@ -2844,7 +2883,7 @@
# false fails even when invoked with --help or --version.
if test $i = false; then
-@@ -155,7 +157,7 @@
+@@ -161,7 +163,7 @@
for i in $all_programs; do
# Skip these.
@@ -2853,9 +2892,95 @@
rm -rf $tmp_in $tmp_in2 $tmp_dir $tmp_out
echo > $tmp_in
---- coreutils-5.2.1/config.hin.selinux 2004-12-29 12:24:02.949911478 -0500
-+++ coreutils-5.2.1/config.hin 2004-12-29 12:24:03.475852250 -0500
-@@ -1374,6 +1374,9 @@
+--- coreutils-5.92/README.selinux 2005-10-26 17:42:29.000000000 +0100
++++ coreutils-5.92/README 2005-10-26 17:42:29.000000000 +0100
+@@ -7,11 +7,11 @@
+
+ The programs that can be built with this package are:
+
+- [ basename cat chgrp chmod chown chroot cksum comm cp csplit cut date dd
++ [ basename cat chcon chgrp chmod chown chroot cksum comm cp csplit cut date dd
+ df dir dircolors dirname du echo env expand expr factor false fmt fold
+ ginstall groups head hostid hostname id join kill link ln logname ls
+ md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr
+- printenv printf ptx pwd readlink rm rmdir runuser seq sha1sum shred sleep sort
++ printenv printf ptx pwd readlink rm rmdir runcon 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 uptime users vdir wc who whoami yes
+
+--- coreutils-5.92/configure.ac.selinux 2005-10-26 17:42:28.000000000 +0100
++++ coreutils-5.92/configure.ac 2005-10-26 17:42:29.000000000 +0100
+@@ -35,6 +35,13 @@
+ LIB_PAM="-ldl -lpam -lpam_misc"
+ AC_SUBST(LIB_PAM)])
+
++dnl Give the chance to enable SELINUX
++AC_ARG_ENABLE(selinux, dnl
++[ --enable-selinux Enable use of the SELINUX libraries],
++[AC_DEFINE(WITH_SELINUX, 1, [Define if you want to use SELINUX])
++LIB_SELINUX="-lselinux"
++AC_SUBST(LIB_SELINUX)])
++
+ gl_DEFAULT_POSIX2_VERSION
+ gl_USE_SYSTEM_EXTENSIONS
+ gl_PERL
+--- coreutils-5.92/config.hin.selinux 2005-10-26 17:42:29.000000000 +0100
++++ coreutils-5.92/config.hin 2005-10-26 17:48:09.000000000 +0100
+@@ -411,10 +411,6 @@
+ don't. */
+ #undef HAVE_DECL_TTYNAME
+
+-/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
+- */
+-#undef HAVE_DECL_TZNAME
+-
+ /* Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise.
+ */
+ #undef HAVE_DECL_WCWIDTH
+@@ -519,6 +515,9 @@
+ /* Define to 1 if you have the `getdelim' function. */
+ #undef HAVE_GETDELIM
+
++/* Define to 1 if you have the `getgrouplist' function. */
++#undef HAVE_GETGROUPLIST
++
+ /* Define to 1 if your system has a working `getgroups' function. */
+ #undef HAVE_GETGROUPS
+
+@@ -613,9 +612,6 @@
+ /* Define to 1 if you have the `lchown' function. */
+ #undef HAVE_LCHOWN
+
+-/* Define to 1 if you have the `acl' library (-lacl). */
+-#undef HAVE_LIBACL
+-
+ /* Define to 1 if you have the `dgc' library (-ldgc). */
+ #undef HAVE_LIBDGC
+
+@@ -1518,17 +1514,17 @@
+ /* Define to 1 if unlink (dir) cannot possibly succeed. */
+ #undef UNLINK_CANNOT_UNLINK_DIR
+
+-/* Define to 1 if you want getc etc. to use unlocked I/O if available.
+- Unlocked I/O can improve performance in unithreaded apps, but it is not
+- safe for multithreaded apps. */
+-#undef USE_UNLOCKED_IO
+-
+ /* Define if you want access control list support. */
+ #undef USE_ACL
+
+ /* Define if you want to use PAM */
+ #undef USE_PAM
+
++/* Define to 1 if you want getc etc. to use unlocked I/O if available.
++ Unlocked I/O can improve performance in unithreaded apps, but it is not
++ safe for multithreaded apps. */
++#undef USE_UNLOCKED_IO
++
+ /* Version number of package */
+ #undef VERSION
+
+@@ -1538,6 +1534,9 @@
/* Define if sys/ptem.h is required for struct winsize. */
#undef WINSIZE_IN_PTEM
@@ -2865,3 +2990,21 @@
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
+@@ -1683,7 +1682,7 @@
+ /* Define to rpl_nanosleep if the replacement function should be used. */
+ #undef nanosleep
+
+-/* Define to `long int' if <sys/types.h> does not define. */
++/* Define to `long' if <sys/types.h> does not define. */
+ #undef off_t
+
+ /* Define to `int' if <sys/types.h> does not define. */
+@@ -1750,7 +1749,7 @@
+ /* Define to empty if the C compiler doesn't support this keyword. */
+ #undef signed
+
+-/* Define to `unsigned int' if <sys/types.h> does not define. */
++/* Define to `unsigned' if <sys/types.h> does not define. */
+ #undef size_t
+
+ /* Map `socklen_t' to `int' if it is missing. */
Index: coreutils.spec
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/coreutils.spec,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- coreutils.spec 30 Sep 2005 11:56:32 -0000 1.84
+++ coreutils.spec 27 Oct 2005 15:05:08 -0000 1.85
@@ -1,7 +1,7 @@
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils
-Version: 5.2.1
-Release: 56
+Version: 5.92
+Release: 0.1
License: GPL
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -15,11 +15,14 @@
Source106: colorls.csh
Source200: su.pamd
+# From upstream
+Patch1: coreutils-mkdir.patch
+Patch2: coreutils-dircolors.patch
+Patch3: coreutils-mkdir2.patch
+Patch4: coreutils-tac.patch
+
# fileutils
Patch107: fileutils-4.1.10-timestyle.patch
-Patch108: fileutils-4.1.5-afs.patch
-Patch116: fileutils-4.1-dircolors_c.patch
-Patch153: fileutils-4.1.10-utmp.patch
Patch182: coreutils-acl.patch
# sh-utils
@@ -30,30 +33,15 @@
# it here indefinitely.
Patch706: coreutils-pam.patch
Patch713: coreutils-4.5.3-langinfo.patch
-Patch714: coreutils-4.5.3-printf-ll.patch
Patch715: coreutils-4.5.3-sysinfo.patch
# (sb) lin18nux/lsb compliance
Patch800: coreutils-i18n.patch
-Patch904: coreutils-5.0-allow_old_options.patch
-Patch905: coreutils-jday.patch
-Patch906: coreutils-fchown.patch
Patch907: coreutils-5.2.1-runuser.patch
Patch908: coreutils-getgrouplist.patch
-Patch909: coreutils-zh_CN.patch
-Patch910: coreutils-gcc4.patch
-Patch911: coreutils-brokentest.patch
Patch912: coreutils-overflow.patch
-# From upstream
-Patch920: coreutils-dateseconds.patch
-Patch921: coreutils-chown.patch
-Patch922: coreutils-rmaccess.patch
-Patch923: coreutils-copy.patch
-Patch924: coreutils-stale-utmp.patch
-Patch925: coreutils-no-sign-extend.patch
-
#SELINUX Patch
Patch950: coreutils-selinux.patch
@@ -82,11 +70,14 @@
%prep
%setup -q
+# From upstream
+%patch1 -p0 -b .mkdir
+%patch2 -p0 -b .dircolors
+%patch3 -p0 -b .mkdir2
+%patch4 -p0 -b .tac
+
# fileutils
%patch107 -p1 -b .timestyle
-%patch108 -p1 -b .afs
-%patch116 -p1
-%patch153 -p1
%patch182 -p1 -b .acl
# sh-utils
@@ -94,31 +85,16 @@
%patch704 -p1 -b .paths
%patch706 -p1 -b .pam
%patch713 -p1 -b .langinfo
-%patch714 -p1 -b .printf-ll
%patch715 -p1 -b .sysinfo
# li18nux/lsb
%patch800 -p1 -b .i18n
# Coreutils
-%patch904 -p1 -b .allow_old_options
-%patch905 -p1 -b .jday
-%patch906 -p1 -b .fchown
%patch907 -p1 -b .runuser
%patch908 -p1 -b .getgrouplist
-%patch909 -p1 -b .zh_CN
-%patch910 -p1 -b .gcc4
-%patch911 -p1 -b .brokentest
%patch912 -p1 -b .overflow
-# From upstream
-%patch920 -p1 -b .dateseconds
-%patch921 -p1 -b .chown
-%patch922 -p1 -b .rmaccess
-%patch923 -p1 -b .copy
-%patch924 -p1 -b .stale-utmp
-%patch925 -p1 -b .no-sign-extend
-
#SELinux
%patch950 -p1 -b .selinux
@@ -284,6 +260,14 @@
/sbin/runuser
%changelog
+* Mon Oct 24 2005 Tim Waugh <twaugh at redhat.com> 5.92-0.1
+- 5.92.
+- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
+ chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
+- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
+- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
+- NOTE: i18n patch not ported for sort(1) yet.
+
* Fri Sep 30 2005 Tomas Mraz <tmraz at redhat.com> - 5.2.1-56
- use include instead of pam_stack in pam config
sh-utils-2.0.11-dateman.patch:
date.1 | 5 +++++
1 files changed, 5 insertions(+)
Index: sh-utils-2.0.11-dateman.patch
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/sh-utils-2.0.11-dateman.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sh-utils-2.0.11-dateman.patch 9 Sep 2004 03:55:45 -0000 1.1
+++ sh-utils-2.0.11-dateman.patch 27 Oct 2005 15:05:08 -0000 1.2
@@ -1,9 +1,9 @@
---- sh-utils-2.0.11/man/date.1.man Tue May 15 19:02:55 2001
-+++ sh-utils-2.0.11/man/date.1 Tue May 15 19:06:05 2001
-@@ -152,6 +152,11 @@
- .IP
- `-' (hyphen) do not pad the field
- `_' (underscore) pad the field with spaces
+--- 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
+@@ -188,6 +188,11 @@
+ then an optional modifier, which is either
+ E to use the locale's alternate representations if available, or
+ O to use the locale's alternate numeric symbols if available.
+.SH ENVIRONMENT
+.TP
+TZ
Index: sources
===================================================================
RCS file: /cvs/dist/rpms/coreutils/devel/sources,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- sources 9 Sep 2004 03:58:39 -0000 1.4
+++ sources 27 Oct 2005 15:05:08 -0000 1.5
@@ -1 +1 @@
-172ee3c315af93d3385ddfbeb843c53f coreutils-5.2.1.tar.bz2
+f2ad653731ebc9d5763be5971b4d41e0 coreutils-5.92.tar.bz2
--- coreutils-4.5.3-printf-ll.patch DELETED ---
--- coreutils-5.0-allow_old_options.patch DELETED ---
--- coreutils-brokentest.patch DELETED ---
--- coreutils-chown.patch DELETED ---
--- coreutils-copy.patch DELETED ---
--- coreutils-dateseconds.patch DELETED ---
--- coreutils-fchown.patch DELETED ---
--- coreutils-gcc4.patch DELETED ---
--- coreutils-jday.patch DELETED ---
--- coreutils-no-sign-extend.patch DELETED ---
--- coreutils-rmaccess.patch DELETED ---
--- coreutils-stale-utmp.patch DELETED ---
--- coreutils-zh_CN.patch DELETED ---
--- fileutils-4.1-dircolors_c.patch DELETED ---
--- fileutils-4.1.10-utmp.patch DELETED ---
--- fileutils-4.1.5-afs.patch DELETED ---
More information about the fedora-cvs-commits
mailing list