X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=coreutils-pam.patch;h=6c2b01ee4ed1cce01eac52f9055ec88d8d93f249;hb=e80ed3e54531ed18ae00d741754bc7b242fab09b;hp=c7bf120b50a79bd18b6a012431b3a25d02df6753;hpb=ca7ee99d404b450aba8b0624a7a85300af55a817;p=packages%2Fcoreutils.git diff --git a/coreutils-pam.patch b/coreutils-pam.patch index c7bf120..6c2b01e 100644 --- a/coreutils-pam.patch +++ b/coreutils-pam.patch @@ -1,17 +1,17 @@ --- coreutils-6.7/src/Makefile.am.pam 2006-11-24 21:28:10.000000000 +0000 +++ coreutils-6.7/src/Makefile.am 2007-01-09 17:00:01.000000000 +0000 -@@ -103,7 +103,7 @@ - # If necessary, add -lm to resolve use of pow in lib/strtod.c. - uptime_LDADD = $(LDADD) $(POW_LIB) $(GETLOADAVG_LIBS) +@@ -359,7 +359,7 @@ + uptime_LDADD += $(GETLOADAVG_LIBS) --su_LDADD = $(LDADD) $(LIB_CRYPT) -+su_LDADD = $(LDADD) $(LIB_CRYPT) $(LIB_PAM) + # for crypt +-su_LDADD += $(LIB_CRYPT) ++su_LDADD += $(LIB_CRYPT) $(LIB_PAM) - dir_LDADD += $(LIB_ACL) - ls_LDADD += $(LIB_ACL) ---- coreutils-6.7/src/su.c.pam 2007-01-09 17:00:01.000000000 +0000 -+++ coreutils-6.7/src/su.c 2007-01-09 17:16:43.000000000 +0000 -@@ -38,6 +38,16 @@ + # for various ACL functions + copy_LDADD += $(LIB_ACL) +--- coreutils-6.10/src/su.c.orig 2007-11-25 14:23:31.000000000 +0100 ++++ coreutils-6.10/src/su.c 2008-03-02 02:07:13.568059486 +0100 +@@ -37,6 +37,16 @@ restricts who can su to UID 0 accounts. RMS considers that to be fascist. @@ -28,7 +28,7 @@ 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. -@@ -59,6 +69,15 @@ +@@ -58,6 +68,15 @@ prototype (returning `int') in . */ #define getusershell _getusershell_sys_proto_ @@ -43,32 +43,27 @@ + #include "system.h" #include "getpass.h" - -@@ -128,15 +147,22 @@ + +@@ -130,10 +130,17 @@ /* The user to become if none is specified. */ #define DEFAULT_USER "root" +#ifndef USE_PAM - char *crypt (); + char *crypt (char const *key, char const *salt); +#endif - char *getusershell (); - void endusershell (); - void setusershell (); - - extern char **environ; -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 *) ++ const struct passwd *) +#ifdef USE_PAM + ; +#else ATTRIBUTE_NORETURN; +#endif - /* The name this program was run with. */ - char *program_name; -@@ -225,7 +251,26 @@ + /* If true, pass the `-f' option to the subshell. */ + static bool fast_startup; +@@ -215,7 +241,26 @@ } #endif @@ -95,7 +90,7 @@ 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. */ -@@ -233,6 +278,44 @@ +@@ -223,6 +268,44 @@ static bool correct_password (const struct passwd *pw) { @@ -140,7 +135,7 @@ char *unencrypted, *encrypted, *correct; #if HAVE_GETSPNAM && HAVE_STRUCT_SPWD_SP_PWDP /* Shadow passwd stuff for SVR3 and maybe other systems. */ -@@ -257,6 +340,7 @@ +@@ -247,6 +330,7 @@ encrypted = crypt (unencrypted, correct); memset (unencrypted, 0, strlen (unencrypted)); return STREQ (encrypted, correct); @@ -148,42 +143,42 @@ } /* Update `environ' for the new shell based on PW, with SHELL being -@@ -270,12 +354,18 @@ +@@ -260,12 +344,18 @@ /* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH. Unset all other environment variables. */ char const *term = getenv ("TERM"); + char const *display = getenv ("DISPLAY"); + char const *xauthority = getenv ("XAUTHORITY"); if (term) - term = xstrdup (term); + term = xstrdup (term); environ = xmalloc ((6 + !!term) * sizeof (char *)); environ[0] = NULL; if (term) - xsetenv ("TERM", term); + xsetenv ("TERM", term); + if (display) -+ xsetenv ("DISPLAY", display); ++ xsetenv ("DISPLAY", display); + if (xauthority) -+ xsetenv ("XAUTHORITY", xauthority); ++ xsetenv ("XAUTHORITY", xauthority); xsetenv ("HOME", pw->pw_dir); xsetenv ("SHELL", shell); xsetenv ("USER", pw->pw_name); -@@ -308,8 +398,13 @@ +@@ -373,8 +373,13 @@ { #ifdef HAVE_INITGROUPS errno = 0; - if (initgroups (pw->pw_name, pw->pw_gid) == -1) + if (initgroups (pw->pw_name, pw->pw_gid) == -1) { +#ifdef USE_PAM -+ pam_close_session(pamh, 0); -+ pam_end(pamh, PAM_ABORT); ++ pam_close_session(pamh, 0); ++ pam_end(pamh, PAM_ABORT); +#endif - error (EXIT_FAIL, errno, _("cannot set groups")); + error (EXIT_CANCELED, errno, _("cannot set groups")); + } endgrent (); #endif if (setgid (pw->pw_gid)) -@@ -318,6 +413,31 @@ - error (EXIT_FAIL, errno, _("cannot set user id")); +@@ -308,6 +403,31 @@ + error (EXIT_FAILURE, errno, _("cannot set user id")); } +#ifdef USE_PAM @@ -214,12 +209,12 @@ /* Run SHELL, or DEFAULT_SHELL if SHELL is empty. If COMMAND is nonzero, pass it to the shell with the -c option. Pass ADDITIONAL_ARGS to the shell as more arguments; there -@@ -325,17 +445,49 @@ +@@ -315,17 +435,49 @@ static void 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) +- size_t n_additional_args) ++ size_t n_additional_args, const struct passwd *pw) { size_t n_args = 1 + fast_startup + 2 * !!command + n_additional_args + 1; char const **args = xnmalloc (n_args, sizeof *args); @@ -265,7 +260,7 @@ shell_basename = last_component (shell); arg0 = xmalloc (strlen (shell_basename) + 2); arg0[0] = '-'; -@@ -360,6 +512,66 @@ +@@ -350,6 +502,66 @@ error (0, errno, "%s", shell); exit (exit_status); } @@ -332,7 +327,7 @@ } /* Return true if SHELL is a restricted shell (one not returned by -@@ -527,9 +739,9 @@ +@@ -714,9 +714,9 @@ shell = xstrdup (shell ? shell : pw->pw_shell); modify_environment (pw, shell); @@ -342,6 +337,12 @@ - error (0, errno, _("warning: cannot change directory to %s"), pw->pw_dir); +#endif + /* error() flushes stderr, but does not check for write failure. + Normally, we would catch this via our atexit() hook of +@@ -726,5 +726,5 @@ + if (ferror (stderr)) + exit (EXIT_CANCELED); + - run_shell (shell, command, argv + optind, MAX (0, argc - optind)); + run_shell (shell, command, argv + optind, MAX (0, argc - optind), pw); } @@ -394,23 +395,23 @@ @node Delaying @chapter Delaying ---- coreutils-6.7/configure.ac.pam 2006-12-07 21:30:24.000000000 +0000 -+++ coreutils-6.7/configure.ac 2007-01-09 17:18:04.000000000 +0000 -@@ -39,6 +39,13 @@ +--- coreutils-6.10/configure.ac.orig 2008-01-13 09:14:23.000000000 +0100 ++++ coreutils-6.10/configure.ac 2008-03-02 02:08:10.027276914 +0100 +@@ -44,6 +44,13 @@ gl_INIT coreutils_MACROS +dnl Give the chance to enable PAM +AC_ARG_ENABLE(pam, dnl +[ --enable-pam Enable use of the PAM libraries], -+[AC_DEFINE(USE_PAM, 1, [Define if you want to use PAM]) ++AC_DEFINE(USE_PAM, 1, [Define if you want to use PAM]) +LIB_PAM="-ldl -lpam -lpam_misc" +) + - AC_CHECK_FUNCS(uname, - OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uname\$(EXEEXT)" - MAN="$MAN uname.1") -@@ -249,6 +256,13 @@ + AC_FUNC_FORK + + optional_bin_progs= +@@ -332,6 +339,13 @@ AM_GNU_GETTEXT([external], [need-formatstring-macros]) AM_GNU_GETTEXT_VERSION([0.15]) @@ -424,15 +425,15 @@ AC_CONFIG_FILES( Makefile doc/Makefile ---- coreutils-6.3/po/pl.po.orig 2006-09-30 11:11:04.000000000 +0200 -+++ coreutils-6.3/po/pl.po 2006-10-10 22:07:14.416124000 +0200 -@@ -8149,6 +8149,49 @@ +--- coreutils-6.10/po/pl.po.orig 2008-01-16 21:22:08.000000000 +0100 ++++ coreutils-6.10/po/pl.po 2008-03-02 02:09:23.671473657 +0100 +@@ -8875,6 +8875,49 @@ msgid "Usage: %s [OPTION]... [-] [USER [ARG]...]\n" msgstr "Składnia: %s [OPCJA]... [-] [UŻYTKOWNIK [ARGUMENT]...]\n" +#: src/su.c:300 +msgid "standard in must be a tty\n\n" -+msgstr "standartowe wejście musi być terminalem\n" ++msgstr "standardowe wejście musi być terminalem\n" + +#: src/su.c:425 +msgid "could not open session\n" @@ -444,7 +445,7 @@ + +#: src/su.c:450 +msgid "could not set PAM credentials\n" -+msgstr "błąd podczas ustawiania uwierzytelnień PAM\n" ++msgstr "błąd podczas ustawiania uwierzytelnienia PAM\n" + +#: src/su.c:471 +#, c-format @@ -473,9 +474,9 @@ +msgid " killed.\n" +msgstr " zabito.\n" + - #: src/su.c:386 - #, fuzzy + #: src/su.c:382 msgid "" + "Change the effective user id and group id to that of USER.\n" diff -Nur coreutils-5.2.1.orig/man/es/su.1 coreutils-5.2.1/man/es/su.1 --- coreutils-5.2.1.orig/man/es/su.1 Mon Apr 12 14:26:19 1999 +++ coreutils-5.2.1/man/es/su.1 Thu Mar 18 17:05:55 2004