import CS libedit-3.1-38.20210216cvs.el9

This commit is contained in:
eabdullin 2023-09-21 19:06:43 +00:00
parent de26bb3791
commit 7a5ec3e65d
2 changed files with 48 additions and 2 deletions

View File

@ -0,0 +1,40 @@
diff -ur libedit-20210419-3.1/src/el.c libedit-20210522-3.1/src/el.c
--- libedit-20210419-3.1/src/el.c 2019-10-25 22:12:05.000000000 +0200
+++ libedit-20210522-3.1/src/el.c 2021-05-22 20:55:00.000000000 +0200
@@ -548,15 +548,15 @@
fp = NULL;
if (fname == NULL) {
-#ifdef HAVE_ISSETUGID
- if (issetugid())
- return -1;
- if ((fname = getenv("EDITRC")) == NULL) {
+ /* secure_getenv is guaranteed to be defined and do the right thing here */
+ /* because of the defines above which take into account issetugid, */
+ /* secure_getenv and __secure_getenv availability. */
+ if ((fname = secure_getenv("EDITRC")) == NULL) {
static const char elpath[] = "/.editrc";
size_t plen = sizeof(elpath);
- if ((ptr = getenv("HOME")) == NULL)
+ if ((ptr = secure_getenv("HOME")) == NULL)
return -1;
plen += strlen(ptr);
if ((path = el_calloc(plen, sizeof(*path))) == NULL)
@@ -565,14 +565,7 @@
elpath + (*ptr == '\0'));
fname = path;
}
-#else
- /*
- * If issetugid() is missing, always return an error, in order
- * to keep from inadvertently opening up the user to a security
- * hole.
- */
- return -1;
-#endif
+
}
if (fname[0] == '\0')
return -1;

View File

@ -4,7 +4,7 @@
Summary: The NetBSD Editline library
Name: libedit
Version: 3.1
Release: 37.%{snap}cvs%{?dist}
Release: 38.%{snap}cvs%{?dist}
License: BSD
URL: https://www.thrysoee.dk/editline/
Source0: https://www.thrysoee.dk/editline/%{name}-%{snap}-%{version}.tar.gz
@ -13,6 +13,9 @@ BuildRequires: groff-base
BuildRequires: make
BuildRequires: ncurses-devel
# Fix reading of $HOME/.editrc and $EDITRC
Patch1: libedit-editrc.patch
%description
Libedit is an autotool- and libtoolized port of the NetBSD Editline library.
It provides generic line editing, history, and tokenization functions, similar
@ -28,7 +31,7 @@ Requires: ncurses-devel%{?_isa}
This package contains development files for %{name}.
%prep
%autosetup -n %{name}-%{dir_snap}-%{version}
%autosetup -n %{name}-%{dir_snap}-%{version} -p1
# Fix unused direct shared library dependencies.
sed -i "s/lncurses/ltinfo/" configure
@ -64,6 +67,9 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man3/history.3*
%{_includedir}/editline/readline.h
%changelog
* Wed Jul 19 2023 Miroslav Lichvar <mlichvar@redhat.com> 3.1-38.20210216cvs
- Fix reading of $HOME/.editrc and $EDITRC (#2211207)
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 3.1-37.20210216cvs
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688