diff --git a/package/base/acl/acl.desc b/package/base/acl/acl.desc index f22966869..c25788c69 100644 --- a/package/base/acl/acl.desc +++ b/package/base/acl/acl.desc @@ -36,7 +36,7 @@ [L] GPL [S] Stable [V] 2.2.32 -[P] X -?---5---9 141.100 +[P] X -?2------9 141.100 [D] 290869604 acl-2.2.32.src.tar.gz ftp://oss.sgi.com/projects/xfs/cmd_tars/ diff --git a/package/base/attr/attr.desc b/package/base/attr/attr.desc index 2f237e255..2ddc7e6b7 100644 --- a/package/base/attr/attr.desc +++ b/package/base/attr/attr.desc @@ -47,7 +47,7 @@ [L] GPL [S] Stable [V] 2.4.24 -[P] X -?---5---9 140.500 +[P] X -?2------9 140.500 [D] 1503430840 attr-2.4.24.src.tar.gz ftp://oss.sgi.com/projects/xfs/cmd_tars/ diff --git a/package/base/coreutils/acl-xattr.diff b/package/base/coreutils/acl-xattr.diff index d55b76d2d..078d09262 100644 --- a/package/base/coreutils/acl-xattr.diff +++ b/package/base/coreutils/acl-xattr.diff @@ -17,165 +17,170 @@ # # --- ROCK-COPYRIGHT-NOTE-END --- ---- /dev/null 2004-02-23 21:02:56.000000000 +0000 -+++ ./m4/posix_acl.m4 2004-03-13 11:50:03.000000000 +0000 -@@ -0,0 +1,28 @@ -+#serial 1 +Andreas Gruenbacher patches for ACL and XATTR support in coreutils. + +http://www.suse.de/~agruen/coreutils/5.91/coreutils-acl.diff +http://www.suse.de/~agruen/coreutils/5.91/coreutils-acl+posix.diff +http://www.suse.de/~agruen/coreutils/5.91/coreutils-xattr.diff + +(merged using combinediff) + +------------------------------------------------------------------------------ + +--- coreutils-5.91/doc/coreutils.texi ++++ coreutils-5.91/doc/coreutils.texi +@@ -5610,9 +5610,14 @@ + @end table + + Following the permission bits is a single character that specifies +-whether an alternate access method applies to the file. When that +-character is a space, there is no alternate access method. When it +-is a printing character (e.g., @samp{+}), then there is such a method. ++whether an alternate access method such as an access control list ++applies to the file. When the character following the permissions is a ++space, there is no alternate access method. When it is a printing ++character, then there is such a method. + -+dnl Written by Andreas Gruenbacher . ++For a file with an extended access control list, a @samp{+} character is ++listed. Basic access control lists are equivalent to the permissions ++listed, and are not considered an alternate access method. + + @item -n + @itemx --numeric-uid-gid +@@ -6345,6 +6350,18 @@ + directory in a different order). + Equivalent to @option{-dpPR}. + ++@itemx @w{@kbd{--attributes}=@var{regex}} ++@opindex --attributes ++Preserve extended attributes whose names match the specified regular ++expression. The default behavior or @command{cp} if no ++@option{--attributes} option is given is to preserve all extended ++attributes except file permissions. If @var{regex} is ``@samp{-}'', no ++extended attributes are preserved. + -+dnl Posix 1003.1e draft standard 17 (abandoned) and similar -+dnl access control list support -+AC_DEFUN([ag_POSIX_ACL], -+[ -+ AC_CHECK_HEADERS(sys/acl.h) -+ AC_CHECK_LIB(acl, main, cu_cv_lacl=yes, cu_cv_lacl=no) -+ if test "$cu_cv_lacl" = yes; then -+ LIBACL=-lacl -+ else -+ LIBACL= -+ fi -+ AC_SUBST(LIBACL) -+ OLDLIBS="$LIBS" -+ LIBS="$LIBS $LIBACL" -+ AC_CHECK_FUNCS(acl_get_file acl_set_file acl_free acl_to_text \ -+ acl_from_text acl_delete_def_file) -+ # Linux specific extensions: -+ AC_CHECK_FUNCS(acl_entries acl_extended_file) -+ LIBS="$OLDLIBS" ++This option does not affect the preservation of file permissions. ++File permission preservation is controlled by the @option{-p} or ++@option{--preserve=mode} options. + -+ if test $ac_cv_header_sys_acl_h = yes; then -+ AC_DEFINE(USE_ACL, 1, [Define if you want access control list support.]) -+ fi -+]) ---- ./m4/Makefile.am.acl 2004-03-08 09:56:31.000000000 +0000 -+++ ./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 ---- ./lib/acl.h.acl 2004-02-02 08:13:21.000000000 +0000 -+++ ./lib/acl.h 2004-03-13 11:50:03.000000000 +0000 -@@ -18,11 +18,16 @@ - - Written by Paul Eggert. */ + @item -b + @itemx @w{@kbd{--backup}[=@var{method}]} + @opindex -b +@@ -6448,7 +6465,7 @@ --#if HAVE_SYS_ACL_H && HAVE_ACL -+#if HAVE_SYS_ACL_H - # include - #endif -+#if HAVE_SYS_TYPES_H -+# include -+#endif - #if ! defined GETACLCNT && defined ACL_CNT - # define GETACLCNT ACL_CNT - #endif + @table @samp + @itemx mode +-Preserve the permission attributes. ++Preserve the permission attributes, including access control lists. + @itemx ownership + Preserve the owner and group. On most modern systems, + only the super-user may change the owner of a file, and regular users +@@ -6464,7 +6481,6 @@ + @itemx all + Preserve all file attributes. + Equivalent to specifying all of the above. +-@c Mention ACLs here. + @end table - 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); ---- ./lib/acl.c.acl 2004-02-02 08:13:21.000000000 +0000 -+++ ./lib/acl.c 2004-03-13 11:50:03.000000000 +0000 -@@ -22,18 +22,30 @@ + Using @option{--preserve} with no @var{attribute_list} is equivalent +--- coreutils-5.91/lib/acl.c ++++ coreutils-5.91/lib/acl.c +@@ -22,18 +22,35 @@ # include #endif -+#if ENABLE_NLS -+# include -+# define _(Text) gettext (Text) -+#else -+# define _(Text) Text -+#endif -+ ++#include #include #include #ifndef S_ISLNK # define S_ISLNK(Mode) 0 #endif -+#include -+ ++#include "error.h" ++#include "quote.h" #include "acl.h" ++#ifdef HAVE_ACL_LIBACL_H ++# include ++#endif ++ #include #ifndef ENOSYS # define ENOSYS (-1) #endif +#ifndef ENOTSUP +# define ENOTSUP (-1) ++#endif ++ ++#if ENABLE_NLS ++# include ++# define _(Text) gettext (Text) ++#else ++# define _(Text) Text +#endif #ifndef MIN_ACL_ENTRIES # define MIN_ACL_ENTRIES 4 -@@ -45,19 +57,201 @@ - int - file_has_acl (char const *path, struct stat const *pathstat) +@@ -47,17 +64,196 @@ { - /* FIXME: This implementation should work on recent-enough versions - of HP-UX, Solaris, and Unixware, but it simply returns 0 with - POSIX 1003.1e (draft 17 -- abandoned), AIX, GNU/Linux, Irix, and - Tru64. Please see Samba's source/lib/sysacls.c file for - fix-related ideas. */ -- - #if HAVE_ACL && defined GETACLCNT ++#if USE_ACL && HAVE_ACL && defined GETACLCNT + /* This implementation should work on recent-enough versions of HP-UX, + Solaris, and Unixware. */ -+ - if (! S_ISLNK (pathstat->st_mode)) + +-#if HAVE_ACL && defined GETACLCNT + 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 ++#elif USE_ACL && HAVE_ACL_EXTENDED_FILE ++ /* Linux specific version. */ + -+ /* 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; + } -+#else -+ /* FIXME: Add support for AIX, Irix, and Tru64, FreeBSD, etc. -+ Please see Samba's source/lib/sysacls.c file for fix-related ideas. */ - #endif - - return 0; - } ++#endif + -+/* Copy the permissions from SRC_PATH to DST_PATH, including access control -+ lists on systems where this is supported. MODE is the file mode for -+ DST_PATH, including the file type. -+ Also sets special bits in MODE on DST_PATH. */ ++ /* FIXME: Add support for POSIX 1003.1e (draft 17 -- abandoned), AIX, Irix, ++ and Tru64. Please see Samba's source/lib/sysacls.c file for fix-related ++ ideas. */ + ++ return 0; ++} ++ ++/* Copy the access control list of src_file to dst_file. Fall back to ++ src_st.st_mode if access control lists are not supported for either ++ file. */ +int -+copy_acl (char const *src_path, char const *dst_path, mode_t mode) ++copy_acl (char const *src_file, char const *dst_file, mode_t mode) +{ -+#if HAVE_ACL_GET_FILE && HAVE_ACL_SET_FILE && HAVE_ACL_FREE && \ -+ HAVE_ACL_ENTRIES -+ ++#if USE_ACL && HAVE_ACL_GET_FILE && HAVE_ACL_SET_FILE && \ ++ HAVE_ACL_FREE && HAVE_ACL_ENTRIES + /* Linux specific. Will work on all POSIX 1003.1e draft 17 (abandoned) -+ compliant systems if the acl_entries() function is implemented. */ ++ systems if the Linux specific acl_entries() function is substituted. */ + -+ acl_t acl = acl_get_file (src_path, ACL_TYPE_ACCESS); ++ acl_t acl = acl_get_file (src_file, ACL_TYPE_ACCESS); + if (acl == NULL) + { + if (errno == ENOSYS || errno == ENOTSUP) -+ return set_acl (dst_path, mode); ++ return set_acl (dst_file, mode); + else + { -+ error (0, errno, "%s", quote (src_path)); ++ error (0, errno, "%s", quote (src_file)); + return -1; + } + } + -+ if (acl_set_file (dst_path, ACL_TYPE_ACCESS, acl)) ++ if (acl_set_file (dst_file, ACL_TYPE_ACCESS, acl)) + { + int saved_errno = errno; + @@ -186,51 +191,52 @@ + acl_free (acl); + if (n == 3) + { -+ if (chmod (dst_path, mode)) ++ if (chmod (dst_file, mode)) + saved_errno = errno; + else + return 0; + } + else -+ chmod (dst_path, mode); ++ chmod (dst_file, mode); + } + else + { + acl_free (acl); -+ chmod (dst_path, mode); ++ chmod (dst_file, mode); + } + error (0, saved_errno, _("preserving permissions for %s"), -+ quote (dst_path)); ++ quote (dst_file)); + return -1; + } -+ acl_free (acl); ++ else ++ acl_free (acl); + + if (mode & (S_ISUID | S_ISGID | S_ISVTX)) + { + /* We did not call chmod so far, so the special bits have not yet + been set. */ + -+ if (chmod (dst_path, mode)) ++ if (chmod (dst_file, mode)) + { + error (0, errno, _("preserving permissions for %s"), -+ quote (dst_path)); ++ quote (dst_file)); + return -1; + } + } + + if (S_ISDIR (mode)) + { -+ acl = acl_get_file (src_path, ACL_TYPE_DEFAULT); ++ acl = acl_get_file (src_file, ACL_TYPE_DEFAULT); + if (acl == NULL) + { -+ error (0, errno, "%s", quote (src_path)); ++ error (0, errno, "%s", quote (src_file)); + return -1; + } + -+ if (acl_set_file (dst_path, ACL_TYPE_DEFAULT, acl)) ++ if (acl_set_file (dst_file, ACL_TYPE_DEFAULT, acl)) + { + error (0, errno, _("preserving permissions for %s"), -+ quote (dst_path)); ++ quote (dst_file)); + acl_free(acl); + return -1; + } @@ -239,22 +245,21 @@ + } + return 0; +#else -+ int ret = chmod (dst_path, mode); ++ int ret = chmod (dst_file, mode); + if (ret) -+ error (0, errno, _("preserving permissions for %s"), quote (dst_path)); ++ error (0, errno, _("preserving permissions for %s"), quote (dst_file)); + return ret; -+#endif + #endif +} + -+/* Set the permissions of PATH, overwriting access control lists, on systems -+ where this is supported. MODE is the file mode for PATH, including the -+ file type. Also sets special bits in MODE on PATH. */ -+ ++/* Set the access control list of path to the permissions defined by mode. */ +int +set_acl (char const *path, mode_t mode) +{ -+#if HAVE_ACL_FROM_TEXT && HAVE_ACL_SET_FILE && HAVE_ACL_FREE && \ -+ HAVE_ACL_DELETE_DEF_FILE ++#if USE_ACL && HAVE_ACL_FROM_TEXT && HAVE_ACL_SET_FILE && HAVE_ACL_FREE && \ ++ HAVE_ACL_DELETE_DEF_FILE ++ /* POSIX 1003.1e draft 17 (abandoned) specific version. */ ++ + char acl_text[] = "u::---,g::---,o::---"; + acl_t acl; + @@ -267,7 +272,7 @@ + if (mode & S_IROTH) acl_text[17] = 'r'; + if (mode & S_IWOTH) acl_text[18] = 'w'; + if (mode & S_IXOTH) acl_text[19] = 'x'; -+ + + acl = acl_from_text(acl_text); + if (!acl) + { @@ -290,7 +295,8 @@ + error (0, saved_errno, _("setting permissions for %s"), quote (path)); + return -1; + } -+ acl_free (acl); ++ else ++ acl_free (acl); + + if (mode & (S_ISUID | S_ISGID | S_ISVTX)) + { @@ -310,210 +316,586 @@ + error (0, errno, _("setting permissions for %s"), quote (path)); + return -1; + } -+ return 0; + return 0; +#else + int ret = chmod (path, mode); + if (ret) + error (0, errno, _("setting permissions for %s"), quote (path)); + return ret; +#endif + } +--- coreutils-5.91/lib/acl.h ++++ coreutils-5.91/lib/acl.h +@@ -18,11 +18,13 @@ + + Written by Paul Eggert. */ + +-#if HAVE_SYS_ACL_H && HAVE_ACL ++#if HAVE_SYS_ACL_H + # include + #endif +-#if ! defined GETACLCNT && defined ACL_CNT ++#if defined HAVE_ACL && ! defined GETACLCNT && defined ACL_CNT + # define GETACLCNT ACL_CNT + #endif + + int file_has_acl (char const *, struct stat const *); ++int copy_acl(char const *, char const *, mode_t); ++int set_acl(char const *, mode_t); +--- coreutils-5.91/src/copy.c ++++ coreutils-5.91/src/copy.c +@@ -50,6 +50,14 @@ + #include "utimens.h" + #include "xreadlink.h" + #include "yesno.h" ++#include "acl.h" ++ ++#if USE_XATTR ++# include "regex.h" ++# include ++# include ++# include ++#endif + + #ifndef HAVE_FCHMOD + # define HAVE_FCHMOD false +@@ -101,26 +109,6 @@ + /* The invocation name of this program. */ + extern char *program_name; + +-/* Encapsulate selection of the file mode to be applied to +- new non-directories. */ +- +-static mode_t +-get_dest_mode (const struct cp_options *option, mode_t mode) +-{ +- /* In some applications (e.g., install), use precisely the +- specified mode. */ +- if (option->set_mode) +- return option->mode; +- +- /* Honor the umask for `cp', but not for `mv' or `cp -p'. +- In addition, `cp' without -p must clear the set-user-ID and set-group-ID +- bits. POSIX requires it do that when creating new files. */ +- if (!option->move_mode && !option->preserve_mode) +- mode &= (option->umask_kill & ~(S_ISUID | S_ISGID)); +- +- return mode; +-} +- + /* FIXME: describe */ + /* FIXME: rewrite this to use a hash table so we avoid the quadratic + performance hit that's probably noticeable only on trees deeper +@@ -138,6 +126,104 @@ + return false; + } + ++#if USE_XATTR ++static void ++copy_attr_error (struct error_context *ctx, const char *fmt, ...) ++{ ++ int err = errno; ++ va_list ap; ++ int len; ++ char *buffer; ++ ++ /* There is no error function that takes a va_list argument, ++ so we print the message in a buffer first. */ ++ ++ va_start (ap, fmt); ++ len = vsnprintf (NULL, 0, fmt, ap); ++ if (len > 0) ++ { ++ buffer = xmalloc (len + 1); ++ vsnprintf (buffer, len + 1, fmt, ap); ++ error (0, err, "%s", buffer); ++ free (buffer); ++ } ++ va_end (ap); +} + ---- ./src/mv.c.acl 2004-02-07 15:41:02.000000000 +0000 -+++ ./src/mv.c 2004-03-13 11:50:03.000000000 +0000 -@@ -132,12 +132,6 @@ - x->mode = 0; - x->stdin_tty = isatty (STDIN_FILENO); ++static const char * ++copy_attr_quote (struct error_context *ctx, const char *str) ++{ ++ return xstrdup (quote (str)); ++} ++ ++static void ++copy_attr_free (struct error_context *ctx, const char *str) ++{ ++ free ((void *) str); ++} ++ ++struct copy_attr_context ++ { ++ struct error_context ctx; ++ const char *re_pattern; ++ struct re_pattern_buffer re_compiled; ++ } copy_attr_ctx = { ++ { copy_attr_error, ++ copy_attr_quote, ++ copy_attr_free } ++ }; ++ ++static int ++copy_attr_filter (const char *name, struct error_context *ctx) ++{ ++ struct copy_attr_context *copy_ctx = (struct copy_attr_context *) ctx; ++ ++ return (attr_copy_check_permissions (name, ctx) ++ && copy_ctx->re_pattern != NULL ++ && re_search (©_ctx->re_compiled, name, strlen (name), 0, ++ strlen (name), NULL) >= 0); ++} ++#endif /* USE_XATTR */ ++ ++static bool ++copy_extended_attributes (const char *src_path, const char *dst_path, ++ const struct cp_options *x) ++{ ++#if USE_XATTR ++ if (x->attr_pattern == NULL) ++ return true; ++ ++ if (copy_attr_ctx.re_pattern != x->attr_pattern) ++ { ++ struct re_pattern_buffer *c = ©_attr_ctx.re_compiled; ++ size_t len = strlen (x->attr_pattern); ++ const char *err; ++ ++ free (c->fastmap); ++ free (c->buffer); ++ ++ copy_attr_ctx.re_pattern = x->attr_pattern; ++ c->allocated = 2 * len; ++ c->buffer = xmalloc (c->allocated); ++ c->fastmap = xmalloc (256); ++ c->translate = 0; ++ err = re_compile_pattern (x->attr_pattern, len, c); ++ if (err) ++ { ++ free (c->fastmap); ++ free (c->buffer); ++ copy_attr_ctx.re_pattern = NULL; ++ error (EXIT_FAILURE, 0, _("%s: invalid regular expression: %s"), ++ x->attr_pattern, err); ++ } ++ } ++ return attr_copy_file (src_path, dst_path, ++ copy_attr_filter, ©_attr_ctx.ctx) == 0; ++#else /* USE_XATTR */ ++ return true; ++#endif /* USE_XATTR */ ++} ++ + /* Read the contents of the directory SRC_NAME_IN, and recursively + copy the contents to DST_NAME_IN. NEW_DST is true if + DST_NAME_IN is a directory that was created previously in the +@@ -205,7 +291,6 @@ + static bool + copy_reg (char const *src_name, char const *dst_name, + const struct cp_options *x, mode_t dst_mode, bool *new_dst, +- bool *chown_succeeded, + struct stat const *src_sb, + struct stat const *dst_sb) + { +@@ -435,9 +520,8 @@ + if (x->preserve_ownership + && (*new_dst || !SAME_OWNER_AND_GROUP (*src_sb, *dst_sb))) + { +- if (fchown (dest_desc, src_sb->st_uid, src_sb->st_gid) == 0) +- *chown_succeeded = true; +- else if (! chown_failure_ok (x)) ++ if (! fchown (dest_desc, src_sb->st_uid, src_sb->st_gid) == 0 && ++ ! chown_failure_ok (x)) + { + error (0, errno, _("failed to preserve ownership for %s"), + quote (dst_name)); +@@ -454,27 +538,6 @@ + /* FIXME: Preserve the st_author field via the file descriptor dest_desc. */ + #endif -- /* Find out the current file creation mask, to knock the right bits -- when using chmod. The creation mask is set to be liberal, so -- that created directories can be written, even if it would not -- have been allowed with the mask this process was started with. */ -- x->umask_kill = ~ umask (0); +-#if HAVE_FCHMOD +- /* Permissions of newly-created regular files were set upon `open'. +- But don't return early if there were any special bits and chown +- 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) +- { +- 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 - - x->update = 0; - x->verbose = 0; - x->dest_info = NULL; ---- ./src/ls.c.acl 2004-03-13 11:50:03.000000000 +0000 -+++ ./src/ls.c 2004-03-13 11:50:03.000000000 +0000 -@@ -188,13 +188,13 @@ + close_src_and_dst_desc: + if (close (dest_desc) < 0) + { +@@ -909,12 +972,13 @@ + struct stat dst_sb; + mode_t src_mode; + mode_t src_type; ++ mode_t dst_mode IF_LINT (= 0); ++ int dst_mode_valid = 0; + char *earlier_file = NULL; + char *dst_backup = NULL; + bool backup_succeeded = false; + bool delayed_ok; + bool copied_as_regular = false; +- bool chown_succeeded = false; + bool preserve_metadata; - enum filetype filetype; + if (x->move_mode && rename_succeeded) +@@ -1430,22 +1494,43 @@ --#if HAVE_ACL -+#if HAVE_ACL || USE_ACL - /* For long listings, true if the file has an access control list. */ - bool have_acl; + if (new_dst || !S_ISDIR (dst_sb.st_mode)) + { +- /* Create the new directory writable and searchable, so +- we can create new entries in it. */ +- +- if (mkdir (dst_name, (src_mode & x->umask_kill) | S_IRWXU) != 0) ++ if (mkdir (dst_name, src_mode) != 0) + { + error (0, errno, _("cannot create directory %s"), + quote (dst_name)); + goto un_backup; + } + ++ /* We need search and write permissions to the new directory ++ for writing the directory's contents. Check if these ++ permissions are there. */ ++ ++ if (lstat (dst_name, &dst_sb)) ++ { ++ error (0, errno, _("cannot stat %s"), quote (dst_name)); ++ goto un_backup; ++ } ++ else if ((dst_sb.st_mode & S_IRWXU) != S_IRWXU) ++ { ++ /* Make the new directory searchable and writable. The ++ original permissions will be restored later. */ ++ ++ dst_mode = dst_sb.st_mode; ++ dst_mode_valid = 1; ++ ++ if (chmod (dst_name, dst_mode | S_IRWXU)) ++ { ++ error (0, errno, _("setting permissions for %s"), ++ quote (dst_name)); ++ goto un_backup; ++ } ++ } ++ + /* Insert the created directory's inode and device + numbers into the search structure, so that we can + avoid copying it again. */ + +- if (! remember_created (dst_name)) +- goto un_backup; ++ remember_copied (dst_name, dst_sb.st_ino, dst_sb.st_dev); + + if (x->verbose) + printf ("%s -> %s\n", quote_n (0, src_name), quote_n (1, dst_name)); +@@ -1522,8 +1607,7 @@ + /* POSIX says the permission bits of the source file must be + used as the 3rd argument in the open call, but that's not consistent + with historical practice. */ +- if (! copy_reg (src_name, dst_name, x, +- get_dest_mode (x, src_mode), &new_dst, &chown_succeeded, ++ if (! copy_reg (src_name, dst_name, x, src_mode, &new_dst, + &src_sb, &dst_sb)) + goto un_backup; + } +@@ -1531,7 +1615,7 @@ + #ifdef S_ISFIFO + if (S_ISFIFO (src_type)) + { +- if (mkfifo (dst_name, get_dest_mode (x, src_mode))) ++ if (mkfifo (dst_name, src_mode)) + { + error (0, errno, _("cannot create fifo %s"), quote (dst_name)); + goto un_backup; +@@ -1542,7 +1626,7 @@ + if (S_ISBLK (src_type) || S_ISCHR (src_type) + || S_ISSOCK (src_type)) + { +- if (mknod (dst_name, get_dest_mode (x, src_mode), src_sb.st_rdev)) ++ if (mknod (dst_name, src_mode, src_sb.st_rdev)) + { + error (0, errno, _("cannot create special file %s"), + quote (dst_name)); +@@ -1654,9 +1738,8 @@ + if (!(copied_as_regular && HAVE_FCHOWN) && x->preserve_ownership + && (new_dst || !SAME_OWNER_AND_GROUP (src_sb, dst_sb))) + { +- if (chown (dst_name, src_sb.st_uid, src_sb.st_gid) == 0) +- chown_succeeded = true; +- else if (! chown_failure_ok (x)) ++ if (! chown (dst_name, src_sb.st_uid, src_sb.st_gid) == 0 && ++ ! chown_failure_ok (x)) + { + error (0, errno, _("failed to preserve ownership for %s"), + quote (dst_name)); +@@ -1682,21 +1765,30 @@ + } #endif - }; --#if HAVE_ACL -+#if HAVE_ACL || USE_ACL - # define FILE_HAS_ACL(F) ((F)->have_acl) - #else - # define FILE_HAS_ACL(F) 0 -@@ -2409,7 +2409,7 @@ - return 0; - } +- /* 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 (! copy_extended_attributes (src_name, dst_name, x)) ++ delayed_ok = false; --#if HAVE_ACL -+#if HAVE_ACL || USE_ACL - if (format == long_format) +- if ((x->preserve_mode || new_dst) +- && (x->copy_as_regular || S_ISREG (src_type) || S_ISDIR (src_type))) ++ if (x->preserve_mode || x->move_mode) + { +- if (chmod (dst_name, get_dest_mode (x, src_mode)) != 0) ++ if (copy_acl (src_name, dst_name, src_mode) && x->require_preserve) ++ return false; ++ } ++ else if (x->set_mode) ++ { ++ if (chmod (dst_name, x->mode)) { - int n = file_has_acl (path, &f->stat); ---- ./src/install.c.acl 2004-03-13 11:50:03.000000000 +0000 -+++ ./src/install.c 2004-03-13 11:50:03.000000000 +0000 -@@ -242,7 +242,6 @@ - x->mode = S_IRUSR | S_IWUSR; - x->stdin_tty = 0; +- error (0, errno, _("setting permissions for %s"), quote (dst_name)); +- if (x->set_mode || x->require_preserve) ++ error (0, errno, _("setting permissions for %s"), ++ quote (dst_name)); ++ return false; ++ } ++ } ++ else if (dst_mode_valid) ++ { ++ if (chmod (dst_name, dst_mode)) ++ { ++ error (0, errno, _("preserving permissions for %s"), ++ quote (dst_name)); ++ if (x->require_preserve) + return false; + } + } +--- coreutils-5.91/src/copy.h ++++ coreutils-5.91/src/copy.h +@@ -128,6 +128,10 @@ + bool preserve_mode; + bool preserve_timestamps; -- x->umask_kill = 0; - x->update = 0; - x->verbose = 0; - x->dest_info = NULL; ---- ./src/cp.c.acl 2004-02-07 15:55:09.000000000 +0000 -+++ ./src/cp.c 2004-03-13 11:50:03.000000000 +0000 -@@ -58,7 +58,8 @@ ++ /* Regular expression pattern that specifies which extended attributes to ++ copy. NULL stands for copying no extended attributes. */ ++ const char *attr_pattern; ++ + /* Enabled for mv, and for cp by the --preserve=links option. + If true, attempt to preserve in the destination files any + logical hard links between the source files. If used with cp's +@@ -165,9 +169,6 @@ + Create destination directories as usual. */ + bool symbolic_link; + +- /* The bits to preserve in created files' modes. */ +- mode_t umask_kill; +- + /* If true, do not copy a nondirectory that has an existing destination + with the same or newer modification time. */ + bool update; +--- coreutils-5.91/src/cp.c ++++ coreutils-5.91/src/cp.c +@@ -35,6 +35,7 @@ + #include "quotearg.h" + #include "stat-time.h" + #include "utimens.h" ++#include "acl.h" + + #define ASSIGN_BASENAME_STRDUPA(Dest, File_name) \ + do \ +@@ -56,7 +57,8 @@ need to be fixed after copying. */ struct dir_attr { -- int is_new_dir; -+ int mode_valid; +- bool is_new_dir; + mode_t mode; - int slash_offset; ++ bool mode_valid; + size_t slash_offset; struct dir_attr *next; }; -@@ -333,9 +334,14 @@ +@@ -72,7 +74,8 @@ + REPLY_OPTION, + SPARSE_OPTION, + STRIP_TRAILING_SLASHES_OPTION, +- UNLINK_DEST_BEFORE_OPENING ++ UNLINK_DEST_BEFORE_OPENING, ++ PRESERVE_XATTRS_OPTION + }; + + /* Initial number of entries in each hash table entry's table of inodes. */ +@@ -129,6 +132,7 @@ + {"parents", no_argument, NULL, PARENTS_OPTION}, + {"path", no_argument, NULL, PARENTS_OPTION}, /* Deprecated. */ + {"preserve", optional_argument, NULL, PRESERVE_ATTRIBUTES_OPTION}, ++ {"attributes", required_argument, NULL, PRESERVE_XATTRS_OPTION}, + {"recursive", no_argument, NULL, 'R'}, + {"remove-destination", no_argument, NULL, UNLINK_DEST_BEFORE_OPENING}, + {"reply", required_argument, NULL, REPLY_OPTION}, /* Deprecated 2005-07-03, +@@ -219,6 +223,13 @@ + -v, --verbose explain what is being done\n\ + -x, --one-file-system stay on this file system\n\ + "), stdout); ++ fputs(_("\n\ ++ --attributes=regex preserve extended attributes whose name\n\ ++ matches the specified regular expression\n\ ++ (defaults to preserving all extended\n\ ++ attributes except file permissions;\n\ ++ regex=`-' preserves no extended attributes).\n\ ++"), stdout); + fputs (HELP_OPTION_DESCRIPTION, stdout); + fputs (VERSION_OPTION_DESCRIPTION, stdout); + fputs (_("\ +@@ -327,9 +338,14 @@ } } -- if (x->preserve_mode || p->is_new_dir) -- { -- if (chmod (dst_path, src_sb.st_mode & x->umask_kill)) +- if (x->preserve_mode | p->is_new_dir) + if (x->preserve_mode) -+ { -+ if (copy_acl (src_path, dst_path, src_sb.st_mode)) -+ return 1; -+ } ++ { ++ if (copy_acl (src_name, dst_name, src_sb.st_mode)) ++ return false; ++ } + else if (p->mode_valid) -+ { -+ if (chmod (dst_path, p->mode)) + { +- if (chmod (dst_name, src_sb.st_mode & x->umask_kill)) ++ 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 +363,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. */ - - 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) +@@ -364,9 +379,9 @@ + + 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'. */ -+ mode_t mode; -+ int (*xstat)() = (x->dereference == DEREF_COMMAND_LINE_ARGUMENTS -+ || x->dereference == DEREF_ALWAYS -+ ? stat -+ : lstat); + char *dir; /* A copy of CONST_DIR we can change. */ +@@ -385,7 +400,7 @@ + + *attr_list = NULL; - ASSIGN_STRDUPA (dirpath, const_dirpath); +- if ((*xstat) (dst_dir, &stats)) ++ if (XSTAT (x, dst_dir, &stats)) + { + /* A parent of CONST_DIR does not exist. + Make all missing intermediate directories. */ +@@ -404,16 +419,25 @@ + *attr_list = new; -@@ -412,12 +422,20 @@ - if ((*xstat) (dirpath, &stats)) + *slash = '\0'; +- if ((*xstat) (dir, &stats)) ++ if (XSTAT (x, dir, &stats)) { - /* This element of the path does not exist. We must set ++ mode_t src_mode; ++ + /* 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, ++ *new_dst and new->mode 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; -+ -+ if ((*xstat) (src, &stats)) + make_dir_parents_private creates only e_dir/../a if + ./b already exists. */ + *new_dst = true; +- new->is_new_dir = true; +- if (mkdir (dir, mode)) ++ if (XSTAT (x, src, &stats)) + { + error (0, errno, _("failed to get attributes of %s"), + quote (src)); -+ return 1; ++ return false; + } -+ mode = stats.st_mode; ++ src_mode = stats.st_mode; + - if (mkdir (dirpath, mode)) ++ if (mkdir (dir, src_mode)) { error (0, errno, _("cannot make directory %s"), -@@ -429,6 +447,46 @@ + quote (dir)); +@@ -424,6 +448,45 @@ 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. */ ++ for writing the directory's contents. Check if these ++ permissions are there. */ + -+ if (lstat (dirpath, &stats)) -+ { ++ if (lstat (dir, &stats)) ++ { + error (0, errno, _("failed to get attributes of %s"), -+ quote (dirpath)); -+ return 1; ++ quote (dir)); ++ return false; + } + else -+ { -+ if (x->preserve_mode && mode != stats.st_mode) ++ { ++ if (x->preserve_mode) + { -+ new->mode = mode; -+ new->mode_valid = 1; ++ new->mode = src_mode; ++ new->mode_valid = (src_mode != stats.st_mode); + } + else -+ new->mode_valid = 0; ++ { ++ new->mode = stats.st_mode; ++ new->mode_valid = false; ++ } + + if ((stats.st_mode & S_IRWXU) != S_IRWXU) + { -+ /* Make the new directory writable and searchable. The -+ original permissions will be restored later. */ ++ /* Make the new directory searchable and writable. The ++ original permissions will be restored later. */ + -+ if (!new->mode_valid) -+ { -+ new->mode = stats.st_mode; -+ new->mode_valid = 1; -+ } ++ new->mode_valid = true; + -+ 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)); -+ return 1; ++ quote (dir)); ++ return false; + } + } + } } else if (!S_ISDIR (stats.st_mode)) { -@@ -438,7 +496,7 @@ +@@ -433,7 +496,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 +599,6 @@ Copy the files `file1' through `filen' to the existing directory `edir'. */ int i; @@ -522,24 +904,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 +644,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,16 +756,12 @@ /* 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 @@ -547,411 +928,216 @@ - 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 @@ + x->src_info = NULL; ++ ++ x->attr_pattern = ""; /* all extended attributes */ + } + + /* Given a string, ARG, containing a comma-separated list of arguments +@@ -894,6 +949,13 @@ + x.require_preserve = true; + break; + ++ case PRESERVE_XATTRS_OPTION: ++ if (strcmp (optarg, "-") == 0) ++ x.attr_pattern = NULL; ++ else ++ x.attr_pattern = optarg; ++ break; ++ + case PARENTS_OPTION: + parents_option = true; + break; +@@ -987,9 +1049,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) ---- ./src/copy.h.acl 2004-02-07 16:00:59.000000000 +0000 -+++ ./src/copy.h 2004-03-13 11:50:03.000000000 +0000 -@@ -143,9 +143,6 @@ - Create destination directories as usual. */ - int 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 - with the same or newer modification time. */ - int update; ---- ./src/copy.c.acl 2004-03-12 11:48:59.000000000 +0000 -+++ ./src/copy.c 2004-03-13 11:50:43.000000000 +0000 -@@ -95,26 +95,6 @@ - /* The invocation name of this program. */ - extern char *program_name; +--- coreutils-5.91/src/install.c ++++ coreutils-5.91/src/install.c +@@ -153,11 +153,12 @@ + x->mode = S_IRUSR | S_IWUSR; + x->stdin_tty = false; --/* Encapsulate selection of the file mode to be applied to -- new non-directories. */ -- --static mode_t --get_dest_mode (const struct cp_options *option, mode_t mode) --{ -- /* In some applications (e.g., install), use precisely the -- specified mode. */ -- if (option->set_mode) -- return option->mode; -- -- /* Honor the umask for `cp', but not for `mv' or `cp -p'. -- In addition, `cp' without -p must clear the set-user-ID and set-group-ID -- bits. POSIX requires it do that when creating new files. */ -- if (!option->move_mode && !option->preserve_mode) -- mode &= (option->umask_kill & ~(S_ISUID | S_ISGID)); -- -- return mode; --} -- - /* FIXME: describe */ - /* FIXME: rewrite this to use a hash table so we avoid the quadratic - performance hit that's probably noticeable only on trees deeper -@@ -817,13 +797,13 @@ - struct stat src_sb; - struct stat dst_sb; - mode_t src_mode; -- mode_t src_type; -+ mode_t dst_mode; - char *earlier_file = NULL; - char *dst_backup = NULL; - int backup_succeeded = 0; - int delayed_fail; - int copied_as_regular = 0; -- int ran_chown = 0; -+ int dst_mode_valid = 0; - int preserve_metadata; +- x->umask_kill = 0; + x->update = false; + x->verbose = false; + x->dest_info = NULL; + x->src_info = NULL; ++ ++ x->attr_pattern = NULL; /* no extended attributes */ + } - if (x->move_mode && rename_succeeded) -@@ -837,11 +817,9 @@ - return 1; - } + /* FILE is the last operand of this command. Return true if FILE is a +--- coreutils-5.91/src/ls.c ++++ coreutils-5.91/src/ls.c +@@ -193,13 +193,13 @@ struct fileinfo -- src_type = src_sb.st_mode; -- - src_mode = src_sb.st_mode; + enum filetype filetype; -- 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 @@ +-#if HAVE_ACL ++#if USE_ACL + /* For long listings, true if the file has an access control list. */ + bool have_acl; + #endif + }; - if (!S_ISDIR (dst_sb.st_mode)) - { -- if (S_ISDIR (src_type)) -+ if (S_ISDIR (src_mode)) - { - error (0, 0, - _("cannot overwrite non-directory %s with directory %s"), -@@ -935,7 +913,7 @@ - } - } +-#if HAVE_ACL ++#if USE_ACL + # define FILE_HAS_ACL(F) ((F)->have_acl) + #else + # define FILE_HAS_ACL(F) 0 +@@ -334,7 +334,7 @@ static int current_time_ns = -1; + /* Whether any of the files has an ACL. This affects the width of the + mode column. */ -- if (!S_ISDIR (src_type)) -+ if (!S_ISDIR (src_mode)) - { - if (S_ISDIR (dst_sb.st_mode)) - { -@@ -963,7 +941,7 @@ - This may be due to an interactive `negative' reply to the - prompt about the existing file. It may also be due to the - use of the --reply=no option. */ -- if (!S_ISDIR (src_type)) -+ if (!S_ISDIR (src_mode)) - { - /* cp and mv treat -i and -f differently. */ - if (x->move_mode) -@@ -1084,7 +1062,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)); - if (backup_succeeded) -@@ -1132,7 +1110,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); +-#if HAVE_ACL ++#if USE_ACL + static bool any_has_acl; + #else + enum { any_has_acl = false }; +@@ -2469,7 +2469,7 @@ clear_files (void) } -@@ -1145,7 +1123,7 @@ - /* Avoid damaging the destination filesystem 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, - then warn about copying a directory into itself. */ -@@ -1197,7 +1175,7 @@ - { - if (rename (src_path, dst_path) == 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)); - if (rename_succeeded) - *rename_succeeded = 1; -@@ -1310,7 +1288,7 @@ - In such cases, set this variable to zero. */ - preserve_metadata = 1; - -- if (S_ISDIR (src_type)) -+ if (S_ISDIR (src_mode)) - { - struct dir_list *dir; -@@ -1335,16 +1313,38 @@ + files_index = 0; +-#if HAVE_ACL ++#if USE_ACL + any_has_acl = false; + #endif + inode_number_width = 0; +@@ -2580,7 +2580,7 @@ gobble_file (char const *name, enum file + return 0; + } - if (new_dst || !S_ISDIR (dst_sb.st_mode)) +-#if HAVE_ACL ++#if USE_ACL + if (format == long_format) { -- /* 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)) - { - error (0, errno, _("cannot create directory %s"), - quote (dst_path)); - goto un_backup; - } + int n = file_has_acl (absolute_name, &f->stat); +--- coreutils-5.91/src/mv.c ++++ coreutils-5.91/src/mv.c +@@ -135,16 +135,12 @@ + x->mode = 0; + x->stdin_tty = isatty (STDIN_FILENO); -+ /* We need search and write permissions to the new directory -+ for adding the directory's contents. Check if these permissions -+ are already there. */ -+ -+ if (lstat (dst_path, &dst_sb)) -+ { -+ error (0, errno, _("cannot stat %s"), quote (dst_path)); -+ delayed_fail = 1; -+ } -+ else if ((dst_sb.st_mode & S_IRWXU) != S_IRWXU) -+ { -+ /* Make the new directory writable and searchable. The original -+ permissions will be restored later. */ -+ -+ dst_mode_valid = 1; -+ dst_mode = dst_sb.st_mode; -+ -+ if (chmod (dst_path, dst_mode | S_IRWXU)) -+ { -+ error (0, errno, _("setting permissions for %s"), -+ quote (dst_path)); -+ goto un_backup; -+ } -+ } -+ - /* 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 @@ - goto un_backup; - } - } -- else if (S_ISREG (src_type) -- || (x->copy_as_regular && !S_ISDIR (src_type) -- && !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; - /* 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)) - goto un_backup; - } - else - #ifdef S_ISFIFO -- 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)) - { - error (0, errno, _("cannot create fifo %s"), quote (dst_path)); - goto un_backup; -@@ -1444,10 +1443,10 @@ - } - else - #endif -- if (S_ISBLK (src_type) || S_ISCHR (src_type) -- || S_ISSOCK (src_type)) -+ if (S_ISBLK (src_mode) || S_ISCHR (src_mode) -+ || S_ISSOCK (src_mode)) - { -- if (mknod (dst_path, get_dest_mode (x, src_mode), src_sb.st_rdev)) -+ if (mknod (dst_path, src_mode, src_sb.st_rdev)) - { - error (0, errno, _("cannot create special file %s"), - quote (dst_path)); -@@ -1456,7 +1455,7 @@ - } - else - #ifdef S_ISLNK -- if (S_ISLNK (src_type)) -+ if (S_ISLNK (src_mode)) - { - char *src_link_val = xreadlink (src_path); - if (src_link_val == NULL) -@@ -1560,7 +1559,25 @@ - if (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.) */ -+ -+ if ((src_mode & (S_ISUID | S_ISGID)) -+ && !x->preserve_mode && !x->move_mode && !x->set_mode) -+ { -+ if (lstat (dst_path, &dst_sb)) -+ { -+ error (0, errno, _("cannot stat %s"), quote (dst_path)); -+ delayed_fail = 1; -+ } -+ else -+ { -+ dst_mode_valid = 1; -+ dst_mode = dst_sb.st_mode; -+ } -+ } +- /* Find out the current file creation mask, to knock the right bits +- when using chmod. The creation mask is set to be liberal, so +- that created directories can be written, even if it would not +- have been allowed with the mask this process was started with. */ +- x->umask_kill = ~ umask (0); +- + x->update = false; + x->verbose = false; + x->dest_info = NULL; + x->src_info = NULL; + - 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 @@ - } - #endif ++ x->attr_pattern = ""; /* all extended attributes */ + } -- /* 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; -- -- 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))) -- { -- error (0, errno, _("setting permissions for %s"), quote (dst_path)); -- if (x->set_mode || x->require_preserve) -+ if (copy_acl (src_path, dst_path, src_mode) && x->require_preserve) -+ return 1; -+ } -+ else if (x->set_mode) -+ { -+ if (set_acl (dst_path, x->mode) && x->require_preserve) -+ return 1; -+ } -+ else if (dst_mode_valid) -+ { -+ if (chmod (dst_path, dst_mode)) -+ { -+ error (0, errno, _("preserving permissions for %s"), -+ quote (dst_path)); -+ if (x->require_preserve) - return 1; - } - } ---- ./src/Makefile.am.acl 2004-02-02 08:12:57.000000000 +0000 -+++ ./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 - --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) --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) ---- ./configure.ac.acl 2004-03-02 22:47:31.000000000 +0000 -+++ ./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 @@ - AM_GNU_GETTEXT([external], [need-ngettext]) - AM_GNU_GETTEXT_VERSION(0.13.1) + /* FILE is the last operand of this command. Return true if FILE is a +--- coreutils-5.91/m4/acl.m4 ++++ coreutils-5.91/m4/acl.m4 +@@ -14,5 +14,22 @@ AC_DEFUN([AC_FUNC_ACL], -+ag_POSIX_ACL -+ - AC_CONFIG_FILES( - Makefile - doc/Makefile ---- ./config.hin.acl 2004-03-11 08:59:16.000000000 +0000 -+++ ./config.hin 2004-03-13 11:50:03.000000000 +0000 -@@ -96,6 +96,30 @@ - /* Define to 1 if you have the `acl' function. */ - #undef HAVE_ACL + dnl Prerequisites of lib/acl.c. + AC_CHECK_HEADERS(sys/acl.h) ++ if test "$ac_cv_header_sys_acl_h" = yes; then ++ use_acl=1 ++ else ++ use_acl=0 ++ fi ++ AC_DEFINE_UNQUOTED(USE_ACL, $use_acl, ++ [Define if you want access control list support.]) + AC_CHECK_FUNCS(acl) ++ ac_save_LIBS="$LIBS" ++ AC_SEARCH_LIBS(acl_get_file, acl, ++ [test "$ac_cv_search_acl_get_file" = "none required" || ++ LIB_ACL=$ac_cv_search_acl_get_file]) ++ AC_SUBST(LIB_ACL) ++ AC_CHECK_HEADERS(acl/libacl.h) ++ AC_CHECK_FUNCS(acl_get_file acl_set_file acl_free acl_to_text \ ++ acl_from_text acl_delete_def_file \ ++ acl_entries acl_extended_file) ++ LIBS="$ac_save_LIBS" + ]) +--- coreutils-5.91/src/Makefile.am ++++ coreutils-5.91/src/Makefile.am +@@ -92,6 +92,17 @@ -+/* Define to 1 if you have the `acl_delete_def_file' function. */ -+#undef HAVE_ACL_DELETE_DEF_FILE -+ -+/* Define to 1 if you have the `acl_entries' function. */ -+#undef HAVE_ACL_ENTRIES + su_LDADD = $(LDADD) $(LIB_CRYPT) + ++dir_LDADD += $(LIB_ACL) ++ls_LDADD += $(LIB_ACL) ++vdir_LDADD += $(LIB_ACL) ++cp_LDADD += $(LIB_ACL) ++mv_LDADD += $(LIB_ACL) ++ginstall_LDADD += $(LIB_ACL) + -+/* Define to 1 if you have the `acl_extended_file' function. */ -+#undef HAVE_ACL_EXTENDED_FILE ++cp_LDADD += $(LIB_XATTR) ++mv_LDADD += $(LIB_XATTR) ++ginstall_LDADD += $(LIB_XATTR) + -+/* Define to 1 if you have the `acl_free' function. */ -+#undef HAVE_ACL_FREE + $(PROGRAMS): ../lib/libcoreutils.a + + SUFFIXES = .sh +--- coreutils-5.91/configure.ac ++++ coreutils-5.91/configure.ac +@@ -248,6 +248,9 @@ AC_CHECK_DECLS([strtoimax, strtoumax]) + + cu_LIB_CHECK + ++# Extended attribute copying. ++AC_FUNC_XATTR + -+/* Define to 1 if you have the `acl_from_text' function. */ -+#undef HAVE_ACL_FROM_TEXT + AM_GNU_GETTEXT([external], [need-ngettext]) + AM_GNU_GETTEXT_VERSION(0.13.1) + +--- coreutils-5.91/m4/xattr.m4 ++++ coreutils-5.91/m4/xattr.m4 +@@ -0,0 +1,38 @@ ++# xattr.m4 - check for Extended Attributes (Linux) + -+/* Define to 1 if you have the `acl_get_file' function. */ -+#undef HAVE_ACL_GET_FILE ++# Copyright (C) 2003 Free Software Foundation, Inc. + -+/* Define to 1 if you have the `acl_set_file' function. */ -+#undef HAVE_ACL_SET_FILE ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2, or (at your option) ++# any later version. + -+/* Define to 1 if you have the `acl_to_text' function. */ -+#undef HAVE_ACL_TO_TEXT ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. + - /* Define to 1 if you have the `alarm' function. */ - #undef HAVE_ALARM - -@@ -489,6 +513,9 @@ - /* Define to 1 if you have the `lchown' function. */ - #undef HAVE_LCHOWN - -+/* Define to 1 if you have the `acl' library (-lacl). */ -+#undef HAVE_LIBACL ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software Foundation, ++# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + - /* Define to 1 if you have the `dgc' library (-ldgc). */ - #undef HAVE_LIBDGC - -@@ -1335,6 +1362,9 @@ - . */ - #undef UMAX4_3 - -+/* Define if you want access control list support. */ -+#undef USE_ACL ++# Written by Andreas Gruenbacher. + - /* Version number of package */ - #undef VERSION - ++AC_DEFUN([AC_FUNC_XATTR], ++[ ++ AC_CHECK_HEADERS(attr/error_context.h attr/libattr.h) ++ if test "$ac_cv_header_attr_libattr_h" = yes \ ++ && test "$ac_cv_header_attr_error_context_h" = yes; then ++ use_xattr=1 ++ else ++ use_xattr=0 ++ fi ++ AC_DEFINE_UNQUOTED(USE_XATTR, $use_xattr, ++ [Define if you want extended attribute support.]) ++ xattr_saved_LIBS=$LIBS ++ AC_SEARCH_LIBS(attr_copy_file, attr, ++ [test "$ac_cv_search_attr_copy_file" = "none required" || LIB_XATTR=$ac_cv_search_attr_copy_file]) ++ AC_SUBST(LIB_XATTR) ++ AC_CHECK_FUNCS(attr_copy_file) ++ LIBS=$xattr_saved_LIBS ++]) diff --git a/package/base/coreutils/coreutils.conf b/package/base/coreutils/coreutils.conf index 9669864d3..75f25c6e3 100644 --- a/package/base/coreutils/coreutils.conf +++ b/package/base/coreutils/coreutils.conf @@ -49,7 +49,7 @@ coreutils_postmake() { chmod +x $root/usr/bin/shuffle } -if [ $stagelevel -ge 3 -a -f $root/var/adm/flists/acl ]; then +if [ $stagelevel -ge 3 ]; then var_append patchfiles " " $confdir/acl-xattr.diff fi @@ -61,3 +61,10 @@ fi # a newer version will be installed by tar later var_append flist''del '|' "usr/lib/charset.alias" + +# disable some file provided by other packages: +# uptime, groups, hostname, id, kill, su +# +var_append INSTALL_WRAPPER_FILTER "|" "sed -r 's,.*/share/man/.*/(uptime|groups|hostname|id|kill|su).1\$,$builddir/dummy,'" +var_append INSTALL_WRAPPER_FILTER "|" "sed -r 's,.*/bin/(uptime|groups|hostname|id|kill|su)\$,$builddir/dummy,'" + diff --git a/package/base/coreutils/no-broken-progs-in.patch b/package/base/coreutils/no-broken-progs-in.patch deleted file mode 100644 index 53abf95a0..000000000 --- a/package/base/coreutils/no-broken-progs-in.patch +++ /dev/null @@ -1,262 +0,0 @@ -# --- ROCK-COPYRIGHT-NOTE-BEGIN --- -# -# This copyright note is auto-generated by ./scripts/Create-CopyPatch. -# Please add additional copyright information _after_ the line containing -# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by -# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! -# -# ROCK Linux: rock-src/package/base/coreutils/no-broken-progs-in.patch -# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf -# -# This patch file is dual-licensed. It is available under the license the -# patched project is licensed under, as long as it is an OpenSource license -# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms -# of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# --- ROCK-COPYRIGHT-NOTE-END --- - ---- ./Makefile.in.orig 2004-10-01 19:05:13.027154464 +0200 -+++ ./Makefile.in 2004-10-01 19:04:44.930425816 +0200 -@@ -148,7 +148,7 @@ - $(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \ - $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \ - $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \ -- $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \ -+ $(top_srcdir)/m4/unlocked-io.m4 \ - $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \ - $(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \ - $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \ ---- ./configure.orig 2004-10-01 19:04:58.239402544 +0200 -+++ ./configure 2004-10-01 19:04:44.924426728 +0200 -@@ -47462,8 +47462,7 @@ - echo "$as_me:$LINENO: result: $gnulib_cv_have_boot_time" >&5 - echo "${ECHO_T}$gnulib_cv_have_boot_time" >&6 - if test $gnulib_cv_have_boot_time = yes; then -- OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uptime\$(EXEEXT)" -- MAN="$MAN uptime.1" -+echo "uptime is surpressed" - fi - - ---- ./man/Makefile.in.orig 2004-10-01 19:05:24.542403880 +0200 -+++ ./man/Makefile.in 2004-10-01 19:05:56.565535624 +0200 -@@ -142,7 +142,7 @@ - $(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \ - $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \ - $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \ -- $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \ -+ $(top_srcdir)/m4/unlocked-io.m4 \ - $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \ - $(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \ - $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \ -@@ -302,14 +302,14 @@ - dist_man_MANS = \ - basename.1 cat.1 chgrp.1 chmod.1 chown.1 chroot.1 cksum.1 comm.1 \ - cp.1 csplit.1 cut.1 date.1 dd.1 df.1 dir.1 dircolors.1 dirname.1 du.1 \ -- echo.1 env.1 expand.1 expr.1 factor.1 false.1 fmt.1 fold.1 groups.1 \ -- head.1 hostid.1 hostname.1 id.1 install.1 join.1 kill.1 \ -+ echo.1 env.1 expand.1 expr.1 factor.1 false.1 fmt.1 fold.1 \ -+ head.1 hostid.1 id.1 install.1 join.1 \ - link.1 ln.1 logname.1 \ - ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nice.1 nl.1 nohup.1 od.1 \ - paste.1 pathchk.1 pinky.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \ - rm.1 rmdir.1 seq.1 sha1sum.1 shred.1 sleep.1 sort.1 split.1 stat.1 stty.1 \ -- su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \ -- tty.1 uname.1 unexpand.1 uniq.1 unlink.1 uptime.1 users.1 vdir.1 wc.1 \ -+ sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \ -+ tty.1 uname.1 unexpand.1 uniq.1 unlink.1 users.1 vdir.1 wc.1 \ - who.1 whoami.1 yes.1 - - man_aux = $(dist_man_MANS:.1=.x) -@@ -568,14 +568,11 @@ - false.1: $(common_dep) $(srcdir)/false.x ../src/false.c - fmt.1: $(common_dep) $(srcdir)/fmt.x ../src/fmt.c - fold.1: $(common_dep) $(srcdir)/fold.x ../src/fold.c --groups.1: $(common_dep) $(srcdir)/groups.x ../src/groups.sh - head.1: $(common_dep) $(srcdir)/head.x ../src/head.c - hostid.1: $(common_dep) $(srcdir)/hostid.x ../src/hostid.c --hostname.1: $(common_dep) $(srcdir)/hostname.x ../src/hostname.c - id.1: $(common_dep) $(srcdir)/id.x ../src/id.c - install.1: $(common_dep) $(srcdir)/install.x ../src/install.c - join.1: $(common_dep) $(srcdir)/join.x ../src/join.c --kill.1: $(common_dep) $(srcdir)/kill.x ../src/kill.c - link.1: $(common_dep) $(srcdir)/link.x ../src/link.c - ln.1: $(common_dep) $(srcdir)/ln.x ../src/ln.c - logname.1: $(common_dep) $(srcdir)/logname.x ../src/logname.c -@@ -608,7 +605,6 @@ - split.1: $(common_dep) $(srcdir)/split.x ../src/split.c - stat.1: $(common_dep) $(srcdir)/stat.x ../src/stat.c - stty.1: $(common_dep) $(srcdir)/stty.x ../src/stty.c --su.1: $(common_dep) $(srcdir)/su.x ../src/su.c - sum.1: $(common_dep) $(srcdir)/sum.x ../src/sum.c - sync.1: $(common_dep) $(srcdir)/sync.x ../src/sync.c - tac.1: $(common_dep) $(srcdir)/tac.x ../src/tac.c -@@ -624,7 +620,6 @@ - unexpand.1: $(common_dep) $(srcdir)/unexpand.x ../src/unexpand.c - uniq.1: $(common_dep) $(srcdir)/uniq.x ../src/uniq.c - unlink.1: $(common_dep) $(srcdir)/unlink.x ../src/unlink.c --uptime.1: $(common_dep) $(srcdir)/uptime.x ../src/uptime.c - users.1: $(common_dep) $(srcdir)/users.x ../src/users.c - vdir.1: $(common_dep) $(srcdir)/vdir.x ../src/ls.c - wc.1: $(common_dep) $(srcdir)/wc.x ../src/wc.c -@@ -656,7 +651,7 @@ - check-x-vs-1: - PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \ - t=ls-files.$$$$; \ -- (cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\ -+ (cd $(srcdir) && ls -1 *.x) | grep -v 'uptime.x' | grep -v 'kill.x' | sed 's/\.x$$//' | $(ASSORT) > $$t; \ - echo $(dist_man_MANS) | tr -s ' ' '\n' | sed 's/\.1$$//' \ - | $(ASSORT) | diff - $$t || { rm $$t; exit 1; }; \ - rm $$t ---- ./src/Makefile.in.orig 2004-10-01 19:05:35.737701936 +0200 -+++ ./src/Makefile.in 2004-10-01 19:04:44.941424144 +0200 -@@ -39,7 +39,7 @@ - host_triplet = @host@ - EXTRA_PROGRAMS = chroot$(EXEEXT) df$(EXEEXT) hostid$(EXEEXT) \ - nice$(EXEEXT) pinky$(EXEEXT) stty$(EXEEXT) su$(EXEEXT) \ -- uname$(EXEEXT) uptime$(EXEEXT) users$(EXEEXT) who$(EXEEXT) -+ uname$(EXEEXT) users$(EXEEXT) who$(EXEEXT) - bin_PROGRAMS = [$(EXEEXT) chgrp$(EXEEXT) chown$(EXEEXT) chmod$(EXEEXT) \ - cp$(EXEEXT) dd$(EXEEXT) dircolors$(EXEEXT) du$(EXEEXT) \ - ginstall$(EXEEXT) link$(EXEEXT) ln$(EXEEXT) dir$(EXEEXT) \ -@@ -55,8 +55,8 @@ - tail$(EXEEXT) tr$(EXEEXT) tsort$(EXEEXT) unexpand$(EXEEXT) \ - uniq$(EXEEXT) wc$(EXEEXT) basename$(EXEEXT) date$(EXEEXT) \ - dirname$(EXEEXT) echo$(EXEEXT) env$(EXEEXT) expr$(EXEEXT) \ -- factor$(EXEEXT) false$(EXEEXT) hostname$(EXEEXT) id$(EXEEXT) \ -- kill$(EXEEXT) logname$(EXEEXT) pathchk$(EXEEXT) \ -+ factor$(EXEEXT) false$(EXEEXT) id$(EXEEXT) \ -+ logname$(EXEEXT) pathchk$(EXEEXT) \ - printenv$(EXEEXT) printf$(EXEEXT) pwd$(EXEEXT) seq$(EXEEXT) \ - sleep$(EXEEXT) tee$(EXEEXT) test$(EXEEXT) true$(EXEEXT) \ - tty$(EXEEXT) whoami$(EXEEXT) yes$(EXEEXT) $(am__EXEEXT_1) \ -@@ -169,7 +169,7 @@ - $(top_srcdir)/m4/ullong_max.m4 $(top_srcdir)/m4/ulonglong.m4 \ - $(top_srcdir)/m4/unicodeio.m4 $(top_srcdir)/m4/unistd-safer.m4 \ - $(top_srcdir)/m4/unlink-busy.m4 $(top_srcdir)/m4/unlinkdir.m4 \ -- $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/uptime.m4 \ -+ $(top_srcdir)/m4/unlocked-io.m4 \ - $(top_srcdir)/m4/userspec.m4 $(top_srcdir)/m4/utimbuf.m4 \ - $(top_srcdir)/m4/utime.m4 $(top_srcdir)/m4/utimecmp.m4 \ - $(top_srcdir)/m4/utimens.m4 $(top_srcdir)/m4/utimes-null.m4 \ -@@ -621,29 +621,29 @@ - $(chown_SOURCES) chroot.c cksum.c comm.c $(cp_SOURCES) \ - csplit.c cut.c date.c dd.c df.c $(dir_SOURCES) dircolors.c \ - dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c \ -- fmt.c fold.c $(ginstall_SOURCES) head.c hostid.c hostname.c \ -- id.c join.c kill.c link.c ln.c logname.c $(ls_SOURCES) \ -+ fmt.c fold.c $(ginstall_SOURCES) head.c hostid.c \ -+ id.c join.c link.c ln.c logname.c $(ls_SOURCES) \ - $(md5sum_SOURCES) mkdir.c mkfifo.c mknod.c $(mv_SOURCES) \ - nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c \ - printenv.c printf.c ptx.c pwd.c readlink.c $(rm_SOURCES) \ - rmdir.c seq.c setuidgid.c $(sha1sum_SOURCES) shred.c sleep.c \ - sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c tail.c \ - tee.c test.c touch.c tr.c true.c tsort.c tty.c uname.c \ -- unexpand.c uniq.c unlink.c uptime.c users.c $(vdir_SOURCES) \ -+ unexpand.c uniq.c unlink.c users.c $(vdir_SOURCES) \ - wc.c who.c whoami.c yes.c - DIST_SOURCES = $(__SOURCES) basename.c cat.c $(chgrp_SOURCES) chmod.c \ - $(chown_SOURCES) chroot.c cksum.c comm.c $(cp_SOURCES) \ - csplit.c cut.c date.c dd.c df.c $(dir_SOURCES) dircolors.c \ - dirname.c du.c echo.c env.c expand.c expr.c factor.c false.c \ -- fmt.c fold.c $(ginstall_SOURCES) head.c hostid.c hostname.c \ -- id.c join.c kill.c link.c ln.c logname.c $(ls_SOURCES) \ -+ fmt.c fold.c $(ginstall_SOURCES) head.c hostid.c \ -+ id.c join.c link.c ln.c logname.c $(ls_SOURCES) \ - $(md5sum_SOURCES) mkdir.c mkfifo.c mknod.c $(mv_SOURCES) \ - nice.c nl.c nohup.c od.c paste.c pathchk.c pinky.c pr.c \ - printenv.c printf.c ptx.c pwd.c readlink.c $(rm_SOURCES) \ - rmdir.c seq.c setuidgid.c $(sha1sum_SOURCES) shred.c sleep.c \ - sort.c split.c stat.c stty.c su.c sum.c sync.c tac.c tail.c \ - tee.c test.c touch.c tr.c true.c tsort.c tty.c uname.c \ -- unexpand.c uniq.c unlink.c uptime.c users.c $(vdir_SOURCES) \ -+ unexpand.c uniq.c unlink.c users.c $(vdir_SOURCES) \ - wc.c who.c whoami.c yes.c - HEADERS = $(noinst_HEADERS) - ETAGS = etags -@@ -786,14 +786,14 @@ - sharedstatedir = @sharedstatedir@ - sysconfdir = @sysconfdir@ - target_alias = @target_alias@ --bin_SCRIPTS = groups -+bin_SCRIPTS = - noinst_HEADERS = \ - system.h checksum.h copy.h cp-hash.h ls.h dircolors.h remove.h \ - chown-core.h fs.h \ - wheel.h wheel-size.h - - EXTRA_DIST = dcgen dircolors.hin tac-pipe.c \ -- groups.sh wheel-gen.pl extract-magic -+ wheel-gen.pl extract-magic - - CLEANFILES = $(SCRIPTS) su - AM_CPPFLAGS = -I.. -I$(srcdir) -I$(top_srcdir)/lib -I../lib -@@ -840,7 +840,6 @@ - nanosec_libs = $(LDADD) $(POW_LIB) $(LIB_NANOSLEEP) - sleep_LDADD = $(nanosec_libs) - tail_LDADD = $(nanosec_libs) --uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS) - su_LDADD = $(LDADD) $(LIB_CRYPT) - SUFFIXES = .sh - installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'` -@@ -1067,18 +1066,12 @@ - hostid$(EXEEXT): $(hostid_OBJECTS) $(hostid_DEPENDENCIES) - @rm -f hostid$(EXEEXT) - $(LINK) $(hostid_LDFLAGS) $(hostid_OBJECTS) $(hostid_LDADD) $(LIBS) --hostname$(EXEEXT): $(hostname_OBJECTS) $(hostname_DEPENDENCIES) -- @rm -f hostname$(EXEEXT) -- $(LINK) $(hostname_LDFLAGS) $(hostname_OBJECTS) $(hostname_LDADD) $(LIBS) - id$(EXEEXT): $(id_OBJECTS) $(id_DEPENDENCIES) - @rm -f id$(EXEEXT) - $(LINK) $(id_LDFLAGS) $(id_OBJECTS) $(id_LDADD) $(LIBS) - join$(EXEEXT): $(join_OBJECTS) $(join_DEPENDENCIES) - @rm -f join$(EXEEXT) - $(LINK) $(join_LDFLAGS) $(join_OBJECTS) $(join_LDADD) $(LIBS) --kill$(EXEEXT): $(kill_OBJECTS) $(kill_DEPENDENCIES) -- @rm -f kill$(EXEEXT) -- $(LINK) $(kill_LDFLAGS) $(kill_OBJECTS) $(kill_LDADD) $(LIBS) - link$(EXEEXT): $(link_OBJECTS) $(link_DEPENDENCIES) - @rm -f link$(EXEEXT) - $(LINK) $(link_LDFLAGS) $(link_OBJECTS) $(link_LDADD) $(LIBS) -@@ -1226,9 +1219,6 @@ - unlink$(EXEEXT): $(unlink_OBJECTS) $(unlink_DEPENDENCIES) - @rm -f unlink$(EXEEXT) - $(LINK) $(unlink_LDFLAGS) $(unlink_OBJECTS) $(unlink_LDADD) $(LIBS) --uptime$(EXEEXT): $(uptime_OBJECTS) $(uptime_DEPENDENCIES) -- @rm -f uptime$(EXEEXT) -- $(LINK) $(uptime_LDFLAGS) $(uptime_OBJECTS) $(uptime_LDADD) $(LIBS) - users$(EXEEXT): $(users_OBJECTS) $(users_DEPENDENCIES) - @rm -f users$(EXEEXT) - $(LINK) $(users_LDFLAGS) $(users_OBJECTS) $(users_LDADD) $(LIBS) -@@ -1318,11 +1308,9 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fold.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/head.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostid.Po@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostname.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/id.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/install.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/join.Po@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbracket.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ln.Po@am__quote@ -@@ -1378,7 +1366,6 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unexpand.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uniq.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/users.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wc.Po@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/who.Po@am__quote@ -@@ -1606,7 +1593,7 @@ - && can_create_suid_root_executable=yes; \ - rm -f $$TMPFILE; \ - if test $$can_create_suid_root_executable = yes; then \ -- $(INSTALL_SU); \ -+ echo "Installation of su is surpressed"; \ - else \ - echo "WARNING: insufficient access; not installing su"; \ - echo "NOTE: to install su, run 'make install-root' as root"; \