SHA256
1
0
forked from pool/coreutils
OBS User unknown 2009-02-23 11:44:46 +00:00 committed by Git OBS Bridge
parent c21d4ad3e5
commit 82441f080b
13 changed files with 823 additions and 738 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:49d2f703e2310e6328cb6f9d9bae3612c42b3ee5175f449692c5b95e453cf18a
size 9001890

View File

@ -1,8 +1,162 @@
Index: src/Makefile.am
================================================================================
--- Makefile.in
+++ Makefile.in
@@ -732,6 +732,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_LIBS = @PAM_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POSIX_SHELL = @POSIX_SHELL@
--- configure
+++ configure
@@ -612,6 +612,7 @@ OPTIONAL_BIN_PROGS
INSTALL_SU
LIB_GMP
LIB_CRYPT
+PAM_LIBS
WERROR_CFLAGS
SEQ_LIBM
LIB_CAP
@@ -1231,6 +1232,7 @@ with_included_regex
enable_xattr
enable_libcap
enable_gcc_warnings
+enable_pam
with_gmp
enable_install_program
enable_no_install_program
@@ -1877,6 +1879,7 @@ Optional Features:
--disable-xattr do not support extended attributes
--disable-libcap disable libcap support
--enable-gcc-warnings turn on lots of GCC warnings (not recommended)
+ --disable-pam Enable PAM support in su (default=auto)
--enable-install-program=PROG_LIST
install the programs in PROG_LIST (comma-separated,
default: none)
@@ -26931,7 +26934,6 @@ fi
-
XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'"
@@ -39096,6 +39098,111 @@ $as_echo "#define HAVE_WORKING_FORK 1" >
fi
+# Check whether --enable-pam was given.
+if test "${enable_pam+set}" = set; then
+ enableval=$enable_pam;
+else
+ enable_pam=yes
+fi
+
+if test "x$enable_pam" != xno; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5
+$as_echo_n "checking for pam_start in -lpam... " >&6; }
+if test "${ac_cv_lib_pam_pam_start+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpam $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pam_start ();
+int
+main ()
+{
+return pam_start ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then
+ ac_cv_lib_pam_pam_start=yes
+else
+ ac_cv_lib_pam_pam_start=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5
+$as_echo "$ac_cv_lib_pam_pam_start" >&6; }
+if test "x$ac_cv_lib_pam_pam_start" = x""yes; then
+ enable_pam=yes
+else
+ enable_pam=no
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for misc_conv in -lpam_misc" >&5
+$as_echo_n "checking for misc_conv in -lpam_misc... " >&6; }
+if test "${ac_cv_lib_pam_misc_misc_conv+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpam_misc $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char misc_conv ();
+int
+main ()
+{
+return misc_conv ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then
+ ac_cv_lib_pam_misc_misc_conv=yes
+else
+ ac_cv_lib_pam_misc_misc_conv=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_misc_misc_conv" >&5
+$as_echo "$ac_cv_lib_pam_misc_misc_conv" >&6; }
+if test "x$ac_cv_lib_pam_misc_misc_conv" = x""yes; then
+ :
+else
+ enable_pam=no
+fi
+
+ if test "x$enable_pam" != xno; then
+
+$as_echo "#define USE_PAM 1" >>confdefs.h
+
+ PAM_LIBS="-lpam -lpam_misc"
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable PAM support in su" >&5
+$as_echo_n "checking whether to enable PAM support in su... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_pam" >&5
+$as_echo "$enable_pam" >&6; }
+
optional_bin_progs=
for ac_func in uname
do
--- configure.ac
+++ configure.ac
@@ -46,6 +46,20 @@ coreutils_MACROS
@@ -79,6 +79,20 @@ fi
AC_FUNC_FORK
@ -21,11 +175,51 @@ Index: src/Makefile.am
+AC_MSG_RESULT([$enable_pam])
+
optional_bin_progs=
AC_CHECK_FUNCS(uname,
AC_CHECK_FUNCS([uname],
gl_ADD_PROG([optional_bin_progs], [uname]))
--- doc/Makefile.in
+++ doc/Makefile.in
@@ -713,6 +713,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_LIBS = @PAM_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POSIX_SHELL = @POSIX_SHELL@
--- gnulib-tests/Makefile.in
+++ gnulib-tests/Makefile.in
@@ -1421,6 +1421,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_LIBS = @PAM_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POSIX_SHELL = @POSIX_SHELL@
--- lib/Makefile.in
+++ lib/Makefile.in
@@ -763,6 +763,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_LIBS = @PAM_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POSIX_SHELL = @POSIX_SHELL@
--- man/Makefile.in
+++ man/Makefile.in
@@ -703,6 +703,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_LIBS = @PAM_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POSIX_SHELL = @POSIX_SHELL@
--- src/Makefile.am
+++ src/Makefile.am
@@ -124,7 +124,8 @@ tail_LDADD = $(nanosec_libs)
@@ -147,7 +147,8 @@ tail_LDADD = $(nanosec_libs)
# If necessary, add -lm to resolve use of pow in lib/strtod.c.
uptime_LDADD = $(LDADD) $(POW_LIB) $(GETLOADAVG_LIBS)
@ -33,8 +227,82 @@ Index: src/Makefile.am
+su_SOURCES = su.c getdef.c
+su_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS)
dir_LDADD += $(LIB_ACL_TRIVIAL) $(LIB_ACL)
ls_LDADD += $(LIB_ACL_TRIVIAL) $(LIB_ACL)
dir_LDADD += $(LIB_ACL)
ls_LDADD += $(LIB_ACL)
--- src/Makefile.in
+++ src/Makefile.in
@@ -605,9 +605,10 @@ stty_OBJECTS = stty.$(OBJEXT)
stty_LDADD = $(LDADD)
stty_DEPENDENCIES = libver.a ../lib/libcoreutils.a \
$(am__DEPENDENCIES_1) ../lib/libcoreutils.a
-su_SOURCES = su.c
-su_OBJECTS = su.$(OBJEXT)
-su_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+am_su_OBJECTS = su.$(OBJEXT) getdef.$(OBJEXT)
+su_OBJECTS = $(am_su_OBJECTS)
+su_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
sum_SOURCES = sum.c
sum_OBJECTS = sum.$(OBJEXT)
sum_LDADD = $(LDADD)
@@ -735,11 +736,11 @@ SOURCES = $(nodist_libver_a_SOURCES) $(_
$(rm_SOURCES) $(rmdir_SOURCES) runcon.c seq.c setuidgid.c \
$(sha1sum_SOURCES) $(sha224sum_SOURCES) $(sha256sum_SOURCES) \
$(sha384sum_SOURCES) $(sha512sum_SOURCES) shred.c shuf.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 $(timeout_SOURCES) touch.c tr.c true.c \
- truncate.c tsort.c tty.c $(uname_SOURCES) unexpand.c uniq.c \
- unlink.c uptime.c users.c $(vdir_SOURCES) wc.c who.c whoami.c \
- yes.c
+ sleep.c sort.c split.c stat.c stty.c $(su_SOURCES) sum.c \
+ sync.c tac.c tail.c tee.c test.c $(timeout_SOURCES) touch.c \
+ tr.c true.c truncate.c tsort.c tty.c $(uname_SOURCES) \
+ unexpand.c uniq.c unlink.c uptime.c users.c $(vdir_SOURCES) \
+ wc.c who.c whoami.c yes.c
DIST_SOURCES = $(__SOURCES) $(arch_SOURCES) base64.c basename.c cat.c \
chcon.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 \
@@ -754,10 +755,10 @@ DIST_SOURCES = $(__SOURCES) $(arch_SOURC
$(rmdir_SOURCES) runcon.c seq.c setuidgid.c $(sha1sum_SOURCES) \
$(sha224sum_SOURCES) $(sha256sum_SOURCES) $(sha384sum_SOURCES) \
$(sha512sum_SOURCES) shred.c shuf.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 \
- $(timeout_SOURCES) touch.c tr.c true.c truncate.c tsort.c \
- tty.c $(uname_SOURCES) unexpand.c uniq.c unlink.c uptime.c \
- users.c $(vdir_SOURCES) wc.c who.c whoami.c yes.c
+ stat.c stty.c $(su_SOURCES) sum.c sync.c tac.c tail.c tee.c \
+ test.c $(timeout_SOURCES) touch.c tr.c true.c truncate.c \
+ tsort.c tty.c $(uname_SOURCES) unexpand.c uniq.c unlink.c \
+ uptime.c users.c $(vdir_SOURCES) wc.c who.c whoami.c yes.c
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
@@ -1209,6 +1210,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_LIBS = @PAM_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POSIX_SHELL = @POSIX_SHELL@
@@ -1511,7 +1513,8 @@ tail_LDADD = $(nanosec_libs)
# If necessary, add -lm to resolve use of pow in lib/strtod.c.
uptime_LDADD = $(LDADD) $(POW_LIB) $(GETLOADAVG_LIBS)
-su_LDADD = $(LDADD) $(LIB_CRYPT)
+su_SOURCES = su.c getdef.c
+su_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS)
stat_LDADD = $(LDADD) $(LIB_SELINUX)
# programs that use getaddrinfo (e.g., via canon_host)
@@ -2040,6 +2043,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/false.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fold.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdef.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getlimits.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-copy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-cp-hash.Po@am__quote@
--- src/getdef.c
+++ src/getdef.c
@@ -0,0 +1,259 @@
@ -401,25 +669,25 @@ Index: src/Makefile.am
#define DEFAULT_USER "root"
+#ifndef USE_PAM
char *crypt ();
char *crypt (char const *key, char const *salt);
+#endif
char *getusershell ();
void endusershell ();
void setusershell ();
char *getusershell (void);
void endusershell (void);
void setusershell (void);
extern char **environ;
+#ifdef USE_PAM
+static bool _pam_session_opened;
+static bool _pam_cred_established;
+static void export_pamenv(void);
+static void create_watching_parent(void);
+static void export_pamenv (void);
+static void create_watching_parent (void);
+#endif
+
static void run_shell (char const *, char const *, char **, size_t)
ATTRIBUTE_NORETURN;
@@ -215,7 +238,162 @@ log_su (struct passwd const *pw, bool su
@@ -212,7 +235,162 @@ log_su (struct passwd const *pw, bool su
}
#endif
@ -582,7 +850,7 @@ Index: src/Makefile.am
Return true if the user gives the correct password for entry PW,
false if not. Return true without asking for a password if run by UID 0
or if PW has an empty password. */
@@ -223,10 +402,52 @@ log_su (struct passwd const *pw, bool su
@@ -220,10 +398,52 @@ log_su (struct passwd const *pw, bool su
static bool
correct_password (const struct passwd *pw)
{
@ -636,7 +904,7 @@ Index: src/Makefile.am
endspent ();
if (sp)
@@ -247,6 +468,7 @@ correct_password (const struct passwd *p
@@ -244,6 +464,7 @@ correct_password (const struct passwd *p
encrypted = crypt (unencrypted, correct);
memset (unencrypted, 0, strlen (unencrypted));
return STREQ (encrypted, correct);
@ -644,7 +912,7 @@ Index: src/Makefile.am
}
/* Update `environ' for the new shell based on PW, with SHELL being
@@ -271,8 +493,8 @@ modify_environment (const struct passwd
@@ -268,8 +489,8 @@ modify_environment (const struct passwd
xsetenv ("USER", pw->pw_name);
xsetenv ("LOGNAME", pw->pw_name);
xsetenv ("PATH", (pw->pw_uid
@ -655,7 +923,7 @@ Index: src/Makefile.am
}
else
{
@@ -282,6 +504,12 @@ modify_environment (const struct passwd
@@ -279,6 +500,12 @@ modify_environment (const struct passwd
{
xsetenv ("HOME", pw->pw_dir);
xsetenv ("SHELL", shell);
@ -668,7 +936,7 @@ Index: src/Makefile.am
if (pw->pw_uid)
{
xsetenv ("USER", pw->pw_name);
@@ -289,19 +517,41 @@ modify_environment (const struct passwd
@@ -286,19 +513,41 @@ modify_environment (const struct passwd
}
}
}
@ -712,7 +980,7 @@ Index: src/Makefile.am
if (setgid (pw->pw_gid))
error (EXIT_FAILURE, errno, _("cannot set group id"));
if (setuid (pw->pw_uid))
@@ -494,6 +744,7 @@ main (int argc, char **argv)
@@ -491,6 +740,7 @@ main (int argc, char **argv)
#ifdef SYSLOG_FAILURE
log_su (pw, false);
#endif
@ -720,10 +988,11 @@ Index: src/Makefile.am
error (EXIT_FAILURE, 0, _("incorrect password"));
}
#ifdef SYSLOG_SUCCESS
@@ -515,9 +766,21 @@ main (int argc, char **argv)
@@ -512,9 +762,21 @@ main (int argc, char **argv)
shell = NULL;
}
shell = xstrdup (shell ? shell : pw->pw_shell);
- modify_environment (pw, shell);
+
+ init_groups (pw);
+
@ -731,15 +1000,24 @@ Index: src/Makefile.am
+ create_watching_parent ();
+ /* Now we're in the child. */
+#endif
+
+ change_identity (pw);
change_identity (pw);
+
+ /* Set environment after pam_open_session, which may put KRB5CCNAME
+ into the pam_env, etc. */
+
modify_environment (pw, shell);
- change_identity (pw);
+ modify_environment (pw, shell);
+
if (simulate_login && chdir (pw->pw_dir) != 0)
error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
--- tests/Makefile.in
+++ tests/Makefile.in
@@ -677,6 +677,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_LIBS = @PAM_LIBS@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
POSIX_SHELL = @POSIX_SHELL@

View File

@ -1,25 +1,183 @@
Index: lib/Makefile.am
===================================================================
--- lib/Makefile.am.orig
--- lib/Makefile.am
+++ lib/Makefile.am
@@ -20,6 +20,7 @@
@@ -18,6 +18,7 @@
include gnulib.mk
AM_CFLAGS = $(WARNING_CFLAGS) $(WERROR_CFLAGS)
AM_CFLAGS = $(WARN_CFLAGS) # $(WERROR_CFLAGS)
+AM_CFLAGS += -fpie
noinst_PROGRAMS = t-fpending
LDADD = $(noinst_LIBRARIES)
Index: src/Makefile.am
===================================================================
--- src/Makefile.am.orig
libcoreutils_a_SOURCES += \
buffer-lcm.c buffer-lcm.h \
--- lib/Makefile.in
+++ lib/Makefile.in
@@ -1169,7 +1169,7 @@ GPERF = gperf
LINK_WARNING_H = $(top_srcdir)/build-aux/link-warning.h
charset_alias = $(DESTDIR)$(libdir)/charset.alias
charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
-AM_CFLAGS = $(WARN_CFLAGS) # $(WERROR_CFLAGS)
+AM_CFLAGS = $(WARN_CFLAGS) -fpie
all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
--- src/Makefile.am
+++ src/Makefile.am
@@ -104,6 +104,8 @@ uptime_LDADD = $(LDADD) $(POW_LIB) $(GET
@@ -149,6 +149,10 @@ uptime_LDADD = $(LDADD) $(POW_LIB) $(GET
su_SOURCES = su.c getdef.c
su_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS)
+su_CFLAGS = -fpie
+su_LDFLAGS = -pie
+timeout_CFLAGS = -fpie
+timeout_LDFLAGS = -pie
dir_LDADD += $(LIB_ACL)
ls_LDADD += $(LIB_ACL)
--- src/Makefile.in
+++ src/Makefile.in
@@ -605,10 +605,12 @@ stty_OBJECTS = stty.$(OBJEXT)
stty_LDADD = $(LDADD)
stty_DEPENDENCIES = libver.a ../lib/libcoreutils.a \
$(am__DEPENDENCIES_1) ../lib/libcoreutils.a
-am_su_OBJECTS = su.$(OBJEXT) getdef.$(OBJEXT)
+am_su_OBJECTS = su-su.$(OBJEXT) su-getdef.$(OBJEXT)
su_OBJECTS = $(am_su_OBJECTS)
su_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
+su_LINK = $(CCLD) $(su_CFLAGS) $(CFLAGS) $(su_LDFLAGS) $(LDFLAGS) -o \
+ $@
sum_SOURCES = sum.c
sum_OBJECTS = sum.$(OBJEXT)
sum_LDADD = $(LDADD)
@@ -633,9 +635,12 @@ tee_DEPENDENCIES = libver.a ../lib/libco
test_SOURCES = test.c
test_OBJECTS = test.$(OBJEXT)
test_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
-am_timeout_OBJECTS = timeout.$(OBJEXT) operand2sig.$(OBJEXT)
+am_timeout_OBJECTS = timeout-timeout.$(OBJEXT) \
+ timeout-operand2sig.$(OBJEXT)
timeout_OBJECTS = $(am_timeout_OBJECTS)
timeout_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+timeout_LINK = $(CCLD) $(timeout_CFLAGS) $(CFLAGS) $(timeout_LDFLAGS) \
+ $(LDFLAGS) -o $@
touch_SOURCES = touch.c
touch_OBJECTS = touch.$(OBJEXT)
touch_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
@@ -1515,6 +1520,10 @@ tail_LDADD = $(nanosec_libs)
uptime_LDADD = $(LDADD) $(POW_LIB) $(GETLOADAVG_LIBS)
su_SOURCES = su.c getdef.c
su_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS)
+su_CFLAGS = -fpie
+su_LDFLAGS = -pie
+timeout_CFLAGS = -fpie
+timeout_LDFLAGS = -pie
stat_LDADD = $(LDADD) $(LIB_SELINUX)
# programs that use getaddrinfo (e.g., via canon_host)
@@ -1933,7 +1942,7 @@ stty$(EXEEXT): $(stty_OBJECTS) $(stty_DE
$(LINK) $(stty_OBJECTS) $(stty_LDADD) $(LIBS)
su$(EXEEXT): $(su_OBJECTS) $(su_DEPENDENCIES)
@rm -f su$(EXEEXT)
- $(LINK) $(su_OBJECTS) $(su_LDADD) $(LIBS)
+ $(su_LINK) $(su_OBJECTS) $(su_LDADD) $(LIBS)
sum$(EXEEXT): $(sum_OBJECTS) $(sum_DEPENDENCIES)
@rm -f sum$(EXEEXT)
$(LINK) $(sum_OBJECTS) $(sum_LDADD) $(LIBS)
@@ -1954,7 +1963,7 @@ test$(EXEEXT): $(test_OBJECTS) $(test_DE
$(LINK) $(test_OBJECTS) $(test_LDADD) $(LIBS)
timeout$(EXEEXT): $(timeout_OBJECTS) $(timeout_DEPENDENCIES)
@rm -f timeout$(EXEEXT)
- $(LINK) $(timeout_OBJECTS) $(timeout_LDADD) $(LIBS)
+ $(timeout_LINK) $(timeout_OBJECTS) $(timeout_LDADD) $(LIBS)
touch$(EXEEXT): $(touch_OBJECTS) $(touch_DEPENDENCIES)
@rm -f touch$(EXEEXT)
$(LINK) $(touch_OBJECTS) $(touch_LDADD) $(LIBS)
@@ -2043,7 +2052,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/false.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fmt.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fold.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdef.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getlimits.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-copy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ginstall-cp-hash.Po@am__quote@
@@ -2104,14 +2112,16 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/split.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stty.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/su.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/su-getdef.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/su-su.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sum.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tac.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tail.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeout.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeout-operand2sig.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeout-timeout.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/touch.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/true.Po@am__quote@
@@ -2286,6 +2296,62 @@ sha512sum-md5sum.obj: md5sum.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sha512sum_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sha512sum-md5sum.obj `if test -f 'md5sum.c'; then $(CYGPATH_W) 'md5sum.c'; else $(CYGPATH_W) '$(srcdir)/md5sum.c'; fi`
+su-su.o: su.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -MT su-su.o -MD -MP -MF $(DEPDIR)/su-su.Tpo -c -o su-su.o `test -f 'su.c' || echo '$(srcdir)/'`su.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/su-su.Tpo $(DEPDIR)/su-su.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='su.c' object='su-su.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -c -o su-su.o `test -f 'su.c' || echo '$(srcdir)/'`su.c
+
+su-su.obj: su.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -MT su-su.obj -MD -MP -MF $(DEPDIR)/su-su.Tpo -c -o su-su.obj `if test -f 'su.c'; then $(CYGPATH_W) 'su.c'; else $(CYGPATH_W) '$(srcdir)/su.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/su-su.Tpo $(DEPDIR)/su-su.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='su.c' object='su-su.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -c -o su-su.obj `if test -f 'su.c'; then $(CYGPATH_W) 'su.c'; else $(CYGPATH_W) '$(srcdir)/su.c'; fi`
+
+su-getdef.o: getdef.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -MT su-getdef.o -MD -MP -MF $(DEPDIR)/su-getdef.Tpo -c -o su-getdef.o `test -f 'getdef.c' || echo '$(srcdir)/'`getdef.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/su-getdef.Tpo $(DEPDIR)/su-getdef.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getdef.c' object='su-getdef.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -c -o su-getdef.o `test -f 'getdef.c' || echo '$(srcdir)/'`getdef.c
+
+su-getdef.obj: getdef.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -MT su-getdef.obj -MD -MP -MF $(DEPDIR)/su-getdef.Tpo -c -o su-getdef.obj `if test -f 'getdef.c'; then $(CYGPATH_W) 'getdef.c'; else $(CYGPATH_W) '$(srcdir)/getdef.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/su-getdef.Tpo $(DEPDIR)/su-getdef.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='getdef.c' object='su-getdef.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(su_CFLAGS) $(CFLAGS) -c -o su-getdef.obj `if test -f 'getdef.c'; then $(CYGPATH_W) 'getdef.c'; else $(CYGPATH_W) '$(srcdir)/getdef.c'; fi`
+
+timeout-timeout.o: timeout.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -MT timeout-timeout.o -MD -MP -MF $(DEPDIR)/timeout-timeout.Tpo -c -o timeout-timeout.o `test -f 'timeout.c' || echo '$(srcdir)/'`timeout.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/timeout-timeout.Tpo $(DEPDIR)/timeout-timeout.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='timeout.c' object='timeout-timeout.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -c -o timeout-timeout.o `test -f 'timeout.c' || echo '$(srcdir)/'`timeout.c
+
+timeout-timeout.obj: timeout.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -MT timeout-timeout.obj -MD -MP -MF $(DEPDIR)/timeout-timeout.Tpo -c -o timeout-timeout.obj `if test -f 'timeout.c'; then $(CYGPATH_W) 'timeout.c'; else $(CYGPATH_W) '$(srcdir)/timeout.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/timeout-timeout.Tpo $(DEPDIR)/timeout-timeout.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='timeout.c' object='timeout-timeout.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -c -o timeout-timeout.obj `if test -f 'timeout.c'; then $(CYGPATH_W) 'timeout.c'; else $(CYGPATH_W) '$(srcdir)/timeout.c'; fi`
+
+timeout-operand2sig.o: operand2sig.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -MT timeout-operand2sig.o -MD -MP -MF $(DEPDIR)/timeout-operand2sig.Tpo -c -o timeout-operand2sig.o `test -f 'operand2sig.c' || echo '$(srcdir)/'`operand2sig.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/timeout-operand2sig.Tpo $(DEPDIR)/timeout-operand2sig.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='operand2sig.c' object='timeout-operand2sig.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -c -o timeout-operand2sig.o `test -f 'operand2sig.c' || echo '$(srcdir)/'`operand2sig.c
+
+timeout-operand2sig.obj: operand2sig.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -MT timeout-operand2sig.obj -MD -MP -MF $(DEPDIR)/timeout-operand2sig.Tpo -c -o timeout-operand2sig.obj `if test -f 'operand2sig.c'; then $(CYGPATH_W) 'operand2sig.c'; else $(CYGPATH_W) '$(srcdir)/operand2sig.c'; fi`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/timeout-operand2sig.Tpo $(DEPDIR)/timeout-operand2sig.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='operand2sig.c' object='timeout-operand2sig.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(timeout_CFLAGS) $(CFLAGS) -c -o timeout-operand2sig.obj `if test -f 'operand2sig.c'; then $(CYGPATH_W) 'operand2sig.c'; else $(CYGPATH_W) '$(srcdir)/operand2sig.c'; fi`
+
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \

View File

@ -1,6 +1,16 @@
--- configure
+++ configure
@@ -3029,7 +3029,6 @@ as_fn_append ac_func_list " fchmod"
as_fn_append ac_func_list " alarm"
as_fn_append ac_header_list " sys/statvfs.h"
as_fn_append ac_header_list " sys/select.h"
-gl_printf_safe=yes
as_fn_append ac_func_list " readlink"
as_fn_append ac_header_list " utmp.h"
as_fn_append ac_header_list " utmpx.h"
--- doc/coreutils.texi
+++ doc/coreutils.texi
@@ -67,8 +67,6 @@
@@ -66,8 +66,6 @@
* fold: (coreutils)fold invocation. Wrap long input lines.
* groups: (coreutils)groups invocation. Print group names a user is in.
* head: (coreutils)head invocation. Output the first part of files.
@ -9,29 +19,37 @@
* id: (coreutils)id invocation. Print user identity.
* install: (coreutils)install invocation. Copy and change attributes.
* join: (coreutils)join invocation. Join lines on a common field.
@@ -402,8 +400,6 @@ System context
@@ -195,7 +193,7 @@ Free Documentation License''.
* File name manipulation:: dirname basename pathchk
* Working context:: pwd stty printenv tty
* User information:: id logname whoami groups users who
-* System context:: date uname hostname hostid uptime
+* System context:: date uname uptime
* SELinux context:: chcon runcon
* Modified command invocation:: chroot env nice nohup su timeout
* Process control:: kill
@@ -409,8 +407,6 @@ System context
* arch invocation:: Print machine hardware name
* date invocation:: Print or set system date and time
* uname invocation:: Print system information
-* hostname invocation:: Print or set system name
-* hostid invocation:: Print numeric host identifier.
-* hostid invocation:: Print numeric host identifier
* uptime invocation:: Print system uptime and load
@command{date}: Print or set system date and time
@@ -12523,8 +12519,6 @@ information.
@@ -12969,8 +12965,6 @@ information.
* arch invocation:: Print machine hardware name.
* date invocation:: Print or set system date and time.
* uname invocation:: Print system information.
-* hostname invocation:: Print or set system name.
-* hostid invocation:: Print numeric host identifier.
* uptime invocation:: Print system uptime and load
@end menu
@@ -13304,55 +13298,6 @@ Print the kernel version.
@@ -13928,54 +13922,6 @@ Print the kernel version.
@exitstatus
-
-@node hostname invocation
-@section @command{hostname}: Print or set system name
-
@ -80,12 +98,12 @@
-
-@exitstatus
-
@node uptime invocation
@section @command{uptime}: Print system uptime and load
@node Modified command invocation
@chapter Modified command invocation
--- gnulib-tests/test-isnanl.h
+++ gnulib-tests/test-isnanl.h
@@ -59,7 +59,7 @@ main ()
@@ -75,7 +75,7 @@ main ()
/* Quiet NaN. */
ASSERT (isnanl (0.0L / 0.0L));
@ -94,7 +112,7 @@
/* A bit pattern that is different from a Quiet NaN. With a bit of luck,
it's a Signalling NaN. */
{
@@ -101,6 +101,7 @@ main ()
@@ -117,6 +117,7 @@ main ()
{ LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
ASSERT (isnanl (x.value));
}
@ -102,7 +120,7 @@
/* The isnanl function should recognize Pseudo-NaNs, Pseudo-Infinities,
Pseudo-Zeroes, Unnormalized Numbers, and Pseudo-Denormals, as defined in
Intel IA-64 Architecture Software Developer's Manual, Volume 1:
@@ -134,6 +135,7 @@ main ()
@@ -150,6 +151,7 @@ main ()
ASSERT (isnanl (x.value));
}
#endif
@ -112,7 +130,7 @@
}
--- m4/gnulib-comp.m4
+++ m4/gnulib-comp.m4
@@ -260,7 +260,6 @@ AC_DEFUN([gl_INIT],
@@ -287,7 +287,6 @@ AC_DEFUN([gl_INIT],
gl_POSIXVER
gl_FUNC_PRINTF_FREXP
gl_FUNC_PRINTF_FREXPL
@ -122,7 +140,18 @@
AM_XGETTEXT_OPTION([--keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'])])
--- man/Makefile.am
+++ man/Makefile.am
@@ -179,7 +179,7 @@ check-x-vs-1:
@@ -184,7 +184,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;\
- (echo $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT) \
+ (echo $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT) hostid \
| tr -s ' ' '\n' | sed 's/\.1$$//') \
| $(ASSORT) -u | diff - $$t || { rm $$t; exit 1; }; \
rm $$t
--- man/Makefile.in
+++ man/Makefile.in
@@ -1275,7 +1275,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;\
@ -133,7 +162,7 @@
rm $$t
--- src/system.h
+++ src/system.h
@@ -168,7 +168,7 @@ enum
@@ -156,7 +156,7 @@ enum
# define DEV_BSIZE BBSIZE
#endif
#ifndef DEV_BSIZE
@ -144,7 +173,7 @@
/* Extract or fake data from a `struct stat'.
--- tests/misc/help-version
+++ tests/misc/help-version
@@ -178,6 +178,7 @@ lbracket_args=": ]"
@@ -182,6 +182,7 @@ lbracket_args=": ]"
for i in $built_programs; do
# Skip these.
case $i in chroot|stty|tty|false|chcon|runcon) continue;; esac

3
coreutils-7.1.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a584c6ce92f390c684dac00032e5c790ecc15cb0fa3e61891ac62401832ae108
size 3967824

View File

@ -1,44 +0,0 @@
2005-10-20 Andreas Gruenbacher <agruen@suse.de>
* Add support for access control lists and extended attributes
(see below).
* lib/acl.h: Remove HAVE_ACL symbol; <sys/acl.h> is needed for POSIX
ACLs even if there is no acl system call.
* lib/acl.c (file_has_acl, copy_acl, set_acl): Add Linux/POSIX ACL
implementation.
* src/copy.c (get_dest_mode): Remove, no longer correct with acls.
* src/copy.c (copy_internal): Check effective permissions after
mkdir(). Add S_IRWXU only after saving the default permissions,
so that the default permissions can be restored. This is needed
with POSIX 1003.1e draft 17 acls. Add dst_mode and dst_mode_valid,
which are set when the destination file mode is changed
temporarily. Remove obsolete ran_chown.
* src/copy.c (copy_internal): Use copy_acl and set_acl instead of
chmod.
* src/copy.c: Add --attributes option for controlling which extended
attributes to copy.
* src/cp.c (make_path_private): Remove the mode parameter. Pass in
cp_options, instead of cp_options->xstat only. Stat the source dir,
and create the destination dir with the source dir's mode as create
mode (see analog change to src/copy.c (copy_internal)). Check if the
effective permissions include S_IRWXU. Remember the original mode
only if needed later.
* src/cp.c, src/install.c, src/mv.c, src/copy.h: Remove umask_kill,
and never change the startup umask. The functions creating files
need the original umask to create the correct permissions inside
directories with default ACLs.
* src/cp.c (struct dir_attr, re_protect, make_path_private): Replace
is_new_dir by mode and mode_valid variables.
* src/ls.c: change `HAVE_ACL' to `USE_ACL' for POSIX ACLs: POSIX ACLs
have no acl syscall.

View File

@ -1,38 +1,35 @@
--- src/fs.h
+++ src/fs.h 2008-11-19 12:28:00.977049694 +0100
@@ -34,6 +34,7 @@
# define S_MAGIC_MINIX_V2_30 0x2478
# define S_MAGIC_MSDOS 0x4D44
# define S_MAGIC_NCP 0x564C
+++ src/fs.h
@@ -5,10 +5,12 @@
#if defined __linux__
# define S_MAGIC_ADFS 0xADF5
# define S_MAGIC_AFFS 0xADFF
+# define S_MAGIC_AFS 0x6B414653
# define S_MAGIC_NFS 0x6969
# define S_MAGIC_NFSD 0x6E667364
# define S_MAGIC_NTFS 0x5346544E
@@ -44,6 +45,7 @@
# define S_MAGIC_REISERFS 0x52654973
# define S_MAGIC_ROMFS 0x7275
# define S_MAGIC_SMB 0x517B
# define S_MAGIC_AUTOFS 0x187
# define S_MAGIC_BEFS 0x42465331
# define S_MAGIC_BFS 0x1BADFACE
# define S_MAGIC_BINFMT_MISC 0x42494e4d
+# define S_MAGIC_CIFS 0xFF534D42
# define S_MAGIC_SQUASHFS 0x73717368
# define S_MAGIC_SYSFS 0x62656572
# define S_MAGIC_SYSV2 0x012FF7B6
# define S_MAGIC_CODA 0x73757245
# define S_MAGIC_COH 0x012FF7B7
# define S_MAGIC_CRAMFS 0x28CD3D45
--- src/stat.c
+++ src/stat.c 2008-11-19 12:28:26.235780004 +0100
@@ -283,6 +283,8 @@ human_fstype (STRUCT_STATVFS const *stat
return "msdos";
case S_MAGIC_NCP: /* 0x564C */
return "novell";
+++ src/stat.c
@@ -219,6 +219,8 @@ human_fstype (STRUCT_STATVFS const *stat
return "adfs";
case S_MAGIC_AFFS: /* 0xADFF */
return "affs";
+ case S_MAGIC_AFS: /* 0x6B414653 */
+ return "afs";
case S_MAGIC_NFS: /* 0x6969 */
return "nfs";
case S_MAGIC_NFSD: /* 0x6E667364 */
@@ -303,6 +305,8 @@ human_fstype (STRUCT_STATVFS const *stat
return "romfs";
case S_MAGIC_SMB: /* 0x517B */
return "smb";
case S_MAGIC_AUTOFS: /* 0x187 */
return "autofs";
case S_MAGIC_BEFS: /* 0x42465331 */
@@ -227,6 +229,8 @@ human_fstype (STRUCT_STATVFS const *stat
return "bfs";
case S_MAGIC_BINFMT_MISC: /* 0x42494e4d */
return "binfmt_misc";
+ case S_MAGIC_CIFS: /* 0xFF534D42 */
+ return "cifs";
case S_MAGIC_SQUASHFS: /* 0x73717368 */
return "squashfs";
case S_MAGIC_SYSFS: /* 0x62656572 */
case S_MAGIC_CODA: /* 0x73757245 */
return "coda";
case S_MAGIC_COH: /* 0x012FF7B7 */

View File

@ -1,15 +1,16 @@
Index: coreutils-6.9.90/gnulib-tests/test-getaddrinfo.c
===================================================================
--- coreutils-6.9.90.orig/gnulib-tests/test-getaddrinfo.c 2007-11-17 07:59:42.000000000 +0100
+++ coreutils-6.9.90/gnulib-tests/test-getaddrinfo.c 2007-12-12 11:25:49.000000000 +0100
@@ -61,6 +61,10 @@ int simple (char *host, char *service)
if (res == EAI_SERVICE)
return 0;
+ /* Do not fail this test for temporary name resolution errors. */
+ if (res == EAI_AGAIN)
================================================================================
--- coreutils-7.1/gnulib-tests/test-getaddrinfo.c
+++ coreutils-7.1/gnulib-tests/test-getaddrinfo.c
@@ -71,10 +71,7 @@ int simple (char *host, char *service)
the test merely because someone is down the country on their
in-law's farm. */
if (res == EAI_AGAIN)
- {
- fprintf (stderr, "skipping getaddrinfo test: no network?\n");
- return 77;
- }
+ return 0;
+
return 1;
}
/* IRIX reports EAI_NONAME for "https". Don't fail the test
merely because of this. */
if (res == EAI_NONAME)

View File

@ -1,308 +0,0 @@
Index: coreutils-6.2/configure.ac
================================================================================
--- coreutils-6.9.89.48-96961/configure.ac
+++ coreutils-6.9.89.48-96961/configure.ac
@@ -325,6 +325,9 @@ CONFIG_STATUS_DEPENDENCIES='$(top_srcdir
AC_SUBST([CONFIG_STATUS_DEPENDENCIES])
############################################################################
+# Extended attribute copying.
+AC_FUNC_XATTR
+
AM_GNU_GETTEXT([external], [need-formatstring-macros])
AM_GNU_GETTEXT_VERSION([0.15])
--- coreutils-6.9.89.48-96961/doc/coreutils.texi
+++ coreutils-6.9.89.48-96961/doc/coreutils.texi
@@ -7087,6 +7087,8 @@ Preserve in the destination files
any links between corresponding source files.
@c Give examples illustrating how hard links are preserved.
@c Also, show how soft links map to hard links with -L and -H.
+@itemx xattrs
+Preserve extended attributes. (See /etc/xattr.conf.)
@itemx all
Preserve all file attributes.
Equivalent to specifying all of the above.
--- coreutils-6.9.89.48-96961/m4/xattr.m4
+++ coreutils-6.9.89.48-96961/m4/xattr.m4
@@ -0,0 +1,38 @@
+# xattr.m4 - check for Extended Attributes (Linux)
+
+# Copyright (C) 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Written by Andreas Gruenbacher.
+
+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
+])
--- coreutils-6.9.89.48-96961/src/Makefile.am
+++ coreutils-6.9.89.48-96961/src/Makefile.am
@@ -135,6 +135,10 @@ ginstall_LDADD += $(LIB_ACL)
stat_LDADD = $(LDADD) $(LIB_SELINUX)
+cp_LDADD += $(LIB_XATTR)
+mv_LDADD += $(LIB_XATTR)
+ginstall_LDADD += $(LIB_XATTR)
+
$(PROGRAMS): ../lib/libcoreutils.a
# Get the release year from ../lib/version-etc.c.
--- coreutils-6.9.89.48-96961/src/copy.c
+++ coreutils-6.9.89.48-96961/src/copy.c
@@ -56,6 +56,12 @@
#include "areadlink.h"
#include "yesno.h"
+#if USE_XATTR
+# include <stdarg.h>
+# include <attr/error_context.h>
+# include <attr/libattr.h>
+#endif
+
#ifndef HAVE_FCHOWN
# define HAVE_FCHOWN false
# define fchown(fd, uid, gid) (-1)
@@ -113,6 +119,98 @@ is_ancestor (const struct stat *sb, cons
return false;
}
+#if USE_XATTR
+static void
+copy_xattr_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);
+ va_end (ap);
+ if (len > 0)
+ {
+ buffer = xmalloc (len + 1);
+ va_start (ap, fmt);
+ vsnprintf (buffer, len + 1, fmt, ap);
+ va_end (ap);
+ error (0, err, "%s", buffer);
+ free (buffer);
+ }
+}
+
+static const char *
+copy_xattr_quote (struct error_context *ctx, const char *str)
+{
+ return xstrdup (quote (str));
+}
+
+static void
+copy_xattr_free (struct error_context *ctx, const char *str)
+{
+ free ((void *) str);
+}
+
+struct copy_xattr_context {
+ struct error_context ctx;
+ struct cp_options *x;
+};
+
+static int
+copy_xattr_filter (const char *name, struct error_context *ctx)
+{
+ struct copy_xattr_context *copy_ctx = (struct copy_xattr_context *) ctx;
+ int action;
+
+ /* We handle POSIX ACLs separately. */
+ if (!strcmp(name, "system.posix_acl_access")
+ || !strcmp(name, "system.posix_acl_default"))
+ return 0;
+
+ action = attr_copy_action(name, ctx);
+ return (action != ATTR_ACTION_SKIP &&
+ (!copy_ctx->x->preserve_mode
+ || action != ATTR_ACTION_PERMISSIONS));
+}
+#endif /* USE_XATTR */
+
+static bool
+copy_xattrs (const char *src_path, int source_desc, const char *dst_path,
+ int dest_desc, const struct cp_options *x)
+{
+ struct copy_xattr_context copy_xattr_ctx = {
+ { copy_xattr_error,
+ copy_xattr_quote,
+ copy_xattr_free },
+ x
+ };
+
+#if USE_XATTR
+ if (x->preserve_xattrs)
+ {
+ int ret;
+
+ if (source_desc != -1 && dest_desc != -1)
+ ret = attr_copy_fd(src_path, source_desc, dst_path, dest_desc,
+ copy_xattr_filter, &copy_xattr_ctx.ctx);
+ else
+ ret = attr_copy_file (src_path, dst_path,
+ copy_xattr_filter, &copy_xattr_ctx.ctx);
+ return ret == 0 || !x->require_preserve;
+ }
+ else
+ return true;
+#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
@@ -640,6 +738,9 @@ copy_reg (char const *src_name, char con
}
}
+ if (!copy_xattrs (src_name, source_desc, dst_name, dest_desc, x))
+ return_val = false;
+
set_author (dst_name, dest_desc, src_sb);
if (x->preserve_mode || x->move_mode)
@@ -1939,6 +2040,9 @@ copy_internal (char const *src_name, cha
}
}
+ if (!copy_xattrs (src_name, -1, dst_name, -1, x))
+ delayed_ok = false;
+
set_author (dst_name, -1, &src_sb);
if (x->preserve_mode || x->move_mode)
--- coreutils-6.9.89.48-96961/src/copy.h
+++ coreutils-6.9.89.48-96961/src/copy.h
@@ -134,6 +134,9 @@ struct cp_options
bool preserve_mode;
bool preserve_timestamps;
+ /* If true, attempt to copy extended attributes. */
+ bool preserve_xattrs;
+
/* 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
--- coreutils-6.9.89.48-96961/src/cp.c
+++ coreutils-6.9.89.48-96961/src/cp.c
@@ -197,7 +197,8 @@ Mandatory arguments to long options are
-p same as --preserve=mode,ownership,timestamps\n\
--preserve[=ATTR_LIST] preserve the specified attributes (default:\n\
mode,ownership,timestamps), if possible\n\
- additional attributes: context, links, all\n\
+ additional attributes: context, links,\n\
+ xattrs, all\n\
"), stdout);
fputs (_("\
--no-preserve=ATTR_LIST don't preserve the specified attributes\n\
@@ -751,6 +752,7 @@ cp_option_init (struct cp_options *x)
x->preserve_links = false;
x->preserve_mode = false;
x->preserve_timestamps = false;
+ x->preserve_xattrs = false;
x->preserve_security_context = false;
x->require_preserve_context = false;
@@ -788,19 +790,21 @@ decode_preserve_arg (char const *arg, st
PRESERVE_TIMESTAMPS,
PRESERVE_OWNERSHIP,
PRESERVE_LINK,
+ PRESERVE_XATTRS,
PRESERVE_CONTEXT,
PRESERVE_ALL
};
static enum File_attribute const preserve_vals[] =
{
PRESERVE_MODE, PRESERVE_TIMESTAMPS,
- PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_CONTEXT, PRESERVE_ALL
+ PRESERVE_OWNERSHIP, PRESERVE_LINK, PRESERVE_XATTRS, PRESERVE_CONTEXT,
+ PRESERVE_ALL
};
/* Valid arguments to the `--preserve' option. */
static char const* const preserve_args[] =
{
"mode", "timestamps",
- "ownership", "links", "context", "all", NULL
+ "ownership", "links", "xattrs", "context", "all", NULL
};
ARGMATCH_VERIFY (preserve_args, preserve_vals);
@@ -836,6 +840,10 @@ decode_preserve_arg (char const *arg, st
x->preserve_links = on_off;
break;
+ case PRESERVE_XATTRS:
+ x->preserve_xattrs = on_off;
+ break;
+
case PRESERVE_CONTEXT:
x->preserve_security_context = on_off;
x->require_preserve_context = on_off;
@@ -846,6 +854,7 @@ decode_preserve_arg (char const *arg, st
x->preserve_timestamps = on_off;
x->preserve_ownership = on_off;
x->preserve_links = on_off;
+ x->preserve_xattrs = on_off;
if (selinux_enabled)
x->preserve_security_context = on_off;
break;
--- coreutils-6.9.89.48-96961/src/install.c
+++ coreutils-6.9.89.48-96961/src/install.c
@@ -176,6 +176,7 @@ cp_option_init (struct cp_options *x)
x->preserve_links = false;
x->preserve_mode = false;
x->preserve_timestamps = false;
+ x->preserve_xattrs = false;
x->require_preserve = false;
x->require_preserve_context = false;
x->recursive = false;
--- coreutils-6.9.89.48-96961/src/mv.c
+++ coreutils-6.9.89.48-96961/src/mv.c
@@ -136,6 +136,7 @@ cp_option_init (struct cp_options *x)
x->preserve_links = true;
x->preserve_mode = true;
x->preserve_timestamps = true;
+ x->preserve_xattrs = true;
x->preserve_security_context = selinux_enabled;
x->require_preserve = false; /* FIXME: maybe make this an option */
x->require_preserve_context = false;

View File

@ -1,3 +1,53 @@
-------------------------------------------------------------------
Sun Feb 22 10:49:52 CET 2009 - schwab@suse.de
- Update to coreutils 7.1.
** New features
Add extended attribute support available on certain filesystems like ext2
and XFS.
cp: Tries to copy xattrs when --preserve=xattr or --preserve=all specified
mv: Always tries to copy xattrs
install: Never copies xattrs
cp and mv accept a new option, --no-clobber (-n): silently refrain
from overwriting any existing destination file
dd accepts iflag=cio and oflag=cio to open the file in CIO (concurrent I/O)
mode where this feature is available.
install accepts a new option, --compare (-C): compare each pair of source
and destination files, and if the destination has identical content and
any specified owner, group, permissions, and possibly SELinux context, then
do not modify the destination at all.
ls --color now highlights hard linked files, too
stat -f recognizes the Lustre file system type
** Bug fixes
chgrp, chmod, chown --silent (--quiet, -f) no longer print some diagnostics
[bug introduced in coreutils-5.1]
cp uses much less memory in some situations
cp -a now correctly tries to preserve SELinux context (announced in 6.9.90),
doesn't inform about failure, unlike with --preserve=all
du --files0-from=FILE no longer reads all of FILE into RAM before
processing the first file name
seq 9223372036854775807 9223372036854775808 now prints only two numbers
on systems with extended long double support and good library support.
Even with this patch, on some systems, it still produces invalid output,
from 3 to at least 1026 lines long. [bug introduced in coreutils-6.11]
seq -w now accounts for a decimal point added to the last number
to correctly print all numbers to the same width.
wc --files0-from=FILE no longer reads all of FILE into RAM, before
processing the first file name, unless the list of names is known
to be small enough.
** Changes in behavior
cp and mv: the --reply={yes,no,query} option has been removed.
Using it has elicited a warning for the last three years.
dd: user specified offsets that are too big are handled better.
Previously, erroneous parameters to skip and seek could result
in redundant reading of the file with no warnings or errors.
du: -H (initially equivalent to --si) is now equivalent to
--dereference-args, and thus works as POSIX requires
shred: now does 3 overwrite passes by default rather than 25.
ls -l now marks SELinux-only files with the less obtrusive '.',
rather than '+'. A file with any other combination of MAC and ACL
is still marked with a '+'.
-------------------------------------------------------------------
Wed Nov 19 12:42:10 CET 2008 - werner@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package coreutils (Version 6.12)
# spec file for package coreutils (Version 7.1)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -19,24 +19,22 @@
Name: coreutils
Summary: GNU Core Utilities
BuildRequires: help2man libacl-devel libselinux-devel pam-devel
BuildRequires: help2man libacl-devel libcap-devel libselinux-devel pam-devel xz
Url: http://www.gnu.org/software/coreutils/
License: GNU Free Documentation License, Version 1.2 (GFDL 1.2); GPL v2 or later; GPL v3 or later
Group: System/Base
Version: 6.12
Release: 32
Version: 7.1
Release: 1
Provides: fileutils sh-utils stat textutils mktemp
Obsoletes: fileutils sh-utils stat textutils mktemp
Obsoletes: libselinux <= 1.23.11-3 libselinux-32bit = 9 libselinux-64bit = 9 libselinux-x86 = 9
AutoReqProv: on
PreReq: %{install_info_prereq}
Requires: %{name}-lang = %version
Source: coreutils-%{version}.tar.gz
Source: coreutils-%{version}.tar.xz
Source1: su.pamd
Source2: su.default
Patch: coreutils-%{version}.diff
Patch1: coreutils-xattr.diff
Patch30: coreutils-changelog.diff
Patch4: coreutils-5.3.0-i18n-0.1.patch
Patch5: i18n-uninit.diff
Patch6: i18n-infloop.diff
@ -49,7 +47,6 @@ Patch20: coreutils-6.8-su.diff
Patch21: coreutils-6.8.0-pie.diff
Patch22: coreutils-5.3.0-sbin4su.diff
Patch23: coreutils-getaddrinfo.diff
Patch24: utimens.diff
Patch25: coreutils-cifs-afs.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -63,8 +60,8 @@ factor false fmt fold groups head id install join kill link ln logname
ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup od paste pathchk
pinky pr printenv printf ptx pwd readlink rm rmdir runcon seq sha1sum
sha224sum sha256sum sha384sum sha512sum shred shuf sleep sort split
stat stty su sum sync tac tail tee test touch tr true tsort tty uname
unexpand uniq unlink uptime users vdir wc who whoami yes
stat stty su sum sync tac tail tee test timeout touch tr true tsort tty
uname unexpand uniq unlink uptime users vdir wc who whoami yes
@ -107,7 +104,6 @@ Authors:
%lang_package
%prep
%setup -q
%patch1 -p1
%patch4 -p1
%patch5
%patch6
@ -121,11 +117,10 @@ Authors:
%patch21
%patch22
%patch23 -p1
%patch24 -p1
%patch25
%build
AUTOPOINT=true autoreconf -fi
#AUTOPOINT=true autoreconf -fi
./configure CFLAGS="$RPM_OPT_FLAGS -Wall" \
--prefix=%{_prefix} --mandir=%{_mandir} \
--infodir=%{_infodir} --without-included-regex \
@ -138,13 +133,13 @@ make %{?jobs:-j%jobs} PAMLIBS="-lpam -ldl"
%check
if test $EUID -eq 0; then
su nobody -c make check VERBOSE=yes
make check-root VERBOSE=yes
su nobody -c make %{?jobs:-j%jobs} check VERBOSE=yes
make %{?jobs:-j%jobs} check-root VERBOSE=yes
else
%ifarch %arm
make -k check VERBOSE=yes || echo make check failed
make -k %{?jobs:-j%jobs} check VERBOSE=yes || echo make check failed
%else
make check VERBOSE=yes
make %{?jobs:-j%jobs} check VERBOSE=yes
%endif
fi
@ -191,6 +186,53 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root)
%changelog
* Sun Feb 22 2009 schwab@suse.de
- Update to coreutils 7.1.
** New features
Add extended attribute support available on certain filesystems like ext2
and XFS.
cp: Tries to copy xattrs when --preserve=xattr or --preserve=all specified
mv: Always tries to copy xattrs
install: Never copies xattrs
cp and mv accept a new option, --no-clobber (-n): silently refrain
from overwriting any existing destination file
dd accepts iflag=cio and oflag=cio to open the file in CIO (concurrent I/O)
mode where this feature is available.
install accepts a new option, --compare (-C): compare each pair of source
and destination files, and if the destination has identical content and
any specified owner, group, permissions, and possibly SELinux context, then
do not modify the destination at all.
ls --color now highlights hard linked files, too
stat -f recognizes the Lustre file system type
** Bug fixes
chgrp, chmod, chown --silent (--quiet, -f) no longer print some diagnostics
[bug introduced in coreutils-5.1]
cp uses much less memory in some situations
cp -a now correctly tries to preserve SELinux context (announced in 6.9.90),
doesn't inform about failure, unlike with --preserve=all
du --files0-from=FILE no longer reads all of FILE into RAM before
processing the first file name
seq 9223372036854775807 9223372036854775808 now prints only two numbers
on systems with extended long double support and good library support.
Even with this patch, on some systems, it still produces invalid output,
from 3 to at least 1026 lines long. [bug introduced in coreutils-6.11]
seq -w now accounts for a decimal point added to the last number
to correctly print all numbers to the same width.
wc --files0-from=FILE no longer reads all of FILE into RAM, before
processing the first file name, unless the list of names is known
to be small enough.
** Changes in behavior
cp and mv: the --reply={yes,no,query} option has been removed.
Using it has elicited a warning for the last three years.
dd: user specified offsets that are too big are handled better.
Previously, erroneous parameters to skip and seek could result
in redundant reading of the file with no warnings or errors.
du: -H (initially equivalent to --si) is now equivalent to
--dereference-args, and thus works as POSIX requires
shred: now does 3 overwrite passes by default rather than 25.
ls -l now marks SELinux-only files with the less obtrusive '.',
rather than '+'. A file with any other combination of MAC and ACL
is still marked with a '+'.
* Wed Nov 19 2008 werner@suse.de
- Enable stat(1) to detect (k)AFS and CIFS network file systems
* Tue Nov 18 2008 schwab@suse.de

View File

@ -1,112 +0,0 @@
2008-06-02 Eric Blake <ebb9@byu.net>
Provide fallback for older kernels.
* lib/utimens.c (gl_futimens) [HAVE_UTIMENSAT, HAVE_FUTIMENS]:
Provide runtime fallback if kernel lacks support.
Reported by Mike Frysinger.
diff --git a/lib/utimens.c b/lib/utimens.c
index 25bc965..134310b 100644
--- a/lib/utimens.c
+++ b/lib/utimens.c
@@ -96,20 +96,30 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
#endif
/* POSIX 200x added two interfaces to set file timestamps with
- nanosecond resolution. */
+ nanosecond resolution. We provide a fallback for ENOSYS (for
+ example, compiling against Linux 2.6.25 kernel headers and glibc
+ 2.7, but running on Linux 2.6.18 kernel). */
#if HAVE_UTIMENSAT
if (fd < 0)
- return utimensat (AT_FDCWD, file, timespec, 0);
+ {
+ int result = utimensat (AT_FDCWD, file, timespec, 0);
+ if (result == 0 || errno != ENOSYS)
+ return result;
+ }
#endif
#if HAVE_FUTIMENS
- return futimens (fd, timespec);
-#else
+ {
+ int result = futimens (fd, timespec);
+ if (result == 0 || errno != ENOSYS)
+ return result;
+ }
+#endif
/* The platform lacks an interface to set file timestamps with
nanosecond resolution, so do the best we can, discarding any
fractional part of the timestamp. */
{
-# if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
+#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
struct timeval timeval[2];
struct timeval const *t;
if (timespec)
@@ -125,9 +135,9 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
if (fd < 0)
{
-# if HAVE_FUTIMESAT
+# if HAVE_FUTIMESAT
return futimesat (AT_FDCWD, file, t);
-# endif
+# endif
}
else
{
@@ -141,21 +151,21 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
worth optimizing, and who knows what other messed-up systems
are out there? So play it safe and fall back on the code
below. */
-# if HAVE_FUTIMESAT
+# if HAVE_FUTIMESAT
if (futimesat (fd, NULL, t) == 0)
return 0;
-# elif HAVE_FUTIMES
+# elif HAVE_FUTIMES
if (futimes (fd, t) == 0)
return 0;
-# endif
+# endif
}
-# endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */
+#endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */
if (!file)
{
-# if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES))
+#if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES))
errno = ENOSYS;
-# endif
+#endif
/* Prefer EBADF to ENOSYS if both error numbers apply. */
if (errno == ENOSYS)
@@ -170,9 +180,9 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
return -1;
}
-# if HAVE_WORKING_UTIMES
+#if HAVE_WORKING_UTIMES
return utimes (file, t);
-# else
+#else
{
struct utimbuf utimbuf;
struct utimbuf const *ut;
@@ -187,9 +197,8 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
return utime (file, ut);
}
-# endif /* !HAVE_WORKING_UTIMES */
+#endif /* !HAVE_WORKING_UTIMES */
}
-#endif /* !HAVE_FUTIMENS */
}
/* Set the access and modification time stamps of FILE to be
--
1.5.5.1