#define SEVAL_NOLONGJMP 0x040
/* Flags for describe_command, shared between type.def and command.def */
+#define SEVAL_FUNCDEF 0x080 /* only allow function definitions */
+#define SEVAL_ONECMD 0x100 /* only allow a single command */
#define CDESC_ALL 0x001 /* type -a */
#define CDESC_SHORTDESC 0x002 /* command -V */
#define CDESC_REUSABLE 0x004 /* command -v */
{
struct fd_bitmap *bitmap;
+ if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def)
+ {
+ internal_warning ("%s: ignoring function definition attempt", from_file);
+ should_jump_to_top_level = 0;
+ last_result = last_command_exit_value = EX_BADUSAGE;
+ break;
+ }
+
bitmap = new_fd_bitmap (FD_BITMAP_SIZE);
begin_unwind_frame ("pe_dispose");
add_unwind_protect (dispose_fd_bitmap, bitmap);
dispose_command (command);
dispose_fd_bitmap (bitmap);
discard_unwind_frame ("pe_dispose");
+
+ if (flags & SEVAL_ONECMD)
+ break;
}
}
else
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+ <assign>
+ <filesystem path="/bin/*" exec_label="none" />
+ </assign>
+</manifest>
Version: 4.1
Name: bash
Summary: The GNU Bourne Again shell
-Release: 1
+Release: 3
Group: System/Shells
-License: GPLv2+
+License: GPL-3.0+
Url: http://www.gnu.org/software/bash
Source0: ftp://ftp.gnu.org/gnu/bash/%{name}-%{version}.tar.gz
+Source1001: %{name}.manifest
# SLP patches
Patch0: bash41-001.patch
%patch12 -p1 -b .builtins-declare-fix
%build
+cp %{SOURCE1001} .
autoconf
%configure --enable-largefile --without-bash-malloc --disable-nls
# Recycles pids is neccessary. When bash's last fork's pid was X
# and new fork's pid is also X, bash has to wait for this same pid.
# Without Recycles pids bash will not wait.
-make "CPPFLAGS=-D_GNU_SOURCE -DRECYCLES_PIDS `getconf LFS_CFLAGS`"
-%check
-make check
+make %{?_smp_mflags} "CPPFLAGS=-D_GNU_SOURCE -DRECYCLES_PIDS `getconf LFS_CFLAGS`"
%install
rm -rf $RPM_BUILD_ROOT
rm -rf %{buildroot}%{_bindir}/bashbug-*
chmod a-x doc/*.sh
+mkdir -p $RPM_BUILD_ROOT%{_datadir}/license
+for keyword in LICENSE COPYING COPYRIGHT;
+do
+ for file in `find %{_builddir} -name $keyword`;
+ do
+ cat $file >> $RPM_BUILD_ROOT%{_datadir}/license/%{name};
+ echo "";
+ done;
+done
+
%clean
rm -rf $RPM_BUILD_ROOT
%post -p <lua>
bashfound = false;
shfound = false;
-
+
f = io.open("/etc/shells", "r");
if f == nil
then
until t == nil;
end
f:close()
-
+
f = io.open("/etc/shells", "a");
if not bashfound
then
%docs_package
-%files
+%files
+%manifest %{name}.manifest
+%{_datadir}/license/%{name}
/bin/sh
/bin/bash
-
temp_string[char_index] = ' ';
strcpy (temp_string + char_index + 1, string);
- parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST);
-
- /* Ancient backwards compatibility. Old versions of bash exported
- functions like name()=() {...} */
- if (name[char_index - 1] == ')' && name[char_index - 2] == '(')
- name[char_index - 2] = '\0';
+ /* Don't import function names that are invalid identifiers from the
+ environment. */
+ if (legal_identifier (name))
+ parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD);
if (temp_var = find_function (name))
{
}
else
report_error (_("error importing function definition for `%s'"), name);
-
- /* ( */
- if (name[char_index - 1] == ')' && name[char_index - 2] == '\0')
- name[char_index - 2] = '('; /* ) */
}
#if defined (ARRAY_VARS)
# if 0