Sync from SUSE:SLFO:Main expect revision d133883c7888ff90e2711b29193814da

This commit is contained in:
Adrian Schröter 2024-05-03 12:23:42 +02:00
commit 6c9d7c9aed
11 changed files with 3337 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
--- exp_clib.c.orig
+++ exp_clib.c
@@ -1938,8 +1938,8 @@
char *str;
{
if (exp_is_debugging) {
- fprintf(stderr,str);
- if (exp_logfile) fprintf(exp_logfile,str);
+ fprintf(stderr, "%s", str);
+ if (exp_logfile) fprintf(exp_logfile, "%s", str);
}
}

44
expect-errorfd.patch Normal file
View File

@ -0,0 +1,44 @@
Index: exp_clib.c
==================================================================
--- exp_clib.c
+++ exp_clib.c
@@ -2043,11 +2043,16 @@
#endif /* SYSV3 */
#endif /* DO_SETSID */
/* save error fd while we're setting up new one */
+#ifdef F_DUPFD_CLOEXEC
+ errorfd = fcntl(2,F_DUPFD_CLOEXEC,3);
+#else
errorfd = fcntl(2,F_DUPFD,3);
+ fcntl(errorfd, F_SETFD, FD_CLOEXEC);
+#endif /* F_DUPFD_CLOXEC */
/* and here is the macro to restore it */
#define restore_error_fd {close(2);fcntl(errorfd,F_DUPFD,2);}
if (exp_autoallocpty) {
Index: exp_command.c
==================================================================
--- exp_command.c
+++ exp_command.c
@@ -1159,11 +1159,16 @@
/* save stderr elsewhere to avoid BSD4.4 bogosity that warns */
/* if stty finds dev(stderr) != dev(stdout) */
/* save error fd while we're setting up new one */
+#ifdef F_DUPFD_CLOEXEC
+ errorfd = fcntl(2,F_DUPFD_CLOEXEC,3);
+#else
errorfd = fcntl(2,F_DUPFD,3);
+ fcntl(errorfd, F_SETFD, FD_CLOEXEC);
+#endif /* F_DUPFD_CLOXEC */
/* and here is the macro to restore it */
#define restore_error_fd {close(2);fcntl(errorfd,F_DUPFD,2);}
close(0);
close(1);

91
expect-fixes.patch Normal file
View File

@ -0,0 +1,91 @@
Index: exp_clib.c
===================================================================
--- exp_clib.c.orig
+++ exp_clib.c
@@ -9,6 +9,7 @@ would appreciate credit if this program
#include "expect_cf.h"
#include <stdio.h>
+#include <unistd.h>
#include <setjmp.h>
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
Index: exp_trap.c
===================================================================
--- exp_trap.c.orig
+++ exp_trap.c
@@ -13,6 +13,7 @@ would appreciate credit if this program
#include <stdio.h>
#include <signal.h>
#include <sys/types.h>
+#include <string.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
Index: exp_win.c
===================================================================
--- exp_win.c.orig
+++ exp_win.c
@@ -78,7 +78,7 @@ typedef struct {
static exp_winsize winsize = {0, 0};
static exp_winsize win2size = {0, 0};
-int exp_window_size_set(fd)
+void exp_window_size_set(fd)
int fd;
{
#ifdef TIOCSWINSZ
@@ -89,7 +89,7 @@ int fd;
#endif
}
-int exp_window_size_get(fd)
+void exp_window_size_get(fd)
int fd;
{
#ifdef TIOCGWINSZ
@@ -142,7 +142,7 @@ exp_win_columns_get()
* separate copy of everything above - used for handling user stty requests
*/
-int exp_win2_size_set(fd)
+void exp_win2_size_set(fd)
int fd;
{
#ifdef TIOCSWINSZ
@@ -153,7 +153,7 @@ int fd;
#endif
}
-int exp_win2_size_get(fd)
+void exp_win2_size_get(fd)
int fd;
{
#ifdef TIOCGWINSZ
Index: exp_win.h
===================================================================
--- exp_win.h.orig
+++ exp_win.h
@@ -8,8 +8,8 @@ would appreciate credit if you use this
#include <tcl.h> /* For _ANSI_ARGS_ */
-int exp_window_size_set();
-int exp_window_size_get();
+void exp_window_size_set();
+void exp_window_size_get();
void exp_win_rows_set _ANSI_ARGS_ ((char* rows));
char* exp_win_rows_get _ANSI_ARGS_ ((void));
Index: pty_termios.c
===================================================================
--- pty_termios.c.orig
+++ pty_termios.c
@@ -9,6 +9,7 @@ would appreciate credit if you use this
#include <stdio.h>
#include <signal.h>
+#include <string.h>
#if defined(SIGCLD) && !defined(SIGCHLD)
#define SIGCHLD SIGCLD

20
expect-log.patch Normal file
View File

@ -0,0 +1,20 @@
--- exp_log.c
+++ exp_log.c
@@ -374,7 +374,7 @@ expDiagChannelOpen(interp,filename)
Tcl_DStringAppend(&tsdPtr->diagFilename,filename,-1);
}
- tsdPtr->diagChannel = Tcl_OpenFileChannel(interp,newfilename,"a",0777);
+ tsdPtr->diagChannel = Tcl_OpenFileChannel(interp,newfilename,"a",0666);
if (!tsdPtr->diagChannel) {
Tcl_DStringFree(&tsdPtr->diagFilename);
return TCL_ERROR;
@@ -499,7 +499,7 @@ expLogChannelOpen(interp,filename,append
Tcl_DStringAppend(&tsdPtr->logFilename,filename,-1);
}
- tsdPtr->logChannel = Tcl_OpenFileChannel(interp,newfilename,mode,0777);
+ tsdPtr->logChannel = Tcl_OpenFileChannel(interp,newfilename,mode,0666);
if (!tsdPtr->logChannel) {
Tcl_DStringFree(&tsdPtr->logFilename);
return TCL_ERROR;

3
expect-rpmlintrc Normal file
View File

@ -0,0 +1,3 @@
addFilter("no-soname")
addFilter("files-duplicate")
addFilter("package-with-huge-docs")

282
expect.changes Normal file
View File

@ -0,0 +1,282 @@
-------------------------------------------------------------------
Tue Apr 19 21:54:42 UTC 2022 - Dirk Müller <dmueller@suse.com>
- add expect-5.45-format-security.patch
-------------------------------------------------------------------
Tue Dec 21 15:41:30 UTC 2021 - Ludwig Nussel <lnussel@suse.de>
- Fix home page URL https://core.tcl-lang.org/expect/
-------------------------------------------------------------------
Mon May 10 13:44:24 UTC 2021 - Reinhard Max <max@suse.com>
- bsc#1183904, expect-errorfd.patch:
errorfd file descriptors should be closed when forking
-------------------------------------------------------------------
Tue May 4 11:02:42 UTC 2021 - Matthias Gerstner <matthias.gerstner@suse.com>
- fix previous change regarding PIE linking. Passing SHLIB_CFLAGS="-shared"
causes /usr/bin/expect to become a shared library that SEGFAULTs upon
execution. Instead use SHLIB_LD to pass -shared only to shared library
linking.
-------------------------------------------------------------------
Wed Apr 21 13:13:28 UTC 2021 - Matthias Gerstner <matthias.gerstner@suse.com>
- pass explicit -pie flag to CFLAGS and hack `make` invocation so that
/usr/bin/expect actually becomes a PIE binary. This is especially awkard
since the expect build system implicitly passes -fPIC which breaks our
gcc-PIE package, but does not pass -pie while linking the executable.
Shared libraries are also not linked with -shared so we need to explicitly
pass this, too, to avoid build breakage (bsc#1184122).
-------------------------------------------------------------------
Thu Oct 15 08:18:32 UTC 2020 - Reinhard Max <max@suse.com>
- Add an unversioned symlink to make linking easier for
applications that use libexpect without Tcl (boo#1172681).
-------------------------------------------------------------------
Thu Oct 25 09:10:24 UTC 2018 - Reinhard Max <max@suse.com>
- New version 5.45.4:
* Fix two bugs in EOF handling.
-------------------------------------------------------------------
Wed Nov 8 20:29:35 UTC 2017 - aavindraa@gmail.com
- New version 5.45.3:
* expect.c: On finding a full buffer during matching the sliding
window mechanism slides too far, truncating the whole buffer and
preventing matches across the boundary. Fix is shortening the
slide distance (slide only one 1/3).
* expect.c: Replaced a cc==0 check with proper Tcl_Eof() check.
- Includes changes from 5.45.2:
* configure: Extended Tcl header detection for OS X Mountain Lion.
* expect.c: Replaced memcpy with memmove to properly handle
overlapping memory.
- Includes changes from 5.45.1:
* exp_chan.c: Fix a problem when talking a tty where the writer
dies. Some operating systems report the condition as EIO with
nothing read, while this actually an EOF. Previously, returned
data was incomplete due to the error causing data in buffers to
be dropped.
* exp_chan.c: Fix a problem with the iteration over the expect
channel list where the loop code may modify the list, breaking
the iterator.
* Fixes for exp_chan.c and exp_command.h
* expect.c: Convert #bytes information to #chars to prevent later
code to fail when copying strings around and miscalculating how
much to copy, for strings containing non-ASCII utf chars.
* exp_inter.c: Hack access to TCL_REG_BOSONLY when not present,
became private with Tcl 8.5 and higher.
* expect.h: Remove the local fiddling with the memory allocation
and panic macros.
* example/unbuffer: Prevent unbuffer from swallowing exit code of
the command it ran (regular mode only, not -p)
* Various deduplications and cleanups
- cleanup with spec-cleaner
- use %make_install macro
-------------------------------------------------------------------
Fri Jul 17 09:01:09 UTC 2015 - max@suse.com
- Don't ship the 'weather' example anymore (fate#318342).
-------------------------------------------------------------------
Tue Mar 26 13:12:41 UTC 2013 - mmeister@suse.com
- Added url as source.
Please see http://en.opensuse.org/SourceUrls
-------------------------------------------------------------------
Wed Feb 6 10:49:32 UTC 2013 - schwab@suse.de
- Update config.guess/sub for aarch64
-------------------------------------------------------------------
Sat Apr 14 15:33:53 UTC 2012 - schwab@linux-m68k.org
- Remove execute permission from logfiles
-------------------------------------------------------------------
Tue Dec 20 20:19:12 UTC 2011 - coolo@suse.com
- add autoconf as buildrequire to avoid implicit dependency
-------------------------------------------------------------------
Fri Oct 7 13:15:19 UTC 2011 - max@suse.com
- New version 5.45:
* Examples now use the expect package instead of /usr/bin/expect.
* Countless other bug fixes. For details, see
/usr/share/doc/packages/expect/ChangeLog
-------------------------------------------------------------------
Sun Sep 18 17:17:12 UTC 2011 - jengelh@medozas.de
- Remove redundant/obsolete tags/sections from specfile
(cf. packaging guidelines)
- Use %_smp_mflags for parallel build
-------------------------------------------------------------------
Mon May 25 16:30:18 CEST 2009 - max@suse.de
- Fix buffer overflow in the "stty" command
(bnc#506873, bnc#501291).
-------------------------------------------------------------------
Tue Oct 14 18:31:49 CEST 2008 - max@suse.de
- Update to version 5.44.1.11 from CVS. The changes mainly consist
of our former expect-fixes.patch and expect-warnings.patch, plus
some more bug fixes, e.g. for the [expect -exact] crash reported
at bnc#427270 .
-------------------------------------------------------------------
Tue Oct 14 17:42:41 CEST 2008 - meissner@suse.de
- fixed fortify implicits.
-------------------------------------------------------------------
Tue May 6 21:22:31 CEST 2008 - aj@suse.de
- Add missing return values.
-------------------------------------------------------------------
Thu Apr 3 14:00:24 CEST 2008 - max@suse.de
- Fixed swapped arguments in prototype of exp_cmd_init()
- Adjusted installation to the new Tcl file system layout
-------------------------------------------------------------------
Thu Mar 20 19:13:00 CET 2008 - max@suse.de
- Update to version 5.44.1.5 from CVS:
* Improved internal buffer management
* Ported script-level commands to the newer Tcl object API
* Optimized regular expression matching
- Split off a -devel subpackage
- Don't package the example subdir anymore.
- Fix all critical and part of the non-critical warnings that
show up with gcc 4.3. To be continued...
-------------------------------------------------------------------
Wed Jan 25 21:30:10 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Tue Dec 13 15:41:15 CET 2005 - max@suse.de
- Fixed a typo in tcl.m4 that broke configure with bash 3.1.
- Updated expect-CVS.patch.bz2 .
-------------------------------------------------------------------
Fri Sep 23 01:31:50 CEST 2005 - ro@suse.de
- fix some missing declarations
-------------------------------------------------------------------
Tue Jun 14 15:54:14 CEST 2005 - max@suse.de
- New version: 5.43 plus patch to current CVS head.
- Disabled building of the static library.
- Moved script library to /usr/share/tcl .
-------------------------------------------------------------------
Tue Jul 13 16:58:00 CEST 2004 - max@suse.de
- New version: 5.41.
-------------------------------------------------------------------
Mon Mar 1 15:48:15 CET 2004 - max@suse.de
- Re-enabled the test suite and added expect-send_tty.patch to
prevent it from crashing.
-------------------------------------------------------------------
Fri Feb 27 18:44:33 CET 2004 - max@suse.de
- New version: 5.40
- Fixed warnings that broke build (expect-warnings.patch).
- Temporarily disabled "make test" to prevent crashes in autobuild
on some architectures (ppc, s390).
-------------------------------------------------------------------
Fri Oct 31 17:13:46 CET 2003 - max@suse.de
- New version: 5.39
- Buliding as non-root user
-------------------------------------------------------------------
Wed May 28 00:39:00 CEST 2003 - ro@suse.de
- package include files and static lib as well
-------------------------------------------------------------------
Tue Jan 28 15:27:08 CET 2003 - max@suse.de
- Fixed path to /usr/bin/write in kibitz.
-------------------------------------------------------------------
Fri Jan 10 16:12:49 CET 2003 - max@suse.de
- Fixed a segfault case during application shutdown, and sent
the patch to the author.
-------------------------------------------------------------------
Tue Nov 26 17:27:49 CET 2002 - max@suse.de
- New version: 5.38
- Don't build the expectk binary anymore to remove the buildtime
dependency on Tk and X. Scripts that needed to run in expectk
before can be fixed by running them in expect and adding a line
that says "package require Tk" before the first tk command
is executed.
-------------------------------------------------------------------
Mon Aug 19 08:27:51 CEST 2002 - aj@suse.de
- Read all input from invoked program.
-------------------------------------------------------------------
Wed Apr 3 18:18:19 CEST 2002 - max@suse.de
- Replaced autoreconf by autoconf because it breaks on
autoconf-2.53 and was overkill anyways.
-------------------------------------------------------------------
Wed Feb 20 19:28:39 CET 2002 - max@suse.de
- Fixed for lib64-s390x.
-------------------------------------------------------------------
Thu Jan 24 09:29:01 CET 2002 - max@suse.de
- Removed the mkpasswd manpage due to a file name conflict and
because the respective program is also not included.
-------------------------------------------------------------------
Fri Jan 18 19:10:46 CET 2002 - max@suse.de
- added tk to neededforbuild to prevent linking to static libtk
which is included in tcl-devel
-------------------------------------------------------------------
Fri Jan 18 00:52:40 CET 2002 - ro@suse.de
- fixed neededforbuild
-------------------------------------------------------------------
Thu Jan 17 19:26:42 CET 2002 - max@suse.de
- New version 5.34.
- Separated this package from the tcl source RPM, because it
doesn not any longer need the Tcl and Tk sources at hand.

62
expect.patch Normal file
View File

@ -0,0 +1,62 @@
Index: Makefile.in
===================================================================
--- Makefile.in.orig
+++ Makefile.in
@@ -331,7 +331,7 @@ pkgIndex.tcl:
pkgIndex.tcl-hand:
(echo 'if {![package vsatisfies [package provide Tcl] @TCL_VERSION@]} {return}' ; \
echo 'package ifneeded Expect $(PACKAGE_VERSION) \
- [list load [file join $$dir $(PKG_LIB_FILE)]]'\
+ [list load $(PKG_LIB_FILE)]'\
) > pkgIndex.tcl
#========================================================================
@@ -524,29 +524,30 @@ distclean: clean
#========================================================================
install-lib-binaries:
- @mkdir -p $(DESTDIR)$(pkglibdir)
+ @mkdir -p $(DESTDIR)$(libdir)
@list='$(lib_BINARIES)'; for p in $$list; do \
if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
- $(INSTALL_PROGRAM) $$p $(DESTDIR)$(pkglibdir)/$$p; \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p; \
stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \
if test "x$$stub" = "xstub"; then \
- echo " $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p"; \
- $(RANLIB_STUB) $(DESTDIR)$(pkglibdir)/$$p; \
+ echo " $(RANLIB_STUB) $(DESTDIR)$(libdir)/$$p"; \
+ $(RANLIB_STUB) $(DESTDIR)$(libdir)/$$p; \
else \
- echo " $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p"; \
- $(RANLIB) $(DESTDIR)$(pkglibdir)/$$p; \
+ echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \
+ $(RANLIB) $(DESTDIR)$(libdir)/$$p; \
fi; \
ext=`echo $$p|sed -e "s/.*\.//"`; \
if test "x$$ext" = "xdll"; then \
lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
if test -f $$lib; then \
- echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \
- $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \
+ echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib"; \
+ $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \
fi; \
fi; \
fi; \
done
+ @mkdir -p $(DESTDIR)$(pkglibdir)
@list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
if test -f $(srcdir)/$$p; then \
destp=`basename $$p`; \
@@ -585,7 +586,7 @@ Makefile: $(srcdir)/Makefile.in $(top_b
uninstall-binaries:
list='$(lib_BINARIES)'; for p in $$list; do \
- rm -f $(DESTDIR)$(pkglibdir)/$$p; \
+ rm -f $(DESTDIR)$(libdir)/$$p; \
done
list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
p=`basename $$p`; \

99
expect.spec Normal file
View File

@ -0,0 +1,99 @@
#
# spec file for package expect
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: expect
Version: 5.45.4
Release: 0
Summary: A Tool for Automating Interactive Programs
License: SUSE-Public-Domain
Group: Development/Languages/Tcl
URL: https://core.tcl-lang.org/expect/
Source: https://downloads.sourceforge.net/expect/expect%version.tar.gz
Source1: expect-rpmlintrc
Patch1: expect.patch
Patch2: expect-fixes.patch
Patch3: expect-log.patch
Patch4: config-guess-sub-update.patch
Patch5: expect-errorfd.patch
Patch6: expect-5.45-format-security.patch
BuildRequires: autoconf
BuildRequires: tcl-devel
%description
Expect is a tool primarily for automating interactive applications,
such as telnet, ftp, passwd, fsck, rlogin, tip, and more. Expect
really makes this stuff trivial. Expect is also useful for testing
these applications. It is described in many books, articles, papers,
and FAQs. There is an entire book on it available from O'Reilly.
%package devel
Summary: Header Files and C API Documentation for expect
Group: Development/Libraries/Tcl
%description devel
This package contains header files and documentation needed for linking
to expect from programs written in compiled languages like C, C++, etc.
This package is not needed for developing scripts that run under the
/usr/bin/expect interpreter, or any other Tcl interpreter with the
expect package loaded.
%prep
%setup -q -n %name%version
%autopatch -p0
%build
export CFLAGS="%{optflags} -fPIC -pie"
autoreconf
%configure \
--with-tcl=%_libdir \
--with-tk=no_tk \
--with-tclinclude=%_includedir \
--enable-shared
make SHLIB_LD="gcc -shared" %{?_smp_mflags} all pkglibdir=%_libdir/tcl/%name%version
%check
make %{?_smp_mflags} test
%install
# set the right path to the expect binary...
sed -i \
-e '1s,^#![^ ]*expectk,#!%_bindir/wish\npackage require Expect,' \
-e '1s,^#![^ ]*expect,#!%_bindir/expect,' \
example/*
%make_install pkglibdir=%_libdir/tcl/%name%version
# Remove some executables and manpages we don't want to ship
rm %buildroot%_bindir/*passwd
rm %buildroot%_bindir/weather
rm %buildroot%_mandir/*/*passwd*
# Simplify linking for apps that use Expect without Tcl
ln -s libexpect%version.so %buildroot%_libdir/libexpect.so
%files
%_bindir/*
%_libdir/tcl/*
%_libdir/lib*.so
%_mandir/man1/*
%doc ChangeLog HISTORY INSTALL FAQ NEWS README
%files devel
%_libdir/libexpect.so
%_includedir/*
%_mandir/man3/*
%changelog

BIN
expect5.45.4.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.