diff --git a/ncurses-5.9-ibm327x.dif b/ncurses-5.9-ibm327x.dif index 2a8dc0c..b893f2e 100644 --- a/ncurses-5.9-ibm327x.dif +++ b/ncurses-5.9-ibm327x.dif @@ -4,7 +4,7 @@ --- misc/terminfo.src +++ misc/terminfo.src 2018-10-29 10:23:47.271511864 +0000 -@@ -17417,8 +17417,8 @@ hazel|exec80|h80|he80|Hazeltine Executiv +@@ -17506,8 +17506,8 @@ hazel|exec80|h80|he80|Hazeltine Executiv # ibm327x|line mode IBM 3270 style, diff --git a/ncurses-6.2-patches.tar.bz2 b/ncurses-6.2-patches.tar.bz2 index c288a4c..35212d6 100644 --- a/ncurses-6.2-patches.tar.bz2 +++ b/ncurses-6.2-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c10d4c92a12c95986aab6cc913a831f13aa5f4e4bc6ad4428b4c0ab091324f37 -size 2762762 +oid sha256:d690041025c95549f15fa480c452e7fa4ca8edaefa1e5b7c2f4d960e871561e2 +size 3069804 diff --git a/ncurses-6.2.dif b/ncurses-6.2.dif index cd3d1b1..8afe2d5 100644 --- a/ncurses-6.2.dif +++ b/ncurses-6.2.dif @@ -1,25 +1,21 @@ --- - aclocal.m4 | 40 ++++++++-------- - configure | 42 +++++++++------- - include/curses.h.in | 5 +- - include/termcap.h.in | 2 - include/tic.h | 4 - - man/man_db.renames | 2 - man/ncurses.3x | 4 + - misc/gen-pkgconfig.in | 8 +++ - misc/terminfo.src | 107 ++++++++++++++++++++++++++++++++++++------- - ncurses/Makefile.in | 2 - ncurses/curses.priv.h | 2 - ncurses/run_cmd.sh | 11 ++++ - ncurses/tinfo/MKfallback.sh | 10 +++- - ncurses/tinfo/access.c | 28 +++++++++++ - ncurses/tinfo/lib_setup.c | 3 + - ncurses/tinfo/read_entry.c | 2 - ncurses/tinfo/read_termcap.c | 21 +++++--- - progs/Makefile.in | 4 - - test/test.priv.h | 4 - - test/tracemunch | 2 - 20 files changed, 233 insertions(+), 70 deletions(-) + aclocal.m4 | 40 +++++++++------- + configure | 42 +++++++++-------- + include/curses.h.in | 5 +- + include/termcap.h.in | 2 + include/tic.h | 4 - + man/man_db.renames | 2 + man/ncurses.3x | 4 + + misc/gen-pkgconfig.in | 8 +++ + misc/terminfo.src | 107 +++++++++++++++++++++++++++++++++++++------- + ncurses/Makefile.in | 2 + ncurses/run_cmd.sh | 11 ++++ + ncurses/tinfo/MKfallback.sh | 14 ++++- + ncurses/tinfo/lib_setup.c | 3 + + progs/Makefile.in | 4 - + test/test.priv.h | 4 - + test/tracemunch | 2 + 16 files changed, 190 insertions(+), 64 deletions(-) --- aclocal.m4 +++ aclocal.m4 2021-06-07 07:18:38.416598899 +0000 @@ -152,7 +148,7 @@ done --- configure +++ configure 2021-06-07 07:18:38.420598827 +0000 -@@ -5849,7 +5849,7 @@ echo $ECHO_N "checking for an rpath opti +@@ -5850,7 +5850,7 @@ echo $ECHO_N "checking for an rpath opti fi ;; (linux*|gnu*|k*bsd*-gnu|freebsd*) @@ -161,7 +157,7 @@ ;; (openbsd[2-9].*|mirbsd*) LD_RPATH_OPT="-Wl,-rpath," -@@ -7451,7 +7451,7 @@ echo "${ECHO_T}$with_pcre2" >&6 +@@ -7452,7 +7452,7 @@ echo "${ECHO_T}$with_pcre2" >&6 if test "x$with_pcre2" != xno ; then cf_with_pcre2_ok=no @@ -170,7 +166,7 @@ do if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$cf_with_pcre2"; then -@@ -14555,12 +14555,15 @@ cat >>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <\$TMP CF_EOF if test -n "$cf_compress" ; then -@@ -14685,9 +14688,9 @@ cat >>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <, rmul=\EG0$<10/>, sgr0=\EG0$<10/>, smir=\Eq, smso=\EG4$<10/>, smul=\EG8$<10/>, tbc=\E0, vpa=\E[%p1%{32}%+%c, @@ -640,7 +636,7 @@ am, da, db, xhp, cols#80, lh#2, lines#24, lm#0, lw#8, nlab#8, acsc=0cjgktlrmfn/q\,t5u6v8w7x., bel=^G, blink=\E&dA, -@@ -17427,7 +17504,7 @@ ibm3101|i3101|IBM 3101-10, +@@ -17516,7 +17593,7 @@ ibm3101|i3101|IBM 3101-10, cup=\EY%p1%{32}%+%c%p2%{32}%+%c, cuu1=\EA, ed=\EJ, el=\EI, home=\EH, hts=\E0, ind=\n, kcub1=\ED, kcud1=\EB, kcuf1=\EC, kcuu1=\EA, nel=\r\n, tbc=\EH, @@ -649,7 +645,7 @@ is2=\E S, rmacs=\E>B, rmcup=\E>B, rs2=\E S, s0ds=\E>B, sgr=\E4%{64}%?%p1%t%{65}%|%;%?%p2%t%{66}%|%;%?%p3%t%{65}%|%; %?%p4%t%{68}%|%;%?%p5%t%{64}%|%;%?%p6%t%{72}%|%;%?%p7%t -@@ -17685,7 +17762,7 @@ lft|lft-pc850|LFT-PC850|IBM LFT PC850 De +@@ -17774,7 +17851,7 @@ lft|lft-pc850|LFT-PC850|IBM LFT PC850 De tbc=\E[3g, use=ecma+index, # "Megapel" refers to the display adapter, which was used with the IBM RT # aka IBM 6150. @@ -669,17 +665,6 @@ ./lib_gen.c : $(base)/MKlib_gen.sh ../include/curses.h $(SHELL) -e $(base)/MKlib_gen.sh "$(CPP) $(CPPFLAGS)" "$(AWK)" generated <../include/curses.h >$@ ---- ncurses/curses.priv.h -+++ ncurses/curses.priv.h 2021-06-07 07:18:38.424598755 +0000 -@@ -2277,6 +2277,8 @@ extern NCURSES_EXPORT(char *) _nc_tracec - extern NCURSES_EXPORT(char *) _nc_tracemouse (SCREEN *, MEVENT const *); - extern NCURSES_EXPORT(char *) _nc_trace_mmask_t (SCREEN *, mmask_t); - extern NCURSES_EXPORT(int) _nc_access (const char *, int); -+extern NCURSES_EXPORT(void) _nc_fsid(void); -+extern NCURSES_EXPORT(void) _nc_fseid(void); - extern NCURSES_EXPORT(int) _nc_baudrate (int); - extern NCURSES_EXPORT(int) _nc_freewin (WINDOW *); - extern NCURSES_EXPORT(int) _nc_getenv_num (const char *); --- ncurses/run_cmd.sh +++ ncurses/run_cmd.sh 2021-06-07 07:18:38.424598755 +0000 @@ -0,0 +1,11 @@ @@ -696,7 +681,18 @@ +exec ${1+"$@"} --- ncurses/tinfo/MKfallback.sh +++ ncurses/tinfo/MKfallback.sh 2021-06-07 07:18:38.424598755 +0000 -@@ -74,6 +74,12 @@ else +@@ -66,14 +66,22 @@ if test $# != 0 ; then + TERMINFO=`pwd`/$tmp_info + export TERMINFO + ++ test -d "$TERMINFO" || mkdir -p "$TERMINFO" ++ + TERMINFO_DIRS=$TERMINFO:$terminfo_dir + export TERMINFO_DIRS + +- "$tic_path" -x "$terminfo_src" >&2 ++ "$tic_path" -o "$TERMINFO" -x "$terminfo_src" >&2 + else tmp_info= fi @@ -709,7 +705,7 @@ cat < -+#endif -+ - #include - - #include -@@ -111,6 +115,30 @@ _nc_basename(char *path) - return path + _nc_pathlast(path); - } - -+NCURSES_EXPORT(void) -+_nc_fsid() -+{ -+#ifdef linux -+ int _old_errno = errno; -+ setfsuid(getuid()); -+ setfsgid(getgid()); -+ errno = _old_errno; -+#endif -+ return; -+} -+ -+NCURSES_EXPORT(void) -+_nc_fseid() -+{ -+#ifdef linux -+ int _old_errno = errno; -+ setfsuid(geteuid()); -+ setfsgid(getegid()); -+ errno = _old_errno; -+#endif -+ return; -+} -+ - NCURSES_EXPORT(int) - _nc_access(const char *path, int mode) - { --- ncurses/tinfo/lib_setup.c +++ ncurses/tinfo/lib_setup.c 2021-06-07 07:18:38.424598755 +0000 @@ -613,6 +613,9 @@ _nc_locale_breaks_acs(TERMINAL *termp) @@ -783,71 +735,6 @@ if (strstr(env, "linux")) { result = 1; /* always broken */ } else if (strstr(env, "screen") != 0 ---- ncurses/tinfo/read_entry.c -+++ ncurses/tinfo/read_entry.c 2021-06-07 07:18:38.424598755 +0000 -@@ -551,6 +551,7 @@ _nc_read_file_entry(const char *const fi - FILE *fp = 0; - int code; - -+ _nc_fsid(); - if (_nc_access(filename, R_OK) < 0 - || (fp = fopen(filename, BIN_R)) == 0) { - TR(TRACE_DATABASE, ("cannot open terminfo %s (errno=%d)", filename, errno)); -@@ -571,6 +572,7 @@ _nc_read_file_entry(const char *const fi - } - fclose(fp); - } -+ _nc_fseid(); - - return (code); - } ---- ncurses/tinfo/read_termcap.c -+++ ncurses/tinfo/read_termcap.c 2021-06-07 07:18:38.424598755 +0000 -@@ -323,14 +323,18 @@ _nc_getent( - */ - if (fd >= 0) { - (void) lseek(fd, (off_t) 0, SEEK_SET); -- } else if ((_nc_access(db_array[current], R_OK) < 0) -- || (fd = open(db_array[current], O_RDONLY, 0)) < 0) { -- /* No error on unfound file. */ -- if (errno == ENOENT) -- continue; -- free(record); -- return (TC_SYS_ERR); - } else { -+ _nc_fsid(); -+ if ((_nc_access(db_array[current], R_OK) < 0) || -+ (fd = open(db_array[current], O_RDONLY, 0)) < 0) { -+ _nc_fseid(); -+ /* No error on unfound file. */ -+ if (errno == ENOENT) -+ continue; -+ free(record); -+ return (TC_SYS_ERR); -+ } -+ _nc_fseid(); - myfd = TRUE; - } - lineno = 0; -@@ -1125,8 +1129,10 @@ _nc_read_termcap_entry(const char *const - for (i = 0; i < filecount; i++) { - - TR(TRACE_DATABASE, ("Looking for %s in %s", tn, termpaths[i])); -+ _nc_fsid(); - if (_nc_access(termpaths[i], R_OK) == 0 - && (fp = fopen(termpaths[i], "r")) != (FILE *) 0) { -+ _nc_fseid(); - _nc_set_source(termpaths[i]); - - /* -@@ -1138,6 +1144,7 @@ _nc_read_termcap_entry(const char *const - - (void) fclose(fp); - } -+ _nc_fseid(); - } - } - if (copied != 0) --- progs/Makefile.in +++ progs/Makefile.in 2021-06-07 07:18:38.424598755 +0000 @@ -101,7 +101,7 @@ CFLAGS_LIBTOOL = $(CCFLAGS) diff --git a/ncurses.changes b/ncurses.changes index f334e55..ebb7ecd 100644 --- a/ncurses.changes +++ b/ncurses.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Mon Jun 28 05:52:41 UTC 2021 - Dr. Werner Fink + +- Add ncurses patch 20210626 + + add configure option --disable-root-access, which tells ncurses to + disallow most file-opens by setuid processes. + + use default colors in pccon "op" -TD + + correct rmacs/smacs in aaa+dec, aaa+rv -TD + + add hpterm-color2 and hp98550-color (Martin Trusler) + + regenerate man-html documentation. +- Remove setfsuid code from patch ncurses-6.2.dif as now upstream solved +- Correct offset of patch ncurses-5.9-ibm327x.dif and ncurses-6.2.dif + ------------------------------------------------------------------- Mon Jun 21 07:50:36 UTC 2021 - Dr. Werner Fink diff --git a/ncurses.spec b/ncurses.spec index b860d79..5a8fdf9 100644 --- a/ncurses.spec +++ b/ncurses.spec @@ -517,6 +517,7 @@ mv tack-* tack --with-pcre2 \ %endif --disable-stripping \ + --disable-root-access \ --disable-root-environ \ --disable-termcap \ --disable-overwrite \ @@ -612,13 +613,10 @@ mv tack-* tack export BUILD_INFOCMP=$PWD/progs/infocmp.build EOF pushd ncurses/ - TERMINFO=$PWD/tmp - export TERMINFO - mkdir -p $TERMINFO . ${PWD}/../.build_tic $BUILD_TIC -I -r -e $FALLBK ../misc/terminfo.src > terminfo.src $BUILD_TIC -o $TERMINFO -s terminfo.src - sh -e ./tinfo/MKfallback.sh $TERMINFO ../misc/terminfo.src $BUILD_TIC $BUILD_INFOCMP ${FALLBK//,/ } > fallback.c + sh -e ./tinfo/MKfallback.sh $PWD/tmp_info ../misc/terminfo.src $BUILD_TIC $BUILD_INFOCMP ${FALLBK//,/ } > fallback.c rm -rf $TERMINFO unset TERMINFO cp -p fallback.c ../fallback.c.build