From c28a6bb4f4dd8ed8f36d533919d334873b4e1c4456f4fab5a9a6681c074dab17 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 1 Jun 2021 06:50:22 +0000 Subject: [PATCH] Accepting request 896467 from home:susnux:branches:Base:System Update to version 2.9.4 OBS-URL: https://build.opensuse.org/request/show/896467 OBS-URL: https://build.opensuse.org/package/show/Base:System/man?expand=0&rev=124 --- man-MAN_POSIXLY_CORRECT-man1.dif | 21 - man-db-2.6.3-listall.dif | 17 + man-db-2.6.3-man0.dif | 60 +- man-db-2.6.3-section.dif | 42 -- man-db-2.7.1-security4.dif | 2 +- man-db-2.7.1-zio.dif | 8 +- man-db-2.8.4.dif | 1184 ------------------------------ man-db-2.8.4.tar.xz | 3 - man-db-2.8.4.tar.xz.asc | 16 - man-db-2.9.4-no-chown.patch | 21 + man-db-2.9.4.patch | 791 ++++++++++++++++++++ man-db-2.9.4.tar.xz | 3 + man-db-2.9.4.tar.xz.asc | 16 + man.changes | 52 ++ man.spec | 249 ++++--- mancoding | 54 -- mandb.service | 12 - mandb.timer | 11 - 18 files changed, 1030 insertions(+), 1532 deletions(-) delete mode 100644 man-MAN_POSIXLY_CORRECT-man1.dif delete mode 100644 man-db-2.6.3-section.dif delete mode 100644 man-db-2.8.4.dif delete mode 100644 man-db-2.8.4.tar.xz delete mode 100644 man-db-2.8.4.tar.xz.asc create mode 100644 man-db-2.9.4-no-chown.patch create mode 100644 man-db-2.9.4.patch create mode 100644 man-db-2.9.4.tar.xz create mode 100644 man-db-2.9.4.tar.xz.asc delete mode 100644 mancoding delete mode 100644 mandb.service delete mode 100644 mandb.timer diff --git a/man-MAN_POSIXLY_CORRECT-man1.dif b/man-MAN_POSIXLY_CORRECT-man1.dif deleted file mode 100644 index 73bbb28..0000000 --- a/man-MAN_POSIXLY_CORRECT-man1.dif +++ /dev/null @@ -1,21 +0,0 @@ ---- - man/man1/man.man1 | 8 ++++++++ - 1 file changed, 8 insertions(+) - ---- man/man1/man.man1 -+++ man/man1/man.man1 2016-12-15 14:10:47.883461034 +0000 -@@ -1344,6 +1344,14 @@ However, some users want to see them any - .RB $ MAN_KEEP_STDERR - is set to any non-empty value, error output will be displayed as usual. - .TP -+.if !'po4a'hide' .BR MAN_POSIXLY_CORRECT -+If many man pages are available corresponding to the requested one, -+.B %man% -+will display them in a list, unless -+.RB $ MAN_POSIXLY_CORRECT -+is set, in which case the first page in the list will be displayed -+automatically. -+.TP - .if !'po4a'hide' .BR LANG , " LC_MESSAGES" - Depending on system and implementation, either or both of - .RB $ LANG diff --git a/man-db-2.6.3-listall.dif b/man-db-2.6.3-listall.dif index 27a96f3..6d81b6a 100644 --- a/man-db-2.6.3-listall.dif +++ b/man-db-2.6.3-listall.dif @@ -205,3 +205,20 @@ return found; } +--- man/man1/man.man1 ++++ man/man1/man.man1 2016-12-15 14:10:47.883461034 +0000 +@@ -1344,6 +1344,14 @@ However, some users want to see them any + .RB $ MAN_KEEP_STDERR + is set to any non-empty value, error output will be displayed as usual. + .TP ++.if !'po4a'hide' .BR MAN_POSIXLY_CORRECT ++If many man pages are available corresponding to the requested one, ++.B %man% ++will display them in a list, unless ++.RB $ MAN_POSIXLY_CORRECT ++is set, in which case the first page in the list will be displayed ++automatically. ++.TP + .if !'po4a'hide' .BR LANG , " LC_MESSAGES" + Depending on system and implementation, either or both of + .RB $ LANG diff --git a/man-db-2.6.3-man0.dif b/man-db-2.6.3-man0.dif index 76bafd6..f289aac 100644 --- a/man-db-2.6.3-man0.dif +++ b/man-db-2.6.3-man0.dif @@ -1,61 +1,5 @@ ---- - man/de/man1/man.1 | 3 +++ - man/es/man1/man.1 | 3 +++ - man/it/man1/man.1 | 3 +++ - man/ja/man1/man.1 | 3 +++ - man/man1/man.1 | 3 +++ - 5 files changed, 15 insertions(+) - ---- man/de/man1/man.1 -+++ man/de/man1/man.1 2018-11-23 14:23:22.531297359 +0000 -@@ -83,6 +83,9 @@ und den Typ der dort zu findenden Seiten - .TS - tab (@); - l lx. -+0@T{ -+Dateiheader (gewöhnlich in \fI/usr/include\fR) -+T} - 1@T{ - Ausführbare Programme oder Shell\-Befehle - T} ---- man/es/man1/man.1 -+++ man/es/man1/man.1 2018-11-23 14:23:22.531297359 +0000 -@@ -80,6 +80,9 @@ seguidos por el tipo de página que cont - .TS - tab (@); - l lx. -+0@T{ -+Ficheros (se encuentran generalmente en \fI/usr/include\fR) -+T} - 1@T{ - Programa ejecutable o mandatos del shell - T} ---- man/it/man1/man.1 -+++ man/it/man1/man.1 2018-11-23 14:23:22.531297359 +0000 -@@ -124,6 +124,9 @@ del manuale seguiti dai tipi di pagine c - .TS - tab (@); - l lx. -+0@T{ -+File (di solito trovabili in \fI/usr/include\fR) -+T} - 1@T{ - Programmi eseguibili e comandi della shell - T} ---- man/ja/man1/man.1 -+++ man/ja/man1/man.1 2018-11-23 14:23:22.531297359 +0000 -@@ -78,6 +78,9 @@ default, unless overridden by the \fBSEC - .TS - tab (@); - l lx. -+0@T{ -+(\fIusr/include\fP) -+T} - 1@T{ - 実行プログラムまたはシェルコマンド - T} ---- man/man1/man.1 -+++ man/man1/man.1 2018-11-23 14:23:22.531297359 +0000 +--- man/man1/man.man1 ++++ man/man1/man.man1 2018-11-23 14:23:22.531297359 +0000 @@ -186,6 +186,9 @@ numbers of the manual followed by the ty .TS tab (@); diff --git a/man-db-2.6.3-section.dif b/man-db-2.6.3-section.dif deleted file mode 100644 index 91e6745..0000000 --- a/man-db-2.6.3-section.dif +++ /dev/null @@ -1,42 +0,0 @@ ---- - src/man.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- src/man.c -+++ src/man.c 2018-11-23 12:42:32.280720195 +0000 -@@ -978,7 +978,7 @@ static const char *is_section (const cha - { - const char **vs; - -- for (vs = section_list; *vs; vs++) { -+ for (vs = section_list; vs && *vs; vs++) { - if (STREQ (*vs, name)) - return name; - /* allow e.g. 3perl but disallow 8139too and libfoo */ -@@ -2776,7 +2776,7 @@ static int compare_candidates (const str - /* Find out whether lsource->ext is ahead of rsource->ext in - * section_list. - */ -- for (sp = section_list; *sp; ++sp) { -+ for (sp = section_list; sp && *sp; ++sp) { - if (!*(*sp + 1)) { - /* No extension */ - if (!sec_left && **sp == *(lsource->ext)) -@@ -3738,7 +3738,7 @@ static int do_global_apropos (const char - } else - my_section_list = section_list; - -- for (sp = my_section_list; *sp; sp++) -+ for (sp = my_section_list; sp && *sp; sp++) - for (mp = manpathlist; *mp; mp++) - *found += do_global_apropos_section (*mp, *sp, name); - -@@ -3927,7 +3927,7 @@ static int man (const char *name, int *f - else { - const char **sp; - -- for (sp = section_list; *sp; sp++) { -+ for (sp = section_list; sp && *sp; sp++) { - locate_page_in_manpath (*sp, name, &candidates, found); - } - } diff --git a/man-db-2.7.1-security4.dif b/man-db-2.7.1-security4.dif index b17562c..5f903ed 100644 --- a/man-db-2.7.1-security4.dif +++ b/man-db-2.7.1-security4.dif @@ -5,7 +5,7 @@ --- src/mandb.c +++ src/mandb.c 2018-11-23 12:50:40.139688661 +0000 @@ -442,18 +442,27 @@ static int mandb (struct dbpaths *dbpath - int ret, amount; + int amount; char *dbname; int should_create; + int fd; diff --git a/man-db-2.7.1-zio.dif b/man-db-2.7.1-zio.dif index ac69e94..013cdcc 100644 --- a/man-db-2.7.1-zio.dif +++ b/man-db-2.7.1-zio.dif @@ -37,9 +37,9 @@ MAN_ARG_AUTOMATIC_CREATE MAN_ARG_AUTOMATIC_UPDATE MAN_ARG_CATS -@@ -325,6 +337,46 @@ AC_SUBST([unlzma]) - AC_SUBST([unxz]) +@@ -346,6 +358,46 @@ AC_SUBST([unxz]) AC_SUBST([unlzip]) + AC_SUBST([unzstd]) MAN_COMPRESS_LIB([z], [gzopen]) +dnl Check for zlib and libbz2 libraries to use this together +dnl with SUSE's libzio to open compressed info files. @@ -84,8 +84,8 @@ dnl To add more decompressors just follow the scheme above. # Check for various header files and associated libraries. ---- lib/decompress.c -+++ lib/decompress.c 2018-11-23 13:12:59.714923151 +0000 +--- src/decompress.c ++++ src/decompress.c 2018-11-23 13:12:59.714923151 +0000 @@ -38,6 +38,10 @@ #include "xvasprintf.h" diff --git a/man-db-2.8.4.dif b/man-db-2.8.4.dif deleted file mode 100644 index 112a1d3..0000000 --- a/man-db-2.8.4.dif +++ /dev/null @@ -1,1184 +0,0 @@ ---- - configure.ac | 18 +++++- - include/comp_src.h.in | 2 - lib/security.c | 30 ++++++++++ - lib/util.c | 3 + - libdb/mydbm.h | 2 - man/po4a/po/ru.po | 2 - mk_catdirs | 30 ++++++++++ - src/Makefile.am | 11 --- - src/check_mandirs.c | 33 +++++++---- - src/lexgrog.l | 121 ++++++++++++++++++++++++++++------------- - src/man.c | 101 ++++++++++++++++++++-------------- - src/man_db.conf.in | 145 +++++++++++++++++++++++++++++++++++++++++++++++--- - src/mandb.c | 18 +++++- - src/manp.c | 2 - src/straycats.c | 22 +++++-- - src/ult_src.c | 9 ++- - src/ult_src.h | 7 +- - 17 files changed, 428 insertions(+), 128 deletions(-) - ---- configure.ac -+++ configure.ac 2018-11-23 13:56:33.730644942 +0000 -@@ -248,6 +248,14 @@ then - fi - - MAN_CHECK_PROGS([eqn], [EQN], [use EQN to preprocess equations], [eqn geqn]) -+MAN_CHECK_PROGS([geqn], [GEQN], [use GEQN to preprocess equations], [geqn]) -+dnl -+dnl if geqn is found and geqn is identical with eqn we use a GNU eqn -+dnl which its self can use -Tlatin1 -+dnl -+if test -n "$geqn" -a -n "$eqn" ; then -+ test $geqn -ef $eqn && neqn="$eqn -T$nroff_device" -+fi - MAN_CHECK_PROGS([neqn], [NEQN], [use NEQN to preprocess equations for character devices], [neqn gneqn]) - # If we fail to find an neqn, use eqn and try to force it to output for an - # ascii device. As this is only relevant for equations (?), not using latin1 -@@ -291,9 +299,15 @@ then - compress_ext="gz" - fi - MAN_CHECK_PROGS([compress], [COMPRESS], [use COMPRESS as UNIX compression utility], [compress]) --if test -n "$compress" -+if test -n "$compress" || test -n "$gzip" - then -- uncompress="$compress -dc" -+ if test -n "$gzip" -+ then -+ uncompress="$gzip -dc" -+ elif test -n "$compress" -+ then -+ uncompress="$compress -dc" -+ fi - if test -z "$gzip" - then - compressor="$compress -c" ---- include/comp_src.h.in -+++ include/comp_src.h.in 2018-11-23 13:56:33.730644942 +0000 -@@ -53,7 +53,7 @@ struct compression comp_list[] = { - #endif /* HAVE_GZIP */ - - /* If we have compress, incorporate the following */ --#ifdef HAVE_COMPRESS -+#if defined(HAVE_COMPRESS) || defined(HAVE_GZIP) - {UNCOMPRESS, "Z", NULL}, - /* Else if we have gzip, incorporate the following */ - #elif defined (HAVE_GZIP) ---- lib/security.c -+++ lib/security.c 2018-11-23 13:56:33.730644942 +0000 -@@ -78,6 +78,11 @@ static void gripe_set_euid (void) - error (FATAL, errno, _("can't set effective uid")); - } - -+static inline void gripe_set_egid (void) -+{ -+ error (FATAL, errno, _("can't set effective gid")); -+} -+ - #endif /* MAN_OWNER */ - - void init_security (void) -@@ -164,6 +169,31 @@ void regain_effective_privs (void) - uid = euid; - gid = egid; - } -+ if (gid != rgid) { -+# if defined(HAVE_SETRESGID) -+ if (setresgid (rgid, egid, -1) < 0) -+# elif defined(HAVE_SETREGID) -+ if (setregid (rgid, egid) < 0) -+# elif defined(HAVE_SETEGID) -+ if (setegid (rgid) < 0) -+# endif -+ gripe_set_egid(); -+ -+ gid = rgid; -+ } -+ -+ if (gid != egid) { -+# if defined(HAVE_SETRESGID) -+ if (setresgid (egid, rgid, -1)) -+# elif defined(HAVE_SETREGID) -+ if (setregid (egid, rgid) < 0) -+# elif defined(HAVE_SETEGID) -+ if (setegid (egid)) -+# endif -+ gripe_set_egid(); -+ -+ gid = egid; -+ } - #endif /* MAN_OWNER */ - } - ---- lib/util.c -+++ lib/util.c 2018-11-23 13:56:33.730644942 +0000 -@@ -50,6 +50,9 @@ - - #include "gettext.h" - -+#include -+#define _(String) gettext (String) -+ - #include "manconfig.h" - - #include "error.h" ---- libdb/mydbm.h -+++ libdb/mydbm.h 2018-11-23 13:56:33.730644942 +0000 -@@ -154,7 +154,7 @@ extern void btree_set_time(DB *db, const - # define MYDBM_SET_DPTR(d, value) ((d).data = (char *) (value)) - # define MYDBM_DSIZE(d) ((d).size) - # define MYDBM_CTRWOPEN(file) btree_flopen(file, O_TRUNC|O_CREAT|O_RDWR, DBMODE) --# define MYDBM_CRWOPEN(file) btree_flopen(file, O_CREAT|O_RDWR, DBMODE) -+# define MYDBM_CRWOPEN(file) btree_flopen(file, O_CREAT|O_RDWR, DBMODE) - # define MYDBM_RWOPEN(file) btree_flopen(file, O_RDWR, DBMODE) - # define MYDBM_RDOPEN(file) btree_flopen(file, O_RDONLY, DBMODE) - # define MYDBM_INSERT(db, key, cont) btree_insert(db, key, cont) ---- man/po4a/po/ru.po -+++ man/po4a/po/ru.po 2018-11-23 13:56:33.730644942 +0000 -@@ -3890,7 +3890,7 @@ msgstr "" - #~ msgstr "255" - - #~ msgid "\\*[softhyphen]" --#~ msgstr "\\*[мягкий перенос]" -+#~ msgstr "\\*[softhyphen]" - - #~ msgid "-\n" - #~ msgstr "-\n" ---- mk_catdirs -+++ mk_catdirs 2018-11-23 13:56:33.730644942 +0000 -@@ -0,0 +1,30 @@ -+#!/bin/sh -+ -+OLDPWD="`pwd`" -+CACHE="$1/var/cache/man" -+ -+ cats="cat{0,1,2,3,4,5,6,7,8,9,n}" -+locale="{ca,cs,da,de,en,es,et,fi,fr,ga,hu,is,it,ja,ko,nl,no,pl,pt,ru,sk,sr,sv,uk}" -+ dirs="{local,opt}" -+ -+umask 022 -+test -d ${CACHE} && rm -rf ${CACHE} -+mkdir -p ${CACHE} -+ -+catman=false -+grep -qE '#[[:blank:]]*define[[:blank:]]+MAN_CATS' include/manconfig.h && catman=true -+cd ${CACHE} -+if $catman ; then -+ eval echo ${cats} \ -+ ${locale}/${cats} \ -+ ${dirs}/${cats} \ -+ ${dirs}/${locale}/${cats} -+else -+ eval echo ${locale} \ -+ ${dirs} \ -+ ${dirs}/${locale} -+fi | xargs mkdir -p -+sync -+cd ${OLDPWD} -+ -+test "$(id -u)" -ne 0 || chown man:man -R ${CACHE} ---- src/Makefile.am -+++ src/Makefile.am 2018-11-23 13:56:33.730644942 +0000 -@@ -173,16 +173,7 @@ apropos$(EXEEXT): whatis$(EXEEXT) - all-am: apropos$(EXEEXT) - - install-exec-hook: -- if [ "$(man_owner)" ] && [ "$(man_mode)" = 6755 ]; then \ -- chown $(man_owner):$(man_owner) \ -- $(DESTDIR)$(bindir)/$(TRANS_MAN) \ -- $(DESTDIR)$(bindir)/$(TRANS_MANDB); \ -- fi -- chmod $(man_mode) \ -- $(DESTDIR)$(bindir)/$(TRANS_MAN) \ -- $(DESTDIR)$(bindir)/$(TRANS_MANDB) -- cd $(DESTDIR)$(bindir) && rm -f $(TRANS_APROPOS)$(EXEEXT) && \ -- $(LN_S) $(TRANS_WHATIS)$(EXEEXT) $(TRANS_APROPOS)$(EXEEXT) -+ $(LN_S) $(TRANS_WHATIS) $(DESTDIR)$(bindir)/$(TRANS_APROPOS) - - install-data-hook: - @if test -f $(DESTDIR)$(config_file); then \ ---- src/check_mandirs.c -+++ src/check_mandirs.c 2018-11-23 13:56:33.730644942 +0000 -@@ -393,7 +393,7 @@ void chown_if_possible (const char *path - #endif /* MAN_OWNER */ - - /* create the catman hierarchy if it doesn't exist */ --static void mkcatdirs (const char *mandir, const char *catdir) -+void mkcatdirs (const char *mandir, const char *catdir) - { - char *manname, *catname; - -@@ -421,9 +421,14 @@ static void mkcatdirs (const char *mandi - int j; - regain_effective_privs (); - debug ("creating catdir hierarchy %s ", catdir); -- for (j = 1; j <= 9; j++) { -- catname[strlen (catname) - 1] = '0' + j; -- manname[strlen (manname) - 1] = '0' + j; -+ for (j = 1; j <= 10; j++) { -+ unsigned int c; -+ if (j < 10) -+ c = '0' + j; -+ else -+ c = 'n'; -+ catname[strlen (catname) - 1] = c; -+ manname[strlen (manname) - 1] = c; - if ((is_directory (manname) == 1) - && (is_directory (catname) != 1)) { - if (mkdir (catname, 0755) < 0) { -@@ -431,7 +436,7 @@ static void mkcatdirs (const char *mandi - error (0, 0, _("warning: cannot create catdir %s"), catname); - debug ("warning: cannot create catdir %s\n", catname); - } else -- debug (" cat%d", j); -+ debug (" cat%c", c); - chown_if_possible (catname); - } - } -@@ -578,15 +583,10 @@ static int testmandirs (const char *path - } - - if (!quiet) { -- int tty = isatty (STDERR_FILENO); -- -- if (tty) -- fprintf (stderr, "\r"); - fprintf (stderr, - _("Updating index cache for path " - "`%s/%s'. Wait..."), path, mandir->d_name); -- if (!tty) -- fprintf (stderr, "\n"); -+ fprintf (stderr, "\n"); - } - add_dir_entries (dbf, path, mandir->d_name); - MYDBM_CLOSE (dbf); -@@ -693,7 +693,7 @@ int update_db (const char *manpath, cons - dbf = NULL; - } - if (!dbf) { -- debug ("failed to open %s O_RDONLY\n", database); -+ debug ("failed to open database %s O_RDONLY\n", database); - return EOF; - } - mtime = MYDBM_GET_TIME (dbf); -@@ -896,6 +896,7 @@ static int purge_whatis (MYDBM_FILE dbf, - "would delete\n", name, info->ext); - return 1; - } -+ return 1; - } - - /* Check that multi keys are correctly constructed. */ -@@ -993,6 +994,14 @@ int purge_missing (const char *manpath, - nextkey = MYDBM_NEXTKEY (dbf, key); - MYDBM_FREE_DPTR (key); - key = nextkey; -+ continue; -+ } -+ -+ /* Ignore db identifier keys. */ -+ if (*MYDBM_DPTR (key) == '.' && *(key.dptr+1) == 0) { -+ nextkey = MYDBM_NEXTKEY (dbf, key); -+ MYDBM_FREE_DPTR (key); -+ key = nextkey; - continue; - } - ---- src/lexgrog.l -+++ src/lexgrog.l 2018-11-23 13:56:33.734644867 +0000 -@@ -55,7 +55,7 @@ - - #include "manconv_client.h" - --#define YY_READ_BUF_SIZE 1024 -+#define YY_READ_BUF_SIZE YY_BUF_SIZE - #define MAX_NAME 8192 - - #define ARRAY_SIZE(array) (sizeof (array) / sizeof ((array)[0])) -@@ -203,15 +203,15 @@ static const struct macro perldocs[] = { - { "R\"", "\"" } - }; - --static void add_str_to_whatis (const char *string, size_t length); --static void add_char_to_whatis (unsigned char c); --static void add_separator_to_whatis (void); --static void add_wordn_to_whatis (const char *string, size_t length); --static void add_word_to_whatis (const char *string); --static void add_glyph_to_whatis (const char *string, size_t length); --static void add_perldoc_to_whatis (const char *string, size_t length); --static void mdoc_text (const char *string); --static void newline_found (void); -+static __inline__ void add_str_to_whatis (const char *string, size_t length); -+static __inline__ void add_char_to_whatis (unsigned char c); -+static __inline__ void add_separator_to_whatis (const char *, size_t); -+static __inline__ void add_wordn_to_whatis (const char *string, size_t length); -+static __inline__ void add_word_to_whatis (const char *string); -+static __inline__ void add_glyph_to_whatis (const char *string, size_t length); -+static __inline__ void add_perldoc_to_whatis (const char *string, size_t length); -+static __inline__ void mdoc_text (const char *string); -+static __inline__ void newline_found (void); - - static char newname[MAX_NAME]; - static char *p_name; -@@ -220,6 +220,7 @@ static char filters[MAX_FILTERS]; - - static int fill_mode; - static int waiting_for_quote; -+static int have_separator; - - static pipeline *decomp; - -@@ -237,7 +238,7 @@ static pipeline *decomp; - %} - - %option ecs meta-ecs --%option 8bit batch caseful never-interactive -+%option 8bit batch caseful never-interactive align - %option nostdinit - %option warn - %option noyywrap nounput -@@ -275,8 +276,9 @@ font_change \\f([[:upper:]1-4]|\({upper} - size_change \\s[+-]?{digit} - style_change ({font_change}{size_change}?|{size_change}{font_change}?) - typeface \.(B[IR]?|I[BR]?|R[BI]|S[BM]) -+paragr \.[PITLH][Pp] - sec_request \.[Ss][HhYySs] --comment ['.]\\{dbl_quote} -+comment (['.]\\{dbl_quote}|\'\-+|\\&) - - /* Please add to this list if you know how. */ - /* Note that, since flex only supports UTF-8 by accident, character classes -@@ -311,7 +313,26 @@ vi_name TÊN - zh_CN_name 名{blank}?(称|字){blank}?.* - zh_TW_name (名{blank}?(稱|字)|命令名){blank}?.* - name ({bg_name}|{cs_name}|{da_name}|{de_name}|{en_name}|{es_name}|{fi_name}|{fr_name}|{hu_name}|{id_name}|{it_name}|{ja_name}|{ko_name}|{latin_name}|{lt_name}|{nl_name}|{pl_name}|{ru_name}|{sk_name}|{sr_name}|{srlatin_name}|{sv_name}|{tr_name}|{vi_name}|{zh_CN_name}|{zh_TW_name}) --name_sec {dbl_quote}?{style_change}?{name}{style_change}?({blank}*{dbl_quote})? -+name_sec {dbl_quote}?{style_change}?{name}{style_change}?({blank}*{dbl_quote})?\r? -+start {sec_request}{blank_eol}+{name_sec} -+ -+N N(\bN)? -+n (N(\bN)?|n(\bn)?) -+a (A(\bA)?|a(\ba)?) -+o (O(\bO)?|o(\bo)?) -+m (M(\bM)?|M(\bM)?) -+e (E(\bE)?|e(\be)?) -+B B(\bB) -+b (B(\bB)?|b(\bb)?) -+r (R(\bR)?|r(\br)?) -+z (Z(\bZ)?|z(\bz)?) -+i (I(\bI)?|i(\bi)?) -+c (C(\bC)?|c(\bc)?) -+h (H(\bH)?|h(\bh)?) -+u (U(\bU)?|u(\bu)?) -+g (G(\bG)?|g(\bg)?) -+ -+cname (({N}({a}|{o}){m}({n}|{e})|{N}{o}{m}|{N}{o}{m}{b}{r}{e}|{B}{e}{z}{e}{i}{c}{h}{n}{u}{n}{g})|{bg_name}|{cs_name}|{hu_name}|{ko_name}|{ru_name}|{sr_name}|{tr_name}|{vi_name}|{ja_name}|{zh_CN_name}|{zh_TW_name}) - - /* eptgrv : eqn, pic, tbl, grap, refer, vgrind */ - tbl_request \.TS -@@ -325,8 +346,13 @@ vgrind_request \.vS - %% - - /* begin NAME section processing */ --{sec_request}{blank_eol}+{name_sec}{blank}* BEGIN (MAN_PRENAME); --{empty}{2,}{name}{blank}*{indent} BEGIN (CAT_NAME); -+{ -+ {start}{blank}*{bol}{blank}*{paragr} | /* strange format */ -+ {start}{blank}* { /* default */ -+ BEGIN (MAN_PRENAME); -+ } -+} -+{empty}{2,}{cname}{blank}*{indent} BEGIN (CAT_NAME); - - /* general text matching */ - \.[^Ss\r\n].* | -@@ -394,6 +420,7 @@ vgrind_request \.vS - {bol}\.sp{blank}* | /* vertical spacing */ - {bol}\.ig{blank}* | /* block comment */ - {bol}\.de[1i]?{blank}* | /* macro definition */ -+{bol}\.V[be]{blank}* | /* special in perl pages */ - {bol}\.i[ef]{blank}* | /* conditional */ - {empty}{bol}.+ | - <> { /* terminate the string */ -@@ -431,21 +458,24 @@ vgrind_request \.vS - } - - /* No-op requests */ --{bol}\.{blank}*$ newline_found (); --{bol}\.\.$ newline_found (); -+{bol}\.{blank}*/{eol} newline_found (); -+{bol}\.\./{eol} newline_found (); - - /* Toggle fill mode */ --{bol}\.nf.* fill_mode = 0; --{bol}\.fi.* fill_mode = 1; -+{bol}\.(nf|de).* fill_mode = 0; -+{bol}\.(fi|\.).* fill_mode = 1; - - -{eol}{blank_eol}* /* strip continuations */ - - /* convert to DASH */ - {next}{blank}*\\\((mi|hy|em|en){blank}* | -+{bol}\.sp{bol}{blank}+\\-{blank}* | /* strange spacing in NAME section * -+{blank}+[-\\]?-{bol} | /* dash at end of line */ -+{next}{blank_eol}+(\\?-){2}{blank}+ | /* some man pages use -- as dash */ - {next}{blank_eol}+[-\\]-{blank}* | - {next}{blank_eol}*[-\\]-{blank}+ | - {next}{blank}+-{1,2}{blank_eol}+ | --{bol}\.Nd{blank}* add_separator_to_whatis (); -+{bol}\.Nd{blank}* add_separator_to_whatis (yytext, yyleng); - - /* escape sequences and special characters */ - { -@@ -461,6 +491,7 @@ vgrind_request \.vS - {next}\\[|^&!%acdpruz{}\r\n] /* various useless control chars */ - {next}\\[bhlLvx]{blank}*'[^']+' /* various inline functions */ - -+ {next}\\\\\$[1-9] /* roff macro argument */ - {next}\\\$[1-9] /* interpolate arg */ - - /* roff named glyphs */ -@@ -623,11 +654,8 @@ vgrind_request \.vS - for later processing */ - { - {bol}\.br{blank}* | -- {bol}\.LP{blank}* | -- {bol}\.PP{blank}* | -+ {bol}{paragr}{blank}* | - {bol}\.P{blank}* | -- {bol}\.IP{blank}.* | -- {bol}\.HP{blank}.* | - {bol}\.RS{blank}.* | - {bol}\.RE{blank}.* add_char_to_whatis ((char) 0x11); - } -@@ -642,7 +670,7 @@ vgrind_request \.vS - [[:alnum:]]* add_str_to_whatis (yytext, yyleng); - - /* normalise the period (,) separators */ --{blank}*,[ \t\r\n]* | -+{blank}*,{blank_eol}* | - {blank}*,{blank}* add_str_to_whatis (", ", 2); - - {bol}. { -@@ -658,7 +686,7 @@ vgrind_request \.vS - %% - - /* print warning and force scanner to terminate */ --static void too_big (void) -+static __inline__ void too_big (void) - { - /* Even though MAX_NAME is a macro expanding to a constant, we - * translate it using ngettext anyway because that will make it -@@ -675,7 +703,7 @@ static void too_big (void) - } - - /* append a string to newname if enough room */ --static void add_str_to_whatis (const char *string, size_t length) -+static __inline__ void add_str_to_whatis (const char *string, size_t length) - { - if (p_name - newname + length >= MAX_NAME) - too_big (); -@@ -686,8 +714,10 @@ static void add_str_to_whatis (const cha - } - - /* append a char to newname if enough room */ --static void add_char_to_whatis (unsigned char c) -+static __inline__ void add_char_to_whatis (unsigned char c) - { -+ if (c == (char) 0x11 && *p_name == (char) 0x11) -+ return; - if (p_name - newname + 1 >= MAX_NAME) - too_big (); - else if (waiting_for_quote && c == '"') -@@ -699,8 +729,24 @@ static void add_char_to_whatis (unsigned - /* append the " - " separator to newname, trimming the first space if one's - * already there - */ --static void add_separator_to_whatis (void) -+static __inline__ void add_separator_to_whatis (const char *, size_t) - { -+ if (have_separator) { -+ unsigned int n; -+ unsigned char c; -+ -+ for (n = 0; (n < len) && (c = string[n]); n++) { -+ switch (c) { -+ case '-': -+ case ' ': -+ add_char_to_whatis (c); -+ default: -+ break; -+ } -+ } -+ return; -+ } -+ have_separator = 1; - if (p_name != newname && *(p_name - 1) != ' ') - add_char_to_whatis (' '); - add_str_to_whatis ("- ", 2); -@@ -708,7 +754,7 @@ static void add_separator_to_whatis (voi - - /* append a word to newname if enough room, ensuring only necessary - surrounding space */ --static void add_wordn_to_whatis (const char *string, size_t length) -+static __inline__ void add_wordn_to_whatis (const char *string, size_t length) - { - if (p_name != newname && *(p_name - 1) != ' ') - add_char_to_whatis (' '); -@@ -718,7 +764,7 @@ static void add_wordn_to_whatis (const c - add_str_to_whatis (string, length); - } - --static void add_word_to_whatis (const char *string) -+static __inline__ void add_word_to_whatis (const char *string) - { - add_wordn_to_whatis (string, strlen (string)); - } -@@ -728,7 +774,7 @@ struct compare_macro_key { - size_t length; - }; - --static int compare_macro (const void *left, const void *right) -+static __inline__ int compare_macro (const void *left, const void *right) - { - const struct compare_macro_key *key = left; - const struct macro *value = right; -@@ -746,7 +792,7 @@ static int compare_macro (const void *le - return 0; - } - --static void add_macro_to_whatis (const struct macro *macros, size_t n_macros, -+static __inline__ void add_macro_to_whatis (const struct macro *macros, size_t n_macros, - const char *string, size_t length) - { - struct compare_macro_key key; -@@ -760,23 +806,23 @@ static void add_macro_to_whatis (const s - add_str_to_whatis (macro->value, strlen (macro->value)); - } - --static void add_glyph_to_whatis (const char *string, size_t length) -+static __inline__ void add_glyph_to_whatis (const char *string, size_t length) - { - add_macro_to_whatis (glyphs, ARRAY_SIZE (glyphs), string, length); - } - --static void add_perldoc_to_whatis (const char *string, size_t length) -+static __inline__ void add_perldoc_to_whatis (const char *string, size_t length) - { - add_macro_to_whatis (perldocs, ARRAY_SIZE (perldocs), string, length); - } - --static void mdoc_text (const char *string) -+static __inline__ void mdoc_text (const char *string) - { - add_word_to_whatis (string); - BEGIN (MAN_NAME); - } - --static void newline_found (void) -+static __inline__ void newline_found (void) - { - /* If we are mid p_name and the last added char was not a space, - * best add one. -@@ -859,6 +905,7 @@ int find_name_decompressed (pipeline *p, - - fill_mode = 1; - waiting_for_quote = 0; -+ have_separator = 0; - - if (p_lg->type) - BEGIN (CAT_FILE); ---- src/man.c -+++ src/man.c 2018-11-26 10:36:45.654147759 +0000 -@@ -65,6 +65,7 @@ - #include - #include - #include -+#include - - #include "argp.h" - #include "dirname.h" -@@ -109,6 +110,8 @@ - #ifdef MAN_OWNER - extern uid_t ruid; - extern uid_t euid; -+extern gid_t rgid; -+extern gid_t egid; - #endif /* MAN_OWNER */ - - /* the default preprocessor sequence */ -@@ -139,6 +142,11 @@ char *lang; - - static int global_manpath = -1; /* global or user manual page hierarchy? */ - static int skip; /* page exists but has been skipped */ -+static struct termios tms; /* To save terminal settings in */ -+static int tms_set = 0; /* Do we have saved terminal settings? */ -+static pid_t tms_pid = 0; -+ -+static void set_term(void) { if (tms_set && getpid () == tms_pid) tcsetattr(fileno(stdin), TCSANOW, &tms); } - - #if defined _AIX || defined __sgi - char **global_argv; -@@ -242,10 +250,10 @@ static int found_a_stray; /* found a st - #ifdef MAN_CATS - static char *tmp_cat_file; /* for open_cat_stream(), close_cat_stream() */ - static int created_tmp_cat; /* dto. */ --#endif - static int tmp_cat_fd; - static struct timespec man_modtime; /* modtime of man page, for - * commit_tmp_cat() */ -+#endif - - # ifdef TROFF_IS_GROFF - static int ditroff; -@@ -660,36 +668,6 @@ static void check_standard_fds (void) - } - } - --static struct termios tms; --static int tms_set = 0; --static pid_t tms_pid = 0; -- --static void set_term (void) --{ -- if (tms_set && getpid () == tms_pid) -- tcsetattr (STDIN_FILENO, TCSANOW, &tms); --} -- --static void get_term (void) --{ -- if (isatty (STDOUT_FILENO)) { -- debug ("is a tty\n"); -- tcgetattr (STDIN_FILENO, &tms); -- if (!tms_set++) { -- /* Work around pipecmd_exec calling exit(3) rather -- * than _exit(2), which means our atexit-registered -- * functions are called at the end of each child -- * process created using pipecmd_new_function and -- * friends. It would probably be good to fix this -- * in libpipeline at some point, but it would -- * require care to avoid breaking compatibility. -- */ -- tms_pid = getpid (); -- atexit (set_term); -- } -- } --} -- - #if defined(TROFF_IS_GROFF) || defined(HEIRLOOM_NROFF) - static int get_roff_line_length (void) - { -@@ -1562,6 +1540,18 @@ static void setenv_less (pipecmd *cmd, c - free (less_opts); - } - -+static void disable_x(void) -+{ -+ char *bname = basename((char*)pager); -+ if (bname) { -+ if (!strcmp(bname, "less")) -+ unsetenv("DISPLAY"); -+#if 0 -+ free(bname); -+#endif -+ } -+} -+ - static void add_output_iconv (pipeline *p, - const char *source, const char *target) - { -@@ -1679,6 +1669,8 @@ static pipeline *make_display_command (c - - if (pager_cmd) { - setenv_less (pager_cmd, title); -+ if (!htmlout) -+ disable_x(); - pipeline_command (p, pager_cmd); - } - pipeline_ignore_signals (p, 1); -@@ -1689,7 +1681,7 @@ static pipeline *make_display_command (c - return p; - } - -- -+#ifdef MAN_CATS - /* return a (malloced) temporary name in cat_file's directory */ - static char *tmp_cat_filename (const char *cat_file) - { -@@ -1717,7 +1709,6 @@ static char *tmp_cat_filename (const cha - return name; - } - -- - /* If delete unlink tmp_cat, else commit tmp_cat to cat_file. - Return non-zero on error. - */ -@@ -1790,6 +1781,7 @@ static int commit_tmp_cat (const char *c - - return status; - } -+#endif /* MAN_CATS */ - - /* TODO: This should all be refactored after work on the decompression - * library is complete. -@@ -1818,7 +1810,6 @@ static void chdir_commands (pipeline *p, - } - - #ifdef MAN_CATS -- - /* Return pipeline to write formatted manual page to for saving as cat file. */ - static pipeline *open_cat_stream (const char *cat_file, const char *encoding) - { -@@ -2041,6 +2032,7 @@ static void format_display (pipeline *de - regain_effective_privs (); - } - -+#ifdef MAN_CATS - /* "Display" a page in catman mode, which amounts to saving it. */ - /* TODO: merge with format_display_and_save? */ - static void display_catman (const char *cat_file, pipeline *decomp, -@@ -2084,6 +2076,7 @@ static void display_catman (const char * - pop_cleanup ((cleanup_fun) unlink, tmpcat); - free (tmpcat); - } -+#endif /* MAN_CATS */ - - static void disable_hyphenation (void *data ATTRIBUTE_UNUSED) - { -@@ -2283,7 +2276,7 @@ static int display (const char *dir, con - format_cmd = NULL; - decomp_errno = errno; - } -- -+#ifdef MAN_CATS - /* Get modification time, for commit_tmp_cat(). */ - if (man_file && *man_file) { - struct stat stb; -@@ -2293,7 +2286,7 @@ static int display (const char *dir, con - } else - man_modtime = get_stat_mtime (&stb); - } -- -+#endif /* MAN_CATS */ - display_to_stdout = troff; - #ifdef TROFF_IS_GROFF - if (htmlout) -@@ -2430,6 +2423,7 @@ static int display (const char *dir, con - } - if (printed) - putchar ('\n'); -+#ifdef MAN_CATS - } else if (catman) { - if (format) { - if (!save_cat) -@@ -2442,6 +2436,7 @@ static int display (const char *dir, con - format_cmd, - formatted_encoding); - } -+#endif /* MAN_CATS */ - } else if (format) { - /* no cat or out of date */ - pipeline *disp_cmd; -@@ -2503,8 +2498,10 @@ static int display (const char *dir, con - - free (formatted_encoding); - -- pipeline_free (format_cmd); -- pipeline_free (decomp); -+ if (format_cmd) -+ pipeline_free (format_cmd); -+ if (decomp) -+ pipeline_free (decomp); - - if (!prompt) - prompt = found; -@@ -3336,7 +3333,7 @@ static int display_database_check (struc - #ifdef MAN_DB_UPDATES - if (!exists && !skip) { - debug ("dbdelete_wrapper (%s, %p)\n", -- candp->req_name, candp->source); -+ candp->req_name, candp->source->addr); - dbdelete_wrapper (candp->req_name, candp->source); - } - #endif /* MAN_DB_UPDATES */ -@@ -3945,17 +3942,20 @@ static int local_man_loop (const char *a - /* Check that the file exists and isn't e.g. a directory */ - if (stat (argv, &st)) { - error (0, errno, "%s", argv); -+ regain_effective_privs (); - return NOT_FOUND; - } - - if (S_ISDIR (st.st_mode)) { - error (0, EISDIR, "%s", argv); -+ regain_effective_privs (); - return NOT_FOUND; - } - - if (S_ISCHR (st.st_mode) || S_ISBLK (st.st_mode)) { - /* EINVAL is about the best I can do. */ - error (0, EINVAL, "%s", argv); -+ regain_effective_privs (); - return NOT_FOUND; - } - -@@ -4022,6 +4022,11 @@ executable_out: - argv_abs = xstrdup (argv); - } - lang = lang_dir (argv_abs); -+ if (!lang || !*lang) { -+ if (lang) -+ free(lang); -+ lang = xstrdup(internal_locale); -+ } - free (argv_abs); - if (!display (NULL, argv, NULL, argv_base, NULL)) { - if (local_mf) -@@ -4259,7 +4264,16 @@ int main (int argc, char *argv[]) - umask (022); - init_locale (); - -- internal_locale = setlocale (LC_MESSAGES, NULL); -+ internal_locale = setlocale (LC_MESSAGES, ""); -+#if defined(__GLIBC__) -+# if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2) -+ if (!internal_locale) { -+ if ( !(internal_locale = getenv ("LC_ALL")) -+ && !(internal_locale = getenv ("LC_MESSAGES"))) -+ internal_locale = getenv ("LANG"); -+ } -+# endif -+#endif - /* Use LANGUAGE only when LC_MESSAGES locale category is - * neither "C" nor "POSIX". */ - if (internal_locale && strcmp (internal_locale, "C") && -@@ -4298,9 +4312,14 @@ int main (int argc, char *argv[]) - if (external) - do_extern (argc, argv); - -- get_term (); /* stores terminal settings */ - #ifdef MAN_OWNER - debug ("real user = %d; effective user = %d\n", ruid, euid); -+ if (isatty(fileno(stdin)) && isatty(fileno(stdout))) { -+ tcgetattr(fileno(stdin), &tms); -+ tms_pid = getpid (); -+ if (!tms_set++) -+ atexit(set_term); -+ } - #endif /* MAN_OWNER */ - - /* close this locale and reinitialise if a new locale was ---- src/man_db.conf.in -+++ src/man_db.conf.in 2018-11-23 13:56:33.734644867 +0000 -@@ -20,6 +20,14 @@ - MANDATORY_MANPATH /usr/man - MANDATORY_MANPATH /usr/share/man - MANDATORY_MANPATH /usr/local/share/man -+MANDATORY_MANPATH /opt/man -+MANDATORY_MANPATH /opt/dx/man -+MANDATORY_MANPATH /opt/lsb/man -+MANDATORY_MANPATH /opt/cross/share/man -+MANDATORY_MANPATH /opt/mpich/man -+MANDATORY_MANPATH /opt/lsb-tet3-lite/share/man -+MANDATORY_MANPATH /opt/snavigator/man -+MANDATORY_MANPATH /opt/novell/man - #--------------------------------------------------------- - # set up PATH to MANPATH mapping - # ie. what man tree holds man pages for what binary directory. -@@ -34,8 +42,10 @@ MANPATH_MAP /usr/local/bin /usr/local/m - MANPATH_MAP /usr/local/bin /usr/local/share/man - MANPATH_MAP /usr/local/sbin /usr/local/man - MANPATH_MAP /usr/local/sbin /usr/local/share/man --MANPATH_MAP /usr/X11R6/bin /usr/X11R6/man --MANPATH_MAP /usr/bin/X11 /usr/X11R6/man -+MANPATH_MAP /usr/X11R6/bin /usr/share/man -+MANPATH_MAP /usr/X11/bin /usr/share/man -+MANPATH_MAP /usr/bin/X11 /usr/share/man -+MANPATH_MAP /usr/bin/mh /usr/share/man - MANPATH_MAP /usr/games /usr/share/man - MANPATH_MAP /opt/bin /opt/man - MANPATH_MAP /opt/sbin /opt/man -@@ -63,12 +73,133 @@ MANPATH_MAP /opt/sbin /opt/man - # - # *MANPATH* -> *CATPATH* - # --MANDB_MAP /usr/man /var/cache/man/fsstnd -+MANDB_MAP /usr/share/man/ca /var/cache/man/ca -+MANDB_MAP /usr/share/man/cs /var/cache/man/cs -+MANDB_MAP /usr/share/man/cs_CZ /var/cache/man/cs -+MANDB_MAP /usr/share/man/da /var/cache/man/da -+MANDB_MAP /usr/share/man/de /var/cache/man/de -+MANDB_MAP /usr/share/man/de_AT /var/cache/man/de -+MANDB_MAP /usr/share/man/de_DE /var/cache/man/de -+MANDB_MAP /usr/share/man/en /var/cache/man/en -+MANDB_MAP /usr/share/man/es /var/cache/man/es -+MANDB_MAP /usr/share/man/es_ES /var/cache/man/es -+MANDB_MAP /usr/share/man/et /var/cache/man/et -+MANDB_MAP /usr/share/man/fi /var/cache/man/fi -+MANDB_MAP /usr/share/man/fr_FR /var/cache/man/fr -+MANDB_MAP /usr/share/man/ga /var/cache/man/ga -+MANDB_MAP /usr/share/man/is /var/cache/man/is -+MANDB_MAP /usr/share/man/it /var/cache/man/it -+MANDB_MAP /usr/share/man/ja /var/cache/man/ja -+MANDB_MAP /usr/share/man/ja_JP /var/cache/man/ja -+MANDB_MAP /usr/share/man/ja_JP.eucJP /var/cache/man/ja -+MANDB_MAP /usr/share/man/ko /var/cache/man/ko -+MANDB_MAP /usr/share/man/nl /var/cache/man/nl -+MANDB_MAP /usr/share/man/no /var/cache/man/no -+MANDB_MAP /usr/share/man/pl /var/cache/man/pl -+MANDB_MAP /usr/share/man/pt /var/cache/man/pt -+MANDB_MAP /usr/share/man/pt_BR /var/cache/man/pt -+MANDB_MAP /usr/share/man/ru /var/cache/man/ru -+MANDB_MAP /usr/share/man/sk /var/cache/man/sk -+MANDB_MAP /usr/share/man/sr /var/cache/man/sr -+MANDB_MAP /usr/share/man/sv /var/cache/man/sv -+MANDB_MAP /usr/share/man/uk /var/cache/man/uk - MANDB_MAP /usr/share/man /var/cache/man --MANDB_MAP /usr/local/man /var/cache/man/oldlocal --MANDB_MAP /usr/local/share/man /var/cache/man/local --MANDB_MAP /usr/X11R6/man /var/cache/man/X11R6 --MANDB_MAP /opt/man /var/cache/man/opt -+# -+MANDB_MAP /usr/local/man/ca /var/cache/man/local/ca -+MANDB_MAP /usr/local/man/cs /var/cache/man/local/cs -+MANDB_MAP /usr/local/man/cs_CZ /var/cache/man/local/cs -+MANDB_MAP /usr/local/man/da /var/cache/man/local/da -+MANDB_MAP /usr/local/man/de /var/cache/man/local/de -+MANDB_MAP /usr/local/man/de_AT /var/cache/man/local/de -+MANDB_MAP /usr/local/man/de_DE /var/cache/man/local/de -+MANDB_MAP /usr/local/man/en /var/cache/man/local/en -+MANDB_MAP /usr/local/man/es /var/cache/man/local/es -+MANDB_MAP /usr/local/man/es_ES /var/cache/man/local/es -+MANDB_MAP /usr/local/man/et /var/cache/man/local/et -+MANDB_MAP /usr/local/man/fi /var/cache/man/local/fi -+MANDB_MAP /usr/local/man/fr_FR /var/cache/man/local/fr -+MANDB_MAP /usr/local/man/ga /var/cache/man/local/ga -+MANDB_MAP /usr/local/man/is /var/cache/man/local/is -+MANDB_MAP /usr/local/man/it /var/cache/man/local/it -+MANDB_MAP /usr/local/man/ja /var/cache/man/local/ja -+MANDB_MAP /usr/local/man/ja_JP /var/cache/man/local/ja -+MANDB_MAP /usr/local/man/ja_JP.eucJP /var/cache/man/local/ja -+MANDB_MAP /usr/local/man/ko /var/cache/man/local/ko -+MANDB_MAP /usr/local/man/nl /var/cache/man/local/nl -+MANDB_MAP /usr/local/man/no /var/cache/man/local/no -+MANDB_MAP /usr/local/man/pl /var/cache/man/local/pl -+MANDB_MAP /usr/local/man/pt /var/cache/man/local/pt -+MANDB_MAP /usr/local/man/pt_BR /var/cache/man/local/pt -+MANDB_MAP /usr/local/man/ru /var/cache/man/local/ru -+MANDB_MAP /usr/local/man/sk /var/cache/man/local/sk -+MANDB_MAP /usr/local/man/sr /var/cache/man/local/sr -+MANDB_MAP /usr/local/man/sv /var/cache/man/local/sv -+MANDB_MAP /usr/local/man/uk /var/cache/man/local/uk -+MANDB_MAP /usr/local/man /var/cache/man/local -+# -+MANDB_MAP /usr/local/share/man/ca /var/cache/man/local/ca -+MANDB_MAP /usr/local/share/man/cs /var/cache/man/local/cs -+MANDB_MAP /usr/local/share/man/cs_CZ /var/cache/man/local/cs -+MANDB_MAP /usr/local/share/man/da /var/cache/man/local/da -+MANDB_MAP /usr/local/share/man/de /var/cache/man/local/de -+MANDB_MAP /usr/local/share/man/de_AT /var/cache/man/local/de -+MANDB_MAP /usr/local/share/man/de_DE /var/cache/man/local/de -+MANDB_MAP /usr/local/share/man/en /var/cache/man/local/en -+MANDB_MAP /usr/local/share/man/es /var/cache/man/local/es -+MANDB_MAP /usr/local/share/man/es_ES /var/cache/man/local/es -+MANDB_MAP /usr/local/share/man/et /var/cache/man/local/et -+MANDB_MAP /usr/local/share/man/fi /var/cache/man/local/fi -+MANDB_MAP /usr/local/share/man/fr_FR /var/cache/man/local/fr -+MANDB_MAP /usr/local/share/man/ga /var/cache/man/local/ga -+MANDB_MAP /usr/local/share/man/is /var/cache/man/local/is -+MANDB_MAP /usr/local/share/man/it /var/cache/man/local/it -+MANDB_MAP /usr/local/share/man/ja /var/cache/man/local/ja -+MANDB_MAP /usr/local/share/man/ja_JP /var/cache/man/local/ja -+MANDB_MAP /usr/local/share/man/ja_JP.eucJP /var/cache/man/local/ja -+MANDB_MAP /usr/local/share/man/ko /var/cache/man/local/ko -+MANDB_MAP /usr/local/share/man/nl /var/cache/man/local/nl -+MANDB_MAP /usr/local/share/man/no /var/cache/man/local/no -+MANDB_MAP /usr/local/share/man/pl /var/cache/man/local/pl -+MANDB_MAP /usr/local/share/man/pt /var/cache/man/local/pt -+MANDB_MAP /usr/local/share/man/pt_BR /var/cache/man/local/pt -+MANDB_MAP /usr/local/share/man/ru /var/cache/man/local/ru -+MANDB_MAP /usr/local/share/man/sk /var/cache/man/local/sk -+MANDB_MAP /usr/local/share/man/sr /var/cache/man/local/sr -+MANDB_MAP /usr/local/share/man/sv /var/cache/man/local/sv -+MANDB_MAP /usr/local/share/man/uk /var/cache/man/local/uk -+MANDB_MAP /usr/local/share/man /var/cache/man/local -+# -+MANDB_MAP /opt/share/man/ca /var/cache/man/opt/ca -+MANDB_MAP /opt/share/man/cs /var/cache/man/opt/cs -+MANDB_MAP /opt/share/man/cs_CZ /var/cache/man/opt/cs -+MANDB_MAP /opt/share/man/da /var/cache/man/opt/da -+MANDB_MAP /opt/share/man/de /var/cache/man/opt/de -+MANDB_MAP /opt/share/man/de_AT /var/cache/man/opt/de -+MANDB_MAP /opt/share/man/de_DE /var/cache/man/opt/de -+MANDB_MAP /opt/share/man/en /var/cache/man/opt/en -+MANDB_MAP /opt/share/man/es /var/cache/man/opt/es -+MANDB_MAP /opt/share/man/es /var/cache/man/opt/es -+MANDB_MAP /opt/share/man/et /var/cache/man/opt/et -+MANDB_MAP /opt/share/man/fi /var/cache/man/opt/fi -+MANDB_MAP /opt/share/man/fr_FR /var/cache/man/opt/fr -+MANDB_MAP /opt/share/man/ga /var/cache/man/opt/ga -+MANDB_MAP /opt/share/man/is /var/cache/man/opt/is -+MANDB_MAP /opt/share/man/it /var/cache/man/opt/it -+MANDB_MAP /opt/share/man/ja /var/cache/man/opt/ja -+MANDB_MAP /opt/share/man/ja_JP /var/cache/man/opt/ja -+MANDB_MAP /opt/share/man/ja_JP.eucJP /var/cache/man/opt/ja -+MANDB_MAP /opt/share/man/ko /var/cache/man/opt/ko -+MANDB_MAP /opt/share/man/nl /var/cache/man/opt/nl -+MANDB_MAP /opt/share/man/no /var/cache/man/opt/no -+MANDB_MAP /opt/share/man/pl /var/cache/man/opt/pl -+MANDB_MAP /opt/share/man/pt /var/cache/man/opt/pt -+MANDB_MAP /opt/share/man/pt_BR /var/cache/man/opt/pt -+MANDB_MAP /opt/share/man/ru /var/cache/man/opt/ru -+MANDB_MAP /opt/share/man/sk /var/cache/man/opt/sk -+MANDB_MAP /opt/share/man/sr /var/cache/man/opt/sr -+MANDB_MAP /opt/share/man/sv /var/cache/man/opt/sv -+MANDB_MAP /opt/share/man/uk /var/cache/man/opt/uk -+MANDB_MAP /opt/share/man /var/cache/man/opt - # - #--------------------------------------------------------- - # Program definitions. These are commented out by default as the value ---- src/mandb.c -+++ src/mandb.c 2018-11-23 13:56:33.734644867 +0000 -@@ -200,6 +200,8 @@ struct dbpaths { - #ifdef MAN_OWNER - extern uid_t ruid; - extern uid_t euid; -+extern gid_t rgid; -+extern gid_t egid; - #endif /* MAN_OWNER */ - - static char *manpathlist[MAXDIRS]; -@@ -561,6 +563,8 @@ static int mandb (struct dbpaths *dbpath - return amount; - } - -+extern void mkcatdirs (const char *, const char *); -+ - static int process_manpath (const char *manpath, int global_manpath, - struct hashtable *tried_catdirs) - { -@@ -608,6 +612,8 @@ static int process_manpath (const char * - database = NULL; - } - -+ mkcatdirs (manpath, catpath); -+ - dbpaths = XZALLOC (struct dbpaths); - push_cleanup (cleanup, dbpaths, 0); - push_cleanup (cleanup_sigsafe, dbpaths, 1); -@@ -623,7 +629,7 @@ static int process_manpath (const char * - if (!opt_test && amount) - finish_up (dbpaths); - #ifdef MAN_OWNER -- if (global_manpath) -+ if (global_manpath && (euid == 0 || ruid == 0)) - do_chown (dbpaths); - #endif /* MAN_OWNER */ - -@@ -828,8 +834,14 @@ int main (int argc, char *argv[]) - - #ifdef MAN_OWNER - man_owner = get_man_owner (); -- if (!user && euid != 0 && euid != man_owner->pw_uid) -- user = 1; -+ if (!user) { -+ if (!ruid && euid != man_owner->pw_uid) { -+ seteuid(man_owner->pw_uid); -+ euid = geteuid(); -+ } -+ if (euid != man_owner->pw_uid) -+ user = 1; -+ } - #endif /* MAN_OWNER */ - - read_config_file (user); ---- src/manp.c -+++ src/manp.c 2018-11-23 13:56:33.734644867 +0000 -@@ -919,7 +919,7 @@ static char *def_path (int flag) - - /* If we have complete config file failure... */ - if (!manpath) -- return xstrdup ("/usr/man"); -+ return xstrdup ("/usr/share/man"); - - return manpath; - } ---- src/straycats.c -+++ src/straycats.c 2018-11-23 13:56:33.734644867 +0000 -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - #include - - #include "canonicalize.h" -@@ -287,18 +288,25 @@ static int check_for_stray (MYDBM_FILE d - free (catdir_base); - } - -- free (lg.whatis); -- pipeline_free (decomp); -+ if (lg.whatis) -+ free (lg.whatis); -+ if (decomp) -+ pipeline_free (decomp); - next_exists: -- free_mandata_struct (exists); -- free (mandir_base); -+ if (exists) -+ free_mandata_struct (exists); -+ if (mandir_base) -+ free (mandir_base); - } - next_section: -- free (section); -+ if (section) -+ free (section); - next_name: -- free (names[i]); -+ if (names[i]) -+ free (names[i]); - } -- free (names); -+ if (names) -+ free (names); - return strays; - } - ---- src/ult_src.c -+++ src/ult_src.c 2018-11-23 13:56:33.734644867 +0000 -@@ -362,10 +362,15 @@ const char *ult_src (const char *name, c - } - pipeline_start (decomp); - -- /* make sure that we skip over any comments */ -+ /* -+ * make sure that we skip over any comments -+ * ... even if we handle TCL/TK manual pages -+ */ - do { - buffer = pipeline_readline (decomp); -- } while (buffer && STRNEQ (buffer, ".\\\"", 3)); -+ } while (buffer && *buffer && -+ (STRNEQ (buffer, ".\\\"", 3) || -+ STRNEQ (buffer, "'\\\"", 3))); - - include = test_for_include (buffer); - if (include) { ---- src/ult_src.h -+++ src/ult_src.h 2018-11-23 13:56:33.734644867 +0000 -@@ -22,9 +22,10 @@ - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - --#define SO_LINK 0001 --#define SOFT_LINK 0002 --#define HARD_LINK 0004 -+#define SO_LINK 0x0001 -+#define SOFT_LINK 0x0002 -+#define HARD_LINK 0x0004 -+#define WHATISBUF 0x0008 - - /* Trace of the link chain from a given file. Any names listed here should - * not have WHATIS_MAN entries created for them. diff --git a/man-db-2.8.4.tar.xz b/man-db-2.8.4.tar.xz deleted file mode 100644 index 4d67b7b..0000000 --- a/man-db-2.8.4.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:103c185f9d8269b9ee3b8a4cb27912b3aa393e952731ef96fedc880723472bc3 -size 1779488 diff --git a/man-db-2.8.4.tar.xz.asc b/man-db-2.8.4.tar.xz.asc deleted file mode 100644 index 0ed02a8..0000000 --- a/man-db-2.8.4.tar.xz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCAAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAlta9cYACgkQOTWH2X2G -UAt8yA//fY5MjdNr3RdKMDvA/jxxvw2y3+xy2m/8zeOSvJjapl6F24VoXQ88XNmg -I0Jnb1zd7PnOZaQsRQtRf6LMDl15+jfEuMTm+t3Qul6QpTQmPYhJy0m9drEe9ERl -JrmjHb1eQn6CsATkRrEpMDlNo6rf/vvFgOpRtfULTWl2jLLN+Ua85IVLbfepgWJ9 -5MhW6Z4nHk6a2h2SQf+FdTRCxjGC2z08s+rurKWJ2kDACpOL89NCmpisVDF922i+ -VZq0vh7NQqT8Eaha8Dldyst06GlBYb9vLZUqm0+1+eqS70waH0yn1jlUQHpZQFTa -Pe4ThYo4+BhEIkA3Hr3rNqHdUJ6jncZKc7C6pMmK1Lm2XaNL9+0EgOb4Wb7gZg4B -U4YHswKsPrZZ6V9wouMRNhBQRnvFURAaaxoDJ3teEYit+vrePhS0d6YXxidUtkFS -qRjMHuDJTLjwUVazkumYm0fM40Pk2HZXspopwU3tqXy4cfzrcV0O3c0YxFzUZEjD -siV6HtHG5+JXBs36uWxx+47G0Pk3wnQ111I3jRuvXSSwm8E1jh8rStkbNPx/8/tu -fCUBMQiuEBSQiyISaNYhURlma9iaiegO0mPJ405xnR5fuW+ZdH7U+YrKkv3KJHPV -qe7TrXAuFGYPb+PqHR6QviUXcOfK7iI8nDKO7UW6oBfG24Ndf9U= -=023B ------END PGP SIGNATURE----- diff --git a/man-db-2.9.4-no-chown.patch b/man-db-2.9.4-no-chown.patch new file mode 100644 index 0000000..832d3bc --- /dev/null +++ b/man-db-2.9.4-no-chown.patch @@ -0,0 +1,21 @@ +diff -Nur man-db-2.9.4/src/Makefile.am new/src/Makefile.am +--- man-db-2.9.4/src/Makefile.am 2020-01-01 16:11:59.000000000 +0100 ++++ new/src/Makefile.am 2021-05-31 23:36:22.062144466 +0200 +@@ -192,16 +192,7 @@ + all-am: apropos$(EXEEXT) + + install-exec-hook: +- if [ "$(man_owner)" ] && [ "$(man_mode)" = 6755 ]; then \ +- chown $(man_owner):$(man_owner) \ +- $(DESTDIR)$(bindir)/$(TRANS_MAN) \ +- $(DESTDIR)$(bindir)/$(TRANS_MANDB); \ +- fi +- chmod $(man_mode) \ +- $(DESTDIR)$(bindir)/$(TRANS_MAN) \ +- $(DESTDIR)$(bindir)/$(TRANS_MANDB) +- cd $(DESTDIR)$(bindir) && rm -f $(TRANS_APROPOS)$(EXEEXT) && \ +- $(LN_S) $(TRANS_WHATIS)$(EXEEXT) $(TRANS_APROPOS)$(EXEEXT) ++ $(LN_S) $(TRANS_WHATIS) $(DESTDIR)$(bindir)/$(TRANS_APROPOS) + + install-data-hook: + @if test -f $(DESTDIR)$(config_file); then \ diff --git a/man-db-2.9.4.patch b/man-db-2.9.4.patch new file mode 100644 index 0000000..782b725 --- /dev/null +++ b/man-db-2.9.4.patch @@ -0,0 +1,791 @@ +diff --git a/configure.ac b/configure.ac +index f4fe224..89fb860 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -252,6 +252,14 @@ then + fi + + MAN_CHECK_PROGS([eqn], [EQN], [use EQN to preprocess equations], [eqn geqn]) ++MAN_CHECK_PROGS([geqn], [GEQN], [use GEQN to preprocess equations], [geqn]) ++dnl ++dnl if geqn is found and geqn is identical with eqn we use a GNU eqn ++dnl which its self can use -Tlatin1 ++dnl ++if test -n "$geqn" -a -n "$eqn" ; then ++ test $geqn -ef $eqn && neqn="$eqn -T$nroff_device" ++fi + MAN_CHECK_PROGS([neqn], [NEQN], [use NEQN to preprocess equations for character devices], [neqn gneqn]) + # If we fail to find an neqn, use eqn and try to force it to output for an + # ascii device. As this is only relevant for equations (?), not using latin1 +@@ -295,9 +303,15 @@ then + compress_ext="gz" + fi + MAN_CHECK_PROGS([compress], [COMPRESS], [use COMPRESS as UNIX compression utility], [compress]) +-if test -n "$compress" ++if test -n "$compress" || test -n "$gzip" + then +- uncompress="$compress -dc" ++ if test -n "$gzip" ++ then ++ uncompress="$gzip -dc" ++ elif test -n "$compress" ++ then ++ uncompress="$compress -dc" ++ fi + if test -z "$gzip" + then + compressor="$compress -c" +diff --git a/include/comp_src.h.in b/include/comp_src.h.in +index bc5d601..39f5f0d 100644 +--- a/include/comp_src.h.in ++++ b/include/comp_src.h.in +@@ -51,7 +51,7 @@ struct compression comp_list[] = { + #endif /* HAVE_GZIP */ + + /* If we have compress, incorporate the following */ +-#ifdef HAVE_COMPRESS ++#if defined(HAVE_COMPRESS) || defined(HAVE_GZIP) + {UNCOMPRESS, "Z", NULL}, + /* Else if we have gzip, incorporate the following */ + #elif defined (HAVE_GZIP) +diff --git a/lib/security.c b/lib/security.c +index 55f2d85..8524d1c 100644 +--- a/lib/security.c ++++ b/lib/security.c +@@ -79,6 +79,11 @@ static void gripe_set_euid (void) + error (FATAL, errno, _("can't set effective uid")); + } + ++static inline void gripe_set_egid (void) ++{ ++ error (FATAL, errno, _("can't set effective gid")); ++} ++ + #endif /* MAN_OWNER */ + + void init_security (void) +@@ -165,6 +170,31 @@ void regain_effective_privs (void) + uid = euid; + gid = egid; + } ++ if (gid != rgid) { ++# if defined(HAVE_SETRESGID) ++ if (setresgid (rgid, egid, -1) < 0) ++# elif defined(HAVE_SETREGID) ++ if (setregid (rgid, egid) < 0) ++# elif defined(HAVE_SETEGID) ++ if (setegid (rgid) < 0) ++# endif ++ gripe_set_egid(); ++ ++ gid = rgid; ++ } ++ ++ if (gid != egid) { ++# if defined(HAVE_SETRESGID) ++ if (setresgid (egid, rgid, -1)) ++# elif defined(HAVE_SETREGID) ++ if (setregid (egid, rgid) < 0) ++# elif defined(HAVE_SETEGID) ++ if (setegid (egid)) ++# endif ++ gripe_set_egid(); ++ ++ gid = egid; ++ } + #endif /* MAN_OWNER */ + } + +diff --git a/mk_catdirs b/mk_catdirs +new file mode 100644 +index 0000000..47eaa25 +--- /dev/null ++++ b/mk_catdirs +@@ -0,0 +1,30 @@ ++#!/bin/sh ++ ++OLDPWD="`pwd`" ++CACHE="$1/var/cache/man" ++ ++ cats="cat{0,1,2,3,4,5,6,7,8,9,n}" ++locale="{ca,cs,da,de,en,es,et,fi,fr,ga,hu,is,it,ja,ko,nl,no,pl,pt,ru,sk,sr,sv,uk}" ++ dirs="{local,opt}" ++ ++umask 022 ++test -d ${CACHE} && rm -rf ${CACHE} ++mkdir -p ${CACHE} ++ ++catman=false ++grep -qE '#[[:blank:]]*define[[:blank:]]+MAN_CATS' include/manconfig.h && catman=true ++cd ${CACHE} ++if $catman ; then ++ eval echo ${cats} \ ++ ${locale}/${cats} \ ++ ${dirs}/${cats} \ ++ ${dirs}/${locale}/${cats} ++else ++ eval echo ${locale} \ ++ ${dirs} \ ++ ${dirs}/${locale} ++fi | xargs mkdir -p ++sync ++cd ${OLDPWD} ++ ++test "$(id -u)" -ne 0 || chown man:man -R ${CACHE} +diff --git a/src/check_mandirs.c b/src/check_mandirs.c +index d28a6be..90c5d58 100644 +--- a/src/check_mandirs.c ++++ b/src/check_mandirs.c +@@ -397,7 +397,7 @@ void chown_if_possible (const char *path _GL_UNUSED) + #endif /* MAN_OWNER */ + + /* create the catman hierarchy if it doesn't exist */ +-static void mkcatdirs (const char *mandir, const char *catdir) ++void mkcatdirs (const char *mandir, const char *catdir) + { + char *manname, *catname; + +@@ -425,9 +425,14 @@ static void mkcatdirs (const char *mandir, const char *catdir) + int j; + regain_effective_privs (); + debug ("creating catdir hierarchy %s ", catdir); +- for (j = 1; j <= 9; j++) { +- catname[strlen (catname) - 1] = '0' + j; +- manname[strlen (manname) - 1] = '0' + j; ++ for (j = 1; j <= 10; j++) { ++ unsigned int c; ++ if (j < 10) ++ c = '0' + j; ++ else ++ c = 'n'; ++ catname[strlen (catname) - 1] = c; ++ manname[strlen (manname) - 1] = c; + if ((is_directory (manname) == 1) + && (is_directory (catname) != 1)) { + if (mkdir (catname, 0755) < 0) { +@@ -435,7 +440,7 @@ static void mkcatdirs (const char *mandir, const char *catdir) + error (0, 0, _("warning: cannot create catdir %s"), catname); + debug ("warning: cannot create catdir %s\n", catname); + } else +- debug (" cat%d", j); ++ debug (" cat%c", c); + chown_if_possible (catname); + } + } +@@ -583,15 +588,10 @@ static int testmandirs (const char *database, + } + + if (!quiet) { +- int tty = isatty (STDERR_FILENO); +- +- if (tty) +- fprintf (stderr, "\r"); + fprintf (stderr, + _("Updating index cache for path " + "`%s/%s'. Wait..."), path, mandir->d_name); +- if (!tty) +- fprintf (stderr, "\n"); ++ fprintf (stderr, "\n"); + } + add_dir_entries (dbf, path, mandir->d_name); + MYDBM_CLOSE (dbf); +@@ -698,7 +698,7 @@ int update_db (const char *database, const char *manpath, const char *catpath) + dbf = NULL; + } + if (!dbf) { +- debug ("failed to open %s O_RDONLY\n", database); ++ debug ("failed to open database %s O_RDONLY\n", database); + return EOF; + } + mtime = MYDBM_GET_TIME (dbf); +@@ -904,6 +904,7 @@ static int purge_whatis (MYDBM_FILE dbf, const char *path, int cat, + "would delete\n", name, info->ext); + return 1; + } ++ return 1; + } + + /* Check that multi keys are correctly constructed. */ +@@ -1005,6 +1006,14 @@ int purge_missing (const char *database, + continue; + } + ++ /* Ignore db identifier keys. */ ++ if (*MYDBM_DPTR (key) == '.' && *(key.dptr+1) == 0) { ++ nextkey = MYDBM_NEXTKEY (dbf, key); ++ MYDBM_FREE_DPTR (key); ++ key = nextkey; ++ continue; ++ } ++ + content = MYDBM_FETCH (dbf, key); + if (!MYDBM_DPTR (content)) { + nextkey = MYDBM_NEXTKEY (dbf, key); +diff --git a/src/lexgrog.l b/src/lexgrog.l +index cc31a70..1e3a0d5 100644 +--- a/src/lexgrog.l ++++ b/src/lexgrog.l +@@ -64,7 +64,7 @@ + + #include "manconv_client.h" + +-#define YY_READ_BUF_SIZE 1024 ++#define YY_READ_BUF_SIZE YY_BUF_SIZE + #define MAX_NAME 8192 + + #define ARRAY_SIZE(array) (sizeof (array) / sizeof ((array)[0])) +@@ -212,15 +212,15 @@ static const struct macro perldocs[] = { + { "R\"", "\"" } + }; + +-static void add_str_to_whatis (const char *string, size_t length); +-static void add_char_to_whatis (unsigned char c); +-static void add_separator_to_whatis (void); +-static void add_wordn_to_whatis (const char *string, size_t length); +-static void add_word_to_whatis (const char *string); +-static void add_glyph_to_whatis (const char *string, size_t length); +-static void add_perldoc_to_whatis (const char *string, size_t length); +-static void mdoc_text (const char *string); +-static void newline_found (void); ++static __inline__ void add_str_to_whatis (const char *string, size_t length); ++static __inline__ void add_char_to_whatis (unsigned char c); ++static __inline__ void add_separator_to_whatis (const char *, size_t); ++static __inline__ void add_wordn_to_whatis (const char *string, size_t length); ++static __inline__ void add_word_to_whatis (const char *string); ++static __inline__ void add_glyph_to_whatis (const char *string, size_t length); ++static __inline__ void add_perldoc_to_whatis (const char *string, size_t length); ++static __inline__ void mdoc_text (const char *string); ++static __inline__ void newline_found (void); + + static char newname[MAX_NAME]; + static char *p_name; +@@ -229,6 +229,7 @@ static char filters[MAX_FILTERS]; + + static int fill_mode; + static int waiting_for_quote; ++static int have_separator; + + static pipeline *decomp; + +@@ -246,7 +247,7 @@ static pipeline *decomp; + %} + + %option ecs meta-ecs +-%option 8bit batch caseful never-interactive ++%option 8bit batch caseful never-interactive align + %option nostdinit + %option warn + %option noyywrap nounput +@@ -285,8 +286,9 @@ font_change \\f([[:upper:]1-4]|\({upper}{2}) + size_change \\s[+-]?{digit} + style_change ({font_change}{size_change}?|{size_change}{font_change}?) + typeface \.(B[IR]?|I[BR]?|R[BI]|S[BM]) ++paragr \.[PITLH][Pp] + sec_request \.[Ss][HhYySs] +-comment ['.]\\{dbl_quote} ++comment (['.]\\{dbl_quote}|\'\-+|\\&) + + /* Please add to this list if you know how. */ + /* Note that, since flex only supports UTF-8 by accident, character classes +@@ -325,7 +327,26 @@ vi_name TÊN + zh_CN_name 名{blank}?(称|字){blank}?.* + zh_TW_name (名{blank}?(稱|字)|命令名){blank}?.* + name ({bg_name}|{cs_name}|{da_name}|{de_name}|{en_name}|{eo_name}|{es_name}|{fi_name}|{fr_name}|{hu_name}|{id_name}|{it_name}|{ja_name}|{ko_name}|{latin_name}|{lt_name}|{nl_name}|{pl_name}|{ro_name}|{ru_name}|{sk_name}|{sr_name}|{srlatin_name}|{sv_name}|{ta_name}|{tr_name}|{uk_name}|{vi_name}|{zh_CN_name}|{zh_TW_name}) +-name_sec {dbl_quote}?{style_change}?{name}{style_change}?({blank}*{dbl_quote})? ++name_sec {dbl_quote}?{style_change}?{name}{style_change}?({blank}*{dbl_quote})?\r? ++start {sec_request}{blank_eol}+{name_sec} ++ ++N N(\bN)? ++n (N(\bN)?|n(\bn)?) ++a (A(\bA)?|a(\ba)?) ++o (O(\bO)?|o(\bo)?) ++m (M(\bM)?|M(\bM)?) ++e (E(\bE)?|e(\be)?) ++B B(\bB) ++b (B(\bB)?|b(\bb)?) ++r (R(\bR)?|r(\br)?) ++z (Z(\bZ)?|z(\bz)?) ++i (I(\bI)?|i(\bi)?) ++c (C(\bC)?|c(\bc)?) ++h (H(\bH)?|h(\bh)?) ++u (U(\bU)?|u(\bu)?) ++g (G(\bG)?|g(\bg)?) ++ ++cname (({N}({a}|{o}){m}({n}|{e})|{N}{o}{m}|{N}{o}{m}{b}{r}{e}|{B}{e}{z}{e}{i}{c}{h}{n}{u}{n}{g})|{bg_name}|{cs_name}|{hu_name}|{ko_name}|{ru_name}|{sr_name}|{tr_name}|{vi_name}|{ja_name}|{zh_CN_name}|{zh_TW_name}) + + /* eptgrv : eqn, pic, tbl, grap, refer, vgrind */ + tbl_request \.TS +@@ -339,8 +360,13 @@ vgrind_request \.vS + %% + + /* begin NAME section processing */ +-{sec_request}{blank_eol}+{name_sec}{blank}* BEGIN (MAN_PRENAME); +-{empty}{2,}{name}{blank}*{indent} BEGIN (CAT_NAME); ++{ ++ {start}{blank}*{bol}{blank}*{paragr} | /* strange format */ ++ {start}{blank}* { /* default */ ++ BEGIN (MAN_PRENAME); ++ } ++} ++{empty}{2,}{cname}{blank}*{indent} BEGIN (CAT_NAME); + + /* general text matching */ + { +@@ -415,6 +441,7 @@ vgrind_request \.vS + {bol}\.sp{blank}* | /* vertical spacing */ + {bol}\.ig{blank}* | /* block comment */ + {bol}\.de[1i]?{blank}* | /* macro definition */ ++ {bol}\.V[be]{blank}* | /* special in perl pages */ + {bol}\.i[ef]{blank}* | /* conditional */ + {empty}{bol}.+ | + <> { /* terminate the string */ +@@ -462,8 +489,8 @@ vgrind_request \.vS + + /* Toggle fill mode */ + { +- {bol}\.nf.* fill_mode = 0; +- {bol}\.fi.* fill_mode = 1; ++ {bol}\.(nf|de).* fill_mode = 0; ++ {bol}\.(fi|\.).* fill_mode = 1; + } + + -{eol}{blank_eol}* /* strip continuations */ +@@ -472,6 +499,9 @@ vgrind_request \.vS + { + {next}{blank}*\\\((mi|hy|em|en){blank}* | + {next}{blank}*\\\[(mi|hy|em|en)\]{blank}* | ++ {bol}\.sp{bol}{blank}+\\-{blank}* | /* strange spacing in NAME section */ ++ {blank}+[-\\]?-{bol} | /* dash at end of line */ ++ {next}{blank_eol}+(\\?-){2}{blank}+ | /* some man pages use -- as dash */ + {next}{blank_eol}+[-\\]-{blank}* | + {next}{blank_eol}*[-\\]-{blank}+ | + {bol}\.Nd{blank}* { +diff --git a/src/man.c b/src/man.c +index 6d1cba7..f72867c 100644 +--- a/src/man.c ++++ b/src/man.c +@@ -56,6 +56,7 @@ + #include + #include + #include ++#include + + #include "argp.h" + #include "dirname.h" +@@ -106,6 +107,8 @@ + #ifdef MAN_OWNER + extern uid_t ruid; + extern uid_t euid; ++extern gid_t rgid; ++extern gid_t egid; + #endif /* MAN_OWNER */ + + /* the default preprocessor sequence */ +@@ -136,6 +139,11 @@ char *lang; + + static bool global_manpath; /* global or user manual page hierarchy? */ + static int skip; /* page exists but has been skipped */ ++static struct termios tms; /* To save terminal settings in */ ++static int tms_set = 0; /* Do we have saved terminal settings? */ ++static pid_t tms_pid = 0; ++ ++static void set_term(void) { if (tms_set && getpid () == tms_pid) tcsetattr(fileno(stdin), TCSANOW, &tms); } + + #if defined _AIX || defined __sgi + char **global_argv; +@@ -232,10 +240,10 @@ static int found_a_stray; /* found a straycat */ + #ifdef MAN_CATS + static char *tmp_cat_file; /* for open_cat_stream(), close_cat_stream() */ + static int created_tmp_cat; /* dto. */ +-#endif + static int tmp_cat_fd; + static struct timespec man_modtime; /* modtime of man page, for + * commit_tmp_cat() */ ++#endif + + # ifdef TROFF_IS_GROFF + static bool ditroff; +@@ -608,36 +616,6 @@ static void gripe_no_name (const char *sect) + exit (FAIL); + } + +-static struct termios tms; +-static int tms_set = 0; +-static pid_t tms_pid = 0; +- +-static void set_term (void) +-{ +- if (tms_set && getpid () == tms_pid) +- tcsetattr (STDIN_FILENO, TCSANOW, &tms); +-} +- +-static void get_term (void) +-{ +- if (isatty (STDOUT_FILENO)) { +- debug ("is a tty\n"); +- tcgetattr (STDIN_FILENO, &tms); +- if (!tms_set++) { +- /* Work around pipecmd_exec calling exit(3) rather +- * than _exit(2), which means our atexit-registered +- * functions are called at the end of each child +- * process created using pipecmd_new_function and +- * friends. It would probably be good to fix this +- * in libpipeline at some point, but it would +- * require care to avoid breaking compatibility. +- */ +- tms_pid = getpid (); +- atexit (set_term); +- } +- } +-} +- + #if defined(TROFF_IS_GROFF) || defined(HEIRLOOM_NROFF) + static int get_roff_line_length (void) + { +@@ -1526,6 +1504,18 @@ static void setenv_less (pipecmd *cmd, const char *title) + free (less_opts); + } + ++static void disable_x(void) ++{ ++ char *bname = basename((char*)pager); ++ if (bname) { ++ if (!strcmp(bname, "less")) ++ unsetenv("DISPLAY"); ++#if 0 ++ free(bname); ++#endif ++ } ++} ++ + static void add_output_iconv (pipeline *p, + const char *source, const char *target) + { +@@ -1656,6 +1646,8 @@ static pipeline *make_display_command (const char *encoding, const char *title) + + if (pager_cmd) { + setenv_less (pager_cmd, title); ++ if (!htmlout) ++ disable_x(); + pipeline_command (p, pager_cmd); + } + pipeline_ignore_signals (p, 1); +@@ -1666,7 +1658,7 @@ static pipeline *make_display_command (const char *encoding, const char *title) + return p; + } + +- ++#ifdef MAN_CATS + /* return a (malloced) temporary name in cat_file's directory */ + static char *tmp_cat_filename (const char *cat_file) + { +@@ -1694,7 +1686,6 @@ static char *tmp_cat_filename (const char *cat_file) + return name; + } + +- + /* If delete unlink tmp_cat, else commit tmp_cat to cat_file. + Return non-zero on error. + */ +@@ -1767,6 +1758,7 @@ static int commit_tmp_cat (const char *cat_file, const char *tmp_cat, + + return status; + } ++#endif /* MAN_CATS */ + + /* TODO: This should all be refactored after work on the decompression + * library is complete. +@@ -1803,7 +1795,6 @@ static void cleanup_unlink (void *arg) + } + + #ifdef MAN_CATS +- + /* Return pipeline to write formatted manual page to for saving as cat file. */ + static pipeline *open_cat_stream (const char *cat_file, const char *encoding) + { +@@ -2025,6 +2016,7 @@ static void format_display (pipeline *decomp, + regain_effective_privs (); + } + ++#ifdef MAN_CATS + /* "Display" a page in catman mode, which amounts to saving it. */ + /* TODO: merge with format_display_and_save? */ + static void display_catman (const char *cat_file, pipeline *decomp, +@@ -2068,6 +2060,7 @@ static void display_catman (const char *cat_file, pipeline *decomp, + pop_cleanup (cleanup_unlink, tmpcat); + free (tmpcat); + } ++#endif /* MAN_CATS */ + + static void disable_hyphenation (void *data _GL_UNUSED) + { +@@ -2268,7 +2261,7 @@ static int display (const char *dir, const char *man_file, + format_cmd = NULL; + decomp_errno = errno; + } +- ++#ifdef MAN_CATS + /* Get modification time, for commit_tmp_cat(). */ + if (man_file && *man_file) { + struct stat stb; +@@ -2278,7 +2271,7 @@ static int display (const char *dir, const char *man_file, + } else + man_modtime = get_stat_mtime (&stb); + } +- ++#endif /* MAN_CATS */ + display_to_stdout = troff; + #ifdef TROFF_IS_GROFF + if (htmlout || gxditview) +@@ -2418,6 +2411,7 @@ static int display (const char *dir, const char *man_file, + } + if (printed) + putchar ('\n'); ++#ifdef MAN_CATS + } else if (catman) { + if (format) { + if (!save_cat) +@@ -2430,6 +2424,7 @@ static int display (const char *dir, const char *man_file, + format_cmd, + formatted_encoding); + } ++#endif /* MAN_CATS */ + } else if (format) { + /* no cat or out of date */ + pipeline *disp_cmd; +@@ -2491,8 +2486,10 @@ static int display (const char *dir, const char *man_file, + + free (formatted_encoding); + +- pipeline_free (format_cmd); +- pipeline_free (decomp); ++ if (format_cmd) ++ pipeline_free (format_cmd); ++ if (decomp) ++ pipeline_free (decomp); + + if (!prompt) + prompt = found; +@@ -3324,7 +3321,7 @@ static int display_database_check (struct candidate *candp) + #ifdef MAN_DB_UPDATES + if (!exists && !skip) { + debug ("dbdelete_wrapper (%s, %p)\n", +- candp->req_name, candp->source); ++ candp->req_name, candp->source->addr); + dbdelete_wrapper (candp->req_name, candp->source); + } + #endif /* MAN_DB_UPDATES */ +@@ -3753,17 +3750,20 @@ static int local_man_loop (const char *argv) + /* Check that the file exists and isn't e.g. a directory */ + if (stat (argv, &st)) { + error (0, errno, "%s", argv); ++ regain_effective_privs (); + return NOT_FOUND; + } + + if (S_ISDIR (st.st_mode)) { + error (0, EISDIR, "%s", argv); ++ regain_effective_privs (); + return NOT_FOUND; + } + + if (S_ISCHR (st.st_mode) || S_ISBLK (st.st_mode)) { + /* EINVAL is about the best I can do. */ + error (0, EINVAL, "%s", argv); ++ regain_effective_privs (); + return NOT_FOUND; + } + +@@ -3826,6 +3826,11 @@ executable_out: + argv_abs = xstrdup (argv); + } + lang = lang_dir (argv_abs); ++ if (!lang || !*lang) { ++ if (lang) ++ free(lang); ++ lang = xstrdup(internal_locale); ++ } + free (argv_abs); + if (!display (NULL, argv, NULL, argv_base, NULL)) { + if (local_mf) +@@ -4075,7 +4080,16 @@ int main (int argc, char *argv[]) + umask (022); + init_locale (); + +- internal_locale = setlocale (LC_MESSAGES, NULL); ++ internal_locale = setlocale (LC_MESSAGES, ""); ++#if defined(__GLIBC__) ++# if (__GLIBC__ < 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2) ++ if (!internal_locale) { ++ if ( !(internal_locale = getenv ("LC_ALL")) ++ && !(internal_locale = getenv ("LC_MESSAGES"))) ++ internal_locale = getenv ("LANG"); ++ } ++# endif ++#endif + /* Use LANGUAGE only when LC_MESSAGES locale category is + * neither "C" nor "POSIX". */ + if (internal_locale && strcmp (internal_locale, "C") && +@@ -4120,7 +4134,16 @@ int main (int argc, char *argv[]) + if (external) + do_extern (argc, argv); + ++#ifdef MAN_OWNER ++ if (isatty(fileno(stdin)) && isatty(fileno(stdout))) { ++ tcgetattr(fileno(stdin), &tms); ++ tms_pid = getpid (); ++ if (!tms_set++) ++ atexit(set_term); ++ } ++#else + get_term (); /* stores terminal settings */ ++#endif + + /* close this locale and reinitialise if a new locale was + issued as an argument or in $MANOPT */ +diff --git a/src/man_db.conf.in b/src/man_db.conf.in +index 2942000..b2751f5 100644 +--- a/src/man_db.conf.in ++++ b/src/man_db.conf.in +@@ -20,6 +20,14 @@ + MANDATORY_MANPATH /usr/man + MANDATORY_MANPATH /usr/share/man + MANDATORY_MANPATH /usr/local/share/man ++MANDATORY_MANPATH /opt/man ++MANDATORY_MANPATH /opt/dx/man ++MANDATORY_MANPATH /opt/lsb/man ++MANDATORY_MANPATH /opt/cross/share/man ++MANDATORY_MANPATH /opt/mpich/man ++MANDATORY_MANPATH /opt/lsb-tet3-lite/share/man ++MANDATORY_MANPATH /opt/snavigator/man ++MANDATORY_MANPATH /opt/novell/man + #--------------------------------------------------------- + # set up PATH to MANPATH mapping + # ie. what man tree holds man pages for what binary directory. +@@ -34,8 +42,10 @@ MANPATH_MAP /usr/local/bin /usr/local/man + MANPATH_MAP /usr/local/bin /usr/local/share/man + MANPATH_MAP /usr/local/sbin /usr/local/man + MANPATH_MAP /usr/local/sbin /usr/local/share/man +-MANPATH_MAP /usr/X11R6/bin /usr/X11R6/man +-MANPATH_MAP /usr/bin/X11 /usr/X11R6/man ++MANPATH_MAP /usr/X11R6/bin /usr/share/man ++MANPATH_MAP /usr/X11/bin /usr/share/man ++MANPATH_MAP /usr/bin/X11 /usr/share/man ++MANPATH_MAP /usr/bin/mh /usr/share/man + MANPATH_MAP /usr/games /usr/share/man + MANPATH_MAP /opt/bin /opt/man + MANPATH_MAP /opt/sbin /opt/man +@@ -68,7 +78,8 @@ MANDB_MAP /usr/share/man /var/cache/man + MANDB_MAP /usr/local/man /var/cache/man/oldlocal + MANDB_MAP /usr/local/share/man /var/cache/man/local + MANDB_MAP /usr/X11R6/man /var/cache/man/X11R6 +-MANDB_MAP /opt/man /var/cache/man/opt ++MANDB_MAP /opt/man /var/cache/man/oldopt ++MANDB_MAP /opt/share/man /var/cache/man/opt + MANDB_MAP /snap/man /var/cache/man/snap + # + #--------------------------------------------------------- +diff --git a/src/mandb.c b/src/mandb.c +index 7a63d8d..786e77b 100644 +--- a/src/mandb.c ++++ b/src/mandb.c +@@ -203,6 +203,8 @@ struct dbpaths { + #ifdef MAN_OWNER + extern uid_t ruid; + extern uid_t euid; ++extern gid_t rgid; ++extern gid_t egid; + #endif /* MAN_OWNER */ + + static gl_list_t manpathlist; +@@ -554,6 +556,8 @@ out: + return amount; + } + ++extern void mkcatdirs (const char *, const char *); ++ + static int process_manpath (const char *manpath, bool global_manpath, + gl_map_t tried_catdirs) + { +@@ -601,6 +605,8 @@ static int process_manpath (const char *manpath, bool global_manpath, + free (database); + } + ++ mkcatdirs (manpath, catpath); ++ + dbpaths = XZALLOC (struct dbpaths); + push_cleanup (cleanup, dbpaths, 0); + push_cleanup (cleanup_sigsafe, dbpaths, 1); +@@ -616,7 +622,7 @@ static int process_manpath (const char *manpath, bool global_manpath, + if (!opt_test && amount) + finish_up (dbpaths); + #ifdef MAN_OWNER +- if (global_manpath) ++ if (global_manpath && (euid == 0 || ruid == 0)) + do_chown (dbpaths); + #endif /* MAN_OWNER */ + +@@ -819,8 +825,14 @@ int main (int argc, char *argv[]) + + #ifdef MAN_OWNER + man_owner = get_man_owner (); +- if (!user && euid != 0 && euid != man_owner->pw_uid) +- user = true; ++ if (!user) { ++ if (!ruid && euid != man_owner->pw_uid) { ++ seteuid(man_owner->pw_uid); ++ euid = geteuid(); ++ } ++ if (euid != man_owner->pw_uid) ++ user = true; ++ } + #endif /* MAN_OWNER */ + + read_config_file (user); +diff --git a/src/manp.c b/src/manp.c +index 5441339..ac46d3f 100644 +--- a/src/manp.c ++++ b/src/manp.c +@@ -898,7 +898,7 @@ static char *def_path (enum config_flag flag) + + /* If we have complete config file failure... */ + if (!manpath) +- return xstrdup ("/usr/man"); ++ return xstrdup ("/usr/share/man"); + + return manpath; + } +diff --git a/src/straycats.c b/src/straycats.c +index b07083c..fbc0c1b 100644 +--- a/src/straycats.c ++++ b/src/straycats.c +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include + + #include "canonicalize.h" +diff --git a/src/ult_src.c b/src/ult_src.c +index 43e7a9b..93bd30c 100644 +--- a/src/ult_src.c ++++ b/src/ult_src.c +@@ -336,10 +336,15 @@ const char *ult_src (const char *name, const char *path, + } + pipeline_start (decomp); + +- /* make sure that we skip over any comments */ ++ /* ++ * make sure that we skip over any comments ++ * ... even if we handle TCL/TK manual pages ++ */ + do { + buffer = pipeline_readline (decomp); +- } while (buffer && STRNEQ (buffer, ".\\\"", 3)); ++ } while (buffer && *buffer && ++ (STRNEQ (buffer, ".\\\"", 3) || ++ STRNEQ (buffer, "'\\\"", 3))); + + include = test_for_include (buffer); + if (include) { diff --git a/man-db-2.9.4.tar.xz b/man-db-2.9.4.tar.xz new file mode 100644 index 0000000..27fb692 --- /dev/null +++ b/man-db-2.9.4.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b66c99edfad16ad928c889f87cf76380263c1609323c280b3a9e6963fdb16756 +size 1909020 diff --git a/man-db-2.9.4.tar.xz.asc b/man-db-2.9.4.tar.xz.asc new file mode 100644 index 0000000..71c56f2 --- /dev/null +++ b/man-db-2.9.4.tar.xz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCAAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAmAhxZ0ACgkQOTWH2X2G +UAtvuRAAnSJCWzUDJ3588STv6CoaTr2LPqvAWYaX8TirjaBArrHAkLbtljiACDTh +FvuzJvpm8Uy0y8H1zoZsvyaxrP0z9K+SKxPAV7WURyHIk5eXCVN6AoIlZ4WkAbcx +lcRP12vP8pReBqgTg/wKg/qcr3avwsP5gZFlk+tZegboqjzNwgntUuWwMvNP+8GI +/MEZFAnJ51gm4JT32RyXmGmOwwq45bZVmjo44e2fuo1Ke3jZa0whL5HpDDVCVE/J +45bdURdIkQLPo+XroKHCqp/T9z/wI+IFsbNoqr1BtMhc/HyvJHqnEoSVZ9oN5WAf +yyo7XkMCcYAsBz0pGC314i/G78ojrhDgpWJe1PUiMTcHR+iIIjoR/7NjSH0Zm3Z/ +/K/wsv6iDeNArwzF1aYQ8+0AK2tfWfAXOqUY8Rop7XQR+Yx9Xbz9UK3Z2mHproMJ +y+URF1QgtEOQakzejX4TKUGN94skFn2JukDqeqoVeaujLQ2zq6b49JPGeIzBNAQ8 +iQk5RZXJejIKhBe0SauVTsCjeM7SnQ4eSL6fCCkH4q8JfWI5R8mg5JUlf+kAYh81 +EMSCy8f3xNNQpi7Skj/Mfs636E9hkmgoEjtraps59D5/gpmBmjJn3cL/d8HTz4QE +o2Xu92t2XWYlJZfEifdOaYXrT6KnguN8aIQDv4un9xW/B8uFjn0= +=TXm9 +-----END PGP SIGNATURE----- diff --git a/man.changes b/man.changes index 1133bce..5c81714 100644 --- a/man.changes +++ b/man.changes @@ -1,3 +1,55 @@ +------------------------------------------------------------------- +Mon May 31 19:07:16 UTC 2021 - Ferdinand Thiessen + +- Update to version 2.9.4: + * Add support for zstd-compressed manual pages + * Recognise Esperanto, Romanian, Tamil, and Ukrainian translations + of the NAME section. + * Fix handling of \- in the right-hand side of a NAME section. + * Treat "\[en]" (etc.) as another synonym for "\-" in NAME sections, + alongside the existing "\(en" (etc.). + * Avoid incorrect markup in man(1) with po4a >= 0.58. + * Fix manual page translation infrastructure to compare po4a + versions with more than two components correctly. + * Fix "man -X75-12" and "man -X100-12" to set the document font + size as well as the device + * Fix incompatibility of "man -X" and friends with the seccomp + sandbox. + * man --recode and manconv now adjust encoding declarations on the + first line of their input to refer to the new encoding. + * There is a new "man-recode" program. Which has an interface + designed for bulk conversion and so can be much faster when + used on a large number of pages. + * Fix comparison of candidate manual pages to correctly handle the + case where the language elements are the same and match the + locale, but the territory elements differ. + * If run with no arguments or only a section, man now suggests + running "man man". + * man now understands the (
) form on its command + line, so for example "man 'chmod(2)'" is now the same as + "man 2 chmod". + * manconv now guesses the input encoding based on the file name + if it is not explicitly specified. + * Further workarounds for ESET File Security: allow sendmsg when + it is in use. + * If more than one of "../man", "man", "../share/man", and + "share/man" exist relative to a directory on $PATH, then all of + them are now added to the automatically-determined manpath + * Remove arbitrary limit on manpath size. + * Fix several resource and memory leaks. + * Ship a systemd timer to perform daily database maintenance. + * Fix segfaults in mandb. +- Drop our systemd timer in favor of upstream provided one +- Drop unused mancoding +- Drop upstream fixed man-db-2.6.3-section.dif +- Merge man-MAN_POSIXLY_CORRECT-man1.dif into + man-db-2.6.3-listall.dif as first one is only the documentation + of the latter one +- Seperate man-db-2.9.4-no-chown.patch from man-db-2.8.4.dif +- Update man-db-2.8.4.dif, now called man-db-2.9.4.patch +- Update man-db-2.6.3-man0.dif to be used inside prep section +- Refresh man-db-2.7.1-security4.dif, man-db-2.7.1-zio.dif + ------------------------------------------------------------------- Fri Jan 22 23:57:39 UTC 2021 - Dirk Müller diff --git a/man.spec b/man.spec index 4da39bb..135f592 100644 --- a/man.spec +++ b/man.spec @@ -24,36 +24,36 @@ %endif %bcond_without sdtimer Name: man -Version: 2.8.4 +Version: 2.9.4 Release: 0 Summary: A Program for Displaying man Pages License: GPL-2.0-or-later Group: System/Base URL: https://savannah.nongnu.org/projects/man-db -Source: http://download.savannah.gnu.org/releases/man-db/man-db-%{version}.tar.xz -Source1: sysconfig.cron-man -Source2: cron.daily.do_mandb -Source4: mancoding +Source0: https://download.savannah.gnu.org/releases/man-db/man-db-%{version}.tar.xz +Source1: http://download.savannah.gnu.org/releases/man-db/man-db-%{version}.tar.xz.asc +Source2: https://savannah.nongnu.org/project/memberlist-gpgkeys.php?group=man-db&download=1#/%{name}.keyring +Source3: sysconfig.cron-man +Source4: cron.daily.do_mandb Source5: wrapper.c Source6: man-rpmlintrc Source7: man-db-create.service -Source8: mandb.timer -Source9: mandb.service -Source10: man-db-2.6.3-man0.dif -Source11: http://download.savannah.gnu.org/releases/man-db/man-db-%{version}.tar.xz.asc -Source12: https://savannah.nongnu.org/project/memberlist-gpgkeys.php?group=man-db&download=1#/%{name}.keyring -Patch0: man-db-2.8.4.dif -Patch2: man-db-2.3.19deb4.0-groff.dif -Patch4: man-db-2.6.3-section.dif -Patch5: man-db-2.7.1-security4.dif -Patch6: man-db-2.7.1-firefox.dif -Patch7: man-db-2.6.3-chinese.dif -Patch9: man-db-2.7.1-zio.dif -Patch10: man-db-2.6.3-listall.dif -# PATCH-FIX-SUSE Fixes the documentation for bnc#786679 -Patch11: man-MAN_POSIXLY_CORRECT-man1.dif +Patch0: man-db-2.3.19deb4.0-groff.dif +Patch1: man-db-2.7.1-security4.dif +Patch2: man-db-2.7.1-firefox.dif +Patch3: man-db-2.6.3-chinese.dif +# PATCH-FEATURE-OPENSUSE man-db-2.7.1-zio.dif -- Allow using libzio for decompression +Patch4: man-db-2.7.1-zio.dif +# PATCH-FEATURE-OPENSUSE man-db-2.6.3-listall.dif -- If multiple matching pages are found show a list bnc#786679 +Patch5: man-db-2.6.3-listall.dif # PATCH-FIX-SUSE Fixes build-compare bnc#971922 -Patch12: reproducible.patch +Patch6: reproducible.patch +# PATCH-FIX-OPENSUSE man-db-2.9.4-no-chown.patch -- chown is not allowed as non-root +Patch7: man-db-2.9.4-no-chown.patch +# what is it good for? +Patch8: man-db-2.9.4.patch +# PATCH-FEATURE-OPENSUSE -- Add documentation about man0 section (header files) +Patch9: man-db-2.6.3-man0.dif BuildRequires: automake BuildRequires: flex BuildRequires: gdbm-devel @@ -61,15 +61,14 @@ BuildRequires: gettext-runtime BuildRequires: gettext-tools BuildRequires: groff BuildRequires: less -BuildRequires: libbz2-devel BuildRequires: libpipeline-devel >= 1.5.0 BuildRequires: libzio-devel BuildRequires: man-pages BuildRequires: pkgconfig BuildRequires: po4a BuildRequires: update-alternatives -BuildRequires: xz-devel BuildRequires: zlib-devel +BuildRequires: zstd BuildRequires: pkgconfig(systemd) Requires: glibc-locale-base Suggests: glibc-locale @@ -79,8 +78,8 @@ Requires: less PreReq: coreutils PreReq: fillup Requires(post): update-alternatives -Requires(posttrans): systemd -Requires(postun): update-alternatives +Requires(posttrans):systemd +Requires(postun):update-alternatives Requires(pre): group(man) Requires(pre): user(man) Provides: man_db @@ -94,20 +93,23 @@ printer (using groff). %prep %setup -q -n man-db-%{version} -%patch2 -b .groff -%patch4 -b .sect -%patch5 -b .secu4 -%patch6 -b .firefox -%patch7 -b .chinese -%patch9 -b .zio -%patch10 -b .listall -%patch11 -b .p11 -%patch12 -p1 -b .p12 -%patch0 -b .0 +%patch0 -b .groff +%patch1 -b .secu4 +%patch2 -b .firefox +%patch3 -b .chinese +%patch4 -b .zio +%patch5 -b .listall +%patch6 -p1 -b .p12 +%patch7 -p1 +%patch8 -p1 +%patch9 -b .s10 +rm -f configure %build - gettextize --force --copy --no-changelog - SEC=(0 1 n l 8 3 2 5 4 9 6 7 +%global optflags %{optflags} -funroll-loops -pipe -Wall + +gettextize --force --copy --no-changelog +SEC=(0 1 n l 8 3 2 5 4 9 6 7 1x 3x 4x 5x 6x 8x 1bind 3bind 5bind 7bind 8bind 1cn 8cn @@ -126,31 +128,33 @@ printer (using groff). 3t 3tk 3tcl 3tclx 3tix 7l 7nr 8c - Cg g s m) - SEC="${SEC[@]}" - rm -f configure -%global optflags %{optflags} -funroll-loops -pipe -Wall - if grep -q _DEFAULT_SOURCE %{_includedir}/features.h ; then + Cg g s m +) +SEC="${SEC[@]}" +if grep -q _DEFAULT_SOURCE %{_includedir}/features.h ; then CFLAGS="%{optflags} -D_GNU_SOURCE -D_DEFAULT_SOURCE" - else +else CFLAGS="%{optflags} -D_GNU_SOURCE -D_SVID_SOURCE" - fi - LDFLAGS= - LIBS= - LINGUAS= - for d in $(cat man/LINGUAS*) ; do +fi +for d in $(cat man/LINGUAS*) ; do test -d %{_datadir}/locale/$d || continue LINGUAS="${LINGUAS:+$LINGUAS }$d" - done - export CFLAGS LDFLAGS LIBS LINGUAS - aclocal -I ${PWD} -I ${PWD}/m4 -I ${PWD}/gl/m4 - autoconf -B ${PWD} -B ${PWD}/m4 -B ${PWD}/gl/m4 - automake --add-missing - find -name 'Makefile.*' | xargs \ +done +export CFLAGS LINGUAS +# Create configure +aclocal -I ${PWD} -I ${PWD}/m4 -I ${PWD}/gl/m4 +autoconf -B ${PWD} -B ${PWD}/m4 -B ${PWD}/gl/m4 +automake --add-missing +find -name 'Makefile.*' | xargs \ sed -ri -e '/^pkglibdir/{ s@^(pkglibdir[[:blank:]]+=[[:blank:]]+\$\(libdir\)).*@\1@p }' - %configure \ - --enable-dups \ - --enable-cache-owner=man \ +# Configure +%configure \ +%if %{without sdtimer} + --with-systemdtmpfilesdir=no \ + --with-systemdsystemunitdir=no \ +%endif + --enable-dups \ + --enable-cache-owner=man \ --with-device=utf8 \ --with-zio \ --with-gnu-ld \ @@ -165,8 +169,9 @@ printer (using groff). --with-config-file=%{_sysconfdir}/manpath.config \ --without-included-gettext \ --with-sections="${SEC}" - %make_build nls=all - for man in $(find man/ -type f -a -name '*.[0-9]'); do +%make_build nls=all +# Fix coding +for man in $(find man/ -type f -a -name '*.[0-9]'); do pp="$(head -n 1 $man)" case "$pp" in \'\\\"*\ -\*-\ coding:\ *\ -\*-) @@ -180,10 +185,11 @@ printer (using groff). '\\\\\" -\*- coding: UTF-8 -\*-\ " $man esac - done - patch --backup --suffix=.s10 ${FUZZ+"--fuzz=$FUZZ"} -p0 < %{SOURCE10} - gcc $CFLAGS -I gl/lib/ -I include/ --include config.h -D LOCALEDIR="\"%{_datarootdir}/locale\"" \ - -D LIBEXECDIR="\"%{_libexecdir}\"" -o wrapper %{SOURCE5} -L gl/lib/.libs/ -lgnu +done +# +gcc $CFLAGS -I gl/lib/ -I include/ --include config.h \ + -D LOCALEDIR="\"%{_datarootdir}/locale\"" \ + -D LIBEXECDIR="\"%{_libexecdir}\"" -o wrapper %{SOURCE5} -L gl/lib/.libs/ -lgnu %check if ! make check; then @@ -195,74 +201,63 @@ fi %if 0%{?suse_version} <= 1030 export MKDIR_P="mkdir -p" %endif - rm -rf %{buildroot}%{_localstatedir}/cache/man - mkdir -p %{buildroot}%{_docdir}/man - mkdir -p %{buildroot}%{_libexecdir}/man-db - mkdir -p %{buildroot}%{_bindir} - mkdir -p %{buildroot}%{_sysconfdir} - mkdir -p %{buildroot}%{_mandir} - mkdir -p %{buildroot}%{_sysconfdir}/alternatives - make nls=all install DESTDIR=%{buildroot} +rm -rf %{buildroot}%{_localstatedir}/cache/man +%make_install nls=all find %{buildroot} -type f -name "*.la" -delete -print - mv %{buildroot}%{_datadir}/doc/man-db/man-db-manual.* \ - %{buildroot}%{_docdir}/man/ - # wrapper which drops roots privileges if root executes man or mandb - mv -vf %{buildroot}%{_bindir}/man %{buildroot}%{_libexecdir}/man-db/ - mv -vf %{buildroot}%{_bindir}/mandb %{buildroot}%{_libexecdir}/man-db/ - rm -vf %{buildroot}%{_bindir}/apropos - mv -vf %{buildroot}%{_bindir}/whatis %{buildroot}%{_libexecdir}/man-db/ - install wrapper %{buildroot}%{_libexecdir}/man-db/ - ln -sf %{_libexecdir}/man-db/wrapper %{buildroot}%{_sysconfdir}/alternatives/man - ln -sf %{_libexecdir}/man-db/wrapper %{buildroot}%{_bindir}/mandb - ln -sf %{_libexecdir}/man-db/whatis %{buildroot}%{_sysconfdir}/alternatives/apropos - ln -sf %{_libexecdir}/man-db/whatis %{buildroot}%{_sysconfdir}/alternatives/whatis - ln -sf %{_sysconfdir}/alternatives/man %{buildroot}%{_bindir}/man - ln -sf %{_sysconfdir}/alternatives/apropos %{buildroot}%{_bindir}/apropos - ln -sf %{_sysconfdir}/alternatives/whatis %{buildroot}%{_bindir}/whatis - pushd %{buildroot}%{_mandir}/ - rm -rf *.ascii/ - for d in *.UTF-8 ; do +# Move manual +mkdir -p %{buildroot}%{_docdir} +mv %{buildroot}%{_datadir}/doc/man-db %{buildroot}%{_docdir}/man/ +# wrapper which drops roots privileges if root executes man or mandb +mv -vf %{buildroot}%{_bindir}/man %{buildroot}%{_libexecdir}/man-db/ +mv -vf %{buildroot}%{_bindir}/mandb %{buildroot}%{_libexecdir}/man-db/ +rm -vf %{buildroot}%{_bindir}/apropos +mv -vf %{buildroot}%{_bindir}/whatis %{buildroot}%{_libexecdir}/man-db/ +install -D -m 0755 wrapper %{buildroot}%{_libexecdir}/man-db/ +install -d -m 0755 %{buildroot}%{_sysconfdir}/alternatives +ln -sf %{_libexecdir}/man-db/wrapper %{buildroot}%{_sysconfdir}/alternatives/man +ln -sf %{_libexecdir}/man-db/wrapper %{buildroot}%{_bindir}/mandb +ln -sf %{_libexecdir}/man-db/whatis %{buildroot}%{_sysconfdir}/alternatives/apropos +ln -sf %{_libexecdir}/man-db/whatis %{buildroot}%{_sysconfdir}/alternatives/whatis +ln -sf %{_sysconfdir}/alternatives/man %{buildroot}%{_bindir}/man +ln -sf %{_sysconfdir}/alternatives/apropos %{buildroot}%{_bindir}/apropos +ln -sf %{_sysconfdir}/alternatives/whatis %{buildroot}%{_bindir}/whatis +# Fix man pages +pushd %{buildroot}%{_mandir}/ +rm -rf *.ascii/ +for d in *.UTF-8 ; do find -name '*.[1-9nlop]' | xargs gzip -9f - done - for d in `find -name manpath.5%{?ext_man} -printf '%%h '` ; do +done +for d in `find -name manpath.5%{?ext_man} -printf '%%h '` ; do ln -sf manpath.5%{?ext_man} $d/manpath.config.5%{?ext_man} - done - - for man in apropos man whatis - do +done +for man in apropos man whatis; do mv man1/${man}.1%{?ext_man} man1/${man}-db.1%{?ext_man} ln -sf %{_sysconfdir}/alternatives/${man}.1%{?ext_man} man1/${man}.1%{?ext_man} ln -sf %{_mandir}/man1/${man}-db.1%{?ext_man} %{buildroot}%{_sysconfdir}/alternatives/${man}.1%{?ext_man} - done +done +# remove japanese pages, as they are in man-pages-ja +# (need to cross verify at some point that they are up to date there) +rm -rf ja +popd - # remove japanese pages, as they are in man-pages-ja - # (need to cross verify at some point that they are up to date there) - rm -rf ja - - popd - install -m 644 src/man_db.conf %{buildroot}%{_sysconfdir}/manpath.config - sh ./mk_catdirs %{buildroot} - mkdir -p %{buildroot}%{_datadir}/groff/site-tmac - install -m 0644 groff/tmac.andb %{buildroot}%{_datadir}/groff/site-tmac/ - install -m 0644 groff/tmac.andocdb %{buildroot}%{_datadir}/groff/site-tmac/ - mkdir -p %{buildroot}%{_fillupdir} - mkdir -p %{buildroot}%{_unitdir}/ +install -m 644 src/man_db.conf %{buildroot}%{_sysconfdir}/manpath.config +sh ./mk_catdirs %{buildroot} +mkdir -p %{buildroot}%{_datadir}/groff/site-tmac +install -m 0644 groff/tmac.andb %{buildroot}%{_datadir}/groff/site-tmac/ +install -m 0644 groff/tmac.andocdb %{buildroot}%{_datadir}/groff/site-tmac/ +mkdir -p %{buildroot}%{_fillupdir} +mkdir -p %{buildroot}%{_unitdir}/ %if 0%{?suse_version} < 1500 mkdir -p %{buildroot}%{_sysconfdir}/cron.daily %endif - install -m 0644 %{SOURCE1} %{buildroot}%{_fillupdir} + install -m 0644 %{SOURCE3} %{buildroot}%{_fillupdir} %if 0%{?suse_version} < 1500 - install -m 0744 %{SOURCE2} %{buildroot}%{_sysconfdir}/cron.daily/suse-do_mandb + install -m 0744 %{SOURCE4} %{buildroot}%{_sysconfdir}/cron.daily/suse-do_mandb %else - install -m 0744 %{SOURCE2} %{buildroot}/%{_libexecdir}/man-db/do_mandb + install -m 0744 %{SOURCE4} %{buildroot}/%{_libexecdir}/man-db/do_mandb %endif %if %{with sdtimer} install -m 0644 %{SOURCE7} %{buildroot}%{_unitdir}/ -%if 0%{?suse_version} >= 1500 - install -m 0644 %{SOURCE8} %{buildroot}%{_unitdir}/ - install -m 0644 %{SOURCE9} %{buildroot}%{_unitdir}/ - sed -ri 's|@@LIBEXECDIR@@|%{_libexecdir}|' %{buildroot}%{_unitdir}/mandb.service -%endif %endif %find_lang man-db --all-name --with-man @@ -271,7 +266,7 @@ find %{buildroot} -type f -name "*.la" -delete -print test -d var/catman/ && rm -rf var/catman/ || true %if %{with sdtimer} %if 0%{?suse_version} >= 1500 -%service_add_pre man-db-create.service mandb.service mandb.timer +%service_add_pre man-db-create.service man-db.service man-db.timer %else %service_add_pre man-db-create.service %endif @@ -283,7 +278,7 @@ test -d var/catman/ && rm -rf var/catman/ || true %if %{with sdtimer} %service_add_post man-db-create.service %if 0%{?suse_version} >= 1500 -%service_add_post mandb.service mandb.timer +%service_add_post man-db.service man-db.timer %endif %endif # Remark: soelim(1) is part of package groff or mandoc and @@ -309,7 +304,7 @@ fi %if %{with sdtimer} %service_del_preun man-db-create.service %if 0%{?suse_version} >= 1500 -%service_del_preun mandb.service mandb.timer +%service_del_preun man-db.service man-db.timer %endif %endif @@ -318,7 +313,7 @@ fi %if %{with sdtimer} %service_del_postun man-db-create.service %if 0%{?suse_version} >= 1500 -%service_del_postun mandb.service mandb.timer +%service_del_postun man-db.service man-db.timer %endif %endif if [ ! -f %{_libexecdir}/man-db/wrapper ] ; then @@ -335,7 +330,7 @@ fi %files -f man-db.lang %license docs/COPYING %doc ChangeLog -%doc %{_docdir}/man/man-db-manual.* +%doc %{_docdir}/man/man-db-manual* %config %{_sysconfdir}/manpath.config %if 0%{?suse_version} < 1500 %attr(0744,root,root) %{_sysconfdir}/cron.daily/suse-do_mandb @@ -346,13 +341,14 @@ fi %ghost %{_sysconfdir}/alternatives/man.1%{ext_man} %ghost %{_sysconfdir}/alternatives/apropos.1%{ext_man} %ghost %{_sysconfdir}/alternatives/whatis.1%{ext_man} -%{_bindir}/man %{_bindir}/apropos -%{_bindir}/whatis -%{_bindir}/mandb %{_bindir}/catman %{_bindir}/lexgrog +%{_bindir}/man +%{_bindir}/mandb %{_bindir}/manpath +%{_bindir}/man-recode +%{_bindir}/whatis %dir %attr(0755,root,root) %{_libexecdir}/man-db %attr(0755,root,root) %{_libexecdir}/man-db/man %attr(0755,root,root) %{_libexecdir}/man-db/whatis @@ -373,8 +369,8 @@ fi %if %{with sdtimer} %{_unitdir}/man-db-create.service %if 0%{?suse_version} >= 1500 -%{_unitdir}/mandb.service -%{_unitdir}/mandb.timer +%{_unitdir}/man-db.service +%{_unitdir}/man-db.timer %endif %endif %dir %{_datadir}/groff/site-tmac @@ -385,6 +381,7 @@ fi %{_mandir}/man8/*.8%{?ext_man} %dir %{_mandir}/id %dir %{_mandir}/sr +%dir %{_mandir}/ro %dir %{_mandir}/tr %{_fillupdir}/sysconfig.cron-man %defattr(-,man,man) diff --git a/mancoding b/mancoding deleted file mode 100644 index ca5e9ef..0000000 --- a/mancoding +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2007 Werner Fink -# Copyright (c) 2007 SuSE Linux Products GmbH, Nuernberg, Germany. -# -# This library is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or (at -# your option) any later version. -# -# This library is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# For a copy see -# -# Author: Werner Fink - -docode=yes -if test "$1" = "-e" ; then - shift - encode=$1 - docode=no - shift -fi - -for man; do - pp="$(head -n 1 $man)" - case "$pp" in - \'\\\"*\ -\*-\ coding:\ *\ -\*-) - continue - esac - if test "$docode" = "yes" ; then - encode=$(sed -r "s/^(\.[[:alpha:]]{1,2}|\.\\\\\".*|'\\\\\".*)//;s/\\f[[:alpha:]]//;s/\\\\\".*//" $man | file -b -) - encode=${encode%% *} - fi - case "$encode" in - ISO-8859) - echo "${0##*/}: The encoding $encode does not include the Latin Alphabet Number" 1>&2 - echo "${0##*/}: use option -e to specify" 1>&2 - echo " ${0##*/} -e ISO-8859- $man" 1>&2 - exit 1 - esac - case "$pp" in - \'\\\"*) - sed -ri "1{s/('\\\\\".*)/\\1 -\*- coding: UTF-8 -\*-/}" $man - ;; - *) - sed -ri "1 i\ - '\\\\\" -\*- coding: UTF-8 -\*-\ - " $man - esac -done diff --git a/mandb.service b/mandb.service deleted file mode 100644 index a723b0f..0000000 --- a/mandb.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Do daily mandb update -Documentation=man:mandb(8) man:catman(8) -ConditionACPower=true - -[Service] -User=man -Group=man -Type=oneshot -Nice=5 -IOSchedulingClass=idle -ExecStart=@@LIBEXECDIR@@/man-db/do_mandb diff --git a/mandb.timer b/mandb.timer deleted file mode 100644 index 3b1c314..0000000 --- a/mandb.timer +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Do daily mandb update -Documentation=man:mandb(8) man:catman(8) - -[Timer] -OnCalendar=daily -AccuracySec=12h -Persistent=true - -[Install] -WantedBy=timers.target