Update to man-db 2.7.6

OBS-URL: https://build.opensuse.org/package/show/Base:System/man?expand=0&rev=71
This commit is contained in:
Dr. Werner Fink 2016-12-16 09:45:04 +00:00 committed by Git OBS Bridge
parent 105760fe7d
commit b9bb15e12b
13 changed files with 240 additions and 226 deletions

View File

@ -1,6 +1,10 @@
--- man/man1/man.man1.bak 2014-07-29 19:12:02.574014758 +0300
+++ man/man1/man.man1 2014-07-29 19:14:06.522076369 +0300
@@ -1327,6 +1327,14 @@
---
man/man1/man.man1 | 8 ++++++++
1 file changed, 8 insertions(+)
--- man/man1/man.man1
+++ man/man1/man.man1 2016-12-15 14:10:47.883461034 +0000
@@ -1344,6 +1344,14 @@ However, some users want to see them any
.RB $ MAN_KEEP_STDERR
is set to any non-empty value, error output will be displayed as usual.
.TP

View File

@ -1,5 +1,9 @@
---
lib/encodings.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
--- lib/encodings.c
+++ lib/encodings.c 2012-10-01 14:42:07.895867558 +0000
+++ lib/encodings.c 2016-12-15 14:07:01.072034899 +0000
@@ -224,6 +224,7 @@ static struct charset_entry charset_tabl
{ "EUC-CN", "nippon" },
{ "EUC-JP", "nippon" },
@ -30,7 +34,7 @@
*/
const char *get_source_encoding (const char *lang)
{
@@ -654,7 +663,7 @@ static int compatible_encodings (const c
@@ -667,7 +676,7 @@ static int compatible_encodings (const c
*/
if ((STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") ||
STREQ (input, "EUC-JP") ||
@ -39,7 +43,7 @@
STREQ (input, "EUC-KR") ||
STREQ (input, "EUC-TW")) &&
STREQ (output, "UTF-8"))
@@ -758,7 +767,7 @@ const char *get_roff_encoding (const cha
@@ -771,7 +780,7 @@ const char *get_roff_encoding (const cha
STRNEQ (ctype, "zh_HK", 5) ||
STRNEQ (ctype, "zh_SG", 5) ||
STRNEQ (ctype, "zh_TW", 5))

View File

@ -1,6 +1,10 @@
---
src/man.c | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 178 insertions(+), 2 deletions(-)
--- src/man.c
+++ src/man.c 2012-10-29 13:48:02.134344676 +0100
@@ -3712,12 +3712,141 @@ static int locate_page (const char *manp
+++ src/man.c 2016-12-15 14:08:57.993676527 +0000
@@ -3514,12 +3514,141 @@ static int locate_page (const char *manp
return found;
}
@ -142,7 +146,7 @@
global_manpath = is_global_mandir (candp->path);
if (!global_manpath)
drop_effective_privs ();
@@ -3739,9 +3868,56 @@ static int display_pages (struct candida
@@ -3541,9 +3670,56 @@ static int display_pages (struct candida
regain_effective_privs ();
if (found && !findall)

View File

@ -1,6 +1,10 @@
---
src/man.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- src/man.c
+++ src/man.c 2012-10-01 14:24:23.251006952 +0000
@@ -1368,7 +1368,7 @@ static inline const char *is_section (co
+++ src/man.c 2016-12-15 13:49:52.184819971 +0000
@@ -961,7 +961,7 @@ static const char *is_section (const cha
{
const char **vs;
@ -9,7 +13,7 @@
if (STREQ (*vs, name))
return name;
/* allow e.g. 3perl but disallow 8139too and libfoo */
@@ -2943,7 +2943,7 @@ static int compare_candidates (const str
@@ -2714,7 +2714,7 @@ static int compare_candidates (const str
/* Find out whether lsource->ext is ahead of rsource->ext in
* section_list.
*/
@ -18,12 +22,21 @@
if (!*(*sp + 1)) {
/* No extension */
if (!sec_left && **sp == *(lsource->ext))
@@ -3918,7 +3918,7 @@ static int man (const char *name, int *f
} else {
@@ -3679,7 +3679,7 @@ static int do_global_apropos (const char
} else
my_section_list = section_list;
- for (sp = my_section_list; *sp; sp++)
+ for (sp = my_section_list; sp && *sp; sp++)
for (mp = manpathlist; *mp; mp++)
*found += do_global_apropos_section (*mp, *sp, name);
@@ -3879,7 +3879,7 @@ static int man (const char *name, int *f
else {
const char **sp;
- for (sp = section_list; *sp; sp++) {
+ for (sp = section_list; sp && *sp; sp++) {
char **mp;
for (mp = manpathlist; *mp; mp++)
locate_page_in_manpath (*sp, name, &candidates, found);
}
}

View File

@ -3,9 +3,9 @@
1 file changed, 12 insertions(+), 10 deletions(-)
--- src/man.c
+++ src/man.c 2015-05-28 10:54:07.961519305 +0000
@@ -1847,16 +1847,6 @@ static void format_display (pipeline *de
if (!status)
+++ src/man.c 2016-12-15 14:02:44.261219082 +0000
@@ -1949,16 +1949,6 @@ static void format_display (pipeline *de
if (!disp_status)
break;
}
- if (!candidate) {
@ -21,12 +21,12 @@
free (browser_list);
if (have_old_cwd && restore_cwd (&old_cwd) < 0) {
error (0, errno,
@@ -1864,11 +1854,23 @@ static void format_display (pipeline *de
chdir ("/");
@@ -1967,11 +1957,23 @@ static void format_display (pipeline *de
if (chdir ("/")) { /* ignore errors */ }
}
free_cwd (&old_cwd);
+ if (!status)
+ sleep(5); /* firefox runs into background to fast */
+ if (!disp_status)
+ sleep (5); /* firefox runs into background to fast */
if (remove_directory (htmldir, 0) == -1)
error (0, errno, _("can't remove directory %s"),
htmldir);
@ -44,4 +44,4 @@
+ }
} else
#endif /* TROFF_IS_GROFF */
/* TODO: check format_cmd status too? */
{

View File

@ -1,21 +1,13 @@
---
src/mandb.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
src/mandb.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
--- src/mandb.c
+++ src/mandb.c 2015-05-28 10:43:41.785520616 +0000
@@ -37,6 +37,7 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h> /* for chmod() */
+#include <fcntl.h> /* for open () */
#include <dirent.h>
#include <unistd.h>
#include <signal.h>
@@ -446,10 +447,19 @@ static int mandb (const char *catpath, c
+++ src/mandb.c 2016-12-16 07:14:50.995017235 +0000
@@ -439,17 +439,26 @@ static int mandb (struct dbpaths *dbpath
int ret, amount;
char *dbname;
char *cachedir_tag;
struct stat st;
int should_create;
+ int fd;
dbname = mkdbname (catpath);
@ -32,17 +24,19 @@
if (!quiet)
printf (_("Processing manual pages under %s...\n"), manpath);
@@ -458,11 +468,13 @@ static int mandb (const char *catpath, c
if (stat (cachedir_tag, &st) == -1 && errno == ENOENT) {
FILE *cachedir_tag_file;
if (!STREQ (catpath, manpath)) {
char *cachedir_tag;
- int fd;
+ drop_effective_privs ();
cachedir_tag_file = fopen (cachedir_tag, "w");
if (cachedir_tag_file) {
fputs (CACHEDIR_TAG, cachedir_tag_file);
fclose (cachedir_tag_file);
}
+ regain_effective_privs ();
}
+ drop_effective_privs ();
cachedir_tag = xasprintf ("%s/CACHEDIR.TAG", catpath);
fd = open (cachedir_tag, O_RDONLY);
if (fd < 0) {
@@ -467,6 +476,7 @@ static int mandb (struct dbpaths *dbpath
if (global_manpath)
chown_if_possible (cachedir_tag);
check_chmod (cachedir_tag, DBMODE);
+ regain_effective_privs ();
free (cachedir_tag);
}

View File

@ -5,8 +5,8 @@
3 files changed, 120 insertions(+)
--- config.h.in
+++ config.h.in 2015-05-28 00:00:00.000000000 +0000
@@ -737,6 +737,9 @@
+++ config.h.in 2016-12-15 14:07:41.579217715 +0000
@@ -740,6 +740,9 @@
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
@ -17,8 +17,8 @@
#undef HAVE_LINEWRAP_H
--- configure.ac
+++ configure.ac 2015-05-28 11:01:35.689518526 +0000
@@ -35,6 +35,18 @@ MAN_ARG_DEVICE
+++ configure.ac 2016-12-15 14:07:41.579217715 +0000
@@ -32,6 +32,18 @@ MAN_ARG_DEVICE
MAN_ARG_DB
MAN_ARG_CONFIG_FILE
MAN_ARG_SECTIONS
@ -37,7 +37,7 @@
MAN_ARG_AUTOMATIC_CREATE
MAN_ARG_AUTOMATIC_UPDATE
MAN_ARG_CATS
@@ -325,6 +337,46 @@ AC_SUBST([unlzma])
@@ -321,6 +333,46 @@ AC_SUBST([unlzma])
AC_SUBST([unxz])
AC_SUBST([unlzip])
MAN_COMPRESS_LIB([z], [gzopen])
@ -85,7 +85,7 @@
# Check for various header files and associated libraries.
--- lib/decompress.c
+++ lib/decompress.c 2015-05-28 00:00:00.000000000 +0000
+++ lib/decompress.c 2016-12-15 14:07:41.579217715 +0000
@@ -38,6 +38,10 @@
#include "xvasprintf.h"

View File

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

View File

@ -1,12 +1,13 @@
---
configure.ac | 18 +++++-
include/comp_src.h.in | 2
lib/security.c | 36 ++++++++++++
lib/security.c | 30 ++++++++++
lib/util.c | 3 +
libdb/mydbm.h | 4 -
libdb/mydbm.h | 2
man/po4a/po/ru.po | 2
mk_catdirs | 30 ++++++++++
src/Makefile.am | 12 +---
src/check_mandirs.c | 43 ++++++++++----
src/Makefile.am | 11 ---
src/check_mandirs.c | 33 +++++++----
src/lexgrog.l | 121 ++++++++++++++++++++++++++++-------------
src/man.c | 109 ++++++++++++++++++++++++++-----------
src/man_db.conf.in | 145 +++++++++++++++++++++++++++++++++++++++++++++++---
@ -15,11 +16,11 @@
src/straycats.c | 19 ++++--
src/ult_src.c | 9 ++-
src/ult_src.h | 7 +-
16 files changed, 459 insertions(+), 119 deletions(-)
17 files changed, 443 insertions(+), 118 deletions(-)
--- configure.ac
+++ configure.ac 2015-05-28 00:00:00.000000000 +0000
@@ -248,6 +248,14 @@ then
+++ configure.ac 2016-12-16 08:41:31.950958393 +0000
@@ -244,6 +244,14 @@ then
fi
MAN_CHECK_PROGS([eqn], [EQN], [use EQN to preprocess equations], [eqn geqn])
@ -34,7 +35,7 @@
MAN_CHECK_PROGS([neqn], [NEQN], [use NEQN to preprocess equations for character devices], [neqn gneqn])
# If we fail to find an neqn, use eqn and try to force it to output for an
# ascii device. As this is only relevant for equations (?), not using latin1
@@ -291,9 +299,15 @@ then
@@ -287,9 +295,15 @@ then
compress_ext="gz"
fi
MAN_CHECK_PROGS([compress], [COMPRESS], [use COMPRESS as UNIX compression utility], [compress])
@ -53,7 +54,7 @@
then
compressor="$compress -c"
--- include/comp_src.h.in
+++ include/comp_src.h.in 2015-05-28 00:00:00.000000000 +0000
+++ include/comp_src.h.in 2016-12-16 08:41:31.950958393 +0000
@@ -53,7 +53,7 @@ struct compression comp_list[] = {
#endif /* HAVE_GZIP */
@ -64,19 +65,8 @@
/* Else if we have gzip, incorporate the following */
#elif defined (HAVE_GZIP)
--- lib/security.c
+++ lib/security.c 2015-05-28 00:00:00.000000000 +0000
@@ -60,7 +60,10 @@
uid_t ruid; /* initial real user id */
uid_t euid; /* initial effective user id */
+gid_t rgid; /* initial real group id */
+gid_t egid; /* initial effective group id */
uid_t uid; /* current euid */
+gid_t gid; /* current egid */
static struct passwd *man_owner;
@@ -74,10 +77,17 @@ static inline void gripe_set_euid (void)
+++ lib/security.c 2016-12-16 08:41:31.950958393 +0000
@@ -77,6 +77,11 @@ static void gripe_set_euid (void)
error (FATAL, errno, _("can't set effective uid"));
}
@ -88,17 +78,10 @@
void init_security (void)
{
ruid = getuid ();
+ rgid = getgid ();
uid = euid = geteuid ();
+ gid = egid = getegid ();
debug ("ruid=%d, euid=%d\n", (int) ruid, (int) euid);
priv_drop_count = 0;
drop_effective_privs ();
@@ -147,6 +157,32 @@ void regain_effective_privs (void)
@@ -155,6 +160,31 @@ void regain_effective_privs (void)
uid = euid;
gid = egid;
}
+
+ if (gid != rgid) {
+# if defined(HAVE_SETRESGID)
+ if (setresgid (rgid, egid, -1) < 0)
@ -108,10 +91,10 @@
+ if (setegid (rgid) < 0)
+# endif
+ gripe_set_egid();
+
+
+ gid = rgid;
+ }
+
+
+ if (gid != egid) {
+# if defined(HAVE_SETRESGID)
+ if (setresgid (egid, rgid, -1))
@ -121,14 +104,14 @@
+ if (setegid (egid))
+# endif
+ gripe_set_egid();
+
+
+ gid = egid;
+ }
#endif /* SECURE_MAN_UID */
}
--- lib/util.c
+++ lib/util.c 2015-05-28 00:00:00.000000000 +0000
+++ lib/util.c 2016-12-16 08:41:31.950958393 +0000
@@ -50,6 +50,9 @@
#include "gettext.h"
@ -140,17 +123,8 @@
#include "error.h"
--- libdb/mydbm.h
+++ libdb/mydbm.h 2015-05-28 00:00:00.000000000 +0000
@@ -44,7 +44,7 @@
# include <gdbm.h>
# ifndef HAVE_GDBM_EXISTS
-extern inline int gdbm_exists(GDBM_FILE db, datum key);
+extern int gdbm_exists(GDBM_FILE db, datum key);
# endif /* !HAVE_GDBM_EXISTS */
/* gdbm_nextkey() is not lexicographically sorted, so we need to keep the
@@ -156,7 +156,7 @@ extern void btree_set_time(DB *db, const
+++ libdb/mydbm.h 2016-12-16 08:41:31.950958393 +0000
@@ -154,7 +154,7 @@ extern void btree_set_time(DB *db, const
# define MYDBM_SET_DPTR(d, value) ((d).data = (char *) (value))
# define MYDBM_DSIZE(d) ((d).size)
# define MYDBM_CTRWOPEN(file) btree_flopen(file, O_TRUNC|O_CREAT|O_RDWR, DBMODE)
@ -159,8 +133,19 @@
# define MYDBM_RWOPEN(file) btree_flopen(file, O_RDWR, DBMODE)
# define MYDBM_RDOPEN(file) btree_flopen(file, O_RDONLY, DBMODE)
# define MYDBM_INSERT(db, key, cont) btree_insert(db, key, cont)
--- man/po4a/po/ru.po
+++ man/po4a/po/ru.po 2016-12-16 08:41:31.950958393 +0000
@@ -3942,7 +3942,7 @@ msgstr ""
#~ msgstr "255"
#~ msgid "\\*[softhyphen]"
-#~ msgstr "\\*[мягкий перенос]"
+#~ msgstr "\\*[softhyphen]"
#~ msgid "-\n"
#~ msgstr "-\n"
--- mk_catdirs
+++ mk_catdirs 2015-05-28 00:00:00.000000000 +0000
+++ mk_catdirs 2016-12-16 08:41:31.950958393 +0000
@@ -0,0 +1,30 @@
+#!/bin/sh
+
@ -193,35 +178,28 @@
+
+test "$(id -u)" -ne 0 || chown man:man -R ${CACHE}
--- src/Makefile.am
+++ src/Makefile.am 2015-05-28 00:00:00.000000000 +0000
@@ -173,15 +173,9 @@ apropos$(EXEEXT): whatis$(EXEEXT)
+++ src/Makefile.am 2016-12-16 09:15:35.265937979 +0000
@@ -173,16 +173,7 @@ apropos$(EXEEXT): whatis$(EXEEXT)
all-am: apropos$(EXEEXT)
install-exec-hook:
- -test -z "$(man_owner)" || \
- chown $(man_owner) \
- $(DESTDIR)$(bindir)/$(TRANS_MAN) \
- $(DESTDIR)$(bindir)/$(TRANS_MANDB)
- if [ "$(man_owner)" ] && [ "$(man_mode)" = 6755 ]; then \
- chown $(man_owner):$(man_owner) \
- $(DESTDIR)$(bindir)/$(TRANS_MAN) \
- $(DESTDIR)$(bindir)/$(TRANS_MANDB); \
- fi
- chmod $(man_mode) \
- $(DESTDIR)$(bindir)/$(TRANS_MAN) \
- $(DESTDIR)$(bindir)/$(TRANS_MANDB)
- cd $(DESTDIR)$(bindir) && rm -f $(TRANS_APROPOS)$(EXEEXT) && \
- $(LN_S) $(TRANS_WHATIS)$(EXEEXT) $(TRANS_APROPOS)$(EXEEXT)
+ $(INSTALL_PROGRAM) $(TRANS_MAN) $(DESTDIR)$(pkglibexecdir)/$(TRANS_MAN)
+ $(INSTALL_PROGRAM) $(TRANS_MANDB) $(DESTDIR)$(pkglibexecdir)/$(TRANS_MANDB)
+ $(LN_S) $(TRANS_WHATIS) $(DESTDIR)$(bindir)/$(TRANS_APROPOS)
install-data-hook:
@if test -f $(DESTDIR)$(config_file); then \
--- src/check_mandirs.c
+++ src/check_mandirs.c 2015-05-28 00:00:00.000000000 +0000
@@ -362,10 +362,13 @@ static inline void add_dir_entries (cons
#ifdef SECURE_MAN_UID
extern uid_t ruid; /* initial real user id */
+extern uid_t euid; /* initial effective user id */
+extern gid_t rgid; /* initial real group id */
+extern gid_t egid; /* initial effective group id */
+++ src/check_mandirs.c 2016-12-16 08:41:31.950958393 +0000
@@ -394,7 +394,7 @@ void chown_if_possible (const char *path
#endif /* SECURE_MAN_UID */
/* create the catman hierarchy if it doesn't exist */
@ -229,24 +207,15 @@
+void mkcatdirs (const char *mandir, const char *catdir)
{
char *manname, *catname;
#ifdef SECURE_MAN_UID
@@ -389,6 +392,8 @@ static void mkcatdirs (const char *mandi
#ifdef SECURE_MAN_UID
if (ruid == 0)
chown (catdir, man_owner->pw_uid, 0);
+ if (rgid == 0)
+ chown (catdir, -1, man_owner->pw_gid);
#endif /* SECURE_MAN_UID */
drop_effective_privs ();
}
@@ -399,9 +404,14 @@ static void mkcatdirs (const char *mandi
@@ -422,9 +422,14 @@ static void mkcatdirs (const char *mandi
int j;
regain_effective_privs ();
debug ("creating catdir hierarchy %s ", catdir);
- for (j = 1; j <= 9; j++) {
- catname[strlen (catname) - 1] = '0' + j;
- manname[strlen (manname) - 1] = '0' + j;
+ for (j = 0; j <= 10; j++) {
+ for (j = 1; j <= 10; j++) {
+ unsigned int c;
+ if (j < 10)
+ c = '0' + j;
@ -256,24 +225,17 @@
+ manname[strlen (manname) - 1] = c;
if ((is_directory (manname) == 1)
&& (is_directory (catname) != 1)) {
if (mkdir (catname,
@@ -410,11 +420,12 @@ static void mkcatdirs (const char *mandi
if (mkdir (catname, 0755) < 0) {
@@ -432,7 +437,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%d", c);
#ifdef SECURE_MAN_UID
if (ruid == 0)
- chown (catname,
- man_owner->pw_uid, 0);
+ chown (catname, man_owner->pw_uid, 0);
+ if (rgid == 0)
+ chown (catname, -1, man_owner->pw_gid);
#endif /* SECURE_MAN_UID */
+ debug (" cat%c", c);
chown_if_possible (catname);
}
}
@@ -523,15 +534,10 @@ static int testmandirs (const char *path
@@ -579,15 +584,10 @@ static int testmandirs (const char *path
}
if (!quiet) {
@ -288,18 +250,18 @@
- fprintf (stderr, "\n");
+ fprintf (stderr, "\n");
}
add_dir_entries (path, mandir->d_name);
add_dir_entries (dbf, path, mandir->d_name);
MYDBM_CLOSE (dbf);
@@ -651,7 +657,7 @@ int update_db (const char *manpath, cons
return new;
@@ -694,7 +694,7 @@ int update_db (const char *manpath, cons
dbf = NULL;
}
- debug ("failed to open %s O_RDONLY\n", database);
+ debug ("failed to open database %s O_RDONLY\n", database);
return EOF;
}
@@ -843,6 +849,7 @@ static int purge_whatis (const char *pat
if (!dbf) {
- debug ("failed to open %s O_RDONLY\n", database);
+ debug ("failed to open database %s O_RDONLY\n", database);
return EOF;
}
mtime = MYDBM_GET_TIME (dbf);
@@ -897,6 +897,7 @@ static int purge_whatis (MYDBM_FILE dbf,
"would delete\n", name, info->ext);
return 1;
}
@ -307,23 +269,23 @@
}
/* Check that multi keys are correctly constructed. */
@@ -941,6 +948,14 @@ int purge_missing (const char *manpath,
@@ -994,6 +995,14 @@ int purge_missing (const char *manpath,
nextkey = MYDBM_NEXTKEY (dbf, key);
MYDBM_FREE_DPTR (key);
key = nextkey;
continue;
}
+
+ /* Ignore db identifier keys. */
+ if (*key.dptr == '.' && *(key.dptr+1) == 0) {
+ nextkey = MYDBM_NEXTKEY (dbf, key);
+ MYDBM_FREE (key.dptr);
+ key = nextkey;
+ continue;
+ }
+
+ /* Ignore db identifier keys. */
+ if (*MYDBM_DPTR (key) == '.' && *(key.dptr+1) == 0) {
+ nextkey = MYDBM_NEXTKEY (dbf, key);
+ MYDBM_FREE_DPTR (key);
+ key = nextkey;
continue;
}
content = MYDBM_FETCH (dbf, key);
if (!MYDBM_DPTR (content)) {
--- src/lexgrog.l
+++ src/lexgrog.l 2015-05-28 11:06:00.000000000 +0000
+++ src/lexgrog.l 2016-12-16 08:41:31.954958312 +0000
@@ -54,7 +54,7 @@
#include "manconv_client.h"
@ -627,7 +589,7 @@
if (p_lg->type)
BEGIN (CAT_FILE);
--- src/man.c
+++ src/man.c 2015-05-28 12:30:03.846019151 +0000
+++ src/man.c 2016-12-16 08:41:31.954958312 +0000
@@ -68,6 +68,7 @@ int have_cwd;
#include <time.h>
#include <sys/types.h>
@ -656,7 +618,7 @@
#if defined _AIX || defined __sgi
char **global_argv;
@@ -245,10 +252,10 @@ static int found_a_stray; /* found a st
@@ -244,10 +251,10 @@ static int found_a_stray; /* found a st
#ifdef MAN_CATS
static char *tmp_cat_file; /* for open_cat_stream(), close_cat_stream() */
static int created_tmp_cat; /* dto. */
@ -668,8 +630,8 @@
# ifdef TROFF_IS_GROFF
static int ditroff;
@@ -613,25 +620,6 @@ static void gripe_no_name (const char *s
exit (FAIL);
@@ -654,25 +661,6 @@ static void check_standard_fds (void)
}
}
-static struct termios tms;
@ -694,7 +656,7 @@
#if defined(TROFF_IS_GROFF) || defined(HEIRLOOM_NROFF)
static int get_roff_line_length (void)
{
@@ -1454,6 +1442,18 @@ static void setenv_less (pipecmd *cmd, c
@@ -1498,6 +1486,18 @@ static void setenv_less (pipecmd *cmd, c
free (less_opts);
}
@ -713,16 +675,16 @@
static void add_output_iconv (pipeline *p,
const char *source, const char *target)
{
@@ -1513,6 +1513,8 @@ static pipeline *make_display_command (c
else
pipecmd_chdir (pager_cmd, cwd.name);
@@ -1613,6 +1613,8 @@ static pipeline *make_display_command (c
pipecmd_chdir (pager_cmd, cwd.name);
}
setenv_less (pager_cmd, title);
+ if (!htmlout)
+ disable_x();
pipeline_command (p, pager_cmd);
}
pipeline_ignore_signals (p, 1);
@@ -1523,7 +1525,7 @@ static pipeline *make_display_command (c
@@ -1623,7 +1625,7 @@ static pipeline *make_display_command (c
return p;
}
@ -731,7 +693,7 @@
/* return a (malloced) temporary name in cat_file's directory */
static char *tmp_cat_filename (const char *cat_file)
{
@@ -1551,7 +1553,6 @@ static char *tmp_cat_filename (const cha
@@ -1651,7 +1653,6 @@ static char *tmp_cat_filename (const cha
return name;
}
@ -739,7 +701,7 @@
/* If delete unlink tmp_cat, else commit tmp_cat to cat_file.
Return non-zero on error.
*/
@@ -1623,6 +1624,7 @@ static int commit_tmp_cat (const char *c
@@ -1724,6 +1725,7 @@ static int commit_tmp_cat (const char *c
return status;
}
@ -747,7 +709,7 @@
/* TODO: This should all be refactored after work on the decompression
* library is complete.
@@ -1643,7 +1645,6 @@ static void maybe_discard_stderr (pipeli
@@ -1744,7 +1746,6 @@ static void maybe_discard_stderr (pipeli
}
#ifdef MAN_CATS
@ -755,7 +717,7 @@
/* 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)
{
@@ -1880,6 +1881,7 @@ static void format_display (pipeline *de
@@ -1986,6 +1987,7 @@ static void format_display (pipeline *de
regain_effective_privs ();
}
@ -763,15 +725,15 @@
/* "Display" a page in catman mode, which amounts to saving it. */
/* TODO: merge with format_display_and_save? */
static void display_catman (const char *cat_file, pipeline *decomp,
@@ -1919,6 +1921,7 @@ static void display_catman (const char *
pop_cleanup();
@@ -2025,6 +2027,7 @@ static void display_catman (const char *
pop_cleanup ((cleanup_fun) unlink, tmpcat);
free (tmpcat);
}
+#endif /* MAN_CATS */
static void disable_hyphenation (void *data ATTRIBUTE_UNUSED)
{
@@ -2111,7 +2114,7 @@ static int display (const char *dir, con
@@ -2222,7 +2225,7 @@ static int display (const char *dir, con
format_cmd = NULL;
decomp_errno = errno;
}
@ -780,7 +742,7 @@
/* Get modification time, for commit_tmp_cat(). */
if (man_file && *man_file) {
struct stat stb;
@@ -2121,7 +2124,7 @@ static int display (const char *dir, con
@@ -2232,7 +2235,7 @@ static int display (const char *dir, con
} else
man_modtime = get_stat_mtime (&stb);
}
@ -789,7 +751,7 @@
display_to_stdout = troff;
#ifdef TROFF_IS_GROFF
if (htmlout)
@@ -2257,6 +2260,7 @@ static int display (const char *dir, con
@@ -2368,6 +2371,7 @@ static int display (const char *dir, con
}
if (printed)
putchar ('\n');
@ -797,7 +759,7 @@
} else if (catman) {
if (format) {
if (!save_cat)
@@ -2269,6 +2273,7 @@ static int display (const char *dir, con
@@ -2380,6 +2384,7 @@ static int display (const char *dir, con
format_cmd,
formatted_encoding);
}
@ -805,7 +767,7 @@
} else if (format) {
/* no cat or out of date */
pipeline *disp_cmd;
@@ -2330,8 +2335,10 @@ static int display (const char *dir, con
@@ -2441,8 +2446,10 @@ static int display (const char *dir, con
free (formatted_encoding);
@ -818,7 +780,7 @@
if (!prompt)
prompt = found;
@@ -3165,7 +3172,7 @@ static int display_database_check (struc
@@ -3277,7 +3284,7 @@ static int display_database_check (struc
#ifdef MAN_DB_UPDATES
if (!exists && !skip) {
debug ("dbdelete_wrapper (%s, %p)\n",
@ -827,7 +789,7 @@
dbdelete_wrapper (candp->req_name, candp->source);
}
#endif /* MAN_DB_UPDATES */
@@ -3768,6 +3775,8 @@ static int local_man_loop (const char *a
@@ -3882,6 +3889,8 @@ static int local_man_loop (const char *a
display (NULL, "", NULL, "(stdin)", NULL);
else {
struct stat st;
@ -836,7 +798,7 @@
if (have_cwd) {
debug ("restore_cwd: %d %s\n", cwd.desc, cwd.name);
@@ -3779,21 +3788,39 @@ static int local_man_loop (const char *a
@@ -3893,21 +3902,39 @@ static int local_man_loop (const char *a
return 0;
}
}
@ -877,7 +839,7 @@
return NOT_FOUND;
}
@@ -3860,8 +3887,13 @@ executable_out:
@@ -3974,8 +4001,13 @@ executable_out:
argv_abs = xstrdup (argv);
}
lang = lang_dir (argv_abs);
@ -892,7 +854,7 @@
if (local_mf)
error (0, errno, "%s", argv);
exit_status = NOT_FOUND;
@@ -3990,7 +4022,16 @@ int main (int argc, char *argv[])
@@ -4142,7 +4174,16 @@ int main (int argc, char *argv[])
umask (022);
init_locale ();
@ -910,7 +872,7 @@
/* Use LANGUAGE only when LC_MESSAGES locale category is
* neither "C" nor "POSIX". */
if (internal_locale && strcmp (internal_locale, "C") &&
@@ -4053,9 +4094,13 @@ int main (int argc, char *argv[])
@@ -4192,9 +4233,13 @@ int main (int argc, char *argv[])
if (external)
do_extern (argc, argv);
@ -926,7 +888,7 @@
/* close this locale and reinitialise if a new locale was
--- src/man_db.conf.in
+++ src/man_db.conf.in 2015-05-28 00:00:00.000000000 +0000
+++ src/man_db.conf.in 2016-12-16 08:41:31.954958312 +0000
@@ -20,6 +20,14 @@
MANDATORY_MANPATH /usr/man
MANDATORY_MANPATH /usr/share/man
@ -1095,8 +1057,8 @@
#---------------------------------------------------------
# Program definitions. These are commented out by default as the value
--- src/mandb.c
+++ src/mandb.c 2015-05-28 11:33:30.000000000 +0000
@@ -196,6 +196,8 @@ static const char *xtmpfile;
+++ src/mandb.c 2016-12-16 08:41:31.954958312 +0000
@@ -197,6 +197,8 @@ struct dbpaths {
#ifdef SECURE_MAN_UID
extern uid_t ruid;
extern uid_t euid;
@ -1105,7 +1067,7 @@
#endif /* SECURE_MAN_UID */
static char *manpathlist[MAXDIRS];
@@ -548,6 +550,8 @@ static int mandb (const char *catpath, c
@@ -552,6 +554,8 @@ static int mandb (struct dbpaths *dbpath
return amount;
}
@ -1114,25 +1076,25 @@
static int process_manpath (const char *manpath, int global_manpath,
struct hashtable *tried_catdirs)
{
@@ -594,6 +598,8 @@ static int process_manpath (const char *
@@ -599,6 +603,8 @@ static int process_manpath (const char *
database = NULL;
}
+ mkcatdirs (manpath, catpath);
+
push_cleanup (cleanup, NULL, 0);
push_cleanup (cleanup_sigsafe, NULL, 1);
if (run_mandb) {
@@ -608,7 +614,7 @@ static int process_manpath (const char *
if (!opt_test && amount) {
finish_up ();
dbpaths = XZALLOC (struct dbpaths);
push_cleanup (cleanup, dbpaths, 0);
push_cleanup (cleanup_sigsafe, dbpaths, 1);
@@ -614,7 +620,7 @@ static int process_manpath (const char *
if (!opt_test && amount)
finish_up (dbpaths);
#ifdef SECURE_MAN_UID
- if (global_manpath && euid == 0)
+ if (global_manpath && (euid == 0 || ruid == 0))
do_chown (man_owner->pw_uid);
- if (global_manpath)
+ if (global_manpath && (euid == 0 || ruid == 0))
do_chown (dbpaths);
#endif /* SECURE_MAN_UID */
}
@@ -819,8 +825,14 @@ int main (int argc, char *argv[])
@@ -824,8 +830,14 @@ int main (int argc, char *argv[])
error (FAIL, 0,
_("the setuid man user \"%s\" does not exist"),
MAN_OWNER);
@ -1150,7 +1112,7 @@
read_config_file (user);
--- src/manp.c
+++ src/manp.c 2015-05-28 00:00:00.000000000 +0000
+++ src/manp.c 2016-12-16 08:41:31.954958312 +0000
@@ -925,7 +925,7 @@ static char *def_path (int flag)
/* If we have complete config file failure... */
@ -1161,7 +1123,7 @@
return manpath;
}
--- src/straycats.c
+++ src/straycats.c 2015-05-28 11:36:07.000000000 +0000
+++ src/straycats.c 2016-12-16 08:41:31.954958312 +0000
@@ -36,6 +36,7 @@
#include <sys/types.h>
#include <sys/stat.h>
@ -1170,7 +1132,7 @@
#include <dirent.h>
#include "canonicalize.h"
@@ -283,17 +284,23 @@ static int check_for_stray (void)
@@ -284,17 +285,23 @@ static int check_for_stray (MYDBM_FILE d
if (lg.whatis)
free (lg.whatis);
@ -1201,8 +1163,8 @@
}
--- src/ult_src.c
+++ src/ult_src.c 2015-05-28 00:00:00.000000000 +0000
@@ -364,10 +364,15 @@ const char *ult_src (const char *name, c
+++ src/ult_src.c 2016-12-16 08:41:31.954958312 +0000
@@ -363,10 +363,15 @@ const char *ult_src (const char *name, c
}
pipeline_start (decomp);
@ -1221,7 +1183,7 @@
include = test_for_include (buffer);
if (include) {
--- src/ult_src.h
+++ src/ult_src.h 2015-05-28 00:00:00.000000000 +0000
+++ src/ult_src.h 2016-12-16 08:41:31.954958312 +0000
@@ -22,9 +22,10 @@
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

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

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

2
man-rpmlintrc Normal file
View File

@ -0,0 +1,2 @@
addFilter(".*W:.*patch-not-applied.*Patch1:.*man-db-2.6.3-man0.dif.*")
addFilter(".*W:.*tmpfile-not-in-filelist.*/var/cache/man.*")

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Fri Dec 16 09:37:34 UTC 2016 - werner@suse.de
- Update to version 2.7.6
* Many bug fixes
* man understands the <page>.<section> form on its command line,
so for example 'man chmod.2' is now the same as 'man 2 chmod'
(Contributed by Mihail Konev)
* Document that 'man -K' searches page source, not rendered text
- Rename patch man-db-2.7.1.dif which becomes man-db-2.7.6.dif
- Port the patches
man-MAN_POSIXLY_CORRECT-man1.dif
man-db-2.6.3-chinese.dif
man-db-2.6.3-listall.dif
man-db-2.6.3-section.dif
man-db-2.7.1-firefox.dif
man-db-2.7.1-security4.dif
man-db-2.7.1-zio.dif
- Add an rpmlintrc file man-rpmlintrc as we apply a patch
on generated manual pages
-------------------------------------------------------------------
Fri Jun 24 10:06:32 UTC 2016 - werner@suse.de

View File

@ -16,6 +16,8 @@
#
%bcond_with wrapman
Name: man
BuildRequires: automake
BuildRequires: flex
@ -31,7 +33,7 @@ BuildRequires: pkg-config
BuildRequires: po4a
BuildRequires: xz-devel
BuildRequires: zlib-devel
Version: 2.7.1
Version: 2.7.6
Release: 0
Summary: A Program for Displaying man Pages
License: GPL-2.0+
@ -39,7 +41,7 @@ Group: System/Base
Url: https://savannah.nongnu.org/projects/man-db
PreReq: coreutils fillup
Provides: man_db
Requires: cronie
Requires: cron
Requires: glibc-locale
%if 0%{suse_version} > 1300
Recommends: groff-full
@ -52,7 +54,8 @@ Source2: cron.daily.do_mandb
Source3: cron.daily.clean_catman
Source4: mancoding
Source5: wrapper.c
Patch0: man-db-2.7.1.dif
Source6: man-rpmlintrc
Patch0: man-db-2.7.6.dif
Patch1: man-db-2.6.3-man0.dif
Patch2: man-db-2.3.19deb4.0-groff.dif
Patch4: man-db-2.6.3-section.dif
@ -90,9 +93,9 @@ Authors:
%patch7 -p0 -b .chinese
%patch9 -p0 -b .zio
%patch10 -p0 -b .listall
%patch11 -p0 -b .p11
%patch12 -p1 -b .p12
%patch0 -p0 -b .0
%patch11 -p0
%patch12 -p1
%build
gettextize --force --copy --no-changelog
@ -139,7 +142,7 @@ Authors:
sed -ri -e '/^pkglibdir/{ s@^(pkglibdir[[:blank:]]+=[[:blank:]]+\$\(libdir\)).*@\1@p }'
%configure \
--enable-dups \
--enable-setuid=man \
--enable-cache-owner=man \
--with-device=utf8 \
--with-zio \
--with-gnu-ld \
@ -196,12 +199,14 @@ fi
# wrapper which drops roots privileges if root executes man or mandb
if test -x %{buildroot}%{_bindir}/mandb ; then
mv %{buildroot}%{_bindir}/mandb %{buildroot}%{_prefix}/lib/man-db/
install wrapper %{buildroot}%{_bindir}/mandb
fi
%if %{with wrapman}
if test -x %{buildroot}%{_bindir}/man ; then
mv %{buildroot}%{_bindir}/man %{buildroot}%{_prefix}/lib/man-db/
ln -sf mandb %{buildroot}%{_bindir}/man
fi
install wrapper %{buildroot}%{_bindir}/mandb
ln -sf mandb %{buildroot}%{_bindir}/man
%endif
mkdir -p %{buildroot}%{_mandir}
pushd %{buildroot}%{_mandir}/
rm -rf *.ascii/
@ -235,6 +240,9 @@ test -d var/catman/ && rm -rf var/catman/ || true
%post
%{?tmpfiles_create:%tmpfiles_create %{_libexecdir}/tmpfiles.d/man-db.conf}
%{fillup_only -an cron}
/sbin/ldconfig
%postun -p /sbin/ldconfig
%posttrans
mandb --quiet --create
@ -255,7 +263,9 @@ mandb --quiet --create
%{_bindir}/manpath
%{_bindir}/whatis
%dir %attr(0755,root,root) %{_libexecdir}/man-db
%if %{with wrapman}
%attr(0755,root,root) %{_libexecdir}/man-db/man
%endif
%attr(0755,root,root) %{_libexecdir}/man-db/mandb
%attr(0755,man,man) %{_libexecdir}/man-db/manconv
%attr(0755,man,man) %{_libexecdir}/man-db/globbing
@ -273,8 +283,8 @@ mandb --quiet --create
%doc %{_mandir}/man5/*.5.gz
%doc %{_mandir}/man8/*.8.gz
%dir %{_mandir}/id
%defattr(-,man,root)
%ghost %{_localstatedir}/cache/man/*
%{_localstatedir}/adm/fillup-templates/sysconfig.cron-man
%defattr(-,man,man)
%ghost %{_localstatedir}/cache/man/*
%changelog