- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
    chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
This commit is contained in:
Tim Waugh 2005-10-27 15:05:08 +00:00
parent 6e90d64fff
commit c3e4c8460e
10 changed files with 1254 additions and 2153 deletions

View File

@ -1 +1,2 @@
coreutils-5.2.1.tar.bz2
coreutils-5.92.tar.bz2

View File

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

View File

@ -1,5 +1,122 @@
--- /dev/null 2004-09-30 04:21:43.103661032 -0400
+++ coreutils-5.2.1/man/runuser.1 2004-10-05 09:56:25.919169327 -0400
--- coreutils-5.92/src/su.c.runuser 2005-10-27 09:13:53.000000000 +0100
+++ coreutils-5.92/src/su.c 2005-10-27 09:17:11.000000000 +0100
@@ -134,7 +134,9 @@
/* The official name of this program (e.g., no `g' prefix). */
#define PROGRAM_NAME "su"
+#ifndef AUTHORS
#define AUTHORS "David MacKenzie"
+#endif
#if HAVE_PATHS_H
# include <paths.h>
@@ -172,6 +174,10 @@
#ifndef USE_PAM
char *crypt ();
#endif
+#ifndef CHECKPASSWD
+#define CHECKPASSWD 1
+#endif
+
char *getpass ();
char *getusershell ();
void endusershell ();
@@ -730,7 +736,7 @@
: DEFAULT_SHELL);
endpwent ();
- if (!correct_password (pw))
+ if (CHECKPASSWD && !correct_password (pw))
{
#ifdef SYSLOG_FAILURE
log_su (pw, false);
--- coreutils-5.92/src/Makefile.am.runuser 2005-10-27 09:13:53.000000000 +0100
+++ coreutils-5.92/src/Makefile.am 2005-10-27 09:13:53.000000000 +0100
@@ -17,7 +17,7 @@
## along with this program; if not, write to the Free Software Foundation,
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who
+EXTRA_PROGRAMS = chroot df hostid nice pinky stty su runuser uname uptime users who
bin_SCRIPTS = groups
bin_PROGRAMS = [ chgrp chown chmod cp dd dircolors du \
@@ -91,6 +91,7 @@
uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS)
su_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
+runuser_LDADD = $(LDADD) $(LIB_CRYPT)
$(PROGRAMS): ../lib/libcoreutils.a
@@ -106,7 +107,7 @@
chmod +x $@-t
mv $@-t $@
-all-local: su$(EXEEXT)
+all-local: su$(EXEEXT) runuser
installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
--- /dev/null 2005-10-10 09:36:06.437701000 +0100
+++ coreutils-5.92/src/runuser.c 2005-10-27 09:17:34.000000000 +0100
@@ -0,0 +1,54 @@
+#define CHECKPASSWD 0
+#define pam_start my_pam_start
+#define pam_end my_pam_end
+#define pam_setcred my_pam_setcred
+#define pam_open_session my_pam_open_session
+#define pam_close_session my_pam_close_session
+#define pam_strerror my_pam_strerror
+#define pam_getenvlist my_pam_getenvlist
+#define AUTHORS "David MacKenzie, Dan Walsh"
+#include "su.c"
+int pam_start(const char *service_name, const char *user,
+ const struct pam_conv *pam_conversation,
+ pam_handle_t **pamh) {
+ return PAM_SUCCESS;
+}
+int pam_end(pam_handle_t *pamh, int pam_status) {
+ return PAM_SUCCESS;
+}
+int pam_setcred(pam_handle_t *pamh, int flags){
+ return PAM_SUCCESS;
+}
+int pam_open_session(pam_handle_t *pamh, int flags){
+ return PAM_SUCCESS;
+}
+int pam_close_session(pam_handle_t *pamh, int flags){
+ return PAM_SUCCESS;
+}
+const char *pam_strerror(pam_handle_t *pamh, int err){
+ return "";
+}
+char **pam_getenvlist(pam_handle_t *pamh){
+ return NULL;
+}
+
+int misc_conv(int num_msg, const struct pam_message **msgm,
+ struct pam_response **response, void *appdata_ptr) {
+ return PAM_SUCCESS;
+}
+
+int pam_authenticate(pam_handle_t *pamh, int flags) {
+ return PAM_SUCCESS;
+}
+
+int pam_acct_mgmt(pam_handle_t *pamh, int flags) {
+ return PAM_SUCCESS;
+}
+
+int pam_chauthtok (pam_handle_t *pamh, int flags) {
+ return PAM_SUCCESS;
+}
+
+int pam_set_item(pam_handle_t *pamh, int item_type, const void *item) {
+ return PAM_SUCCESS;
+}
--- /dev/null 2005-10-10 09:36:06.437701000 +0100
+++ coreutils-5.92/man/runuser.1 2005-10-27 09:13:53.000000000 +0100
@@ -0,0 +1,59 @@
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.33.
+.TH RUNUSER "1" "September 2004" "runuser (coreutils) 5.2.1" "User Commands"
@ -60,8 +177,8 @@
+.B info coreutils su
+.PP
+should give you access to the complete manual.
--- coreutils-5.2.1/man/Makefile.am.runuser 2004-01-23 10:54:23.000000000 -0500
+++ coreutils-5.2.1/man/Makefile.am 2004-10-05 09:56:25.921169102 -0400
--- coreutils-5.92/man/Makefile.am.runuser 2005-10-13 15:12:26.000000000 +0100
+++ coreutils-5.92/man/Makefile.am 2005-10-27 09:13:53.000000000 +0100
@@ -7,7 +7,7 @@
link.1 ln.1 logname.1 \
ls.1 md5sum.1 mkdir.1 mkfifo.1 mknod.1 mv.1 nice.1 nl.1 nohup.1 od.1 \
@ -79,15 +196,25 @@
seq.1: $(common_dep) $(srcdir)/seq.x ../src/seq.c
sha1sum.1: $(common_dep) $(srcdir)/sha1sum.x ../src/md5sum.c
shred.1: $(common_dep) $(srcdir)/shred.x ../src/shred.c
--- /dev/null 2004-09-30 04:21:43.103661032 -0400
+++ coreutils-5.2.1/man/runuser.x 2004-10-05 09:56:25.922168989 -0400
--- /dev/null 2005-10-10 09:36:06.437701000 +0100
+++ coreutils-5.92/man/runuser.x 2005-10-27 09:13:53.000000000 +0100
@@ -0,0 +1,4 @@
+[NAME]
+runuser \- run a shell with substitute user and group IDs
+[DESCRIPTION]
+.\" Add any additional description here
--- coreutils-5.2.1/README.runuser 2004-01-18 02:59:41.000000000 -0500
+++ coreutils-5.2.1/README 2004-10-05 09:56:25.925168651 -0400
--- coreutils-5.92/tests/help-version.runuser 2005-01-05 22:08:48.000000000 +0000
+++ coreutils-5.92/tests/help-version 2005-10-27 09:13:53.000000000 +0100
@@ -136,6 +136,7 @@
seq_args=10
sleep_args=0
su_args=--version
+runuser_args=--version
test_args=foo
# This is necessary in the unusual event that there is
--- coreutils-5.92/README.runuser 2005-09-28 19:34:03.000000000 +0100
+++ coreutils-5.92/README 2005-10-27 09:13:53.000000000 +0100
@@ -11,7 +11,7 @@
df dir dircolors dirname du echo env expand expr factor false fmt fold
ginstall groups head hostid hostname id join kill link ln logname ls
@ -97,127 +224,13 @@
split stat stty su sum sync tac tail tee test touch tr true tsort tty
uname unexpand uniq unlink uptime users vdir wc who whoami yes
--- coreutils-5.2.1/tests/help-version.runuser 2004-02-17 11:04:23.000000000 -0500
+++ coreutils-5.2.1/tests/help-version 2004-10-05 09:56:25.924168764 -0400
@@ -130,6 +130,7 @@
seq_args=10
sleep_args=0
su_args=--version
+runuser_args=--version
test_args=foo
# This is necessary in the unusual event that there is
--- coreutils-5.2.1/src/su.c.runuser 2004-10-05 09:56:25.680196251 -0400
+++ coreutils-5.2.1/src/su.c 2004-10-05 09:56:25.915169778 -0400
@@ -171,6 +171,10 @@
#ifndef USE_PAM
char *crypt ();
#endif
+#ifndef CHECKPASSWD
+#define CHECKPASSWD 1
+#endif
+
char *getpass ();
char *getusershell ();
void endusershell ();
@@ -740,7 +744,7 @@
pw->pw_dir = xstrdup (pw->pw_dir);
pw->pw_shell = xstrdup (pw->pw_shell);
- if (!correct_password (pw))
+ if (CHECKPASSWD && !correct_password (pw))
{
#ifdef SYSLOG_FAILURE
log_su (pw, 0);
--- coreutils-5.2.1/src/Makefile.am.runuser 2004-10-05 09:56:25.677196589 -0400
+++ coreutils-5.2.1/src/Makefile.am 2004-10-05 09:56:25.916169665 -0400
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
-EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who
+EXTRA_PROGRAMS = chroot df hostid nice pinky stty su runuser uname uptime users who
bin_SCRIPTS = groups
bin_PROGRAMS = [ chgrp chown chmod cp dd dircolors du \
@@ -67,6 +67,7 @@
uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS)
su_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
+runuser_LDADD = $(LDADD) $(LIB_CRYPT)
$(PROGRAMS): ../lib/libfetish.a
@@ -84,7 +85,7 @@
chmod +x $@-t
mv $@-t $@
-all-local: su$(EXEEXT)
+all-local: su$(EXEEXT) runuser
installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
@@ -100,7 +101,7 @@
chmod $(setuid_root_mode) $(installed_su)
install-root: su$(EXEEXT)
- @$(INSTALL_SU)
+ @$(INSTALL_SU)
install-exec-local: su$(EXEEXT)
@TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \
--- /dev/null 2004-09-30 04:21:43.103661032 -0400
+++ coreutils-5.2.1/src/runuser.c 2004-10-05 10:04:28.835490381 -0400
@@ -0,0 +1,53 @@
+#define CHECKPASSWD 0
+#define pam_start my_pam_start
+#define pam_end my_pam_end
+#define pam_setcred my_pam_setcred
+#define pam_open_session my_pam_open_session
+#define pam_close_session my_pam_close_session
+#define pam_strerror my_pam_strerror
+#define pam_getenvlist my_pam_getenvlist
+#include "su.c"
+int pam_start(const char *service_name, const char *user,
+ const struct pam_conv *pam_conversation,
+ pam_handle_t **pamh) {
+ return PAM_SUCCESS;
+}
+int pam_end(pam_handle_t *pamh, int pam_status) {
+ return PAM_SUCCESS;
+}
+int pam_setcred(pam_handle_t *pamh, int flags){
+ return PAM_SUCCESS;
+}
+int pam_open_session(pam_handle_t *pamh, int flags){
+ return PAM_SUCCESS;
+}
+int pam_close_session(pam_handle_t *pamh, int flags){
+ return PAM_SUCCESS;
+}
+const char *pam_strerror(pam_handle_t *pamh, int err){
+ return "";
+}
+char **pam_getenvlist(pam_handle_t *pamh){
+ return NULL;
+}
+
+int misc_conv(int num_msg, const struct pam_message **msgm,
+ struct pam_response **response, void *appdata_ptr) {
+ return PAM_SUCCESS;
+}
+
+int pam_authenticate(pam_handle_t *pamh, int flags) {
+ return PAM_SUCCESS;
+}
+
+int pam_acct_mgmt(pam_handle_t *pamh, int flags) {
+ return PAM_SUCCESS;
+}
+
+int pam_chauthtok (pam_handle_t *pamh, int flags) {
+ return PAM_SUCCESS;
+}
+
+int pam_set_item(pam_handle_t *pamh, int item_type, const void *item) {
+ return PAM_SUCCESS;
+}
--- coreutils-5.92/AUTHORS.runuser 2004-11-03 23:10:50.000000000 +0000
+++ coreutils-5.92/AUTHORS 2005-10-27 09:13:53.000000000 +0100
@@ -59,6 +59,7 @@
readlink: Dmitry V. Levin
rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering
rmdir: David MacKenzie
+runuser: David MacKenzie, Dan Walsh
seq: Ulrich Drepper
sha1sum: Ulrich Drepper, Scott Miller
shred: Colin Plumb

View File

@ -1,16 +1,16 @@
--- coreutils-5.2.1/m4/jm-macros.m4.getgrouplist 2003-12-20 17:57:18.000000000 +0000
+++ coreutils-5.2.1/m4/jm-macros.m4 2004-10-05 12:43:14.975401711 +0100
@@ -83,6 +83,7 @@
endpwent \
fdatasync \
--- coreutils-5.92/m4/jm-macros.m4.getgrouplist 2005-09-25 06:57:46.000000000 +0100
+++ coreutils-5.92/m4/jm-macros.m4 2005-10-25 14:28:45.000000000 +0100
@@ -105,6 +105,7 @@
fchmod \
fchown \
ftruncate \
+ getgrouplist \
gethrtime \
hasmntopt \
isascii \
--- coreutils-5.2.1/lib/getugroups.c.getgrouplist 2003-09-10 07:23:09.000000000 +0100
+++ coreutils-5.2.1/lib/getugroups.c 2004-10-05 12:43:14.980400761 +0100
@@ -21,6 +21,9 @@
iswspace \
--- coreutils-5.92/lib/getugroups.c.getgrouplist 2005-09-22 07:47:18.000000000 +0100
+++ coreutils-5.92/lib/getugroups.c 2005-10-25 14:28:02.000000000 +0100
@@ -23,6 +23,9 @@
# include <config.h>
#endif
@ -20,15 +20,15 @@
#include <sys/types.h>
#include <stdio.h> /* grp.h on alpha OSF1 V2.0 uses "FILE *". */
#include <grp.h>
@@ -95,3 +98,4 @@
@@ -105,3 +108,4 @@
return count;
}
+#endif /* have getgrouplist */
--- coreutils-5.2.1/src/id.c.getgrouplist 2004-10-05 12:26:40.222539037 +0100
+++ coreutils-5.2.1/src/id.c 2004-10-05 12:43:14.986399620 +0100
@@ -316,14 +316,36 @@
if (username == 0)
--- coreutils-5.92/src/id.c.getgrouplist 2005-08-11 22:02:57.000000000 +0100
+++ coreutils-5.92/src/id.c 2005-10-25 14:30:41.000000000 +0100
@@ -253,7 +253,14 @@
if (!username)
max_n_groups = getgroups (0, NULL);
else
- max_n_groups = getugroups (0, NULL, username, gid);
@ -41,28 +41,29 @@
+#endif
+ }
/* Add 1 just in case max_n_groups is zero. */
g = xmalloc (max_n_groups * sizeof (GETGROUPS_T) + 1);
if (username == 0)
ng = getgroups (max_n_groups, g);
else
- ng = getugroups (max_n_groups, g, username, gid);
+ {
+#ifdef HAVE_GETGROUPLIST
+ int e;
+ ng = max_n_groups;
+ while ((e = getgrouplist (username, gid, g, &ng)) == -1
+ && ng > max_n_groups)
if (max_n_groups < 0)
ng = -1;
@@ -263,7 +270,22 @@
if (!username)
ng = getgroups (max_n_groups, g);
else
- ng = getugroups (max_n_groups, g, username, gid);
+ {
+ max_n_groups = ng;
+ g = xrealloc (g, max_n_groups * sizeof (GETGROUPS_T));
+ }
+ if (e == -1)
+ ng = -1;
+#ifdef HAVE_GETGROUPLIST
+ int e;
+ ng = max_n_groups;
+ while ((e = getgrouplist (username, gid, g, &ng)) == -1
+ && ng > max_n_groups)
+ {
+ max_n_groups = ng;
+ g = xrealloc (g, max_n_groups * sizeof (GETGROUPS_T));
+ }
+ if (e == -1)
+ ng = -1;
+#else
+ ng = getugroups (max_n_groups, g, username, gid);
+ ng = getugroups (max_n_groups, g, username, gid);
+#endif
+ }
+ }
}
if (ng < 0)
{

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,16 @@
--- coreutils-5.2.1/src/Makefile.am.pam 2005-04-15 17:03:44.000000000 +0100
+++ coreutils-5.2.1/src/Makefile.am 2005-04-15 17:03:44.000000000 +0100
@@ -66,7 +66,7 @@
--- coreutils-5.92/src/Makefile.am.pam 2005-10-24 17:58:21.000000000 +0100
+++ coreutils-5.92/src/Makefile.am 2005-10-24 17:58:21.000000000 +0100
@@ -93,7 +93,7 @@
uptime_LDADD = $(LDADD) $(GETLOADAVG_LIBS)
-su_LDADD = $(LDADD) $(LIB_CRYPT)
+su_LDADD = $(LDADD) $(LIB_CRYPT) @LIB_PAM@
$(PROGRAMS): ../lib/libfetish.a
$(PROGRAMS): ../lib/libcoreutils.a
--- coreutils-5.2.1/src/su.c.pam 2005-04-15 17:03:44.000000000 +0100
+++ coreutils-5.2.1/src/su.c 2005-04-15 17:04:52.000000000 +0100
--- coreutils-5.92/src/su.c.pam 2005-10-24 17:58:21.000000000 +0100
+++ coreutils-5.92/src/su.c 2005-10-24 18:06:22.000000000 +0100
@@ -38,6 +38,16 @@
restricts who can su to UID 0 accounts. RMS considers that to
be fascist.
@ -54,21 +54,22 @@
char *getpass ();
char *getusershell ();
void endusershell ();
@@ -158,8 +179,12 @@
@@ -158,8 +179,13 @@
extern char **environ;
-static void run_shell (const char *, const char *, char **)
+static void run_shell (const char *, const char *, char **, const struct passwd *)
-static void run_shell (char const *, char const *, char **, size_t)
+static void run_shell (char const *, char const *, char **, size_t,
+ const struct passwd *)
+#ifdef USE_PAM
+ ;
+ ;
+#else
ATTRIBUTE_NORETURN;
+#endif
/* The name this program was run with. */
char *program_name;
@@ -271,7 +296,22 @@
@@ -248,7 +274,22 @@
}
#endif
@ -88,11 +89,11 @@
+
/* Ask the user for a password.
+ If PAM is in use, let PAM ask for the password if necessary.
Return 1 if the user gives the correct password for entry PW,
0 if not. Return 1 without asking for a password if run by UID 0
Return true if the user gives the correct password for entry PW,
false if not. Return true without asking for a password if run by UID 0
or if PW has an empty password. */
@@ -279,6 +319,44 @@
static int
@@ -256,6 +297,44 @@
static bool
correct_password (const struct passwd *pw)
{
+#ifdef USE_PAM
@ -136,41 +137,34 @@
char *unencrypted, *encrypted, *correct;
#if HAVE_GETSPNAM && HAVE_STRUCT_SPWD_SP_PWDP
/* Shadow passwd stuff for SVR3 and maybe other systems. */
@@ -303,6 +381,7 @@
@@ -280,6 +359,7 @@
encrypted = crypt (unencrypted, correct);
memset (unencrypted, 0, strlen (unencrypted));
return strcmp (encrypted, correct) == 0;
return STREQ (encrypted, correct);
+#endif /* !USE_PAM */
}
/* Update `environ' for the new shell based on PW, with SHELL being
@@ -312,16 +391,24 @@
modify_environment (const struct passwd *pw, const char *shell)
{
char *term;
+ char *display;
+ char *xauthority;
if (simulate_login)
{
- /* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH.
+ /* Leave TERM, DISPLAY, XAUTHORITY unchanged. Set HOME, SHELL, USER, LOGNAME, PATH.
@@ -293,12 +373,18 @@
/* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH.
Unset all other environment variables. */
term = getenv ("TERM");
+ display = getenv ("DISPLAY");
+ xauthority = getenv ("XAUTHORITY");
environ = xmalloc (2 * sizeof (char *));
environ[0] = 0;
char const *term = getenv ("TERM");
+ char const *display = getenv ("DISPLAY");
+ char const *xauthority = getenv ("XAUTHORITY");
if (term)
xputenv (concat ("TERM", "=", term));
term = xstrdup (term);
environ = xmalloc ((6 + !!term) * sizeof (char *));
environ[0] = NULL;
if (term)
xsetenv ("TERM", term);
+ if (display)
+ xputenv (concat ("DISPLAY", "=", display));
+ xsetenv ("DISPLAY", display);
+ if (xauthority)
+ xputenv (concat ("XAUTHORITY", "=", xauthority));
xputenv (concat ("HOME", "=", pw->pw_dir));
xputenv (concat ("SHELL", "=", shell));
xputenv (concat ("USER", "=", pw->pw_name));
@@ -354,8 +441,13 @@
+ xsetenv ("XAUTHORITY", xauthority);
xsetenv ("HOME", pw->pw_dir);
xsetenv ("SHELL", shell);
xsetenv ("USER", pw->pw_name);
@@ -331,8 +417,13 @@
{
#ifdef HAVE_INITGROUPS
errno = 0;
@ -185,7 +179,7 @@
endgrent ();
#endif
if (setgid (pw->pw_gid))
@@ -364,16 +456,69 @@
@@ -341,6 +432,31 @@
error (EXIT_FAIL, errno, _("cannot set user id"));
}
@ -205,7 +199,8 @@
+ env = pam_getenvlist(pamh);
+ if(env) {
+ while(*env) {
+ xputenv(*env);
+ if (putenv (*env))
+ xalloc_die ();
+ env++;
+ }
+ }
@ -215,15 +210,17 @@
+
/* Run SHELL, or DEFAULT_SHELL if SHELL is empty.
If COMMAND is nonzero, pass it to the shell with the -c option.
If ADDITIONAL_ARGS is nonzero, pass it to the shell as more
arguments. */
Pass ADDITIONAL_ARGS to the shell as more arguments; there
@@ -348,17 +464,49 @@
static void
-run_shell (const char *shell, const char *command, char **additional_args)
+run_shell (const char *shell, const char *command, char **additional_args, const struct passwd *pw)
run_shell (char const *shell, char const *command, char **additional_args,
- size_t n_additional_args)
+ size_t n_additional_args, const struct passwd *pw)
{
const char **args;
int argno = 1;
size_t n_args = 1 + fast_startup + 2 * !!command + n_additional_args + 1;
char const **args = xnmalloc (n_args, sizeof *args);
size_t argno = 1;
+#ifdef USE_PAM
+ int child;
+ sigset_t ourset;
@ -254,9 +251,8 @@
+ pam_end(pamh, 0);
+#endif
if (additional_args)
args = xmalloc (sizeof (char *)
@@ -385,6 +530,9 @@
if (simulate_login)
{
char *arg0;
char *shell_basename;
@ -266,7 +262,7 @@
shell_basename = base_name (shell);
arg0 = xmalloc (strlen (shell_basename) + 2);
arg0[0] = '-';
@@ -411,6 +559,66 @@
@@ -383,6 +531,66 @@
error (0, errno, "%s", shell);
exit (exit_status);
}
@ -332,24 +328,23 @@
+#endif /* USE_PAM */
}
/* Return 1 if SHELL is a restricted shell (one not returned by
@@ -586,9 +794,10 @@
}
/* Return true if SHELL is a restricted shell (one not returned by
@@ -550,9 +758,11 @@
shell = xstrdup (shell ? shell : pw->pw_shell);
modify_environment (pw, shell);
+
+#ifndef USE_PAM
change_identity (pw);
- if (simulate_login && chdir (pw->pw_dir))
- error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
+#endif
if (simulate_login && chdir (pw->pw_dir) != 0)
error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir);
- run_shell (shell, command, additional_args);
+ run_shell (shell, command, additional_args, pw);
- run_shell (shell, command, argv + optind, MAX (0, argc - optind));
+ run_shell (shell, command, argv + optind, MAX (0, argc - optind), pw);
}
--- coreutils-5.2.1/doc/coreutils.texi.pam 2005-04-15 17:03:44.000000000 +0100
+++ coreutils-5.2.1/doc/coreutils.texi 2005-04-15 17:03:44.000000000 +0100
@@ -11850,8 +11850,11 @@
--- coreutils-5.92/doc/coreutils.texi.pam 2005-10-16 08:26:21.000000000 +0100
+++ coreutils-5.92/doc/coreutils.texi 2005-10-24 17:58:21.000000000 +0100
@@ -12746,8 +12746,11 @@
@findex syslog
@command{su} can optionally be compiled to use @code{syslog} to report
failed, and optionally successful, @command{su} attempts. (If the system
@ -363,7 +358,7 @@
The program accepts the following options. Also see @ref{Common options}.
@@ -11932,33 +11935,6 @@
@@ -12828,33 +12831,6 @@
the exit status of the subshell otherwise
@end display
@ -397,11 +392,11 @@
@node Process control
@chapter Process control
--- coreutils-5.2.1/configure.ac.pam 2005-04-15 17:03:44.000000000 +0100
+++ coreutils-5.2.1/configure.ac 2005-04-15 17:03:44.000000000 +0100
@@ -7,6 +7,13 @@
AM_INIT_AUTOMAKE([1.8 gnits dist-bzip2])
--- coreutils-5.92/configure.ac.pam 2005-10-24 17:58:21.000000000 +0100
+++ coreutils-5.92/configure.ac 2005-10-24 17:58:21.000000000 +0100
@@ -28,6 +28,13 @@
AB_INIT()
AM_INIT_AUTOMAKE([1.8.3 gnits dist-bzip2])
+dnl Give the chance to enable PAM
+AC_ARG_ENABLE(pam, dnl
@ -412,10 +407,10 @@
+
gl_DEFAULT_POSIX2_VERSION
gl_USE_SYSTEM_EXTENSIONS
jm_PERL
--- coreutils-5.2.1/config.hin.pam 2005-04-15 17:03:44.000000000 +0100
+++ coreutils-5.2.1/config.hin 2005-04-15 17:03:44.000000000 +0100
@@ -1365,6 +1365,9 @@
gl_PERL
--- coreutils-5.92/config.hin.pam 2005-10-24 17:58:21.000000000 +0100
+++ coreutils-5.92/config.hin 2005-10-24 17:58:21.000000000 +0100
@@ -1526,6 +1526,9 @@
/* Define if you want access control list support. */
#undef USE_ACL

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils
Version: 5.2.1
Release: 56
Version: 5.92
Release: 0.1
License: GPL
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -15,11 +15,14 @@ Source105: colorls.sh
Source106: colorls.csh
Source200: su.pamd
# From upstream
Patch1: coreutils-mkdir.patch
Patch2: coreutils-dircolors.patch
Patch3: coreutils-mkdir2.patch
Patch4: coreutils-tac.patch
# fileutils
Patch107: fileutils-4.1.10-timestyle.patch
Patch108: fileutils-4.1.5-afs.patch
Patch116: fileutils-4.1-dircolors_c.patch
Patch153: fileutils-4.1.10-utmp.patch
Patch182: coreutils-acl.patch
# sh-utils
@ -30,30 +33,15 @@ Patch704: sh-utils-1.16-paths.patch
# it here indefinitely.
Patch706: coreutils-pam.patch
Patch713: coreutils-4.5.3-langinfo.patch
Patch714: coreutils-4.5.3-printf-ll.patch
Patch715: coreutils-4.5.3-sysinfo.patch
# (sb) lin18nux/lsb compliance
Patch800: coreutils-i18n.patch
Patch904: coreutils-5.0-allow_old_options.patch
Patch905: coreutils-jday.patch
Patch906: coreutils-fchown.patch
Patch907: coreutils-5.2.1-runuser.patch
Patch908: coreutils-getgrouplist.patch
Patch909: coreutils-zh_CN.patch
Patch910: coreutils-gcc4.patch
Patch911: coreutils-brokentest.patch
Patch912: coreutils-overflow.patch
# From upstream
Patch920: coreutils-dateseconds.patch
Patch921: coreutils-chown.patch
Patch922: coreutils-rmaccess.patch
Patch923: coreutils-copy.patch
Patch924: coreutils-stale-utmp.patch
Patch925: coreutils-no-sign-extend.patch
#SELINUX Patch
Patch950: coreutils-selinux.patch
@ -82,11 +70,14 @@ the old GNU fileutils, sh-utils, and textutils packages.
%prep
%setup -q
# From upstream
%patch1 -p0 -b .mkdir
%patch2 -p0 -b .dircolors
%patch3 -p0 -b .mkdir2
%patch4 -p0 -b .tac
# fileutils
%patch107 -p1 -b .timestyle
%patch108 -p1 -b .afs
%patch116 -p1
%patch153 -p1
%patch182 -p1 -b .acl
# sh-utils
@ -94,31 +85,16 @@ the old GNU fileutils, sh-utils, and textutils packages.
%patch704 -p1 -b .paths
%patch706 -p1 -b .pam
%patch713 -p1 -b .langinfo
%patch714 -p1 -b .printf-ll
%patch715 -p1 -b .sysinfo
# li18nux/lsb
%patch800 -p1 -b .i18n
# Coreutils
%patch904 -p1 -b .allow_old_options
%patch905 -p1 -b .jday
%patch906 -p1 -b .fchown
%patch907 -p1 -b .runuser
%patch908 -p1 -b .getgrouplist
%patch909 -p1 -b .zh_CN
%patch910 -p1 -b .gcc4
%patch911 -p1 -b .brokentest
%patch912 -p1 -b .overflow
# From upstream
%patch920 -p1 -b .dateseconds
%patch921 -p1 -b .chown
%patch922 -p1 -b .rmaccess
%patch923 -p1 -b .copy
%patch924 -p1 -b .stale-utmp
%patch925 -p1 -b .no-sign-extend
#SELinux
%patch950 -p1 -b .selinux
@ -284,6 +260,14 @@ fi
/sbin/runuser
%changelog
* Mon Oct 24 2005 Tim Waugh <twaugh@redhat.com> 5.92-0.1
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
* Fri Sep 30 2005 Tomas Mraz <tmraz@redhat.com> - 5.2.1-56
- use include instead of pam_stack in pam config

View File

@ -1,9 +1,9 @@
--- sh-utils-2.0.11/man/date.1.man Tue May 15 19:02:55 2001
+++ sh-utils-2.0.11/man/date.1 Tue May 15 19:06:05 2001
@@ -152,6 +152,11 @@
.IP
`-' (hyphen) do not pad the field
`_' (underscore) pad the field with spaces
--- coreutils-5.92/man/date.1.dateman 2005-10-22 19:14:46.000000000 +0100
+++ coreutils-5.92/man/date.1 2005-10-24 17:57:38.000000000 +0100
@@ -188,6 +188,11 @@
then an optional modifier, which is either
E to use the locale's alternate representations if available, or
O to use the locale's alternate numeric symbols if available.
+.SH ENVIRONMENT
+.TP
+TZ

View File

@ -1 +1 @@
172ee3c315af93d3385ddfbeb843c53f coreutils-5.2.1.tar.bz2
f2ad653731ebc9d5763be5971b4d41e0 coreutils-5.92.tar.bz2