Automatic import for version 8.12

This commit is contained in:
Rosa 2012-02-01 14:36:01 +04:00
commit a794ecdb00
28 changed files with 6403 additions and 0 deletions

2
.abf.yml Normal file
View file

@ -0,0 +1,2 @@
sources:
"coreutils-8.12.tar.xz": c27b1578a96a57a6ac3cd6ac927ce480db122ee8

View file

@ -0,0 +1,18 @@
--- coreutils-5.92/src/date.c.langinfo 2005-09-16 09:06:57.000000000 +0100
+++ coreutils-5.92/src/date.c 2005-10-24 18:09:16.000000000 +0100
@@ -451,14 +451,7 @@
format = DATE_FMT_LANGINFO ();
if (! *format)
{
- /* Do not wrap the following literal format string with _(...).
- For example, suppose LC_ALL is unset, LC_TIME=POSIX,
- and LANG="ko_KR". In that case, POSIX says that LC_TIME
- determines the format and contents of date and time strings
- written by date, which means "date" must generate output
- using the POSIX locale; but adding _() would cause "date"
- to use a Korean translation of the format. */
- format = "%a %b %e %H:%M:%S %Z %Y";
+ format = dcgettext(NULL, N_("%a %b %e %H:%M:%S %Z %Y"), LC_TIME);
}
}

View file

@ -0,0 +1,11 @@
--- coreutils-5.0.91/lib/physmem.c.64bit-fixes 2004-01-08 16:23:09.000000000 +0100
+++ coreutils-5.0.91/lib/physmem.c 2004-01-08 16:27:37.000000000 +0100
@@ -84,7 +84,7 @@ typedef WINBOOL (WINAPI *PFN_MS_EX) (lME
static double
physmem_cap (double mem)
{
- double max = 1 << (sizeof(void *)*8 - 4);
+ double max = 1L << (sizeof(void *)*8 - 4);
return mem > max ? max : mem;
}

View file

@ -0,0 +1,14 @@
--- coreutils-5.92/man/date.1.dateman 2005-10-22 19:14:46.000000000 +0100
+++ coreutils-5.92/man/date.1 2005-10-24 17:57:38.000000000 +0100
@@ -214,6 +214,11 @@
relative date, and numbers. An empty string indicates the beginning
of the day. The date string format is more complex than is easily
documented here but is fully described in the info documentation.
+.SH ENVIRONMENT
+.TP
+TZ
+Specifies the timezone, unless overridden by command line parameters.
+If neither is specified, the setting from /etc/localtime is used.
.SH AUTHOR
Written by David MacKenzie.
.SH "REPORTING BUGS"

View file

@ -0,0 +1,12 @@
diff -urNp coreutils-7.4-orig/src/stty.c coreutils-7.4/src/stty.c
--- coreutils-7.4-orig/src/stty.c 2009-04-24 14:41:19.000000000 +0200
+++ coreutils-7.4/src/stty.c 2009-06-11 10:15:41.000000000 +0200
@@ -1001,7 +1001,7 @@ main (int argc, char **argv)
spurious difference in an uninitialized portion of the structure. */
DECLARE_ZEROED_AGGREGATE (struct termios, new_mode);
- if (tcsetattr (STDIN_FILENO, TCSADRAIN, &mode))
+ if (tcsetattr (STDIN_FILENO, TCSANOW, &mode))
error (EXIT_FAILURE, errno, "%s", device_name);
/* POSIX (according to Zlotnick's book) tcsetattr returns zero if

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,11 @@
--- coreutils-8.2/src/ls.c.broken_blink 2009-11-09 11:00:39.000000000 +0100
+++ coreutils-8.2/src/ls.c 2010-01-03 06:45:14.000000000 +0100
@@ -2743,7 +2743,7 @@
assertion that the inode number is not yet known. */
|| (print_inode && inode == NOT_AN_INODE_NUMBER)
|| (format_needs_type
- && (type == unknown || command_line_arg
+ && (type == unknown || command_line_arg || symbolic_link
/* --indicator-style=classify (aka -F)
requires that we stat each regular file
to see if it's executable. */

View file

@ -0,0 +1,42 @@
--- coreutils-8.2/src/cp.c.override 2009-09-29 15:27:54.000000000 +0200
+++ coreutils-8.2/src/cp.c 2010-01-03 06:05:55.000000000 +0100
@@ -972,6 +972,7 @@
break;
case 'f':
+ x.interactive = I_ALWAYS_YES;
x.unlink_dest_after_failed_open = true;
break;
--- coreutils-8.2/tests/cp/cp-i.override 2009-10-30 12:51:07.000000000 +0100
+++ coreutils-8.2/tests/cp/cp-i 2010-01-03 06:04:07.000000000 +0100
@@ -60,8 +60,8 @@
compare out6 out_empty || fail=1
# do not ask, prevent from overwrite
-echo n | cp -vnf c d 2>/dev/null > out7 || fail=1
-compare out7 out_empty || fail=1
+#echo n | cp -vnf c d 2>/dev/null > out7 || fail=1
+#compare out7 out_empty || fail=1
# options --backup and --no-clobber are mutually exclusive
cp -bn c d 2>/dev/null && fail=1
--- coreutils-8.2/tests/mv/i-2.override 2009-10-30 12:51:07.000000000 +0100
+++ coreutils-8.2/tests/mv/i-2 2010-01-03 06:04:07.000000000 +0100
@@ -41,11 +41,12 @@
# Before 4.0s, this would not prompt.
cp -if e f < y > out 2>&1 || fail=1
+#(peroyvind) this test is bogus, we don't want to be prompted when forcing
# Make sure out contains the prompt.
-case "`cat out`" in
- "cp: try to overwrite \`f', overriding mode 0000 (---------)?"*) ;;
- *) fail=1 ;;
-esac
+#case "`cat out`" in
+# "cp: try to overwrite \`f', overriding mode 0000 (---------)?"*) ;;
+# *) fail=1 ;;
+#esac
test -f e || fail=1
test -f f || fail=1

View file

@ -0,0 +1,55 @@
--- coreutils-8.2/src/df.c.space 2009-09-29 15:27:54.000000000 +0200
+++ coreutils-8.2/src/df.c 2010-01-03 06:56:41.000000000 +0100
@@ -298,6 +298,35 @@
*dest = -*dest;
}
+/* Since the values in a line are separated by spaces, a name cannot
+ * contain a space. Therefore some programs encode spaces in names
+ * by the strings "\040". We undo the encoding when reading an entry.
+ * The decoding happens in place. */
+static char * decode_name (char *buf)
+{
+ char *rp = buf;
+ char *wp = buf;
+
+ do
+ if (rp[0] == '\\' && rp[1] == '0' && rp[2] == '4' && rp[3] == '0') {
+ /* \040 is a SPACE. */
+ *wp++ = ' ';
+ rp += 3;
+ } else if (rp[0] == '\\' && rp[1] == '0' && rp[2] == '1' && rp[3] == '2') {
+ /* \012 is a TAB. */
+ *wp++ = '\t';
+ rp += 3;
+ } else if (rp[0] == '\\' && rp[1] == '\\') {
+ /* We have to escape \\ to be able to represent all characters. */
+ *wp++ = '\\';
+ rp += 1;
+ } else
+ *wp++ = *rp;
+ while (*rp++ != '\0');
+
+ return buf;
+}
+
/* Display a space listing for the disk device with absolute file name DISK.
If MOUNT_POINT is non-NULL, it is the name of the root of the
file system on DISK.
@@ -346,7 +375,7 @@
It would be better to report on the unmounted file system,
but statfs doesn't do that on most systems. */
if (!stat_file)
- stat_file = mount_point ? mount_point : disk;
+ stat_file = mount_point ? decode_name((char *) mount_point) : disk;
if (force_fsu)
fsu = *force_fsu;
@@ -509,6 +538,7 @@
else if (strncmp ("/tmp_mnt/", mount_point, 9) == 0)
mount_point += 8;
#endif
+ /* at this point mount_point should ba already decoded */
printf (" %s", mount_point);
}
putchar ('\n');

View file

@ -0,0 +1,49 @@
diff -urNp coreutils-8.2-orig/src/uname.c coreutils-8.2/src/uname.c
--- coreutils-8.2-orig/src/uname.c 2009-09-23 10:25:44.000000000 +0200
+++ coreutils-8.2/src/uname.c 2009-12-19 09:09:11.663607110 +0100
@@ -301,7 +301,7 @@ main (int argc, char **argv)
if (toprint & PRINT_PROCESSOR)
{
- char const *element = unknown;
+ char *element = unknown;
#if HAVE_SYSINFO && defined SI_ARCHITECTURE
{
static char processor[257];
@@ -308,6 +308,12 @@ main (int argc, char **argv)
if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
element = processor;
}
+#else
+ {
+ struct utsname u;
+ uname(&u);
+ element = u.machine;
+ }
#endif
#ifdef UNAME_PROCESSOR
if (element == unknown)
@@ -351,7 +357,7 @@ main (int argc, char **argv)
if (toprint & PRINT_HARDWARE_PLATFORM)
{
- char const *element = unknown;
+ char *element = unknown;
#if HAVE_SYSINFO && defined SI_PLATFORM
{
static char hardware_platform[257];
@@ -353,6 +359,14 @@ main (int argc, char **argv)
hardware_platform, sizeof hardware_platform))
element = hardware_platform;
}
+#else
+ {
+ struct utsname u;
+ uname(&u);
+ element = u.machine;
+ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6')
+ element[1]='3';
+ }
#endif
#ifdef UNAME_HARDWARE_PLATFORM
if (element == unknown)

View file

@ -0,0 +1,24 @@
--- coreutils-8.3/lib/getugroups.c.groups 2010-01-04 17:19:05.000000000 +0100
+++ coreutils-8.3/lib/getugroups.c 2010-01-11 07:09:44.000000000 +0100
@@ -75,8 +75,12 @@
errno = 0;
grp = getgrent ();
- if (grp == NULL)
+ if (grp == NULL) {
+ if (errno == ENOENT)
+ /* expected at the end of the group list, so ignore errno */
+ errno =0;
break;
+ }
for (cp = grp->gr_mem; *cp; ++cp)
{
@@ -102,6 +106,7 @@
if (count == INT_MAX)
{
errno = EOVERFLOW;
+ count = -1;
goto done;
}
count++;

35
coreutils-8.3-mem.patch Normal file
View file

@ -0,0 +1,35 @@
--- coreutils-8.3/lib/physmem.c.orig 2010-01-04 17:19:05.000000000 +0100
+++ coreutils-8.3/lib/physmem.c 2010-01-11 07:05:15.000000000 +0100
@@ -77,6 +77,14 @@
#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
+/* Cap physical memory to something sane */
+static double
+physmem_cap (double mem)
+{
+ double max = 1 << (sizeof(void *)*8 - 4);
+ return mem > max ? max : mem;
+}
+
/* Return the total amount of physical memory. */
double
physmem_total (void)
@@ -86,7 +94,7 @@
double pages = sysconf (_SC_PHYS_PAGES);
double pagesize = sysconf (_SC_PAGESIZE);
if (0 <= pages && 0 <= pagesize)
- return pages * pagesize;
+ return physmem_cap(pages * pagesize);
}
#endif
@@ -98,7 +106,7 @@
double pages = pss.physical_memory;
double pagesize = pss.page_size;
if (0 <= pages && 0 <= pagesize)
- return pages * pagesize;
+ return physmem_cap(pages * pagesize);
}
}
#endif

