1 diff -urN coreutils-4.5.10.org/configure.ac coreutils-4.5.10/configure.ac
2 --- coreutils-4.5.10.org/configure.ac Mon Mar 24 16:29:50 2003
3 +++ coreutils-4.5.10/configure.ac Mon Mar 24 16:31:35 2003
5 AM_GNU_GETTEXT([external], [need-ngettext])
6 AM_GNU_GETTEXT_VERSION(0.11.5)
10 # just in case we want PAM
12 # with PAM su doesn't need libcrypt
13 diff -urN coreutils-4.5.10.org/lib/acl.c coreutils-4.5.10/lib/acl.c
14 --- coreutils-4.5.10.org/lib/acl.c Mon Mar 24 16:29:46 2003
15 +++ coreutils-4.5.10/lib/acl.c Mon Mar 24 16:30:58 2003
21 +# include <libintl.h>
22 +# define _(Text) gettext (Text)
24 +# define _(Text) Text
29 # define S_ISLNK(Mode) 0
35 +# define ENOTSUP (-1)
38 #ifndef MIN_ACL_ENTRIES
39 # define MIN_ACL_ENTRIES 4
42 file_has_acl (char const *path, struct stat const *pathstat)
44 - /* FIXME: This implementation should work on recent-enough versions
45 - of HP-UX, Solaris, and Unixware, but it simply returns 0 with
46 - POSIX 1003.1e (draft 17 -- abandoned), AIX, GNU/Linux, Irix, and
47 - Tru64. Please see Samba's source/lib/sysacls.c file for
48 - fix-related ideas. */
50 #if HAVE_ACL && defined GETACLCNT
51 + /* This implementation should work on recent-enough versions of HP-UX,
52 + Solaris, and Unixware. */
54 if (! S_ISLNK (pathstat->st_mode))
56 int n = acl (path, GETACLCNT, 0, NULL);
57 return n < 0 ? (errno == ENOSYS ? 0 : -1) : (MIN_ACL_ENTRIES < n);
59 +#elif HAVE_ACL_EXTENDED_FILE
61 + /* Linux specific. */
63 + if (! S_ISLNK (pathstat->st_mode))
65 + int ret = acl_extended_file (path);
67 + return (errno == ENOSYS || errno == ENOTSUP) ? 0 : -1;
71 + /* FIXME: Add support for AIX, Irix, and Tru64, FreeBSD, etc.
72 + Please see Samba's source/lib/sysacls.c file for fix-related ideas. */
78 +/* Copy the permissions from SRC_PATH to DST_PATH, including access control
79 + lists on systems where this is supported. MODE is the file mode for
80 + DST_PATH, including the file type.
81 + Also sets special bits in MODE on DST_PATH. */
84 +copy_acl (char const *src_path, char const *dst_path, mode_t mode)
86 +#if HAVE_ACL_GET_FILE && HAVE_ACL_SET_FILE && HAVE_ACL_FREE && \
89 + /* Linux specific. Will work on all POSIX 1003.1e draft 17 (abandoned)
90 + compliant systems if the acl_entries() function is implemented. */
92 + acl_t acl = acl_get_file (src_path, ACL_TYPE_ACCESS);
95 + if (errno == ENOSYS || errno == ENOTSUP)
96 + return set_acl (dst_path, mode);
99 + error (0, errno, "%s", quote (src_path));
104 + if (acl_set_file (dst_path, ACL_TYPE_ACCESS, acl))
106 + int saved_errno = errno;
108 + if (errno == ENOSYS || errno == ENOTSUP)
110 + int n = acl_entries (acl);
115 + if (chmod (dst_path, mode))
116 + saved_errno = errno;
121 + chmod (dst_path, mode);
126 + chmod (dst_path, mode);
128 + error (0, saved_errno, _("preserving permissions for %s"),
134 + if (mode & (S_ISUID | S_ISGID | S_ISVTX))
136 + /* We did not call chmod so far, so the special bits have not yet
139 + if (chmod (dst_path, mode))
141 + error (0, errno, _("preserving permissions for %s"),
147 + if (S_ISDIR (mode))
149 + acl = acl_get_file (src_path, ACL_TYPE_DEFAULT);
152 + error (0, errno, "%s", quote (src_path));
156 + if (acl_set_file (dst_path, ACL_TYPE_DEFAULT, acl))
158 + error (0, errno, _("preserving permissions for %s"),
168 + int ret = chmod (dst_path, mode);
170 + error (0, errno, _("preserving permissions for %s"), quote (dst_path));
175 +/* Set the permissions of PATH, overwriting access control lists, on systems
176 + where this is supported. MODE is the file mode for PATH, including the
177 + file type. Also sets special bits in MODE on PATH. */
180 +set_acl (char const *path, mode_t mode)
182 +#if HAVE_ACL_FROM_TEXT && HAVE_ACL_SET_FILE && HAVE_ACL_FREE && \
183 + HAVE_ACL_DELETE_DEF_FILE
184 + char acl_text[] = "u::---,g::---,o::---";
187 + if (mode & S_IRUSR) acl_text[ 3] = 'r';
188 + if (mode & S_IWUSR) acl_text[ 4] = 'w';
189 + if (mode & S_IXUSR) acl_text[ 5] = 'x';
190 + if (mode & S_IRGRP) acl_text[10] = 'r';
191 + if (mode & S_IWGRP) acl_text[11] = 'w';
192 + if (mode & S_IXGRP) acl_text[12] = 'x';
193 + if (mode & S_IROTH) acl_text[17] = 'r';
194 + if (mode & S_IWOTH) acl_text[18] = 'w';
195 + if (mode & S_IXOTH) acl_text[19] = 'x';
197 + acl = acl_from_text(acl_text);
200 + error (0, errno, "%s", quote (path));
204 + if (acl_set_file(path, ACL_TYPE_ACCESS, acl))
206 + int saved_errno = errno;
209 + if (errno == ENOTSUP || errno == ENOSYS)
211 + if (chmod (path, mode))
212 + saved_errno = errno;
216 + error (0, saved_errno, _("setting permissions for %s"), quote (path));
221 + if (mode & (S_ISUID | S_ISGID | S_ISVTX))
223 + /* We did not call chmod so far, so the special bits have not yet
226 + if (chmod (path, mode))
228 + error (0, errno, _("preserving permissions for %s"),
234 + if (S_ISDIR (mode) && acl_delete_def_file (path))
236 + error (0, errno, _("setting permissions for %s"), quote (path));
241 + int ret = chmod (path, mode);
243 + error (0, errno, _("setting permissions for %s"), quote (path));
248 diff -urN coreutils-4.5.10.org/lib/acl.h coreutils-4.5.10/lib/acl.h
249 --- coreutils-4.5.10.org/lib/acl.h Mon Mar 24 16:29:46 2003
250 +++ coreutils-4.5.10/lib/acl.h Mon Mar 24 16:30:58 2003
253 Written by Paul Eggert. */
255 -#if HAVE_SYS_ACL_H && HAVE_ACL
257 # include <sys/acl.h>
259 #if ! defined GETACLCNT && defined ACL_CNT
263 int file_has_acl (char const *, struct stat const *);
264 +int copy_acl (char const *, char const *, mode_t);
265 +int set_acl (char const *, mode_t);
266 diff -urN coreutils-4.5.10.org/m4/Makefile.am coreutils-4.5.10/m4/Makefile.am
267 --- coreutils-4.5.10.org/m4/Makefile.am Mon Mar 24 16:29:47 2003
268 +++ coreutils-4.5.10/m4/Makefile.am Mon Mar 24 16:30:58 2003
277 diff -urN coreutils-4.5.10.org/m4/posix_acl.m4 coreutils-4.5.10/m4/posix_acl.m4
278 --- coreutils-4.5.10.org/m4/posix_acl.m4 Thu Jan 1 01:00:00 1970
279 +++ coreutils-4.5.10/m4/posix_acl.m4 Mon Mar 24 16:30:58 2003
283 +dnl Written by Andreas Gruenbacher <a.gruenbacher@computer.org>.
285 +dnl Posix 1003.1e draft standard 17 (abandoned) and similar
286 +dnl access control list support
287 +AC_DEFUN([ag_POSIX_ACL],
290 + AC_CHECK_HEADERS(sys/acl.h)
291 + AC_CHECK_LIB(acl, main)
292 + AC_CHECK_FUNCS(acl_get_file acl_set_file acl_free acl_to_text \
293 + acl_from_text acl_delete_def_file)
294 + # Linux specific extensions:
295 + AC_CHECK_FUNCS(acl_entries acl_extended_file)
299 + if test $ac_cv_header_sys_acl_h = yes; then
300 + AC_DEFINE(USE_ACL, 1, [Define if you want access control list support.])
305 diff -urN coreutils-4.5.10.org/src/copy.c coreutils-4.5.10/src/copy.c
306 --- coreutils-4.5.10.org/src/copy.c Mon Mar 24 16:29:46 2003
307 +++ coreutils-4.5.10/src/copy.c Mon Mar 24 16:30:58 2003
309 /* The invocation name of this program. */
310 extern char *program_name;
312 -/* Encapsulate selection of the file mode to be applied to
313 - new non-directories. */
316 -get_dest_mode (const struct cp_options *option, mode_t mode)
318 - /* In some applications (e.g., install), use precisely the
320 - if (option->set_mode)
321 - return option->mode;
323 - /* Honor the umask for `cp', but not for `mv' or `cp -p'.
324 - In addition, `cp' without -p must clear the set-user-ID and set-group-ID
325 - bits. POSIX requires it do that when creating new files. */
326 - if (!option->move_mode && !option->preserve_mode)
327 - mode &= (option->umask_kill & ~(S_ISUID | S_ISGID));
332 /* FIXME: describe */
333 /* FIXME: rewrite this to use a hash table so we avoid the quadratic
334 performance hit that's probably noticeable only on trees deeper
335 @@ -792,13 +772,13 @@
341 char *earlier_file = NULL;
342 char *dst_backup = NULL;
343 int backup_succeeded = 0;
345 int copied_as_regular = 0;
347 + int dst_mode_valid = 0;
348 int preserve_metadata;
350 if (x->move_mode && rename_succeeded)
355 - src_type = src_sb.st_mode;
357 src_mode = src_sb.st_mode;
359 - if (S_ISDIR (src_type) && !x->recursive)
360 + if (S_ISDIR (src_mode) && !x->recursive)
362 error (0, 0, _("omitting directory %s"), quote (src_path));
366 if (!S_ISDIR (dst_sb.st_mode))
368 - if (S_ISDIR (src_type))
369 + if (S_ISDIR (src_mode))
372 _("cannot overwrite non-directory %s with directory %s"),
377 - if (!S_ISDIR (src_type))
378 + if (!S_ISDIR (src_mode))
380 if (S_ISDIR (dst_sb.st_mode))
383 This may be due to an interactive `negative' reply to the
384 prompt about the existing file. It may also be due to the
385 use of the --reply=no option. */
386 - if (!S_ISDIR (src_type))
387 + if (!S_ISDIR (src_mode))
389 /* cp and mv treat -i and -f differently. */
391 @@ -1042,7 +1020,7 @@
392 /* If the source is a directory, we don't always create the destination
393 directory. So --verbose should not announce anything until we're
394 sure we'll create a directory. */
395 - if (x->verbose && !S_ISDIR (src_type))
396 + if (x->verbose && !S_ISDIR (src_mode))
398 printf ("%s -> %s", quote_n (0, src_path), quote_n (1, dst_path));
399 if (backup_succeeded)
400 @@ -1077,7 +1055,7 @@
402 && x->dereference == DEREF_COMMAND_LINE_ARGUMENTS)
403 || x->dereference == DEREF_ALWAYS))
404 - || (x->recursive && S_ISDIR (src_type)))
405 + || (x->recursive && S_ISDIR (src_mode)))
407 earlier_file = remember_copied (dst_path, src_sb.st_ino, src_sb.st_dev);
409 @@ -1090,7 +1068,7 @@
410 /* Avoid damaging the destination filesystem by refusing to preserve
411 hard-linked directories (which are found at least in Netapp snapshot
413 - if (S_ISDIR (src_type))
414 + if (S_ISDIR (src_mode))
416 /* If src_path and earlier_file refer to the same directory entry,
417 then warn about copying a directory into itself. */
418 @@ -1142,7 +1120,7 @@
420 if (rename (src_path, dst_path) == 0)
422 - if (x->verbose && S_ISDIR (src_type))
423 + if (x->verbose && S_ISDIR (src_mode))
424 printf ("%s -> %s\n", quote_n (0, src_path), quote_n (1, dst_path));
425 if (rename_succeeded)
426 *rename_succeeded = 1;
427 @@ -1255,7 +1233,7 @@
428 In such cases, set this variable to zero. */
429 preserve_metadata = 1;
431 - if (S_ISDIR (src_type))
432 + if (S_ISDIR (src_mode))
434 struct dir_list *dir;
436 @@ -1280,16 +1258,38 @@
438 if (new_dst || !S_ISDIR (dst_sb.st_mode))
440 - /* Create the new directory writable and searchable, so
441 - we can create new entries in it. */
443 - if (mkdir (dst_path, (src_mode & x->umask_kill) | S_IRWXU))
444 + if (mkdir (dst_path, src_mode))
446 error (0, errno, _("cannot create directory %s"),
451 + /* We need search and write permissions to the new directory
452 + for adding the directory's contents. Check if these permissions
453 + are already there. */
455 + if (lstat (dst_path, &dst_sb))
457 + error (0, errno, _("cannot stat %s"), quote (dst_path));
460 + else if ((dst_sb.st_mode & S_IRWXU) != S_IRWXU)
462 + /* Make the new directory writable and searchable. The original
463 + permissions will be restored later. */
465 + dst_mode_valid = 1;
466 + dst_mode = dst_sb.st_mode;
468 + if (chmod (dst_path, dst_mode | S_IRWXU))
470 + error (0, errno, _("setting permissions for %s"),
476 /* Insert the created directory's inode and device
477 numbers into the search structure, so that we can
478 avoid copying it again. */
479 @@ -1365,10 +1365,10 @@
483 - else if (S_ISREG (src_type)
484 - || (x->copy_as_regular && !S_ISDIR (src_type)
485 + else if (S_ISREG (src_mode)
486 + || (x->copy_as_regular && !S_ISDIR (src_mode)
488 - && !S_ISLNK (src_type)
489 + && !S_ISLNK (src_mode)
493 @@ -1376,15 +1376,14 @@
494 /* POSIX says the permission bits of the source file must be
495 used as the 3rd argument in the open call, but that's not consistent
496 with historical practice. */
497 - if (copy_reg (src_path, dst_path, x,
498 - get_dest_mode (x, src_mode), &new_dst, &src_sb))
499 + if (copy_reg (src_path, dst_path, x, src_mode, &new_dst, &src_sb))
504 - if (S_ISFIFO (src_type))
505 + if (S_ISFIFO (src_mode))
507 - if (mkfifo (dst_path, get_dest_mode (x, src_mode)))
508 + if (mkfifo (dst_path, src_mode))
510 error (0, errno, _("cannot create fifo %s"), quote (dst_path));
512 @@ -1392,13 +1391,13 @@
516 - if (S_ISBLK (src_type) || S_ISCHR (src_type)
517 + if (S_ISBLK (src_mode) || S_ISCHR (src_mode)
519 - || S_ISSOCK (src_type)
520 + || S_ISSOCK (src_mode)
524 - if (mknod (dst_path, get_dest_mode (x, src_mode), src_sb.st_rdev))
525 + if (mknod (dst_path, src_mode, src_sb.st_rdev))
527 error (0, errno, _("cannot create special file %s"),
529 @@ -1407,7 +1406,7 @@
533 - if (S_ISLNK (src_type))
534 + if (S_ISLNK (src_mode))
536 char *src_link_val = xreadlink (src_path);
537 if (src_link_val == NULL)
538 @@ -1513,7 +1512,25 @@
539 if (x->preserve_ownership
540 && (new_dst || !SAME_OWNER_AND_GROUP (src_sb, dst_sb)))
543 + /* The chown() system call may clear the SUID and SGID bits, so we
544 + need to set them again later. (But we don't care if we will
545 + overwrite the permissions of the destination file anyway.) */
547 + if ((src_mode & (S_ISUID | S_ISGID))
548 + && !x->preserve_mode && !x->move_mode && !x->set_mode)
550 + if (lstat (dst_path, &dst_sb))
552 + error (0, errno, _("cannot stat %s"), quote (dst_path));
557 + dst_mode_valid = 1;
558 + dst_mode = dst_sb.st_mode;
562 if (DO_CHOWN (chown, dst_path, src_sb.st_uid, src_sb.st_gid))
564 error (0, errno, _("failed to preserve ownership for %s"),
565 @@ -1534,20 +1551,23 @@
569 - /* Permissions of newly-created regular files were set upon `open' in
570 - copy_reg. But don't return early if there were any special bits and
571 - we had to run chown, because the chown must have reset those bits. */
572 - if ((new_dst && copied_as_regular)
573 - && !(ran_chown && (src_mode & ~S_IRWXUGO)))
574 - return delayed_fail;
576 - if ((x->preserve_mode || new_dst)
577 - && (x->copy_as_regular || S_ISREG (src_type) || S_ISDIR (src_type)))
578 + if (x->preserve_mode || x->move_mode)
580 - if (chmod (dst_path, get_dest_mode (x, src_mode)))
582 - error (0, errno, _("setting permissions for %s"), quote (dst_path));
583 - if (x->set_mode || x->require_preserve)
584 + if (copy_acl (src_path, dst_path, src_mode) && x->require_preserve)
587 + else if (x->set_mode)
589 + if (set_acl (dst_path, x->mode) && x->require_preserve)
592 + else if (dst_mode_valid)
594 + if (chmod (dst_path, dst_mode))
596 + error (0, errno, _("preserving permissions for %s"),
598 + if (x->require_preserve)
602 diff -urN coreutils-4.5.10.org/src/copy.h coreutils-4.5.10/src/copy.h
603 --- coreutils-4.5.10.org/src/copy.h Mon Mar 24 16:29:46 2003
604 +++ coreutils-4.5.10/src/copy.h Mon Mar 24 16:30:58 2003
606 Create destination directories as usual. */
609 - /* The bits to preserve in created files' modes. */
612 /* If nonzero, do not copy a nondirectory that has an existing destination
613 with the same or newer modification time. */
615 diff -urN coreutils-4.5.10.org/src/cp.c coreutils-4.5.10/src/cp.c
616 --- coreutils-4.5.10.org/src/cp.c Mon Mar 24 16:29:46 2003
617 +++ coreutils-4.5.10/src/cp.c Mon Mar 24 16:34:26 2003
619 need to be fixed after copying. */
626 struct dir_attr *next;
632 - if (x->preserve_mode || p->is_new_dir)
633 + if (x->preserve_mode)
635 - if (chmod (dst_path, src_sb.st_mode & x->umask_kill))
636 + if (copy_acl (src_path, dst_path, src_sb.st_mode))
639 + else if (p->mode_valid)
641 + if (chmod (dst_path, p->mode))
643 error (0, errno, _("failed to preserve permissions for %s"),
647 SRC_OFFSET is the index in CONST_DIRPATH (which is a destination
648 path) of the beginning of the source directory name.
649 - Create any leading directories that don't already exist,
650 - giving them permissions MODE.
651 + Create any leading directories that don't already exist.
652 If VERBOSE_FMT_STRING is nonzero, use it as a printf format
653 string for printing a message after successfully making a directory.
654 The format should take two string arguments: the names of the
655 @@ -378,15 +383,16 @@
656 /* FIXME: find a way to synch this function with the one in lib/makepath.c. */
659 -make_path_private (const char *const_dirpath, int src_offset, int mode,
660 +make_path_private (const char *const_dirpath, int src_offset,
661 const char *verbose_fmt_string, struct dir_attr **attr_list,
662 - int *new_dst, int (*xstat)())
663 + int *new_dst, const struct cp_options *x)
666 char *dirpath; /* A copy of CONST_DIRPATH we can change. */
667 char *src; /* Source name in `dirpath'. */
668 char *dst_dirname; /* Leading path of `dirpath'. */
669 size_t dirlen; /* Length of leading path of `dirpath'. */
672 dirpath = (char *) alloca (strlen (const_dirpath) + 1);
673 strcpy (dirpath, const_dirpath);
678 - if ((*xstat) (dst_dirname, &stats))
679 + if ((*x->xstat) (dst_dirname, &stats))
681 /* Parent of CONST_DIRNAME does not exist.
682 Make all missing intermediate directories. */
683 @@ -420,15 +426,23 @@
687 - if ((*xstat) (dirpath, &stats))
688 + if ((*x->xstat) (dirpath, &stats))
690 /* This element of the path does not exist. We must set
691 - *new_dst and new->is_new_dir inside this loop because,
692 + *new_dst inside this loop because,
693 for example, in the command `cp --parents ../a/../b/c e_dir',
694 make_path_private creates only e_dir/../a if ./b already
697 - new->is_new_dir = 1;
699 + if ((*x->xstat) (src, &stats))
701 + error (0, errno, _("failed to get attributes of %s"),
705 + mode = stats.st_mode;
707 if (mkdir (dirpath, mode))
709 error (0, errno, _("cannot make directory %s"),
711 if (verbose_fmt_string != NULL)
712 printf (verbose_fmt_string, src, dirpath);
715 + /* We need search and write permissions to the new directory
716 + for adding the directory's contents. Check if these
717 + permissions are already there. */
719 + if (lstat (dirpath, &stats))
721 + error (0, errno, _("failed to get attributes of %s"),
727 + if (x->preserve_mode && mode != stats.st_mode)
730 + new->mode_valid = 1;
733 + new->mode_valid = 0;
735 + if ((stats.st_mode & S_IRWXU) != S_IRWXU)
737 + /* Make the new directory writable and searchable. The
738 + original permissions will be restored later. */
740 + if (!new->mode_valid)
742 + new->mode = stats.st_mode;
743 + new->mode_valid = 1;
746 + if (chmod (dirpath, stats.st_mode | S_IRWXU))
748 + error (0, errno, _("setting permissions for %s"),
755 else if (!S_ISDIR (stats.st_mode))
761 - new->is_new_dir = 0;
762 + new->mode_valid = 0;
767 leading directories. */
768 parent_exists = !make_path_private (dst_path,
769 arg_in_concat - dst_path,
772 ? "%s -> %s\n" : NULL),
773 - &attr_list, &new_dst,
775 + &attr_list, &new_dst, x);
783 - /* Find out the current file creation mask, to knock the right bits
784 - when using chmod. The creation mask is set to be liberal, so
785 - that created directories can be written, even if it would not
786 - have been allowed with the mask this process was started with. */
787 - x->umask_kill = ~ umask (0);
792 @@ -1017,9 +1063,6 @@
793 version_control_string)
796 - if (x.preserve_mode == 1)
797 - x.umask_kill = ~ (mode_t) 0;
799 if (x.dereference == DEREF_UNDEFINED)
802 diff -urN coreutils-4.5.10.org/src/install.c coreutils-4.5.10/src/install.c
803 --- coreutils-4.5.10.org/src/install.c Mon Mar 24 16:29:46 2003
804 +++ coreutils-4.5.10/src/install.c Mon Mar 24 16:30:58 2003
806 x->mode = S_IRUSR | S_IWUSR;
813 diff -urN coreutils-4.5.10.org/src/ls.c coreutils-4.5.10/src/ls.c
814 --- coreutils-4.5.10.org/src/ls.c Mon Mar 24 16:29:46 2003
815 +++ coreutils-4.5.10/src/ls.c Mon Mar 24 16:30:58 2003
816 @@ -223,13 +223,13 @@
818 enum filetype filetype;
821 +#if HAVE_ACL || USE_ACL
822 /* For long listings, true if the file has an access control list. */
828 +#if HAVE_ACL || USE_ACL
829 # define FILE_HAS_ACL(F) ((F)->have_acl)
831 # define FILE_HAS_ACL(F) 0
832 @@ -2400,7 +2400,7 @@
837 +#if HAVE_ACL || USE_ACL
838 if (format == long_format)
840 int n = file_has_acl (path, &files[files_index].stat);
841 diff -urN coreutils-4.5.10.org/src/mv.c coreutils-4.5.10/src/mv.c
842 --- coreutils-4.5.10.org/src/mv.c Mon Mar 24 16:29:46 2003
843 +++ coreutils-4.5.10/src/mv.c Mon Mar 24 16:30:58 2003
846 x->stdin_tty = isatty (STDIN_FILENO);
848 - /* Find out the current file creation mask, to knock the right bits
849 - when using chmod. The creation mask is set to be liberal, so
850 - that created directories can be written, even if it would not
851 - have been allowed with the mask this process was started with. */
852 - x->umask_kill = ~ umask (0);
857 diff -urN coreutils-4.5.10.org/tests/misc/README coreutils-4.5.10/tests/misc/README
858 --- coreutils-4.5.10.org/tests/misc/README Thu Jan 1 01:00:00 1970
859 +++ coreutils-4.5.10/tests/misc/README Mon Mar 24 16:30:58 2003
861 +Use the run script to run any of the *.test scripts, e.g.,
865 +The cp.test script can be run as any user; the cp-root
866 +script requires root privileges.
867 diff -urN coreutils-4.5.10.org/tests/misc/acl coreutils-4.5.10/tests/misc/acl
868 --- coreutils-4.5.10.org/tests/misc/acl Thu Jan 1 01:00:00 1970
869 +++ coreutils-4.5.10/tests/misc/acl Mon Mar 24 16:30:58 2003
873 +getfacl "$@" | sed -e 's/[ ]*#.*$//' -e '/^$/d'
874 diff -urN coreutils-4.5.10.org/tests/misc/cp-root.test coreutils-4.5.10/tests/misc/cp-root.test
875 --- coreutils-4.5.10.org/tests/misc/cp-root.test Thu Jan 1 01:00:00 1970
876 +++ coreutils-4.5.10/tests/misc/cp-root.test Mon Mar 24 16:30:58 2003
878 +! Tests the access control list extensions to cp.
879 +! This script must be run as root.
904 diff -urN coreutils-4.5.10.org/tests/misc/cp.test coreutils-4.5.10/tests/misc/cp.test
905 --- coreutils-4.5.10.org/tests/misc/cp.test Thu Jan 1 01:00:00 1970
906 +++ coreutils-4.5.10/tests/misc/cp.test Mon Mar 24 16:30:58 2003
908 +! Tests the access control list extensions to cp (and also of ls).
909 +! Requires a system with POSIX access control lists and the
910 +! getfacl and setfacl utilities.
920 +$ setfacl -m u:@OWNER@:rw- f
944 +$ setfacl -d -m u::rwx,u:@OWNER@:r-x,g::---,m::r-x,o::--- d
950 + default:user:@OWNER@:r-x
994 diff -urN coreutils-4.5.10.org/tests/misc/mode coreutils-4.5.10/tests/misc/mode
995 --- coreutils-4.5.10.org/tests/misc/mode Thu Jan 1 01:00:00 1970
996 +++ coreutils-4.5.10/tests/misc/mode Mon Mar 24 16:30:58 2003
999 +ls -dl $* | awk -- '!/^total/ { print $1, $8; }'
1000 diff -urN coreutils-4.5.10.org/tests/misc/run coreutils-4.5.10/tests/misc/run
1001 --- coreutils-4.5.10.org/tests/misc/run Thu Jan 1 01:00:00 1970
1002 +++ coreutils-4.5.10/tests/misc/run Mon Mar 24 16:30:58 2003
1008 +use POSIX qw(geteuid getegid isatty);
1012 +$ENV{'PATH'} = $pwd . ":../../src:" . $ENV{'PATH'};
1014 +my $owner = getpwuid(geteuid());
1015 +my $group = getgrgid(getegid());
1017 +my ($OK, $FAILED) = ("ok", "failed");
1018 +if (isatty(fileno(STDOUT))) {
1019 + $OK = "\033[32m" . $OK . "\033[m";
1020 + $FAILED = "\033[31m\033[1m" . $FAILED . "\033[m";
1023 +my ($prog, $in, $out) = ([], [], []);
1026 +my ($tests, $failed);
1029 + my $script = <>; $line++;
1030 + $script =~ s/\@OWNER\@/$owner/g;
1031 + $script =~ s/\@GROUP\@/$group/g;
1032 + next if (defined($script) && $script =~ /^!/);
1033 + if (!defined($script) || $script =~ s/^\$ ?//) {
1035 + #print "[$prog_line] \$ ", join(' ', @$prog), " -- ";
1036 + my $p = [ @$prog ];
1037 + print "[$prog_line] \$ ", join(' ',
1038 + map { s/\s/\\$&/g; $_ } @$p), " -- ";
1039 + my $result = exec_test($prog, $in);
1041 + my $nmax = (@$out > @$result) ? @$out : @$result;
1042 + for (my $n=0; $n < $nmax; $n++) {
1043 + if (!defined($out->[$n]) || !defined($result->[$n]) ||
1044 + $out->[$n] ne $result->[$n]) {
1046 + #chomp $out->[$n];
1047 + #chomp $result->[$n];
1048 + #print "$out->[$n] != $result->[$n]";
1052 + $failed++ unless $good;
1053 + print $good ? $OK : $FAILED, "\n";
1055 + for (my $n=0; $n < $nmax; $n++) {
1056 + my $l = defined($out->[$n]) ? $out->[$n] : "~";
1058 + my $r = defined($result->[$n]) ? $result->[$n] : "~";
1060 + print sprintf("%-37s | %-39s\n", $l, $r);
1064 + #$prog = [ split /\s+/, $script ] if $script;
1065 + $prog = [ map { s/\\(.)/$1/g; $_ } split /(?<!\\)\s+/, $script ] if $script;
1066 + $prog_line = $line;
1069 + } elsif ($script =~ s/^> ?//) {
1070 + push @$in, $script;
1072 + $script =~ s/^[ \t]*//; # ignore leading whitespace
1073 + push @$out, $script;
1075 + last unless defined($script);
1077 +my $status = sprintf("%d commands (%d passed, %d failed)",
1078 + $tests, $tests-$failed, $failed);
1079 +if (isatty(fileno(STDOUT))) {
1081 + $status = "\033[31m\033[1m" . $status . "\033[m";
1083 + $status = "\033[32m" . $status . "\033[m";
1086 +print $status, "\n";
1088 +sub exec_test($$) {
1089 + my ($prog, $in) = @_;
1090 + local (*IN, *IN_DUP, *IN2, *OUT_DUP, *OUT, *OUT2);
1092 + if ($prog->[0] eq "umask") {
1093 + umask oct $prog->[1];
1095 + } elsif ($prog->[0] eq "cd") {
1096 + if (!chdir $prog->[1]) {
1097 + return [ "chdir: $prog->[1]: $!\n" ];
1103 + or die "Can't create pipe for reading: $!";
1104 + open *IN_DUP, "<&STDIN"
1105 + or *IN_DUP = undef;
1106 + open *STDIN, "<&IN2"
1107 + or die "Can't duplicate pipe for reading: $!";
1110 + open *OUT_DUP, ">&STDOUT"
1111 + or die "Can't duplicate STDOUT: $!";
1113 + or die "Can't create pipe for writing: $!";
1114 + open *STDOUT, ">&OUT2"
1115 + or die "Can't duplicate pipe for writing: $!";
1118 + *STDOUT->autoflush();
1119 + *OUT->autoflush();
1124 + open *STDIN, "<&IN_DUP"
1125 + or die "Can't duplicate STDIN: $!";
1127 + or die "Can't close STDIN duplicate: $!";
1129 + open *STDOUT, ">&OUT_DUP"
1130 + or die "Can't duplicate STDOUT: $!";
1132 + or die "Can't close STDOUT duplicate: $!";
1134 + foreach my $line (@$in) {
1139 + or die "Can't close pipe for writing: $!";
1144 + push @$result, $_;
1150 + or die "Can't close read end for input pipe: $!";
1152 + or die "Can't close write end for output pipe: $!";
1154 + or die "Can't close STDOUT duplicate: $!";
1156 + open ERR_DUP, ">&STDERR"
1157 + or die "Can't duplicate STDERR: $!";
1158 + open STDERR, ">&STDOUT"
1159 + or die "Can't join STDOUT and STDERR: $!";
1161 + #print ERR_DUP "<", join(' ', @$prog), ">\n";
1163 + print ERR_DUP $prog->[0], ": $!\n";
1168 --- coreutils-5.0/src/Makefile.am.orig 2003-12-28 23:21:11.000000000 +0100
1169 +++ coreutils-5.0/src/Makefile.am 2003-12-28 23:27:33.113542384 +0100
1171 # replacement functions defined in libfetish.a.
1172 LDADD = ../lib/libfetish.a @LIBINTL@ ../lib/libfetish.a
1174 -dir_LDADD = $(LDADD) @LIB_CLOCK_GETTIME@
1175 -ls_LDADD = $(LDADD) @LIB_CLOCK_GETTIME@
1176 +dir_LDADD = $(LDADD) @LIB_CLOCK_GETTIME@ $(LIBACL)
1177 +ls_LDADD = $(LDADD) @LIB_CLOCK_GETTIME@ $(LIBACL)
1178 shred_LDADD = $(LDADD) @LIB_CLOCK_GETTIME@
1179 -vdir_LDADD = $(LDADD) @LIB_CLOCK_GETTIME@
1180 +vdir_LDADD = $(LDADD) @LIB_CLOCK_GETTIME@ $(LIBACL)
1181 +cp_LDADD = $(LDADD) $(LIBACL)
1182 +ginstall_LDADD = $(LDADD) $(LIBACL)
1183 +mv_LDADD = $(LDADD) $(LIBACL)
1185 ## If necessary, add -lm to resolve use of pow in lib/strtod.c.
1186 sort_LDADD = $(LDADD) @POW_LIB@
1187 --- coreutils-5.0/po/pl.po.orig 2003-12-28 23:21:11.000000000 +0100
1188 +++ coreutils-5.0/po/pl.po 2003-12-28 23:43:19.632649608 +0100
1189 @@ -1011,6 +1011,11 @@
1190 msgid "setting permissions for %s"
1191 msgstr "nie mo¿na ustawiæ uprawnieñ do %s"
1195 +msgid "preserving permissions for %s"
1196 +msgstr "nie mo¿na zachowaæ uprawnieñ do %s"
1198 #: src/copy.c:1571 src/ln.c:326
1200 msgid "cannot un-backup %s"