bash-1.5.8 rebuild
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
diff --git a/config.h.in b/config.h.in
|
||||
index a5ad9e7..62a6b32 100644
|
||||
index ab316d4..11d1d68 100644
|
||||
--- a/config.h.in
|
||||
+++ b/config.h.in
|
||||
@@ -748,6 +748,9 @@
|
||||
@@ -775,6 +775,9 @@
|
||||
/* Define if you have the pselect function. */
|
||||
#undef HAVE_PSELECT
|
||||
|
||||
@@ -12,7 +12,7 @@ index a5ad9e7..62a6b32 100644
|
||||
/* Define if you have the putenv function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
@@ -946,6 +949,9 @@
|
||||
@@ -981,6 +984,9 @@
|
||||
/* Define if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
@@ -23,29 +23,20 @@ index a5ad9e7..62a6b32 100644
|
||||
#undef HAVE_GRP_H
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index ce4e9b6..eda95d6 100644
|
||||
index 2fe3e7d..f1b7f1b 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -700,7 +700,7 @@ BASH_HEADER_INTTYPES
|
||||
AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \
|
||||
memory.h locale.h termcap.h termio.h termios.h dlfcn.h \
|
||||
stdbool.h stddef.h stdint.h netdb.h pwd.h grp.h strings.h \
|
||||
- regex.h syslog.h ulimit.h)
|
||||
+ regex.h syslog.h ulimit.h elf.h)
|
||||
AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h sys/ioctl.h \
|
||||
sys/param.h sys/socket.h sys/stat.h \
|
||||
sys/time.h sys/times.h sys/types.h sys/wait.h)
|
||||
@@ -771,7 +771,7 @@ dnl checks for system calls
|
||||
AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getgroups gethostname \
|
||||
getpagesize getpeername getrlimit getrusage gettimeofday \
|
||||
kill killpg lstat pselect readlink sbrk select setdtablesize \
|
||||
- setitimer tcgetpgrp uname ulimit waitpid)
|
||||
+ setitimer tcgetpgrp uname ulimit waitpid pread)
|
||||
@@ -827,7 +827,7 @@ dnl checks for system calls
|
||||
AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getentropy getgroups \
|
||||
gethostname getpagesize getpeername getrandom getrlimit \
|
||||
getrusage gettimeofday kill killpg lstat pselect readlink \
|
||||
- select setdtablesize setitimer tcgetpgrp uname ulimit waitpid)
|
||||
+ select setdtablesize setitimer tcgetpgrp uname ulimit waitpid pread)
|
||||
AC_REPLACE_FUNCS(rename)
|
||||
|
||||
dnl checks for c library functions
|
||||
diff --git a/execute_cmd.c b/execute_cmd.c
|
||||
index 2a3df6d..b5cd405 100644
|
||||
index d2a0dd7..d2555ad 100644
|
||||
--- a/execute_cmd.c
|
||||
+++ b/execute_cmd.c
|
||||
@@ -41,6 +41,10 @@
|
||||
@@ -59,7 +50,7 @@ index 2a3df6d..b5cd405 100644
|
||||
#include "posixtime.h"
|
||||
|
||||
#if defined (HAVE_SYS_RESOURCE_H) && !defined (RLIMTYPE)
|
||||
@@ -5486,6 +5490,14 @@ shell_execve (command, args, env)
|
||||
@@ -5832,6 +5836,14 @@ shell_execve (command, args, env)
|
||||
{
|
||||
/* The file has the execute bits set, but the kernel refuses to
|
||||
run it for some reason. See why. */
|
||||
@@ -74,18 +65,19 @@ index 2a3df6d..b5cd405 100644
|
||||
#if defined (HAVE_HASH_BANG_EXEC)
|
||||
READ_SAMPLE_BUF (command, sample, sample_len);
|
||||
if (sample_len > 0)
|
||||
@@ -5495,6 +5507,7 @@ shell_execve (command, args, env)
|
||||
@@ -5841,6 +5853,7 @@ shell_execve (command, args, env)
|
||||
char *interp;
|
||||
int ilen;
|
||||
|
||||
+ close (fd);
|
||||
+ close (fd);
|
||||
interp = getinterp (sample, sample_len, (int *)NULL);
|
||||
ilen = strlen (interp);
|
||||
errno = i;
|
||||
@@ -5510,6 +5523,136 @@ shell_execve (command, args, env)
|
||||
@@ -5856,7 +5869,138 @@ shell_execve (command, args, env)
|
||||
return (EX_NOEXEC);
|
||||
}
|
||||
#endif
|
||||
- errno = i;
|
||||
+#if defined (HAVE_ELF_H)
|
||||
+ if (i == ENOENT
|
||||
+ && sample_len > EI_NIDENT
|
||||
@@ -216,9 +208,8 @@ index 2a3df6d..b5cd405 100644
|
||||
+#if defined (HAVE_HASH_BANG_EXEC) || defined (HAVE_ELF_H)
|
||||
+ close (fd);
|
||||
+#endif
|
||||
errno = i;
|
||||
+
|
||||
+ errno = i;
|
||||
file_error (command);
|
||||
}
|
||||
--
|
||||
2.9.3
|
||||
|
||||
return (last_command_exit_value);
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
diff -up bash-4.0/config-top.h.ssh_source_bash bash-4.0/config-top.h
|
||||
--- bash-4.0/config-top.h.ssh_source_bash 2009-01-21 15:20:06.000000000 +0100
|
||||
+++ bash-4.0/config-top.h 2009-01-21 15:25:46.000000000 +0100
|
||||
@@ -90,7 +90,7 @@
|
||||
diff --git a/config-top.h b/config-top.h
|
||||
index e5cc147..f5e0a52 100644
|
||||
--- a/config-top.h
|
||||
+++ b/config-top.h
|
||||
@@ -106,7 +106,7 @@
|
||||
sshd and source the .bashrc if so (like the rshd behavior). This checks
|
||||
for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment,
|
||||
which can be fooled under certain not-uncommon circumstances. */
|
||||
-/* #define SSH_SOURCE_BASHRC */
|
||||
+#define SSH_SOURCE_BASHRC
|
||||
|
||||
/* Define if you want the case-capitalizing operators (~[~]) and the
|
||||
/* Define if you want the case-toggling operators (~[~]) and the
|
||||
`capcase' variable attribute (declare -c). */
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
|
||||
--- bash-4.2/execute_cmd.c.coverity 2011-02-24 13:04:35.000000000 +0100
|
||||
+++ bash-4.2/execute_cmd.c 2011-02-24 13:49:13.000000000 +0100
|
||||
@@ -5036,7 +5036,7 @@ shell_execve (command, args, env)
|
||||
diff --git a/execute_cmd.c b/execute_cmd.c
|
||||
index a988400..412128c 100644
|
||||
--- a/execute_cmd.c
|
||||
+++ b/execute_cmd.c
|
||||
@@ -5760,7 +5760,7 @@ shell_execve (command, args, env)
|
||||
Elf32_Ehdr ehdr;
|
||||
Elf32_Phdr *phdr;
|
||||
Elf32_Shdr *shdr;
|
||||
@@ -10,7 +11,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
|
||||
|
||||
/* We have to copy the data since the sample buffer
|
||||
might not be aligned correctly to be accessed as
|
||||
@@ -5044,12 +5044,12 @@ shell_execve (command, args, env)
|
||||
@@ -5768,12 +5768,12 @@ shell_execve (command, args, env)
|
||||
memcpy (&ehdr, sample, sizeof (Elf32_Ehdr));
|
||||
|
||||
nshdr = ehdr.e_shnum;
|
||||
@@ -25,7 +26,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
|
||||
ehdr.e_shoff);
|
||||
#else
|
||||
if (lseek (fd, ehdr.e_shoff, SEEK_SET) != -1)
|
||||
@@ -5091,11 +5091,11 @@ shell_execve (command, args, env)
|
||||
@@ -5815,11 +5815,11 @@ shell_execve (command, args, env)
|
||||
}
|
||||
|
||||
nphdr = ehdr.e_phnum;
|
||||
@@ -39,7 +40,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
|
||||
ehdr.e_phoff);
|
||||
#else
|
||||
if (lseek (fd, ehdr.e_phoff, SEEK_SET) != -1)
|
||||
@@ -5120,7 +5120,7 @@ shell_execve (command, args, env)
|
||||
@@ -5844,7 +5844,7 @@ shell_execve (command, args, env)
|
||||
Elf64_Ehdr ehdr;
|
||||
Elf64_Phdr *phdr;
|
||||
Elf64_Shdr *shdr;
|
||||
@@ -48,7 +49,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
|
||||
|
||||
/* We have to copy the data since the sample buffer
|
||||
might not be aligned correctly to be accessed as
|
||||
@@ -5128,11 +5128,11 @@ shell_execve (command, args, env)
|
||||
@@ -5852,11 +5852,11 @@ shell_execve (command, args, env)
|
||||
memcpy (&ehdr, sample, sizeof (Elf64_Ehdr));
|
||||
|
||||
nshdr = ehdr.e_shnum;
|
||||
@@ -62,7 +63,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
|
||||
ehdr.e_shoff);
|
||||
#else
|
||||
if (lseek (fd, ehdr.e_shoff, SEEK_SET) != -1)
|
||||
@@ -5174,11 +5174,11 @@ shell_execve (command, args, env)
|
||||
@@ -5898,11 +5898,11 @@ shell_execve (command, args, env)
|
||||
}
|
||||
|
||||
nphdr = ehdr.e_phnum;
|
||||
@@ -76,7 +77,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
|
||||
ehdr.e_phoff);
|
||||
#else
|
||||
if (lseek (fd, ehdr.e_phoff, SEEK_SET) != -1)
|
||||
@@ -5200,8 +5200,8 @@ shell_execve (command, args, env)
|
||||
@@ -5924,8 +5924,8 @@ shell_execve (command, args, env)
|
||||
|
||||
if (offset != -1)
|
||||
{
|
||||
@@ -87,7 +88,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
|
||||
char *interp = NULL;
|
||||
|
||||
do
|
||||
@@ -5250,7 +5250,8 @@ shell_execve (command, args, env)
|
||||
@@ -5974,7 +5974,8 @@ shell_execve (command, args, env)
|
||||
}
|
||||
#endif
|
||||
#if defined (HAVE_HASH_BANG_EXEC) || defined (HAVE_ELF_H)
|
||||
@@ -95,5 +96,8 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
|
||||
+ if (fd >= 0)
|
||||
+ close (fd);
|
||||
#endif
|
||||
errno = i;
|
||||
file_error (command);
|
||||
|
||||
errno = i;
|
||||
--
|
||||
2.17.2
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
diff -up bash-4.3/locale.c.old bash-4.3/locale.c
|
||||
--- bash-4.3/locale.c.old 2015-07-15 11:55:00.002857301 +0200
|
||||
+++ bash-4.3/locale.c 2015-07-15 11:48:36.698086257 +0200
|
||||
@@ -77,8 +77,6 @@ set_default_locale ()
|
||||
diff --git a/locale.c b/locale.c
|
||||
index 17ccc58..a6c07a3 100644
|
||||
--- a/locale.c
|
||||
+++ b/locale.c
|
||||
@@ -78,8 +78,6 @@ set_default_locale ()
|
||||
{
|
||||
#if defined (HAVE_SETLOCALE)
|
||||
default_locale = setlocale (LC_ALL, "");
|
||||
- if (default_locale)
|
||||
- default_locale = savestring (default_locale);
|
||||
#else
|
||||
default_locale = savestring ("C");
|
||||
#endif /* HAVE_SETLOCALE */
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
diff --git a/parse.y b/parse.y
|
||||
index 30425a5..85f1c4f 100644
|
||||
index df1231d..2449fa8 100644
|
||||
--- a/parse.y
|
||||
+++ b/parse.y
|
||||
@@ -4228,6 +4228,8 @@ xparse_dolparen (base, string, indp, flags)
|
||||
@@ -4482,6 +4482,8 @@ xparse_dolparen (base, string, indp, flags)
|
||||
save_parser_state (&ps);
|
||||
save_input_line_state (&ls);
|
||||
orig_eof_token = shell_eof_token;
|
||||
+ /* avoid echoing every substitution again */
|
||||
+ echo_input_at_read = 0;
|
||||
|
||||
/*(*/
|
||||
parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/
|
||||
#if defined (ALIAS) || defined (DPAREN_ARITHMETIC)
|
||||
saved_pushed_strings = pushed_string_list; /* separate parsing context */
|
||||
pushed_string_list = (STRING_SAVER *)NULL;
|
||||
diff --git a/subst.c b/subst.c
|
||||
index f1a4df1..a93a4ce 100644
|
||||
index 9ccbf33..8a9ee5c 100644
|
||||
--- a/subst.c
|
||||
+++ b/subst.c
|
||||
@@ -8513,6 +8513,7 @@ param_expand (string, sindex, quoted, expanded_something,
|
||||
WORD_LIST *list;
|
||||
@@ -9453,6 +9453,7 @@ param_expand (string, sindex, quoted, expanded_something,
|
||||
WORD_LIST *list, *l;
|
||||
WORD_DESC *tdesc, *ret;
|
||||
int tflag;
|
||||
int tflag, nullarg;
|
||||
+ int old_echo_input;
|
||||
|
||||
/*itrace("param_expand: `%s' pflags = %d", string+*sindex, pflags);*/
|
||||
zindex = *sindex;
|
||||
@@ -8831,6 +8832,9 @@ arithsub:
|
||||
@@ -9843,6 +9844,9 @@ arithsub:
|
||||
}
|
||||
|
||||
comsub:
|
||||
@@ -33,7 +33,7 @@ index f1a4df1..a93a4ce 100644
|
||||
if (pflags & PF_NOCOMSUB)
|
||||
/* we need zindex+1 because string[zindex] == RPAREN */
|
||||
temp1 = substring (string, *sindex, zindex+1);
|
||||
@@ -8843,6 +8847,7 @@ comsub:
|
||||
@@ -9855,6 +9859,7 @@ comsub:
|
||||
}
|
||||
FREE (temp);
|
||||
temp = temp1;
|
||||
@@ -41,6 +41,3 @@ index f1a4df1..a93a4ce 100644
|
||||
break;
|
||||
|
||||
/* Do POSIX.2d9-style arithmetic substitution. This will probably go
|
||||
--
|
||||
2.9.3
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
--- bash-3.1/doc/Makefile.in.infotags 2006-07-12 13:57:18.000000000 +0100
|
||||
+++ bash-3.1/doc/Makefile.in 2006-07-12 13:58:25.000000000 +0100
|
||||
@@ -69,7 +69,6 @@
|
||||
diff --git a/doc/Makefile.in b/doc/Makefile.in
|
||||
index 5f0756c..a5fa5a0 100644
|
||||
--- a/doc/Makefile.in
|
||||
+++ b/doc/Makefile.in
|
||||
@@ -74,7 +74,6 @@ TEXI2DVI = ${SUPPORT_SRCDIR}/texi2dvi
|
||||
TEXI2HTML = ${SUPPORT_SRCDIR}/texi2html
|
||||
MAN2HTML = ${BUILD_DIR}/support/man2html
|
||||
HTMLPOST = ${srcdir}/htmlpost.sh
|
||||
@@ -8,18 +10,9 @@
|
||||
QUIETPS = #set this to -q to shut up dvips
|
||||
PAPERSIZE = letter # change to a4 for A4-size paper
|
||||
PSDPI = 600 # could be 300 if you like
|
||||
@@ -146,7 +145,7 @@
|
||||
|
||||
PSFILES = bash.ps bashbug.ps article.ps builtins.ps rbash.ps
|
||||
DVIFILES = bashref.dvi bashref.ps
|
||||
-INFOFILES = bashref.info
|
||||
+INFOFILES = bashref.info bash.info
|
||||
MAN0FILES = bash.0 bashbug.0 builtins.0 rbash.0
|
||||
HTMLFILES = bashref.html bash.html
|
||||
PDFFILES = bash.pdf bashref.pdf article.pdf rose94.pdf
|
||||
@@ -167,8 +166,8 @@
|
||||
@@ -188,8 +187,8 @@ bashref.pdf: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
|
||||
bashref.html: $(BASHREF_FILES) $(HSUSER) $(RLUSER)
|
||||
$(TEXI2HTML) -menu -monolithic -I $(TEXINPUTDIR) $(srcdir)/bashref.texi
|
||||
$(MAKEINFO) --html --no-split -I$(TEXINPUTDIR) $(srcdir)/bashref.texi
|
||||
|
||||
-bash.info: bashref.info
|
||||
- ${SHELL} ${INFOPOST} < $(srcdir)/bashref.info > $@ ; \
|
||||
@@ -28,3 +21,6 @@
|
||||
|
||||
bash.txt: bash.1
|
||||
bash.ps: bash.1
|
||||
--
|
||||
2.9.3
|
||||
|
||||
|
||||
@@ -1,35 +1,36 @@
|
||||
diff -up bash-4.1/builtins.h.requires bash-4.1/builtins.h
|
||||
--- bash-4.1/builtins.h.requires 2009-01-04 20:32:23.000000000 +0100
|
||||
+++ bash-4.1/builtins.h 2010-08-02 17:42:41.000000000 +0200
|
||||
@@ -41,6 +41,8 @@
|
||||
#define SPECIAL_BUILTIN 0x08 /* This is a Posix `special' builtin. */
|
||||
diff --git a/builtins.h b/builtins.h
|
||||
index dac95fd..5b7e811 100644
|
||||
--- a/builtins.h
|
||||
+++ b/builtins.h
|
||||
@@ -45,6 +45,7 @@
|
||||
#define ASSIGNMENT_BUILTIN 0x10 /* This builtin takes assignment statements. */
|
||||
#define POSIX_BUILTIN 0x20 /* This builtins is special in the Posix command search order. */
|
||||
+#define REQUIRES_BUILTIN 0x40 /* This builtin requires other files. */
|
||||
+
|
||||
#define LOCALVAR_BUILTIN 0x40 /* This builtin creates local variables */
|
||||
+#define REQUIRES_BUILTIN 0x80 /* This builtin requires other files. */
|
||||
|
||||
#define BASE_INDENT 4
|
||||
|
||||
diff -up bash-4.1/builtins/mkbuiltins.c.requires bash-4.1/builtins/mkbuiltins.c
|
||||
--- bash-4.1/builtins/mkbuiltins.c.requires 2009-01-04 20:32:23.000000000 +0100
|
||||
+++ bash-4.1/builtins/mkbuiltins.c 2010-08-02 17:42:41.000000000 +0200
|
||||
@@ -69,9 +69,15 @@ extern char *strcpy ();
|
||||
diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c
|
||||
index e243021..0a7a0e5 100644
|
||||
--- a/builtins/mkbuiltins.c
|
||||
+++ b/builtins/mkbuiltins.c
|
||||
@@ -69,10 +69,15 @@ extern char *strcpy ();
|
||||
#define whitespace(c) (((c) == ' ') || ((c) == '\t'))
|
||||
|
||||
/* Flag values that builtins can have. */
|
||||
+/* These flags are for the C code generator,
|
||||
+/* These flags are for the C code generator,
|
||||
+ the C which is produced (./builtin.c)
|
||||
+ includes the flags definitions found
|
||||
+ includes the flags definitions found
|
||||
+ in ../builtins.h */
|
||||
#define BUILTIN_FLAG_SPECIAL 0x01
|
||||
#define BUILTIN_FLAG_ASSIGNMENT 0x02
|
||||
#define BUILTIN_FLAG_POSIX_BUILTIN 0x04
|
||||
+#define BUILTIN_FLAG_REQUIRES 0x08
|
||||
+
|
||||
#define BUILTIN_FLAG_LOCALVAR 0x04
|
||||
#define BUILTIN_FLAG_POSIX_BUILTIN 0x08
|
||||
+#define BUILTIN_FLAG_REQUIRES 0x10
|
||||
|
||||
#define BASE_INDENT 4
|
||||
|
||||
@@ -163,10 +169,18 @@ char *posix_builtins[] =
|
||||
@@ -173,11 +178,19 @@ char *posix_builtins[] =
|
||||
(char *)NULL
|
||||
};
|
||||
|
||||
@@ -43,36 +44,37 @@ diff -up bash-4.1/builtins/mkbuiltins.c.requires bash-4.1/builtins/mkbuiltins.c
|
||||
/* Forward declarations. */
|
||||
static int is_special_builtin ();
|
||||
static int is_assignment_builtin ();
|
||||
static int is_localvar_builtin ();
|
||||
static int is_posix_builtin ();
|
||||
+static int is_requires_builtin ();
|
||||
|
||||
#if !defined (HAVE_RENAME)
|
||||
static int rename ();
|
||||
@@ -812,6 +826,9 @@ builtin_handler (self, defs, arg)
|
||||
new->flags |= BUILTIN_FLAG_ASSIGNMENT;
|
||||
@@ -831,6 +844,8 @@ builtin_handler (self, defs, arg)
|
||||
new->flags |= BUILTIN_FLAG_LOCALVAR;
|
||||
if (is_posix_builtin (name))
|
||||
new->flags |= BUILTIN_FLAG_POSIX_BUILTIN;
|
||||
+ if (is_requires_builtin (name))
|
||||
+ new->flags |= BUILTIN_FLAG_REQUIRES;
|
||||
+
|
||||
|
||||
array_add ((char *)new, defs->builtins);
|
||||
building_builtin = 1;
|
||||
@@ -1229,11 +1246,12 @@ write_builtins (defs, structfile, extern
|
||||
@@ -1250,12 +1265,13 @@ write_builtins (defs, structfile, externfile)
|
||||
else
|
||||
fprintf (structfile, "(sh_builtin_func_t *)0x0, ");
|
||||
|
||||
- fprintf (structfile, "%s%s%s%s, %s_doc,\n",
|
||||
+ fprintf (structfile, "%s%s%s%s%s, %s_doc,\n",
|
||||
- fprintf (structfile, "%s%s%s%s%s, %s_doc,\n",
|
||||
+ fprintf (structfile, "%s%s%s%s%s%s, %s_doc,\n",
|
||||
"BUILTIN_ENABLED | STATIC_BUILTIN",
|
||||
(builtin->flags & BUILTIN_FLAG_SPECIAL) ? " | SPECIAL_BUILTIN" : "",
|
||||
(builtin->flags & BUILTIN_FLAG_ASSIGNMENT) ? " | ASSIGNMENT_BUILTIN" : "",
|
||||
(builtin->flags & BUILTIN_FLAG_LOCALVAR) ? " | LOCALVAR_BUILTIN" : "",
|
||||
(builtin->flags & BUILTIN_FLAG_POSIX_BUILTIN) ? " | POSIX_BUILTIN" : "",
|
||||
+ (builtin->flags & BUILTIN_FLAG_REQUIRES) ? " | REQUIRES_BUILTIN" : "",
|
||||
document_name (builtin));
|
||||
|
||||
if (inhibit_functions)
|
||||
@@ -1581,6 +1599,13 @@ is_posix_builtin (name)
|
||||
/* Don't translate short document summaries that are identical
|
||||
@@ -1645,6 +1661,13 @@ is_posix_builtin (name)
|
||||
return (_find_in_table (name, posix_builtins));
|
||||
}
|
||||
|
||||
@@ -86,15 +88,16 @@ diff -up bash-4.1/builtins/mkbuiltins.c.requires bash-4.1/builtins/mkbuiltins.c
|
||||
#if !defined (HAVE_RENAME)
|
||||
static int
|
||||
rename (from, to)
|
||||
diff -up bash-4.1/doc/bash.1.requires bash-4.1/doc/bash.1
|
||||
--- bash-4.1/doc/bash.1.requires 2010-08-02 17:42:41.000000000 +0200
|
||||
+++ bash-4.1/doc/bash.1 2010-08-02 18:09:27.000000000 +0200
|
||||
@@ -231,6 +231,14 @@ The shell becomes restricted (see
|
||||
diff --git a/doc/bash.1 b/doc/bash.1
|
||||
index 5af7d42..7539368 100644
|
||||
--- a/doc/bash.1
|
||||
+++ b/doc/bash.1
|
||||
@@ -239,6 +239,14 @@ The shell becomes restricted (see
|
||||
.B "RESTRICTED SHELL"
|
||||
below).
|
||||
.TP
|
||||
+.B \-\-rpm-requires
|
||||
+Produce the list of files that are required for the
|
||||
+Produce the list of files that are required for the
|
||||
+shell script to run. This implies '-n' and is subject
|
||||
+to the same limitations as compile time error checking checking;
|
||||
+Command substitutions, Conditional expressions and
|
||||
@@ -102,17 +105,18 @@ diff -up bash-4.1/doc/bash.1.requires bash-4.1/doc/bash.1
|
||||
+builtin are not parsed so some dependencies may be missed.
|
||||
+.TP
|
||||
.B \-\-verbose
|
||||
Equivalent to \fB\-v\fP.
|
||||
Equivalent to \fB\-v\fP.
|
||||
.TP
|
||||
diff -up bash-4.1/doc/bashref.texi.requires bash-4.1/doc/bashref.texi
|
||||
--- bash-4.1/doc/bashref.texi.requires 2010-08-02 17:42:41.000000000 +0200
|
||||
+++ bash-4.1/doc/bashref.texi 2010-08-02 18:11:58.000000000 +0200
|
||||
@@ -5343,6 +5343,13 @@ standard. @xref{Bash POSIX Mode}, for a
|
||||
diff --git a/doc/bashref.texi b/doc/bashref.texi
|
||||
index 9e23f58..d02151e 100644
|
||||
--- a/doc/bashref.texi
|
||||
+++ b/doc/bashref.texi
|
||||
@@ -6554,6 +6554,13 @@ standard. @xref{Bash POSIX Mode}, for a description of the Bash
|
||||
@item --restricted
|
||||
Make the shell a restricted shell (@pxref{The Restricted Shell}).
|
||||
|
||||
+@item --rpm-requires
|
||||
+Produce the list of files that are required for the
|
||||
+Produce the list of files that are required for the
|
||||
+shell script to run. This implies '-n' and is subject
|
||||
+to the same limitations as compile time error checking checking;
|
||||
+Command substitutions, Conditional expressions and @command{eval}
|
||||
@@ -121,30 +125,25 @@ diff -up bash-4.1/doc/bashref.texi.requires bash-4.1/doc/bashref.texi
|
||||
@item --verbose
|
||||
Equivalent to @option{-v}. Print shell input lines as they're read.
|
||||
|
||||
diff -up bash-4.1/eval.c.requires bash-4.1/eval.c
|
||||
--- bash-4.1/eval.c.requires 2009-01-04 20:32:26.000000000 +0100
|
||||
+++ bash-4.1/eval.c 2010-08-02 17:42:41.000000000 +0200
|
||||
@@ -53,6 +53,7 @@ extern int last_command_exit_value, stdi
|
||||
extern int need_here_doc;
|
||||
extern int current_command_number, current_command_line_count, line_number;
|
||||
extern int expand_aliases;
|
||||
+extern int rpm_requires;
|
||||
|
||||
#if defined (HAVE_POSIX_SIGNALS)
|
||||
extern sigset_t top_level_mask;
|
||||
@@ -136,7 +137,7 @@ reader_loop ()
|
||||
diff --git a/eval.c b/eval.c
|
||||
index 1d967da..f197033 100644
|
||||
--- a/eval.c
|
||||
+++ b/eval.c
|
||||
@@ -137,7 +137,8 @@ reader_loop ()
|
||||
|
||||
if (read_command () == 0)
|
||||
{
|
||||
- if (interactive_shell == 0 && read_but_dont_execute)
|
||||
+
|
||||
+ if (interactive_shell == 0 && (read_but_dont_execute && !rpm_requires))
|
||||
{
|
||||
last_command_exit_value = EXECUTION_SUCCESS;
|
||||
set_exit_status (EXECUTION_SUCCESS);
|
||||
dispose_command (global_command);
|
||||
diff -up bash-4.1/execute_cmd.c.requires bash-4.1/execute_cmd.c
|
||||
--- bash-4.1/execute_cmd.c.requires 2010-08-02 17:42:41.000000000 +0200
|
||||
+++ bash-4.1/execute_cmd.c 2010-08-02 17:42:41.000000000 +0200
|
||||
@@ -503,6 +503,8 @@ async_redirect_stdin ()
|
||||
diff --git a/execute_cmd.c b/execute_cmd.c
|
||||
index d2555ad..397e283 100644
|
||||
--- a/execute_cmd.c
|
||||
+++ b/execute_cmd.c
|
||||
@@ -543,6 +543,8 @@ async_redirect_stdin ()
|
||||
|
||||
#define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0)
|
||||
|
||||
@@ -152,8 +151,8 @@ diff -up bash-4.1/execute_cmd.c.requires bash-4.1/execute_cmd.c
|
||||
+
|
||||
/* Execute the command passed in COMMAND, perhaps doing it asynchronously.
|
||||
COMMAND is exactly what read_command () places into GLOBAL_COMMAND.
|
||||
ASYNCHROUNOUS, if non-zero, says to do this command in the background.
|
||||
@@ -534,7 +536,13 @@ execute_command_internal (command, async
|
||||
ASYNCHRONOUS, if non-zero, says to do this command in the background.
|
||||
@@ -574,7 +576,13 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
|
||||
|
||||
if (breaking || continuing)
|
||||
return (last_command_exit_value);
|
||||
@@ -163,63 +162,48 @@ diff -up bash-4.1/execute_cmd.c.requires bash-4.1/execute_cmd.c
|
||||
+ if (rpm_requires && command->type == cm_function_def)
|
||||
+ return last_command_exit_value =
|
||||
+ execute_intern_function (command->value.Function_def->name,
|
||||
+ command->value.Function_def->command);
|
||||
+ command->value.Function_def);
|
||||
+ if (read_but_dont_execute)
|
||||
return (EXECUTION_SUCCESS);
|
||||
|
||||
QUIT;
|
||||
@@ -5066,7 +5074,7 @@ execute_intern_function (name, function)
|
||||
|
||||
if (check_identifier (name, posixly_correct) == 0)
|
||||
@@ -2836,7 +2844,7 @@ execute_for_command (for_command)
|
||||
save_line_number = line_number;
|
||||
if (check_identifier (for_command->name, 1) == 0)
|
||||
{
|
||||
- if (posixly_correct && interactive_shell == 0)
|
||||
+ if (posixly_correct && interactive_shell == 0 && rpm_requires == 0)
|
||||
{
|
||||
last_command_exit_value = EX_BADUSAGE;
|
||||
jump_to_top_level (ERREXIT);
|
||||
diff -up bash-4.1/execute_cmd.h.requires bash-4.1/execute_cmd.h
|
||||
--- bash-4.1/execute_cmd.h.requires 2009-01-16 22:20:15.000000000 +0100
|
||||
+++ bash-4.1/execute_cmd.h 2010-08-02 17:42:41.000000000 +0200
|
||||
@@ -22,6 +22,8 @@
|
||||
diff --git a/execute_cmd.h b/execute_cmd.h
|
||||
index 465030a..9c7fd1c 100644
|
||||
--- a/execute_cmd.h
|
||||
+++ b/execute_cmd.h
|
||||
@@ -22,6 +22,9 @@
|
||||
#define _EXECUTE_CMD_H_
|
||||
|
||||
#include "stdc.h"
|
||||
+#include "variables.h"
|
||||
+#include "command.h"
|
||||
+
|
||||
|
||||
extern struct fd_bitmap *new_fd_bitmap __P((int));
|
||||
extern void dispose_fd_bitmap __P((struct fd_bitmap *));
|
||||
diff -up bash-4.1/make_cmd.c.requires bash-4.1/make_cmd.c
|
||||
--- bash-4.1/make_cmd.c.requires 2009-09-11 23:26:12.000000000 +0200
|
||||
+++ bash-4.1/make_cmd.c 2010-08-02 17:42:41.000000000 +0200
|
||||
@@ -42,11 +42,15 @@
|
||||
#include "flags.h"
|
||||
#include "make_cmd.h"
|
||||
#include "dispose_cmd.h"
|
||||
+#include "execute_cmd.h"
|
||||
#include "variables.h"
|
||||
#include "subst.h"
|
||||
#include "input.h"
|
||||
#include "ocache.h"
|
||||
#include "externs.h"
|
||||
#if defined (ARRAY_VARS)
|
||||
struct func_array_state
|
||||
diff --git a/make_cmd.c b/make_cmd.c
|
||||
index 2d7ac96..ac53526 100644
|
||||
--- a/make_cmd.c
|
||||
+++ b/make_cmd.c
|
||||
@@ -35,6 +35,8 @@
|
||||
#include "bashintl.h"
|
||||
|
||||
#include "shell.h"
|
||||
+#include "builtins.h"
|
||||
+
|
||||
+#include "builtins/common.h"
|
||||
|
||||
#if defined (JOB_CONTROL)
|
||||
#include "jobs.h"
|
||||
@@ -56,6 +60,10 @@
|
||||
|
||||
extern int line_number, current_command_line_count, parser_state;
|
||||
extern int last_command_exit_value;
|
||||
+extern int rpm_requires;
|
||||
+
|
||||
+static char *alphabet_set = "abcdefghijklmnopqrstuvwxyz"
|
||||
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
||||
/* Object caching */
|
||||
sh_obj_cache_t wdcache = {0, 0, 0};
|
||||
@@ -820,6 +828,27 @@ make_coproc_command (name, command)
|
||||
#include "execute_cmd.h"
|
||||
#include "parser.h"
|
||||
#include "flags.h"
|
||||
@@ -828,6 +830,30 @@ make_coproc_command (name, command)
|
||||
return (make_command (cm_coproc, (SIMPLE_COM *)temp));
|
||||
}
|
||||
|
||||
@@ -228,12 +212,15 @@ diff -up bash-4.1/make_cmd.c.requires bash-4.1/make_cmd.c
|
||||
+const char *deptype;
|
||||
+char *filename;
|
||||
+{
|
||||
+ static char *alphabet_set = "abcdefghijklmnopqrstuvwxyz"
|
||||
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
+
|
||||
+ if (strchr(filename, '$') || (filename[0] != '/' && strchr(filename, '/')))
|
||||
+ return;
|
||||
+
|
||||
+ /*
|
||||
+ /*
|
||||
+ if the executable is called via variable substitution we can
|
||||
+ not dermine what it is at compile time.
|
||||
+ not dermine what it is at compile time.
|
||||
+
|
||||
+ if the executable consists only of characters not in the
|
||||
+ alphabet we do not consider it a dependency just an artifact
|
||||
@@ -247,7 +234,7 @@ diff -up bash-4.1/make_cmd.c.requires bash-4.1/make_cmd.c
|
||||
/* Reverse the word list and redirection list in the simple command
|
||||
has just been parsed. It seems simpler to do this here the one
|
||||
time then by any other method that I can think of. */
|
||||
@@ -837,6 +866,27 @@ clean_simple_command (command)
|
||||
@@ -845,6 +871,28 @@ clean_simple_command (command)
|
||||
REVERSE_LIST (command->value.Simple->redirects, REDIRECT *);
|
||||
}
|
||||
|
||||
@@ -271,16 +258,18 @@ diff -up bash-4.1/make_cmd.c.requires bash-4.1/make_cmd.c
|
||||
+ output_requirement (find_function(cmd0) ? "function" : "executable", cmd0);
|
||||
+ }
|
||||
+ } /*rpm_requires*/
|
||||
+
|
||||
+
|
||||
parser_state &= ~PST_REDIRLIST;
|
||||
return (command);
|
||||
}
|
||||
diff -up bash-4.1/shell.c.requires bash-4.1/shell.c
|
||||
--- bash-4.1/shell.c.requires 2010-08-02 17:42:41.000000000 +0200
|
||||
+++ bash-4.1/shell.c 2010-08-02 17:42:41.000000000 +0200
|
||||
@@ -193,6 +193,9 @@ int have_devfd = 0;
|
||||
diff --git a/shell.c b/shell.c
|
||||
index ce8087f..7dcd000 100644
|
||||
--- a/shell.c
|
||||
+++ b/shell.c
|
||||
@@ -194,6 +194,9 @@ int have_devfd = 0;
|
||||
/* The name of the .(shell)rc file. */
|
||||
static char *bashrc_file = "~/.bashrc";
|
||||
static char *bashrc_file = DEFAULT_BASHRC;
|
||||
|
||||
+/* Non-zero if we are finding the scripts requirements. */
|
||||
+int rpm_requires;
|
||||
@@ -288,7 +277,7 @@ diff -up bash-4.1/shell.c.requires bash-4.1/shell.c
|
||||
/* Non-zero means to act more like the Bourne shell on startup. */
|
||||
static int act_like_sh;
|
||||
|
||||
@@ -251,6 +254,7 @@ static const struct {
|
||||
@@ -260,6 +263,7 @@ static const struct {
|
||||
{ "protected", Int, &protected_mode, (char **)0x0 },
|
||||
#endif
|
||||
{ "rcfile", Charp, (int *)0x0, &bashrc_file },
|
||||
@@ -296,7 +285,7 @@ diff -up bash-4.1/shell.c.requires bash-4.1/shell.c
|
||||
#if defined (RESTRICTED_SHELL)
|
||||
{ "restricted", Int, &restricted, (char **)0x0 },
|
||||
#endif
|
||||
@@ -485,6 +489,12 @@ main (argc, argv, env)
|
||||
@@ -502,6 +506,12 @@ main (argc, argv, env)
|
||||
if (dump_translatable_strings)
|
||||
read_but_dont_execute = 1;
|
||||
|
||||
@@ -309,3 +298,15 @@ diff -up bash-4.1/shell.c.requires bash-4.1/shell.c
|
||||
if (running_setuid && privileged_mode == 0)
|
||||
disable_priv_mode ();
|
||||
|
||||
diff --git a/shell.h b/shell.h
|
||||
index 8b41792..29b0efb 100644
|
||||
--- a/shell.h
|
||||
+++ b/shell.h
|
||||
@@ -99,6 +99,7 @@ extern int interactive, interactive_shell;
|
||||
extern int startup_state;
|
||||
extern int reading_shell_script;
|
||||
extern int shell_initialized;
|
||||
+extern int rpm_requires;
|
||||
extern int bash_argv_initialized;
|
||||
extern int subshell_environment;
|
||||
extern int current_command_number;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
diff -up bash-4.2-rc2/tests/exec.right.tty_tests bash-4.2-rc2/tests/exec.right
|
||||
--- bash-4.2-rc2/tests/exec.right.tty_tests 2011-02-09 10:42:48.000000000 +0100
|
||||
+++ bash-4.2-rc2/tests/exec.right 2011-02-09 10:42:59.000000000 +0100
|
||||
@@ -50,7 +50,6 @@ this is ohio-state
|
||||
diff --git a/tests/exec.right b/tests/exec.right
|
||||
index 0a249dd..fe8a127 100644
|
||||
--- a/tests/exec.right
|
||||
+++ b/tests/exec.right
|
||||
@@ -51,7 +51,6 @@ this is ohio-state
|
||||
0
|
||||
1
|
||||
testb
|
||||
@@ -9,21 +10,23 @@ diff -up bash-4.2-rc2/tests/exec.right.tty_tests bash-4.2-rc2/tests/exec.right
|
||||
1
|
||||
1
|
||||
1
|
||||
diff -up bash-4.2-rc2/tests/execscript.tty_tests bash-4.2-rc2/tests/execscript
|
||||
--- bash-4.2-rc2/tests/execscript.tty_tests 2010-12-27 22:01:02.000000000 +0100
|
||||
+++ bash-4.2-rc2/tests/execscript 2011-02-09 10:42:34.000000000 +0100
|
||||
@@ -107,8 +107,6 @@ ${THIS_SH} ./exec6.sub
|
||||
diff --git a/tests/execscript b/tests/execscript
|
||||
index 2809676..1216828 100644
|
||||
--- a/tests/execscript
|
||||
+++ b/tests/execscript
|
||||
@@ -108,8 +108,6 @@ ${THIS_SH} ./exec6.sub
|
||||
# checks for properly deciding what constitutes an executable file
|
||||
${THIS_SH} ./exec7.sub
|
||||
|
||||
-${THIS_SH} -i ./exec8.sub
|
||||
-${THIS_SH} -i ${PWD}/exec8.sub
|
||||
-
|
||||
${THIS_SH} ./exec9.sub
|
||||
|
||||
true | `echo true` &
|
||||
diff -up bash-4.2-rc2/tests/read.right.tty_tests bash-4.2-rc2/tests/read.right
|
||||
--- bash-4.2-rc2/tests/read.right.tty_tests 2010-12-21 16:49:00.000000000 +0100
|
||||
+++ bash-4.2-rc2/tests/read.right 2011-02-09 10:42:34.000000000 +0100
|
||||
${THIS_SH} ./exec10.sub
|
||||
diff --git a/tests/read.right b/tests/read.right
|
||||
index 1144083..09cd422 100644
|
||||
--- a/tests/read.right
|
||||
+++ b/tests/read.right
|
||||
@@ -33,14 +33,6 @@ a = abcdefg
|
||||
a = xyz
|
||||
a = -xyz 123-
|
||||
@@ -32,17 +35,18 @@ diff -up bash-4.2-rc2/tests/read.right.tty_tests bash-4.2-rc2/tests/read.right
|
||||
-
|
||||
-timeout 2: ok
|
||||
-
|
||||
-./read2.sub: line 23: read: -3: invalid timeout specification
|
||||
-./read2.sub: line 36: read: -3: invalid timeout specification
|
||||
-1
|
||||
-
|
||||
-abcde
|
||||
./read3.sub: line 4: read: -1: invalid number
|
||||
./read3.sub: line 17: read: -1: invalid number
|
||||
abc
|
||||
ab
|
||||
diff -up bash-4.2-rc2/tests/read.tests.tty_tests bash-4.2-rc2/tests/read.tests
|
||||
--- bash-4.2-rc2/tests/read.tests.tty_tests 2008-09-06 19:09:11.000000000 +0200
|
||||
+++ bash-4.2-rc2/tests/read.tests 2011-02-09 10:42:34.000000000 +0100
|
||||
@@ -82,9 +82,6 @@ echo " foo" | { IFS=$':' ; read line; re
|
||||
diff --git a/tests/read.tests b/tests/read.tests
|
||||
index 7384f05..43fcf8d 100644
|
||||
--- a/tests/read.tests
|
||||
+++ b/tests/read.tests
|
||||
@@ -95,9 +95,6 @@ echo " foo" | { IFS=$':' ; read line; recho "$line"; }
|
||||
# test read -d delim behavior
|
||||
${THIS_SH} ./read1.sub
|
||||
|
||||
|
||||
+11
-16
@@ -29,33 +29,28 @@
|
||||
<Patch>official/bash51-008.patch</Patch>
|
||||
|
||||
<!-- Fedora patches -->
|
||||
<Patch level="1">fedora/bash-2.02-security.patch</Patch>
|
||||
<Patch level="1">fedora/bash-2.03-paths.patch</Patch>
|
||||
<Patch level="1">fedora/bash-2.03-profile.patch</Patch>
|
||||
<!-- <Patch level="1">fedora/bash-2.05a-interpreter.patch</Patch> -->
|
||||
<Patch level="1">fedora/bash-2.05a-interpreter.patch</Patch>
|
||||
<Patch level="1">fedora/bash-2.05b-debuginfo.patch</Patch>
|
||||
<Patch level="1">fedora/bash-2.05b-manso.patch</Patch>
|
||||
<Patch level="1">fedora/bash-2.05b-pgrp_sync.patch</Patch>
|
||||
<!-- <Patch level="1">fedora/bash-2.05b-xcc.patch</Patch> -->
|
||||
<Patch level="1">fedora/bash-3.2-audit.patch</Patch>
|
||||
<Patch level="1">fedora/bash-3.2-ssh_source_bash.patch</Patch>
|
||||
<!--Patch level="1">fedora/bash-bashbug.patch</Patch>
|
||||
<Patch level="1">fedora/bash-infotags.patch</Patch>
|
||||
<Patch level="1">fedora/bash-requires.patch</Patch-->
|
||||
<Patch level="1">fedora/bash-setlocale.patch</Patch>
|
||||
<!-- <Patch level="1">fedora/bash-tty-tests.patch</Patch> -->
|
||||
<!-- <Patch level="1">fedora/bash-4.0-nobits.patch</Patch> -->
|
||||
<Patch level="1">fedora/bash-4.1-examples.patch</Patch>
|
||||
<Patch level="1">fedora/bash-4.0-nobits.patch</Patch>
|
||||
<Patch level="1">fedora/bash-4.1-broken_pipe.patch</Patch>
|
||||
<Patch level="1">fedora/bash-4.2-rc2-logout.patch</Patch>
|
||||
<!-- <Patch level="1">fedora/bash-4.2-coverity.patch</Patch> -->
|
||||
<Patch level="1">fedora/bash-4.1-defer-sigchld-trap.patch</Patch>
|
||||
<Patch level="1">fedora/bash-4.1-examples.patch</Patch>
|
||||
<Patch level="1">fedora/bash-4.2-coverity.patch</Patch>
|
||||
<Patch level="1">fedora/bash-4.2-manpage_trap.patch</Patch>
|
||||
<Patch level="1">fedora/bash-4.2-rc2-logout.patch</Patch>
|
||||
<Patch level="1">fedora/bash-4.2-size_type.patch</Patch>
|
||||
<Patch level="1">fedora/bash-4.3-man-ulimit.patch</Patch>
|
||||
<!-- <Patch level="1">fedora/bash-4.3-noecho.patch</Patch> -->
|
||||
<!-- <Patch level="1">fedora/bash-4.3-memleak-lc_all.patch</Patch> -->
|
||||
<Patch level="1">fedora/bash-4.3-memleak-lc_all.patch</Patch>
|
||||
<Patch level="1">fedora/bash-4.3-noecho.patch</Patch>
|
||||
<Patch level="1">fedora/bash-4.4-no-loadable-builtins.patch</Patch>
|
||||
<Patch level="1">fedora/bash-infotags.patch</Patch>
|
||||
<Patch level="1">fedora/bash-requires.patch</Patch>
|
||||
<Patch level="1">fedora/bash-setlocale.patch</Patch>
|
||||
<Patch level="1">fedora/bash-tty-tests.patch</Patch>
|
||||
|
||||
</Patches>
|
||||
</Source>
|
||||
|
||||
Reference in New Issue
Block a user