Add a new make.conf knob, SENDMAIL_MAP_PERMS, which specifies the

permissions to use for alias and map database files built by
/etc/mail/Makefile.  The default is 0640 to assist users in avoiding
a file locking local denial of service.

MFC after:	1 day
		pending RE approval
This commit is contained in:
Gregory Neil Shapiro 2002-05-24 01:46:39 +00:00
parent 519c4f1816
commit 34925ba6f7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97200
3 changed files with 16 additions and 0 deletions

View File

@ -101,6 +101,9 @@ SENDMAIL?= /usr/sbin/sendmail
MAKEMAP?= /usr/sbin/makemap MAKEMAP?= /usr/sbin/makemap
M4?= /usr/bin/m4 M4?= /usr/bin/m4
# Permissions for generated maps
SENDMAIL_MAP_PERMS?= 0640
# Set a reasonable default # Set a reasonable default
.MAIN: all .MAIN: all
@ -134,10 +137,12 @@ ${_f}: ${_f}.sample
${_f}.db: ${_f} ${_f}.db: ${_f}
${MAKEMAP} ${SENDMAIL_MAP_TYPE} ${.TARGET} < ${.OODATE} ${MAKEMAP} ${SENDMAIL_MAP_TYPE} ${.TARGET} < ${.OODATE}
chmod ${SENDMAIL_MAP_PERMS} ${.TARGET}
.endfor .endfor
userdb.db: userdb userdb.db: userdb
${MAKEMAP} btree ${.TARGET} < ${.OODATE} ${MAKEMAP} btree ${.TARGET} < ${.OODATE}
chmod ${SENDMAIL_MAP_PERMS} ${.TARGET}
# #
@ -160,6 +165,7 @@ M4FILES!= find ${SENDMAIL_CF_DIR} -type f -name '*.m4' -print
# #
${SENDMAIL_ALIASES}.db: ${SENDMAIL_ALIASES} ${SENDMAIL_ALIASES}.db: ${SENDMAIL_ALIASES}
${SENDMAIL} -bi ${SENDMAIL} -bi
chmod ${SENDMAIL_MAP_PERMS} ${.TARGET}
# #
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------

View File

@ -301,3 +301,8 @@
# information. # information.
# #
#SENDMAIL_SET_USER_ID= #SENDMAIL_SET_USER_ID=
#
# The permissions to use on alias and map databases generated using
# /etc/mail/Makefile. Defaults to 0640.
#
#SENDMAIL_MAP_PERMS=

View File

@ -567,6 +567,11 @@ and do not install
Use of this flag is not recommended and the alternative advice in Use of this flag is not recommended and the alternative advice in
.Pa /etc/mail/README .Pa /etc/mail/README
should be followed instead if at all possible. should be followed instead if at all possible.
.It Va SENDMAIL_MAP_PERMS
.Pq Vt str
Mode to use when generating alias and map database files using
.Pa /etc/mail/Makefile .
The default value is 0640.
.It Va WANT_FORCE_OPTIMIZATION_DOWNGRADE .It Va WANT_FORCE_OPTIMIZATION_DOWNGRADE
.Pq Vt int .Pq Vt int
Causes the system compiler to be built such that it forces high optimization Causes the system compiler to be built such that it forces high optimization