diff options
author | Pete Travis <immanetize@fedoraproject.org> | 2014-10-01 11:54:54 -0600 |
---|---|---|
committer | Pete Travis <immanetize@fedoraproject.org> | 2014-10-01 11:54:54 -0600 |
commit | b7fb238e0ec327db793aefa670ffedb8cbd63f0b (patch) | |
tree | d795a1fa84fedd491d912cd97c26d80ec523c1fa /SOURCES | |
parent | 08b01b8f3f227bda87ee2591c7e6ccb379fad187 (diff) | |
download | rpmbuild-sles11.1-bash.tar.gz rpmbuild-sles11.1-bash.tar.xz rpmbuild-sles11.1-bash.zip |
starting bash bracnch for sles 11.1sles11.1-bash
Diffstat (limited to 'SOURCES')
29 files changed, 2222 insertions, 0 deletions
diff --git a/SOURCES/bash-2.03-manual.patch b/SOURCES/bash-2.03-manual.patch new file mode 100644 index 0000000..e42e52d --- /dev/null +++ b/SOURCES/bash-2.03-manual.patch @@ -0,0 +1,68 @@ +--- doc/bash.1 ++++ doc/bash.1 Mon Oct 25 17:29:54 2004 +@@ -113,6 +113,12 @@ + This option allows the positional parameters to be set + when invoking an interactive shell. + .TP ++.B \-v ++Print shell input lines as they are read. ++.TP ++.B \-x ++Print commands and their arguments as they are executed. ++.TP + .B \-D + A list of all double-quoted strings preceded by \fB$\fP + is printed on the standard ouput. +@@ -2539,7 +2539,7 @@ The \fIpattern\fP is expanded to produce + pathname expansion. + \fIParameter\fP is expanded and the longest match of \fIpattern\fP + against its value is replaced with \fIstring\fP. +-If \Ipattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are ++If \fIpattern\fP begins with \fB/\fP, all matches of \fIpattern\fP are + replaced with \fIstring\fP. Normally only the first match is replaced. + If \fIpattern\fP begins with \fB#\fP, it must match at the beginning + of the expanded value of \fIparameter\fP. +@@ -5799,6 +5805,11 @@ + .SH "SHELL BUILTIN COMMANDS" + .\" start of bash_builtins + .zZ ++.if !dFN \{\ ++.de FN ++\fI\|\\$1\|\fP ++.. ++.\} + .PP + Unless otherwise noted, each builtin command documented in this + section as accepting options preceded by +@@ -8534,6 +8545,11 @@ + .SH "RESTRICTED SHELL" + .\" rbash.1 + .zY ++.if !dFN \{\ ++.de FN ++\fI\|\\$1\|\fP ++.. ++.\} + .PP + If + .B bash +--- doc/builtins.1 ++++ doc/builtins.1 Mon Oct 25 17:29:20 2004 +@@ -10,6 +10,6 @@ + ulimit, umask, unalias, unset, wait \- bash built-in commands, see \fBbash\fR(1) + .SH BASH BUILTIN COMMANDS + .nr zZ 1 +-.so bash.1 ++.so /usr/share/man/man1/bash.1 + .SH SEE ALSO + bash(1), sh(1) +--- doc/rbash.1 ++++ doc/rbash.1 Mon Oct 25 17:29:20 2004 +@@ -3,6 +3,6 @@ + rbash \- restricted bash, see \fBbash\fR(1) + .SH RESTRICTED SHELL + .nr zY 1 +-.so bash.1 ++.so /usr/share/man/man1/bash.1 + .SH SEE ALSO + bash(1) diff --git a/SOURCES/bash-2.05a-security.patch b/SOURCES/bash-2.05a-security.patch new file mode 100644 index 0000000..86af623 --- /dev/null +++ b/SOURCES/bash-2.05a-security.patch @@ -0,0 +1,69 @@ +--- variables.c ++++ variables.c Wed Aug 21 12:14:18 2002 +@@ -1035,6 +1035,7 @@ + return v; + } + ++#if !defined(linux) + /* The random number seed. You can change this by setting RANDOM. */ + static unsigned long rseed = 1; + static int last_random_value; +@@ -1060,6 +1061,21 @@ + last_random_value = 0; + } + ++#else ++ ++static int last_sbrand_pid; ++ ++static int brand () ++{ ++ return random() & 32767; ++} ++ ++static void sbrand (unsigned long seed) ++{ ++ srandom(seed); ++} ++#endif ++ + static SHELL_VAR * + assign_random (self, value, unused) + SHELL_VAR *self; +@@ -1075,6 +1091,7 @@ + { + int rv; + ++#if !defined(linux) + /* Reset for command and process substitution. */ + if (subshell_environment) + sbrand (rseed + getpid() + NOW); +@@ -1082,6 +1099,18 @@ + do + rv = brand (); + while (rv == last_random_value); ++#else ++ if (subshell_environment) ++ { ++ int mypid = getpid(); ++ if (mypid != last_sbrand_pid) ++ { ++ last_sbrand_pid = mypid; ++ sbrand (mypid + NOW); ++ } ++ } ++ rv = brand(); ++#endif + return rv; + } + +@@ -1093,7 +1122,9 @@ + char *p; + + rv = get_random_number (); ++#if !defined(linux) + last_random_value = rv; ++#endif + p = itos (rv); + + FREE (value_cell (var)); diff --git a/SOURCES/bash-3.0-decl.patch b/SOURCES/bash-3.0-decl.patch new file mode 100644 index 0000000..91a3aa6 --- /dev/null +++ b/SOURCES/bash-3.0-decl.patch @@ -0,0 +1,10 @@ +--- support/printenv.c ++++ support/printenv.c 2005-09-19 15:09:08.000000000 +0200 +@@ -24,6 +24,7 @@ + with Bash; see the file COPYING. If not, write to the Free Software + Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ + ++#include <string.h> + extern char **environ; + + int diff --git a/SOURCES/bash-3.0-evalexp.patch b/SOURCES/bash-3.0-evalexp.patch new file mode 100644 index 0000000..11b28cd --- /dev/null +++ b/SOURCES/bash-3.0-evalexp.patch @@ -0,0 +1,13 @@ +--- expr.c ++++ expr.c 2004-07-30 16:39:48.000000000 +0200 +@@ -406,8 +406,8 @@ + value = expcond (); + if (curtok == EQ || curtok == OP_ASSIGN) + { +- int special, op; +- intmax_t lvalue; ++ int special, op = -1; ++ intmax_t lvalue = 0; + + special = curtok == OP_ASSIGN; + diff --git a/SOURCES/bash-3.0-nfs_redir.patch b/SOURCES/bash-3.0-nfs_redir.patch new file mode 100644 index 0000000..ac245c9 --- /dev/null +++ b/SOURCES/bash-3.0-nfs_redir.patch @@ -0,0 +1,148 @@ +--- redir.c ++++ redir.c 2005-01-28 15:22:21.950230271 +0100 +@@ -169,12 +169,13 @@ + how to undo the redirections later, if non-zero. If flags & RX_CLEXEC + is non-zero, file descriptors opened in do_redirection () have their + close-on-exec flag set. */ ++static int close_before_dup2_err; + int + do_redirections (list, flags) + REDIRECT *list; + int flags; + { +- int error; ++ int error, ret = 0; + REDIRECT *temp; + + if (flags & RX_UNDOABLE) +@@ -190,14 +191,21 @@ + + for (temp = list; temp; temp = temp->next) + { ++ close_before_dup2_err = 0; + error = do_redirection_internal (temp, flags); + if (error) + { + redirection_error (temp, error); + return (error); + } ++ if (close_before_dup2_err) ++ { ++ redirection_error (temp, close_before_dup2_err); ++ ret = close_before_dup2_err; ++ } + } +- return (0); ++ ++ return (ret); + } + + /* Return non-zero if the redirection pointed to by REDIRECT has a +@@ -759,6 +767,8 @@ + #if defined (BUFFERED_INPUT) + check_bash_input (redirector); + #endif ++ if ((fd != redirector) && (close(redirector) < 0) && (errno != EBADF)) ++ close_before_dup2_err = errno; + + if ((fd != redirector) && (dup2 (fd, redirector) < 0)) + return (errno); +@@ -838,6 +848,9 @@ + #if defined (BUFFERED_INPUT) + check_bash_input (redirector); + #endif ++ if ((fd != redirector) && (close(redirector) < 0) && (errno != EBADF)) ++ close_before_dup2_err = errno; ++ + if (fd != redirector && dup2 (fd, redirector) < 0) + { + r = errno; +@@ -880,6 +893,9 @@ + #if defined (BUFFERED_INPUT) + check_bash_input (redirector); + #endif ++ if ((close(redirector) < 0) && (errno != EBADF)) ++ close_before_dup2_err = errno; ++ + /* This is correct. 2>&1 means dup2 (1, 2); */ + if (dup2 (redir_fd, redirector) < 0) + return (errno); +--- execute_cmd.c ++++ execute_cmd.c 2005-01-28 16:09:10.383937390 +0100 +@@ -119,7 +119,7 @@ + static void do_piping __P((int, int)); + static void bind_lastarg __P((char *)); + static int shell_control_structure __P((enum command_type)); +-static void cleanup_redirects __P((REDIRECT *)); ++static int cleanup_redirects __P((REDIRECT *)); + + #if defined (JOB_CONTROL) + static int restore_signal_mask __P((sigset_t *)); +@@ -393,12 +393,13 @@ + + /* A function to use to unwind_protect the redirection undo list + for loops. */ +-static void ++static int + cleanup_redirects (list) + REDIRECT *list; + { +- do_redirections (list, RX_ACTIVE); ++ int ret = do_redirections (list, RX_ACTIVE); + dispose_redirects (list); ++ return (ret ? 1 : 0); + } + + #if 0 +@@ -603,7 +604,7 @@ + redirection.) */ + if (do_redirections (command->redirects, RX_ACTIVE|RX_UNDOABLE) != 0) + { +- cleanup_redirects (redirection_undo_list); ++ (void)cleanup_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + dispose_exec_redirects (); + return (EXECUTION_FAILURE); +@@ -2593,7 +2594,7 @@ + int pipe_in, pipe_out, async; + pid_t old_last_command_subst_pid; + { +- int r; ++ int r, s; + + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE || async) + { +@@ -2632,10 +2633,10 @@ + substitution. Otherwise, return EXECUTION_SUCCESS. */ + + r = do_redirections (redirects, RX_ACTIVE|RX_UNDOABLE); +- cleanup_redirects (redirection_undo_list); ++ s = cleanup_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + +- if (r != 0) ++ if (r != 0 || s != 0) + return (EXECUTION_FAILURE); + else if (old_last_command_subst_pid != last_command_subst_pid) + return (last_command_exit_value); +@@ -3404,7 +3405,7 @@ + + if (do_redirections (redirects, RX_ACTIVE|RX_UNDOABLE) != 0) + { +- cleanup_redirects (redirection_undo_list); ++ (void)cleanup_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; + dispose_exec_redirects (); + return (EX_REDIRFAIL); /* was EXECUTION_FAILURE */ +@@ -3463,8 +3464,10 @@ + + if (redirection_undo_list) + { +- cleanup_redirects (redirection_undo_list); ++ int ret = cleanup_redirects (redirection_undo_list); + redirection_undo_list = (REDIRECT *)NULL; ++ if (result == 0) ++ result = ret; + } + + return (result); diff --git a/SOURCES/bash-3.0-warn-locale.patch b/SOURCES/bash-3.0-warn-locale.patch new file mode 100644 index 0000000..ed6215a --- /dev/null +++ b/SOURCES/bash-3.0-warn-locale.patch @@ -0,0 +1,29 @@ +--- locale.c ++++ locale.c 2004-09-03 12:56:10.000000000 +0200 +@@ -29,6 +29,10 @@ + #include "bashintl.h" + #include "bashansi.h" + #include <stdio.h> ++#include <sys/types.h> ++#include <sys/stat.h> ++#include <unistd.h> ++#include <errno.h> + #include "chartypes.h" + + #include "shell.h" +@@ -63,6 +67,15 @@ + set_default_locale () + { + #if defined (HAVE_SETLOCALE) ++ struct stat st; ++ ++ if (stat("/usr/lib/locale/locale-archive", &st) == 0 && st.st_size == 0) { ++ errno = EINVAL; ++ sys_error("set_default_locale: broken locale"); ++ fprintf (stderr, "%s: Please remove /usr/lib/locale/locale-archive\n", ++ get_name_for_error()); ++ sleep(1); ++ } + default_locale = setlocale (LC_ALL, ""); + if (default_locale) + default_locale = savestring (default_locale); diff --git a/SOURCES/bash-3.1-extended_quote.patch b/SOURCES/bash-3.1-extended_quote.patch new file mode 100644 index 0000000..14e98c8 --- /dev/null +++ b/SOURCES/bash-3.1-extended_quote.patch @@ -0,0 +1,19 @@ +*** parse.y +--- parse.y Tue Jan 10 11:36:59 2006 +*************** +*** 2842,2848 **** + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + +! if ((rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); +--- 2842,2848 ---- + ttrans = ansiexpand (nestret, 0, nestlen - 1, &ttranslen); + xfree (nestret); + +! if (extended_quote || (rflags & P_DQUOTE) == 0) + { + nestret = sh_single_quote (ttrans); + free (ttrans); diff --git a/SOURCES/bash-3.1-loadables.dif b/SOURCES/bash-3.1-loadables.dif new file mode 100644 index 0000000..0d14df4 --- /dev/null +++ b/SOURCES/bash-3.1-loadables.dif @@ -0,0 +1,689 @@ +--- examples/loadables/Makefile.in ++++ examples/loadables/Makefile.in 2006-09-25 13:31:55.000000000 +0200 +@@ -81,7 +81,7 @@ + $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -c -o $@ $< + + +-ALLPROG = print truefalse sleep pushd finfo logname basename dirname \ ++ALLPROG = print sleep finfo logname basename dirname \ + tty pathchk tee head mkdir rmdir printenv id whoami \ + uname sync push ln unlink cut realpath getconf strftime + OTHERPROG = necho hello cat +--- examples/loadables/basename.c ++++ examples/loadables/basename.c 2006-09-25 13:49:31.000000000 +0200 +@@ -9,9 +9,12 @@ + #endif + + #include <stdio.h> +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + ++int + basename_builtin (list) + WORD_LIST *list; + { +--- examples/loadables/cat.c ++++ examples/loadables/cat.c 2006-09-25 13:37:46.000000000 +0200 +@@ -7,8 +7,10 @@ + #include <fcntl.h> + #include <errno.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + + #ifndef errno + extern int errno; +--- examples/loadables/cut.c ++++ examples/loadables/cut.c 2006-09-25 14:00:21.000000000 +0200 +@@ -60,8 +60,10 @@ + # include <unistd.h> + #endif + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + + #if !defined (errno) +@@ -243,7 +245,7 @@ + pos = positions + 1; + for (col = maxval; col; --col) { + if ((ch = getc(fp)) == EOF) +- return; ++ return (0); + if (ch == '\n') + break; + if (*pos++) +--- examples/loadables/dirname.c ++++ examples/loadables/dirname.c 2006-09-25 13:49:38.000000000 +0200 +@@ -9,9 +9,12 @@ + #endif + + #include <stdio.h> +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + ++int + dirname_builtin (list) + WORD_LIST *list; + { +--- examples/loadables/finfo.c ++++ examples/loadables/finfo.c 2006-09-25 13:48:52.000000000 +0200 +@@ -16,6 +16,8 @@ + #include "bashansi.h" + #include "shell.h" + #include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "common.h" + + #ifndef errno +@@ -77,7 +79,7 @@ + char **argv; + { + register int i; +- int mode, flags, opt; ++ int flags, opt; + + sh_optind = 0; /* XXX */ + prog = base_pathname(argv[0]); +@@ -170,7 +172,7 @@ + return (m & (S_IRWXU|S_IRWXG|S_IRWXO|S_ISUID|S_ISGID)); + } + +-static int ++static void + perms(m) + int m; + { +@@ -214,7 +216,7 @@ + printf ("u=%s,g=%s,o=%s", ubits, gbits, obits); + } + +-static int ++static void + printmode(mode) + int mode; + { +@@ -309,13 +311,13 @@ + else + printf("%ld\n", st->st_ctime); + } else if (flags & OPT_DEV) +- printf("%d\n", st->st_dev); ++ printf("%lu\n", (ulong)st->st_dev); + else if (flags & OPT_INO) +- printf("%d\n", st->st_ino); ++ printf("%lu\n", (ulong)st->st_ino); + else if (flags & OPT_FID) +- printf("%d:%ld\n", st->st_dev, st->st_ino); ++ printf("%lu:%lu\n", (ulong)st->st_dev, (ulong)st->st_ino); + else if (flags & OPT_NLINK) +- printf("%d\n", st->st_nlink); ++ printf("%lu\n", (ulong)st->st_nlink); + else if (flags & OPT_LNKNAM) { + #ifdef S_ISLNK + b = xmalloc(4096); +@@ -365,7 +367,6 @@ + { + int c, r; + char **v; +- WORD_LIST *l; + + v = make_builtin_argv (list, &c); + r = finfo_main (c, v); +--- examples/loadables/getconf.c ++++ examples/loadables/getconf.c 2006-09-25 14:02:33.000000000 +0200 +@@ -65,6 +65,8 @@ + #include "bashansi.h" + #include "shell.h" + #include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "stdc.h" + #include "common.h" + #include "bashgetopt.h" +@@ -1119,8 +1121,6 @@ + { NULL } + }; + +-static int num_getconf_variables = sizeof(conf_table) / sizeof(struct conf_variable) - 1; +- + extern char *this_command_name; + extern char **make_builtin_argv (); + +@@ -1133,8 +1133,7 @@ + getconf_builtin (list) + WORD_LIST *list; + { +- int c, r, opt, aflag; +- char **v; ++ int r, opt, aflag; + + aflag = 0; + reset_internal_getopt(); +@@ -1169,7 +1168,6 @@ + getconf_help() + { + const struct conf_variable *cp; +- register int i, column; + + builtin_usage(); + printf("Acceptable variable names are:\n"); +--- examples/loadables/head.c ++++ examples/loadables/head.c 2006-09-25 13:55:24.000000000 +0200 +@@ -20,6 +20,8 @@ + + #include "builtins.h" + #include "shell.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + + #if !defined (errno) +@@ -69,8 +71,10 @@ + break; + } + } ++ return EXECUTION_SUCCESS; + } + ++int + head_builtin (list) + WORD_LIST *list; + { +@@ -78,8 +82,6 @@ + WORD_LIST *l; + FILE *fp; + +- char *t; +- + munge_list (list); /* change -num into -n num */ + + reset_internal_getopt (); +--- examples/loadables/hello.c ++++ examples/loadables/hello.c 2006-09-25 13:38:25.000000000 +0200 +@@ -11,8 +11,10 @@ + + #include <stdio.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + + /* A builtin `xxx' is normally implemented with an `xxx_builtin' function. +--- examples/loadables/id.c ++++ examples/loadables/id.c 2006-09-25 13:57:41.000000000 +0200 +@@ -29,6 +29,8 @@ + + #include "shell.h" + #include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "stdc.h" + #include "common.h" + #include "bashgetopt.h" +@@ -46,8 +48,6 @@ + static uid_t ruid, euid; + static gid_t rgid, egid; + +-static char *id_user; +- + static int inituser (); + + static int id_pruser (); +--- examples/loadables/ln.c ++++ examples/loadables/ln.c 2006-09-25 13:59:09.000000000 +0200 +@@ -15,8 +15,10 @@ + #include <stdio.h> + #include <errno.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + + #if !defined (errno) +@@ -31,6 +33,7 @@ + static unix_link_syscall_t *linkfn; + static int dolink (); + ++int + ln_builtin (list) + WORD_LIST *list; + { +--- examples/loadables/logname.c ++++ examples/loadables/logname.c 2006-09-25 13:30:40.000000000 +0200 +@@ -9,8 +9,10 @@ + #include <stdio.h> + #include <errno.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/common.h" ++#include "builtins/builtext.h" + + #if !defined (errno) + extern int errno; +--- examples/loadables/mkdir.c ++++ examples/loadables/mkdir.c 2006-09-25 13:56:07.000000000 +0200 +@@ -13,8 +13,10 @@ + # include <unistd.h> + #endif + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + + #if !defined (errno) +@@ -33,7 +35,7 @@ + mkdir_builtin (list) + WORD_LIST *list; + { +- int opt, pflag, omode, rval, octal, nmode, parent_mode, um; ++ int opt, pflag, omode, rval, octal, nmode, parent_mode; + char *mode; + WORD_LIST *l; + +@@ -150,7 +152,7 @@ + while (*p == '/') + p++; + +- while (p = strchr (p, '/')) ++ while ((p = strchr (p, '/'))) + { + *p = '\0'; + if (stat (npath, &sb) != 0) +--- examples/loadables/necho.c ++++ examples/loadables/necho.c 2006-09-25 13:39:26.000000000 +0200 +@@ -3,9 +3,15 @@ + /* Sample builtin to be dynamically loaded with enable -f and replace an + existing builtin. */ + ++#ifdef HAVE_CONFIG_H ++# include <config.h> ++#endif ++ + #include <stdio.h> +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + + necho_builtin (list) + WORD_LIST *list; +--- examples/loadables/pathchk.c ++++ examples/loadables/pathchk.c 2006-09-25 13:53:13.000000000 +0200 +@@ -40,8 +40,10 @@ + #include <stdio.h> + #include <errno.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "stdc.h" + #include "bashgetopt.h" + #include "maxpath.h" +@@ -79,6 +81,7 @@ + + static int validate_path (); + ++int + pathchk_builtin (list) + WORD_LIST *list; + { +@@ -257,7 +260,7 @@ + char *path; + int portability; + { +- int path_max; ++ size_t path_max; + int last_elem; /* Nonzero if checking last element of path. */ + int exists; /* 2 if the path element exists. */ + char *slash; +@@ -269,10 +272,8 @@ + if (*path == '\0') + return 0; + +-#ifdef lint + /* Suppress `used before initialized' warning. */ + exists = 0; +-#endif + + /* Figure out the parent of the first element in PATH. */ + parent = xstrdup (*path == '/' ? "/" : "."); +@@ -349,7 +350,7 @@ + free (parent); + if (strlen (path) > path_max) + { +- builtin_error ("path `%s' has length %d; exceeds limit of %d", ++ builtin_error ("path `%s' has length %zu; exceeds limit of %zu", + path, strlen (path), path_max); + return 1; + } +--- examples/loadables/print.c ++++ examples/loadables/print.c 2006-09-25 13:23:46.000000000 +0200 +@@ -15,6 +15,8 @@ + #include "bashansi.h" + #include "shell.h" + #include "builtins.h" ++#include "builtins/common.h" ++#include "builtins/builtext.h" + #include "stdc.h" + #include "bashgetopt.h" + +@@ -55,7 +57,7 @@ + { + int c, r, nflag, raw, ofd, sflag; + intmax_t lfd; +- char **v, *pfmt, *arg; ++ char *pfmt; + WORD_LIST *l; + + nflag = raw = sflag = 0; +--- examples/loadables/printenv.c ++++ examples/loadables/printenv.c 2006-09-25 13:39:47.000000000 +0200 +@@ -8,8 +8,10 @@ + #include <config.h> + #include <stdio.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + + extern char **export_env; +--- examples/loadables/push.c ++++ examples/loadables/push.c 2006-09-25 13:39:53.000000000 +0200 +@@ -7,8 +7,10 @@ + #include <stdio.h> + #include <errno.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "jobs.h" + #include "bashgetopt.h" + +--- examples/loadables/realpath.c ++++ examples/loadables/realpath.c 2006-09-25 14:03:01.000000000 +0200 +@@ -31,8 +31,10 @@ + #include <maxpath.h> + #include <errno.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + + #ifndef errno +@@ -41,6 +43,7 @@ + + extern char *sh_realpath(); + ++int + realpath_builtin(list) + WORD_LIST *list; + { +@@ -67,14 +70,14 @@ + vflag = 1; + break; + default: +- usage(); ++ builtin_usage(); + } + } + + list = loptend; + + if (list == 0) +- usage(); ++ builtin_usage(); + + for (es = EXECUTION_SUCCESS; list; list = list->next) { + p = list->word->word; +--- examples/loadables/rmdir.c ++++ examples/loadables/rmdir.c 2006-09-25 13:56:28.000000000 +0200 +@@ -6,13 +6,16 @@ + + #include <stdio.h> + #include <errno.h> +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + + #if !defined (errno) + extern int errno; + #endif + ++int + rmdir_builtin (list) + WORD_LIST *list; + { +--- examples/loadables/sleep.c ++++ examples/loadables/sleep.c 2006-09-25 13:24:54.000000000 +0200 +@@ -27,6 +27,8 @@ + + #include "shell.h" + #include "builtins.h" ++#include "builtins/common.h" ++#include "builtins/builtext.h" + + #define RETURN(x) \ + do { \ +--- examples/loadables/strftime.c ++++ examples/loadables/strftime.c 2006-09-25 13:40:17.000000000 +0200 +@@ -13,8 +13,10 @@ + + #include <stdio.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "common.h" + + int +--- examples/loadables/sync.c ++++ examples/loadables/sync.c 2006-09-25 13:58:50.000000000 +0200 +@@ -6,10 +6,13 @@ + #include <unistd.h> + #endif + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + ++int + sync_builtin (list) + WORD_LIST *list; + { +--- examples/loadables/tee.c ++++ examples/loadables/tee.c 2006-09-25 13:54:21.000000000 +0200 +@@ -19,8 +19,10 @@ + #include <stdio.h> + #include <errno.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + + #if !defined (errno) +@@ -41,6 +43,7 @@ + + extern char *strerror (); + ++int + tee_builtin (list) + WORD_LIST *list; + { +@@ -49,8 +52,6 @@ + FLIST *fl; + char *buf, *bp; + +- char *t; +- + reset_internal_getopt (); + append = nointr = 0; + tee_flist = (FLIST *)NULL; +--- examples/loadables/template.c ++++ examples/loadables/template.c 2006-09-25 13:40:33.000000000 +0200 +@@ -11,8 +11,10 @@ + #include <stdio.h> + #include <errno.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + + #if !defined (errno) +--- examples/loadables/truefalse.c ++++ examples/loadables/truefalse.c 2006-09-25 13:40:42.000000000 +0200 +@@ -1,16 +1,22 @@ + /* true and false builtins */ + ++#ifdef HAVE_CONFIG_H ++# include <config.h> ++#endif ++ + #include "bashtypes.h" + #include "shell.h" + #include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + +-true_builtin (list) ++int true_builtin (list) + WORD_LIST *list; + { + return EXECUTION_SUCCESS; + } + +-false_builtin (list) ++int false_builtin (list) + WORD_LIST *list; + { + return EXECUTION_FAILURE; +--- examples/loadables/tty.c ++++ examples/loadables/tty.c 2006-09-25 13:49:53.000000000 +0200 +@@ -5,12 +5,15 @@ + #include "config.h" + + #include <stdio.h> +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + + extern char *ttyname (); + ++int + tty_builtin (list) + WORD_LIST *list; + { +--- examples/loadables/uname.c ++++ examples/loadables/uname.c 2006-09-25 13:58:18.000000000 +0200 +@@ -24,8 +24,10 @@ + + #include <errno.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + + #define FLAG_SYSNAME 0x01 /* -s */ +@@ -44,10 +46,11 @@ + + static int uname_flags; + ++int + uname_builtin (list) + WORD_LIST *list; + { +- int opt, r; ++ int opt; + struct utsname uninfo; + + uname_flags = 0; +--- examples/loadables/unlink.c ++++ examples/loadables/unlink.c 2006-09-25 13:59:37.000000000 +0200 +@@ -12,13 +12,16 @@ + #include <stdio.h> + #include <errno.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + + #ifndef errno + extern int errno; + #endif + ++int + unlink_builtin (list) + WORD_LIST *list; + { +--- examples/loadables/whoami.c ++++ examples/loadables/whoami.c 2006-09-25 13:57:54.000000000 +0200 +@@ -5,10 +5,13 @@ + #include <config.h> + #include <stdio.h> + +-#include "builtins.h" + #include "shell.h" ++#include "builtins.h" ++#include "builtins/builtext.h" ++#include "builtins/common.h" + #include "bashgetopt.h" + ++int + whoami_builtin (list) + WORD_LIST *list; + { diff --git a/SOURCES/bash-3.1-random.patch b/SOURCES/bash-3.1-random.patch new file mode 100644 index 0000000..07822e0 --- /dev/null +++ b/SOURCES/bash-3.1-random.patch @@ -0,0 +1,16 @@ + builtins/printf.def | 2 +- + 1 files changed, 1 insertion(+), 1 deletion(-) + +Index: bash-3.1/builtins/printf.def +=================================================================== +--- bash-3.1.orig/builtins/printf.def 2005-12-12 16:00:42.000000000 +0100 ++++ bash-3.1/builtins/printf.def 2005-12-12 16:01:38.000000000 +0100 +@@ -558,7 +558,7 @@ printstr (fmt, string, len, fieldwidth, + #else + if (string == 0 || len == 0) + #endif +- return; ++ return 0; + + #if 0 + s = fmt; diff --git a/SOURCES/bash-3.2-2.4.4.patch b/SOURCES/bash-3.2-2.4.4.patch new file mode 100644 index 0000000..9d2577f --- /dev/null +++ b/SOURCES/bash-3.2-2.4.4.patch @@ -0,0 +1,130 @@ +--- array.c ++++ array.c 2006-11-14 10:54:22.000000000 +0100 +@@ -724,7 +724,7 @@ char *s, *sep; + * To make a running version, compile -DTEST_ARRAY and link with: + * xmalloc.o syntax.o lib/malloc/libmalloc.a lib/sh/libsh.a + */ +-int interrupt_immediately = 0; ++volatile sig_atomic_t interrupt_immediately = 0; + + int + signal_is_trapped(s) +--- hashlib.c ++++ hashlib.c 2006-11-14 10:54:36.000000000 +0100 +@@ -381,7 +381,7 @@ hash_pstats (table, name) + + HASH_TABLE *table, *ntable; + +-int interrupt_immediately = 0; ++volatile sig_atomic_t interrupt_immediately = 0; + + int + signal_is_trapped (s) +--- jobs.c ++++ jobs.c 2001-05-02 18:20:31.000000000 +0200 +@@ -1701,6 +1701,15 @@ make_child (command, async_p) + pid_t mypid; + + mypid = getpid (); ++ ++ if (interrupt_state) ++ { ++ struct timeval tv; ++ struct rusage rx; ++ (void) gettimeofday(&tv, NULL); ++ (void) getrusage(RUSAGE_SELF, &rx); ++ } ++ + #if defined (BUFFERED_INPUT) + /* Close default_buffered_input if it's > 0. We don't close it if it's + 0 because that's the file descriptor used when redirecting input, +--- quit.h ++++ quit.h 2006-11-14 10:43:18.000000000 +0100 +@@ -21,9 +21,13 @@ + #if !defined (_QUIT_H_) + #define _QUIT_H_ + ++#define __need_sig_atomic_t ++#include <signal.h> ++#undef __need_sig_atomic_t ++ + /* Non-zero means SIGINT has already ocurred. */ +-extern volatile int interrupt_state; +-extern volatile int terminating_signal; ++extern volatile sig_atomic_t interrupt_state; ++extern volatile sig_atomic_t terminating_signal; + + /* Macro to call a great deal. SIGINT just sets the interrupt_state variable. + When it is safe, put QUIT in the code, and the "interrupt" will take +--- sig.c ++++ sig.c 2006-11-14 10:53:51.000000000 +0100 +@@ -59,13 +59,13 @@ extern int loop_level, continuing, break + extern int parse_and_execute_level, shell_initialized; + + /* Non-zero after SIGINT. */ +-volatile int interrupt_state = 0; ++volatile sig_atomic_t interrupt_state = 0; + + /* Non-zero after SIGWINCH */ +-volatile int sigwinch_received = 0; ++volatile sig_atomic_t sigwinch_received = 0; + + /* Set to the value of any terminating signal received. */ +-volatile int terminating_signal = 0; ++volatile sig_atomic_t terminating_signal = 0; + + /* The environment at the top-level R-E loop. We use this in + the case of error return. */ +@@ -77,10 +77,10 @@ sigset_t top_level_mask; + #endif /* JOB_CONTROL */ + + /* When non-zero, we throw_to_top_level (). */ +-int interrupt_immediately = 0; ++volatile sig_atomic_t interrupt_immediately = 0; + + /* When non-zero, we call the terminating signal handler immediately. */ +-int terminate_immediately = 0; ++volatile sig_atomic_t terminate_immediately = 0; + + #if defined (SIGWINCH) + static SigHandler *old_winch = (SigHandler *)SIG_DFL; +--- sig.h ++++ sig.h 2006-11-14 10:49:32.000000000 +0100 +@@ -108,11 +108,15 @@ do { \ + + #endif /* JOB_CONTROL */ + ++#define __need_sig_atomic_t ++#include <signal.h> ++#undef __need_sig_atomic_t ++ + /* Extern variables */ +-extern volatile int sigwinch_received; ++extern volatile sig_atomic_t sigwinch_received; + +-extern int interrupt_immediately; +-extern int terminate_immediately; ++extern volatile sig_atomic_t interrupt_immediately; ++extern volatile sig_atomic_t terminate_immediately; + + /* Functions from sig.c. */ + extern sighandler termsig_sighandler __P((int)); +--- examples/loadables/tee.c ++++ examples/loadables/tee.c 2006-11-14 11:31:29.000000000 +0100 +@@ -17,6 +17,7 @@ + #include "bashansi.h" + + #include <stdio.h> ++#include <signal.h> + #include <errno.h> + + #include "builtins.h" +@@ -37,7 +38,7 @@ static FLIST *tee_flist; + + #define TEE_BUFSIZE 8192 + +-extern int interrupt_immediately; ++extern volatile sig_atomic_t interrupt_immediately; + + extern char *strerror (); + diff --git a/SOURCES/bash-3.2-longjmp.dif b/SOURCES/bash-3.2-longjmp.dif new file mode 100644 index 0000000..6dedd33 --- /dev/null +++ b/SOURCES/bash-3.2-longjmp.dif @@ -0,0 +1,43 @@ +--- execute_cmd.c.mm 2008-04-22 14:03:07.000000000 +0000 ++++ execute_cmd.c 2008-04-28 01:38:19.000000000 +0000 +@@ -24,6 +24,7 @@ + #endif /* _AIX && RISC6000 && !__GNUC__ */ + + #include <stdio.h> ++#include <paths.h> + #include "chartypes.h" + #include "bashtypes.h" + #if !defined (_MINIX) && defined (HAVE_SYS_FILE_H) +@@ -4013,6 +4014,23 @@ shell_execve (command, args, env) + /* We have committed to attempting to execute the contents of this file + as shell commands. */ + ++#if 1 ++ larray = strvec_len(args) + 1; ++ args = strvec_resize(args, larray + 1); ++ ++ for (i = larray - 1; i; i--) ++ args[i] = args[i - 1]; ++ ++ args[0] = savestring(_PATH_BSHELL); ++ args[1] = command; ++ args[larray] = (char *)0; ++ ++ SETOSTYPE (0); /* Some systems use for USG/POSIX semantics */ ++ execve ("/bin/sh", args, env); ++ SETOSTYPE (1); ++ ++ internal_error (_("%s: cannot execute: %s"), command, strerror (errno)); ++#else + initialize_subshell (); + + set_sigint_handler (); +@@ -4055,6 +4073,8 @@ shell_execve (command, args, env) + + longjmp (subshell_top_level, 1); + /*NOTREACHED*/ ++#endif ++ return (EX_NOEXEC); + } + + static int diff --git a/SOURCES/bash-3.2-patches.tar.bz2 b/SOURCES/bash-3.2-patches.tar.bz2 Binary files differnew file mode 100644 index 0000000..2d85c44 --- /dev/null +++ b/SOURCES/bash-3.2-patches.tar.bz2 diff --git a/SOURCES/bash-3.2-printf.patch b/SOURCES/bash-3.2-printf.patch new file mode 100644 index 0000000..e250c4f --- /dev/null +++ b/SOURCES/bash-3.2-printf.patch @@ -0,0 +1,32 @@ +--- builtins/printf.def ++++ builtins/printf.def 2006-07-27 17:11:19.000000000 +0200 +@@ -37,6 +37,7 @@ shell variable VAR rather than being sen + $END + + #include <config.h> ++#include <locale.h> + + #include "../bashtypes.h" + +@@ -501,12 +502,20 @@ printf_builtin (list) + case 'A': + #endif + { +- char *f; ++ char *f, *lce = getenv("LC_NUMERIC"), *lcl = setlocale(LC_NUMERIC, NULL); + floatmax_t p; + + p = getfloatmax (); + f = mklong (start, FLOATMAX_CONV, sizeof(FLOATMAX_CONV) - 1); ++ ++ if (lce && lcl) ++ setlocale(LC_NUMERIC, lce); ++ + PF (f, p); ++ ++ if (lce && lcl) ++ setlocale(LC_NUMERIC, lcl); ++ + break; + } + diff --git a/SOURCES/bash-3.2-sigrestart.patch b/SOURCES/bash-3.2-sigrestart.patch new file mode 100644 index 0000000..92e16b4 --- /dev/null +++ b/SOURCES/bash-3.2-sigrestart.patch @@ -0,0 +1,34 @@ +--- jobs.c ++++ jobs.c 2008-01-08 19:10:15.575513000 +0100 +@@ -2344,7 +2344,11 @@ wait_for (pid) + act.sa_handler = SIG_DFL; + sigemptyset (&act.sa_mask); + sigemptyset (&oact.sa_mask); ++# if defined(MUST_REINSTALL_SIGHANDLERS) + act.sa_flags = 0; ++# else ++ act.sa_flags = SA_RESTART; ++# endif + sigaction (SIGCHLD, &act, &oact); + # endif + queue_sigchld = 1; +--- sig.c ++++ sig.c 2008-04-02 12:42:23.742406622 +0200 +@@ -586,6 +586,17 @@ set_signal_handler (sig, handler) + act.sa_flags |= SA_INTERRUPT; /* XXX */ + else + act.sa_flags |= SA_RESTART; /* XXX */ ++#else ++# if !defined(MUST_REINSTALL_SIGHANDLERS) ++ if (sig != SIGALRM) ++ act.sa_flags |= SA_RESTART; /* XXX */ ++ if (handler == (trap_handler)) ++ act.sa_flags |= SA_NODEFER; /* XXX */ ++ if (handler == (termsig_sighandler)) ++ act.sa_flags |= SA_NODEFER; /* XXX */ ++ if (sig == SIGTSTP || sig == SIGTTOU || sig == SIGTTIN || sig == SIGCONT) ++ act.sa_flags |= SA_NODEFER; /* XXX */ ++# endif + #endif + sigemptyset (&act.sa_mask); + sigemptyset (&oact.sa_mask); diff --git a/SOURCES/bash-3.2-valgrind.patch b/SOURCES/bash-3.2-valgrind.patch new file mode 100644 index 0000000..3e5d49f --- /dev/null +++ b/SOURCES/bash-3.2-valgrind.patch @@ -0,0 +1,18 @@ +--- array.c ++++ array.c 2007-02-28 11:17:18.000000000 +0000 +@@ -649,13 +649,14 @@ int quoted; + + result = (char *)xmalloc (rsize = 128); + result[0] = '('; ++ indstr[0] = '\0'; + rlen = 1; + + for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) { + is = inttostr (element_index(ae), indstr, sizeof(indstr)); + valstr = element_value (ae) ? sh_double_quote (element_value(ae)) + : (char *)NULL; +- elen = STRLEN (indstr) + 8 + STRLEN (valstr); ++ elen = STRLEN (is) + 3 + STRLEN (valstr); + RESIZE_MALLOCED_BUFFER (result, rlen, (elen + 1), rsize, rsize); + + result[rlen++] = '['; diff --git a/SOURCES/bash-3.2.dif b/SOURCES/bash-3.2.dif new file mode 100644 index 0000000..d6911ef --- /dev/null +++ b/SOURCES/bash-3.2.dif @@ -0,0 +1,245 @@ +--- .pkgextract ++++ .pkgextract 2006-03-27 14:15:25.000000000 +0200 +@@ -0,0 +1,17 @@ ++tar Oxfj ../bash-3.2-patches.tar.bz2 | patch -p0 -s ++patch -p0 -s --suffix=".manual" < ../bash-2.03-manual.patch ++patch -p0 -s --suffix=".security" < ../bash-2.05a-security.patch ++patch -p0 -s --suffix=".2.4.4" < ../bash-3.2-2.4.4.patch ++patch -p0 -s --suffix=".evalexp" < ../bash-3.0-evalexp.patch ++patch -p0 -s --suffix=".warnlc" < ../bash-3.0-warn-locale.patch ++patch -p0 -s --suffix=".nfs_redir"< ../bash-3.0-nfs_redir.patch ++patch -p0 -s --suffix=".decl" < ../bash-3.0-decl.patch ++patch -p1 -s --suffix=".random2" < ../bash-3.1-random.patch ++patch -p0 -s --suffix=".equote" < ../bash-3.1-extended_quote.patch ++patch -p0 -s --suffix=".printf" < ../bash-3.2-printf.patch ++patch -p0 -s --suffix=".plugins" < ../bash-3.1-loadables.dif ++patch -p0 -s --suffix=".valgrind" < ../bash-3.2-valgrind.patch ++patch -p0 -s --suffix=".zerotty" < ../readline-4.3-input.dif ++patch -p0 -s --suffix=".wrap" < ../readline-5.2-wrap.patch ++patch -p0 -s --suffix=".conf" < ../readline-5.2-conf.patch ++patch -p0 -s --suffix=".input" < ../readline-5.1-input.patch +--- config-top.h ++++ config-top.h 2007-12-04 15:44:39.314025629 +0100 +@@ -52,14 +52,14 @@ + /* The default value of the PATH variable. */ + #ifndef DEFAULT_PATH_VALUE + #define DEFAULT_PATH_VALUE \ +- "/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:." ++ "/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:." + #endif + + /* The value for PATH when invoking `command -p'. This is only used when + the Posix.2 confstr () function, or CS_PATH define are not present. */ + #ifndef STANDARD_UTILS_PATH + #define STANDARD_UTILS_PATH \ +- "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc" ++ "/bin:/usr/bin:/sbin:/usr/sbin" + #endif + + /* Default primary and secondary prompt strings. */ +@@ -73,15 +73,15 @@ + #define KSH_COMPATIBLE_SELECT + + /* System-wide .bashrc file for interactive shells. */ +-/* #define SYS_BASHRC "/etc/bash.bashrc" */ ++#define SYS_BASHRC "/etc/bash.bashrc" + + /* System-wide .bash_logout for login shells. */ +-/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */ ++#define SYS_BASH_LOGOUT "/etc/bash.bash_logout" + + /* Define this to make non-interactive shells begun with argv[0][0] == '-' + run the startup files when not in posix mode. */ +-/* #define NON_INTERACTIVE_LOGIN_SHELLS */ ++#define NON_INTERACTIVE_LOGIN_SHELLS + + /* Define this if you want bash to try to check whether it's being run by + sshd and source the .bashrc if so (like the rshd behavior). */ +-/* #define SSH_SOURCE_BASHRC */ ++#define SSH_SOURCE_BASHRC +--- general.h ++++ general.h 2006-03-27 14:15:25.000000000 +0200 +@@ -21,10 +21,13 @@ + #if !defined (_GENERAL_H_) + #define _GENERAL_H_ + ++#include <time.h> ++#include <sys/types.h> + #include "stdc.h" + + #include "bashtypes.h" + #include "chartypes.h" ++#include "bashline.h" + + #if defined (HAVE_SYS_RESOURCE_H) && defined (RLIMTYPE) + # if defined (HAVE_SYS_TIME_H) +--- jobs.c ++++ jobs.c 2006-03-27 14:15:25.000000000 +0200 +@@ -197,10 +197,10 @@ int previous_job = NO_JOB; + #endif + + /* Last child made by the shell. */ +-pid_t last_made_pid = NO_PID; ++volatile pid_t last_made_pid = NO_PID; + + /* Pid of the last asynchronous child. */ +-pid_t last_asynchronous_pid = NO_PID; ++volatile pid_t last_asynchronous_pid = NO_PID; + + /* The pipeline currently being built. */ + PROCESS *the_pipeline = (PROCESS *)NULL; +@@ -213,7 +213,7 @@ int already_making_children = 0; + + /* If this is non-zero, $LINES and $COLUMNS are reset after every process + exits from get_tty_state(). */ +-int check_window_size; ++int check_window_size = 1; + + /* Functions local to this file. */ + +--- jobs.h ++++ jobs.h 2006-03-27 14:15:25.000000000 +0200 +@@ -162,7 +162,7 @@ extern pid_t fork (), getpid (), getpgrp + extern struct jobstats js; + + extern pid_t original_pgrp, shell_pgrp, pipeline_pgrp; +-extern pid_t last_made_pid, last_asynchronous_pid; ++extern volatile pid_t last_made_pid, last_asynchronous_pid; + extern int asynchronous_notification; + + extern JOB **jobs; +--- parse.y ++++ parse.y 2006-03-27 14:15:25.000000000 +0200 +@@ -1182,7 +1182,7 @@ input_file_descriptor () + + #if defined (READLINE) + char *current_readline_prompt = (char *)NULL; +-char *current_readline_line = (char *)NULL; ++unsigned char *current_readline_line = (unsigned char *)NULL; + int current_readline_line_index = 0; + + static int +--- shell.c ++++ shell.c 2006-03-27 14:15:25.000000000 +0200 +@@ -460,7 +460,7 @@ main (argc, argv, env) + if (dump_translatable_strings) + read_but_dont_execute = 1; + +- if (running_setuid && privileged_mode == 0) ++ if (running_setuid && privileged_mode == 0 /* && act_like_sh == 0 */) + disable_priv_mode (); + + /* Need to get the argument to a -c option processed in the +--- subst.c ++++ subst.c 2006-03-27 14:15:25.000000000 +0200 +@@ -2717,6 +2717,7 @@ call_expand_word_internal (w, q, i, c, e + last_command_exit_value = EXECUTION_FAILURE; + exp_jump_to_top_level ((result == &expand_word_error) ? DISCARD : FORCE_EOF); + /* NOTREACHED */ ++ return NULL; /* make stupid compiler happy */ + } + else + return (result); +--- variables.c ++++ variables.c 2006-03-27 14:15:25.000000000 +0200 +@@ -1191,8 +1191,10 @@ assign_random (self, value, unused) + arrayind_t unused; + { + sbrand (strtoul (value, (char **)NULL, 10)); ++#if !defined(linux) + if (subshell_environment) + seeded_subshell = 1; ++#endif + return (self); + } + +--- builtins/shopt.def ++++ builtins/shopt.def 2006-03-27 14:15:25.000000000 +0200 +@@ -252,9 +252,9 @@ reset_shopt_options () + allow_null_glob_expansion = glob_dot_filenames = 0; + cdable_vars = mail_warning = 0; + no_exit_on_failed_exec = print_shift_error = 0; +- check_hashed_filenames = cdspelling = expand_aliases = check_window_size = 0; ++ check_hashed_filenames = cdspelling = expand_aliases = 0; + +- source_uses_path = promptvars = 1; ++ check_window_size = source_uses_path = promptvars = 1; + + #if defined (EXTENDED_GLOB) + extended_glob = 0; +--- doc/Makefile.in ++++ doc/Makefile.in 2006-03-27 14:15:25.000000000 +0200 +@@ -141,7 +141,7 @@ BASHREF_FILES = $(srcdir)/bashref.texi $ + ${RM} $@ + -${DVIPS} $< + +-all: ps info dvi text html ++all: info html + nodvi: ps info text html + + PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps +--- doc/bash.1 ++++ doc/bash.1 2006-03-27 14:15:25.000000000 +0200 +@@ -4370,8 +4370,8 @@ file (the \fIinputrc\fP file). + The name of this file is taken from the value of the + .SM + .B INPUTRC +-variable. If that variable is unset, the default is +-.IR ~/.inputrc . ++environment variable. If that variable is unset, readline will read both ++.IR /etc/inputrc " and " ~/.inputrc . + When a program which uses the readline library starts up, the + initialization file is read, and the key bindings and variables + are set. +@@ -8816,6 +8816,9 @@ The individual login shell cleanup file, + .TP + .FN ~/.inputrc + Individual \fIreadline\fP initialization file ++.TP ++.FN /etc/inputrc ++System \fBreadline\fP initialization file + .PD + .SH AUTHORS + Brian Fox, Free Software Foundation +--- support/printenv.c ++++ support/printenv.c 2007-12-06 16:33:46.899561365 +0100 +@@ -27,6 +27,7 @@ + #if defined (HAVE_CONFIG_H) + # include <config.h> + #endif ++#include <stdio.h> + + #include "bashansi.h" + +--- support/rlvers.sh ++++ support/rlvers.sh 2006-03-27 14:15:25.000000000 +0200 +@@ -27,10 +27,10 @@ TDIR=$TMPDIR/rlvers + + # defaults + CC=cc +-RL_LIBDIR=/usr/local/lib +-RL_INCDIR=/usr/local/include ++RL_LIBDIR=/lib ++RL_INCDIR=/usr/include + +-TERMCAP_LIB="-ltermcap" ++TERMCAP_LIB="-lncurses" + + # cannot rely on the presence of getopts + while [ $# -gt 0 ]; do +--- support/shobj-conf ++++ support/shobj-conf 2006-09-22 16:11:58.000000000 +0200 +@@ -108,10 +108,11 @@ sunos5*|solaris2*) + linux*-*|gnu*-*|k*bsd*-gnu-*) + SHOBJ_CFLAGS=-fPIC + SHOBJ_LD='${CC}' +- SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' ++ SHOBJ_LDFLAGS='-shared' + +- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`' ++ SHLIB_XLDFLAGS='-Wl,-rpath-link,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' ++ SHLIB_LIBS=-lncurses + ;; + + freebsd2* | netbsd*) diff --git a/SOURCES/bash-3.2.tar.bz2 b/SOURCES/bash-3.2.tar.bz2 Binary files differnew file mode 100644 index 0000000..838ae0f --- /dev/null +++ b/SOURCES/bash-3.2.tar.bz2 diff --git a/SOURCES/bash-rpmlintrc b/SOURCES/bash-rpmlintrc new file mode 100644 index 0000000..db5425f --- /dev/null +++ b/SOURCES/bash-rpmlintrc @@ -0,0 +1,2 @@ +addFilter(".*hidden-file-or-dir.*/etc/skel/\..*") +addFilter(".*zero-length.*/etc/skel/\..*") diff --git a/SOURCES/command-not-found.patch b/SOURCES/command-not-found.patch new file mode 100644 index 0000000..80a016d --- /dev/null +++ b/SOURCES/command-not-found.patch @@ -0,0 +1,63 @@ +--- doc/bash.1 ++++ doc/bash.1 +@@ -2035,6 +2035,13 @@ + be a prefix of a stopped job's name; this provides functionality + analogous to the \fB%\fP\fIstring\fP job identifier. + .TP ++.B command_not_found_handle ++The name of a shell function to be called if a command cannot be ++found. The return value of this function should be 0, if the command ++is available after execution of the function, otherwise 127 (EX_NOTFOUND). ++Enabled only in interactive, non POSIX mode shells. This is a Debian ++extension. ++.TP + .B histchars + The two or three characters which control history expansion + and tokenization (see +--- doc/bashref.texi ++++ doc/bashref.texi +@@ -4809,6 +4809,13 @@ + @item UID + The numeric real user id of the current user. This variable is readonly. + ++@item command_not_found_handle ++The name of a shell function to be called if a command cannot be ++found. The return value of this function should be 0, if the command ++is available after execution of the function, otherwise 127 (EX_NOTFOUND). ++Enabled only in interactive, non POSIX mode shells. This is a Debian ++extension. ++ + @end vtable + + @node Bash Features +--- execute_cmd.c ++++ execute_cmd.c +@@ -3722,8 +3722,26 @@ + + if (command == 0) + { +- internal_error (_("%s: command not found"), pathname); +- exit (EX_NOTFOUND); /* Posix.2 says the exit status is 127 */ ++ SHELL_VAR *f, *v; ++ WORD_LIST *cmdlist; ++ WORD_DESC *w; ++ int fval; ++ if( (posixly_correct || interactive_shell == 0) || ++ (f = find_function ("command_not_found_handle")) == 0) ++ { ++ internal_error (_("%s: command not found"), pathname); ++ exit (EX_NOTFOUND); /* Posix.2 says the exit status is 127 */ ++ } ++ w = make_word("command_not_found_handle"); ++ cmdlist = make_word_list(w, (WORD_LIST*)NULL); ++ ++ w = make_word(pathname); ++ cmdlist->next = make_word_list(w, (WORD_LIST*)NULL); ++ ++ fval = execute_shell_function (f, cmdlist); ++ if (fval == EX_NOTFOUND) ++ internal_error (_("%s: command not found"), pathname); ++ exit(fval); + } + + /* Execve expects the command name to be in args[0]. So we diff --git a/SOURCES/dot.bashrc b/SOURCES/dot.bashrc new file mode 100644 index 0000000..8421175 --- /dev/null +++ b/SOURCES/dot.bashrc @@ -0,0 +1,28 @@ +# Sample .bashrc for SuSE Linux +# Copyright (c) SuSE GmbH Nuernberg + +# There are 3 different types of shells in bash: the login shell, normal shell +# and interactive shell. Login shells read ~/.profile and interactive shells +# read ~/.bashrc; in our setup, /etc/profile sources ~/.bashrc - thus all +# settings made here will also take effect in a login shell. +# +# NOTE: It is recommended to make language settings in ~/.profile rather than +# here, since multilingual X sessions would not work properly if LANG is over- +# ridden in every subshell. + +# Some applications read the EDITOR variable to determine your favourite text +# editor. So uncomment the line below and enter the editor of your choice :-) +#export EDITOR=/usr/bin/vim +#export EDITOR=/usr/bin/mcedit + +# For some news readers it makes sense to specify the NEWSSERVER variable here +#export NEWSSERVER=your.news.server + +# If you want to use a Palm device with Linux, uncomment the two lines below. +# For some (older) Palm Pilots, you might need to set a lower baud rate +# e.g. 57600 or 38400; lowest is 9600 (very slow!) +# +#export PILOTPORT=/dev/pilot +#export PILOTRATE=115200 + +test -s ~/.alias && . ~/.alias || true diff --git a/SOURCES/dot.profile b/SOURCES/dot.profile new file mode 100644 index 0000000..3da0215 --- /dev/null +++ b/SOURCES/dot.profile @@ -0,0 +1,28 @@ +# Sample .profile for SuSE Linux +# rewritten by Christian Steinruecken <cstein@suse.de> +# +# This file is read each time a login shell is started. +# All other interactive shells will only read .bashrc; this is particularly +# important for language settings, see below. + +test -z "$PROFILEREAD" && . /etc/profile || true + +# Most applications support several languages for their output. +# To make use of this feature, simply uncomment one of the lines below or +# add your own one (see /usr/share/locale/locale.alias for more codes) +# This overwrites the system default set in /etc/sysconfig/language +# in the variable RC_LANG. +# +#export LANG=de_DE.UTF-8 # uncomment this line for German output +#export LANG=fr_FR.UTF-8 # uncomment this line for French output +#export LANG=es_ES.UTF-8 # uncomment this line for Spanish output + + +# Some people don't like fortune. If you uncomment the following lines, +# you will have a fortune each time you log in ;-) + +#if [ -x /usr/bin/fortune ] ; then +# echo +# /usr/bin/fortune +# echo +#fi diff --git a/SOURCES/readline-4.3-input.dif b/SOURCES/readline-4.3-input.dif new file mode 100644 index 0000000..ad51e5c --- /dev/null +++ b/SOURCES/readline-4.3-input.dif @@ -0,0 +1,46 @@ +--- lib/readline/input.c ++++ lib/readline/input.c Mon Mar 17 19:03:51 2003 +@@ -415,6 +415,8 @@ + return (c); + } + ++extern int _rl_read_zero_char_from_tty; ++ + int + rl_getc (stream) + FILE *stream; +@@ -432,7 +434,10 @@ + /* If zero characters are returned, then the file that we are + reading from is empty! Return EOF in that case. */ + if (result == 0) +- return (EOF); ++ { ++ _rl_read_zero_char_from_tty = 1; ++ return (EOF); ++ } + + #if defined (__BEOS__) + if (errno == EINTR) +--- lib/readline/readline.c ++++ lib/readline/readline.c Mon Mar 17 19:02:52 2003 +@@ -387,6 +387,9 @@ + return (eof ? (char *)NULL : savestring (the_line)); + } + ++/* Catch EOF from tty, do not return command line */ ++int _rl_read_zero_char_from_tty = 0; ++ + STATIC_CALLBACK int + #if defined (READLINE_CALLBACKS) + readline_internal_char () +@@ -421,6 +424,10 @@ + RL_SETSTATE(RL_STATE_READCMD); + c = rl_read_key (); + RL_UNSETSTATE(RL_STATE_READCMD); ++ ++ /* Return here if terminal is closed */ ++ if (c == EOF && _rl_read_zero_char_from_tty) ++ return (rl_done = 1); + + /* EOF typed to a non-blank line is a <NL>. */ + if (c == EOF && rl_end) diff --git a/SOURCES/readline-5.1-destdir.patch b/SOURCES/readline-5.1-destdir.patch new file mode 100644 index 0000000..456e38d --- /dev/null +++ b/SOURCES/readline-5.1-destdir.patch @@ -0,0 +1,191 @@ +--- shlib/Makefile.in ++++ shlib/Makefile.in 2005-12-09 17:00:46.000000000 +0100 +@@ -57,6 +57,7 @@ + libdir = @libdir@ + datadir = @datadir@ + localedir = $(datadir)/locale ++linkagedir = $(libdir) + + # Support an alternate destination root directory for package building + DESTDIR = +@@ -181,13 +182,13 @@ + -$(SHELL) $(topdir)/support/mkdirs $(DESTDIR)$(libdir) + + install: installdirs $(SHLIB_STATUS) +- $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY) +- $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -i "$(INSTALL_DATA)" $(SHARED_READLINE) ++ $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd $(DESTDIR) -d $(libdir) -l $(linkagedir) -b $(bindir) -i "$(INSTALL_DATA)" $(SHARED_HISTORY) ++ $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd $(DESTDIR) -d $(libdir) -l $(linkagedir) -b $(bindir) -i "$(INSTALL_DATA)" $(SHARED_READLINE) + @echo install: you may need to run ldconfig + + uninstall: +- $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_HISTORY) +- $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -d $(DESTDIR)$(libdir) -b $(DESTDIR)$(bindir) -U $(SHARED_READLINE) ++ $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd $(DESTDIR) -d $(libdir) -l $(linkagedir) -b $(bindir) -U $(SHARED_HISTORY) ++ $(SHELL) $(topdir)/support/shlib-install -O $(host_os) -dd $(DESTDIR) -d $(libdir) -l $(linkagedir) -b $(bindir) -U $(SHARED_READLINE) + @echo uninstall: you may need to run ldconfig + + clean mostlyclean: force +--- support/shlib-install ++++ support/shlib-install 2005-12-09 17:05:28.000000000 +0100 +@@ -3,7 +3,7 @@ + # shlib-install - install a shared library and do any necessary host-specific + # post-installation configuration (like ldconfig) + # +-# usage: shlib-install [-D] -O host_os -d installation-dir [-b bin-dir] -i install-prog [-U] library ++# usage: shlib-install [-D] -O host_os -d installation-dir [-l linkage-dir] [-b bin-dir] -i install-prog [-U] library + # + # Chet Ramey + # chet@po.cwru.edu +@@ -12,10 +12,12 @@ + # defaults + # + INSTALLDIR=/usr/local/lib ++LINKAGEDIR= + LDCONFIG=ldconfig ++DESTDIR= + + PROGNAME=`basename $0` +-USAGE="$PROGNAME [-D] -O host_os -d installation-dir [-b bin-dir] -i install-prog [-U] library" ++USAGE="$PROGNAME [-D] -O host_os -d installation-dir [-l linkage-dir] [-b bin-dir] -i install-prog [-U] library" + + # process options + +@@ -23,14 +25,19 @@ + case "$1" in + -O) shift; host_os="$1"; shift ;; + -d) shift; INSTALLDIR="$1"; shift ;; ++ -dd) shift; DESTDIR=$1; shift ;; + -b) shift; BINDIR="$1" ; shift ;; + -i) shift; INSTALLPROG="$1" ; shift ;; ++ -l) shift; LINKAGEDIR="$1" ; shift ;; + -D) echo=echo ; shift ;; + -U) uninstall=true ; shift ;; + -*) echo "$USAGE" >&2 ; exit 2;; + *) break ;; + esac + done ++if [ -z "$LINKAGEDIR" ]; then ++ LINKAGEDIR="$INSTALLDIR" ++fi + + # set install target name + LIBNAME="$1" +@@ -48,18 +55,18 @@ + # pre-install + + if [ -z "$uninstall" ]; then +- ${echo} $RM ${INSTALLDIR}/${LIBNAME}.${OLDSUFF} +- if [ -f "$INSTALLDIR/$LIBNAME" ]; then +- ${echo} $MV $INSTALLDIR/$LIBNAME ${INSTALLDIR}/${LIBNAME}.${OLDSUFF} ++ ${echo} $RM ${DESTDIR}${INSTALLDIR}/${LIBNAME}.${OLDSUFF} ++ if [ -f "${DESTDIR}$INSTALLDIR/$LIBNAME" ]; then ++ ${echo} $MV ${DESTDIR}$INSTALLDIR/$LIBNAME ${DESTDIR}${INSTALLDIR}/${LIBNAME}.${OLDSUFF} + fi + fi + + # install/uninstall + + if [ -z "$uninstall" ] ; then +- ${echo} eval ${INSTALLPROG} $LIBNAME ${INSTALLDIR}/${LIBNAME} ++ ${echo} eval ${INSTALLPROG} $LIBNAME ${DESTDIR}${INSTALLDIR}/${LIBNAME} + else +- ${echo} ${RM} ${INSTALLDIR}/${LIBNAME} ++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/${LIBNAME} + fi + + # post-install/uninstall +@@ -70,7 +77,7 @@ + case "$host_os" in + hpux*|darwin*|macosx*) + if [ -z "$uninstall" ]; then +- chmod 555 ${INSTALLDIR}/${LIBNAME} ++ chmod 555 ${DESTDIR}${INSTALLDIR}/${LIBNAME} + fi ;; + cygwin*) + IMPLIBNAME=`echo ${LIBNAME} \ +@@ -108,8 +115,8 @@ + LINK1=`echo $LIBNAME | sed 's:\(.*\)\.[0-9]\.[0-9]:\1:'` # libname.dylib + esac + +-INSTALL_LINK1='${echo} cd $INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK1' +-INSTALL_LINK2='${echo} cd $INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK2' ++INSTALL_LINK1='${echo} cd ${DESTDIR}$INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK1' ++INSTALL_LINK2='${echo} cd ${DESTDIR}$INSTALLDIR && ${echo} ${LN} $LIBNAME $LINK2' + + # + # Create symlinks to the installed library. This section is incomplete. +@@ -117,27 +124,27 @@ + case "$host_os" in + *linux*) + # libname.so.M -> libname.so.M.N +- ${echo} ${RM} ${INSTALLDIR}/$LINK2 ++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK2 + if [ -z "$uninstall" ]; then + eval $INSTALL_LINK2 + fi + + # libname.so -> libname.so.M +- ${echo} ${RM} ${INSTALLDIR}/$LINK1 ++ ${echo} ${RM} ${DESTDIR}${LINKAGEDIR}/$LINK1 + if [ -z "$uninstall" ]; then +- ${echo} cd $INSTALLDIR && ${echo} ${LN} $LINK2 $LINK1 ++ ${echo} ln -s ${INSTALLDIR}/$LIBNAME ${DESTDIR}${LINKAGEDIR}/$LINK1 + fi + ;; + + bsdi4*|*gnu*|darwin*|macosx*|k*bsd*-gnu) + # libname.so.M -> libname.so.M.N +- ${echo} ${RM} ${INSTALLDIR}/$LINK2 ++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK2 + if [ -z "$uninstall" ]; then + eval $INSTALL_LINK2 + fi + + # libname.so -> libname.so.M.N +- ${echo} ${RM} ${INSTALLDIR}/$LINK1 ++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1 + if [ -z "$uninstall" ]; then + eval $INSTALL_LINK1 + fi +@@ -145,7 +152,7 @@ + + solaris2*|aix4.[2-9]*|osf*|irix[56]*|sysv[45]*|dgux*) + # libname.so -> libname.so.M +- ${echo} ${RM} ${INSTALLDIR}/$LINK1 ++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1 + if [ -z "$uninstall" ]; then + eval $INSTALL_LINK1 + fi +@@ -156,19 +163,19 @@ + freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*) + if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then + # libname.so -> libname.so.M +- ${echo} ${RM} ${INSTALLDIR}/$LINK1 ++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1 + if [ -z "$uninstall" ]; then + eval $INSTALL_LINK1 + fi + else + # libname.so.M -> libname.so.M.N +- ${echo} ${RM} ${INSTALLDIR}/$LINK2 ++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK2 + if [ -z "$uninstall" ]; then + eval $INSTALL_LINK2 + fi + + # libname.so -> libname.so.M.N +- ${echo} ${RM} ${INSTALLDIR}/$LINK1 ++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1 + if [ -z "$uninstall" ]; then + eval $INSTALL_LINK1 + fi +@@ -177,7 +184,7 @@ + + hpux1*) + # libname.sl -> libname.M +- ${echo} ${RM} ${INSTALLDIR}/$LINK1.sl ++ ${echo} ${RM} ${DESTDIR}${INSTALLDIR}/$LINK1.sl + if [ -z "$uninstall" ]; then + eval $INSTALL_LINK1 + fi diff --git a/SOURCES/readline-5.2-conf.patch b/SOURCES/readline-5.2-conf.patch new file mode 100644 index 0000000..7dc1602 --- /dev/null +++ b/SOURCES/readline-5.2-conf.patch @@ -0,0 +1,118 @@ +--- lib/readline/bind.c ++++ lib/readline/bind.c 2006-11-13 17:20:23.000000000 +0100 +@@ -752,6 +752,9 @@ rl_function_of_keyseq (keyseq, map, type + /* The last key bindings file read. */ + static char *last_readline_init_file = (char *)NULL; + ++/* Flag to read system init file */ ++static int read_system_init_file = 0; ++ + /* The file we're currently reading key bindings from. */ + static const char *current_readline_init_file; + static int current_readline_init_include_level; +@@ -815,11 +818,14 @@ rl_re_read_init_file (count, ignore) + return r; + } + ++/* Forward declarations */ ++static int sv_bell_style PARAMS((const char *)); ++ + /* Do key bindings from a file. If FILENAME is NULL it defaults + to the first non-null filename from this list: + 1. the filename used for the previous call + 2. the value of the shell variable `INPUTRC' +- 3. ~/.inputrc ++ 3. /etc/inputrc and ~/.inputrc + 4. /etc/inputrc + If the file existed and could be opened and read, 0 is returned, + otherwise errno is returned. */ +@@ -831,16 +837,37 @@ rl_read_init_file (filename) + if (filename == 0) + filename = last_readline_init_file; + if (filename == 0) +- filename = sh_get_env_value ("INPUTRC"); ++ { ++ filename = sh_get_env_value ("INPUTRC"); ++ if (filename && !strncmp(SYS_INPUTRC, filename, strlen(SYS_INPUTRC))) ++ { ++ struct stat st; ++ char *default_inputrc = tilde_expand(DEFAULT_INPUTRC); ++ ++ if ((stat(default_inputrc, &st) == 0)) ++ { ++ filename = DEFAULT_INPUTRC; ++ read_system_init_file = 1; ++ } ++ else ++ read_system_init_file = 0; ++ ++ free(default_inputrc); ++ } ++ else ++ read_system_init_file = 1; ++ } + if (filename == 0 || *filename == 0) + { + filename = DEFAULT_INPUTRC; +- /* Try to read DEFAULT_INPUTRC; fall back to SYS_INPUTRC on failure */ +- if (_rl_read_init_file (filename, 0) == 0) +- return 0; +- filename = SYS_INPUTRC; ++ read_system_init_file = 1; + } + ++ sv_bell_style(sh_get_env_value("DEFAULT_BELL_STYLE")); ++ ++ if (read_system_init_file) ++ _rl_read_init_file (SYS_INPUTRC, 1); ++ + #if defined (__MSDOS__) + if (_rl_read_init_file (filename, 0) == 0) + return 0; +@@ -1350,7 +1377,14 @@ rl_parse_and_bind (string) + rl_macro_bind (seq, &funname[1], _rl_keymap); + } + else +- rl_bind_keyseq (seq, rl_named_function (funname)); ++ { ++#if defined (PREFIX_META_HACK) ++ if (_rl_stricmp (funname, "prefix-meta") == 0) ++ rl_generic_bind (ISKMAP, seq, (char *)emacs_meta_keymap, _rl_keymap); ++ else ++#endif ++ rl_bind_keyseq (seq, rl_named_function (funname)); ++ } + + free (seq); + return 0; +@@ -1487,7 +1521,6 @@ typedef int _rl_sv_func_t PARAMS((const + #define V_INT 2 + + /* Forward declarations */ +-static int sv_bell_style PARAMS((const char *)); + static int sv_combegin PARAMS((const char *)); + static int sv_compquery PARAMS((const char *)); + static int sv_editmode PARAMS((const char *)); +--- lib/readline/rlconf.h ++++ lib/readline/rlconf.h 2006-11-13 17:21:26.000000000 +0100 +@@ -35,7 +35,7 @@ + #define HANDLE_SIGNALS + + /* Ugly but working hack for binding prefix meta. */ +-#define PREFIX_META_HACK ++#undef PREFIX_META_HACK + + /* The next-to-last-ditch effort file name for a user-specific init file. */ + #define DEFAULT_INPUTRC "~/.inputrc" +--- lib/readline/doc/rluser.texi ++++ lib/readline/doc/rluser.texi 2006-11-13 17:23:56.000000000 +0100 +@@ -338,7 +338,8 @@ file is taken from the value of the envi + @end ifclear + that variable is unset, the default is @file{~/.inputrc}. If that + file does not exist or cannot be read, the ultimate default is +-@file{/etc/inputrc}. ++@file{/etc/inputrc}. If both @file{~/.inputrc} and @file{/etc/inputrc} ++exist Readline will read first @file{/etc/inputrc} and then @file{~/.inputrc}. + + When a program which uses the Readline library starts up, the + init file is read, and the key bindings are set. diff --git a/SOURCES/readline-5.2-patches.tar.bz2 b/SOURCES/readline-5.2-patches.tar.bz2 Binary files differnew file mode 100644 index 0000000..2cf53d8 --- /dev/null +++ b/SOURCES/readline-5.2-patches.tar.bz2 diff --git a/SOURCES/readline-5.2-wrap.patch b/SOURCES/readline-5.2-wrap.patch new file mode 100644 index 0000000..465f6c5 --- /dev/null +++ b/SOURCES/readline-5.2-wrap.patch @@ -0,0 +1,14 @@ +--- lib/readline/display.c ++++ lib/readline/display.c 2006-11-13 16:55:24.000000000 +0100 +@@ -665,7 +665,10 @@ + inv_lbreaks[++newlines] = temp; + #if defined (HANDLE_MULTIBYTE) + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) +- lpos -= _rl_col_width (local_prompt, n0, num); ++ { ++ if (local_prompt_len > 0) ++ lpos -= _rl_col_width (local_prompt, n0, num); ++ } + else + #endif + lpos -= _rl_screenwidth; diff --git a/SOURCES/readline-5.2.dif b/SOURCES/readline-5.2.dif new file mode 100644 index 0000000..e493b3f --- /dev/null +++ b/SOURCES/readline-5.2.dif @@ -0,0 +1,140 @@ +--- .pkgextract ++++ .pkgextract 2005-12-09 17:09:26.000000000 +0100 +@@ -0,0 +1,6 @@ ++tar Oxfj ../readline-5.2-patches.tar.bz2 | patch -p0 -s ++patch -p2 -s --suffix=".zerotty" < ../readline-4.3-input.dif ++patch -p2 -s --suffix=".wrap" < ../readline-5.2-wrap.patch ++patch -p2 -s --suffix=".conf" < ../readline-5.2-conf.patch ++patch -p2 -s --suffix=".input" < ../readline-5.1-input.patch ++patch -p0 -s --suffix=".destdir" < ../readline-5.1-destdir.patch +--- Makefile.in ++++ Makefile.in 2005-12-09 17:09:26.000000000 +0100 +@@ -220,10 +220,8 @@ maybe-uninstall-headers: uninstall-heade + install: $(INSTALL_TARGETS) + + install-static: installdirs $(STATIC_LIBS) install-headers install-doc +- -$(MV) $(DESTDIR)$(libdir)/libreadline.a $(DESTDIR)$(libdir)/libreadline.old + $(INSTALL_DATA) libreadline.a $(DESTDIR)$(libdir)/libreadline.a + -test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libreadline.a +- -$(MV) $(DESTDIR)$(libdir)/libhistory.a $(DESTDIR)$(libdir)/libhistory.old + $(INSTALL_DATA) libhistory.a $(DESTDIR)$(libdir)/libhistory.a + -test -n "$(RANLIB)" && $(RANLIB) $(DESTDIR)$(libdir)/libhistory.a + +@@ -246,7 +244,7 @@ uninstall-shared: maybe-uninstall-header + install-doc: installdirs + -( if test -d doc ; then \ + cd doc && \ +- ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR=${DESTDIR} install; \ ++ ${MAKE} infodir=$(infodir) DESTDIR=${DESTDIR} install; \ + fi ) + + uninstall-doc: +--- complete.c ++++ complete.c 2005-12-09 17:11:19.000000000 +0100 +@@ -883,7 +883,7 @@ _rl_find_completion_word (fp, dp) + /* We didn't find an unclosed quoted substring upon which to do + completion, so use the word break characters to find the + substring on which to complete. */ +- while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)) ++ while ((rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))) + { + scan = rl_line_buffer[rl_point]; + +@@ -1802,7 +1802,7 @@ rl_completion_matches (text, entry_funct + match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *)); + match_list[1] = (char *)NULL; + +- while (string = (*entry_function) (text, matches)) ++ while ((string = (*entry_function) (text, matches))) + { + if (matches + 1 == match_list_size) + match_list = (char **)xrealloc +@@ -1853,7 +1853,7 @@ rl_username_completion_function (text, s + } + + #if defined (HAVE_GETPWENT) +- while (entry = getpwent ()) ++ while ((entry = getpwent ())) + { + /* Null usernames should result in all users as possible completions. */ + if (namelen == 0 || (STREQN (username, entry->pw_name, namelen))) +--- readline.c ++++ readline.c 2005-12-09 17:09:26.000000000 +0100 +@@ -735,7 +735,11 @@ _rl_dispatch_subseq (key, map, got_subse + { + /* Special case rl_do_lowercase_version (). */ + if (func == rl_do_lowercase_version) +- return (_rl_dispatch (_rl_to_lower (key), map)); ++ { ++ if (key == ANYOTHERKEY) ++ return -1; ++ return (_rl_dispatch (_rl_to_lower (key), map)); ++ } + + rl_executing_keymap = map; + +--- readline.h ++++ readline.h 2005-12-09 17:09:26.000000000 +0100 +@@ -445,7 +445,7 @@ extern char *rl_filename_completion_func + + extern int rl_completion_mode PARAMS((rl_command_func_t *)); + +-#if 0 ++#ifdef OLD_READLINE + /* Backwards compatibility (compat.c). These will go away sometime. */ + extern void free_undo_list PARAMS((void)); + extern int maybe_save_line PARAMS((void)); +--- doc/Makefile.in ++++ doc/Makefile.in 2005-12-09 17:09:26.000000000 +0100 +@@ -96,7 +96,7 @@ DIST_DOCS = $(DVIOBJ) $(PSOBJ) $(HTMLOBJ + $(RM) $@ + -${DVIPDF} $< + +-all: info dvi html ps text ++all: info html + nodvi: info html text + + info: $(INFOOBJ) +--- doc/readline.3 ++++ doc/readline.3 2006-11-13 17:33:27.000000000 +0100 +@@ -118,6 +118,14 @@ environment variable. If that variable + .IR ~/.inputrc . + If that file does not exist or cannot be read, the ultimate default is + .IR /etc/inputrc . ++If both files ++.I ~/.inputrc ++and ++.I /etc/inputrc ++exist readline will read first ++.I /etc/inputrc ++and then ++.IR ~/.inputrc . + When a program which uses the readline library starts up, the + init file is read, and the key bindings and variables are set. + There are only a few basic constructs allowed in the +@@ -1270,6 +1278,9 @@ VI Command Mode functions + .TP + .FN ~/.inputrc + Individual \fBreadline\fP initialization file ++.TP ++.FN /etc/inputrc ++System \fBreadline\fP initialization file + .PD + .SH AUTHORS + Brian Fox, Free Software Foundation +--- support/shobj-conf ++++ support/shobj-conf 2006-09-22 16:17:48.000000000 +0200 +@@ -108,10 +108,11 @@ sunos5*|solaris2*) + linux*-*|gnu*-*|k*bsd*-gnu-*) + SHOBJ_CFLAGS=-fPIC + SHOBJ_LD='${CC}' +- SHOBJ_LDFLAGS='-shared -Wl,-soname,$@' ++ SHOBJ_LDFLAGS='-shared' + +- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`' ++ SHLIB_XLDFLAGS='-Wl,-rpath-link,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`' + SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' ++ SHLIB_LIBS=-lncurses + ;; + + freebsd2* | netbsd*) diff --git a/SOURCES/readline-5.2.tar.bz2 b/SOURCES/readline-5.2.tar.bz2 Binary files differnew file mode 100644 index 0000000..eff9b6e --- /dev/null +++ b/SOURCES/readline-5.2.tar.bz2 diff --git a/SOURCES/run-tests b/SOURCES/run-tests new file mode 100644 index 0000000..9a113d8 --- /dev/null +++ b/SOURCES/run-tests @@ -0,0 +1,29 @@ +#! /bin/sh + +PATH=.:$PATH # just to get recho/zecho/printenv if not run via `make tests' +export PATH + +# unset BASH_ENV only if it is set +[ "${BASH_ENV+set}" = "set" ] && unset BASH_ENV +# ditto for SHELLOPTS +#[ "${SHELLOPTS+set}" = "set" ] && unset SHELLOPTS + +: ${THIS_SH:=../bash} +export THIS_SH + +${THIS_SH} ./version + +rm -f /tmp/xx + +echo Any output from any test, unless otherwise noted, indicates a possible anomaly + +for x in run-* +do + case $x in + $0|run-all|run-minimal|run-gprof|run-jobs|run-ifs-posix) ;; + *.orig|*~) ;; + *) echo $x ; sh $x ;; + esac +done + +exit 0 |