Update to man-db-2.10.0

OBS-URL: https://build.opensuse.org/package/show/Base:System/man?expand=0&rev=136
This commit is contained in:
Dr. Werner Fink 2022-08-18 08:59:01 +00:00 committed by Git OBS Bridge
parent b54e542cbd
commit 517eda8d76
15 changed files with 290 additions and 269 deletions

3
man-db-2.10.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0a8629022f7117dc7fc6473c6fdb14913b24b106059bb056abee87dbd6070c79
size 1888196

16
man-db-2.10.0.tar.xz.asc Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAmH9QJ4ACgkQOTWH2X2G
UAuKBQ/8CfdjtSaWWhtEde7f56MeuIU8W8wkl2E0g2DM+I7UUMhs3DUmD5crC9ah
sLPcSzRr60wv9nLwG7SJSxsMAaUjAa2R78UCweRM4ikxoaBAWkKSSzxAjxeP8o0H
5m/vWepcUHij5MuXvXVBrYa4NGRhdfJo6BXrFDZl4qCFF06UiVZqTg35JvX2zWil
ZayQwlkN5h7ZPuNNmzTiQ8obB+f3n/GOXQ4SE4GKoImhgEvj++Moyo6PiR5CB1G4
RaR62VoRuL4rmQS2dHMVRk7oD8VU3rg7cNpUh1QOOnyKOM0T7cjgIurXU2Z/pZ0x
op7VCOmllOprfBJVREs7cQmfQL7CDUGTzfmFMc+MEFW6LM6tl6Wr/6+tKYpLAiH/
s2ylyOUVCxZay5eXEIcWnSpDxPWPRIQURdqbanobJ5Eo0gP1O23cycOeypqILTPF
t3tCAwiWbj/Je4te6paFPJ3rFYRv3xFBVr3ltaahDAj+LTbA5pYkTpPFwSqYkO3D
EJYYvjOzX6+rdwJuLCe2Ytgy9fdT5p1o7Cm4KusUWfnHKCMNJ+1/So02LayfHMKN
wPQmjXhPVMsXKvt88a9wfK8KVLRVw+hhGURKQMrf3f/hbYwBU8zUxNWxq8NagpER
S9FudI2n5glV3KHawJyK0mlfdK34qMra26cC8ekL3OyJBuXJHVA=
=rJ2k
-----END PGP SIGNATURE-----

View File

