diff --git a/SOURCES/0001-patch-8.2.3115-Coverity-complains-about-free_wininfo.patch b/SOURCES/0001-patch-8.2.3115-Coverity-complains-about-free_wininfo.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.3290-Vim9-compiling-dict-may-use-pointer-a.patch b/SOURCES/0001-patch-8.2.3290-Vim9-compiling-dict-may-use-pointer-a.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.3406-on-some-systems-tests-fail-without-_R.patch b/SOURCES/0001-patch-8.2.3406-on-some-systems-tests-fail-without-_R.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.3409-reading-beyond-end-of-line-with-inval.patch b/SOURCES/0001-patch-8.2.3409-reading-beyond-end-of-line-with-inval.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.3428-using-freed-memory-when-replacing.patch b/SOURCES/0001-patch-8.2.3428-using-freed-memory-when-replacing.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.3487-illegal-memory-access-if-buffer-name-.patch b/SOURCES/0001-patch-8.2.3487-illegal-memory-access-if-buffer-name-.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.3625-illegal-memory-access-when-C-indentin.patch b/SOURCES/0001-patch-8.2.3625-illegal-memory-access-when-C-indentin.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.3669-buffer-overflow-with-long-help-argume.patch b/SOURCES/0001-patch-8.2.3669-buffer-overflow-with-long-help-argume.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.3949-using-freed-memory-with-V.patch b/SOURCES/0001-patch-8.2.3949-using-freed-memory-with-V.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.3950-going-beyond-the-end-of-the-line-with.patch b/SOURCES/0001-patch-8.2.3950-going-beyond-the-end-of-the-line-with.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4120-block-insert-goes-over-the-end-of-the.patch b/SOURCES/0001-patch-8.2.4120-block-insert-goes-over-the-end-of-the.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4151-reading-beyond-the-end-of-a-line.patch b/SOURCES/0001-patch-8.2.4151-reading-beyond-the-end-of-a-line.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4154-ml_get-error-when-exchanging-windows-.patch b/SOURCES/0001-patch-8.2.4154-ml_get-error-when-exchanging-windows-.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4214-illegal-memory-access-with-large-tabs.patch b/SOURCES/0001-patch-8.2.4214-illegal-memory-access-with-large-tabs.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4215-illegal-memory-access-when-copying-li.patch b/SOURCES/0001-patch-8.2.4215-illegal-memory-access-when-copying-li.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4217-illegal-memory-access-when-undo-makes.patch b/SOURCES/0001-patch-8.2.4217-illegal-memory-access-when-undo-makes.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4218-illegal-memory-access-with-bracketed-.patch b/SOURCES/0001-patch-8.2.4218-illegal-memory-access-with-bracketed-.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4245-retab-0-may-cause-illegal-memory-acce.patch b/SOURCES/0001-patch-8.2.4245-retab-0-may-cause-illegal-memory-acce.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4247-stack-corruption-when-looking-for-spe.patch b/SOURCES/0001-patch-8.2.4247-stack-corruption-when-looking-for-spe.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4253-using-freed-memory-when-substitute-wi.patch b/SOURCES/0001-patch-8.2.4253-using-freed-memory-when-substitute-wi.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4281-using-freed-memory-with-lopen-and-bwi.patch b/SOURCES/0001-patch-8.2.4281-using-freed-memory-with-lopen-and-bwi.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4327-may-end-up-with-no-current-buffer.patch b/SOURCES/0001-patch-8.2.4327-may-end-up-with-no-current-buffer.patch new file mode 100644 index 0000000..8c2cf3a --- /dev/null +++ b/SOURCES/0001-patch-8.2.4327-may-end-up-with-no-current-buffer.patch @@ -0,0 +1,110 @@ +From e3537aec2f8d6470010547af28dcbd83d41461b8 Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Tue, 8 Feb 2022 15:05:20 +0000 +Subject: [PATCH] patch 8.2.4327: may end up with no current buffer + +Problem: May end up with no current buffer. +Solution: When deleting the current buffer to not pick a quickfix buffer as + the new current buffer. +--- + src/buffer.c | 26 ++++++++++++++++++++++---- + src/testdir/test_quickfix.vim | 25 +++++++++++++++++++++++++ + src/version.c | 2 ++ + 3 files changed, 49 insertions(+), 4 deletions(-) + +diff --git a/src/buffer.c b/src/buffer.c +index 81bdb31ca..b3e2bc3f9 100644 +--- a/src/buffer.c ++++ b/src/buffer.c +@@ -1430,8 +1430,14 @@ do_buffer_ext( + buf = buflist_findnr(curwin->w_jumplist[jumpidx].fmark.fnum); + if (buf != NULL) + { +- if (buf == curbuf || !buf->b_p_bl) +- buf = NULL; // skip current and unlisted bufs ++ // Skip current and unlisted bufs. Also skip a quickfix ++ // buffer, it might be deleted soon. ++ if (buf == curbuf || !buf->b_p_bl ++#if defined(FEAT_QUICKFIX) ++ || bt_quickfix(buf) ++#endif ++ ) ++ buf = NULL; + else if (buf->b_ml.ml_mfp == NULL) + { + // skip unloaded buf, but may keep it for later +@@ -1467,7 +1473,11 @@ do_buffer_ext( + continue; + } + // in non-help buffer, try to skip help buffers, and vv +- if (buf->b_help == curbuf->b_help && buf->b_p_bl) ++ if (buf->b_help == curbuf->b_help && buf->b_p_bl ++#if defined(FEAT_QUICKFIX) ++ && !bt_quickfix(buf) ++#endif ++ ) + { + if (buf->b_ml.ml_mfp != NULL) // found loaded buffer + break; +@@ -1485,7 +1495,11 @@ do_buffer_ext( + if (buf == NULL) // No loaded buffer, find listed one + { + FOR_ALL_BUFFERS(buf) +- if (buf->b_p_bl && buf != curbuf) ++ if (buf->b_p_bl && buf != curbuf ++#if defined(FEAT_QUICKFIX) ++ && !bt_quickfix(buf) ++#endif ++ ) + break; + } + if (buf == NULL) // Still no buffer, just take one +@@ -1494,6 +1508,10 @@ do_buffer_ext( + buf = curbuf->b_next; + else + buf = curbuf->b_prev; ++#if defined(FEAT_QUICKFIX) ++ if (bt_quickfix(buf)) ++ buf = NULL; ++#endif + } + } + +diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim +index 07fdb9644..adb0ea4fd 100644 +--- a/src/testdir/test_quickfix.vim ++++ b/src/testdir/test_quickfix.vim +@@ -5851,5 +5851,30 @@ func Test_lopen_bwipe() + delfunc R + endfunc + ++" Another sequence of commands that caused all buffers to be wiped out ++func Test_lopen_bwipe_all() ++ let lines =<< trim END ++ func R() ++ silent! tab lopen ++ e foo ++ silent! lfile ++ endfunc ++ cal R() ++ exe "norm \\0" ++ cal R() ++ bwipe ++ ++ call writefile(['done'], 'Xresult') ++ qall! ++ END ++ call writefile(lines, 'Xscript') ++ if RunVim([], [], '-u NONE -n -X -Z -e -m -s -S Xscript') ++ call assert_equal(['done'], readfile('Xresult')) ++ endif ++ ++ call delete('Xscript') ++ call delete('Xresult') ++endfunc ++ + + " vim: shiftwidth=2 sts=2 expandtab +-- +2.35.1 + diff --git a/SOURCES/0001-patch-8.2.4359-crash-when-repeatedly-using-retab.patch b/SOURCES/0001-patch-8.2.4359-crash-when-repeatedly-using-retab.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4397-crash-when-using-many-composing-chara.patch b/SOURCES/0001-patch-8.2.4397-crash-when-using-many-composing-chara.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4436-crash-with-weird-vartabstop-value.patch b/SOURCES/0001-patch-8.2.4436-crash-with-weird-vartabstop-value.patch old mode 100755 new mode 100644 diff --git a/SOURCES/0001-patch-8.2.4563-z-in-Visual-mode-may-go-beyond-the-en.patch b/SOURCES/0001-patch-8.2.4563-z-in-Visual-mode-may-go-beyond-the-en.patch new file mode 100644 index 0000000..4066b1e --- /dev/null +++ b/SOURCES/0001-patch-8.2.4563-z-in-Visual-mode-may-go-beyond-the-en.patch @@ -0,0 +1,39 @@ +diff -up vim82/src/spellsuggest.c.cve0943 vim82/src/spellsuggest.c +--- vim82/src/spellsuggest.c.cve0943 2022-03-28 20:48:07.079197805 +0200 ++++ vim82/src/spellsuggest.c 2022-03-28 20:48:07.101197522 +0200 +@@ -501,6 +501,10 @@ spell_suggest(int count) + curwin->w_cursor.col = VIsual.col; + ++badlen; + end_visual_mode(); ++ // make sure we don't include the NUL at the end of the line ++ line = ml_get_curline(); ++ if (badlen > STRLEN(line) - curwin->w_cursor.col) ++ badlen = STRLEN(line) - curwin->w_cursor.col; + } + // Find the start of the badly spelled word. + else if (spell_move_to(curwin, FORWARD, TRUE, TRUE, NULL) == 0 +diff -up vim82/src/testdir/test_spell.vim.cve0943 vim82/src/testdir/test_spell.vim +--- vim82/src/testdir/test_spell.vim.cve0943 2022-03-28 20:48:07.102197509 +0200 ++++ vim82/src/testdir/test_spell.vim 2022-03-28 20:49:05.038452974 +0200 +@@ -441,6 +441,21 @@ func Test_spellsuggest_expr_errors() + delfunc MySuggest3 + endfunc + ++func Test_spellsuggest_visual_end_of_line() ++ let enc_save = &encoding ++ set encoding=iso8859 ++ ++ " This was reading beyond the end of the line. ++ norm R00000000000 ++ sil norm 0 ++ sil! norm i00000) ++ sil! norm i00000) ++ call feedkeys("\") ++ norm z= ++ ++ let &encoding = enc_save ++endfunc ++ + func Test_spellinfo() + new + let runtime = substitute($VIMRUNTIME, '\\', '/', 'g') diff --git a/SOURCES/0001-patch-8.2.4646-using-buffer-line-after-it-has-been-f.patch b/SOURCES/0001-patch-8.2.4646-using-buffer-line-after-it-has-been-f.patch new file mode 100644 index 0000000..3d45b8e --- /dev/null +++ b/SOURCES/0001-patch-8.2.4646-using-buffer-line-after-it-has-been-f.patch @@ -0,0 +1,44 @@ +diff -up vim82/src/regexp_bt.c.cve1154 vim82/src/regexp_bt.c +--- vim82/src/regexp_bt.c.cve1154 2022-04-25 15:22:28.367621755 +0200 ++++ vim82/src/regexp_bt.c 2022-04-25 15:25:13.726340728 +0200 +@@ -3188,8 +3188,17 @@ regmatch( + int mark = OPERAND(scan)[0]; + int cmp = OPERAND(scan)[1]; + pos_T *pos; ++ size_t col = REG_MULTI ? rex.input - rex.line : 0; + + pos = getmark_buf(rex.reg_buf, mark, FALSE); ++ ++ // Line may have been freed, get it again. ++ if (REG_MULTI) ++ { ++ rex.line = reg_getline(rex.lnum); ++ rex.input = rex.line + col; ++ } ++ + if (pos == NULL // mark doesn't exist + || pos->lnum <= 0 // mark isn't set in reg_buf + || (pos->lnum == rex.lnum + rex.reg_firstlnum +diff -up vim82/src/testdir/test_regexp_latin.vim.cve1154 vim82/src/testdir/test_regexp_latin.vim +--- vim82/src/testdir/test_regexp_latin.vim.cve1154 2022-04-25 15:22:28.368621752 +0200 ++++ vim82/src/testdir/test_regexp_latin.vim 2022-04-25 15:26:57.515227712 +0200 +@@ -954,4 +954,19 @@ func Test_using_visual_position() + bwipe! + endfunc + ++func Test_using_mark_position() ++ " this was using freed memory ++ " new engine ++ new ++ norm O0 ++ call assert_fails("s/\\%')", 'E486:') ++ bwipe! ++ ++ " old engine ++ new ++ norm O0 ++ call assert_fails("s/\\%#=1\\%')", 'E486:') ++ bwipe! ++endfunc ++ + " vim: shiftwidth=2 sts=2 expandtab diff --git a/SOURCES/0001-patch-8.2.4774-crash-when-using-a-number-for-lambda-.patch b/SOURCES/0001-patch-8.2.4774-crash-when-using-a-number-for-lambda-.patch new file mode 100644 index 0000000..60a6c54 --- /dev/null +++ b/SOURCES/0001-patch-8.2.4774-crash-when-using-a-number-for-lambda-.patch @@ -0,0 +1,51 @@ +diff -up vim82/src/errors.h.cve1420 vim82/src/errors.h +--- vim82/src/errors.h.cve1420 2022-04-25 16:01:03.559985019 +0200 ++++ vim82/src/errors.h 2022-04-25 16:01:58.113332024 +0200 +@@ -383,3 +383,7 @@ EXTERN char e_cannot_use_default_values_ + INIT(= N_("E1172: Cannot use default values in a lambda")); + EXTERN char e_resulting_text_too_long[] + INIT(= N_("E1240: Resulting text too long")); ++#ifdef FEAT_EVAL ++EXTERN char e_string_or_function_required_for_arrow_parens_expr[] ++ INIT(= N_("E1275: String or function required for ->(expr)")); ++#endif +diff -up vim82/src/eval.c.cve1420 vim82/src/eval.c +--- vim82/src/eval.c.cve1420 2022-04-25 16:01:03.560985007 +0200 ++++ vim82/src/eval.c 2022-04-25 16:14:11.746600369 +0200 +@@ -3718,13 +3718,20 @@ eval_lambda( + if (**arg != ')') + { + emsg(_(e_missing_close)); +- ret = FAIL; ++ return FAIL; ++ } ++ if (rettv->v_type != VAR_STRING && rettv->v_type != VAR_FUNC ++ && rettv->v_type != VAR_PARTIAL) ++ { ++ emsg(_(e_string_or_function_required_for_arrow_parens_expr)); ++ return FAIL; + } + ++*arg; + } + if (ret != OK) + return FAIL; +- else if (**arg != '(') ++ ++ if (**arg != '(') + { + if (verbose) + { +diff -up vim82/src/testdir/test_lambda.vim.cve1420 vim82/src/testdir/test_lambda.vim +--- vim82/src/testdir/test_lambda.vim.cve1420 2022-04-25 16:01:03.560985007 +0200 ++++ vim82/src/testdir/test_lambda.vim 2022-04-25 16:17:01.694886566 +0200 +@@ -64,6 +64,10 @@ function Test_lambda_fails() + call assert_fails('echo {a, a -> a + a}(1, 2)', 'E853:') + call assert_fails('echo {a, b -> a + b)}(1, 2)', 'E451:') + echo assert_fails('echo 10->{a -> a + 2}', 'E107:') ++ call assert_fails('eval 0->(3)()', "E1275:") ++ call assert_fails('eval 0->([3])()', "E1275:") ++ call assert_fails('eval 0->({"a": 3})()', "E1275:") ++ call assert_fails('eval 0->(xxx)()', "E121:") + endfunc + + func Test_not_lamda() diff --git a/SOURCES/0001-patch-8.2.4919-can-add-invalid-bytes-with-spellgood.patch b/SOURCES/0001-patch-8.2.4919-can-add-invalid-bytes-with-spellgood.patch new file mode 100644 index 0000000..321bf48 --- /dev/null +++ b/SOURCES/0001-patch-8.2.4919-can-add-invalid-bytes-with-spellgood.patch @@ -0,0 +1,50 @@ +diff -up vim82/src/errors.h.cve1621 vim82/src/errors.h +--- vim82/src/errors.h.cve1621 2022-05-24 13:36:23.883370040 +0200 ++++ vim82/src/errors.h 2022-05-24 13:36:47.665487703 +0200 +@@ -387,3 +387,7 @@ EXTERN char e_resulting_text_too_long[] + EXTERN char e_string_or_function_required_for_arrow_parens_expr[] + INIT(= N_("E1275: String or function required for ->(expr)")); + #endif ++#ifdef FEAT_SPELL ++EXTERN char e_illegal_character_in_word[] ++ INIT(= N_("E1280: Illegal character in word")); ++#endif +diff -up vim82/src/mbyte.c.cve1621 vim82/src/mbyte.c +--- vim82/src/mbyte.c.cve1621 2021-03-22 10:02:42.000000000 +0100 ++++ vim82/src/mbyte.c 2022-05-24 13:36:23.884370045 +0200 +@@ -4181,7 +4181,7 @@ theend: + convert_setup(&vimconv, NULL, NULL); + } + +-#if defined(FEAT_GUI_GTK) || defined(PROTO) ++#if defined(FEAT_GUI_GTK) || defined(FEAT_SPELL) || defined(PROTO) + /* + * Return TRUE if string "s" is a valid utf-8 string. + * When "end" is NULL stop at the first NUL. +diff -up vim82/src/spellfile.c.cve1621 vim82/src/spellfile.c +--- vim82/src/spellfile.c.cve1621 2021-03-22 10:02:42.000000000 +0100 ++++ vim82/src/spellfile.c 2022-05-24 13:36:23.885370049 +0200 +@@ -4391,6 +4391,10 @@ store_word( + int res = OK; + char_u *p; + ++ // Avoid adding illegal bytes to the word tree. ++ if (enc_utf8 && !utf_valid_string(word, NULL)) ++ return FAIL; ++ + (void)spell_casefold(word, len, foldword, MAXWLEN); + for (p = pfxlist; res == OK; ++p) + { +@@ -6191,6 +6195,12 @@ spell_add_word( + int i; + char_u *spf; + ++ if (enc_utf8 && !utf_valid_string(word, NULL)) ++ { ++ emsg(_(e_illegal_character_in_word)); ++ return; ++ } ++ + if (idx == 0) // use internal wordlist + { + if (int_wordlist == NULL) diff --git a/SOURCES/0001-patch-8.2.4925-trailing-backslash-may-cause-reading-.patch b/SOURCES/0001-patch-8.2.4925-trailing-backslash-may-cause-reading-.patch new file mode 100644 index 0000000..55dade6 --- /dev/null +++ b/SOURCES/0001-patch-8.2.4925-trailing-backslash-may-cause-reading-.patch @@ -0,0 +1,33 @@ +From 53a70289c2712808e6d4e88927e03cac01b470dd Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Mon, 9 May 2022 13:15:07 +0100 +Subject: [PATCH] patch 8.2.4925: trailing backslash may cause reading past end + of line + +Problem: Trailing backslash may cause reading past end of line. +Solution: Check for NUL after backslash. +--- + src/testdir/test_textobjects.vim | 10 +++++++++- + src/textobject.c | 4 ++++ + src/version.c | 2 ++ + 3 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/src/textobject.c b/src/textobject.c +index e4a7db38e..edaa64c51 100644 +--- a/src/textobject.c ++++ b/src/textobject.c +@@ -1664,7 +1664,11 @@ find_next_quote( + if (c == NUL) + return -1; + else if (escape != NULL && vim_strchr(escape, c)) ++ { + ++col; ++ if (line[col] == NUL) ++ return -1; ++ } + else if (c == quotechar) + break; + if (has_mbyte) +-- +2.36.1 + diff --git a/SOURCES/0001-patch-8.2.4977-memory-access-error-when-substitute-e.patch b/SOURCES/0001-patch-8.2.4977-memory-access-error-when-substitute-e.patch new file mode 100644 index 0000000..b5a9272 --- /dev/null +++ b/SOURCES/0001-patch-8.2.4977-memory-access-error-when-substitute-e.patch @@ -0,0 +1,59 @@ +diff -up vim82/src/ex_cmds.c.cve1785 vim82/src/ex_cmds.c +--- vim82/src/ex_cmds.c.cve1785 2022-06-10 10:26:16.883312704 +0200 ++++ vim82/src/ex_cmds.c 2022-06-10 10:26:16.910312568 +0200 +@@ -4356,12 +4356,17 @@ ex_substitute(exarg_T *eap) + // Save flags for recursion. They can change for e.g. + // :s/^/\=execute("s#^##gn") + subflags_save = subflags; ++ ++ // Disallow changing text or switching window in an expression. ++ ++textwinlock; + #endif + // get length of substitution part + sublen = vim_regsub_multi(®match, + sub_firstlnum - regmatch.startpos[0].lnum, + sub, sub_firstline, FALSE, magic_isset(), TRUE); + #ifdef FEAT_EVAL ++ --textwinlock; ++ + // If getting the substitute string caused an error, don't do + // the replacement. + // Don't keep flags set by a recursive call. +@@ -4462,9 +4467,15 @@ ex_substitute(exarg_T *eap) + mch_memmove(new_end, sub_firstline + copycol, (size_t)copy_len); + new_end += copy_len; + ++#ifdef FEAT_EVAL ++ ++textwinlock; ++#endif + (void)vim_regsub_multi(®match, + sub_firstlnum - regmatch.startpos[0].lnum, + sub, new_end, TRUE, magic_isset(), TRUE); ++#ifdef FEAT_EVAL ++ --textwinlock; ++#endif + sub_nsubs++; + did_sub = TRUE; + +diff -up vim82/src/testdir/test_substitute.vim.cve1785 vim82/src/testdir/test_substitute.vim +--- vim82/src/testdir/test_substitute.vim.cve1785 2022-06-10 10:26:16.910312568 +0200 ++++ vim82/src/testdir/test_substitute.vim 2022-06-10 10:27:02.166084629 +0200 +@@ -942,5 +942,18 @@ func Test_using_old_sub() + set nocompatible + endfunc + ++" This was switching windows in between computing the length and using it. ++func Test_sub_change_window() ++ silent! lfile ++ sil! norm o0000000000000000000000000000000000000000000000000000 ++ func Repl() ++ lopen ++ endfunc ++ silent! s/\%')/\=Repl() ++ bwipe! ++ bwipe! ++ delfunc Repl ++endfunc ++ + + " vim: shiftwidth=2 sts=2 expandtab diff --git a/SOURCES/0001-patch-8.2.5023-substitute-overwrites-allocated-buffe.patch b/SOURCES/0001-patch-8.2.5023-substitute-overwrites-allocated-buffe.patch new file mode 100644 index 0000000..71ce847 --- /dev/null +++ b/SOURCES/0001-patch-8.2.5023-substitute-overwrites-allocated-buffe.patch @@ -0,0 +1,121 @@ +diff -up vim82/src/normal.c.cve1897 vim82/src/normal.c +--- vim82/src/normal.c.cve1897 2022-06-13 09:31:42.880768567 +0200 ++++ vim82/src/normal.c 2022-06-13 09:35:38.560084927 +0200 +@@ -479,6 +479,22 @@ find_command(int cmdchar) + } + + /* ++ * If currently editing a cmdline or text is locked: beep and give an error ++ * message, return TRUE. ++ */ ++ static int ++check_text_locked(oparg_T *oap) ++{ ++ if (text_locked()) ++ { ++ clearopbeep(oap); ++ text_locked_msg(); ++ return TRUE; ++ } ++ return FALSE; ++} ++ ++/* + * Execute a command in Normal mode. + */ + void +@@ -742,14 +758,9 @@ getcount: + goto normal_end; + } + +- if (text_locked() && (nv_cmds[idx].cmd_flags & NV_NCW)) +- { +- // This command is not allowed while editing a cmdline: beep. +- clearopbeep(oap); +- text_locked_msg(); +- goto normal_end; +- } +- if ((nv_cmds[idx].cmd_flags & NV_NCW) && curbuf_locked()) ++ if ((nv_cmds[idx].cmd_flags & NV_NCW) ++ && (check_text_locked(oap) || curbuf_locked())) ++ // this command is not allowed now + goto normal_end; + + /* +@@ -4212,12 +4223,8 @@ nv_gotofile(cmdarg_T *cap) + char_u *ptr; + linenr_T lnum = -1; + +- if (text_locked()) +- { +- clearopbeep(cap->oap); +- text_locked_msg(); ++ if (check_text_locked(cap->oap)) + return; +- } + if (curbuf_locked()) + { + clearop(cap->oap); +@@ -6343,14 +6350,7 @@ nv_g_cmd(cmdarg_T *cap) + + // "gQ": improved Ex mode + case 'Q': +- if (text_locked()) +- { +- clearopbeep(cap->oap); +- text_locked_msg(); +- break; +- } +- +- if (!checkclearopq(oap)) ++ if (!check_text_locked(cap->oap) && !checkclearopq(oap)) + do_exmode(TRUE); + break; + +diff -up vim82/src/testdir/test_substitute.vim.cve1897 vim82/src/testdir/test_substitute.vim +--- vim82/src/testdir/test_substitute.vim.cve1897 2022-06-13 09:31:42.938768884 +0200 ++++ vim82/src/testdir/test_substitute.vim 2022-06-13 09:36:39.013406036 +0200 +@@ -955,5 +955,27 @@ func Test_sub_change_window() + delfunc Repl + endfunc + ++" This was undoign a change in between computing the length and using it. ++func Do_Test_sub_undo_change() ++ new ++ norm o0000000000000000000000000000000000000000000000000000 ++ silent! s/\%')/\=Repl() ++ bwipe! ++endfunc ++ ++func Test_sub_undo_change() ++ func Repl() ++ silent! norm g- ++ endfunc ++ call Do_Test_sub_undo_change() ++ ++ func! Repl() ++ silent earlier ++ endfunc ++ call Do_Test_sub_undo_change() ++ ++ delfunc Repl ++endfunc ++ + + " vim: shiftwidth=2 sts=2 expandtab +diff -up vim82/src/undo.c.cve1897 vim82/src/undo.c +--- vim82/src/undo.c.cve1897 2022-06-13 09:31:42.904768698 +0200 ++++ vim82/src/undo.c 2022-06-13 09:31:42.938768884 +0200 +@@ -2323,6 +2323,12 @@ undo_time( + int above = FALSE; + int did_undo = TRUE; + ++ if (text_locked()) ++ { ++ text_locked_msg(); ++ return; ++ } ++ + // First make sure the current undoable change is synced. + if (curbuf->b_u_synced == FALSE) + u_sync(TRUE); diff --git a/SOURCES/0001-patch-8.2.5037-cursor-position-may-be-invalid-after-.patch b/SOURCES/0001-patch-8.2.5037-cursor-position-may-be-invalid-after-.patch new file mode 100644 index 0000000..a8eeda7 --- /dev/null +++ b/SOURCES/0001-patch-8.2.5037-cursor-position-may-be-invalid-after-.patch @@ -0,0 +1,106 @@ +diff -up vim82/src/ex_docmd.c.cve1927 vim82/src/ex_docmd.c +--- vim82/src/ex_docmd.c.cve1927 2021-03-22 10:02:42.000000000 +0100 ++++ vim82/src/ex_docmd.c 2022-06-13 15:29:45.099472751 +0200 +@@ -3081,6 +3081,8 @@ parse_cmd_address(exarg_T *eap, char **e + { + int address_count = 1; + linenr_T lnum; ++ int need_check_cursor = FALSE; ++ int ret = FAIL; + + // Repeat for all ',' or ';' separated addresses. + for (;;) +@@ -3091,7 +3093,7 @@ parse_cmd_address(exarg_T *eap, char **e + lnum = get_address(eap, &eap->cmd, eap->addr_type, eap->skip, silent, + eap->addr_count == 0, address_count++); + if (eap->cmd == NULL) // error detected +- return FAIL; ++ goto theend; + if (lnum == MAXLNUM) + { + if (*eap->cmd == '%') // '%' - all lines +@@ -3136,14 +3138,14 @@ parse_cmd_address(exarg_T *eap, char **e + // there is no Vim command which uses '%' and + // ADDR_WINDOWS or ADDR_TABS + *errormsg = _(e_invrange); +- return FAIL; ++ goto theend; + } + break; + case ADDR_TABS_RELATIVE: + case ADDR_UNSIGNED: + case ADDR_QUICKFIX: + *errormsg = _(e_invrange); +- return FAIL; ++ goto theend; + case ADDR_ARGUMENTS: + if (ARGCOUNT == 0) + eap->line1 = eap->line2 = 0; +@@ -3175,7 +3177,7 @@ parse_cmd_address(exarg_T *eap, char **e + if (eap->addr_type != ADDR_LINES) + { + *errormsg = _(e_invrange); +- return FAIL; ++ goto theend; + } + + ++eap->cmd; +@@ -3183,11 +3185,11 @@ parse_cmd_address(exarg_T *eap, char **e + { + fp = getmark('<', FALSE); + if (check_mark(fp) == FAIL) +- return FAIL; ++ goto theend; + eap->line1 = fp->lnum; + fp = getmark('>', FALSE); + if (check_mark(fp) == FAIL) +- return FAIL; ++ goto theend; + eap->line2 = fp->lnum; + ++eap->addr_count; + } +@@ -3202,10 +3204,13 @@ parse_cmd_address(exarg_T *eap, char **e + if (!eap->skip) + { + curwin->w_cursor.lnum = eap->line2; ++ + // Don't leave the cursor on an illegal line or column, but do + // accept zero as address, so 0;/PATTERN/ works correctly. ++ // Check the cursor position before returning. + if (eap->line2 > 0) + check_cursor(); ++ need_check_cursor = TRUE; + } + } + else if (*eap->cmd != ',') +@@ -3221,7 +3226,12 @@ parse_cmd_address(exarg_T *eap, char **e + if (lnum == MAXLNUM) + eap->addr_count = 0; + } +- return OK; ++ ret = OK; ++ ++theend: ++ if (need_check_cursor) ++ check_cursor(); ++ return ret; + } + + /* +diff -up vim82/src/testdir/test_excmd.vim.cve1927 vim82/src/testdir/test_excmd.vim +--- vim82/src/testdir/test_excmd.vim.cve1927 2022-06-13 15:26:53.941517542 +0200 ++++ vim82/src/testdir/test_excmd.vim 2022-06-13 15:30:53.972860361 +0200 +@@ -536,4 +536,13 @@ func Test_sandbox() + sandbox call Sandbox_tests() + endfunc + ++" This was leaving the cursor in line zero ++func Test_using_zero_in_range() ++ new ++ norm o00 ++ silent! 0;s/\%') ++ bwipe! ++endfunc ++ ++ + " vim: shiftwidth=2 sts=2 expandtab diff --git a/SOURCES/vim-7.0-fixkeys.patch b/SOURCES/vim-7.0-fixkeys.patch index c747633..1d5bc4a 100644 --- a/SOURCES/vim-7.0-fixkeys.patch +++ b/SOURCES/vim-7.0-fixkeys.patch @@ -1,26 +1,26 @@ diff -up vim82/src/term.c.fixkeys vim82/src/term.c ---- vim82/src/term.c.fixkeys 2022-02-07 09:23:09.195365881 +0100 -+++ vim82/src/term.c 2022-02-07 09:31:31.279695977 +0100 -@@ -921,14 +921,14 @@ static struct builtin_term builtin_termc - {K_XRIGHT, "\033[@;*C"}, - {K_XLEFT, "\033[@;*D"}, +--- vim82/src/term.c.fixkeys 2021-01-08 10:12:59.191309539 +0100 ++++ vim82/src/term.c 2021-01-08 10:18:05.410470981 +0100 +@@ -919,14 +919,14 @@ static struct builtin_term builtin_termc + {K_XRIGHT, IF_EB("\033[@;*C", ESC_STR "[@;*C")}, + {K_XLEFT, IF_EB("\033[@;*D", ESC_STR "[@;*D")}, // An extra set of function keys for vt100 mode -- {K_XF1, "\033O*P"}, -- {K_XF2, "\033O*Q"}, -- {K_XF3, "\033O*R"}, -- {K_XF4, "\033O*S"}, -- {K_F1, "\033[11;*~"}, -- {K_F2, "\033[12;*~"}, -- {K_F3, "\033[13;*~"}, -- {K_F4, "\033[14;*~"}, -+ {K_XF1, "\033[11~"}, -+ {K_XF2, "\033[12~"}, -+ {K_XF3, "\033[13~"}, -+ {K_XF4, "\033[14~"}, -+ {K_F1, "\033OP"}, -+ {K_F2, "\033OQ"}, -+ {K_F3, "\033OR"}, -+ {K_F4, "\033OS"}, - {K_F5, "\033[15;*~"}, - {K_F6, "\033[17;*~"}, - {K_F7, "\033[18;*~"}, +- {K_XF1, IF_EB("\033O*P", ESC_STR "O*P")}, +- {K_XF2, IF_EB("\033O*Q", ESC_STR "O*Q")}, +- {K_XF3, IF_EB("\033O*R", ESC_STR "O*R")}, +- {K_XF4, IF_EB("\033O*S", ESC_STR "O*S")}, +- {K_F1, IF_EB("\033[11;*~", ESC_STR "[11;*~")}, +- {K_F2, IF_EB("\033[12;*~", ESC_STR "[12;*~")}, +- {K_F3, IF_EB("\033[13;*~", ESC_STR "[13;*~")}, +- {K_F4, IF_EB("\033[14;*~", ESC_STR "[14;*~")}, ++ {K_XF1, IF_EB("\033[11~", ESC_STR "[11~")}, ++ {K_XF2, IF_EB("\033[12~", ESC_STR "[12~")}, ++ {K_XF3, IF_EB("\033[13~", ESC_STR "[13~")}, ++ {K_XF4, IF_EB("\033[14~", ESC_STR "[14~")}, ++ {K_F1, IF_EB("\033OP", ESC_STR "OP")}, ++ {K_F2, IF_EB("\033OQ", ESC_STR "OQ")}, ++ {K_F3, IF_EB("\033OR", ESC_STR "OR")}, ++ {K_F4, IF_EB("\033OS", ESC_STR "OS")}, + {K_F5, IF_EB("\033[15;*~", ESC_STR "[15;*~")}, + {K_F6, IF_EB("\033[17;*~", ESC_STR "[17;*~")}, + {K_F7, IF_EB("\033[18;*~", ESC_STR "[18;*~")}, diff --git a/SOURCES/vim-7.0-rclocation.patch b/SOURCES/vim-7.0-rclocation.patch old mode 100755 new mode 100644 diff --git a/SOURCES/vim-7.4-releasestring-1318991.patch b/SOURCES/vim-7.4-releasestring-1318991.patch old mode 100755 new mode 100644 diff --git a/SOURCES/vim-7.4-syntax.patch b/SOURCES/vim-7.4-syntax.patch old mode 100755 new mode 100644 diff --git a/SOURCES/vim-8.0-copy-paste.patch b/SOURCES/vim-8.0-copy-paste.patch index bd5bbd4..73870cd 100644 --- a/SOURCES/vim-8.0-copy-paste.patch +++ b/SOURCES/vim-8.0-copy-paste.patch @@ -1,8 +1,8 @@ diff --git a/runtime/defaults.vim b/runtime/defaults.vim -index f1d5cd1..b08de8e 100644 +index f3c639b..20637e2 100644 --- a/runtime/defaults.vim +++ b/runtime/defaults.vim -@@ -74,18 +74,6 @@ sunmap Q +@@ -73,18 +73,6 @@ map Q gq " Revert with ":iunmap ". inoremap u @@ -22,7 +22,7 @@ index f1d5cd1..b08de8e 100644 if 1 diff --git a/src/testdir/test_balloon.vim b/src/testdir/test_balloon.vim -index ed0c6c1..90c8c40 100644 +index 319e546..8fcf63c 100644 --- a/src/testdir/test_balloon.vim +++ b/src/testdir/test_balloon.vim @@ -9,6 +9,7 @@ source screendump.vim @@ -31,10 +31,10 @@ index ed0c6c1..90c8c40 100644 let s:common_script =<< trim [CODE] + set mouse=a call setline(1, ["one one one", "two tXo two", "three three three"]) - set balloonevalterm balloonexpr=MyBalloonExpr()..s:trailing balloondelay=100 - let s:trailing = '<' " check that script context is set + set balloonevalterm balloonexpr=MyBalloonExpr() balloondelay=100 + func MyBalloonExpr() diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim -index b91689e..c6b70d1 100644 +index f13252b..ec755a4 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -553,6 +553,7 @@ func Test_popup_drag() @@ -45,23 +45,15 @@ index b91689e..c6b70d1 100644 split vsplit $wincmd w -@@ -621,6 +622,7 @@ func Test_popup_drag_minwidth() - - " create a popup that does not fit - let lines =<< trim END -+ set mouse=a - call range(40) - \ ->map({_,i -> string(i)}) - \ ->popup_create({ -@@ -669,6 +671,7 @@ func Test_popup_drag_termwin() +@@ -599,6 +600,7 @@ func Test_popup_drag_termwin() let lines =<< trim END set foldmethod=marker call setline(1, range(100)) -+ set mouse=a ++ set mouse=a for nr in range(7) call setline(nr * 12 + 1, "fold {{{") call setline(nr * 12 + 11, "end }}}") -@@ -722,6 +725,7 @@ func Test_popup_close_with_mouse() +@@ -652,6 +654,7 @@ func Test_popup_close_with_mouse() let lines =<< trim END call setline(1, range(1, 20)) @@ -69,7 +61,7 @@ index b91689e..c6b70d1 100644 " With border, can click on X let winid = popup_create('foobar', #{ \ close: 'button', -@@ -1557,6 +1561,7 @@ func Test_popup_beval() +@@ -1479,6 +1482,7 @@ func Test_popup_beval() let lines =<< trim END call setline(1, range(1, 20)) call setline(5, 'here is some text to hover over') @@ -77,7 +69,7 @@ index b91689e..c6b70d1 100644 set balloonevalterm set balloonexpr=BalloonExpr() set balloondelay=100 -@@ -2262,6 +2267,7 @@ func Test_popup_scrollbar() +@@ -2170,6 +2174,7 @@ func Test_popup_scrollbar() let lines =<< trim END call setline(1, range(1, 20)) diff --git a/SOURCES/vim-8.2-2637.tar.bz2 b/SOURCES/vim-8.2-2637.tar.bz2 deleted file mode 100755 index 462bef9..0000000 Binary files a/SOURCES/vim-8.2-2637.tar.bz2 and /dev/null differ diff --git a/SOURCES/vim-crypto-warning.patch b/SOURCES/vim-crypto-warning.patch index 3b66423..80c36da 100644 --- a/SOURCES/vim-crypto-warning.patch +++ b/SOURCES/vim-crypto-warning.patch @@ -1,10 +1,11 @@ diff -up vim82/src/config.h.in.fips-warning vim82/src/config.h.in ---- vim82/src/config.h.in.fips-warning 2022-02-24 08:13:59.017280243 +0100 -+++ vim82/src/config.h.in 2022-02-24 08:14:33.085580298 +0100 -@@ -508,5 +508,14 @@ +--- vim82/src/config.h.in.fips-warning 2021-03-01 12:20:20.887162181 +0100 ++++ vim82/src/config.h.in 2021-03-01 12:20:42.520977438 +0100 +@@ -499,3 +499,12 @@ + /* Define if _SC_SIGSTKSZ is available via sysconf() */ #undef HAVE_SYSCONF_SIGSTKSZ - ++ +/* Do we need FIPS warning? */ +#undef HAVE_FIPS_WARNING + @@ -13,14 +14,11 @@ diff -up vim82/src/config.h.in.fips-warning vim82/src/config.h.in + +/* Link to fips_enabled file */ +#undef FIPS_ENABLED_FILE_LINK -+ - /* Define if you want to load libgpm dynamically */ - #undef DYNAMIC_GPM diff -up vim82/src/configure.ac.fips-warning vim82/src/configure.ac ---- vim82/src/configure.ac.fips-warning 2022-02-24 08:13:59.014280304 +0100 -+++ vim82/src/configure.ac 2022-02-24 08:13:59.018280222 +0100 -@@ -583,6 +583,38 @@ else - AC_SUBST(XDIFF_OBJS_USED) +--- vim82/src/configure.ac.fips-warning 2021-03-01 12:20:20.885162198 +0100 ++++ vim82/src/configure.ac 2021-03-01 12:20:20.888162173 +0100 +@@ -541,6 +541,38 @@ else + AC_MSG_RESULT(yes) fi +dnl Checking if we want FIPS warning @@ -59,9 +57,9 @@ diff -up vim82/src/configure.ac.fips-warning vim82/src/configure.ac AC_MSG_CHECKING(--enable-luainterp argument) AC_ARG_ENABLE(luainterp, diff -up vim82/src/crypt.c.fips-warning vim82/src/crypt.c ---- vim82/src/crypt.c.fips-warning 2022-02-24 08:09:29.000000000 +0100 -+++ vim82/src/crypt.c 2022-02-24 08:13:59.018280222 +0100 -@@ -740,6 +740,21 @@ crypt_check_method(int method) +--- vim82/src/crypt.c.fips-warning 2021-03-01 12:13:11.000000000 +0100 ++++ vim82/src/crypt.c 2021-03-01 12:20:20.888162173 +0100 +@@ -523,6 +523,21 @@ crypt_check_method(int method) msg_scroll = TRUE; msg(_("Warning: Using a weak encryption method; see :help 'cm'")); } @@ -82,4 +80,4 @@ diff -up vim82/src/crypt.c.fips-warning vim82/src/crypt.c +#endif } - #ifdef FEAT_SODIUM + void diff --git a/SOURCES/vim-cve-var-retab.patch b/SOURCES/vim-cve-var-retab.patch old mode 100755 new mode 100644 diff --git a/SOURCES/virc b/SOURCES/virc index 6d77982..df4d4f4 100644 --- a/SOURCES/virc +++ b/SOURCES/virc @@ -27,6 +27,7 @@ if has("autocmd") augroup END endif + if &term=="xterm" set t_Co=8 set t_Sb=[4%dm diff --git a/SPECS/vim.spec b/SPECS/vim.spec index c5d27ce..2cc9194 100644 --- a/SPECS/vim.spec +++ b/SPECS/vim.spec @@ -1,29 +1,18 @@ -%bcond_without gui - -%if 0%{?fedora} -%bcond_without default_editor -%bcond_without libsodium_crypt -%else -%bcond_with default_editor -%bcond_with libsodium_crypt -%endif - -%define patchlevel 475 - +%define patchlevel 2637 %if %{?WITH_SELINUX:0}%{!?WITH_SELINUX:1} %define WITH_SELINUX 1 %endif - -%if %{with gui} %define desktop_file 1 -%else -%define desktop_file 0 -%endif - %if %{desktop_file} %define desktop_file_utils_version 0.2.93 %endif +%if 0%{?fedora} +%bcond_without default_editor +%else +%bcond_with default_editor +%endif + %define withnetbeans 1 %define withvimspell 0 @@ -31,17 +20,16 @@ %define withruby 1 %define withlua 1 -%define baseversion 9.0 -%define vimdir vim-%{baseversion}.0%{patchlevel} +%define baseversion 8.2 +%define vimdir vim82 Summary: The VIM editor URL: http://www.vim.org/ Name: vim Version: %{baseversion}.%{patchlevel} -Release: 1%{?dist} -Epoch: 2 +Release: 16%{?dist}.3 License: Vim and MIT -Source0: https://github.com/vim/vim/archive/refs/tags/v%{baseversion}.0%{patchlevel}.tar.gz +Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2 Source1: virc Source2: vimrc Source3: gvim16.png @@ -61,87 +49,116 @@ Source100: vim-spell-files.tar.bz2 %endif -Patch2000: vim-7.0-fixkeys.patch -Patch2001: vim-7.4-specsyntax.patch - +Patch2002: vim-7.0-fixkeys.patch +Patch2003: vim-7.4-specsyntax.patch %if %{withhunspell} -Patch2002: vim-7.0-hunspell.patch +Patch2011: vim-7.0-hunspell.patch BuildRequires: hunspell-devel %endif -Patch3000: vim-7.4-fstabsyntax.patch -Patch3001: vim-7.3-manpage-typo-668894-675480.patch -Patch3002: vim-manpagefixes-948566.patch -Patch3003: vim-7.4-globalsyntax.patch +Patch3000: vim-7.4-syntax.patch +Patch3004: vim-7.0-rclocation.patch +Patch3007: vim-7.4-fstabsyntax.patch +Patch3010: vim-7.3-manpage-typo-668894-675480.patch +Patch3011: vim-manpagefixes-948566.patch +Patch3013: vim-7.4-globalsyntax.patch +Patch3014: vim-7.4-releasestring-1318991.patch +Patch3016: vim-8.0-copy-paste.patch # migrate shebangs in script to /usr/bin/python3 and use python2 when necessary -Patch3004: vim-python3-tests.patch -# fips warning (Fedora downstream patch) -Patch3005: vim-crypto-warning.patch -# don't ever set mouse (Fedora downstream patch) -Patch3006: vim-8.0-copy-paste.patch - - -# uses autoconf in spec file -BuildRequires: autoconf - -%if %{desktop_file} -# for /usr/bin/desktop-file-install -BuildRequires: desktop-file-utils >= %{desktop_file_utils_version} -Requires: desktop-file-utils -%endif +Patch3017: vim-python3-tests.patch +# fips warning +Patch3018: vim-crypto-warning.patch +Patch3019: 0001-patch-8.2.3115-Coverity-complains-about-free_wininfo.patch +Patch3020: 0001-patch-8.2.3290-Vim9-compiling-dict-may-use-pointer-a.patch +# 2002320 - CVE-2021-3770 vim: using retab with large value may lead to heap buffer overflow [rhel-9.0] +Patch3021: vim-cve-var-retab.patch +# 2004893 - CVE-2021-3778 vim: heap-based buffer overflow in utf_ptr2char() in mbyte.c [rhel-9.0] +Patch3022: 0001-patch-8.2.3409-reading-beyond-end-of-line-with-inval.patch +# 2004976 - CVE-2021-3796 vim: use-after-free in nv_replace() in normal.c [rhel-9.0] +Patch3023: 0001-patch-8.2.3428-using-freed-memory-when-replacing.patch +# 2015517 - [s390x] Vim needs to be compiled with -D_REENTRANT +Patch3024: 0001-patch-8.2.3406-on-some-systems-tests-fail-without-_R.patch +# 2016202 - CVE-2021-3872 vim: heap-based buffer overflow in win_redr_status() drawscreen.c [rhel-9.0] +Patch3025: 0001-patch-8.2.3487-illegal-memory-access-if-buffer-name-.patch +# 2028342 - CVE-2021-3984 vim: illegal memory access when C-indenting could lead to Heap Buffer Overflow [rhel-9.0] +Patch3026: 0001-patch-8.2.3625-illegal-memory-access-when-C-indentin.patch +# 2028431 - CVE-2021-4019 vim: heap-based buffer overflow in find_help_tags() in src/help.c [rhel-9.0] +Patch3027: 0001-patch-8.2.3669-buffer-overflow-with-long-help-argume.patch +# CVE-2021-4193 vim: vulnerable to Out-of-bounds Read +Patch3028: 0001-patch-8.2.3950-going-beyond-the-end-of-the-line-with.patch +# CVE-2021-4192 vim: vulnerable to Use After Free +Patch3029: 0001-patch-8.2.3949-using-freed-memory-with-V.patch +# CVE-2022-0261 vim: Heap-based Buffer Overflow in block_insert() in src/ops.c +Patch3030: 0001-patch-8.2.4120-block-insert-goes-over-the-end-of-the.patch +# CVE-2022-0318 vim: heap-based buffer overflow in utf_head_off() in mbyte.c +Patch3031: 0001-patch-8.2.4151-reading-beyond-the-end-of-a-line.patch +# CVE-2022-0359 vim: heap-based buffer overflow in init_ccline() in ex_getln.c +Patch3032: 0001-patch-8.2.4214-illegal-memory-access-with-large-tabs.patch +# CVE-2022-0319 vim: heap-based out-of-bounds read +Patch3033: 0001-patch-8.2.4154-ml_get-error-when-exchanging-windows-.patch +# CVE-2022-0361 vim: Heap-based Buffer Overflow in GitHub repository +Patch3034: 0001-patch-8.2.4215-illegal-memory-access-when-copying-li.patch +# CVE-2022-0368 vim: Out-of-bounds Read in vim +Patch3035: 0001-patch-8.2.4217-illegal-memory-access-when-undo-makes.patch +# CVE-2022-0417 vim: heap-based-buffer-overflow in ex_retab() of src/indent.c +Patch3036: 0001-patch-8.2.4245-retab-0-may-cause-illegal-memory-acce.patch +# CVE-2022-0408 vim: Stack-based Buffer Overflow in spellsuggest.c +Patch3037: 0001-patch-8.2.4247-stack-corruption-when-looking-for-spe.patch +# CVE-2022-0413 vim: use after free in src/ex_cmds.c +Patch3038: 0001-patch-8.2.4253-using-freed-memory-when-substitute-wi.patch +# CVE-2022-0443 vim: heap-use-after-free in enter_buffer() of src/buffer.c +Patch3039: 0001-patch-8.2.4281-using-freed-memory-with-lopen-and-bwi.patch +# CVE-2022-0392 vim: heap-based buffer overflow in getexmodeline() in ex_getln.c +Patch3040: 0001-patch-8.2.4218-illegal-memory-access-with-bracketed-.patch +# CVE-2022-0572 vim: heap overflow in ex_retab() may lead to crash +Patch3041: 0001-patch-8.2.4359-crash-when-repeatedly-using-retab.patch +# CVE-2022-0629 vim: Stack-based Buffer Overflow in vim prior to 8.2 +Patch3042: 0001-patch-8.2.4397-crash-when-using-many-composing-chara.patch +# CVE-2022-0714 vim: buffer overflow [rhel-9] +Patch3043: 0001-patch-8.2.4436-crash-with-weird-vartabstop-value.patch +# CVE-2022-0554 vim: Use of Out-of-range Pointer Offset in vim prior +Patch3044: 0001-patch-8.2.4327-may-end-up-with-no-current-buffer.patch +# CVE-2022-0943 vim: Heap-based Buffer Overflow occurs in vim +Patch3045: 0001-patch-8.2.4563-z-in-Visual-mode-may-go-beyond-the-en.patch +# CVE-2022-1154 vim: use after free in utf_ptr2char +Patch3046: 0001-patch-8.2.4646-using-buffer-line-after-it-has-been-f.patch +# CVE-2022-1420 vim: Out-of-range Pointer Offset +Patch3047: 0001-patch-8.2.4774-crash-when-using-a-number-for-lambda-.patch +# CVE-2022-1621 vim: heap buffer overflow +Patch3048: 0001-patch-8.2.4919-can-add-invalid-bytes-with-spellgood.patch +# CVE-2022-1629 vim: buffer over-read +Patch3049: 0001-patch-8.2.4925-trailing-backslash-may-cause-reading-.patch +# CVE-2022-1785 vim: Out-of-bounds Write +Patch3050: 0001-patch-8.2.4977-memory-access-error-when-substitute-e.patch +# CVE-2022-1897 vim: out-of-bounds write in vim_regsub_both() in regexp.c +Patch3051: 0001-patch-8.2.5023-substitute-overwrites-allocated-buffe.patch +# CVE-2022-1927 vim: buffer over-read in utf_ptr2char() in mbyte.c +Patch3052: 0001-patch-8.2.5037-cursor-position-may-be-invalid-after-.patch # gcc is no longer in buildroot by default BuildRequires: gcc -# for translations -BuildRequires: gettext - -# glibc in F35 bootstraped several conversion formats from -# iconv into a separate package. Vim needs those additional -# formats during compilation. -# remove the conditional once F34 is EOL and leave -# only BuildRequires here -%if 0%{?fedora} >= 35 -BuildRequires: glibc-gconv-extra -%endif - -# for mouse support in console -BuildRequires: gpm-devel -# for setting ACL on created files -BuildRequires: libacl-devel +# uses make +BuildRequires: make -# selinux support +BuildRequires: python3-devel ncurses-devel gettext perl-devel +BuildRequires: perl-generators +BuildRequires: perl(ExtUtils::Embed) perl(ExtUtils::ParseXS) +BuildRequires: libacl-devel gpm-devel autoconf file %if %{WITH_SELINUX} BuildRequires: libselinux-devel %endif - -# for xchacha20 encryption -%if %{with libsodium_crypt} -BuildRequires: libsodium-devel +%if "%{withruby}" == "1" +BuildRequires: ruby-devel ruby %endif - -# for lua plugin %if "%{withlua}" == "1" BuildRequires: lua-devel %endif - -# uses make -BuildRequires: make -# screen handling library -BuildRequires: ncurses-devel -# for perl plugin -BuildRequires: perl-devel -BuildRequires: perl-generators -BuildRequires: perl(ExtUtils::Embed) -BuildRequires: perl(ExtUtils::ParseXS) -# for python plugin -BuildRequires: python3-devel - -# for ruby plugin -%if "%{withruby}" == "1" -BuildRequires: ruby -BuildRequires: ruby-devel +%if %{desktop_file} +# for /usr/bin/desktop-file-install +Requires: desktop-file-utils +BuildRequires: desktop-file-utils >= %{desktop_file_utils_version} %endif - +Epoch: 2 %description VIM (VIsual editor iMproved) is an updated and improved version of the @@ -151,12 +168,8 @@ multiple windows, multi-level undo, block highlighting and more. %package common Summary: The common files needed by any version of the VIM editor -# conflicts in package because of manpage move (bug #1599663) -# conflicts because of defaults.vim (bug #2026651) -# remove after F36 EOL+after release CentOS Stream > 9 -Conflicts: %{name}-minimal < %{epoch}:8.2.3642-2 -# shared files between common and minimal -Requires: %{name}-data = %{epoch}:%{version}-%{release} +# remove when a new RHEL is released (current 8) +Conflicts: %{name}-minimal < %{epoch}:8.1.1-1 Requires: %{name}-filesystem %description common @@ -181,13 +194,12 @@ many different languages. %package minimal Summary: A minimal version of the VIM editor # conflicts in package because of manpage move (bug #1599663) -# conflicts because of defaults.vim (bug #2026651) -# remove after F36 EOL+after release CentOS Stream > 9 -Conflicts: %{name}-common < %{epoch}:8.2.3642-2 +# remove when a new RHEL is released (current 8) +Conflicts: %{name}-common < %{epoch}:8.1.1-1 +Conflicts: vim-wrappers < 2:8.2.2488-1 +Obsoletes: vim-wrappers < 2:8.2.2488-1 Provides: vi Provides: %{_bindir}/vi -# shared files between common and minimal -Requires: %{name}-data = %{epoch}:%{version}-%{release} %description minimal VIM (VIsual editor iMproved) is an updated and improved version of the @@ -200,32 +212,25 @@ only available when the vim-common package is installed. %package enhanced Summary: A version of the VIM editor which includes recent enhancements +Conflicts: vim-wrappers < 2:8.2.2488-1 # vim bundles libvterm, which is used during build - so we need to provide # bundled libvterm for catching possible libvterm CVEs Provides: bundled(libvterm) Provides: vim -Provides: vim(plugins-supported) Provides: %{_bindir}/mergetool Provides: %{_bindir}/vim -Requires: vim-common = %{epoch}:%{version}-%{release} -# required for vimtutor (#395371) -Requires: which +Requires: vim-common = %{epoch}:%{version}-%{release} which # suggest python3, python2, lua, ruby and perl packages because of their # embedded functionality in Vim/GVim +Suggests: python3 python3-libs +Suggests: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) perl-devel +%if "%{withruby}" == "1" +Suggests: ruby-libs ruby +%endif %if "%{withlua}" == "1" Suggests: lua-libs %endif -Suggests: perl-devel -Suggests: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) -Suggests: python3 -Suggests: python3-libs - -%if "%{withruby}" == "1" -Suggests: ruby -Suggests: ruby-libs -%endif - %description enhanced VIM (VIsual editor iMproved) is an updated and improved version of the vi editor. Vi was the first real screen-based editor for UNIX, and is @@ -247,55 +252,34 @@ BuildArch: noarch This package provides some directories which are required by other packages that add vim files, p.e. additional syntax files or filetypes. -%if %{with gui} %package X11 Summary: The VIM version of the vi editor for the X Window System - GVim -# devel of libICE, gtk3, libSM, libX11, libXpm and libXt are needed in buildroot -# so configure script can have correct macros enabled for GUI (#1603272) -# generic gnome toolkit for graphical support +# needed in configure script to have correct macros enabled for GUI (#1603272) BuildRequires: gtk3-devel -# inter-client exchange library - for X session management protocol -BuildRequires: libICE-devel -# X session management library -BuildRequires: libSM-devel -# core X11 protocol client library -BuildRequires: libX11-devel -# X PixMap library for X11 - for creating images in X PixMap format -BuildRequires: libXpm-devel -# X Toolkit Intrinsics library - working with widgets? -BuildRequires: libXt-devel -# for testing validity of appdata file BuildRequires: libappstream-glib # for sound support BuildRequires: libcanberra-devel +BuildRequires: libX11-devel +BuildRequires: libSM-devel +BuildRequires: libXt-devel +BuildRequires: libXpm-devel +BuildRequires: libICE-devel Provides: gvim -Provides: vim(plugins-supported) Provides: %{_bindir}/mergetool Provides: %{_bindir}/gvim -# GVIM graphics are based on GTK3 -Requires: gtk3 -# needed for icons (#226526) Requires: hicolor-icon-theme -# for getting/setting extended attributes - they are pairs (name:value) -# from inodes (files, dirs etc.) -Requires: libattr >= 2.4 -Requires: vim-common = %{epoch}:%{version}-%{release} +Requires: vim-common = %{epoch}:%{version}-%{release} libattr >= 2.4 gtk3 # suggest python3, python2, lua, ruby and perl packages because of their # embedded functionality in Vim/GVim - %if "%{withlua}" == "1" +Suggests: python3 python3-libs +Suggests: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) perl-devel +%if "%{withruby}" == "1" +Suggests: ruby-libs ruby +%endif +%if "%{withlua}" == "1" Suggests: lua-libs - %endif - -Suggests: perl-devel -Suggests: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) -Suggests: python3 -Suggests: python3-libs - - %if "%{withruby}" == "1" -Suggests: ruby -Suggests: ruby-libs - %endif +%endif %description X11 VIM (VIsual editor iMproved) is an updated and improved version of the @@ -309,26 +293,14 @@ application with a full GUI interface and mouse support by command gvim. Install the vim-X11 package if you'd like to try out a version of vi with graphics and mouse capabilities. You'll also need to install the vim-common package. -%endif - -%package data -Summary: Shared data for Vi and Vim -BuildArch: noarch -# moved files from filesystem, common and minimal to data -# remove after F36 EOL+after release of CentOS Stream > 9 -Conflicts: %{name}-common < 2:8.2.3642-2 -Conflicts: %{name}-filesystem < 2:8.2.3642-2 -Conflicts: %{name}-minimal < 2:8.2.3642-2 - -%description data -The subpackage is used for shipping files and directories, which need to be -shared between vim-minimal and vim-common packages. %if %{with default_editor} %package default-editor Summary: Set vim as the default editor BuildArch: noarch Conflicts: system-default-editor +# conflict with nano-default-editor which doesn't provide system-default-editor +Conflicts: nano-default-editor < 5.3-3 Provides: system-default-editor Requires: vim-enhanced @@ -341,17 +313,15 @@ This subpackage contains files needed to set Vim as the default editor. %setup -q -b 0 -n %{vimdir} # use %%{__python3} macro for defining shebangs in python3 tests -sed -i -e 's,/usr/bin/python3,%{__python3},' %{PATCH3005} +sed -i -e 's,/usr/bin/python3,%{__python3},' %{PATCH3017} # fix rogue dependencies from sample code chmod -x runtime/tools/mve.awk -%patch2000 -p1 -b .fixkeys -%patch2001 -p1 - +%patch2002 -p1 -b .fixkeys +%patch2003 -p1 %if %{withhunspell} -%patch2002 -p1 +%patch2011 -p1 %endif - perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk # install spell files @@ -359,22 +329,63 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk %{__tar} xjf %{SOURCE100} %endif -%patch3000 -p1 -b .fstabsyntax -%patch3001 -p1 -%patch3002 -p1 -%patch3003 -p1 -%patch3004 -p1 -b .python-tests -%patch3005 -p1 -b .fips-warning -%patch3006 -p1 -b .copypaste +%patch3000 -p1 +%patch3004 -p1 +%patch3007 -p1 -b .fstabsyntax +%patch3010 -p1 +%patch3011 -p1 +%patch3013 -p1 +%patch3014 -p1 +%patch3016 -p1 -b .copypaste +%patch3017 -p1 -b .python-tests +%patch3018 -p1 -b .fips-warning +%patch3019 -p1 -b .covscan-free-wininfo +%patch3020 -p1 -b .covscan-key-freed +%patch3021 -p1 -b .cve-var-retab +%patch3022 -p1 -b .cve-utf-ptrchar +%patch3023 -p1 -b .cve-nv-replace +%patch3024 -p1 -b .reentrant +%patch3025 -p1 -b .cve-win-redr +%patch3026 -p1 -b .cve3984 +%patch3027 -p1 -b .cve4019 +%patch3028 -p1 -b .cve4193 +%patch3029 -p1 -b .cve4192 +%patch3030 -p1 -b .cve0261 +%patch3031 -p1 -b .cve0318 +%patch3032 -p1 -b .cve0359 +%patch3033 -p1 -b .cve0319 +%patch3034 -p1 -b .cve0361 +%patch3035 -p1 -b .cve0368 +%patch3036 -p1 -b .cve0417 +%patch3037 -p1 -b .cve0408 +%patch3038 -p1 -b .cve0413 +%patch3039 -p1 -b .cve0443 +%patch3040 -p1 -b .cve0392 +%patch3041 -p1 -b .cve0572 +%patch3042 -p1 -b .cve0629 +%patch3043 -p1 -b .cve0714 +%patch3044 -p1 -b .cve0554 +%patch3045 -p1 -b .cve0943 +%patch3046 -p1 -b .cve1154 +%patch3047 -p1 -b .cve1420 +%patch3048 -p1 -b .cve1621 +%patch3049 -p1 -b .cve1629 +%patch3050 -p1 -b .cve1785 +%patch3051 -p1 -b .cve1897 +%patch3052 -p1 -b .cve1927 %build cd src autoconf +sed -e "s+VIMRCLOC = \$(VIMLOC)+VIMRCLOC = /etc+" Makefile > Makefile.tmp +mv -f Makefile.tmp Makefile + export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2" export CXXFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2" cp -f os_unix.h os_unix.h.save +cp -f ex_cmds.c ex_cmds.c.save # Configure options: # --enable-fail-if-missing - we need to fail if configure options aren't satisfied @@ -389,8 +400,7 @@ cp -f os_unix.h os_unix.h.save # --disable-gpm - disabling support for General Purpose Mouse - Linux mouse daemon perl -pi -e "s/vimrc/virc/" os_unix.h -%configure CFLAGS="${CFLAGS} -DSYS_VIMRC_FILE='\"/etc/virc\"'" \ - --prefix=%{_prefix} --with-features=small --with-x=no \ +%configure --prefix=%{_prefix} --with-features=small --with-x=no \ --enable-multibyte \ --disable-netbeans \ %if %{WITH_SELINUX} @@ -404,23 +414,21 @@ perl -pi -e "s/vimrc/virc/" os_unix.h --with-modified-by="" \ --enable-fips-warning \ --enable-fail-if-missing \ - --disable-canberra \ - --disable-libsodium + --disable-canberra -%make_build +%make_build VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} cp vim minimal-vim make clean mv -f os_unix.h.save os_unix.h +mv -f ex_cmds.c.save ex_cmds.c -%if %{with gui} # More configure options: # --enable-xim - enabling X Input Method - international input module for X, # it is for multibyte languages in Vim with X # --enable-termtruecolor - use terminal with true colors -%configure CFLAGS="${CFLAGS} -DSYS_VIMRC_FILE='\"/etc/vimrc\"'" \ - --with-features=huge \ +%configure --with-features=huge \ --enable-python3interp=dynamic \ --enable-perlinterp=dynamic \ --disable-tclinterp --with-x=yes \ @@ -430,41 +438,34 @@ mv -f os_unix.h.save os_unix.h --enable-fips-warning \ --with-compiledby="" --enable-cscope \ --with-modified-by="" \ - %if "%{withnetbeans}" == "1" +%if "%{withnetbeans}" == "1" --enable-netbeans \ - %else +%else --disable-netbeans \ - %endif - %if %{WITH_SELINUX} +%endif +%if %{WITH_SELINUX} --enable-selinux \ - %else +%else --disable-selinux \ - %endif - %if "%{withruby}" == "1" +%endif +%if "%{withruby}" == "1" --enable-rubyinterp=dynamic \ - %else +%else --disable-rubyinterp \ - %endif - %if "%{withlua}" == "1" +%endif +%if "%{withlua}" == "1" --enable-luainterp=dynamic \ - %else +%else --disable-luainterp \ - %endif - %if %{with libsodium_crypt} - --enable-libsodium \ - %else - --disable-libsodium \ - %endif +%endif --enable-fail-if-missing \ --enable-canberra -%make_build +%make_build VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} cp vim gvim make clean -%endif -%configure CFLAGS="${CFLAGS} -DSYS_VIMRC_FILE='\"/etc/vimrc\"'" \ - --prefix=%{_prefix} --with-features=huge \ +%configure --prefix=%{_prefix} --with-features=huge \ --enable-python3interp=dynamic \ --enable-perlinterp=dynamic \ --disable-tclinterp \ @@ -493,16 +494,11 @@ make clean --enable-luainterp=dynamic \ %else --disable-luainterp \ -%endif -%if %{with libsodium_crypt} - --enable-libsodium \ -%else - --disable-libsodium \ %endif --enable-fail-if-missing \ --disable-canberra -%make_build +%make_build VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} cp vim enhanced-vim %install @@ -519,20 +515,18 @@ cd src # Adding STRIP=/bin/true, because Vim wants to strip the binaries by himself # and put the stripped files into correct dirs. Build system (koji/brew) # does it for us, so there is no need to do it in Vim -%make_install BINDIR=%{_bindir} STRIP=/bin/true +%make_install BINDIR=%{_bindir} VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} STRIP=/bin/true # make install creates vim binary and view symlink, they will be wrappers # so remove them here -rm -f %{buildroot}%{_bindir}/{vim,view} +%{_bindir}/rm -f %{buildroot}%{_bindir}/{vim,view} +make installgtutorbin DESTDIR=%{buildroot} BINDIR=%{_bindir} VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} mkdir -p %{buildroot}%{_datadir}/icons/hicolor/{16x16,32x32,48x48,64x64}/apps mkdir -p %{buildroot}%{_libexecdir} install -m755 minimal-vim %{buildroot}%{_libexecdir}/vi install -m755 enhanced-vim %{buildroot}%{_bindir}/vim +install -m755 gvim %{buildroot}%{_bindir}/gvim install -m755 %{SOURCE12} %{buildroot}%{_bindir}/view install -m755 %{SOURCE13} %{buildroot}%{_bindir}/vi - -%if %{with gui} -make installgtutorbin DESTDIR=%{buildroot} BINDIR=%{_bindir} -install -m755 gvim %{buildroot}%{_bindir}/gvim install -p -m644 %{SOURCE3} \ %{buildroot}%{_datadir}/icons/hicolor/16x16/apps/gvim.png install -p -m644 %{SOURCE4} \ @@ -585,26 +579,12 @@ SentUpstream: 2014-05-22 EOF -appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*.appdata.xml - -for i in gvim.1 gex.1 gview.1 vimx.1; do - echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man1/$i -done -echo ".so man1/vimdiff.1" > %{buildroot}/%{_mandir}/man1/gvimdiff.1 -echo ".so man1/vimtutor.1" > %{buildroot}/%{_mandir}/man1/gvimtutor.1 -%else -# Remove files included in X11 subpackage, but built by default: -rm %{buildroot}/%{_mandir}/man1/evim.* -rm %{buildroot}/%{_datadir}/applications/{vim,gvim}.desktop -rm %{buildroot}/%{_datadir}/icons/{hicolor,locolor}/*/apps/gvim.png -%endif - ( cd %{buildroot} ln -sf %{_libexecdir}/vi .%{_bindir}/rvi ln -sf %{_libexecdir}/vi .%{_bindir}/rview ln -sf %{_libexecdir}/vi .%{_bindir}/ex - ln -sf vim .%{_bindir}/rvim - ln -sf vim .%{_bindir}/vimdiff + ln -sf %{_bindir}/vim .%{_bindir}/rvim + ln -sf %{_bindir}/vim .%{_bindir}/vimdiff perl -pi -e "s,%{buildroot},," .%{_mandir}/man1/vim.1 .%{_mandir}/man1/vimtutor.1 rm -f .%{_mandir}/man1/rvim.1 cp -p .%{_mandir}/man1/vim.1 .%{_mandir}/man1/vi.1 @@ -613,14 +593,11 @@ rm %{buildroot}/%{_datadir}/icons/{hicolor,locolor}/*/apps/gvim.png ln -sf vi.1.gz .%{_mandir}/man1/view.1 ln -sf vi.1.gz .%{_mandir}/man1/rview.1 ln -sf vim.1.gz .%{_mandir}/man1/vimdiff.1.gz - -%if %{with gui} ln -sf gvim ./%{_bindir}/gview ln -sf gvim ./%{_bindir}/gex ln -sf gvim ./%{_bindir}/evim ln -sf gvim ./%{_bindir}/gvimdiff ln -sf gvim ./%{_bindir}/vimx - %if "%{desktop_file}" == "1" desktop-file-install \ --dir %{buildroot}/%{_datadir}/applications \ @@ -630,14 +607,13 @@ rm %{buildroot}/%{_datadir}/icons/{hicolor,locolor}/*/apps/gvim.png mkdir -p ./%{_sysconfdir}/X11/applnk/Applications cp %{buildroot}/%{_datadir}/applications/gvim.desktop ./%{_sysconfdir}/X11/applnk/Applications/gvim.desktop %endif - -%endif - # ja_JP.ujis is obsolete, ja_JP.eucJP is recommended. ( cd ./%{_datadir}/%{name}/%{vimdir}/lang; \ ln -sf menu_ja_jp.ujis.vim menu_ja_jp.eucjp.vim ) ) +appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*.appdata.xml + pushd %{buildroot}/%{_datadir}/%{name}/%{vimdir}/tutor mkdir conv iconv -f CP1252 -t UTF8 tutor.ca > conv/tutor.ca @@ -668,15 +644,7 @@ chmod 644 %{buildroot}/%{_datadir}/%{name}/%{vimdir}/doc/vim2html.pl \ %{buildroot}/%{_datadir}/%{name}/%{vimdir}/tools/vim132 chmod 644 ../runtime/doc/vim2html.pl -mkdir -p %{buildroot}%{_sysconfdir} -install -p -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/virc -install -p -m644 %{SOURCE2} %{buildroot}%{_sysconfdir}/vimrc - -# if Vim isn't built for Fedora, use redhat augroup -%if 0%{?rhel} >= 7 -sed -i -e "s/augroup fedora/augroup redhat/" %{buildroot}/%{_sysconfdir}/vimrc -sed -i -e "s/augroup fedora/augroup redhat/" %{buildroot}/%{_sysconfdir}/virc -%endif +mkdir -p %{buildroot}/%{_sysconfdir} %if %{with default_editor} mkdir -p %{buildroot}/%{_sysconfdir}/profile.d @@ -687,6 +655,15 @@ install -p -m644 %{SOURCE11} %{buildroot}/%{_datadir}/fish/vendor_conf.d/vim-def mkdir -p %{buildroot}/%{_datadir}/fish/vendor_functions.d/ %endif +install -p -m644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/virc +install -p -m644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/vimrc + +# if Vim isn't built for Fedora, use redhat augroup +%if 0%{?rhel} >= 7 +sed -i -e "s/augroup fedora/augroup redhat/" %{buildroot}/%{_sysconfdir}/vimrc +sed -i -e "s/augroup fedora/augroup redhat/" %{buildroot}/%{_sysconfdir}/virc +%endif + mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/ install -p -m644 %{SOURCE8} %{buildroot}%{_rpmconfigdir}/macros.d/ @@ -709,9 +686,11 @@ for i in fr.UTF-8 it.UTF-8 pl.UTF-8 da.UTF-8 de.UTF-8 tr.UTF-8; do rm -rf %{buildroot}/%{_mandir}/$i done -# Install symlink for rvim man page -echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man1/rvim.1 - +for i in rvim.1 gvim.1 gex.1 gview.1 vimx.1; do + echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man1/$i +done +echo ".so man1/vimdiff.1" > %{buildroot}/%{_mandir}/man1/gvimdiff.1 +echo ".so man1/vimtutor.1" > %{buildroot}/%{_mandir}/man1/gvimtutor.1 mkdir -p %{buildroot}/%{_mandir}/man5 echo ".so man1/vim.1" > %{buildroot}/%{_mandir}/man5/vimrc.5 echo ".so man1/vi.1" > %{buildroot}/%{_mandir}/man5/virc.5 @@ -729,17 +708,20 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %files common %config(noreplace) %{_sysconfdir}/vimrc %{!?_licensedir:%global license %%doc} +%license LICENSE %doc README* %doc runtime/docs +%dir %{_datadir}/%{name} +%{_datadir}/%{name}/vimfiles/template.spec +%dir %{_datadir}/%{name}/%{vimdir} +%{_datadir}/%{name}/%{vimdir}/rgb.txt %{_datadir}/%{name}/%{vimdir}/autoload %{_datadir}/%{name}/%{vimdir}/colors %{_datadir}/%{name}/%{vimdir}/compiler %{_datadir}/%{name}/%{vimdir}/pack %{_datadir}/%{name}/%{vimdir}/doc %{_datadir}/%{name}/%{vimdir}/*.vim -%exclude %{_datadir}/%{name}/%{vimdir}/defaults.vim %{_datadir}/%{name}/%{vimdir}/ftplugin -%{_datadir}/%{name}/%{vimdir}/import/dist/vimhelp.vim %{_datadir}/%{name}/%{vimdir}/indent %{_datadir}/%{name}/%{vimdir}/keymap %{_datadir}/%{name}/%{vimdir}/lang/*.vim @@ -750,11 +732,9 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %{_datadir}/%{name}/%{vimdir}/print %{_datadir}/%{name}/%{vimdir}/syntax %{_datadir}/%{name}/%{vimdir}/tutor - %if ! %{withvimspell} %{_datadir}/%{name}/%{vimdir}/spell %endif - %lang(af) %{_datadir}/%{name}/%{vimdir}/lang/af %lang(ca) %{_datadir}/%{name}/%{vimdir}/lang/ca %lang(cs) %{_datadir}/%{name}/%{vimdir}/lang/cs @@ -797,20 +777,16 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %lang(zh_CN.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/zh_CN.UTF-8 %lang(zh_TW.UTF-8) %{_datadir}/%{name}/%{vimdir}/lang/zh_TW.UTF-8 /%{_bindir}/xxd +%{_mandir}/man1/gex.* +%{_mandir}/man1/gview.* +%{_mandir}/man1/gvim* %{_mandir}/man1/rvim.* %{_mandir}/man1/vim.* %{_mandir}/man1/vimdiff.* %{_mandir}/man1/vimtutor.* +%{_mandir}/man1/vimx.* %{_mandir}/man1/xxd.* %{_mandir}/man5/vimrc.* - -%if %{with gui} -%{_mandir}/man1/gex.* -%{_mandir}/man1/gview.* -%{_mandir}/man1/gvim* -%{_mandir}/man1/vimx.* -%endif - %lang(fr) %{_mandir}/fr/man1/* %lang(da) %{_mandir}/da/man1/* %lang(de) %{_mandir}/de/man1/* @@ -900,6 +876,7 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %files filesystem %{_rpmconfigdir}/macros.d/macros.vim +%dir %{_datadir}/%{name}/vimfiles %dir %{_datadir}/%{name}/vimfiles/after %dir %{_datadir}/%{name}/vimfiles/after/* %dir %{_datadir}/%{name}/vimfiles/autoload @@ -909,8 +886,6 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %ghost %{_datadir}/%{name}/vimfiles/doc/tags %dir %{_datadir}/%{name}/vimfiles/ftdetect %dir %{_datadir}/%{name}/vimfiles/ftplugin -%dir %{_datadir}/%{name}/%{vimdir}/import -%dir %{_datadir}/%{name}/%{vimdir}/import/dist %dir %{_datadir}/%{name}/vimfiles/indent %dir %{_datadir}/%{name}/vimfiles/keymap %dir %{_datadir}/%{name}/vimfiles/lang @@ -920,15 +895,14 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %dir %{_datadir}/%{name}/vimfiles/syntax %dir %{_datadir}/%{name}/vimfiles/tutor -%if %{with gui} %files X11 - %if "%{desktop_file}" == "1" +%if "%{desktop_file}" == "1" %{_datadir}/metainfo/*.appdata.xml /%{_datadir}/applications/* %exclude /%{_datadir}/applications/vim.desktop - %else +%else /%{_sysconfdir}/X11/applnk/*/gvim.desktop - %endif +%endif %{_bindir}/gvimtutor %{_bindir}/gvim %{_bindir}/gvimdiff @@ -946,268 +920,96 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %dir %{_datadir}/icons/locolor/* %dir %{_datadir}/icons/locolor/*/apps %{_datadir}/icons/locolor/*/apps/* -%endif - -%files data -%license LICENSE -%dir %{_datadir}/%{name} -%dir %{_datadir}/%{name}/%{vimdir} -%{_datadir}/%{name}/%{vimdir}/defaults.vim -%dir %{_datadir}/%{name}/vimfiles -%{_datadir}/%{name}/vimfiles/template.spec %if %{with default_editor} %files default-editor %dir %{_datadir}/fish/vendor_conf.d %{_datadir}/fish/vendor_conf.d/vim-default-editor.fish +%dir %{_sysconfdir}/profile.d %config(noreplace) %{_sysconfdir}/profile.d/vim-default-editor.* %endif %changelog -* Fri Sep 16 2022 Zdenek Dohnal - 2:9.0.475-1 -- patchlevel 475 - -* Fri Sep 16 2022 Zdenek Dohnal - 2:9.0.412-2 -- provide 'vim(plugins-supported)' for plugins to require Vim/GVim - -* Thu Sep 08 2022 Zdenek Dohnal - 2:9.0.412-1 -- patchlevel 412 - -* Thu Sep 01 2022 Zdenek Dohnal - 2:9.0.348-1 -- patchlevel 348 - -* Tue Aug 30 2022 Zdenek Dohnal - 2:9.0.327-1 -- patchlevel 327 - -* Tue Aug 23 2022 Zdenek Dohnal - 2:9.0.246-1 -- patchlevel 246 - -* Mon Aug 15 2022 Zdenek Dohnal - 2:9.0.213-1 -- patchlevel 213 - -* Thu Aug 11 2022 Zdenek Dohnal - 2:9.0.189-1 -- patchlevel 189 - -* Thu Aug 04 2022 Zdenek Dohnal - 2:9.0.137-1 -- patchlevel 137 - -* Tue Jul 26 2022 Zdenek Dohnal - 2:9.0.077-1 -- patchlevel 077 - -* Sat Jul 23 2022 Fedora Release Engineering - 2:9.0.049-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Mon Jul 11 2022 Zdenek Dohnal - 2:9.0.049-1 -- patchlevel 049 - -* Tue Jun 28 2022 Zdenek Dohnal - 2:8.2.5172-1 -- patchlevel 5172 - -* Tue Jun 21 2022 Zdenek Dohnal - 2:8.2.5141-1 -- patchlevel 5141 - -* Tue Jun 14 2022 Zdenek Dohnal - 2:8.2.5085-1 -- patchlevel 5085 - -* Fri Jun 03 2022 Zdenek Dohnal - 2:8.2.5052-1 -- patchlevel 5052 - -* Tue May 31 2022 Zdenek Dohnal - 2:8.2.5046-1 -- patchlevel 5046 - -* Wed May 18 2022 Zdenek Dohnal - 2:8.2.4975-1 -- patchlevel 4975 - -* Tue May 17 2022 Zdenek Dohnal - 2:8.2.4969-1 -- patchlevel 4969 - -* Mon May 09 2022 Zdenek Dohnal - 2:8.2.4927-1 -- patchlevel 4927 - -* Mon May 09 2022 Zdenek Dohnal - 2:8.2.4877-2 -- add new file vimhelp.vim - -* Fri May 06 2022 Zdenek Dohnal - 2:8.2.4877-1 -- patchlevel 4877 - -* Mon May 02 2022 Zdenek Dohnal - 2:8.2.4857-1 -- patchlevel 4857 - -* Fri Apr 29 2022 Zdenek Dohnal - 2:8.2.4845-1 -- patchlevel 4845 - -* Fri Apr 22 2022 Zdenek Dohnal - 2:8.2.4804-1 -- patchlevel 4804 - -* Fri Apr 08 2022 Zdenek Dohnal - 2:8.2.4701-2 -- fix the upstream testsuite failure due downstream patch - -* Thu Apr 07 2022 Zdenek Dohnal - 2:8.2.4701-1 -- patchlevel 4701 - -* Fri Mar 25 2022 Zdenek Dohnal - 2:8.2.4621-1 -- patchlevel 4621 - -* Wed Mar 16 2022 Zdenek Dohnal - 2:8.2.4579-1 -- patchlevel 4579 - -* Wed Mar 09 2022 Zdenek Dohnal - 2:8.2.4529-1 -- patchlevel 4529 - -* Tue Mar 01 2022 Zdenek Dohnal - 2:8.2.4485-1 -- patchlevel 4485 - -* Thu Feb 24 2022 Zdenek Dohnal - 2:8.2.4460-1 -- patchlevel 4460 - -* Mon Feb 21 2022 Zdenek Dohnal - 2:8.2.4428-1 -- patchlevel 4428 - -* Tue Feb 15 2022 Zdenek Dohnal - 2:8.2.4386-1 -- patchlevel 4386 - -* Mon Feb 07 2022 Zdenek Dohnal - 2:8.2.4314-1 -- patchlevel 4314 - -* Thu Jan 27 2022 Zdenek Dohnal - 2:8.2.4232-1 -- patchlevel 4232 - -* Mon Jan 24 2022 Zdenek Dohnal - 2:8.2.4198-1 -- patchlevel 4198 - -* Sat Jan 22 2022 Fedora Release Engineering - 2:8.2.4068-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Wed Jan 12 2022 Zdenek Dohnal - 2:8.2.4068-1 -- patchlevel 4068 - -* Mon Jan 10 2022 Zdenek Dohnal - 2:8.2.4051-1 -- patchlevel 4051 - -* Fri Jan 07 2022 Malcolm Inglis - 2:8.2.4006-2 -- add 'gui' build condition for vim-X11 - -* Wed Jan 05 2022 Zdenek Dohnal - 2:8.2.4006-1 -- patchlevel 4006 - -* Wed Dec 15 2021 Zdenek Dohnal - 2:8.2.3811-1 -- patchlevel 3811 - -* Tue Dec 07 2021 Zdenek Dohnal - 2:8.2.3755-1 -- patchlevel 3755 - -* Thu Dec 02 2021 Zdenek Dohnal - 2:8.2.3717-1 -- patchlevel 3717 - -* Thu Nov 25 2021 Zdenek Dohnal - 2:8.2.3642-2 -- 2026651 - defaults.vim changes create conflicts between vim-minimal and vim-common - -* Mon Nov 22 2021 Zdenek Dohnal - 2:8.2.3642-1 -- patchlevel 3642 - -* Mon Nov 08 2021 Zdenek Dohnal - 2:8.2.3582-1 -- patchlevel 3582 - -* Mon Nov 01 2021 Zdenek Dohnal - 2:8.2.3568-1 -- patchlevel 3568 - -* Fri Oct 15 2021 Zdenek Dohnal - 2:8.2.3512-1 -- patchlevel 3512 - -* Thu Oct 14 2021 Zdenek Dohnal - 2:8.2.3404-2 -- adjust test suite to Python 3.10 - -* Thu Oct 14 2021 Zdenek Dohnal - 2:8.2.3404-2 -- remove filetype plugin from virc - it doesn't work with vi - -* Mon Oct 11 2021 Zdenek Dohnal - 2:8.2.3404-2 -- set system vimrc via compiler macros - -* Thu Sep 23 2021 Zdenek Dohnal - 2:8.2.3404-2 -- remove downstream patch vim-8.0-copypaste.patch - put mouse settings into defaults.vim again - -* Mon Sep 06 2021 Zdenek Dohnal - 2:8.2.3404-1 -- patchlevel 3404 - -* Wed Sep 01 2021 Zdenek Dohnal - 2:8.2.3391-1 -- patchlevel 3391 - -* Mon Aug 23 2021 Zdenek Dohnal - 2:8.2.3367-1 -- patchlevel 3367 - -* Mon Aug 16 2021 Zdenek Dohnal - 2:8.2.3354-1 -- patchlevel 3354 - -* Mon Aug 09 2021 Zdenek Dohnal - 2:8.2.3318-1 -- patchlevel 3318 - -* Thu Aug 05 2021 Zdenek Dohnal - 2:8.2.3290-1 -- patchlevel 3290 - -* Mon Aug 02 2021 Zdenek Dohnal - 2:8.2.3273-1 -- patchlevel 3273 - -* Mon Jul 26 2021 Zdenek Dohnal - 2:8.2.3223-1 -- patchlevel 3223 - -* Fri Jul 23 2021 Fedora Release Engineering - 2:8.2.3182-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Mon Jul 19 2021 Zdenek Dohnal - 2:8.2.3182-1 -- patchlevel 3182 - -* Mon Jul 12 2021 Zdenek Dohnal - 2:8.2.3154-1 -- patchlevel 3154 - -* Mon Jun 28 2021 Zdenek Dohnal - 2:8.2.3070-1 -- patchlevel 3070 - -* Fri Jun 25 2021 Zdenek Dohnal - 2:8.2.3046-1 -- patchlevel 3046 - -* Thu Jun 24 2021 Zdenek Dohnal - 2:8.2.3043-1 -- patchlevel 3043 -- enable libsodium encryption in Fedora -- require glibc-gconv-extra on F35 and later - -* Wed Jun 16 2021 Zdenek Dohnal - 2:8.2.3009-1 -- patchlevel 3009 - -* Thu Jun 10 2021 Zdenek Dohnal - 2:8.2.2956-2 -- 1969936 - Failed to source defaults.vim - -* Mon Jun 07 2021 Zdenek Dohnal - 2:8.2.2956-1 -- patchlevel 2956 - -* Fri Jun 04 2021 Zdenek Dohnal - 2:8.2.2932-1 -- patchlevel 2932 - -* Mon May 24 2021 Zdenek Dohnal - 2:8.2.2879-1 -- patchlevel 2879 - -* Fri May 21 2021 Zdenek Dohnal - 2:8.2.2875-1 -- patchlevel 2875 - -* Mon May 10 2021 Zdenek Dohnal - 2:8.2.2846-1 -- patchlevel 2846 - -* Wed May 05 2021 Zdenek Dohnal - 2:8.2.2825-2 -- make default-editor built only on Fedora - -* Mon May 03 2021 Zdenek Dohnal - 2:8.2.2825-1 -- patchlevel 2825 - -* Mon Apr 26 2021 Zdenek Dohnal - 2:8.2.2811-1 -- patchlevel 2811 - -* Tue Apr 20 2021 Zdenek Dohnal - 2:8.2.2787-1 -- patchlevel 2787 - -* Mon Apr 12 2021 Zdenek Dohnal - 2:8.2.2756-1 -- patchlevel 2756 - -* Thu Apr 08 2021 Zdenek Dohnal - 2:8.2.2735-1 -- patchlevel 2735 +* Mon Jun 13 2022 Zdenek Dohnal - 2:8.2.2637-16.3 +- CVE-2022-1785 vim: Out-of-bounds Write +- CVE-2022-1897 vim: out-of-bounds write in vim_regsub_both() in regexp.c +- CVE-2022-1927 vim: buffer over-read in utf_ptr2char() in mbyte.c + +* Wed May 25 2022 Zdenek Dohnal - 2:8.2.2637-16.2 +- CVE-2022-1621 vim: heap buffer overflow +- CVE-2022-1629 vim: buffer over-read + +* Mon Apr 25 2022 Zdenek Dohnal - 2:8.2.2637-16.1 +- CVE-2022-0554 vim: Use of Out-of-range Pointer Offset in vim prior +- CVE-2022-0943 vim: Heap-based Buffer Overflow occurs in vim +- CVE-2022-1154 vim: use after free in utf_ptr2char +- CVE-2022-1420 vim: Out-of-range Pointer Offset + +* Thu Feb 24 2022 Zdenek Dohnal - 2:8.2.2637-15 +- CVE-2022-0714 vim: buffer overflow [rhel-9] + +* Wed Feb 23 2022 Zdenek Dohnal - 2:8.2.2637-14 +- CVE-2022-0629 vim: Stack-based Buffer Overflow in vim prior to 8.2 + +* Wed Feb 16 2022 Zdenek Dohnal - 2:8.2.2637-13 +- CVE-2022-0572 vim: heap overflow in ex_retab() may lead to crash + +* Thu Feb 10 2022 Zdenek Dohnal - 2:8.2.2637-12 +- CVE-2022-0413 vim: use after free in src/ex_cmds.c +- CVE-2022-0443 vim: heap-use-after-free in enter_buffer() of src/buffer.c +- CVE-2022-0392 vim: heap-based buffer overflow in getexmodeline() in ex_getln.c + +* Wed Feb 09 2022 Zdenek Dohnal - 2:8.2.2637-12 +- CVE-2022-0368 vim: Out-of-bounds Read in vim +- CVE-2022-0417 vim: heap-based-buffer-overflow in ex_retab() of src/indent.c +- CVE-2022-0408 vim: Stack-based Buffer Overflow in spellsuggest.c + +* Tue Feb 08 2022 Zdenek Dohnal - 2:8.2.2637-12 +- CVE-2022-0319 vim: heap-based out-of-bounds read +- CVE-2022-0361 vim: Heap-based Buffer Overflow in GitHub repository + +* Thu Jan 27 2022 Zdenek Dohnal - 2:8.2.2637-11 +- CVE-2022-0261 vim: Heap-based Buffer Overflow in block_insert() in src/ops.c +- CVE-2022-0318 vim: heap-based buffer overflow in utf_head_off() in mbyte.c +- CVE-2022-0359 vim: heap-based buffer overflow in init_ccline() in ex_getln.c + +* Thu Jan 13 2022 Zdenek Dohnal - 2:8.2.2637-10 +- CVE-2021-4193 vim: vulnerable to Out-of-bounds Read +- CVE-2021-4192 vim: vulnerable to Use After Free + +* Mon Dec 06 2021 Zdenek Dohnal - 2:8.2.2637-9 +- 2028431 - CVE-2021-4019 vim: heap-based buffer overflow in find_help_tags() in src/help.c [rhel-9.0] + +* Thu Dec 02 2021 Zdenek Dohnal - 2:8.2.2637-9 +- 2028342 - CVE-2021-3984 vim: illegal memory access when C-indenting could lead to Heap Buffer Overflow [rhel-9.0] + +* Tue Oct 26 2021 Zdenek Dohnal - 2:8.2.2637-8 +- 2016202 - CVE-2021-3872 vim: heap-based buffer overflow in win_redr_status() drawscreen.c [rhel-9.0] + +* Tue Oct 19 2021 Zdenek Dohnal - 2:8.2.2637-7 +- 2015517 - [s390x] Vim needs to be compiled with -D_REENTRANT + +* Thu Oct 14 2021 Zdenek Dohnal - 2:8.2.2637-6 +- 2011412 - test suite fails on apache/httpd filetype tests +- 2011424 - Remove vim-7.4-syncolor.patch +- 2011429 - Remove downstream patch vim-7.4-nowarning.patch +- 2011749 - Update test suite to work without default mouse behavior +- 2002320 - CVE-2021-3770 vim: using retab with large value may lead to heap buffer overflow [rhel-9.0] +- 2004893 - CVE-2021-3778 vim: heap-based buffer overflow in utf_ptr2char() in mbyte.c [rhel-9.0] +- 2004976 - CVE-2021-3796 vim: use-after-free in nv_replace() in normal.c [rhel-9.0] + +* Tue Aug 10 2021 Mohan Boddu - 2:8.2.2637-5 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Thu Aug 05 2021 Zdenek Dohnal - 2:8.2.2637-4 +- 1938895 - review of important potential issues detected by static analyzers in vim-8.2.2488-1.el9 + +* Thu May 06 2021 Zdenek Dohnal - 2.8.2.2637-3 +- 1957209 - remove vim-default-editor from el9 + +* Fri Apr 16 2021 Mohan Boddu - 2:8.2.2637-2 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 * Mon Mar 22 2021 Zdenek Dohnal - 2:8.2.2637-1 - patchlevel 2637