Source code pulled from OpenBSD for OpenNTPD. The place to contribute to this code is via the OpenBSD CVS tree.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

40 lines
1004 B

#!/usr/bin/awk -f
#
# Generates a login.conf file from login.conf.in and an optional
# file containing overrides.
#
# Usage: mklogin.conf [overrides_file] < login.conf.in > login.conf.out
#
# $OpenBSD: mklogin.conf,v 1.7 2012/06/20 18:32:04 deraadt Exp $
BEGIN {
# Default substitutions
values["DEF_DATASIZE_MAX"]="512M"
values["DEF_DATASIZE_CUR"]="512M"
values["DEF_MAXPROC_MAX"]="256"
values["DEF_MAXPROC_CUR"]="128"
values["DEF_OPENFILES_CUR"]="512"
values["STAFF_DATASIZE_MAX"]="infinity"
values["STAFF_DATASIZE_CUR"]="512M"
values["STAFF_MAXPROC_MAX"]="512"
values["STAFF_MAXPROC_CUR"]="128"
values["STAFF_OPENFILES_CUR"]="512"
values["DEF_BLOWFISH_RNDS"]="6"
values["ROOT_BLOWFISH_RNDS"]="8"
# Optional overrides
if (ARGC > 1) {
while (getline override < ARGV[1]) {
split(override, ov)
values[ov[1] ""]=ov[2] ""
}
ARGC--
}
}
# Read in login.conf template, do substitutions and output the result
{
for (key in values)
gsub("@" key "@", values[key], $0)
print $0
}