@ -4,7 +4,7 @@
--- lib/encodings.c --- lib/encodings.c
+++ lib/encodings.c 2016-12-15 14:07:01.072034899 +0000 +++ lib/encodings.c 2016-12-15 14:07:01.072034899 +0000
@@ -224,6 +224,7 @@ static struct charset_entry charset_tabl @@ -228,6 +228,7 @@ static struct charset_entry charset_tabl
{ "EUC-CN", "nippon" }, { "EUC-CN", "nippon" },
{ "EUC-JP", "nippon" }, { "EUC-JP", "nippon" },
{ "EUC-TW", "nippon" }, { "EUC-TW", "nippon" },
@ -12,7 +12,7 @@
{ "GBK", "nippon" }, { "GBK", "nippon" },
# else /* !MULTIBYTE_GROFF */ # else /* !MULTIBYTE_GROFF */
/* If we have a smarter version of groff, this is better dealt with /* If we have a smarter version of groff, this is better dealt with
@@ -311,6 +312,7 @@ static struct less_charset_entry less_ch @@ -315,6 +316,7 @@ static struct less_charset_entry less_ch
#ifdef MULTIBYTE_GROFF #ifdef MULTIBYTE_GROFF
{ "CP1251", "windows", NULL }, { "CP1251", "windows", NULL },
@ -20,7 +20,7 @@
{ "EUC-JP", "iso8859", "japanese-ujis" }, { "EUC-JP", "iso8859", "japanese-ujis" },
{ "KOI8-R", "koi8-r", NULL }, { "KOI8-R", "koi8-r", NULL },
/* close enough? */ /* close enough? */
@@ -502,6 +504,13 @@ char *get_page_encoding (const char *lan @@ -453,6 +455,13 @@ char *get_page_encoding (const char *lan
* roff encoding = ISO-8859-15 * roff encoding = ISO-8859-15
* output encoding = ISO-8859-15 * output encoding = ISO-8859-15
* ISO-8859-15 -> groff -Tascii8 -> ISO-8859-15 -> iconv -> UTF-8 * ISO-8859-15 -> groff -Tascii8 -> ISO-8859-15 -> iconv -> UTF-8
@ -34,7 +34,7 @@
*/ */
const char *get_source_encoding (const char *lang) const char *get_source_encoding (const char *lang)
{ {
@@ -667,7 +676,7 @@ static int compatible_encodings (const c @@ -620,7 +629,7 @@ static int compatible_encodings (const c
*/ */
if ((STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") || if ((STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") ||
STREQ (input, "EUC-JP") || STREQ (input, "EUC-JP") ||
@ -43,7 +43,7 @@
STREQ (input, "EUC-KR") || STREQ (input, "EUC-KR") ||
STREQ (input, "EUC-TW")) && STREQ (input, "EUC-TW")) &&
STREQ (output, "UTF-8")) STREQ (output, "UTF-8"))
@@ -771,7 +780,7 @@ const char *get_roff_encoding (const cha @@ -724,7 +733,7 @@ const char *get_roff_encoding (const cha
STRNEQ (ctype, "zh_HK", 5) || STRNEQ (ctype, "zh_HK", 5) ||
STRNEQ (ctype, "zh_SG", 5) || STRNEQ (ctype, "zh_SG", 5) ||
STRNEQ (ctype, "zh_TW", 5)) STRNEQ (ctype, "zh_TW", 5))

View File

@ -1,10 +1,28 @@
--- ---
src/man.c | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- man/man1/man.man1 | 8 ++
1 file changed, 178 insertions(+), 2 deletions(-) src/man.c | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 186 insertions(+), 2 deletions(-)
--- man/man1/man.man1
+++ man/man1/man.man1 2022-08-17 13:11:29.974677243 +0000
@@ -1226,6 +1226,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' .B MAN_DISABLE_SECCOMP
On Linux,
.B %man%
--- src/man.c --- src/man.c
+++ src/man.c 2018-11-23 13:56:09.131098574 +0000 +++ src/man.c 2022-08-17 13:10:07.436205495 +0000
@@ -3573,12 +3573,141 @@ static int locate_page (const char *manp @@ -3572,12 +3572,141 @@ static int locate_page (const char *manp
return found; return found;
} }
@ -146,7 +164,7 @@
global_manpath = is_global_mandir (candp->path); global_manpath = is_global_mandir (candp->path);
if (!global_manpath) if (!global_manpath)
drop_effective_privs (); drop_effective_privs ();
@@ -3600,9 +3729,56 @@ static int display_pages (struct candida @@ -3599,9 +3728,56 @@ static int display_pages (struct candida
regain_effective_privs (); regain_effective_privs ();
if (found && !findall) if (found && !findall)
@ -205,20 +223,3 @@
return found; 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

View File

@ -1,6 +1,6 @@
--- man/man1/man.man1 --- man/man1/man.man1
+++ man/man1/man.man1 2018-11-23 14:23:22.531297359 +0000 +++ man/man1/man.man1 2018-11-23 14:23:22.531297359 +0000
@@ -186,6 +186,9 @@ numbers of the manual followed by the ty @@ -93,6 +93,9 @@ numbers of the manual followed by the ty
.TS .TS
tab (@); tab (@);
l lx. l lx.

View File

@ -1,43 +0,0 @@
---
src/mandb.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
--- 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 amount;
char *dbname;
int should_create;
+ int fd;
dbname = mkdbname (catpath);
database = xasprintf ("%s/%d", catpath, getpid ());
+ /* Just for the case that catpath isn't a system catpath */
+ drop_effective_privs ();
+ fd = open (database, O_WRONLY | O_CREAT | O_EXCL, 0644);
+ regain_effective_privs ();
+ if (fd < 0)
+ error (FATAL, errno, _("can't create a temporary filename"));
+ close(fd);
+
if (!quiet)
printf (_("Processing manual pages under %s...\n"), manpath);
if (!STREQ (catpath, manpath)) {
char *cachedir_tag;
- int fd;
int cachedir_tag_exists = 0;
+ drop_effective_privs ();
cachedir_tag = xasprintf ("%s/CACHEDIR.TAG", catpath);
fd = open (cachedir_tag, O_RDONLY);
if (fd < 0) {
@@ -476,6 +485,7 @@ static int mandb (struct dbpaths *dbpath
chown_if_possible (cachedir_tag);
check_chmod (cachedir_tag, DBMODE);
}
+ regain_effective_privs ();
free (cachedir_tag);
}

View File

@ -1,24 +1,24 @@
--- ---
config.h.in | 3 ++ config.h.in | 3 ++
configure.ac | 52 ++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 52 ++++++++++++++++++++++++++++++++++++++++
lib/decompress.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/decompress.c | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 120 insertions(+) 3 files changed, 124 insertions(+), 1 deletion(-)
--- config.h.in --- config.h.in
+++ config.h.in 2018-11-23 13:11:12.684900437 +0000 +++ config.h.in 2022-08-18 06:45:49.997898305 +0000
@@ -896,6 +896,9 @@ @@ -1003,6 +1003,9 @@
/* Define to 1 if you have the `z' library (-lz). */ /* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ #undef HAVE_LIBZ
+/* Define to 1 if you have libzio for opening compressed manuals */ +/* Define to 1 if you have libzio for opening compressed manuals */
+#undef HAVE_ZIO +#undef HAVE_ZIO
+ +
/* Define to 1 if you have the <limits.h> header file. */ /* Define to 1 if the bcrypt library is guaranteed to be present. */
#undef HAVE_LIMITS_H #undef HAVE_LIB_BCRYPT
--- configure.ac --- configure.ac
+++ configure.ac 2018-11-23 13:09:58.982262008 +0000 +++ configure.ac 2022-08-18 06:45:49.997898305 +0000
@@ -34,6 +34,18 @@ MAN_ARG_DEVICE @@ -35,6 +35,18 @@ MAN_ARG_DEVICE
MAN_ARG_DB MAN_ARG_DB
MAN_ARG_CONFIG_FILE MAN_ARG_CONFIG_FILE
MAN_ARG_SECTIONS MAN_ARG_SECTIONS
@ -37,9 +37,9 @@
MAN_ARG_AUTOMATIC_CREATE MAN_ARG_AUTOMATIC_CREATE
MAN_ARG_AUTOMATIC_UPDATE MAN_ARG_AUTOMATIC_UPDATE
MAN_ARG_CATS MAN_ARG_CATS
@@ -346,6 +358,46 @@ AC_SUBST([unxz]) @@ -388,6 +400,46 @@ AC_DEFINE_UNQUOTED([PROG_UNXZ], ["$unxz"
AC_SUBST([unlzip]) AC_DEFINE_UNQUOTED([PROG_UNLZIP], ["$unlzip"], [Program to use as unlzip.])
AC_SUBST([unzstd]) AC_DEFINE_UNQUOTED([PROG_UNZSTD], ["$unzstd"], [Program to use as unzstd.])
MAN_COMPRESS_LIB([z], [gzopen]) MAN_COMPRESS_LIB([z], [gzopen])
+dnl Check for zlib and libbz2 libraries to use this together +dnl Check for zlib and libbz2 libraries to use this together
+dnl with SUSE's libzio to open compressed info files. +dnl with SUSE's libzio to open compressed info files.
@ -85,9 +85,16 @@
# Check for various header files and associated libraries. # Check for various header files and associated libraries.
--- src/decompress.c --- src/decompress.c
+++ src/decompress.c 2018-11-23 13:12:59.714923151 +0000 +++ src/decompress.c 2022-08-18 06:54:42.008671417 +0000
@@ -38,6 +38,10 @@ @@ -38,12 +38,17 @@
# include "zlib.h"
#endif /* HAVE_LIBZ */
+#include "appendstr.h"
#include "attribute.h"
#include "minmax.h"
#include "xalloc.h"
#include "xstrndup.h"
#include "xvasprintf.h" #include "xvasprintf.h"
+#ifdef HAVE_ZIO +#ifdef HAVE_ZIO
@ -97,7 +104,7 @@
#include "manconfig.h" #include "manconfig.h"
#include "comp_src.h" #include "comp_src.h"
#include "pipeline.h" #include "pipeline.h"
@@ -69,6 +73,32 @@ static void decompress_zlib (void *data @@ -183,6 +188,33 @@ static decompress *decompress_try_zlib (
#endif /* HAVE_LIBZ */ #endif /* HAVE_LIBZ */
@ -107,11 +114,11 @@
+{ +{
+ const char *what = (const char*)data; + const char *what = (const char*)data;
+ FILE *file; + FILE *file;
+ +
+ file = fdzopen(dup (fileno (stdin)), "r", what); + file = fdzopen(dup (fileno (stdin)), "r", what);
+ if (!file) + if (!file)
+ return; + return;
+ +
+ for (;;) { + for (;;) {
+ char buffer[4096]; + char buffer[4096];
+ int r = fread(buffer, sizeof(char), sizeof(buffer), file); + int r = fread(buffer, sizeof(char), sizeof(buffer), file);
@ -120,17 +127,18 @@
+ if (fwrite (buffer, 1, (size_t) r, stdout) < (size_t) r) + if (fwrite (buffer, 1, (size_t) r, stdout) < (size_t) r)
+ break; + break;
+ } + }
+ +
+ fclose(file); + fclose(file);
+ return; + return;
+} +}
+ +
+#endif /* HAVE_ZIO */ +#endif /* HAVE_ZIO */
+
+ +
extern man_sandbox *sandbox; extern man_sandbox *sandbox;
pipeline *decompress_open (const char *filename) decompress *decompress_open (const char *filename, int flags)
@@ -85,6 +115,37 @@ pipeline *decompress_open (const char *f @@ -199,6 +231,38 @@ decompress *decompress_open (const char
if (stat (filename, &st) < 0 || S_ISDIR (st.st_mode)) if (stat (filename, &st) < 0 || S_ISDIR (st.st_mode))
return NULL; return NULL;
@ -138,7 +146,7 @@
+ ext = strrchr (filename, '.'); + ext = strrchr (filename, '.');
+ if (ext) { + if (ext) {
+ const char *opt; + const char *opt;
+ char *name; + char *name = NULL;
+ +
+ if (STREQ (ext, ".gz")) + if (STREQ (ext, ".gz"))
+ opt = "g"; + opt = "g";
@ -156,11 +164,12 @@
+ goto nozio; + goto nozio;
+ +
+ /* informational only; no shell quoting concerns */ + /* informational only; no shell quoting concerns */
+ name = appendstr (NULL, "libzio < ", filename, NULL); + name = appendstr (NULL, "libzio < ", filename, (void *) 0);
+ cmd = pipecmd_new_function (name, &decompress_zio, NULL, + cmd = pipecmd_new_function (name, &decompress_zio, NULL,
+ opt); + (void *)opt);
+ pipecmd_pre_exec (cmd, sandbox_load, sandbox_free, sandbox);
+ p = pipeline_new_commands (cmd, (void *) 0);
+ free (name); + free (name);
+ p = pipeline_new_commands (cmd, NULL);
+ goto got_pipeline; + goto got_pipeline;
+ } + }
+#endif /* HAVE_ZIO */ +#endif /* HAVE_ZIO */
@ -168,7 +177,7 @@
#ifdef HAVE_LIBZ #ifdef HAVE_LIBZ
filename_len = strlen (filename); filename_len = strlen (filename);
if (filename_len > 3 && STREQ (filename + filename_len - 3, ".gz")) { if (filename_len > 3 && STREQ (filename + filename_len - 3, ".gz")) {
@@ -96,7 +157,11 @@ pipeline *decompress_open (const char *f @@ -216,7 +280,11 @@ decompress *decompress_open (const char
} }
#endif /* HAVE_LIBZ */ #endif /* HAVE_LIBZ */
@ -180,3 +189,12 @@
if (ext) { if (ext) {
++ext; ++ext;
@@ -309,7 +377,7 @@ void decompress_inprocess_replace (decom
void decompress_start (decompress *d)
{
- if (d->tag == DECOMPRESS_PIPELINE)
+ if (d && d->tag == DECOMPRESS_PIPELINE)
pipeline_start (d->u.p);
}

View File

@ -1,6 +1,9 @@
diff -u orig/man.c patch/man.c ---
--- src/man.c 2021-06-07 22:06:42.937525661 +0200 src/man.c | 23 ++++++++++++++++++++---
+++ src/man.c 2021-06-08 11:46:40.369916468 +0200 1 file changed, 20 insertions(+), 3 deletions(-)
--- src/man.c
+++ src/man.c 2022-08-17 13:59:26.937398386 +0000
@@ -57,6 +57,7 @@ @@ -57,6 +57,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -8,34 +11,33 @@ diff -u orig/man.c patch/man.c
+#include <libalternatives.h> +#include <libalternatives.h>
#include "argp.h" #include "argp.h"
#include "dirname.h" #include "attribute.h"
@@ -4066,11 +4067,25 @@ @@ -4080,9 +4081,25 @@ static void locate_page_in_manpath (cons
int *found)
{ {
char *mp; char *mp;
+ int count = 0;
- GL_LIST_FOREACH_START (manpathlist, mp) - GL_LIST_FOREACH (manpathlist, mp)
- *found += locate_page (mp, page_section, page_name, - *found += locate_page (mp, page_section, page_name,
- candidates); - candidates);
- GL_LIST_FOREACH_END (manpathlist); + GL_LIST_FOREACH (manpathlist, mp) {
+ GL_LIST_FOREACH_START (manpathlist, mp) { + int count = locate_page (mp, page_section, page_name, candidates);
+ count = locate_page (mp, page_section, page_name, candidates); + if (count == 0) {
+ if (count == 0) { + /* Checking if there has been defined another manpage defined in the
+ /* Checking if there has been defined another manpage defined in the */ + * priorities of libalternatives.
+ /* priorities of libalternatives. */ + */
+ char **alternitives = libalts_get_default_manpages(page_name); + char **alternitives = libalts_get_default_manpages(page_name);
+ for (char **alter = alternitives; *alter; alter++){ + for (char **alter = alternitives; *alter; alter++) {
+ char *p_name, *p_section; + char *p_name, *p_section;
+ split_page_name (*alter, &p_name, &p_section); + split_page_name (*alter, &p_name, &p_section);
+ if (p_name && strlen(p_name)>0 && p_section && strlen(p_section)>0) + if (p_name && strlen(p_name) > 0 &&
+ count = locate_page (mp, p_section, p_name, candidates); + p_section && strlen(p_section) > 0)
+ free(*alter); + count = locate_page (mp, p_section, p_name, candidates);
+ } + free(*alter);
+ free(alternitives); + }
+ } + free(alternitives);
+ *found += count; + }
+ } GL_LIST_FOREACH_END (manpathlist); + *found += count;
+ }
} }
/* /*

View File

@ -1,7 +1,7 @@
diff -Nur man-db-2.9.4/src/Makefile.am new/src/Makefile.am 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 --- 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 +++ new/src/Makefile.am 2021-05-31 23:36:22.062144466 +0200
@@ -192,16 +192,7 @@ @@ -211,16 +211,7 @@
all-am: apropos$(EXEEXT) all-am: apropos$(EXEEXT)
install-exec-hook: install-exec-hook:

View File

@ -1,11 +1,25 @@
---
configure.ac | 18 ++++++++-
include/comp_src.h | 2 -
lib/security.c | 30 ++++++++++++++++
mk_catdirs | 30 ++++++++++++++++
src/check_mandirs.c | 33 +++++++++++------
src/lexgrog.l | 64 +++++++++++++++++++++++++---------
src/man.c | 97 +++++++++++++++++++++++++++++++---------------------
src/man_db.conf.in | 17 +++++++--
src/mandb.c | 18 ++++++++-
src/manp.c | 2 -
src/straycats.c | 1
src/ult_src.c | 9 +++-
12 files changed, 242 insertions(+), 79 deletions(-)
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index f4fe224..89fb860 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -252,6 +252,14 @@ then @@ -289,6 +289,14 @@ fi
fi
MAN_CHECK_PROGS([eqn], [EQN], [use EQN to preprocess equations], [eqn geqn]) MAN_CHECK_PROGS([eqn], [EQN], [use EQN to preprocess equations], [eqn geqn])
AC_DEFINE_UNQUOTED([PROG_EQN], ["$eqn"], [Program to use as eqn.])
+MAN_CHECK_PROGS([geqn], [GEQN], [use GEQN to preprocess equations], [geqn]) +MAN_CHECK_PROGS([geqn], [GEQN], [use GEQN to preprocess equations], [geqn])
+dnl +dnl
+dnl if geqn is found and geqn is identical with eqn we use a GNU eqn +dnl if geqn is found and geqn is identical with eqn we use a GNU eqn
@ -17,7 +31,7 @@ index f4fe224..89fb860 100644
MAN_CHECK_PROGS([neqn], [NEQN], [use NEQN to preprocess equations for character devices], [neqn gneqn]) 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 # 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 # ascii device. As this is only relevant for equations (?), not using latin1
@@ -295,9 +303,15 @@ then @@ -339,9 +347,15 @@ then
compress_ext="gz" compress_ext="gz"
fi fi
MAN_CHECK_PROGS([compress], [COMPRESS], [use COMPRESS as UNIX compression utility], [compress]) MAN_CHECK_PROGS([compress], [COMPRESS], [use COMPRESS as UNIX compression utility], [compress])
@ -35,25 +49,23 @@ index f4fe224..89fb860 100644
if test -z "$gzip" if test -z "$gzip"
then then
compressor="$compress -c" compressor="$compress -c"
diff --git a/include/comp_src.h.in b/include/comp_src.h.in diff --git a/include/comp_src.h b/include/comp_src.h
index bc5d601..39f5f0d 100644 --- a/include/comp_src.h
--- a/include/comp_src.h.in +++ b/include/comp_src.h
+++ b/include/comp_src.h.in
@@ -51,7 +51,7 @@ struct compression comp_list[] = { @@ -51,7 +51,7 @@ struct compression comp_list[] = {
#endif /* HAVE_GZIP */ #endif /* HAVE_GZIP */
/* If we have compress, incorporate the following */ /* If we have compress, incorporate the following */
-#ifdef HAVE_COMPRESS -#ifdef HAVE_COMPRESS
+#if defined(HAVE_COMPRESS) || defined(HAVE_GZIP) +#if defined(HAVE_COMPRESS) || defined(HAVE_GZIP)
{UNCOMPRESS, "Z", NULL}, {PROG_UNCOMPRESS, "Z", NULL},
/* Else if we have gzip, incorporate the following */ /* Else if we have gzip, incorporate the following */
#elif defined (HAVE_GZIP) #elif defined (HAVE_GZIP)
diff --git a/lib/security.c b/lib/security.c diff --git a/lib/security.c b/lib/security.c
index 55f2d85..8524d1c 100644
--- a/lib/security.c --- a/lib/security.c
+++ b/lib/security.c +++ b/lib/security.c
@@ -79,6 +79,11 @@ static void gripe_set_euid (void) @@ -82,6 +82,11 @@ static void gripe_set_euid (void)
error (FATAL, errno, _("can't set effective uid")); fatal (errno, _("can't set effective uid"));
} }
+static inline void gripe_set_egid (void) +static inline void gripe_set_egid (void)
@ -64,7 +76,7 @@ index 55f2d85..8524d1c 100644
#endif /* MAN_OWNER */ #endif /* MAN_OWNER */
void init_security (void) void init_security (void)
@@ -165,6 +170,31 @@ void regain_effective_privs (void) @@ -168,6 +173,31 @@ void regain_effective_privs (void)
uid = euid; uid = euid;
gid = egid; gid = egid;
} }
@ -97,9 +109,7 @@ index 55f2d85..8524d1c 100644
} }
diff --git a/mk_catdirs b/mk_catdirs diff --git a/mk_catdirs b/mk_catdirs
new file mode 100644 --- a/mk_catdirs
index 0000000..47eaa25
--- /dev/null
+++ b/mk_catdirs +++ b/mk_catdirs
@@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
+#!/bin/sh +#!/bin/sh
@ -133,10 +143,9 @@ index 0000000..47eaa25
+ +
+test "$(id -u)" -ne 0 || chown man:man -R ${CACHE} +test "$(id -u)" -ne 0 || chown man:man -R ${CACHE}
diff --git a/src/check_mandirs.c b/src/check_mandirs.c diff --git a/src/check_mandirs.c b/src/check_mandirs.c
index d28a6be..90c5d58 100644
--- a/src/check_mandirs.c --- a/src/check_mandirs.c
+++ b/src/check_mandirs.c +++ b/src/check_mandirs.c
@@ -397,7 +397,7 @@ void chown_if_possible (const char *path _GL_UNUSED) @@ -417,7 +417,7 @@ void chown_if_possible (const char *path
#endif /* MAN_OWNER */ #endif /* MAN_OWNER */
/* create the catman hierarchy if it doesn't exist */ /* create the catman hierarchy if it doesn't exist */
@ -145,15 +154,15 @@ index d28a6be..90c5d58 100644
{ {
char *manname, *catname; char *manname, *catname;
@@ -425,9 +425,14 @@ static void mkcatdirs (const char *mandir, const char *catdir) @@ -445,9 +445,14 @@ static void mkcatdirs (const char *mandi
int j; int j;
regain_effective_privs (); regain_effective_privs ();
debug ("creating catdir hierarchy %s ", catdir); debug ("creating catdir hierarchy %s ", catdir);
- for (j = 1; j <= 9; j++) { - for (j = 1; j <= 9; j++) {
- catname[strlen (catname) - 1] = '0' + j; - catname[strlen (catname) - 1] = '0' + j;
- manname[strlen (manname) - 1] = '0' + j; - manname[strlen (manname) - 1] = '0' + j;
+ for (j = 1; j <= 10; j++) { + for (j = 0; j <= 10; j++) {
+ unsigned int c; + char c;
+ if (j < 10) + if (j < 10)
+ c = '0' + j; + c = '0' + j;
+ else + else
@ -163,7 +172,7 @@ index d28a6be..90c5d58 100644
if ((is_directory (manname) == 1) if ((is_directory (manname) == 1)
&& (is_directory (catname) != 1)) { && (is_directory (catname) != 1)) {
if (mkdir (catname, 0755) < 0) { if (mkdir (catname, 0755) < 0) {
@@ -435,7 +440,7 @@ static void mkcatdirs (const char *mandir, const char *catdir) @@ -455,7 +460,7 @@ static void mkcatdirs (const char *mandi
error (0, 0, _("warning: cannot create catdir %s"), catname); error (0, 0, _("warning: cannot create catdir %s"), catname);
debug ("warning: cannot create catdir %s\n", catname); debug ("warning: cannot create catdir %s\n", catname);
} else } else
@ -172,7 +181,7 @@ index d28a6be..90c5d58 100644
chown_if_possible (catname); chown_if_possible (catname);
} }
} }
@@ -583,15 +588,10 @@ static int testmandirs (const char *database, @@ -597,15 +602,10 @@ static int testmandirs (MYDBM_FILE dbf,
} }
if (!quiet) { if (!quiet) {
@ -188,17 +197,17 @@ index d28a6be..90c5d58 100644
+ fprintf (stderr, "\n"); + fprintf (stderr, "\n");
} }
add_dir_entries (dbf, path, mandir->d_name); add_dir_entries (dbf, path, mandir->d_name);
MYDBM_CLOSE (dbf); amount++;
@@ -698,7 +698,7 @@ int update_db (const char *database, const char *manpath, const char *catpath) @@ -674,7 +674,7 @@ int update_db (MYDBM_FILE dbf, const cha
dbf = NULL; int new;
}
if (!dbf) { if (!ensure_db_open (dbf) || !sanity_check_db (dbf)) {
- debug ("failed to open %s O_RDONLY\n", database); - debug ("failed to open %s O_RDONLY\n", dbf->name);
+ debug ("failed to open database %s O_RDONLY\n", database); + debug ("failed to open database %s O_RDONLY\n", dbf->name);
return EOF; return -1;
} }
mtime = MYDBM_GET_TIME (dbf); mtime = MYDBM_GET_TIME (dbf);
@@ -904,6 +904,7 @@ static int purge_whatis (MYDBM_FILE dbf, const char *path, int cat, @@ -886,6 +886,7 @@ static int purge_whatis (MYDBM_FILE dbf,
"would delete\n", name, info->ext); "would delete\n", name, info->ext);
return 1; return 1;
} }
@ -206,9 +215,9 @@ index d28a6be..90c5d58 100644
} }
/* Check that multi keys are correctly constructed. */ /* Check that multi keys are correctly constructed. */
@@ -1005,6 +1006,14 @@ int purge_missing (const char *database, @@ -983,6 +984,14 @@ int purge_missing (MYDBM_FILE dbf, const
continue;
} }
#pragma GCC diagnostic pop
+ /* Ignore db identifier keys. */ + /* Ignore db identifier keys. */
+ if (*MYDBM_DPTR (key) == '.' && *(key.dptr+1) == 0) { + if (*MYDBM_DPTR (key) == '.' && *(key.dptr+1) == 0) {
@ -222,19 +231,18 @@ index d28a6be..90c5d58 100644
if (!MYDBM_DPTR (content)) { if (!MYDBM_DPTR (content)) {
nextkey = MYDBM_NEXTKEY (dbf, key); nextkey = MYDBM_NEXTKEY (dbf, key);
diff --git a/src/lexgrog.l b/src/lexgrog.l diff --git a/src/lexgrog.l b/src/lexgrog.l
index cc31a70..1e3a0d5 100644
--- a/src/lexgrog.l --- a/src/lexgrog.l
+++ b/src/lexgrog.l +++ b/src/lexgrog.l
@@ -64,7 +64,7 @@ @@ -69,7 +69,7 @@
#include "manconv.h"
#include "manconv_client.h" #include "manconv_client.h"
-#define YY_READ_BUF_SIZE 1024 -#define YY_READ_BUF_SIZE 1024
+#define YY_READ_BUF_SIZE YY_BUF_SIZE +#define YY_READ_BUF_SIZE YY_BUF_SIZE
#define MAX_NAME 8192 #define MAX_NAME 8192
#define ARRAY_SIZE(array) (sizeof (array) / sizeof ((array)[0])) /* defines the ordered list of filters detected by lexgrog */
@@ -212,15 +212,15 @@ static const struct macro perldocs[] = { @@ -228,15 +228,15 @@ static const struct macro perldocs[] = {
{ "R\"", "\"" } { "R\"", "\"" }
}; };
@ -249,7 +257,7 @@ index cc31a70..1e3a0d5 100644
-static void newline_found (void); -static void newline_found (void);
+static __inline__ void add_str_to_whatis (const char *string, size_t length); +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_char_to_whatis (unsigned char c);
+static __inline__ void add_separator_to_whatis (const char *, size_t); +static __inline__ void add_separator_to_whatis (void);
+static __inline__ void add_wordn_to_whatis (const char *string, size_t length); +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_word_to_whatis (const char *string);
+static __inline__ void add_glyph_to_whatis (const char *string, size_t length); +static __inline__ void add_glyph_to_whatis (const char *string, size_t length);
@ -259,24 +267,24 @@ index cc31a70..1e3a0d5 100644
static char newname[MAX_NAME]; static char newname[MAX_NAME];
static char *p_name; static char *p_name;
@@ -229,6 +229,7 @@ static char filters[MAX_FILTERS]; @@ -245,6 +245,7 @@ static char filters[MAX_FILTERS];
static int fill_mode; static int fill_mode;
static int waiting_for_quote; static int waiting_for_quote;
+static int have_separator; +static int have_separator;
static pipeline *decomp; static decompress *decomp;
@@ -246,7 +247,7 @@ static pipeline *decomp; @@ -262,7 +263,7 @@ static decompress *decomp;
%} %}
%option ecs meta-ecs %option ecs meta-ecs
-%option 8bit batch caseful never-interactive -%option 8bit batch caseful never-interactive
+%option 8bit batch caseful never-interactive align +%option 8bit batch caseful never-interactive align
%option nostdinit %option nostdinit
%option warn %option warn
%option noyywrap nounput %option noyywrap nounput
@@ -285,8 +286,9 @@ font_change \\f([[:upper:]1-4]|\({upper}{2}) @@ -301,8 +302,9 @@ font_change \\f([[:upper:]1-4]|\({upper}
size_change \\s[+-]?{digit} size_change \\s[+-]?{digit}
style_change ({font_change}{size_change}?|{size_change}{font_change}?) style_change ({font_change}{size_change}?|{size_change}{font_change}?)
typeface \.(B[IR]?|I[BR]?|R[BI]|S[BM]) typeface \.(B[IR]?|I[BR]?|R[BI]|S[BM])
@ -287,10 +295,10 @@ index cc31a70..1e3a0d5 100644
/* Please add to this list if you know how. */ /* Please add to this list if you know how. */
/* Note that, since flex only supports UTF-8 by accident, character classes /* Note that, since flex only supports UTF-8 by accident, character classes
@@ -325,7 +327,26 @@ vi_name TÊN @@ -344,7 +346,26 @@ vi_name TÊN
zh_CN_name 名{blank}?(称|字){blank}?.* zh_CN_name 名{blank}?(称|字){blank}?.*
zh_TW_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 ({ar_name}|{bg_name}|{cs_name}|{da_name}|{de_name}|{en_name}|{eo_name}|{es_name}|{fa_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})?
+name_sec {dbl_quote}?{style_change}?{name}{style_change}?({blank}*{dbl_quote})?\r? +name_sec {dbl_quote}?{style_change}?{name}{style_change}?({blank}*{dbl_quote})?\r?
+start {sec_request}{blank_eol}+{name_sec} +start {sec_request}{blank_eol}+{name_sec}
@ -315,7 +323,7 @@ index cc31a70..1e3a0d5 100644
/* eptgrv : eqn, pic, tbl, grap, refer, vgrind */ /* eptgrv : eqn, pic, tbl, grap, refer, vgrind */
tbl_request \.TS tbl_request \.TS
@@ -339,8 +360,13 @@ vgrind_request \.vS @@ -358,8 +379,13 @@ vgrind_request \.vS
%% %%
/* begin NAME section processing */ /* begin NAME section processing */
@ -331,7 +339,7 @@ index cc31a70..1e3a0d5 100644
/* general text matching */ /* general text matching */
<MAN_FILE>{ <MAN_FILE>{
@@ -415,6 +441,7 @@ vgrind_request \.vS @@ -434,6 +460,7 @@ vgrind_request \.vS
{bol}\.sp{blank}* | /* vertical spacing */ {bol}\.sp{blank}* | /* vertical spacing */
{bol}\.ig{blank}* | /* block comment */ {bol}\.ig{blank}* | /* block comment */
{bol}\.de[1i]?{blank}* | /* macro definition */ {bol}\.de[1i]?{blank}* | /* macro definition */
@ -339,7 +347,7 @@ index cc31a70..1e3a0d5 100644
{bol}\.i[ef]{blank}* | /* conditional */ {bol}\.i[ef]{blank}* | /* conditional */
{empty}{bol}.+ | {empty}{bol}.+ |
<<EOF>> { /* terminate the string */ <<EOF>> { /* terminate the string */
@@ -462,8 +489,8 @@ vgrind_request \.vS @@ -481,8 +508,8 @@ vgrind_request \.vS
/* Toggle fill mode */ /* Toggle fill mode */
<MAN_NAME,MAN_DESC>{ <MAN_NAME,MAN_DESC>{
@ -350,7 +358,7 @@ index cc31a70..1e3a0d5 100644
} }
<CAT_NAME>-{eol}{blank_eol}* /* strip continuations */ <CAT_NAME>-{eol}{blank_eol}* /* strip continuations */
@@ -472,6 +499,9 @@ vgrind_request \.vS @@ -491,6 +518,9 @@ vgrind_request \.vS
<MAN_NAME>{ <MAN_NAME>{
{next}{blank}*\\\((mi|hy|em|en){blank}* | {next}{blank}*\\\((mi|hy|em|en){blank}* |
{next}{blank}*\\\[(mi|hy|em|en)\]{blank}* | {next}{blank}*\\\[(mi|hy|em|en)\]{blank}* |
@ -361,7 +369,6 @@ index cc31a70..1e3a0d5 100644
{next}{blank_eol}*[-\\]-{blank}+ | {next}{blank_eol}*[-\\]-{blank}+ |
{bol}\.Nd{blank}* { {bol}\.Nd{blank}* {
diff --git a/src/man.c b/src/man.c diff --git a/src/man.c b/src/man.c
index 6d1cba7..f72867c 100644
--- a/src/man.c --- a/src/man.c
+++ b/src/man.c +++ b/src/man.c
@@ -56,6 +56,7 @@ @@ -56,6 +56,7 @@
@ -371,8 +378,8 @@ index 6d1cba7..f72867c 100644
+#include <sys/time.h> +#include <sys/time.h>
#include "argp.h" #include "argp.h"
#include "dirname.h" #include "attribute.h"
@@ -106,6 +107,8 @@ @@ -116,6 +117,8 @@
#ifdef MAN_OWNER #ifdef MAN_OWNER
extern uid_t ruid; extern uid_t ruid;
extern uid_t euid; extern uid_t euid;
@ -381,7 +388,7 @@ index 6d1cba7..f72867c 100644
#endif /* MAN_OWNER */ #endif /* MAN_OWNER */
/* the default preprocessor sequence */ /* the default preprocessor sequence */
@@ -136,6 +139,11 @@ char *lang; @@ -146,6 +149,11 @@ char *lang;
static bool global_manpath; /* global or user manual page hierarchy? */ static bool global_manpath; /* global or user manual page hierarchy? */
static int skip; /* page exists but has been skipped */ static int skip; /* page exists but has been skipped */
@ -393,7 +400,7 @@ index 6d1cba7..f72867c 100644
#if defined _AIX || defined __sgi #if defined _AIX || defined __sgi
char **global_argv; char **global_argv;
@@ -232,10 +240,10 @@ static int found_a_stray; /* found a straycat */ @@ -241,10 +249,10 @@ static int found_a_stray; /* found a st
#ifdef MAN_CATS #ifdef MAN_CATS
static char *tmp_cat_file; /* for open_cat_stream(), close_cat_stream() */ static char *tmp_cat_file; /* for open_cat_stream(), close_cat_stream() */
static int created_tmp_cat; /* dto. */ static int created_tmp_cat; /* dto. */
@ -405,7 +412,7 @@ index 6d1cba7..f72867c 100644
# ifdef TROFF_IS_GROFF # ifdef TROFF_IS_GROFF
static bool ditroff; static bool ditroff;
@@ -608,36 +616,6 @@ static void gripe_no_name (const char *sect) @@ -614,36 +622,6 @@ static void gripe_no_name (const char *s
exit (FAIL); exit (FAIL);
} }
@ -442,7 +449,7 @@ index 6d1cba7..f72867c 100644
#if defined(TROFF_IS_GROFF) || defined(HEIRLOOM_NROFF) #if defined(TROFF_IS_GROFF) || defined(HEIRLOOM_NROFF)
static int get_roff_line_length (void) static int get_roff_line_length (void)
{ {
@@ -1526,6 +1504,18 @@ static void setenv_less (pipecmd *cmd, const char *title) @@ -1533,6 +1511,18 @@ static void setenv_less (pipecmd *cmd, c
free (less_opts); free (less_opts);
} }
@ -461,7 +468,7 @@ index 6d1cba7..f72867c 100644
static void add_output_iconv (pipeline *p, static void add_output_iconv (pipeline *p,
const char *source, const char *target) const char *source, const char *target)
{ {
@@ -1656,6 +1646,8 @@ static pipeline *make_display_command (const char *encoding, const char *title) @@ -1663,6 +1653,8 @@ static pipeline *make_display_command (c
if (pager_cmd) { if (pager_cmd) {
setenv_less (pager_cmd, title); setenv_less (pager_cmd, title);
@ -470,7 +477,7 @@ index 6d1cba7..f72867c 100644
pipeline_command (p, pager_cmd); pipeline_command (p, pager_cmd);
} }
pipeline_ignore_signals (p, 1); pipeline_ignore_signals (p, 1);
@@ -1666,7 +1658,7 @@ static pipeline *make_display_command (const char *encoding, const char *title) @@ -1673,7 +1665,7 @@ static pipeline *make_display_command (c
return p; return p;
} }
@ -479,7 +486,7 @@ index 6d1cba7..f72867c 100644
/* return a (malloced) temporary name in cat_file's directory */ /* return a (malloced) temporary name in cat_file's directory */
static char *tmp_cat_filename (const char *cat_file) static char *tmp_cat_filename (const char *cat_file)
{ {
@@ -1694,7 +1686,6 @@ static char *tmp_cat_filename (const char *cat_file) @@ -1701,7 +1693,6 @@ static char *tmp_cat_filename (const cha
return name; return name;
} }
@ -487,7 +494,7 @@ index 6d1cba7..f72867c 100644
/* If delete unlink tmp_cat, else commit tmp_cat to cat_file. /* If delete unlink tmp_cat, else commit tmp_cat to cat_file.
Return non-zero on error. Return non-zero on error.
*/ */
@@ -1767,6 +1758,7 @@ static int commit_tmp_cat (const char *cat_file, const char *tmp_cat, @@ -1774,6 +1765,7 @@ static int commit_tmp_cat (const char *c
return status; return status;
} }
@ -495,7 +502,7 @@ index 6d1cba7..f72867c 100644
/* TODO: This should all be refactored after work on the decompression /* TODO: This should all be refactored after work on the decompression
* library is complete. * library is complete.
@@ -1803,7 +1795,6 @@ static void cleanup_unlink (void *arg) @@ -1810,7 +1802,6 @@ static void cleanup_unlink (void *arg)
} }
#ifdef MAN_CATS #ifdef MAN_CATS
@ -503,23 +510,23 @@ index 6d1cba7..f72867c 100644
/* Return pipeline to write formatted manual page to for saving as cat file. */ /* 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) static pipeline *open_cat_stream (const char *cat_file, const char *encoding)
{ {
@@ -2025,6 +2016,7 @@ static void format_display (pipeline *decomp, @@ -2036,6 +2027,7 @@ static void format_display (decompress *
regain_effective_privs (); regain_effective_privs ();
} }
+#ifdef MAN_CATS +#ifdef MAN_CATS
/* "Display" a page in catman mode, which amounts to saving it. */ /* "Display" a page in catman mode, which amounts to saving it. */
/* TODO: merge with format_display_and_save? */ /* TODO: merge with format_display_and_save? */
static void display_catman (const char *cat_file, pipeline *decomp, static void display_catman (const char *cat_file, decompress *d,
@@ -2068,6 +2060,7 @@ static void display_catman (const char *cat_file, pipeline *decomp, @@ -2081,6 +2073,7 @@ static void display_catman (const char *
pop_cleanup (cleanup_unlink, tmpcat); pop_cleanup (cleanup_unlink, tmpcat);
free (tmpcat); free (tmpcat);
} }
+#endif /* MAN_CATS */ +#endif /* MAN_CATS */
static void disable_hyphenation (void *data _GL_UNUSED) static void disable_hyphenation (void *data MAYBE_UNUSED)
{ {
@@ -2268,7 +2261,7 @@ static int display (const char *dir, const char *man_file, @@ -2283,7 +2276,7 @@ static int display (const char *dir, con
format_cmd = NULL; format_cmd = NULL;
decomp_errno = errno; decomp_errno = errno;
} }
@ -528,7 +535,7 @@ index 6d1cba7..f72867c 100644
/* Get modification time, for commit_tmp_cat(). */ /* Get modification time, for commit_tmp_cat(). */
if (man_file && *man_file) { if (man_file && *man_file) {
struct stat stb; struct stat stb;
@@ -2278,7 +2271,7 @@ static int display (const char *dir, const char *man_file, @@ -2293,7 +2286,7 @@ static int display (const char *dir, con
} else } else
man_modtime = get_stat_mtime (&stb); man_modtime = get_stat_mtime (&stb);
} }
@ -537,7 +544,7 @@ index 6d1cba7..f72867c 100644
display_to_stdout = troff; display_to_stdout = troff;
#ifdef TROFF_IS_GROFF #ifdef TROFF_IS_GROFF
if (htmlout || gxditview) if (htmlout || gxditview)
@@ -2418,6 +2411,7 @@ static int display (const char *dir, const char *man_file, @@ -2434,6 +2427,7 @@ static int display (const char *dir, con
} }
if (printed) if (printed)
putchar ('\n'); putchar ('\n');
@ -545,7 +552,7 @@ index 6d1cba7..f72867c 100644
} else if (catman) { } else if (catman) {
if (format) { if (format) {
if (!save_cat) if (!save_cat)
@@ -2430,6 +2424,7 @@ static int display (const char *dir, const char *man_file, @@ -2446,6 +2440,7 @@ static int display (const char *dir, con
format_cmd, format_cmd,
formatted_encoding); formatted_encoding);
} }
@ -553,29 +560,16 @@ index 6d1cba7..f72867c 100644
} else if (format) { } else if (format) {
/* no cat or out of date */ /* no cat or out of date */
pipeline *disp_cmd; pipeline *disp_cmd;
@@ -2491,8 +2486,10 @@ static int display (const char *dir, const char *man_file, @@ -3347,7 +3342,7 @@ static int display_database_check (struc
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 #ifdef MAN_DB_UPDATES
if (!exists && !skip) { if (!exists && !skip) {
debug ("dbdelete_wrapper (%s, %p)\n", debug ("dbdelete_wrapper (%s, %p, %s)\n",
- candp->req_name, candp->source); - candp->req_name, candp->source, candp->path);
+ candp->req_name, candp->source->addr); + candp->req_name, candp->source->addr, candp->path);
dbdelete_wrapper (candp->req_name, candp->source); dbdelete_wrapper (candp->req_name, candp->source, candp->path);
} }
#endif /* MAN_DB_UPDATES */ #endif /* MAN_DB_UPDATES */
@@ -3753,17 +3750,20 @@ static int local_man_loop (const char *argv) @@ -3946,17 +3941,20 @@ static int local_man_loop (const char *a
/* Check that the file exists and isn't e.g. a directory */ /* Check that the file exists and isn't e.g. a directory */
if (stat (argv, &st)) { if (stat (argv, &st)) {
error (0, errno, "%s", argv); error (0, errno, "%s", argv);
@ -596,7 +590,7 @@ index 6d1cba7..f72867c 100644
return NOT_FOUND; return NOT_FOUND;
} }
@@ -3826,6 +3826,11 @@ executable_out: @@ -4019,6 +4017,11 @@ executable_out:
argv_abs = xstrdup (argv); argv_abs = xstrdup (argv);
} }
lang = lang_dir (argv_abs); lang = lang_dir (argv_abs);
@ -608,7 +602,7 @@ index 6d1cba7..f72867c 100644
free (argv_abs); free (argv_abs);
if (!display (NULL, argv, NULL, argv_base, NULL)) { if (!display (NULL, argv, NULL, argv_base, NULL)) {
if (local_mf) if (local_mf)
@@ -4075,7 +4080,16 @@ int main (int argc, char *argv[]) @@ -4274,7 +4277,16 @@ int main (int argc, char *argv[])
umask (022); umask (022);
init_locale (); init_locale ();
@ -626,7 +620,7 @@ index 6d1cba7..f72867c 100644
/* Use LANGUAGE only when LC_MESSAGES locale category is /* Use LANGUAGE only when LC_MESSAGES locale category is
* neither "C" nor "POSIX". */ * neither "C" nor "POSIX". */
if (internal_locale && strcmp (internal_locale, "C") && if (internal_locale && strcmp (internal_locale, "C") &&
@@ -4120,7 +4134,16 @@ int main (int argc, char *argv[]) @@ -4319,7 +4331,16 @@ int main (int argc, char *argv[])
if (external) if (external)
do_extern (argc, argv); do_extern (argc, argv);
@ -641,10 +635,9 @@ index 6d1cba7..f72867c 100644
get_term (); /* stores terminal settings */ get_term (); /* stores terminal settings */
+#endif +#endif
/* close this locale and reinitialise if a new locale was /* close this locale and reinitialise if a new locale was
issued as an argument or in $MANOPT */ issued as an argument or in $MANOPT */
diff --git a/src/man_db.conf.in b/src/man_db.conf.in diff --git a/src/man_db.conf.in b/src/man_db.conf.in
index 2942000..b2751f5 100644
--- a/src/man_db.conf.in --- a/src/man_db.conf.in
+++ b/src/man_db.conf.in +++ b/src/man_db.conf.in
@@ -20,6 +20,14 @@ @@ -20,6 +20,14 @@
@ -662,7 +655,7 @@ index 2942000..b2751f5 100644
#--------------------------------------------------------- #---------------------------------------------------------
# set up PATH to MANPATH mapping # set up PATH to MANPATH mapping
# ie. what man tree holds man pages for what binary directory. # ie. what man tree holds man pages for what binary directory.
@@ -34,8 +42,10 @@ MANPATH_MAP /usr/local/bin /usr/local/man @@ -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/bin /usr/local/share/man
MANPATH_MAP /usr/local/sbin /usr/local/man MANPATH_MAP /usr/local/sbin /usr/local/man
MANPATH_MAP /usr/local/sbin /usr/local/share/man MANPATH_MAP /usr/local/sbin /usr/local/share/man
@ -686,10 +679,9 @@ index 2942000..b2751f5 100644
# #
#--------------------------------------------------------- #---------------------------------------------------------
diff --git a/src/mandb.c b/src/mandb.c diff --git a/src/mandb.c b/src/mandb.c
index 7a63d8d..786e77b 100644
--- a/src/mandb.c --- a/src/mandb.c
+++ b/src/mandb.c +++ b/src/mandb.c
@@ -203,6 +203,8 @@ struct dbpaths { @@ -207,6 +207,8 @@ struct dbpaths {
#ifdef MAN_OWNER #ifdef MAN_OWNER
extern uid_t ruid; extern uid_t ruid;
extern uid_t euid; extern uid_t euid;
@ -698,7 +690,7 @@ index 7a63d8d..786e77b 100644
#endif /* MAN_OWNER */ #endif /* MAN_OWNER */
static gl_list_t manpathlist; static gl_list_t manpathlist;
@@ -554,6 +556,8 @@ out: @@ -576,6 +578,8 @@ static int mandb (struct dbpaths *dbpath
return amount; return amount;
} }
@ -707,25 +699,25 @@ index 7a63d8d..786e77b 100644
static int process_manpath (const char *manpath, bool global_manpath, static int process_manpath (const char *manpath, bool global_manpath,
gl_map_t tried_catdirs) gl_map_t tried_catdirs)
{ {
@@ -601,6 +605,8 @@ static int process_manpath (const char *manpath, bool global_manpath, @@ -617,6 +621,8 @@ static int process_manpath (const char *
free (database); } else
} run_mandb = true;
+ mkcatdirs (manpath, catpath); + mkcatdirs (manpath, catpath);
+ +
dbpaths = XZALLOC (struct dbpaths); dbpaths = XZALLOC (struct dbpaths);
push_cleanup (cleanup, dbpaths, 0); push_cleanup (cleanup, dbpaths, 0);
push_cleanup (cleanup_sigsafe, dbpaths, 1); push_cleanup (cleanup_sigsafe, dbpaths, 1);
@@ -616,7 +622,7 @@ static int process_manpath (const char *manpath, bool global_manpath, @@ -636,7 +642,7 @@ static int process_manpath (const char *
if (!opt_test && amount) if (!opt_test && (amount || new_purged || new_strays))
finish_up (dbpaths); finish_up (dbpaths);
#ifdef MAN_OWNER #ifdef MAN_OWNER
- if (global_manpath) - if (global_manpath)
+ if (global_manpath && (euid == 0 || ruid == 0)) + if (global_manpath && (euid == 0 || ruid == 0))
do_chown (dbpaths); do_chown (dbpaths);
#endif /* MAN_OWNER */ #endif /* MAN_OWNER */
@@ -819,8 +825,14 @@ int main (int argc, char *argv[]) @@ -835,8 +841,14 @@ int main (int argc, char *argv[])
#ifdef MAN_OWNER #ifdef MAN_OWNER
man_owner = get_man_owner (); man_owner = get_man_owner ();
@ -743,10 +735,9 @@ index 7a63d8d..786e77b 100644
read_config_file (user); read_config_file (user);
diff --git a/src/manp.c b/src/manp.c diff --git a/src/manp.c b/src/manp.c
index 5441339..ac46d3f 100644
--- a/src/manp.c --- a/src/manp.c
+++ b/src/manp.c +++ b/src/manp.c
@@ -898,7 +898,7 @@ static char *def_path (enum config_flag flag) @@ -906,7 +906,7 @@ static char *def_path (enum config_flag
/* If we have complete config file failure... */ /* If we have complete config file failure... */
if (!manpath) if (!manpath)
@ -756,10 +747,9 @@ index 5441339..ac46d3f 100644
return manpath; return manpath;
} }
diff --git a/src/straycats.c b/src/straycats.c diff --git a/src/straycats.c b/src/straycats.c
index b07083c..fbc0c1b 100644
--- a/src/straycats.c --- a/src/straycats.c
+++ b/src/straycats.c +++ b/src/straycats.c
@@ -37,6 +37,7 @@ @@ -38,6 +38,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
@ -768,12 +758,11 @@ index b07083c..fbc0c1b 100644
#include "canonicalize.h" #include "canonicalize.h"
diff --git a/src/ult_src.c b/src/ult_src.c diff --git a/src/ult_src.c b/src/ult_src.c
index 43e7a9b..93bd30c 100644
--- a/src/ult_src.c --- a/src/ult_src.c
+++ b/src/ult_src.c +++ b/src/ult_src.c
@@ -336,10 +336,15 @@ const char *ult_src (const char *name, const char *path, @@ -342,10 +342,15 @@ const char *ult_src (const char *name, c
} }
pipeline_start (decomp); decompress_start (decomp);
- /* make sure that we skip over any comments */ - /* make sure that we skip over any comments */
+ /* + /*
@ -781,7 +770,7 @@ index 43e7a9b..93bd30c 100644
+ * ... even if we handle TCL/TK manual pages + * ... even if we handle TCL/TK manual pages
+ */ + */
do { do {
buffer = pipeline_readline (decomp); buffer = decompress_readline (decomp);
- } while (buffer && STRNEQ (buffer, ".\\\"", 3)); - } while (buffer && STRNEQ (buffer, ".\\\"", 3));
+ } while (buffer && *buffer && + } while (buffer && *buffer &&
+ (STRNEQ (buffer, ".\\\"", 3) || + (STRNEQ (buffer, ".\\\"", 3) ||

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b66c99edfad16ad928c889f87cf76380263c1609323c280b3a9e6963fdb16756
size 1909020

View File

@ -1,16 +0,0 @@
-----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-----

View File

@ -1,3 +1,55 @@
-------------------------------------------------------------------
Thu Aug 18 08:14:54 UTC 2022 - Dr. Werner Fink <werner@suse.de>
- Update to man-db 2.10.0 (4 February 2022)
* Manpath deduplication no longer mishandles the case where another entry
in the manpath is a suffix of a candidate path to append.
* Fix potential crash in path searching if `getcwd` fails for reasons other
than running out of memory.
* Fix crash in `globbing` test tool if run with no non-option arguments.
* `lexgrog` now produces output in the user's locale.
* Downgrade "malformed .lf request" warning to a debug message and rephrase
it somewhat, since `.lf` requests can use `*roff` arithmetic expressions
and we can't reasonably parse those.
* Avoid modifying the database without changing its mtime, which had been
possible since 2.7.0 if `mandb`'s purge phase found work to do but the
main phase didn't, and which confused some backup systems into reporting
possible filesystem corruption.
* `man` no longer inadvertently modifies the `MANSECT` environment variable
before passing it on to its subprocesses.
* `mandb` now stores the mtime of link targets as the mtime of their
corresponding database entries, rather than sometimes storing the mtime
of the link instead.
* Since man-db 2.4.2, `man` has behaved as if the `-l` option was given if
a manual page argument contains a slash. Since man-db 2.5.6, this has
interacted slightly poorly with the subpage feature, emitting spurious
error messages if given multiple manual page arguments some of which
include a slash. `man` no longer emits spurious error messages in this
case.
* Reduce overhead of `MAN_DISABLE_SECCOMP=1` compared to building without
`libseccomp`.
* Document `MAN_DISABLE_SECCOMP` and `PIPELINE_DEBUG` environment variables
in `man(1)`.
* Add `man-pages(7)` reference to `man(1)`.
* Recognize Arabic and Persian translations of the `NAME` section.
* Delay the `systemd` timer using `RandomizedDelaySec`, so that multiple
containers/VMs on the same host are less prone to running `mandb` all at
the same time.
* Significantly improve `mandb(8)` and `man -K` performance in the common
case where pages are of moderate size and compressed using `zlib`: `mandb
-c` goes from 344 seconds to 10 seconds on a test system.
- Remove patch man-db-2.7.1-security4.dif as now upstream creates
any missing database
- Port patches
* man-db-2.6.3-chinese.dif
* man-db-2.6.3-listall.dif
* man-db-2.6.3-man0.dif
* man-db-2.7.1-zio.dif
* man-db-2.9.4-alternitive.dif
* man-db-2.9.4-no-chown.patch
* man-db-2.9.4.patch
* reproducible.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Aug 15 16:48:51 UTC 2022 - <d_werner@gmx.net> Mon Aug 15 16:48:51 UTC 2022 - <d_werner@gmx.net>

View File

@ -26,7 +26,7 @@
%global optflags %{optflags} %{**} %global optflags %{optflags} %{**}
%bcond_without sdtimer %bcond_without sdtimer
Name: man Name: man
Version: 2.9.4 Version: 2.10.0
Release: 0 Release: 0
Summary: A Program for Displaying man Pages Summary: A Program for Displaying man Pages
License: GPL-2.0-or-later License: GPL-2.0-or-later
@ -43,7 +43,6 @@ Source7: man-db-create.service
Source8: manpath.csh Source8: manpath.csh
Source9: manpath.sh Source9: manpath.sh
Patch0: man-db-2.3.19deb4.0-groff.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 Patch2: man-db-2.7.1-firefox.dif
Patch3: man-db-2.6.3-chinese.dif Patch3: man-db-2.6.3-chinese.dif
# PATCH-FEATURE-OPENSUSE man-db-2.7.1-zio.dif -- Allow using libzio for decompression # PATCH-FEATURE-OPENSUSE man-db-2.7.1-zio.dif -- Allow using libzio for decompression
@ -101,20 +100,19 @@ printer (using groff).
%prep %prep
%setup -q -n man-db-%{version} %setup -q -n man-db-%{version}
%patch0 -b .groff %patch0 -b .groff
%patch1 -b .secu4
%patch2 -b .firefox %patch2 -b .firefox
%patch3 -b .chinese %patch3 -b .chinese
%patch4 -b .zio %patch4 -b .zio
%patch5 -b .listall %patch5 -b .listall
%patch6 -p1 -b .p12 %patch6 -p1 -b .p6
%patch7 -p1 %patch7 -p1 -b .p7
%patch8 -p1 %patch8 -p1 -b .p8
%patch9 -b .s10 %patch9 -b .p9
%patch10 -b .libalernative %patch10 -b .libalernative
rm -f configure rm -f configure
%patch11 -p1 %patch11 -p1 -b .p11
%ifarch ppc64le %ifarch ppc64le
%patch12 %patch12 -b .p12
%endif %endif
%build %build
@ -321,7 +319,7 @@ then
fi fi
%files -f man-db.lang %files -f man-db.lang
%license docs/COPYING %license COPYING
%doc ChangeLog %doc ChangeLog
%doc %{_docdir}/man/man-db-manual* %doc %{_docdir}/man/man-db-manual*
%config %{_sysconfdir}/manpath.config %config %{_sysconfdir}/manpath.config

View File

@ -1,9 +1,13 @@
Index: man-db-2.7.1/manual/man_db.me Index: man-db-2.7.1/manual/man_db.me
=================================================================== ===================================================================
--- man-db-2.7.1.orig/manual/man_db.me ---
+++ man-db-2.7.1/manual/man_db.me man-db-2.10.0/manual/man_db.me | 1 +
1 file changed, 1 insertion(+)
--- man-db-2.10.0/manual/man_db.me
+++ man-db-2.10.0/manual/man_db.me 2022-08-17 13:19:13.782077593 +0000
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
.\" Thu Sep 21 19:22:47 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk) .\" Thu Sep 21 19:22:47 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
.\" .\"
.so version .so version
+.ds td - +.ds td -