Compare commits

1 Commits
main ... 1.1

14 changed files with 343 additions and 574 deletions

BIN
man-db-2.11.2.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

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

@@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAmO7P18ACgkQOTWH2X2G
UAsAVxAAjbkxD9Ji+FhO8VoJ40FnSlK7vwaX+1REswSBmaSCmrt7ey9s60r6sAcM
OjphmTMHNJqxmBS/fsvKnuRiaUv/a+PPKOxEZg85F9uUmArnDphaTH9PzXPpxHgV
jwda7v3BSxPV0YjFyj1FzfpTQjhZX9+0NwVUXUga0ViCExi8yAk3lS+Vhkz3JdkK
PWY9QjD7GwH5G+8ojHOZralBNCEQdcej9/3B1FGPq9EoZ270emybJBmHAF9K+2Y9
2jH4HWcSjhwCAxEXYkzmBtmkYvfE4HdDTCzo5TR51PflizD2RylIYmNO4vdyETIP
KPYK2fzpkSODTUgeSfLfupv1sq9MqIDLEtpWLgZT5BTJCHjG14KAgDfnUmqZB2Iv
w4wHyfAJ+7MrVqCHbLtjcdVVfAxDajhrRLwZZkQrd/lT6ykZ0q0wQjXP+xL2yTxR
70lRgMFnEzezHtiEiW2xjWQDehNiQ+7NK1vNUgnugXBdsb7MO6dwtL/30JMtapOA
60vlGlDejGvfae9OYeNCQc/b7GYJwFQ7vQ3iM2c1PVF1KfaqY71WrrC3hP03gs9j
EzmrA9xLdfkKGmALD8579KukEiWitcIikm8NlkQ/0mLF7CKIjXVSJmGjz4xrsDAg
zN2qdp8cJG6R4PmKQdCFS+YNlBp07xkqO/CCqKjBpLNBN+r9lAQ=
=uREj
-----END PGP SIGNATURE-----

View File