View file

@ -0,0 +1,11 @@
diff -urNp coreutils-8.4-orig/src/Makefile.am coreutils-8.4/src/Makefile.am
--- coreutils-8.4-orig/src/Makefile.am 2010-09-03 17:34:43.399747649 +0200
+++ coreutils-8.4/src/Makefile.am 2010-09-03 17:36:13.005765125 +0200
@@ -367,6 +367,7 @@ factor_LDADD += $(LIB_GMP)
# for crypt and pam
su_LDADD += $(LIB_CRYPT) $(PAM_LIBS)
+su_LDFLAGS = -pie -Wl,-z,relro,-z,now
# for various ACL functions
copy_LDADD += $(LIB_ACL)

428
coreutils-8.7-pam.patch Normal file
View file

@ -0,0 +1,428 @@
From ea2d050b1952feb99f86c98255280beb6e589d8c Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Tue, 17 Aug 2010 13:21:44 +0200
Subject: [PATCH 1/7] pam support for su
---
configure.ac | 14 +++
src/Makefile.am | 4 +-
src/su.c | 266 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 278 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index b07a52b..1fb5839 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,6 +128,20 @@ fi
AC_FUNC_FORK
+AC_ARG_ENABLE(pam, AS_HELP_STRING([--disable-pam],
+ [Disable PAM support in su (default=auto)]), , [enable_pam=yes])
+if test "x$enable_pam" != xno; then
+ AC_CHECK_LIB([pam], [pam_start], [enable_pam=yes], [enable_pam=no])
+ AC_CHECK_LIB([pam_misc], [misc_conv], [:], [enable_pam=no])
+ if test "x$enable_pam" != xno; then
+ AC_DEFINE(USE_PAM, 1, [Define if you want to use PAM])
+ PAM_LIBS="-lpam -lpam_misc"
+ AC_SUBST(PAM_LIBS)
+ fi
+fi
+AC_MSG_CHECKING([whether to enable PAM support in su])
+AC_MSG_RESULT([$enable_pam])
+
optional_bin_progs=
AC_CHECK_FUNCS([chroot],
gl_ADD_PROG([optional_bin_progs], [chroot]))
diff --git a/src/Makefile.am b/src/Makefile.am
index db5359b..154a5ed 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -363,8 +363,8 @@ factor_LDADD += $(LIB_GMP)
# for getloadavg
uptime_LDADD += $(GETLOADAVG_LIBS)
-# for crypt
-su_LDADD += $(LIB_CRYPT)
+# for crypt and pam
+su_LDADD += $(LIB_CRYPT) $(PAM_LIBS)
# for various ACL functions
copy_LDADD += $(LIB_ACL)
diff --git a/src/su.c b/src/su.c
index f8f5b61..811aad7 100644
--- a/src/su.c
+++ b/src/su.c
@@ -37,6 +37,16 @@
restricts who can su to UID 0 accounts. RMS considers that to
be fascist.
+#ifdef USE_PAM
+
+ Actually, with PAM, su has nothing to do with whether or not a
+ wheel group is enforced by su. RMS tries to restrict your access
+ to a su which implements the wheel group, but PAM considers that
+ to be fascist, and gives the user/sysadmin the opportunity to
+ enforce a wheel group by proper editing of /etc/pam.d/su
+
+#endif
+
Compile-time options:
-DSYSLOG_SUCCESS Log successful su's (by default, to root) with syslog.
-DSYSLOG_FAILURE Log failed su's (by default, to root) with syslog.
@@ -52,6 +62,13 @@
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
+#ifdef USE_PAM
+#include <security/pam_appl.h>
+#include <security/pam_misc.h>
+#include <signal.h>
+#include <sys/wait.h>
+#include <sys/fsuid.h>
+#endif
#include "system.h"
#include "getpass.h"
@@ -111,7 +128,9 @@
/* The user to become if none is specified. */
#define DEFAULT_USER "root"
+#ifndef USE_PAM
char *crypt (char const *key, char const *salt);
+#endif
static void run_shell (char const *, char const *, char **, size_t)
ATTRIBUTE_NORETURN;
@@ -125,6 +144,11 @@ static bool simulate_login;
/* If true, change some environment vars to indicate the user su'd to. */
static bool change_environment;
+#ifdef USE_PAM
+static bool _pam_session_opened;
+static bool _pam_cred_established;
+#endif
+
static struct option const longopts[] =
{
{"command", required_argument, NULL, 'c'},
@@ -200,7 +224,164 @@ log_su (struct passwd const *pw, bool successful)
}
#endif
+#ifdef USE_PAM
+#define PAM_SERVICE_NAME PROGRAM_NAME
+#define PAM_SERVICE_NAME_L PROGRAM_NAME "-l"
+static sig_atomic_t volatile caught_signal = false;
+static pam_handle_t *pamh = NULL;
+static int retval;
+static struct pam_conv conv =
+{
+ misc_conv,
+ NULL
+};
+
+#define PAM_BAIL_P(a) \
+ if (retval) \
+ { \
+ pam_end (pamh, retval); \
+ a; \
+ }
+
+static void
+cleanup_pam (int retcode)
+{
+ if (_pam_session_opened)
+ pam_close_session (pamh, 0);
+
+ if (_pam_cred_established)
+ pam_setcred (pamh, PAM_DELETE_CRED | PAM_SILENT);
+
+ pam_end(pamh, retcode);
+}
+
+/* Signal handler for parent process. */
+static void
+su_catch_sig (int sig)
+{
+ caught_signal = true;
+}
+
+/* Export env variables declared by PAM modules. */
+static void
+export_pamenv (void)
+{
+ char **env;
+
+ /* This is a copy but don't care to free as we exec later anyways. */
+ env = pam_getenvlist (pamh);
+ while (env && *env)
+ {
+ if (putenv (*env) != 0)
+ xalloc_die ();
+ env++;
+ }
+}
+
+static void
+create_watching_parent (void)
+{
+ pid_t child;
+ sigset_t ourset;
+ int status = 0;
+
+ retval = pam_open_session (pamh, 0);
+ if (retval != PAM_SUCCESS)
+ {
+ cleanup_pam (retval);
+ error (EXIT_FAILURE, 0, _("cannot not open session: %s"),
+ pam_strerror (pamh, retval));
+ }
+ else
+ _pam_session_opened = 1;
+
+ child = fork ();
+ if (child == (pid_t) -1)
+ {
+ cleanup_pam (PAM_ABORT);
+ error (EXIT_FAILURE, errno, _("cannot create child process"));
+ }
+
+ /* the child proceeds to run the shell */
+ if (child == 0)
+ return;
+
+ /* In the parent watch the child. */
+
+ /* su without pam support does not have a helper that keeps
+ sitting on any directory so let's go to /. */
+ if (chdir ("/") != 0)
+ error (0, errno, _("warning: cannot change directory to %s"), "/");
+
+ sigfillset (&ourset);
+ if (sigprocmask (SIG_BLOCK, &ourset, NULL))
+ {
+ error (0, errno, _("cannot block signals"));
+ caught_signal = true;
+ }
+ if (!caught_signal)
+ {
+ struct sigaction action;
+ action.sa_handler = su_catch_sig;
+ sigemptyset (&action.sa_mask);
+ action.sa_flags = 0;
+ sigemptyset (&ourset);
+ if (sigaddset (&ourset, SIGTERM)
+ || sigaddset (&ourset, SIGALRM)
+ || sigaction (SIGTERM, &action, NULL)
+ || sigprocmask (SIG_UNBLOCK, &ourset, NULL))
+ {
+ error (0, errno, _("cannot set signal handler"));
+ caught_signal = true;
+ }
+ }
+ if (!caught_signal)
+ {
+ pid_t pid;
+ for (;;)
+ {
+ pid = waitpid (child, &status, WUNTRACED);
+
+ if (pid != (pid_t)-1 && WIFSTOPPED (status))
+ {
+ kill (getpid (), SIGSTOP);
+ /* once we get here, we must have resumed */
+ kill (pid, SIGCONT);
+ }
+ else
+ break;
+ }
+ if (pid != (pid_t)-1)
+ if (WIFSIGNALED (status))
+ status = WTERMSIG (status) + 128;
+ else
+ status = WEXITSTATUS (status);
+ else
+ status = 1;
+ }
+ else
+ status = 1;
+
+ if (caught_signal)
+ {
+ fprintf (stderr, _("\nSession terminated, killing shell..."));
+ kill (child, SIGTERM);
+ }
+
+ cleanup_pam (PAM_SUCCESS);
+
+ if (caught_signal)
+ {
+ sleep (2);
+ kill (child, SIGKILL);
+ fprintf (stderr, _(" ...killed.\n"));
+ }
+ exit (status);
+}
+#endif
+
/* Ask the user for a password.
+ If PAM is in use, let PAM ask for the password if necessary.
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. */
@@ -208,10 +389,52 @@ log_su (struct passwd const *pw, bool successful)
static bool
correct_password (const struct passwd *pw)
{
+#ifdef USE_PAM
+ const struct passwd *lpw;
+ const char *cp;
+
+ retval = pam_start (simulate_login ? PAM_SERVICE_NAME_L : PAM_SERVICE_NAME,
+ pw->pw_name, &conv, &pamh);
+ PAM_BAIL_P (return false);
+
+ if (isatty (0) && (cp = ttyname (0)) != NULL)
+ {
+ const char *tty;
+
+ if (strncmp (cp, "/dev/", 5) == 0)
+ tty = cp + 5;
+ else
+ tty = cp;
+ retval = pam_set_item (pamh, PAM_TTY, tty);
+ PAM_BAIL_P (return false);
+ }
+#if 0 /* Manpage discourages use of getlogin. */
+ cp = getlogin ();
+ if (!(cp && *cp && (lpw = getpwnam (cp)) != NULL && lpw->pw_uid == getuid ()))
+#endif
+ lpw = getpwuid (getuid ());
+ if (lpw && lpw->pw_name)
+ {
+ retval = pam_set_item (pamh, PAM_RUSER, (const void *) lpw->pw_name);
+ PAM_BAIL_P (return false);
+ }
+ retval = pam_authenticate (pamh, 0);
+ PAM_BAIL_P (return false);
+ retval = pam_acct_mgmt (pamh, 0);
+ if (retval == PAM_NEW_AUTHTOK_REQD)
+ {
+ /* Password has expired. Offer option to change it. */
+ retval = pam_chauthtok (pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
+ PAM_BAIL_P (return false);
+ }
+ PAM_BAIL_P (return false);
+ /* Must be authenticated if this point was reached. */
+ return true;
+#else /* !USE_PAM */
char *unencrypted, *encrypted, *correct;
#if HAVE_GETSPNAM && HAVE_STRUCT_SPWD_SP_PWDP
/* Shadow passwd stuff for SVR3 and maybe other systems. */
- struct spwd *sp = getspnam (pw->pw_name);
+ const struct spwd *sp = getspnam (pw->pw_name);
endspent ();
if (sp)
@@ -232,6 +455,7 @@ correct_password (const struct passwd *pw)
encrypted = crypt (unencrypted, correct);
memset (unencrypted, 0, strlen (unencrypted));
return STREQ (encrypted, correct);
+#endif /* !USE_PAM */
}
/* Update `environ' for the new shell based on PW, with SHELL being
@@ -274,19 +498,41 @@ modify_environment (const struct passwd *pw, const char *shell)
}
}
}
+
+#ifdef USE_PAM
+ export_pamenv ();
+#endif
}
/* Become the user and group(s) specified by PW. */
static void
-change_identity (const struct passwd *pw)
+init_groups (const struct passwd *pw)
{
#ifdef HAVE_INITGROUPS
errno = 0;
if (initgroups (pw->pw_name, pw->pw_gid) == -1)
- error (EXIT_CANCELED, errno, _("cannot set groups"));
+ {
+#ifdef USE_PAM
+ cleanup_pam (PAM_ABORT);
+#endif
+ error (EXIT_FAILURE, errno, _("cannot set groups"));
+ }
endgrent ();
#endif
+
+#ifdef USE_PAM
+ retval = pam_setcred (pamh, PAM_ESTABLISH_CRED);
+ if (retval != PAM_SUCCESS)
+ error (EXIT_FAILURE, 0, "%s", pam_strerror (pamh, retval));
+ else
+ _pam_cred_established = 1;
+#endif
+}
+
+static void
+change_identity (const struct passwd *pw)
+{
if (setgid (pw->pw_gid))
error (EXIT_CANCELED, errno, _("cannot set group id"));
if (setuid (pw->pw_uid))
@@ -500,9 +746,21 @@ main (int argc, char **argv)
shell = NULL;
}
shell = xstrdup (shell ? shell : pw->pw_shell);
- modify_environment (pw, shell);
+
+ init_groups (pw);
+
+#ifdef USE_PAM
+ create_watching_parent ();
+ /* Now we're in the child. */
+#endif
change_identity (pw);
+
+ /* Set environment after pam_open_session, which may put KRB5CCNAME
+ into the pam_env, etc. */
+
+ modify_environment (pw, shell);
+
if (simulate_login && chdir (pw->pw_dir) != 0)
error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
--
1.7.1
diff -urNp coreutils-8.7-orig/doc/coreutils.texi coreutils-8.7/doc/coreutils.texi
--- coreutils-8.7-orig/doc/coreutils.texi 2010-11-15 12:47:03.529922880 +0100
+++ coreutils-8.7/doc/coreutils.texi 2010-11-15 12:49:55.945171380 +0100
@@ -15180,7 +15180,9 @@ the exit status of @var{command} otherwi
@command{su} allows one user to temporarily become another user. It runs a
command (often an interactive shell) with the real and effective user
-ID, group ID, and supplemental groups of a given @var{user}. Synopsis:
+ID, group ID, and supplemental groups of a given @var{user}. When the -l
+option is given, the su-l PAM file is used instead of the default su PAM file.
+Synopsis:
@example
su [@var{option}]@dots{} [@var{user} [@var{arg}]@dots{}]
@@ -15259,7 +15261,8 @@ environment variables except @env{TERM},
(which are set, even for the super-user, as described above), and set
@env{PATH} to a compiled-in default value. Change to @var{user}'s home
directory. Prepend @samp{-} to the shell's name, intended to make it
-read its login startup file(s).
+read its login startup file(s). When this option is given, /etc/pam.d/su-l
+PAM file is used instead of the default one.
@item -m
@itemx -p

342
coreutils-8.7-runuser.patch Normal file
View file

@ -0,0 +1,342 @@
diff -urNp coreutils-8.7-orig/AUTHORS coreutils-8.7/AUTHORS
--- coreutils-8.7-orig/AUTHORS 2010-10-11 19:35:11.000000000 +0200
+++ coreutils-8.7/AUTHORS 2010-11-15 10:08:04.222078001 +0100
@@ -65,6 +65,7 @@ readlink: Dmitry V. Levin
rm: Paul Rubin, David MacKenzie, Richard M. Stallman, Jim Meyering
rmdir: David MacKenzie
runcon: Russell Coker
+runuser: David MacKenzie, Dan Walsh
seq: Ulrich Drepper
sha1sum: Ulrich Drepper, Scott Miller, David Madore
sha224sum: Ulrich Drepper, Scott Miller, David Madore
diff -urNp coreutils-8.7-orig/man/help2man coreutils-8.7/man/help2man
--- coreutils-8.7-orig/man/help2man 2010-10-11 19:35:11.000000000 +0200
+++ coreutils-8.7/man/help2man 2010-11-15 10:08:51.331054884 +0100
@@ -555,6 +555,9 @@ while (length)
$include{$sect} .= $content;
}
+# There is no info documentation for runuser (shared with su).
+$opt_no_info = 1 if $program eq 'runuser';
+
# Refer to the real documentation.
unless ($opt_no_info)
{
diff -urNp coreutils-8.7-orig/man/Makefile.am coreutils-8.7/man/Makefile.am
--- coreutils-8.7-orig/man/Makefile.am 2010-10-11 19:35:11.000000000 +0200
+++ coreutils-8.7/man/Makefile.am 2010-11-15 10:09:21.768922182 +0100
@@ -94,6 +94,7 @@ readlink.1: $(common_dep) $(srcdir)/read
rm.1: $(common_dep) $(srcdir)/rm.x ../src/rm.c
rmdir.1: $(common_dep) $(srcdir)/rmdir.x ../src/rmdir.c
runcon.1: $(common_dep) $(srcdir)/runcon.x ../src/runcon.c
+runuser.1: $(common_dep) $(srcdir)/runuser.x ../src/su.c
seq.1: $(common_dep) $(srcdir)/seq.x ../src/seq.c
sha1sum.1: $(common_dep) $(srcdir)/sha1sum.x ../src/md5sum.c
sha224sum.1: $(common_dep) $(srcdir)/sha224sum.x ../src/md5sum.c
diff -urNp coreutils-8.7-orig/man/runuser.x coreutils-8.7/man/runuser.x
--- coreutils-8.7-orig/man/runuser.x 1970-01-01 01:00:00.000000000 +0100
+++ coreutils-8.7/man/runuser.x 2010-11-15 10:09:57.437939015 +0100
@@ -0,0 +1,12 @@
+[NAME]
+runuser \- run a shell with substitute user and group IDs
+[DESCRIPTION]
+.\" Add any additional description here
+[SEE ALSO]
+.TP
+More detailed Texinfo documentation could be found by command
+.TP
+\t\fBinfo coreutils \(aqsu invocation\(aq\fR\t
+.TP
+since the command \fBrunuser\fR is trimmed down version of command \fBsu\fR.
+.br
diff -urNp coreutils-8.7-orig/README coreutils-8.7/README
--- coreutils-8.7-orig/README 2010-10-11 19:35:11.000000000 +0200
+++ coreutils-8.7/README 2010-11-15 10:10:43.002922253 +0100
@@ -12,10 +12,10 @@ The programs that can be built with this
factor false fmt fold groups head hostid hostname id install join kill
link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
nproc 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 stdbuf stty su sum sync tac tail tee test timeout
- touch tr true truncate tsort tty uname unexpand uniq unlink uptime users
- vdir wc who whoami yes
+ runcon runuser seq sha1sum sha224sum sha256sum sha384sum sha512sum shred
+ shuf sleep sort split stat stdbuf stty su sum sync tac tail tee test
+ timeout touch tr true truncate tsort tty uname unexpand uniq unlink uptime
+ users vdir wc who whoami yes
See the file NEWS for a list of major changes in the current release.
diff -urNp coreutils-8.7-orig/src/Makefile.am coreutils-8.7/src/Makefile.am
--- coreutils-8.7-orig/src/Makefile.am 2010-11-15 10:07:07.339171659 +0100
+++ coreutils-8.7/src/Makefile.am 2010-11-15 10:12:14.847094550 +0100
@@ -100,6 +100,7 @@ EXTRA_PROGRAMS = \
rm \
rmdir \
runcon \
+ runuser \
seq \
sha1sum \
sha224sum \
@@ -300,6 +301,10 @@ cp_LDADD += $(copy_LDADD)
ginstall_LDADD += $(copy_LDADD)
mv_LDADD += $(copy_LDADD)
+runuser_SOURCES = su.c
+runuser_CFLAGS = -DRUNUSER -DAUTHORS="\"David MacKenzie, Dan Walsh\""
+runuser_LDADD = $(LDADD) $(LIB_CRYPT) $(PAM_LIBS)
+
remove_LDADD =
mv_LDADD += $(remove_LDADD)
rm_LDADD += $(remove_LDADD)
@@ -395,7 +400,7 @@ RELEASE_YEAR = \
`sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
$(top_srcdir)/lib/version-etc.c`
-all-local: su$(EXEEXT)
+all-local: su$(EXEEXT) runuser
installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
diff -urNp coreutils-8.7-orig/src/su.c coreutils-8.7/src/su.c
--- coreutils-8.7-orig/src/su.c 2010-11-15 10:07:07.372933288 +0100
+++ coreutils-8.7/src/su.c 2010-11-15 10:42:12.569159230 +0100
@@ -100,9 +100,15 @@
#include "error.h"
/* The official name of this program (e.g., no `g' prefix). */
+#ifndef RUNUSER
#define PROGRAM_NAME "su"
+#else
+#define PROGRAM_NAME "runuser"
+#endif
+#ifndef AUTHORS
#define AUTHORS proper_name ("David MacKenzie")
+#endif
#if HAVE_PATHS_H
# include <paths.h>
@@ -140,6 +146,9 @@
#ifndef USE_PAM
char *crypt (char const *key, char const *salt);
#endif
+#ifndef CHECKPASSWD
+#define CHECKPASSWD 1
+#endif
static void run_shell (char const *, char const *, char **, size_t)
ATTRIBUTE_NORETURN;
@@ -169,6 +178,10 @@ static struct option const longopts[] =
{"login", no_argument, NULL, 'l'},
{"preserve-environment", no_argument, NULL, 'p'},
{"shell", required_argument, NULL, 's'},
+#ifdef RUNUSER
+ {"group", required_argument, NULL, 'g'},
+ {"supp-group", required_argument, NULL, 'G'},
+#endif
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
@@ -444,6 +457,11 @@ correct_password (const struct passwd *p
retval = pam_set_item (pamh, PAM_RUSER, (const void *) lpw->pw_name);
PAM_BAIL_P (return false);
}
+#ifdef RUNUSER
+ if (getuid() != geteuid())
+ /* safety net: deny operation if we are suid by accident */
+ error(EXIT_FAILURE, 1, "runuser may not be setuid");
+#else
retval = pam_authenticate (pamh, 0);
PAM_BAIL_P (return false);
retval = pam_acct_mgmt (pamh, 0);
@@ -454,6 +472,7 @@ correct_password (const struct passwd *p
PAM_BAIL_P (return false);
}
PAM_BAIL_P (return false);
+#endif
/* Must be authenticated if this point was reached. */
return true;
#else /* !USE_PAM */
@@ -533,11 +552,22 @@ modify_environment (const struct passwd
/* Become the user and group(s) specified by PW. */
static void
-init_groups (const struct passwd *pw)
+init_groups (const struct passwd *pw
+#ifdef RUNUSER
+ , gid_t *groups, int num_groups
+#endif
+ )
{
#ifdef HAVE_INITGROUPS
+ int rc = 0;
errno = 0;
- if (initgroups (pw->pw_name, pw->pw_gid) == -1)
+#ifdef RUNUSER
+ if (num_groups)
+ rc = setgroups(num_groups, groups);
+ else
+#endif
+ rc = initgroups(pw->pw_name, pw->pw_gid);
+ if (rc == -1)
{
#ifdef USE_PAM
cleanup_pam (PAM_ABORT);
@@ -639,6 +669,28 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... [-] [USER [ARG]...]\n"), program_name);
+#ifdef RUNUSER
+ printf (_("\
+Change the effective user id and group id to that of USER. Only session PAM\n\
+hooks are run, and there is no password prompt. This command is useful only\n\
+when run as the root user. If run as a non-root user without privilege\n\
+to set user ID, the command will fail as the binary is not setuid.\n\
+As %s doesn't run auth and account PAM hooks, it runs with lower overhead\n\
+than su.\n\
+\n\
+ -, -l, --login make the shell a login shell, uses runuser-l\n\
+ PAM file instead of default one\n\
+ -g --group=group specify the primary group\n\
+ -G --supp-group=group specify a supplemental group\n\
+ -c, --command=COMMAND pass a single COMMAND to the shell with -c\n\
+ --session-command=COMMAND pass a single COMMAND to the shell with -c\n\
+ and do not create a new session\n\
+ -f, --fast pass -f to the shell (for csh or tcsh)\n\
+ -m, --preserve-environment do not reset environment variables\n\
+ -p same as -m\n\
+ -s, --shell=SHELL run SHELL if /etc/shells allows it\n\
+"), program_name);
+#else
fputs (_("\
Change the effective user id and group id to that of USER.\n\
\n\
@@ -651,6 +703,7 @@ Change the effective user id and group i
-p same as -m\n\
-s, --shell=SHELL run SHELL if /etc/shells allows it\n\
"), stdout);
+#endif
fputs (HELP_OPTION_DESCRIPTION, stdout);
fputs (VERSION_OPTION_DESCRIPTION, stdout);
fputs (_("\
@@ -672,6 +725,12 @@ main (int argc, char **argv)
char *shell = NULL;
struct passwd *pw;
struct passwd pw_copy;
+#ifdef RUNUSER
+ struct group *gr;
+ gid_t groups[NGROUPS_MAX];
+ int num_supp_groups = 0;
+ int use_gid = 0;
+#endif
initialize_main (&argc, &argv);
set_program_name (argv[0]);
@@ -686,7 +745,11 @@ main (int argc, char **argv)
simulate_login = false;
change_environment = true;
- while ((optc = getopt_long (argc, argv, "c:flmps:", longopts, NULL)) != -1)
+ while ((optc = getopt_long (argc, argv, "c:flmps:"
+#ifdef RUNUSER
+ "g:G:"
+#endif
+ , longopts, NULL)) != -1)
{
switch (optc)
{
@@ -716,6 +779,28 @@ main (int argc, char **argv)
shell = optarg;
break;
+#ifdef RUNUSER
+ case 'g':
+ gr = getgrnam(optarg);
+ if (!gr)
+ error (EXIT_FAILURE, 0, _("group %s does not exist"), optarg);
+ use_gid = 1;
+ groups[0] = gr->gr_gid;
+ break;
+
+ case 'G':
+ num_supp_groups++;
+ if (num_supp_groups >= NGROUPS_MAX)
+ error (EXIT_FAILURE, 0,
+ _("Can't specify more than %d supplemental groups"),
+ NGROUPS_MAX - 1);
+ gr = getgrnam(optarg);
+ if (!gr)
+ error (EXIT_FAILURE, 0, _("group %s does not exist"), optarg);
+ groups[num_supp_groups] = gr->gr_gid;
+ break;
+#endif
+
case_GETOPT_HELP_CHAR;
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
@@ -754,7 +839,20 @@ main (int argc, char **argv)
: DEFAULT_SHELL);
endpwent ();
- if (!correct_password (pw))
+#ifdef RUNUSER
+ if (num_supp_groups && !use_gid)
+ {
+ pw->pw_gid = groups[1];
+ memmove (groups, groups + 1, sizeof(gid_t) * num_supp_groups);
+ }
+ else if (use_gid)
+ {
+ pw->pw_gid = groups[0];
+ num_supp_groups++;
+ }
+#endif
+
+ if (CHECKPASSWD && !correct_password (pw))
{
#ifdef SYSLOG_FAILURE
log_su (pw, false);
@@ -784,7 +882,11 @@ main (int argc, char **argv)
}
shell = xstrdup (shell ? shell : pw->pw_shell);
- init_groups (pw);
+ init_groups (pw
+#ifdef RUNUSER
+ , groups, num_supp_groups
+#endif
+ );
#ifdef USE_PAM
create_watching_parent ();
diff -urNp coreutils-8.7-orig/tests/misc/help-version coreutils-8.7/tests/misc/help-version
--- coreutils-8.7-orig/tests/misc/help-version 2010-10-11 19:35:11.000000000 +0200
+++ coreutils-8.7/tests/misc/help-version 2010-11-15 10:45:18.473682325 +0100
@@ -32,6 +32,7 @@ expected_failure_status_nohup=125
expected_failure_status_stdbuf=125
expected_failure_status_su=125
expected_failure_status_timeout=125
+expected_failure_status_runuser=125
expected_failure_status_printenv=2
expected_failure_status_tty=3
expected_failure_status_sort=2
@@ -209,6 +210,7 @@ seq_setup () { args=10; }
sleep_setup () { args=0; }
su_setup () { args=--version; }
stdbuf_setup () { args="-oL true"; }
+runuser_setup () { args=--version; }
timeout_setup () { args=--version; }
# I'd rather not run sync, since it spins up disks that I've
diff -urNp coreutils-8.7-orig/tests/misc/invalid-opt coreutils-8.7/tests/misc/invalid-opt
--- coreutils-8.7-orig/tests/misc/invalid-opt 2010-10-11 19:35:11.000000000 +0200
+++ coreutils-8.7/tests/misc/invalid-opt 2010-11-15 10:45:46.451938873 +0100
@@ -37,6 +37,7 @@ my %exit_status =
sort => 2,
stdbuf => 125,
su => 125,
+ runuser => 125,
test => 0,
timeout => 125,
true => 0,

View file

@ -0,0 +1,12 @@
--- coreutils-8.8/gnulib-tests/test-xvasprintf.c.str_fmt~ 2010-12-28 23:13:20.757419499 +0100
+++ coreutils-8.8/gnulib-tests/test-xvasprintf.c 2010-12-28 23:16:36.165427114 +0100
@@ -96,8 +96,7 @@ test_xasprintf (void)
{
/* Silence gcc warning about zero-length format string. */
- const char *empty = "";
- result = xasprintf (empty);
+ result = xasprintf ("");
ASSERT (result != NULL);
ASSERT (strcmp (result, "") == 0);
free (result);

View file

@ -0,0 +1,161 @@
--- coreutils-8.9/src/dircolors.hin.colors_mdkconf~ 2011-01-01 22:19:23.000000000 +0100
+++ coreutils-8.9/src/dircolors.hin 2011-03-10 09:37:39.007847015 +0100
@@ -8,6 +8,10 @@
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
+# This file goes in the /etc directory, and must be world readable.
+# You can copy this file to .dir_colors in your $HOME directory to override
+# the system defaults.
+
# Below, there should be one TERM entry for each termtype that is colorizable
TERM Eterm
TERM ansi
@@ -80,7 +84,8 @@ SOCK 01;35 # socket
DOOR 01;35 # door
BLK 40;33;01 # block device driver
CHR 40;33;01 # character device driver
-ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file
+ORPHAN 01;05;37;41 # symlink to nonexistent file, or non-stat'able file
+MISSING 01;05;37;41 # ... and the files they point to
SETUID 37;41 # file that is setuid (u+s)
SETGID 30;43 # file that is setgid (g+s)
CAPABILITY 30;41 # file with capability
@@ -96,15 +101,15 @@ EXEC 01;32
# (and any comments you want to add after a '#')
# If you use DOS-style suffixes, you may want to uncomment the following:
-#.cmd 01;32 # executables (bright green)
-#.exe 01;32
-#.com 01;32
-#.btm 01;32
-#.bat 01;32
+.cmd 01;32 # executables (bright green)
+.exe 01;32
+.com 01;32
+.btm 01;32
+.bat 01;32
# Or if you want to colorize scripts even if they do not have the
# executable bit actually set.
-#.sh 01;32
-#.csh 01;32
+.sh 01;32
+.csh 01;32
# archives or compressed (bright red)
.tar 01;31
@@ -136,10 +141,13 @@ EXEC 01;32
.cpio 01;31
.7z 01;31
.rz 01;31
+.iso 01;31
# image formats
.jpg 01;35
.jpeg 01;35
+.JPG 01;35
+.JPEG 01;35
.gif 01;35
.bmp 01;35
.pbm 01;35
@@ -151,6 +159,7 @@ EXEC 01;32
.tif 01;35
.tiff 01;35
.png 01;35
+.ico 01;35
.svg 01;35
.svgz 01;35
.mng 01;35
@@ -161,6 +170,9 @@ EXEC 01;32
.m2v 01;35
.mkv 01;35
.ogm 01;35
+.divx 01;35
+.xvid 01;35
+.3gp 01;35
.mp4 01;35
.m4v 01;35
.mp4v 01;35
@@ -182,6 +194,7 @@ EXEC 01;32
.yuv 01;35
.cgm 01;35
.emf 01;35
+.gem 01;35
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
.axv 01;35
@@ -207,3 +220,74 @@ EXEC 01;32
.oga 00;36
.spx 00;36
.xspf 00;36
+
+.mp2 00;36
+.mod 00;36
+.xm 00;36
+.s3m 00;36
+.it 00;36
+.wma 00;36
+
+# document and various text(ish) formats
+# .txt 01;37;40
+# .lyx 01;37;40
+# .doc 01;37;40
+# .wri 01;37;40
+# .odt 01;37;40
+# .wpd 01;37;40
+# .abw 01;37;40
+# .rtf 01;37;40
+# .sam 01;37;40
+# .pdb 01;37;40
+# .sxw 01;37;40
+# .kwd 01;37;40
+# .sgml 01;37;40
+# .html 01;37;40
+# .htm 01;37;40
+# .wml 01;37;40
+# .xml 01;37;40
+# .pdf 01;37;40
+# .ps 01;37;40
+# .man 01;37;40
+# .info 01;37;40
+# .tex 01;37;40
+# .conf 01;37;40
+# .cnf 01;37;40
+# .cfg 01;37;40
+# .config 01;37;40
+# .ini 01;37;40
+# .spec 01;37;40
+# .log 01;37;40
+# .c 01;37;40
+# .cpp 01;37;40
+# .cxx 01;37;40
+# .h 01;37;40
+# .hpp 01;37;40
+# .java 01;37;40
+# .pl 01;37;40
+# .py 01;37;40
+# .patch 01;37;40
+# *rc 01;37;40
+# *README 01;37;40
+# *COPYING 01;37;40
+# *ChangeLog 01;37;40
+# *NEWS 01;37;40
+# *AUTHORS 01;37;40
+# *ABOUT-NLS 01;37;40
+# *THANKS 01;37;40
+# *TODO 01;37;40
+# *FAQ 01;37;40
+# *INSTALL 01;37;40
+# *CHANGES 01;37;40
+
+# backup formats
+*~ 47;30
+.bak 47;30
+.swp 47;30
+.bck 47;30
+.bk 47;30
+.old 47;30
+.tmp 47;30
+.save 47;30
+.rpmsave 47;30
+.rpmnew 47;30

View file

@ -0,0 +1,175 @@
--- coreutils-8.9/doc/coreutils.texi.dfdirect~ 2011-01-09 07:12:33.211777166 +0100
+++ coreutils-8.9/doc/coreutils.texi 2011-01-09 07:12:54.938027272 +0100
@@ -10306,6 +10306,13 @@ pseudo-file-systems, such as automounter
Scale sizes by @var{size} before printing them (@pxref{Block size}).
For example, @option{-BG} prints sizes in units of 1,073,741,824 bytes.
+@itemx --direct
+@opindex --direct
+@cindex direct statfs for a file
+Do not resolve mount point and show statistics directly for a file. It can be
+especially useful for NFS mount points if there is a boundary between two
+storage policies behind the mount point.
+
@itemx --total
@opindex --total
@cindex grand total of disk size, usage and available space
--- coreutils-8.9/src/df.c.dfdirect~ 2011-01-09 07:12:33.162026153 +0100
+++ coreutils-8.9/src/df.c 2011-01-09 07:12:54.940028040 +0100
@@ -109,6 +109,9 @@ static bool print_type;
/* If true, print a grand total at the end. */
static bool print_grand_total;
+/* If true, show statistics for a file instead of mount point. */
+static bool direct_statfs;
+
/* Grand total data. */
static struct fs_usage grand_fsu;
@@ -117,13 +120,15 @@ static struct fs_usage grand_fsu;
enum
{
NO_SYNC_OPTION = CHAR_MAX + 1,
- SYNC_OPTION
+ SYNC_OPTION,
+ DIRECT_OPTION
};
static struct option const long_options[] =
{
{"all", no_argument, NULL, 'a'},
{"block-size", required_argument, NULL, 'B'},
+ {"direct", no_argument, NULL, DIRECT_OPTION},
{"inodes", no_argument, NULL, 'i'},
{"human-readable", no_argument, NULL, 'h'},
{"si", no_argument, NULL, 'H'},
@@ -204,7 +209,10 @@ print_header (void)
human_readable (output_block_size, buf, opts, 1, 1));
}
- fputs (_(" Mounted on\n"), stdout);
+ if (direct_statfs)
+ fputs (_(" File\n"), stdout);
+ else
+ fputs (_(" Mounted on\n"), stdout);
}
/* Is FSTYPE a type of file system that should be listed? */
@@ -676,6 +684,17 @@ show_point (const char *point, const str
static void
show_entry (char const *name, struct stat const *statp)
{
+ if (direct_statfs)
+ {
+ char *resolved = canonicalize_file_name (name);
+ if (resolved)
+ {
+ show_dev (NULL, resolved, NULL, NULL, false, false, NULL);
+ free (resolved);
+ return;
+ }
+ }
+
if ((S_ISBLK (statp->st_mode) || S_ISCHR (statp->st_mode))
&& show_disk (name))
return;
@@ -744,6 +763,7 @@ Mandatory arguments to long options are
-B, --block-size=SIZE scale sizes by SIZE before printing them. E.g.,\n\
`-BM' prints sizes in units of 1,048,576 bytes.\n\
See SIZE format below.\n\
+ --direct show statistics for a file instead of mount point\n\
--total produce a grand total\n\
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)\
\n\
@@ -820,6 +840,9 @@ main (int argc, char **argv)
xstrtol_fatal (e, oi, c, long_options, optarg);
}
break;
+ case DIRECT_OPTION:
+ direct_statfs = true;
+ break;
case 'i':
inode_format = true;
break;
@@ -880,6 +903,13 @@ main (int argc, char **argv)
}
}
+ if (direct_statfs && show_local_fs)
+ {
+ error (0, 0, _("options --direct and --local (-l) are mutually "
+ "exclusive"));
+ usage (EXIT_FAILURE);
+ }
+
if (human_output_opts == -1)
{
if (posix_format)
--- coreutils-8.9/tests/df/direct.dfdirect~ 2011-01-09 07:12:55.073790258 +0100
+++ coreutils-8.9/tests/df/direct 2011-01-09 07:12:55.073790258 +0100
@@ -0,0 +1,55 @@
+#!/bin/sh
+# Ensure "df --direct" works as documented
+
+# Copyright (C) 2010 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ ../src
+print_ver_ df
+
+df || skip_test_ "df fails"
+
+DIR=`pwd` || framework_failure
+FILE="$DIR/file"
+touch "$FILE" || framework_failure
+echo "$FILE" > file_exp || framework_failure
+echo "Mounted on" > header_mounted_exp || framework_failure
+echo "File" > header_file_exp || framework_failure
+
+fail=0
+
+df --portability "$FILE" > df_out || fail=1
+df --portability --direct "$FILE" > df_direct_out || fail=1
+df --portability --direct --local "$FILE" > /dev/null 2>&1 && fail=1
+
+# check df header
+$AWK '{ if (NR==1) print $6 " " $7; }' df_out > header_mounted_out \
+ || framework_failure
+$AWK '{ if (NR==1) print $6; }' df_direct_out > header_file_out \
+ || framework_failure
+compare header_mounted_out header_mounted_exp || fail=1
+compare header_file_out header_file_exp || fail=1
+
+# check df output (without --direct)
+$AWK '{ if (NR==2) print $6; }' df_out > file_out \
+ || framework_failure
+compare file_out file_exp && fail=1
+
+# check df output (with --direct)
+$AWK '{ if (NR==2) print $6; }' df_direct_out > file_out \
+ || framework_failure
+compare file_out file_exp || fail=1
+
+Exit $fail
--- coreutils-8.9/tests/Makefile.am.dfdirect~ 2011-01-09 07:12:33.337026084 +0100
+++ coreutils-8.9/tests/Makefile.am 2011-01-09 07:12:54.951776608 +0100
@@ -354,6 +354,7 @@ TESTS = \
dd/stderr \
dd/unblock \
dd/unblock-sync \
+ df/direct \
df/total-verify \
du/2g \
du/8gb \

View file

@ -0,0 +1,12 @@
--- coreutils-8.9/src/md5sum.c.manpages~ 2011-01-01 22:19:23.000000000 +0100
+++ coreutils-8.9/src/md5sum.c 2011-01-09 07:11:29.975777377 +0100
@@ -179,6 +179,9 @@ With no FILE, or when FILE is -, read st
fputs (_("\
-t, --text read in text mode (default)\n\
"), stdout);
+ fputs (_("\
+ Note: There is no difference between binary and text mode option on GNU system.\n\
+"), stdout);
fputs (_("\
\n\
The following three options are useful only when verifying checksums:\n\

View file

@ -0,0 +1,86 @@
diff --git a/lib/getugroups.c b/lib/getugroups.c
index 299bae6..8ece29b 100644
--- a/lib/getugroups.c
+++ b/lib/getugroups.c
@@ -19,6 +19,9 @@
#include <config.h>
+/* We do not need this code if getgrouplist(3) is available. */
+#ifndef HAVE_GETGROUPLIST
+
#include "getugroups.h"
#include <errno.h>
@@ -123,3 +126,4 @@ getugroups (int maxcount, gid_t *grouplist, char const *username,
}
#endif /* HAVE_GRP_H */
+#endif /* have getgrouplist */
diff --git a/lib/mgetgroups.c b/lib/mgetgroups.c
index 76474c2..0a9d221 100644
--- a/lib/mgetgroups.c
+++ b/lib/mgetgroups.c
@@ -115,9 +115,17 @@ mgetgroups (char const *username, gid_t gid, gid_t **groups)
/* else no username, so fall through and use getgroups. */
#endif
- max_n_groups = (username
- ? getugroups (0, NULL, username, gid)
- : getgroups (0, NULL));
+ if (!username)
+ max_n_groups = getgroups(0, NULL);
+ else
+ {
+#ifdef HAVE_GETGROUPLIST
+ max_n_groups = 0;
+ getgrouplist (username, gid, NULL, &max_n_groups);
+#else
+ max_n_groups = getugroups (0, NULL, username, gid);
+#endif
+ }
/* If we failed to count groups because there is no supplemental
group support, then return an array containing just GID.
@@ -139,10 +147,25 @@ mgetgroups (char const *username, gid_t gid, gid_t **groups)
if (g == NULL)
return -1;
- ng = (username
- ? getugroups (max_n_groups, g, username, gid)
- : getgroups (max_n_groups - (gid != (gid_t) -1),
- g + (gid != (gid_t) -1)));
+ if (!username)
+ ng = getgroups (max_n_groups - (gid != (gid_t)-1), g + (gid != (gid_t)-1));
+ else
+ {
+#ifdef HAVE_GETGROUPLIST
+ int e;
+ ng = max_n_groups;
+ while ((e = getgrouplist (username, gid, g, &ng)) == -1
+ && ng > max_n_groups)
+ {
+ max_n_groups = ng;
+ g = xrealloc (g, max_n_groups * sizeof (GETGROUPS_T));
+ }
+ if (e == -1)
+ ng = -1;
+#else
+ ng = getugroups (max_n_groups, g, username, gid);
+#endif
+ }
if (ng < 0)
{
diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4
index 62777c7..5180243 100644
--- a/m4/jm-macros.m4
+++ b/m4/jm-macros.m4
@@ -78,6 +78,7 @@ AC_DEFUN([coreutils_MACROS],
fchown \
fchmod \
ftruncate \
+ getgrouplist \
iswspace \
mkfifo \
mbrlen \

9
coreutils-mkstemp.patch Normal file
View file

@ -0,0 +1,9 @@
--- coreutils-7.6/lib/mkstemp.c.BAD 2010-03-03 18:17:52.000000000 +0000
+++ coreutils-7.6/lib/mkstemp.c 2010-03-03 18:18:28.000000000 +0000
@@ -40,5 +40,5 @@
int
mkstemp (char *xtemplate)
{
- return __gen_tempname (xtemplate, 0, 0, __GT_FILE);
+ return __gen_tempname (xtemplate, __GT_FILE);
}

11
coreutils-overflow.patch Normal file
View file

@ -0,0 +1,11 @@
--- coreutils-5.2.1/src/who.c.overflow 2005-05-25 09:59:06.000000000 +0100
+++ coreutils-5.2.1/src/who.c 2005-05-25 10:00:31.000000000 +0100
@@ -75,7 +75,7 @@
# define UT_TYPE_NEW_TIME(U) false
#endif
-#define IDLESTR_LEN 6
+#define IDLESTR_LEN 10
#if HAVE_STRUCT_XTMP_UT_PID
# define PIDSTR_DECL_AND_INIT(Var, Utmp_ent) \

102
coreutils-setsid.patch Normal file
View file

@ -0,0 +1,102 @@
diff -urNp coreutils-8.6-orig/src/su.c coreutils-8.6/src/su.c
--- coreutils-8.6-orig/src/su.c 2010-11-03 13:56:11.679069689 +0100
+++ coreutils-8.6/src/su.c 2010-11-03 13:56:45.304325661 +0100
@@ -153,6 +153,9 @@ static bool simulate_login;
/* If true, change some environment vars to indicate the user su'd to. */
static bool change_environment;
+/* If true, then don't call setsid() with a command. */
+int same_session = 0;
+
#ifdef USE_PAM
static bool _pam_session_opened;
static bool _pam_cred_established;
@@ -161,6 +164,7 @@ static bool _pam_cred_established;
static struct option const longopts[] =
{
{"command", required_argument, NULL, 'c'},
+ {"session-command", required_argument, NULL, 'C'},
{"fast", no_argument, NULL, 'f'},
{"login", no_argument, NULL, 'l'},
{"preserve-environment", no_argument, NULL, 'p'},
@@ -335,14 +339,27 @@ create_watching_parent (void)
sigemptyset (&action.sa_mask);
action.sa_flags = 0;
sigemptyset (&ourset);
- if (sigaddset (&ourset, SIGTERM)
- || sigaddset (&ourset, SIGALRM)
- || sigaction (SIGTERM, &action, NULL)
- || sigprocmask (SIG_UNBLOCK, &ourset, NULL))
- {
+ if (!same_session)
+ {
+ if (sigaddset(&ourset, SIGINT) || sigaddset(&ourset, SIGQUIT))
+ {
+ error (0, errno, _("cannot set signal handler"));
+ caught_signal = true;
+ }
+ }
+ if (!caught_signal && (sigaddset(&ourset, SIGTERM)
+ || sigaddset(&ourset, SIGALRM)
+ || sigaction(SIGTERM, &action, NULL)
+ || sigprocmask(SIG_UNBLOCK, &ourset, NULL))) {
error (0, errno, _("cannot set signal handler"));
caught_signal = true;
}
+ if (!caught_signal && !same_session && (sigaction(SIGINT, &action, NULL)
+ || sigaction(SIGQUIT, &action, NULL)))
+ {
+ error (0, errno, _("cannot set signal handler"));
+ caught_signal = true;
+ }
}
if (!caught_signal)
{
@@ -627,6 +644,8 @@ Change the effective user id and group i
\n\
-, -l, --login make the shell a login shell\n\
-c, --command=COMMAND pass a single COMMAND to the shell with -c\n\
+ --session-command=COMMAND pass a single COMMAND to the shell with -c\n\
+ and do not create a new session\n\
-f, --fast pass -f to the shell (for csh or tcsh)\n\
-m, --preserve-environment do not reset environment variables\n\
-p same as -m\n\
@@ -649,6 +668,7 @@ main (int argc, char **argv)
int optc;
const char *new_user = DEFAULT_USER;
char *command = NULL;
+ int request_same_session = 0;
char *shell = NULL;
struct passwd *pw;
struct passwd pw_copy;
@@ -674,6 +694,11 @@ main (int argc, char **argv)
command = optarg;
break;
+ case 'C':
+ command = optarg;
+ request_same_session = 1;
+ break;
+
case 'f':
fast_startup = true;
break;
@@ -743,6 +768,9 @@ main (int argc, char **argv)
}
#endif
+ if (request_same_session || !command || !pw->pw_uid)
+ same_session = 1;
+
if (!shell && !change_environment)
shell = getenv ("SHELL");
if (shell && getuid () != 0 && restricted_shell (pw->pw_shell))
@@ -764,6 +792,8 @@ main (int argc, char **argv)
#endif
change_identity (pw);
+ if (!same_session)
+ setsid ();
/* Set environment after pam_open_session, which may put KRB5CCNAME
into the pam_env, etc. */

612
coreutils.spec Normal file
View file

@ -0,0 +1,612 @@
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils
Version: 8.12
Release: %mkrel 1
License: GPLv3+
Group: System/Base
Url: http://www.gnu.org/software/coreutils/
Source0: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
Source200: su.pamd
Source202: su-l.pamd
# fileutils
Patch101: coreutils-8.2-spacedir.patch
Patch1155: coreutils-8.2-force-option--override--interactive-option.patch
Patch118: fileutils-4.1-ls_h.patch
Patch500: coreutils-8.3-mem.patch
# sh-utils
#add info about TZ envvar to date manpage
Patch703: coreutils-6.11-dateman.patch
#set paths for su explicitly, don't get influenced by paths.h
Patch704: sh-utils-1.16-paths.patch
# RMS will never accept the PAM patch because it removes his historical
# rant about Twenex and the wheel group, so we'll continue to maintain
# it here indefinitely.
Patch706: coreutils-8.7-pam.patch
Patch713: coreutils-4.5.3-langinfo.patch
# (sb) lin18nux/lsb compliance - normally from here:
# http://www.openi18n.org/subgroups/utildev/patch/
# this one is actually a merger of 5.2 and 5.3, as join segfaults
# compiled with gcc4 and the 5.1/5.2 patch
# fwang: we often get this patch from fedora
Patch800: coreutils-8.10-new-i18n.patch
Patch909: coreutils-5.1.0-64bit-fixes.patch
# https://qa.mandriva.com/show_bug.cgi?id=38577
Patch911: coreutils-8.3-groupfix.patch
Patch1011: coreutils-8.9-DIR_COLORS-mdkconf.patch
#(peroyvind): add back always red blinking on broken symlinks
Patch1013: coreutils-8.2-always-blinking-colors-on-broken-symlinks.patch
#(peroyvind): fix a test that fails to compile with -Werror=format-security
Patch1014: coreutils-8.8-check-string-format.patch
# fedora patches
#add note about no difference between binary/text mode on Linux - md5sum manpage
Patch2101: coreutils-8.9-manpages.patch
#temporarily workaround probable kernel issue with TCSADRAIN(#504798)
Patch2102: coreutils-7.4-sttytcsadrain.patch
#do display processor type for uname -p/-i based on uname(2) syscall
Patch2103: coreutils-8.2-uname-processortype.patch
#df --direct
Patch2104: coreutils-8.9-df-direct.patch
#Fix mkstemp on sparc64
Patch2105: coreutils-mkstemp.patch
#Call setsid() in su under some circumstances (bug #173008).
Patch2900: coreutils-setsid.patch
#make runuser binary based on su.c
Patch2907: coreutils-8.7-runuser.patch
#getgrouplist() patch from Ulrich Drepper.
Patch2908: coreutils-getgrouplist.patch
#Prevent buffer overflow in who(1) (bug #158405).
Patch2912: coreutils-overflow.patch
#compile su with pie flag and RELRO protection
Patch2917: coreutils-8.4-su-pie.patch
BuildRequires: gettext
BuildRequires: termcap-devel
BuildRequires: pam-devel
BuildRequires: texinfo >= 4.3
# We need automake which supports the dist-xz target
BuildRequires: automake >= 1.10.2-2
# And tar which supports xz automagically since rpm.org seems to rely on this(..?)
BuildRequires: tar >= 1.21-2
BuildRequires: libacl-devel
BuildRequires: libattr-devel
BuildRequires: libgmp-devel
BuildRequires: libcap-devel
BuildRequires: bison
BuildRequires: flex
BuildRequires: strace
Provides: mktemp = %{version}
Obsoletes: mktemp < %{version}
Provides: stat = %{version}
Provides: %{_bindir}/env
Provides: /bin/env
Obsoletes: base64
Conflicts: tetex < 1.0.7-49mdk
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
%description
This package is the union of the old GNU fileutils, sh-utils, and
textutils packages.
These tools are the GNU versions of common useful and popular
file & text utilities which are used for:
- file management
- shell scripts
- modifying text file (spliting, joining, comparing, modifying, ...)
Most of these programs have significant advantages over their Unix
counterparts, such as greater speed, additional options, and fewer
arbitrary limits.
%package doc
Summary: Coreutils documentation in info format
Group: Books/Computer books
Requires: coreutils >= 4.5.4-2mdk
Requires(post,preun): info-install
BuildArch: noarch
%description doc
This package contains coreutils documentation in GNU info format.
%prep
%setup -q
# fileutils
# (tpg) seems to be fixed
#%patch101 -p1 -b .space~
%patch1155 -p1 -b .override~
%patch118 -p1
# textutils
%patch500 -p1
# sh-utils
%patch703 -p1 -b .dateman~
%patch704 -p1 -b .paths~
%patch706 -p1 -b .pam~
%patch713 -p1 -b .langinfo~
# li18nux/lsb
%patch800 -p1 -b .i18n~
%patch909 -p1 -b .64bit~
%patch911 -p1 -b .groups~
%patch1011 -p1 -b .colors_mdkconf~
%patch1013 -p1 -b .broken_blink~
%patch1014 -p1 -b .str_fmt~
%patch2101 -p1 -b .manpages~
%patch2102 -p1 -b .tcsadrain~
%patch2103 -p1 -b .sysinfo~
# (tpg) not needed for now
#%patch2104 -p1 -b .dfdirect~
%patch2105 -p1 -b .sparc~
%patch2900 -p1 -b .setsid~
%patch2907 -p1 -b .runuser~
%patch2908 -p1 -b .getgrouplist~
%patch2912 -p1 -b .overflow~
%patch2917 -p1 -b .pie~
chmod a+x tests/misc/sort-mb-tests tests/misc/id-context
chmod +w ./src/dircolors.h
./src/dcgen ./src/dircolors.hin > ./src/dircolors.h
export DEFAULT_POSIX2_VERSION=199209
aclocal -I m4
automake --gnits --add-missing
autoconf
bzip2 -9 ChangeLog
%build
export CFLAGS="%{optflags} -fPIC -D_GNU_SOURCE=1"
%configure2_5x \
--enable-largefile \
--enable-pam \
--enable-install-program=su \
--enable-no-install-program=arch,hostname,uptime,kill \
--without-selinux \
--disable-rpath \
--disable-silent-rules
%make
%check
%make check
%install
rm -rf %{buildroot}
%makeinstall_std
# man pages are not installed with make install
make mandir=%{buildroot}%{_mandir} install-man
# let be compatible with old fileutils, sh-utils and textutils packages :
mkdir -p %{buildroot}{/bin,%{_bindir},%{_sbindir},%{_sysconfdir}/pam.d}
for f in basename cat chgrp chmod chown cp cut date dd df echo env expr false id link ln ls mkdir mknod mktemp mv nice pwd rm rmdir sleep sort stat stty sync touch true uname unlink tac
do
mv %{buildroot}/{%{_bindir},bin}/$f
done
# chroot was in /usr/sbin :
mv %{buildroot}/{%{_bindir},%{_sbindir}}/chroot
# {cat,sort,cut} were previously moved from bin to /usr/bin and linked into
for f in cut env expr tac; do
ln -s /bin/$f %{buildroot}%{_bindir}/$f
done
install -m644 src/dircolors.hin -D %{buildroot}%{_sysconfdir}/DIR_COLORS
# su
install -m 4755 src/su %{buildroot}/bin
install -m 644 %{SOURCE200} %{buildroot}%{_sysconfdir}/pam.d/su
install -m 644 %{SOURCE202} %{buildroot}%{_sysconfdir}/pam.d/su-l
#TV# find_lang look for LC_MESSAGES, not LC_TIME:
find %{buildroot}%{_datadir}/locale/ -name coreutils.mo | fgrep LC_TIME | xargs rm -f
%find_lang %{name}
%clean
rm -rf %{buildroot}
%preun doc
%_remove_install_info %{name}.info
%post doc
%_install_info %{name}.info
# The next true is needed: else, if there's a problem, the
# package'll be installed 2 times because of trigger faillure
true
%files -f %{name}.lang
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/D*
%config(noreplace) %{_sysconfdir}/pam.d/su
%config(noreplace) %{_sysconfdir}/pam.d/su-l
%doc README
/bin/*
%{_bindir}/*
%{_sbindir}/chroot
%dir %{_libdir}/coreutils
%{_libdir}/coreutils/libstdbuf.so
%files doc
%defattr(-,root,root)
%doc ABOUT-NLS ChangeLog.bz2 NEWS THANKS TODO
%{_infodir}/coreutils*
%{_mandir}/man*/*
%changelog
* Sun Jun 19 2011 Tomasz Pawel Gajc <tpg@mandriva.org> 8.12-1mdv2011.0
+ Revision: 686061
- update to new version 8.12
* Wed Apr 20 2011 Tomasz Pawel Gajc <tpg@mandriva.org> 8.11-1
+ Revision: 656350
- update to new version 8.11
- disable patches 101 and 2104
- update to new version 8.10
- update patch 800
+ Per Øyvind Karlsen <peroyvind@mandriva.org>
- add '.gem' suffix with same color as other arhives with 'ls'
* Tue Jan 18 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.9-2
+ Revision: 631565
- remove unnecessary buildrequires on locales-*
- remove dependency on pam causing dependency loop
- add back LC_TIME workaround for %%find_lang for now as it breaks upgrades..
* Sun Jan 09 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.9-1mdv2011.0
+ Revision: 630708
- let %%find_lang take care of LC_TIME locale symlinks now
- new release: 8.9
* Wed Dec 29 2010 Per Øyvind Karlsen <peroyvind@mandriva.org> 8.8-1mdv2011.0
+ Revision: 625742
- license is actually GPLv3+, not GPLv3.. ;p
- drop old patches
- don't install kill(1), it's provided by util-linux
- create all symlinks from /bin/ to /usr/bin in one and same loop
- drop no longer required fix for japanese catalog file
- be sure to own %%{_libdir}/coreutils directory
- fix check that fails to compile with -Werror=format-security (P1014)
- use included help2man
- sync patches with coreutils-8.8-1 from fedora
- sh-utils, fileutils & textutils merge with corresponding provides/obsoletes
dates back to 2002, so we can prolly' safely drop these now... ;)
- new release: 8.8
- pass '--disable-silent-rules' to configure, build output is nice for build logs
- configure not to install 'hostname' & 'uptime' in %%build, rather than removing
those in %%install
- do autofoo in %%prep
- remove perl regexp on texinfo page for wtmp path, now giving duplicate..
- compress ChangeLog in %%prep and drop shipping ancient changelogs
- explicitly build without selinux support
- obsolete/provide mktemp
* Tue Nov 16 2010 Bogdano Arendartchuk <bogdano@mandriva.com> 8.7-3mdv2011.0
+ Revision: 598126
- replacing ealier release uploaded manually
+ Andrey Borzenkov <arvidjaar@mandriva.org>
- source202: su -l PAM config (fedora)
* Tue Nov 16 2010 Funda Wang <fwang@mandriva.org> 8.7-1mdv2011.0
+ Revision: 598011
- new version 8.7
+ Tomasz Pawel Gajc <tpg@mandriva.org>
- update to new version 8.6
- update patches 706 and 800 (from Fedora)
* Tue Aug 31 2010 Thierry Vignaud <tv@mandriva.org> 8.5-2mdv2011.0
+ Revision: 574911
- let the doc subpackage be noarch
* Thu Apr 29 2010 Funda Wang <fwang@mandriva.org> 8.5-1mdv2010.1
+ Revision: 540892
- New version 8.5
* Tue Feb 09 2010 Funda Wang <fwang@mandriva.org> 8.4-2mdv2010.1
+ Revision: 502813
- rebuild for new gmp
* Thu Jan 14 2010 Funda Wang <fwang@mandriva.org> 8.4-1mdv2010.1
+ Revision: 491125
- add several BRs for locales
- new version 8.4
* Mon Jan 11 2010 Funda Wang <fwang@mandriva.org> 8.3-1mdv2010.1
+ Revision: 489498
- no tests needed to be disabled
- rediff i18n patch
- rediff some patches
- New version 8.3
* Sun Jan 03 2010 Funda Wang <fwang@mandriva.org> 8.2-1mdv2010.1
+ Revision: 485787
- disable utimens too
- disable tests which introduce assertion (unknown reason)
- disable format check in check section
- rediff spacedir patch
- New version 8.2
- drop touch_errno patch (don't know where it comes and does not apply)
- renew uname patch with fedora one
- rediff patches
* Fri Oct 16 2009 Frederic Crozat <fcrozat@mandriva.com> 7.5-2mdv2010.0
+ Revision: 457931
- Move tac to /bin, needed for latest initscripts
* Sun Aug 23 2009 Tomasz Pawel Gajc <tpg@mandriva.org> 7.5-1mdv2010.0
+ Revision: 419994
- add missing buildrequires on strace, bison, flex, libcap-devel and libgmp-devel
- spec file clean
- rediff patches 800, 1011 and 1013
- disable rpath
- fix license
- package libstdbuf.so
+ Nicolas Lécureuil <nlecureuil@mandriva.com>
- Add su manpage (Bug #51699)
* Mon Jul 20 2009 Guillaume Rousse <guillomovitch@mandriva.org> 7.4-2mdv2010.0
+ Revision: 398210
- re-activate utimensat, now the xen kernel is uptodate
* Tue May 19 2009 Guillaume Rousse <guillomovitch@mandriva.org> 7.4-1mdv2010.0
+ Revision: 377815
- new version
+ Thierry Vignaud <tv@mandriva.org>
- new version
* Sat May 02 2009 Funda Wang <fwang@mandriva.org> 7.2-1mdv2010.0
+ Revision: 370446
- New version 7.2
* Thu Mar 05 2009 Frederic Crozat <fcrozat@mandriva.com> 7.1-2mdv2009.1
+ Revision: 349061
- Add explicit provides for /bin/env and /usr/bin/env
* Thu Feb 26 2009 Per Øyvind Karlsen <peroyvind@mandriva.org> 7.1-1mdv2009.1
+ Revision: 345271
- add versioned buildrequires on tar & automake for xz support
- new release: 7.1
- rediff a lot of patches..
- fix typo
- update DIR_COLORS patch with new .xz format added
+ Tomasz Pawel Gajc <tpg@mandriva.org>
- rebuild for python-2.6
* Sun Dec 21 2008 Oden Eriksson <oeriksson@mandriva.com> 6.12-4mdv2009.1
+ Revision: 316959
- rediffed some fuzzy patches
* Tue Nov 11 2008 Gustavo De Nardin <gustavodn@mandriva.com> 6.12-3mdv2009.1
+ Revision: 302337
- cripple coreutils to not use utimensat() syscall, available since kernel
2.6.22, for Xen kernel compatibility (#45606)
+ Thierry Vignaud <tv@mandriva.org>
- remove tool list from description
* Tue Jun 24 2008 Luiz Fernando Capitulino <lcapitulino@mandriva.com> 6.12-2mdv2009.0
+ Revision: 228635
- Fix wrong allocation size
The line which allocates szStrings is allocating only
three bytes instead of the space required for three
char pointers.
Bug reproducible by doing 'uname -p'.
* Mon Jun 16 2008 Funda Wang <fwang@mandriva.org> 6.12-1mdv2009.0
+ Revision: 219518
- fix problematic cut test case
- chmod at prep section
- New version 6.12
- sync i18n patch with fedora
* Thu May 01 2008 Funda Wang <fwang@mandriva.org> 6.11-1mdv2009.0
+ Revision: 199891
- rediff groupfix patch
- rediff i18n and pam patch
- rediff patch703
- New version 6.11
* Fri Mar 07 2008 Andreas Hasenack <andreas@mandriva.com> 6.10-4mdv2008.1
+ Revision: 181646
- drop specific versioned requires of automake
- fix "id" can't fetch group name (#38577)
* Tue Jan 29 2008 Funda Wang <fwang@mandriva.org> 6.10-3mdv2008.1
+ Revision: 159680
- fix requirment on info-install
* Sun Jan 27 2008 Funda Wang <fwang@mandriva.org> 6.10-2mdv2008.1
+ Revision: 158552
- update binary list
* Sat Jan 26 2008 Funda Wang <fwang@mandriva.org> 6.10-1mdv2008.1
+ Revision: 158248
- Update i18n patch with fedora one
- rediff uname patch
- rediff pam patch
- New version 6.10
- drop patches merged upstream
* Fri Jan 11 2008 Thierry Vignaud <tv@mandriva.org> 6.9-6mdv2008.1
+ Revision: 149129
- rebuild
- kill re-definition of %%buildroot on Pixel's request
+ Olivier Blin <oblin@mandriva.com>
- restore BuildRoot
+ Arnaud Patard <apatard@mandriva.com>
- Use proper way to change CFLAGS in the spec file.
(aka dd if=/dev/zero bs=1M count=300 | time -p sum -s bug fix).
* Thu Sep 06 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 6.9-5mdv2008.0
+ Revision: 81114
- disable coloring for text documents
* Sun Aug 26 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 6.9-4mdv2008.0
+ Revision: 71568
- give black background for white text for documents in case of using
terminal with white background (updates P1011, fixes #32827)
- add some more files to doc coloring (updates P1011)
* Thu Aug 23 2007 Thierry Vignaud <tv@mandriva.org> 6.9-3mdv2008.0
+ Revision: 69360
- kill file require on info-install
+ Per Øyvind Karlsen <peroyvind@mandriva.org>
- add coloring for .wma & *rc (updates P1011)
- add even more formats (updates P1011, I have no life:p)
- drop lzma patch (P1010) and rather merge with generic dircolors patch (P1011)
- add some more formats (updates P1011)
- regenerate dircolors.h with dcgen in stead of patch
- add coloring for backup files (updates P1011)
- drop junk and be sure not to remove copyright notice in dircolors.hin (updates P1011)
- add white color for document formats (updates P1011)
- add a few more formats (updates P1011)
- update P1011 with coloring for .flv (flash video)
* Sat Jul 14 2007 Funda Wang <fwang@mandriva.org> 6.9-2mdv2008.0
+ Revision: 51981
- Add fedora patch to build against glibc 2.6
- Update program list
- Obsoletes base64
+ Per Øyvind Karlsen <peroyvind@mandriva.org>
- add back always blinking colors for broken symlinks (P1013)
- fix P1011 as it reverted P1010 and lzma coloring
* Thu Jul 12 2007 Funda Wang <fwang@mandriva.org> 6.9-1mdv2008.0
+ Revision: 51465
- Enable test scripts
- Remove old acl patches
- rediff patch 1011
- Rediff patch 1010.
- Add patch1012: From fedora, fix ls -x
- Rediff patch800: from fedora
- Rediff patch706: from Fedora.
- Rediff patch1155
- remove patch107: obsoletes by upstream code
- Remove patch102: sparc detection not there
- Remove patch0: lg.po not there
- New upstream version
* Wed Jul 11 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 5.97-8mdv2008.0
+ Revision: 51341
- drop S101 & S102 and rather merge with dircolors.hin in package as well as add few types (P1011)
- add lzma coloring support for ls (P1010, might need some more work?)
- change to and fix usage of new automake 1.10
- fix inclusion of locale files
* Mon May 28 2007 Ademar de Souza Reis Jr <ademar@mandriva.com.br> 5.97-7mdv2008.0
+ Revision: 32177
+ rebuild (emptylog)
* Mon May 28 2007 Ademar de Souza Reis Jr <ademar@mandriva.com.br> 5.97-6mdv2008.0
+ Revision: 32036
- fix -doc description
- remove redundant build-requirement of acl-devel
+ Anssi Hannula <anssi@mandriva.org>
- fix URL
* Tue Feb 20 2007 Thierry Vignaud <tvignaud@mandriva.com> 5.97-6mdv2007.0
+ Revision: 123126
- bump release (#28834)
+ Per Øyvind Karlsen <pkarlsen@mandriva.com>
- reintroduce interactive override (-if) and rather fix check (P1155, real fix for #16209)
+ Olivier Blin <oblin@mandriva.com>
- explicitely run autotools (or else configure is run two times), we need them for pam/i18n/acl/xattr/hname
* Fri Oct 20 2006 Olivier Blin <oblin@mandriva.com> 5.97-4mdv2007.1
+ Revision: 71290
- rebuild for su to be linked with pam (#26353 and #26527)
- Import coreutils
* Thu Aug 31 2006 Thierry Vignaud <tvignaud@mandriva.com> 5.97-3mdv2007.0
- kill patch 1155 thus the testsuite works again (#16209)
[warning: this means cp -i -f behaves like cp -i, no more like cp -f]
- update & reenable patch 1001-1004 from suse (ACL+xattr support)
* Thu Aug 31 2006 Thierry Vignaud <tvignaud@mandriva.com> 5.97-1mdv2007.0
- new release
- update patches 800 & 1001 from rh
- rediff patches 101, 105, 111, 114, 1115, 703 & 1003
- kill patches 108, 112, 116, 117, 153, 908, 2000 (merged upstream)
- kill patch 2001 (no more needed)
- kill patch 105 (unstandard option)
- drop patches 111 (deprecated rh patch introduced in fileutils-4.1.1-1mdk),
114 (likewise, 4.1) 115 (likewise, 4.1.5-1mdk), 710, 901 (no more needed),
1002 (merged in 1001)
- source 200: sync with fedora
- disable patch 104 (it's time to catch offenders) and 1003 (broken)
- fix build
* Thu Aug 31 2006 Thierry Vignaud <tvignaud@mandriva.com> 5.2.1-11mdv2007.0
- patch 2000: update zh translation (#17302)
- patch 2001: fix build
- fix macro-in-%%changelog
* Sat May 13 2006 Stefan van der Eijk <stefan@eijk.nu> 5.2.1-10mdk
- rebuild for sparc
* Mon Jan 30 2006 Olivier Blin <oblin@mandriva.com> 5.2.1-9mdk
- use "include" directive instead of deprecated pam_stack module
* Fri Aug 19 2005 Stew Benedict <sbenedict@mandriva.com> 5.2.1-8mdk
- redo LSB/i18n patch, join segfaults during LSB testing
when compiled with gcc4
* Fri Aug 12 2005 Leonardo Chiquitto Filho <chiquitto@mandriva.com> 5.2.1-7mdk
- patches 1001, 1002 1003: add support to posix acls and extended attributes
(#15050)
- patch 801: fix some typos in pt_BR.po file
* Fri Aug 12 2005 Nicolas Lécureuil <neoclust@mandriva.org> 5.2.1-6mdk
- fix rpmlint errors (PreReq)
* Thu Feb 10 2005 Thierry Vignaud <tvignaud@mandrakesoft.com> 5.2.1-5mdk
- move expr into /bin (#7052)
* Mon Jul 26 2004 Christiaan Welvaart <cjw@daneel.dyndns.org> 5.2.1-4mdk
- run automake for patch 111
* Fri Jun 25 2004 Thierry Vignaud <tvignaud@mandrakesoft.com> 5.2.1-3mdk
- simplify build
* Thu Jun 24 2004 Thierry Vignaud <tvignaud@mandrakesoft.com> 5.2.1-2mdk
- fix link with pam
- fix --short-circuit when %%build failled
- patch 910: show correct CPU name (Marcin Gondek, #7865)
(if it brokes anything, we'll revert)
- patch 111: fix ls build
* Fri Apr 02 2004 Thierry Vignaud <tvignaud@mandrakesoft.com> 5.2.1-1mdk
- new release
- remove patch 502, 906 (useless)

10
fileutils-4.1-ls_h.patch Normal file
View file

@ -0,0 +1,10 @@
--- fileutils-4.1/src/ls.h.orig Mon Feb 15 17:27:12 1999
+++ fileutils-4.1/src/ls.h Fri Jul 20 21:03:51 2001
@@ -7,4 +7,7 @@
/* This is for the `vdir' program. */
#define LS_LONG_FORMAT 3
+#define MODE_WT 01002
+#define MODE_WRO 02
+
extern int ls_mode;

19
sh-utils-1.16-paths.patch Normal file
View file

@ -0,0 +1,19 @@
diff -Naurp coreutils-6.12/src/su.c coreutils-6.12.oden/src/su.c
--- coreutils-6.12/src/su.c 2008-05-26 08:40:33.000000000 +0200
+++ coreutils-6.12.oden/src/su.c 2008-12-21 16:09:29.000000000 +0100
@@ -112,6 +112,15 @@
# define DEFAULT_ROOT_LOGIN_PATH "/usr/ucb:/bin:/usr/bin:/etc"
#endif
+/* The default paths which get set are both bogus and oddly influenced
+ by <paths.h> and -D on the commands line. Just to be clear, we'll set
+ these explicitly. -ewt */
+#undef DEFAULT_LOGIN_PATH
+#undef DEFAULT_ROOT_LOGIN_PATH
+#define DEFAULT_LOGIN_PATH "/bin:/usr/bin:/usr/local/bin:/usr/bin/X11"
+#define DEFAULT_ROOT_LOGIN_PATH \
+ "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11"
+
/* The shell to run if none is given in the user's passwd entry. */
#define DEFAULT_SHELL "/bin/sh"

6
su-l.pamd Normal file
View file

@ -0,0 +1,6 @@
#%PAM-1.0
auth include su
account include su
password include su
session optional pam_keyinit.so force revoke
session include su

11
su.pamd Normal file
View file

@ -0,0 +1,11 @@
#%PAM-1.0
auth sufficient pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth required pam_wheel.so use_uid
auth include system-auth
account include system-auth
password include system-auth
session optional pam_xauth.so
session include system-auth