mirror of
https://github.com/opnsense/src.git
synced 2026-04-24 07:37:25 -04:00
The catpaging and setuidness features of man(1) combined make it vulnerable to a number of security attacks. Specifically, it was possible to overwrite system catpages with arbitrarily contents by either setting up a symlink to a directory holding system catpages, or by writing custom -mdoc or -man groff(1) macro packages and setting up GROFF_TMAC_PATH in environment to point to them. (See PR below for details). This means man(1) can no longer create system catpages on a regular user's behalf. (It is still able to if the user has write permissions to the directory holding catpages, e.g., user's own manpages, or if the running user is ``root''.) To create and install catpages during ``make world'', please set MANBUILDCAT=YES in /etc/make.conf. To rebuild catpages on a weekly basis, please set weekly_catman_enable="YES" in /etc/periodic.conf. PR: bin/32791
33 lines
728 B
Makefile
33 lines
728 B
Makefile
# $FreeBSD$
|
|
#
|
|
|
|
MAN_LIBZ=YES
|
|
|
|
PROG= man
|
|
SRCS= man.c manpath.c glob.c
|
|
|
|
CFLAGS+= -I${LIBDESTDIR}
|
|
DPADD= ${LIBMAN}
|
|
LDADD= ${LIBMAN}
|
|
|
|
.if defined(MAN_LIBZ) && !empty(MAN_LIBZ)
|
|
DPADD+= ${LIBZ}
|
|
LDADD+= -lz
|
|
CFLAGS+=-DHAVE_LIBZ=1
|
|
.endif
|
|
|
|
CFLAGS+= -I${.CURDIR}/../lib -DSTDC_HEADERS -DPOSIX -DHAS_TROFF
|
|
CFLAGS+= -DDO_COMPRESS -DCATMODE=0644
|
|
CLEANFILES+= man.1
|
|
|
|
.PATH: ${.CURDIR}/../manpath
|
|
|
|
man.1: ${.CURDIR}/man.man
|
|
@${ECHO} echo Making ${.TARGET:T} from ${.ALLSRC:T}; \
|
|
sed -e 's,%libdir%,${libdir},' -e 's,%bindir%,${bindir},' \
|
|
-e 's,%pager%,${pager},' -e 's,%troff%,${troff},' \
|
|
-e 's,%manpath_config_file%,${manpath_config_file},' \
|
|
-e 's,%compress%,${compress},' \
|
|
${.ALLSRC} > ${.TARGET}
|
|
|
|
.include <bsd.prog.mk>
|