@@ -1,60 +0,0 @@
Avoid abort() in regain_effective_privs() if mandb is called by root
that is always initialize saved_uid and saved_gid!
--- gl/lib/idpriv-droptemp.c 2024-08-29 13:17:12.000000000 +0200
+++ gl/lib/idpriv-droptemp.c 2024-11-11 09:55:45.539212073 +0100
@@ -31,19 +31,24 @@
static gid_t saved_gid = -1;
#endif
-int
-idpriv_temp_drop (void)
+void
+idpriv_initial (void)
{
-#if HAVE_GETEUID && HAVE_GETEGID && (HAVE_SETRESUID || HAVE_SETREUID) && (HAVE_SETRESGID || HAVE_SETREGID)
- uid_t uid = getuid ();
- gid_t gid = getgid ();
-
/* Find out about the privileged uid and gid at the first call. */
if (saved_uid == -1)
saved_uid = geteuid ();
if (saved_gid == -1)
saved_gid = getegid ();
+}
+
+int
+idpriv_temp_drop (void)
+{
+#if HAVE_GETEUID && HAVE_GETEGID && (HAVE_SETRESUID || HAVE_SETREUID) && (HAVE_SETRESGID || HAVE_SETREGID)
+ uid_t uid = getuid ();
+ gid_t gid = getgid ();
+ idpriv_initial ();
/* Drop the gid privilege first, because in some cases the gid privilege
cannot be dropped after the uid privilege has been dropped. */
--- gl/lib/idpriv.h 2024-08-29 13:17:12.000000000 +0200
+++ gl/lib/idpriv.h 2024-11-11 09:50:35.047999910 +0100
@@ -95,6 +95,9 @@
/* For approach 3. */
+/* Initialize internal variable saved_uid as well as saved_gid */
+extern void idpriv_initial (void);
+
/* Drop the uid and gid privileges of the current process in a way that allows
them to be restored later.
Return 0 if successful, or -1 with errno set upon failure. The recommended
--- lib/security.c 2024-11-11 09:10:13.044830286 +0100
+++ lib/security.c 2024-11-11 09:51:16.688162468 +0100
@@ -138,7 +138,8 @@
gripe_set_euid ();
uid = ruid;
gid = rgid;
- }
+ } else
+ idpriv_initial ();
priv_drop_count++;
#endif /* MAN_OWNER */

BIN
man-db-2.13.0.tar.xz (Stored with Git LFS)

Binary file not shown.

View File

@@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAmbQWvEACgkQOTWH2X2G
UAv41g/9EwS08JyC1q9NY9K/m+dbrweHuNTJOWu9PfBQNmxDD+39uWOcqzf+Wg7S
rorbs1mHbn+6JG/7PcugGcUucSJOPLB36+DJzVXwGip13aJi8WNWqSEV2RtiPsA0
3DJHvCEB2WcbxbumWxowgpQaWxUy+1FssSCf0ScVqWDc46V8zUWq1rmtgejEOc7m
Eumxc4J+0mhwGx0IB+djjmde/ciqoDQ4ANqLZ7hNMg0+b3l92NRYgBspXfoBjQp9
+wk1cimgrI1oW9gpmO/wZ4LSwsK7YvhdL+zPRjL6HADQaXlpHY7pkx0X/qhqXplo
eUu7GlWSVF6z813g4MAZGdH03coCGLHfbqMWsRiOwKuefmMQsARPVDFAIJtOfsYz
qo3h5pUf0PzVuzRweuA3laM6dHkVhGmewWyzXSH3MbRUlDK17I7h9gY0dtDw4GWz
S+Ppw1Ar2xiN62G9PDtjkt4v/axNbdKaHEMUBqEuzYmBBaJeKxWkRcmXG5smvFb9
fsuoyFxh/opd01Kp8QrU3T6iIIhzSr4SLZMFzxZ1ai8d8AzkHwfBNiQAh5Q94Gtp
qYy/mv7jOpDt0QyyaxMO001/9uFD0Sh3w5lRN0SQCJ0T84bxYY+eVMveSg8qlZsE
53sFdxIbqLetvcHx9L4WXlRLdJXqS+YF2wbe5Dwr+MT+1ys3YKY=
=PUlf
-----END PGP SIGNATURE-----

54
man-db-2.6.3-chinese.dif Normal file
View File

@@ -0,0 +1,54 @@
---
lib/encodings.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
--- lib/encodings.c
+++ lib/encodings.c 2016-12-15 14:07:01.072034899 +0000
@@ -227,6 +227,7 @@ static struct charset_entry charset_tabl
{ "EUC-CN", "nippon" },
{ "EUC-JP", "nippon" },
{ "EUC-TW", "nippon" },
+ { "GB18030", "nippon" },
{ "GBK", "nippon" },
# else /* !MULTIBYTE_GROFF */
/* If we have a smarter version of groff, this is better dealt with
@@ -314,6 +315,7 @@ static struct less_charset_entry less_ch
#ifdef MULTIBYTE_GROFF
{ "CP1251", "windows", NULL },
+ { "GB18030", "zh", NULL },
{ "EUC-JP", "iso8859", "japanese-ujis" },
{ "KOI8-R", "koi8-r", NULL },
/* close enough? */
@@ -452,6 +454,13 @@ char *get_page_encoding (const char *lan
* roff encoding = ISO-8859-15
* output encoding = ISO-8859-15
* ISO-8859-15 -> groff -Tascii8 -> ISO-8859-15 -> iconv -> UTF-8
+ *
+ * /usr/share/man/zh_CN.GB18030, locale zh_CN.UTF-8
+ * page encoding = GB18030
+ * source encoding = GB18030
+ * roff encoding = UTF-8
+ * output encoding = UTF-8
+ * GB18030 -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8
*/
const char *get_source_encoding (const char *lang)
{
@@ -620,7 +629,7 @@ static int compatible_encodings (const c
*/
if ((STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") ||
STREQ (input, "EUC-JP") ||
- STREQ (input, "EUC-CN") || STREQ (input, "GBK") ||
+ STREQ (input, "EUC-CN") || STREQ (input, "GB18030") || STREQ (input, "GBK") ||
STREQ (input, "EUC-KR") ||
STREQ (input, "EUC-TW")) &&
STREQ (output, "UTF-8"))
@@ -724,7 +733,7 @@ const char *get_roff_encoding (const cha
STRNEQ (ctype, "zh_HK", 5) ||
STRNEQ (ctype, "zh_SG", 5) ||
STRNEQ (ctype, "zh_TW", 5))
- roff_encoding = "UTF-8";
+ roff_encoding = source_encoding; /* "UTF-8"; */
}
#endif /* MULTIBYTE_GROFF */

View File

@@ -5,7 +5,7 @@
--- man/man1/man.man1
+++ man/man1/man.man1 2022-08-17 13:11:29.974677243 +0000
@@ -1236,6 +1236,14 @@ However, some users want to see them any
@@ -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
@@ -22,7 +22,7 @@
.B %man%
--- src/man.c
+++ src/man.c 2022-08-17 13:10:07.436205495 +0000
@@ -3651,12 +3651,141 @@ static int locate_page (const char *manp
@@ -3641,12 +3641,141 @@ static int locate_page (const char *manp
return found;
}
@@ -164,7 +164,7 @@
global_manpath = is_global_mandir (candp->path);
if (!global_manpath)
drop_effective_privs ();
@@ -3679,9 +3808,56 @@ static int display_pages (struct candida
@@ -3668,9 +3797,56 @@ static int display_pages (struct candida
regain_effective_privs ();
if (found && !findall)

View File

@@ -1,12 +1,12 @@
---
config.h.in | 3 +
configure.ac | 52 +++++++++++++++++++++++++++++++++
src/decompress.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
3 files changed, 138 insertions(+), 3 deletions(-)
configure.ac | 52 ++++++++++++++++++++++++++++++
src/decompress.c | 70 ++++++++++++++++++++++++++++++++++++++++-
3 files changed, 124 insertions(+), 1 deletion(-)
--- config.h.in
+++ config.h.in 2024-11-11 10:43:01.369880933 +0000
@@ -1148,6 +1148,9 @@
+++ config.h.in 2023-08-15 08:21:20.473974597 +0000
@@ -1015,6 +1015,9 @@
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
@@ -17,7 +17,7 @@
#undef HAVE_LIB_BCRYPT
--- configure.ac
+++ configure.ac 2024-11-11 10:43:01.369880933 +0000
+++ configure.ac 2023-08-15 08:21:20.473974597 +0000
@@ -35,6 +35,18 @@ MAN_ARG_DEVICE
MAN_ARG_DB
MAN_ARG_CONFIG_FILE
@@ -37,7 +37,7 @@
MAN_ARG_AUTOMATIC_CREATE
MAN_ARG_AUTOMATIC_UPDATE
MAN_ARG_CATS
@@ -374,6 +386,46 @@ AC_DEFINE_UNQUOTED([PROG_UNXZ], ["$unxz"
@@ -401,6 +413,46 @@ AC_DEFINE_UNQUOTED([PROG_UNXZ], ["$unxz"
AC_DEFINE_UNQUOTED([PROG_UNLZIP], ["$unlzip"], [Program to use as unlzip.])
AC_DEFINE_UNQUOTED([PROG_UNZSTD], ["$unzstd"], [Program to use as unzstd.])
MAN_COMPRESS_LIB([z], [gzopen])
@@ -85,7 +85,7 @@
# Check for various header files and associated libraries.
--- src/decompress.c
+++ src/decompress.c 2024-11-11 10:44:24.036386441 +0000
+++ src/decompress.c 2023-08-15 08:23:12.947968440 +0000
@@ -40,12 +40,17 @@
#include "pipeline.h"
@@ -104,77 +104,21 @@
#include "manconfig.h"
#include "compression.h"
@@ -146,7 +151,11 @@ static void decompress_zlib (void *data
static decompress *decompress_try_zlib (const char *filename)
{
+#ifdef HAVE_ZIO
+ FILE *file;
+#else
gzFile zlibfile;
+#endif
/* We only ever call this from the parent process (and don't
* currently use threads), and this lets us skip per-file memory
* allocation.
@@ -154,18 +163,32 @@ static decompress *decompress_try_zlib (
static char buffer[MAX_INPROCESS];
int len = 0;
+#ifdef HAVE_ZIO
+ file = fzopen(filename, "r");
+ if (!file)
+ return NULL;
+#else
zlibfile = gzopen (filename, "r");
if (!zlibfile)
return NULL;
+#endif
while (len < MAX_INPROCESS) {
/* Read one more byte than we're prepared to return, in
* order to detect EOF at the right position. The "len >=
* MAX_INPROCESS" check below catches the boundary case.
*/
+#ifdef HAVE_ZIO
+ int r = fread(buffer + len, sizeof(char), MAX_INPROCESS - len, file);
+#else
int r = gzread (zlibfile, buffer + len, MAX_INPROCESS - len);
+#endif
if (r < 0) {
+#ifdef HAVE_ZIO
+ fclose(file);
+#else
gzclose (zlibfile);
+#endif
return NULL;
} else if (r == 0)
break;
@@ -173,7 +196,11 @@ static decompress *decompress_try_zlib (
len += r;
}
+#ifdef HAVE_ZIO
+ fclose(file);
+#else
gzclose (zlibfile);
+#endif
if (len >= MAX_INPROCESS)
return NULL;
/* Copy input data so that we don't have potential data corruption
@@ -189,33 +216,86 @@ static decompress *decompress_try_zlib (
# define OPEN_FLAGS_UNUSED MAYBE_UNUSED
@@ -189,6 +194,33 @@ static decompress *decompress_try_zlib (
#define OPEN_FLAGS_UNUSED MAYBE_UNUSED
#endif /* HAVE_LIBZ */
+#ifdef HAVE_ZIO
+
+static void decompress_zio (void *data)
+{
+ const char *what = (const char*)data;
+ FILE *file;
+
+
+ file = fdzopen(dup (fileno (stdin)), "r", what);
+ if (!file)
+ return;
+
+
+ for (;;) {
+ char buffer[4096];
+ int r = fread(buffer, sizeof(char), sizeof(buffer), file);
@@ -183,74 +127,69 @@
+ if (fwrite (buffer, 1, (size_t) r, stdout) < (size_t) r)
+ break;
+ }
+
+
+ fclose(file);
+ return;
+}
+
+#endif /* HAVE_ZIO */
+
decompress *decompress_open (const char *filename, int flags OPEN_FLAGS_UNUSED)
{
pipecmd *cmd;
pipeline *p;
struct stat st;
#ifdef HAVE_LIBZ
+# ifdef HAVE_ZIO
+ char *ext;
+# else
size_t filename_len;
+# endif
#endif /* HAVE_LIBZ */
- char *ext;
struct compression *comp;
+
extern man_sandbox *sandbox;
decompress *decompress_open (const char *filename, int flags OPEN_FLAGS_UNUSED)
@@ -205,6 +237,38 @@ decompress *decompress_open (const char
if (stat (filename, &st) < 0 || S_ISDIR (st.st_mode))
return NULL;
#ifdef HAVE_LIBZ
+# ifdef HAVE_ZIO
+#ifdef HAVE_ZIO
+ ext = strrchr (filename, '.');
+ if (ext && (
+ STREQ (ext, ".gz") ||
+ STREQ (ext, ".z") ||
+ STREQ (ext, ".bz2") ||
+ STREQ (ext, ".xz") ||
+ STREQ (ext, ".lzma") ||
+ STREQ (ext, ".Z")
+ )) {
+# else
filename_len = strlen (filename);
if (filename_len > 3 && STREQ (filename + filename_len - 3, ".gz")) {
+# endif
if (flags & DECOMPRESS_ALLOW_INPROCESS) {
decompress *d = decompress_try_zlib (filename);
if (d)
return d;
}
-
+# ifdef HAVE_ZIO
+ static char opt[2] = {'\0','\0'};
+ if (ext) {
+ const char *opt;
+ char *name = NULL;
+
+ opt[0] = ext[1];
+ if (STREQ (ext, ".gz"))
+ opt = "g";
+ else if (STREQ (ext, ".z"))
+ opt = "z";
+ else if (STREQ (ext, ".bz2"))
+ opt = "b";
+ else if (STREQ (ext, ".xz"))
+ opt = "x";
+ else if (STREQ (ext, ".lzma"))
+ opt = "l";
+ else if (STREQ (ext, ".Z"))
+ opt = "Z";
+ else
+ goto nozio;
+
+ /* informational only; no shell quoting concerns */
+ name = appendstr (NULL, "libzio < ", filename, (void *) 0);
+ cmd = pipecmd_new_function (name, &decompress_zio, NULL,
+ (void *)opt);
+# else
cmd = pipecmd_new_function ("zcat", &decompress_zlib, NULL,
NULL);
+# endif
pipecmd_pre_exec (cmd, sandbox_load, sandbox_free, sandbox);
p = pipeline_new_commands (cmd, nullptr);
+# ifdef HAVE_ZIO
+ free (name);
+# endif
goto got_pipeline;
+ pipecmd_pre_exec (cmd, sandbox_load, sandbox_free, sandbox);
+ p = pipeline_new_commands (cmd, (void *) 0);
+ free (name);
+ goto got_pipeline;
+ }
+#endif /* HAVE_ZIO */
+
#ifdef HAVE_LIBZ
filename_len = strlen (filename);
if (filename_len > 3 && STREQ (filename + filename_len - 3, ".gz")) {
@@ -222,7 +286,11 @@ decompress *decompress_open (const char
}
#endif /* HAVE_LIBZ */
@@ -313,7 +393,7 @@ void decompress_inprocess_replace (decom
+#ifdef HAVE_ZIO
+nozio:
+#else
ext = strrchr (filename, '.');
+#endif /* HAVE_LIBZ */
if (ext) {
++ext;
@@ -315,7 +383,7 @@ void decompress_inprocess_replace (decom
void decompress_start (decompress *d)
{

View File

@@ -0,0 +1,43 @@
---
src/man.c | 23 ++++++++++++++++++++---
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 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
+#include <libalternatives.h>
#include "argp.h"
#include "attribute.h"
@@ -4171,9 +4172,25 @@ static void locate_page_in_manpath (cons
{
char *mp;
- GL_LIST_FOREACH (manpathlist, mp)
- *found += locate_page (mp, page_section, page_name,
- candidates);
+ GL_LIST_FOREACH (manpathlist, mp) {
+ int count = locate_page (mp, page_section, page_name, candidates);
+ if (count == 0) {
+ /* Checking if there has been defined another manpage defined in the
+ * priorities of libalternatives.
+ */
+ char **alternitives = libalts_get_default_manpages(page_name);
+ for (char **alter = alternitives; *alter; alter++) {
+ char *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)
+ count = locate_page (mp, p_section, p_name, candidates);
+ free(*alter);
+ }
+ free(alternitives);
+ }
+ *found += count;
+ }
}
/*

View File

@@ -1,21 +1,20 @@
---
configure.ac | 18 ++++++++++-
lib/security.c | 30 +++++++++++++++++++
mk_catdirs | 30 +++++++++++++++++++
src/check_mandirs.c | 33 +++++++++++++--------
src/lexgrog.l | 64 ++++++++++++++++++++++++++++++-----------
src/man.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++------
configure.ac | 18 +++++++++-
lib/security.c | 30 +++++++++++++++++
mk_catdirs | 30 +++++++++++++++++
src/check_mandirs.c | 33 ++++++++++++-------
src/lexgrog.l | 64 +++++++++++++++++++++++++++-----------
src/man.c | 60 +++++++++++++++++++++++++++++++++++++++++++-----
src/man_db.conf.in | 17 ++++++++--
src/mandb.c | 30 +++++++++++++------
src/mandb.c | 18 ++++++++--
src/manp.c | 2 -
src/straycats.c | 1
src/ult_src.c | 9 ++++-
11 files changed, 261 insertions(+), 54 deletions(-)
11 files changed, 235 insertions(+), 47 deletions(-)
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -275,6 +275,14 @@ fi
+++ b/configure.ac 2023-08-15 08:31:31.135097942 +0000
@@ -302,6 +302,14 @@ fi
MAN_CHECK_PROGS([eqn], [EQN], [use EQN to preprocess equations], [eqn geqn])
AC_DEFINE_UNQUOTED([PROG_EQN], ["$eqn"], [Program to use as eqn.])
@@ -30,7 +29,7 @@ diff --git a/configure.ac b/configure.ac
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
@@ -325,9 +333,15 @@ then
@@ -352,9 +360,15 @@ then
compress_ext="gz"
fi
MAN_CHECK_PROGS([compress], [COMPRESS], [use COMPRESS as UNIX compression utility], [compress])
@@ -48,22 +47,21 @@ diff --git a/configure.ac b/configure.ac
if test -z "$gzip"
then
compressor="$compress -c"
diff --git a/lib/security.c b/lib/security.c
--- a/lib/security.c
+++ b/lib/security.c
+++ b/lib/security.c 2023-08-15 08:31:31.135097942 +0000
@@ -80,6 +80,11 @@ static void gripe_set_euid (void)
fatal (errno, _ ("can't set effective uid"));
fatal (errno, _("can't set effective uid"));
}
+static inline void gripe_set_egid (void)
+{
+ fatal (errno, _ ("can't set effective gid"));
+ error (FATAL, errno, _("can't set effective gid"));
+}
+
#endif /* MAN_OWNER */
void init_security (void)
@@ -166,6 +171,31 @@ void regain_effective_privs (void)
@@ -164,6 +169,31 @@ void regain_effective_privs (void)
uid = euid;
gid = egid;
}
@@ -95,9 +93,8 @@ diff --git a/lib/security.c b/lib/security.c
#endif /* MAN_OWNER */
}
diff --git a/mk_catdirs b/mk_catdirs
--- a/mk_catdirs
+++ b/mk_catdirs
+++ b/mk_catdirs 2023-08-15 08:31:31.135097942 +0000
@@ -0,0 +1,30 @@
+#!/bin/sh
+
@@ -129,19 +126,18 @@ diff --git a/mk_catdirs b/mk_catdirs
+cd ${OLDPWD}
+
+test "$(id -u)" -ne 0 || chown man:man -R ${CACHE}
diff --git a/src/check_mandirs.c b/src/check_mandirs.c
--- a/src/check_mandirs.c
+++ b/src/check_mandirs.c
@@ -383,7 +383,7 @@ void chown_if_possible (const char *path
+++ b/src/check_mandirs.c 2023-08-15 08:31:31.139097869 +0000
@@ -381,7 +381,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)
{
if (catdir) {
char *manname, *catname;
@@ -412,9 +412,14 @@ static void mkcatdirs (const char *mandi
char *manname, *catname;
@@ -409,9 +409,14 @@ static void mkcatdirs (const char *mandi
int j;
regain_effective_privs ();
debug ("creating catdir hierarchy %s ", catdir);
@@ -156,19 +152,19 @@ diff --git a/src/check_mandirs.c b/src/check_mandirs.c
+ c = 'n';
+ catname[strlen (catname) - 1] = c;
+ manname[strlen (manname) - 1] = c;
if ((is_directory (manname) == 1) &&
(is_directory (catname) != 1)) {
if ((is_directory (manname) == 1)
&& (is_directory (catname) != 1)) {
if (mkdir (catname, 0755) < 0) {
@@ -429,7 +434,7 @@ static void mkcatdirs (const char *mandi
"create catdir %s\n",
catname);
@@ -419,7 +424,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);
}
}
@@ -573,16 +578,11 @@ static int testmandirs (MYDBM_FILE dbf,
@@ -562,15 +567,10 @@ static int testmandirs (MYDBM_FILE dbf,
}
if (!quiet) {
@@ -177,16 +173,15 @@ diff --git a/src/check_mandirs.c b/src/check_mandirs.c
- if (tty)
- fprintf (stderr, "\r");
fprintf (stderr,
_ ("Updating index cache for path "
"`%s/%s'. Wait..."),
path, mandir->d_name);
_("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);
amount++;
@@ -652,7 +652,7 @@ int update_db (MYDBM_FILE dbf, const cha
@@ -639,7 +639,7 @@ int update_db (MYDBM_FILE dbf, const cha
int new;
if (!ensure_db_open (dbf) || !sanity_check_db (dbf)) {
@@ -195,15 +190,15 @@ diff --git a/src/check_mandirs.c b/src/check_mandirs.c
return -1;
}
mtime = MYDBM_GET_TIME (dbf);
@@ -865,6 +865,7 @@ static int purge_whatis (MYDBM_FILE dbf,
name, info->ext);
@@ -847,6 +847,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. */
@@ -964,6 +965,14 @@ int purge_missing (MYDBM_FILE dbf, const
@@ -944,6 +945,14 @@ int purge_missing (MYDBM_FILE dbf, const
}
#pragma GCC diagnostic pop
@@ -218,9 +213,8 @@ diff --git a/src/check_mandirs.c b/src/check_mandirs.c
content = MYDBM_FETCH (dbf, key);
if (!MYDBM_DPTR (content)) {
nextkey = MYDBM_NEXTKEY (dbf, key);
diff --git a/src/lexgrog.l b/src/lexgrog.l
--- a/src/lexgrog.l
+++ b/src/lexgrog.l
+++ b/src/lexgrog.l 2023-08-15 08:33:23.053105426 +0000
@@ -70,7 +70,7 @@
#include "manconv.h"
#include "manconv_client.h"
@@ -230,7 +224,7 @@ diff --git a/src/lexgrog.l b/src/lexgrog.l
#define MAX_NAME 8192
/* defines the ordered list of filters detected by lexgrog */
@@ -227,15 +227,15 @@ static const struct macro perldocs[] = {
@@ -229,15 +229,15 @@ static const struct macro perldocs[] = {
{ "R\"", "\"" }
};
@@ -255,7 +249,7 @@ diff --git a/src/lexgrog.l b/src/lexgrog.l
static char newname[MAX_NAME];
static char *p_name;
@@ -244,6 +244,7 @@ static char filters[MAX_FILTERS];
@@ -246,6 +246,7 @@ static char filters[MAX_FILTERS];
static bool fill_mode;
static bool waiting_for_quote;
@@ -263,7 +257,7 @@ diff --git a/src/lexgrog.l b/src/lexgrog.l
static decompress *decomp;
@@ -261,7 +262,7 @@ static decompress *decomp;
@@ -263,7 +264,7 @@ static decompress *decomp;
%}
%option ecs meta-ecs
@@ -272,7 +266,7 @@ diff --git a/src/lexgrog.l b/src/lexgrog.l
%option nostdinit
%option warn
%option noyywrap nounput
@@ -300,8 +301,9 @@ font_change \\f([[:upper:]1-4]|\({upper}
@@ -302,8 +303,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])
@@ -283,7 +277,7 @@ diff --git a/src/lexgrog.l b/src/lexgrog.l
/* Please add to this list if you know how. */
/* Note that, since flex only supports UTF-8 by accident, character classes
@@ -343,7 +345,26 @@ vi_name T(Ê|ê)[Nn]
@@ -345,7 +347,26 @@ vi_name T(Ê|ê)[Nn]
zh_CN_name 名{blank}?(称|字){blank}?.*
zh_TW_name (名{blank}?(稱|字)|命令名){blank}?.*
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})
@@ -311,7 +305,7 @@ diff --git a/src/lexgrog.l b/src/lexgrog.l
/* eptgrv : eqn, pic, tbl, grap, refer, vgrind */
tbl_request \.TS
@@ -357,8 +378,13 @@ vgrind_request \.vS
@@ -359,8 +380,13 @@ vgrind_request \.vS
%%
/* begin NAME section processing */
@@ -327,7 +321,7 @@ diff --git a/src/lexgrog.l b/src/lexgrog.l
/* general text matching */
<MAN_FILE>{
@@ -433,6 +459,7 @@ vgrind_request \.vS
@@ -435,6 +461,7 @@ vgrind_request \.vS
{bol}\.sp{blank}* | /* vertical spacing */
{bol}\.ig{blank}* | /* block comment */
{bol}\.de[1i]?{blank}* | /* macro definition */
@@ -335,7 +329,7 @@ diff --git a/src/lexgrog.l b/src/lexgrog.l
{bol}\.i[ef]{blank}* | /* conditional */
{empty}{bol}.+ |
<<EOF>> { /* terminate the string */
@@ -480,8 +507,8 @@ vgrind_request \.vS
@@ -482,8 +509,8 @@ vgrind_request \.vS
/* Toggle fill mode */
<MAN_NAME,MAN_DESC>{
@@ -346,7 +340,7 @@ diff --git a/src/lexgrog.l b/src/lexgrog.l
}
<CAT_NAME>-{eol}{blank_eol}* /* strip continuations */
@@ -490,6 +517,9 @@ vgrind_request \.vS
@@ -492,6 +519,9 @@ vgrind_request \.vS
<MAN_NAME>{
{next}{blank}*\\\((mi|hy|em|en){blank}* |
{next}{blank}*\\\[(mi|hy|em|en)\]{blank}* |
@@ -356,19 +350,17 @@ diff --git a/src/lexgrog.l b/src/lexgrog.l
{next}{blank_eol}+[-\\]-{blank}* |
{next}{blank_eol}*[-\\]-{blank}+ |
{bol}\.Nd{blank}* {
diff --git a/src/man.c b/src/man.c
--- a/src/man.c
+++ b/src/man.c
@@ -56,6 +56,8 @@
#include <termios.h>
+++ b/src/man.c 2023-08-15 08:45:27.956189368 +0000
@@ -56,6 +56,7 @@
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/time.h>
+#include <libalternatives.h>
#include "argp.h"
#include "attribute.h"
@@ -118,6 +120,8 @@
@@ -116,6 +117,8 @@
#ifdef MAN_OWNER
extern uid_t ruid;
extern uid_t euid;
@@ -377,19 +369,19 @@ diff --git a/src/man.c b/src/man.c
#endif /* MAN_OWNER */
/* the default preprocessor sequence */
@@ -238,10 +242,10 @@ static int first_arg;
@@ -239,10 +242,10 @@ static int first_arg;
#ifdef MAN_CATS
static char *tmp_cat_file; /* for open_cat_stream(), close_cat_stream() */
static bool created_tmp_cat; /* dto. */
static char *tmp_cat_file; /* for open_cat_stream(), close_cat_stream() */
static bool created_tmp_cat; /* dto. */
-#endif
static int tmp_cat_fd;
static struct timespec man_modtime; /* modtime of man page, for
* commit_tmp_cat() */
static struct timespec man_modtime; /* modtime of man page, for
* commit_tmp_cat() */
+#endif
#ifdef TROFF_IS_GROFF
# ifdef TROFF_IS_GROFF
static bool ditroff;
@@ -1569,6 +1573,18 @@ static void setenv_less (pipecmd *cmd, c
@@ -1561,6 +1564,18 @@ static void setenv_less (pipecmd *cmd, c
free (less_opts);
}
@@ -405,10 +397,10 @@ diff --git a/src/man.c b/src/man.c
+ }
+}
+
static void add_output_iconv (pipeline *p, const char *source,
const char *target)
static void add_output_iconv (pipeline *p,
const char *source, const char *target)
{
@@ -1697,6 +1713,8 @@ static pipeline *make_display_command (c
@@ -1691,6 +1706,8 @@ static pipeline *make_display_command (c
if (pager_cmd) {
setenv_less (pager_cmd, title);
@@ -417,15 +409,24 @@ diff --git a/src/man.c b/src/man.c
pipeline_command (p, pager_cmd);
}
pipeline_ignore_signals (p, 1);
@@ -1707,6 +1725,7 @@ static pipeline *make_display_command (c
@@ -1701,7 +1718,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)
{
@@ -1808,6 +1827,7 @@ static int commit_tmp_cat (const char *c
@@ -1729,7 +1746,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.
*/
@@ -1802,6 +1818,7 @@ static int commit_tmp_cat (const char *c
return status;
}
@@ -433,7 +434,7 @@ diff --git a/src/man.c b/src/man.c
/* TODO: This should all be refactored after work on the decompression
* library is complete.
@@ -1844,7 +1864,6 @@ static void cleanup_unlink (void *arg)
@@ -1838,7 +1855,6 @@ static void cleanup_unlink (void *arg)
}
#ifdef MAN_CATS
@@ -441,7 +442,7 @@ diff --git a/src/man.c b/src/man.c
/* 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)
{
@@ -2072,6 +2091,7 @@ static void format_display (decompress *
@@ -2070,6 +2086,7 @@ static void format_display (decompress *
regain_effective_privs ();
}
@@ -449,15 +450,15 @@ diff --git a/src/man.c b/src/man.c
/* "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, decompress *d,
@@ -2117,6 +2137,7 @@ static void display_catman (const char *
@@ -2115,6 +2132,7 @@ static void display_catman (const char *
pop_cleanup (cleanup_unlink, tmpcat);
free (tmpcat);
}
+#endif /* MAN_CATS */
#ifndef TROFF_IS_GROFF
static void disable_hyphenation (void *data MAYBE_UNUSED)
@@ -2327,7 +2348,7 @@ static int display (const char *dir, con
{
@@ -2317,7 +2335,7 @@ static int display (const char *dir, con
format_cmd = NULL;
decomp_errno = errno;
}
@@ -466,7 +467,7 @@ diff --git a/src/man.c b/src/man.c
/* Get modification time, for commit_tmp_cat(). */
if (man_file && *man_file) {
struct stat stb;
@@ -2337,7 +2358,7 @@ static int display (const char *dir, con
@@ -2327,7 +2345,7 @@ static int display (const char *dir, con
} else
man_modtime = get_stat_mtime (&stb);
}
@@ -475,7 +476,7 @@ diff --git a/src/man.c b/src/man.c
display_to_stdout = troff;
#ifdef TROFF_IS_GROFF
if (htmlout || gxditview)
@@ -2474,6 +2495,7 @@ static int display (const char *dir, con
@@ -2468,6 +2486,7 @@ static int display (const char *dir, con
}
if (printed)
putchar ('\n');
@@ -483,15 +484,15 @@ diff --git a/src/man.c b/src/man.c
} else if (catman) {
if (format) {
if (!save_cat)
@@ -2486,6 +2508,7 @@ static int display (const char *dir, con
format_cmd,
formatted_encoding);
@@ -2480,6 +2499,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;
@@ -4028,17 +4051,20 @@ static int local_man_loop (const char *a
@@ -4011,17 +4031,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);
@@ -512,7 +513,7 @@ diff --git a/src/man.c b/src/man.c
return NOT_FOUND;
}
@@ -4102,6 +4128,11 @@ executable_out:
@@ -4085,6 +4108,11 @@ executable_out:
argv_abs = xstrdup (argv);
}
lang = lang_dir (argv_abs);
@@ -524,36 +525,7 @@ diff --git a/src/man.c b/src/man.c
free (argv_abs);
if (!display (NULL, argv, NULL, argv_base, NULL)) {
if (local_mf)
@@ -4158,9 +4189,25 @@ static void locate_page_in_manpath (cons
{
char *mp;
- GL_LIST_FOREACH (manpathlist, mp)
- *found +=
- locate_page (mp, page_section, page_name, candidates);
+ GL_LIST_FOREACH (manpathlist, mp) {
+ int count = locate_page (mp, page_section, page_name, candidates);
+ if (count == 0) {
+ /* Checking if there has been defined another manpage defined in the
+ * priorities of libalternatives.
+ */
+ char **alternitives = libalts_get_default_manpages(page_name);
+ for (char **alter = alternitives; *alter; alter++) {
+ char *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)
+ count = locate_page (mp, p_section, p_name, candidates);
+ free(*alter);
+ }
+ free(alternitives);
+ }
+ *found += count;
+ }
}
/*
@@ -4354,7 +4401,16 @@ int main (int argc, char *argv[])
@@ -4340,7 +4368,16 @@ int main (int argc, char *argv[])
umask (022);
init_locale ();
@@ -571,7 +543,7 @@ diff --git a/src/man.c b/src/man.c
/* Use LANGUAGE only when LC_MESSAGES locale category is
* neither "C" nor "POSIX". */
if (internal_locale && strcmp (internal_locale, "C") &&
@@ -4399,7 +4455,16 @@ int main (int argc, char *argv[])
@@ -4385,7 +4422,16 @@ int main (int argc, char *argv[])
if (external)
do_extern (argc, argv);
@@ -588,9 +560,8 @@ diff --git a/src/man.c b/src/man.c
/* 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
--- a/src/man_db.conf.in
+++ b/src/man_db.conf.in
+++ b/src/man_db.conf.in 2023-08-15 08:31:31.139097869 +0000
@@ -20,6 +20,14 @@
MANDATORY_MANPATH /usr/man
MANDATORY_MANPATH /usr/share/man
@@ -629,10 +600,9 @@ diff --git a/src/man_db.conf.in b/src/man_db.conf.in
MANDB_MAP @snapdir@/man /var/cache/man/snap
#
#---------------------------------------------------------
diff --git a/src/mandb.c b/src/mandb.c
--- a/src/mandb.c
+++ b/src/mandb.c
@@ -205,6 +205,8 @@ struct dbpaths {
+++ b/src/mandb.c 2023-08-15 08:35:07.783240325 +0000
@@ -213,6 +213,8 @@ struct dbpaths {
#ifdef MAN_OWNER
extern uid_t ruid;
extern uid_t euid;
@@ -641,16 +611,16 @@ diff --git a/src/mandb.c b/src/mandb.c
#endif /* MAN_OWNER */
static gl_list_t manpathlist;
@@ -627,6 +629,8 @@ static int mandb (struct dbpaths *dbpath
@@ -638,6 +640,8 @@ static int mandb (struct dbpaths *dbpath
return amount;
}
+extern void mkcatdirs (const char *, const char *);
+
static int process_manpath (const char *manpath, bool global_manpath,
gl_map_t tried_catdirs)
gl_map_t tried_catdirs)
{
@@ -668,6 +672,8 @@ static int process_manpath (const char *
@@ -679,6 +683,8 @@ static int process_manpath (const char *
} else
run_mandb = true;
@@ -659,7 +629,7 @@ diff --git a/src/mandb.c b/src/mandb.c
dbpaths = XZALLOC (struct dbpaths);
push_cleanup ((cleanup_fun) dbpaths_free_elements, dbpaths, 0);
push_cleanup ((cleanup_fun) dbpaths_unlink_tmp, dbpaths, 1);
@@ -686,7 +692,7 @@ static int process_manpath (const char *
@@ -697,7 +703,7 @@ static int process_manpath (const char *
if (!opt_test && (amount || new_purged || new_strays)) {
dbpaths_rename_from_tmp (dbpaths);
#ifdef MAN_OWNER
@@ -668,39 +638,26 @@ diff --git a/src/mandb.c b/src/mandb.c
dbpaths_chown_if_possible (dbpaths);
#endif /* MAN_OWNER */
reorganize (catpath, global_manpath);
@@ -889,14 +895,20 @@ int main (int argc, char *argv[])
@@ -896,8 +902,14 @@ int main (int argc, char *argv[])
#ifdef MAN_OWNER
man_owner = get_man_owner ();
- if (!user && euid != 0 && euid != man_owner->pw_uid) {
- if (!user && euid != 0 && euid != man_owner->pw_uid)
- user = true;
- if (!quiet)
- fprintf (stderr,
- _ ("Only the '%s' user can create or update "
- "system-wide databases; acting as if the "
- "--user-db option was used.\n"),
- man_owner->pw_name);
+ if (!user) {
+ if (!ruid && euid != man_owner->pw_uid) {
+ seteuid(man_owner->pw_uid);
+ euid = geteuid();
+ }
+ if (euid != man_owner->pw_uid) {
+ user = true;
+ if (!quiet)
+ fprintf (stderr,
+ _ ("Only the '%s' user can create or update "
+ "system-wide databases; acting as if the "
+ "--user-db option was used.\n"),
+ man_owner->pw_name);
+ }
}
+ if (euid != man_owner->pw_uid)
+ user = true;
+ }
#endif /* MAN_OWNER */
diff --git a/src/manp.c b/src/manp.c
read_config_file (user);
--- a/src/manp.c
+++ b/src/manp.c
@@ -903,7 +903,7 @@ static char *def_path (enum config_flag
+++ b/src/manp.c 2023-08-15 08:31:31.139097869 +0000
@@ -907,7 +907,7 @@ static char *def_path (enum config_flag
/* If we have complete config file failure... */
if (!manpath)
@@ -709,20 +666,18 @@ diff --git a/src/manp.c b/src/manp.c
return manpath;
}
diff --git a/src/straycats.c b/src/straycats.c
--- a/src/straycats.c
+++ b/src/straycats.c
@@ -39,6 +39,7 @@
#include <sys/stat.h>
+++ b/src/straycats.c 2023-08-15 08:31:31.139097869 +0000
@@ -38,6 +38,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <fcntl.h>
#include <dirent.h>
#include "canonicalize.h"
#include "dirname.h"
diff --git a/src/ult_src.c b/src/ult_src.c
--- a/src/ult_src.c
+++ b/src/ult_src.c
+++ b/src/ult_src.c 2023-08-15 08:37:50.940333586 +0000
@@ -160,10 +160,15 @@ static char *find_include_directive (cha
}
decompress_start (decomp);

View File

@@ -0,0 +1,29 @@
From b12ffb9df7a6a8956b08206c36be70fac78508bd Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
Date: Thu, 20 Jul 2023 00:18:59 +0100
Subject: [PATCH] Update warning regex for groff 1.23.0
Part of https://gitlab.com/man-db/man-db/-/issues/25.
* man/check-man: groff 1.23.0 says "cannot break line" rather than
"can't break line"; update regular expression.
---
man/check-man | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man/check-man b/man/check-man
index a58b7f9d..f8985a0d 100755
--- a/man/check-man
+++ b/man/check-man
@@ -31,7 +31,7 @@ errors="$(LC_ALL=C MANWIDTH=80 MAN_KEEP_FORMATTING=1 "$top_builddir/libtool" \
# Indeed, even for other languages we're going to get "cannot adjust line"
# if %manpath_config_file% expands to something long. Hmm. We'll just ignore
# this across the board for now.
-errors="$(echo "$errors" | $EGREP -v "(cannot adjust line|can't break line)")" || true
+errors="$(echo "$errors" | $EGREP -v "(cannot adjust line|(can't|cannot) break line)")" || true
if [ "$code" != 0 ]; then
echo "man -E UTF-8 -l $1 failed with exit status $code and error output:"
--
GitLab

View File

@@ -1,32 +1,29 @@
---
man-db-2.13.0/src/man.c | 9 +++++++--
man-db-2.13.0/src/tests/man-invalid-db-entry | 2 ++
2 files changed, 9 insertions(+), 2 deletions(-)
--- man-db-2.13.0/src/man.c
+++ man-db-2.13.0/src/man.c 2024-10-18 12:56:52.431247186 +0000
@@ -769,11 +769,16 @@ static void gripe_no_man (const char *na
diff -ur man-db-2.10.2/src/man.c man-db-2.10.2.patch/src/man.c
--- man-db-2.10.2/src/man.c 2022-03-17 19:41:27.000000000 +0100
+++ man-db-2.10.2.patch/src/man.c 2023-04-03 17:13:05.944119389 +0200
@@ -775,11 +775,16 @@
}
#endif
- if (sec)
+ if (sec) {
fprintf (stderr, _ ("No manual entry for %s in section %s\n"),
name, sec);
fprintf (stderr, _("No manual entry for %s in section %s\n"),
name, sec);
- else
+ fprintf (stderr, _("Possibly, man page is not installed, try online at: "));
+ fprintf (stderr, _("https://manpages.opensuse.org/%s.%s\n"), name, sec);
+ } else {
fprintf (stderr, _ ("No manual entry for %s\n"), name);
+ } else {
fprintf (stderr, _("No manual entry for %s\n"), name);
+ fprintf (stderr, _("Possibly, man page is not installed, try online at: "));
+ fprintf (stderr, _("https://manpages.opensuse.org/%s\n"), name);
+ }
#ifdef UNDOC_COMMAND
if (getenv ("MAN_TEST_DISABLE_UNDOCUMENTED") == NULL &&
--- man-db-2.13.0/src/tests/man-invalid-db-entry
+++ man-db-2.13.0/src/tests/man-invalid-db-entry 2024-10-18 12:53:16.443176267 +0000
@@ -25,6 +25,8 @@ run $MANDB -C "$tmpdir/manpath.config" -
diff -ur man-db-2.10.2/src/tests/man-invalid-db-entry man-db-2.10.2.patch/src/tests/man-invalid-db-entry
--- man-db-2.10.2/src/tests/man-invalid-db-entry 2022-03-17 19:41:27.000000000 +0100
+++ man-db-2.10.2.patch/src/tests/man-invalid-db-entry 2023-04-03 17:13:55.256508193 +0200
@@ -25,6 +25,8 @@
rm -f "$tmpdir/usr/share/man/man1/test.1"
echo "No manual entry for test" > "$tmpdir/1.exp"

View File

@@ -1,118 +1,3 @@
-------------------------------------------------------------------
Mon Nov 11 10:37:45 UTC 2024 - Dr. Werner Fink <werner@suse.de>
- Readd patch man-db-2.7.1-zio.dif
* Use also in-memory decompression
- Add patch man-db-2.13.0-no_abort.patch
* Avoid abort of mandb due switching to user man if executed by root
-------------------------------------------------------------------
Fri Nov 8 13:58:23 UTC 2024 - Fabian Vogt <fvogt@suse.com>
- Drop libzio integration (man-db-2.7.1-zio.dif, BuildRequires and flag)
to restore acceptable performance (boo#1232837):
-------------------------------------------------------------------
Fri Oct 18 13:04:09 UTC 2024 - Dr. Werner Fink <werner@suse.de>
- Update to man-db 2.13.0 (29 August 2024)
* Drop support for versions of groff before 1.21 (released on 2010-12-31).
* Fix `man-suffixed-extension` test failure when not using the GNU
hierarchy organization.
* Fix `-Wmissing-variable-declarations` warnings with GCC 14.
* Fix `-Wflex-array-member-not-at-end` warning with GCC 14.
* Upgrade to Gnulib `stable-202407`.
* Support running the test suite against an installed package; this is
useful for systems such as Debian's autopkgtest framework.
- Remove patch man-db-2.6.3-chinese.dif as not supported anymore
due to newer groff versions
- Port patches
* man-db-2.6.3-listall.dif
* man-db-2.7.1-zio.dif
* man-db-2.9.4.patch
* man-propose-online.patch
-------------------------------------------------------------------
Tue Jun 4 08:10:47 UTC 2024 - Dr. Werner Fink <werner@suse.de>
- Update to 2.12.1 (5 April 2024)
* Fix excessive cleanup of `/var/cache/man` by `systemd-tmpfiles`.
* `man` matches the display width more accurately to the configured width.
* Upgrade to Gnulib `stable-202401`.
* Mention `groff`'s `pdf` device in `man(1)`.
* Speed up `seccomp` filter slightly.
* Document how to format pages using italic rather than underlined text.
* Remove the obsolete `chconfig` tool for converting man-db configuration
files to the FHS. This transition took place almost 25 years ago (at
least in Debian), so it's not worth keeping it around now.
- Remove patch man-db-2.9.4-alternitive.dif now upstream
- Port the patches
* man-db-2.6.3-listall.dif
* man-db-2.7.1-zio.dif
* man-db-2.9.4.patch
* man-propose-online.patch
-------------------------------------------------------------------
Mon Feb 19 07:21:59 UTC 2024 - Dr. Werner Fink <werner@suse.de>
- We don't need anymore systemd-tmpfiles (boo#1219370#c13)
-------------------------------------------------------------------
Mon Feb 12 09:32:21 UTC 2024 - Dr. Werner Fink <werner@suse.de>
- Move creation of /var/cache/man into %pre scriplet (boo#1219370)
-------------------------------------------------------------------
Thu Feb 8 10:48:51 UTC 2024 - Dr. Werner Fink <werner@suse.de>
- Make lua scriplets more failsafe (boo#1219370)
-------------------------------------------------------------------
Fri Jan 26 09:26:57 UTC 2024 - Dr. Werner Fink <werner@suse.de>
- Skip posttrans dependency on systemd to support container without
systemd (boo#1215538)
- Use %(trans)filetriggerin and %(trans)filetriggerpostun to get
an uptodate man database for installed manual pages
-------------------------------------------------------------------
Sun Oct 1 12:19:14 UTC 2023 - Antonio Teixeira <antonio.teixeira@suse.com>
- Update to 2.12.0:
* Fix some manual page portability issues with groff 1.23.0.
* Fix test failures when a working `iconv` is not available.
* Ensure that timestamps read from the database can go past the year 2038,
even on systems where this is not the default.
* Fix `manpath` not parsing `PATH` entries with trailing slash correctly
for guessing `MANPATH` entries.
* More accurately document the behaviour of passing file names as arguments
to `man` without the `-l`/`--local-file` option.
* Avoid duplicate cleanup of old cat pages by both `man-db.service` and
`systemd-tmpfiles-clean.service`.
Improvements:
* Update system call lists in `seccomp` sandbox from `systemd`.
* Upgrade to Gnulib `stable-202307`.
* Work around the Firebuild accelerator in `seccomp` sandbox: if this is in
use then we need to allow some socket-related system calls.
* `man -K` now deduplicates search results that point to the same page.
* Warn if `mandb` drops to `--user-db` mode due to running as the wrong
user.
* Change section title recommendations in `man(1)` to mention `STANDARDS`
rather than `CONFORMING TO`, in line with `man-pages(7)`.
* Add a `STANDARDS` section to `man(1)` itself.
* Document that `man -K` may suffer from false negatives as well as false
positives.
* Take advantage of newer `groff` facilities to implement `man
--no-hyphenation` and `man --no-justification`, if available.
* `man -f` and `man -k` now pass any `-r`/`--regex` or `-w`/`--wildcard`
options on to `whatis` and `apropos` respectively.
* Always pass a line length to `nroff`, even if we believe that it matches
the default.
* Allow disabling `groff` warnings via `man --warnings`, by prefixing a
warning name with `!`.
- Drop man-db-groff-1.23.0-warnings.patch
- Refresh man-db-2.9.4.patch
-------------------------------------------------------------------
Fri Sep 8 19:48:53 UTC 2023 - Antonio Teixeira <antonio.teixeira@suse.com>

119
man.spec
View File

@@ -1,7 +1,7 @@
#
# spec file for package man
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -26,7 +26,7 @@
%global optflags %{optflags} %{**}
%bcond_without sdtimer
Name: man
Version: 2.13.0
Version: 2.11.2
Release: 0
Summary: A Program for Displaying man Pages
License: GPL-2.0-or-later
@@ -43,8 +43,7 @@ Source7: man-db-create.service
Source8: manpath.csh
Source9: manpath.sh
Patch0: man-db-2.3.19deb4.0-groff.dif
# PATCH-FIX-SUSE Fix a crash if mandb is directly executed by root
Patch3: man-db-2.13.0-no_abort.patch
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
@@ -57,8 +56,11 @@ Patch7: man-db-2.9.4-no-chown.patch
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
Patch10: man-db-2.9.4-alternitive.dif
# PATCH-FEATURE-OPENSUSE -- Propose to read man pages online
Patch12: man-propose-online.patch
# PATCH-FIX-UPSTREAM -- Update warning regex for groff 1.23.0
Patch13: man-db-groff-1.23.0-warnings.patch
BuildRequires: automake
BuildRequires: flex
BuildRequires: gdbm-devel
@@ -81,8 +83,10 @@ Requires: glibc-locale-base
Suggests: glibc-locale
Requires: groff >= 1.18
Requires: less
Requires(post): %fillup_prereq
Requires(pre): coreutils
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: coreutils
PreReq: fillup
Requires(posttrans):systemd
Requires(pre): group(man)
Requires(pre): user(man)
Provides: man_db
@@ -96,16 +100,18 @@ printer (using groff).
%prep
%setup -q -n man-db-%{version}
%patch -P 0 -b .groff
%patch -P3 -b .seteuid
%patch -P4 -b .zio
%patch -P5 -b .listall
%patch -P6 -p1 -b .p6
%patch -P7 -p1 -b .p7
%patch -P8 -p1 -b .p8
%patch -P9 -b .p9
%patch0 -b .groff
%patch3 -b .chinese
%patch4 -b .zio
%patch5 -b .listall
%patch6 -p1 -b .p6
%patch7 -p1 -b .p7
%patch8 -p1 -b .p8
%patch9 -b .p9
%patch10 -b .libalernative
rm -f configure
%patch -P12 -p1 -b .p12
%patch12 -p1 -b .p12
%patch13 -p1 -b .p13
%build
%global optflags %{optflags} -funroll-loops -pipe -Wall
@@ -259,75 +265,6 @@ install -m 644 %{SOURCE9} %{buildroot}%{_prefix}/etc/profile.d/
%find_lang man-db --all-name --with-man
%global trigger_functions %{expand:
-- Check if rpm.execute() as function call is given
if type(rpm.execute) == "function" then
execute = rpm.execute
else
function execute(path, ...)
local pid = posix.fork()
if not pid then
error(path .. ": fork failed: " .. posix.errno() .. "\n")
elseif pid == 0 then
assert(posix.exec(path, ...))
else
posix.wait(pid)
end
end
end
--
}
%if 0%{?suse_version} >= 1699
%transfiletriggerin -p <lua> -- %{_mandir}
%else
%filetriggerin -p <lua> -- %{_mandir}
%endif
%trigger_functions
stat = posix.stat("%{_localstatedir}/cache/man/index.db")
if stat then
execute("%{_bindir}/mandb", "--quiet")
else
domkdir = false
stat = posix.stat("%{_localstatedir}/cache/man")
if not stat then
domkdir = true
elseif not (stat.type == "directory") then
domkdir = true
os.remove("%{_localstatedir}/cache/man")
end
if domkdir then
posix.mkdir("%{_localstatedir}/cache/man")
posix.chown("%{_localstatedir}/cache/man", "man", "man")
end
execute("%{_bindir}/mandb", "--quiet", "--create")
end
%if 0%{?suse_version} >= 1699
%transfiletriggerpostun -p <lua> -- %{_mandir}
%else
%filetriggerpostun -p <lua> -- %{_mandir}
%endif
%trigger_functions
stat = posix.stat("%{_localstatedir}/cache/man/index.db")
if stat then
execute("%{_bindir}/mandb", "--quiet")
else
domkdir = false
stat = posix.stat("%{_localstatedir}/cache/man")
if not stat then
domkdir = true
elseif not (stat.type == "directory") then
domkdir = true
os.remove("%{_localstatedir}/cache/man")
end
if domkdir then
posix.mkdir("%{_localstatedir}/cache/man")
posix.chown("%{_localstatedir}/cache/man", "man", "man")
end
execute("%{_bindir}/mandb", "--quiet", "--create")
end
%pre
test -d var/catman/ && rm -rf var/catman/ || true
%if %{with sdtimer}
@@ -352,20 +289,9 @@ then
esac
done
fi
# With fallback for systemdless containers
if test ! -d %{_localstatedir}/cache/man
then
# Simply for systemdless containers
umask 022
rm -f %{_localstatedir}/cache/man
mkdir -p %{_localstatedir}/cache/man
chown -R man:man %{_localstatedir}/cache/man
fi
%post
%if 0%{?suse_version} < 1500
%{fillup_only -an cron}
%endif
/sbin/ldconfig
%if %{with sdtimer}
%service_add_post man-db-create.service
@@ -392,7 +318,8 @@ fi
%endif
%posttrans
if test ! -s %{_localstatedir}/cache/man/index.db
%{?tmpfiles_create:%tmpfiles_create %{_prefix}/lib/tmpfiles.d/man-db.conf}
if test -d %{_localstatedir}/cache/man
then
mandb --quiet --create || :
fi