freebsd-src/gnu/usr.sbin/ypserv/Makefile.yp

360 lines
11 KiB
Makefile
Raw Normal View History

#
# Makefile for the NIS databases
#
# $Id: Makefile.yp,v 1.9 1995/07/19 17:44:05 wpaul Exp $
#
# This Makefile should only be run on the NIS master server of a domain.
# All updated maps will be pushed to all NIS slave servers listed in the
# /var/yp/ypservers file. Please make sure that the hostnames of all
# NIS servers in your domain are listed in /var/yp/ypservers.
#
# This Makefile can be modified to support more NIS maps if desired.
#
# If this machine is an NIS master, comment out this next line so
# that changes to the NIS maps can be propagated to the slave servers.
# (By default we assume that we are only serving a small domain with
# only one server.)
#
NOPUSH = "True"
# If you want to use a FreeBSD NIS server to serve non-FreeBSD clients
# (i.e. clients who expect the password field in the passwd maps to be
# valid) then uncomment this line. This will cause $YPDIR/passwd to
# be generated with valid password fields. This is insecure: FreeBSD
# normally only serves the master.passwd maps (which have real encrypted
# passwords in them) to the superuser on other FreeBSD machines, but
# non-FreeBSD clients (e.g. SunOS, Solaris (without NIS+), IRIX, HP-UX,
# etc...) will only work properly in 'unsecure' mode.
#
#UNSECURE = "True"
# These are commands which this Makefile needs to properly rebuild the
# NIS databases. Don't change these unless you have a good reason. Also
# be sure not to place an @ in front of /usr/bin/awk: it isn't necessary
# and it'll break everything in sight.
#
AWK = /usr/bin/awk
RM = @/bin/rm -f
RCAT = /bin/cat
CAT = @$(RCAT)
DBLOAD = /usr/sbin/yp_mkdb -m `hostname`
MKNETID = /usr/libexec/mknetid
YPPUSH = /usr/bin/yppush
DOMAIN = `/bin/domainname`
YPSRCDIR = /etc
YPDIR = /var/yp
YPMAPDIR = $(YPDIR)/$(DOMAIN)
# These are the files from which the NIS databases are built. You may edit
# these to taste in the event that you wish to keep your NIS source files
# seperate from your NIS server's actual configuration files. Note that the
# NIS passwd and master.passwd files are stored in /var/yp: the server's
# real password database is not used by default. However, you may use
# the real /etc/passwd and /etc/master.passwd files by:
#
Updates, fixes and cleanups -- oh my. In ypserv: yp_svc.c: - small signal handler tweak (hopefully the last): just use sigemptyset() to clear sa_mask. Makefile.yp: - Let the user specify the location of master.passwd when updating maps (e.g. make MASTER_PASSWD=/some/path/to/master.passwd). Editing the file to change the location of master.passwd still works. This is mostly to let yppassswdd specify the name of the master.passwd file itself. In yppasswdd: yppasswdd.c: - Roll in some minor changes (mostly casts) from Olaf Kirch's latest yppasswd package release (version 0.7). - Use daemon() instead of doing all the deamonizing gruntwork ourselves. - Call pw_init() after daemonizing ourselves. pw_init() sets up some resource limits and blocks some signals for us. We used to do this before every password change, but there's really no point in calling it more than once during the life of the program. - Change install_reaper() so that we can use it to de-install the SIGCHLD handler if we need to (and we do in pw_mkdb() -- this is what I get for splicing code from two different programs together). - Use sigemptyset(&act.sa_mask) rather than act.sa_mask = 0: the latter is decidedly non-portable. (In IRIX, HP-UX and Solaris, sigset_t is an array of longs, not an int.) update.c: - Roll in change from new version (check that we're not modifying an NIS entry in validate_args()). - Get rid of call to pw_init() (moved to yppasswdd.c). - Check return values from pw_util routines and return error status to yppasswd clients if there's a problem. - Straighten out password file copying mechanism a little. Keep a grip on the original password file rather than summarily overwriting it so that we can restore everything if we fail to fork() a process to update the NIS maps. - Pass the name of the password template file (specified with -m or /etc/master.passwd by default) to the yppwupdate script, which in turn should now pass it to /var/yp/Makefile. pw_util.c: - Nuke the pw_edit() and pw_prompt() functions -- we don't need them. - Change all warn()s, warnx()s and err()s to syslog()s. - Make sure we return error status to caller rather than bailing out in pw_lock() and pw_tmp(). - Don't block SIGTERM in pw_init() (by ignoring SIGTERM, we prevent yppasswdd from being shut down cleanly). - Don't let pw_error() exit. (This stuff was stolen from chpass and vipw which are interactive programs; it's okay to let pw_error() bail out for these programs, but not in a daemon like yppasswdd). - Fix signal handling in pw_mkdb (we need to temporarily de-install the SIGCHLD handler so that we can wait on the pwd_mkdb child ourselves). pw_copy.c: - Change all warn()s, warnx()s and err()s to syslog()s. - Add a bunch of returns() and make pw_copy() return and int ( 0 on success, -1 on failure) so that update.c can flag errors properly. - Return -1 after calling pw_error() to signal failures rather than relying on pw_error() to bail out. - Abort copying if we discover that we've been asked to change an entry for a user that exists in the NIS passwd maps but not in the master.passwd template file. This can happen if the passwd maps and the template file fall out of sync with each other (or if somebody tries to spoof us). The old behavior was to create add the entry to the password file, which yppasswdd should not do under any circumstances. Makefile: - update VERSION to 0.7 yppasswdd.8: - fix typo (forgot a carriage return somewhere) - remove bogus reference to pwunconv(8) which FreeBSD doesn't have. - bump version from 0.5 to 0.7 - Reflect changes in password file handling. yppwupdate: - Log map rebuilds to /var/yp/ypupdate.log. - Pass the name of the template password file to /var/yp/Makefile as $MASTER_PASSWD.
1995-07-19 17:44:41 +00:00
#
1995-02-04 00:13:21 +00:00
# - invoking yppasswdd without the -m option (yppasswdd will use
# /etc/master.passwd if no alternate master.passwd file is specified
# and do a 'pwd_mkdb' as needed).
Updates, fixes and cleanups -- oh my. In ypserv: yp_svc.c: - small signal handler tweak (hopefully the last): just use sigemptyset() to clear sa_mask. Makefile.yp: - Let the user specify the location of master.passwd when updating maps (e.g. make MASTER_PASSWD=/some/path/to/master.passwd). Editing the file to change the location of master.passwd still works. This is mostly to let yppassswdd specify the name of the master.passwd file itself. In yppasswdd: yppasswdd.c: - Roll in some minor changes (mostly casts) from Olaf Kirch's latest yppasswd package release (version 0.7). - Use daemon() instead of doing all the deamonizing gruntwork ourselves. - Call pw_init() after daemonizing ourselves. pw_init() sets up some resource limits and blocks some signals for us. We used to do this before every password change, but there's really no point in calling it more than once during the life of the program. - Change install_reaper() so that we can use it to de-install the SIGCHLD handler if we need to (and we do in pw_mkdb() -- this is what I get for splicing code from two different programs together). - Use sigemptyset(&act.sa_mask) rather than act.sa_mask = 0: the latter is decidedly non-portable. (In IRIX, HP-UX and Solaris, sigset_t is an array of longs, not an int.) update.c: - Roll in change from new version (check that we're not modifying an NIS entry in validate_args()). - Get rid of call to pw_init() (moved to yppasswdd.c). - Check return values from pw_util routines and return error status to yppasswd clients if there's a problem. - Straighten out password file copying mechanism a little. Keep a grip on the original password file rather than summarily overwriting it so that we can restore everything if we fail to fork() a process to update the NIS maps. - Pass the name of the password template file (specified with -m or /etc/master.passwd by default) to the yppwupdate script, which in turn should now pass it to /var/yp/Makefile. pw_util.c: - Nuke the pw_edit() and pw_prompt() functions -- we don't need them. - Change all warn()s, warnx()s and err()s to syslog()s. - Make sure we return error status to caller rather than bailing out in pw_lock() and pw_tmp(). - Don't block SIGTERM in pw_init() (by ignoring SIGTERM, we prevent yppasswdd from being shut down cleanly). - Don't let pw_error() exit. (This stuff was stolen from chpass and vipw which are interactive programs; it's okay to let pw_error() bail out for these programs, but not in a daemon like yppasswdd). - Fix signal handling in pw_mkdb (we need to temporarily de-install the SIGCHLD handler so that we can wait on the pwd_mkdb child ourselves). pw_copy.c: - Change all warn()s, warnx()s and err()s to syslog()s. - Add a bunch of returns() and make pw_copy() return and int ( 0 on success, -1 on failure) so that update.c can flag errors properly. - Return -1 after calling pw_error() to signal failures rather than relying on pw_error() to bail out. - Abort copying if we discover that we've been asked to change an entry for a user that exists in the NIS passwd maps but not in the master.passwd template file. This can happen if the passwd maps and the template file fall out of sync with each other (or if somebody tries to spoof us). The old behavior was to create add the entry to the password file, which yppasswdd should not do under any circumstances. Makefile: - update VERSION to 0.7 yppasswdd.8: - fix typo (forgot a carriage return somewhere) - remove bogus reference to pwunconv(8) which FreeBSD doesn't have. - bump version from 0.5 to 0.7 - Reflect changes in password file handling. yppwupdate: - Log map rebuilds to /var/yp/ypupdate.log. - Pass the name of the template password file to /var/yp/Makefile as $MASTER_PASSWD.
1995-07-19 17:44:41 +00:00
# - Specifying the location of the master.passwd file using the
# MASTER_PASSWD variable, i.e.:
#
# # make MASTER_PASSWD=/path/to/some/other/master.passwd
#
# - (optionally): editing this Makefile to change the default location.
#
# To add a user, edit $(YPDIR)/master.passwd and type 'make'. The raw
# passwd file will be generated from the master.passwd file automagically.
#
ETHERS = $(YPSRCDIR)/ethers # ethernet addresses (for rarpd)
BOOTPARAMS= $(YPSRCDIR)/bootparams # for booting Sun boxes (bootparamd)
HOSTS = $(YPSRCDIR)/hosts
NETWORKS = $(YPSRCDIR)/networks
PROTOCOLS = $(YPSRCDIR)/protocols
RPC = $(YPSRCDIR)/rpc
SERVICES = $(YPSRCDIR)/services
GROUP = $(YPSRCDIR)/group
NETGROUP = $(YPSRCDIR)/netgroup
PASSWD = $(YPDIR)/passwd
Updates, fixes and cleanups -- oh my. In ypserv: yp_svc.c: - small signal handler tweak (hopefully the last): just use sigemptyset() to clear sa_mask. Makefile.yp: - Let the user specify the location of master.passwd when updating maps (e.g. make MASTER_PASSWD=/some/path/to/master.passwd). Editing the file to change the location of master.passwd still works. This is mostly to let yppassswdd specify the name of the master.passwd file itself. In yppasswdd: yppasswdd.c: - Roll in some minor changes (mostly casts) from Olaf Kirch's latest yppasswd package release (version 0.7). - Use daemon() instead of doing all the deamonizing gruntwork ourselves. - Call pw_init() after daemonizing ourselves. pw_init() sets up some resource limits and blocks some signals for us. We used to do this before every password change, but there's really no point in calling it more than once during the life of the program. - Change install_reaper() so that we can use it to de-install the SIGCHLD handler if we need to (and we do in pw_mkdb() -- this is what I get for splicing code from two different programs together). - Use sigemptyset(&act.sa_mask) rather than act.sa_mask = 0: the latter is decidedly non-portable. (In IRIX, HP-UX and Solaris, sigset_t is an array of longs, not an int.) update.c: - Roll in change from new version (check that we're not modifying an NIS entry in validate_args()). - Get rid of call to pw_init() (moved to yppasswdd.c). - Check return values from pw_util routines and return error status to yppasswd clients if there's a problem. - Straighten out password file copying mechanism a little. Keep a grip on the original password file rather than summarily overwriting it so that we can restore everything if we fail to fork() a process to update the NIS maps. - Pass the name of the password template file (specified with -m or /etc/master.passwd by default) to the yppwupdate script, which in turn should now pass it to /var/yp/Makefile. pw_util.c: - Nuke the pw_edit() and pw_prompt() functions -- we don't need them. - Change all warn()s, warnx()s and err()s to syslog()s. - Make sure we return error status to caller rather than bailing out in pw_lock() and pw_tmp(). - Don't block SIGTERM in pw_init() (by ignoring SIGTERM, we prevent yppasswdd from being shut down cleanly). - Don't let pw_error() exit. (This stuff was stolen from chpass and vipw which are interactive programs; it's okay to let pw_error() bail out for these programs, but not in a daemon like yppasswdd). - Fix signal handling in pw_mkdb (we need to temporarily de-install the SIGCHLD handler so that we can wait on the pwd_mkdb child ourselves). pw_copy.c: - Change all warn()s, warnx()s and err()s to syslog()s. - Add a bunch of returns() and make pw_copy() return and int ( 0 on success, -1 on failure) so that update.c can flag errors properly. - Return -1 after calling pw_error() to signal failures rather than relying on pw_error() to bail out. - Abort copying if we discover that we've been asked to change an entry for a user that exists in the NIS passwd maps but not in the master.passwd template file. This can happen if the passwd maps and the template file fall out of sync with each other (or if somebody tries to spoof us). The old behavior was to create add the entry to the password file, which yppasswdd should not do under any circumstances. Makefile: - update VERSION to 0.7 yppasswdd.8: - fix typo (forgot a carriage return somewhere) - remove bogus reference to pwunconv(8) which FreeBSD doesn't have. - bump version from 0.5 to 0.7 - Reflect changes in password file handling. yppwupdate: - Log map rebuilds to /var/yp/ypupdate.log. - Pass the name of the template password file to /var/yp/Makefile as $MASTER_PASSWD.
1995-07-19 17:44:41 +00:00
.if !defined(MASTER_PASSWD)
MASTER = $(YPDIR)/master.passwd
Updates, fixes and cleanups -- oh my. In ypserv: yp_svc.c: - small signal handler tweak (hopefully the last): just use sigemptyset() to clear sa_mask. Makefile.yp: - Let the user specify the location of master.passwd when updating maps (e.g. make MASTER_PASSWD=/some/path/to/master.passwd). Editing the file to change the location of master.passwd still works. This is mostly to let yppassswdd specify the name of the master.passwd file itself. In yppasswdd: yppasswdd.c: - Roll in some minor changes (mostly casts) from Olaf Kirch's latest yppasswd package release (version 0.7). - Use daemon() instead of doing all the deamonizing gruntwork ourselves. - Call pw_init() after daemonizing ourselves. pw_init() sets up some resource limits and blocks some signals for us. We used to do this before every password change, but there's really no point in calling it more than once during the life of the program. - Change install_reaper() so that we can use it to de-install the SIGCHLD handler if we need to (and we do in pw_mkdb() -- this is what I get for splicing code from two different programs together). - Use sigemptyset(&act.sa_mask) rather than act.sa_mask = 0: the latter is decidedly non-portable. (In IRIX, HP-UX and Solaris, sigset_t is an array of longs, not an int.) update.c: - Roll in change from new version (check that we're not modifying an NIS entry in validate_args()). - Get rid of call to pw_init() (moved to yppasswdd.c). - Check return values from pw_util routines and return error status to yppasswd clients if there's a problem. - Straighten out password file copying mechanism a little. Keep a grip on the original password file rather than summarily overwriting it so that we can restore everything if we fail to fork() a process to update the NIS maps. - Pass the name of the password template file (specified with -m or /etc/master.passwd by default) to the yppwupdate script, which in turn should now pass it to /var/yp/Makefile. pw_util.c: - Nuke the pw_edit() and pw_prompt() functions -- we don't need them. - Change all warn()s, warnx()s and err()s to syslog()s. - Make sure we return error status to caller rather than bailing out in pw_lock() and pw_tmp(). - Don't block SIGTERM in pw_init() (by ignoring SIGTERM, we prevent yppasswdd from being shut down cleanly). - Don't let pw_error() exit. (This stuff was stolen from chpass and vipw which are interactive programs; it's okay to let pw_error() bail out for these programs, but not in a daemon like yppasswdd). - Fix signal handling in pw_mkdb (we need to temporarily de-install the SIGCHLD handler so that we can wait on the pwd_mkdb child ourselves). pw_copy.c: - Change all warn()s, warnx()s and err()s to syslog()s. - Add a bunch of returns() and make pw_copy() return and int ( 0 on success, -1 on failure) so that update.c can flag errors properly. - Return -1 after calling pw_error() to signal failures rather than relying on pw_error() to bail out. - Abort copying if we discover that we've been asked to change an entry for a user that exists in the NIS passwd maps but not in the master.passwd template file. This can happen if the passwd maps and the template file fall out of sync with each other (or if somebody tries to spoof us). The old behavior was to create add the entry to the password file, which yppasswdd should not do under any circumstances. Makefile: - update VERSION to 0.7 yppasswdd.8: - fix typo (forgot a carriage return somewhere) - remove bogus reference to pwunconv(8) which FreeBSD doesn't have. - bump version from 0.5 to 0.7 - Reflect changes in password file handling. yppwupdate: - Log map rebuilds to /var/yp/ypupdate.log. - Pass the name of the template password file to /var/yp/Makefile as $MASTER_PASSWD.
1995-07-19 17:44:41 +00:00
.else
MASTER = $(MASTER_PASSWD)
.endif
YPSERVERS = $(YPDIR)/ypservers # List of all NIS servers for a domain
Updates, fixes and cleanups -- oh my. In ypserv: yp_svc.c: - small signal handler tweak (hopefully the last): just use sigemptyset() to clear sa_mask. Makefile.yp: - Let the user specify the location of master.passwd when updating maps (e.g. make MASTER_PASSWD=/some/path/to/master.passwd). Editing the file to change the location of master.passwd still works. This is mostly to let yppassswdd specify the name of the master.passwd file itself. In yppasswdd: yppasswdd.c: - Roll in some minor changes (mostly casts) from Olaf Kirch's latest yppasswd package release (version 0.7). - Use daemon() instead of doing all the deamonizing gruntwork ourselves. - Call pw_init() after daemonizing ourselves. pw_init() sets up some resource limits and blocks some signals for us. We used to do this before every password change, but there's really no point in calling it more than once during the life of the program. - Change install_reaper() so that we can use it to de-install the SIGCHLD handler if we need to (and we do in pw_mkdb() -- this is what I get for splicing code from two different programs together). - Use sigemptyset(&act.sa_mask) rather than act.sa_mask = 0: the latter is decidedly non-portable. (In IRIX, HP-UX and Solaris, sigset_t is an array of longs, not an int.) update.c: - Roll in change from new version (check that we're not modifying an NIS entry in validate_args()). - Get rid of call to pw_init() (moved to yppasswdd.c). - Check return values from pw_util routines and return error status to yppasswd clients if there's a problem. - Straighten out password file copying mechanism a little. Keep a grip on the original password file rather than summarily overwriting it so that we can restore everything if we fail to fork() a process to update the NIS maps. - Pass the name of the password template file (specified with -m or /etc/master.passwd by default) to the yppwupdate script, which in turn should now pass it to /var/yp/Makefile. pw_util.c: - Nuke the pw_edit() and pw_prompt() functions -- we don't need them. - Change all warn()s, warnx()s and err()s to syslog()s. - Make sure we return error status to caller rather than bailing out in pw_lock() and pw_tmp(). - Don't block SIGTERM in pw_init() (by ignoring SIGTERM, we prevent yppasswdd from being shut down cleanly). - Don't let pw_error() exit. (This stuff was stolen from chpass and vipw which are interactive programs; it's okay to let pw_error() bail out for these programs, but not in a daemon like yppasswdd). - Fix signal handling in pw_mkdb (we need to temporarily de-install the SIGCHLD handler so that we can wait on the pwd_mkdb child ourselves). pw_copy.c: - Change all warn()s, warnx()s and err()s to syslog()s. - Add a bunch of returns() and make pw_copy() return and int ( 0 on success, -1 on failure) so that update.c can flag errors properly. - Return -1 after calling pw_error() to signal failures rather than relying on pw_error() to bail out. - Abort copying if we discover that we've been asked to change an entry for a user that exists in the NIS passwd maps but not in the master.passwd template file. This can happen if the passwd maps and the template file fall out of sync with each other (or if somebody tries to spoof us). The old behavior was to create add the entry to the password file, which yppasswdd should not do under any circumstances. Makefile: - update VERSION to 0.7 yppasswdd.8: - fix typo (forgot a carriage return somewhere) - remove bogus reference to pwunconv(8) which FreeBSD doesn't have. - bump version from 0.5 to 0.7 - Reflect changes in password file handling. yppwupdate: - Log map rebuilds to /var/yp/ypupdate.log. - Pass the name of the template password file to /var/yp/Makefile as $MASTER_PASSWD.
1995-07-19 17:44:41 +00:00
target:
@if [ ! -d $(DOMAIN) ]; then mkdir $(DOMAIN); fi; \
cd $(DOMAIN) ; echo "NIS Map update started on `date`" ; \
Updates, fixes and cleanups -- oh my. In ypserv: yp_svc.c: - small signal handler tweak (hopefully the last): just use sigemptyset() to clear sa_mask. Makefile.yp: - Let the user specify the location of master.passwd when updating maps (e.g. make MASTER_PASSWD=/some/path/to/master.passwd). Editing the file to change the location of master.passwd still works. This is mostly to let yppassswdd specify the name of the master.passwd file itself. In yppasswdd: yppasswdd.c: - Roll in some minor changes (mostly casts) from Olaf Kirch's latest yppasswd package release (version 0.7). - Use daemon() instead of doing all the deamonizing gruntwork ourselves. - Call pw_init() after daemonizing ourselves. pw_init() sets up some resource limits and blocks some signals for us. We used to do this before every password change, but there's really no point in calling it more than once during the life of the program. - Change install_reaper() so that we can use it to de-install the SIGCHLD handler if we need to (and we do in pw_mkdb() -- this is what I get for splicing code from two different programs together). - Use sigemptyset(&act.sa_mask) rather than act.sa_mask = 0: the latter is decidedly non-portable. (In IRIX, HP-UX and Solaris, sigset_t is an array of longs, not an int.) update.c: - Roll in change from new version (check that we're not modifying an NIS entry in validate_args()). - Get rid of call to pw_init() (moved to yppasswdd.c). - Check return values from pw_util routines and return error status to yppasswd clients if there's a problem. - Straighten out password file copying mechanism a little. Keep a grip on the original password file rather than summarily overwriting it so that we can restore everything if we fail to fork() a process to update the NIS maps. - Pass the name of the password template file (specified with -m or /etc/master.passwd by default) to the yppwupdate script, which in turn should now pass it to /var/yp/Makefile. pw_util.c: - Nuke the pw_edit() and pw_prompt() functions -- we don't need them. - Change all warn()s, warnx()s and err()s to syslog()s. - Make sure we return error status to caller rather than bailing out in pw_lock() and pw_tmp(). - Don't block SIGTERM in pw_init() (by ignoring SIGTERM, we prevent yppasswdd from being shut down cleanly). - Don't let pw_error() exit. (This stuff was stolen from chpass and vipw which are interactive programs; it's okay to let pw_error() bail out for these programs, but not in a daemon like yppasswdd). - Fix signal handling in pw_mkdb (we need to temporarily de-install the SIGCHLD handler so that we can wait on the pwd_mkdb child ourselves). pw_copy.c: - Change all warn()s, warnx()s and err()s to syslog()s. - Add a bunch of returns() and make pw_copy() return and int ( 0 on success, -1 on failure) so that update.c can flag errors properly. - Return -1 after calling pw_error() to signal failures rather than relying on pw_error() to bail out. - Abort copying if we discover that we've been asked to change an entry for a user that exists in the NIS passwd maps but not in the master.passwd template file. This can happen if the passwd maps and the template file fall out of sync with each other (or if somebody tries to spoof us). The old behavior was to create add the entry to the password file, which yppasswdd should not do under any circumstances. Makefile: - update VERSION to 0.7 yppasswdd.8: - fix typo (forgot a carriage return somewhere) - remove bogus reference to pwunconv(8) which FreeBSD doesn't have. - bump version from 0.5 to 0.7 - Reflect changes in password file handling. yppwupdate: - Log map rebuilds to /var/yp/ypupdate.log. - Pass the name of the template password file to /var/yp/Makefile as $MASTER_PASSWD.
1995-07-19 17:44:41 +00:00
make -f ../Makefile all; echo "NIS Map update completed."
# If you don't want some of these maps built, feel free to comment
# them out from this list.
1995-03-05 22:48:50 +00:00
# Note that we don't build the ethers or boorparams maps by default
# since /etc/ethers and /etc/bootparams are not likely to be present
# on all systems.
#
Updates, fixes and cleanups -- oh my. In ypserv: yp_svc.c: - small signal handler tweak (hopefully the last): just use sigemptyset() to clear sa_mask. Makefile.yp: - Let the user specify the location of master.passwd when updating maps (e.g. make MASTER_PASSWD=/some/path/to/master.passwd). Editing the file to change the location of master.passwd still works. This is mostly to let yppassswdd specify the name of the master.passwd file itself. In yppasswdd: yppasswdd.c: - Roll in some minor changes (mostly casts) from Olaf Kirch's latest yppasswd package release (version 0.7). - Use daemon() instead of doing all the deamonizing gruntwork ourselves. - Call pw_init() after daemonizing ourselves. pw_init() sets up some resource limits and blocks some signals for us. We used to do this before every password change, but there's really no point in calling it more than once during the life of the program. - Change install_reaper() so that we can use it to de-install the SIGCHLD handler if we need to (and we do in pw_mkdb() -- this is what I get for splicing code from two different programs together). - Use sigemptyset(&act.sa_mask) rather than act.sa_mask = 0: the latter is decidedly non-portable. (In IRIX, HP-UX and Solaris, sigset_t is an array of longs, not an int.) update.c: - Roll in change from new version (check that we're not modifying an NIS entry in validate_args()). - Get rid of call to pw_init() (moved to yppasswdd.c). - Check return values from pw_util routines and return error status to yppasswd clients if there's a problem. - Straighten out password file copying mechanism a little. Keep a grip on the original password file rather than summarily overwriting it so that we can restore everything if we fail to fork() a process to update the NIS maps. - Pass the name of the password template file (specified with -m or /etc/master.passwd by default) to the yppwupdate script, which in turn should now pass it to /var/yp/Makefile. pw_util.c: - Nuke the pw_edit() and pw_prompt() functions -- we don't need them. - Change all warn()s, warnx()s and err()s to syslog()s. - Make sure we return error status to caller rather than bailing out in pw_lock() and pw_tmp(). - Don't block SIGTERM in pw_init() (by ignoring SIGTERM, we prevent yppasswdd from being shut down cleanly). - Don't let pw_error() exit. (This stuff was stolen from chpass and vipw which are interactive programs; it's okay to let pw_error() bail out for these programs, but not in a daemon like yppasswdd). - Fix signal handling in pw_mkdb (we need to temporarily de-install the SIGCHLD handler so that we can wait on the pwd_mkdb child ourselves). pw_copy.c: - Change all warn()s, warnx()s and err()s to syslog()s. - Add a bunch of returns() and make pw_copy() return and int ( 0 on success, -1 on failure) so that update.c can flag errors properly. - Return -1 after calling pw_error() to signal failures rather than relying on pw_error() to bail out. - Abort copying if we discover that we've been asked to change an entry for a user that exists in the NIS passwd maps but not in the master.passwd template file. This can happen if the passwd maps and the template file fall out of sync with each other (or if somebody tries to spoof us). The old behavior was to create add the entry to the password file, which yppasswdd should not do under any circumstances. Makefile: - update VERSION to 0.7 yppasswdd.8: - fix typo (forgot a carriage return somewhere) - remove bogus reference to pwunconv(8) which FreeBSD doesn't have. - bump version from 0.5 to 0.7 - Reflect changes in password file handling. yppwupdate: - Log map rebuilds to /var/yp/ypupdate.log. - Pass the name of the template password file to /var/yp/Makefile as $MASTER_PASSWD.
1995-07-19 17:44:41 +00:00
all: master.passwd passwd hosts group networks protocols \
rpc services servers netid # netgroup ethers bootparam
ethers: ethers.byname ethers.byaddr
1995-03-05 22:48:50 +00:00
bootparam: bootparams
hosts: hosts.byname hosts.byaddr
networks: networks.byaddr networks.byname
protocols: protocols.bynumber protocols.byname
rpc: rpc.byname rpc.bynumber
services: services.byname
passwd: passwd.byname passwd.byuid
group: group.byname group.bygid
netgrp: netgroup
netid: netid.byname
servers: ypservers
master.passwd: master.passwd.byname master.passwd.byuid
ypservers: $(YPSERVERS)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(YPSERVERS) | \
$(AWK) '{ if ($$1 != "" && $$1 != "#") print $$0"\t"$$0 }' $^ \
| $(DBLOAD) -i $(YPSERVERS) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
ethers.byname: $(ETHERS)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(ETHERS) | \
1995-03-05 22:48:50 +00:00
$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
print $$2"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \
-o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) -i $(ETHERS) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
ethers.byaddr: $(ETHERS)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(ETHERS) | \
1995-03-05 22:48:50 +00:00
$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
print $$1"\t"$$0 }' $^ | $(DBLOAD) -i $(ETHERS) \
-o $(YPMAPDIR)/$@ - $@
1995-03-05 22:48:50 +00:00
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
bootparams: $(BOOTPARAMS)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(BOOTPARAMS) | \
$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
print $$0 }' $^ | $(DBLOAD) -i $(BOOTPARAMS) \
-o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
netgroup: $(NETGROUP)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(NETGROUP) | \
$(AWK) '{ if ($$1 != "" && $$1 != "#" && $$1 != "+") \
print $$0 }' $^ | $(DBLOAD) -i $(NETGROUP) \
-o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
Updates, fixes and cleanups -- oh my. In ypserv: yp_svc.c: - small signal handler tweak (hopefully the last): just use sigemptyset() to clear sa_mask. Makefile.yp: - Let the user specify the location of master.passwd when updating maps (e.g. make MASTER_PASSWD=/some/path/to/master.passwd). Editing the file to change the location of master.passwd still works. This is mostly to let yppassswdd specify the name of the master.passwd file itself. In yppasswdd: yppasswdd.c: - Roll in some minor changes (mostly casts) from Olaf Kirch's latest yppasswd package release (version 0.7). - Use daemon() instead of doing all the deamonizing gruntwork ourselves. - Call pw_init() after daemonizing ourselves. pw_init() sets up some resource limits and blocks some signals for us. We used to do this before every password change, but there's really no point in calling it more than once during the life of the program. - Change install_reaper() so that we can use it to de-install the SIGCHLD handler if we need to (and we do in pw_mkdb() -- this is what I get for splicing code from two different programs together). - Use sigemptyset(&act.sa_mask) rather than act.sa_mask = 0: the latter is decidedly non-portable. (In IRIX, HP-UX and Solaris, sigset_t is an array of longs, not an int.) update.c: - Roll in change from new version (check that we're not modifying an NIS entry in validate_args()). - Get rid of call to pw_init() (moved to yppasswdd.c). - Check return values from pw_util routines and return error status to yppasswd clients if there's a problem. - Straighten out password file copying mechanism a little. Keep a grip on the original password file rather than summarily overwriting it so that we can restore everything if we fail to fork() a process to update the NIS maps. - Pass the name of the password template file (specified with -m or /etc/master.passwd by default) to the yppwupdate script, which in turn should now pass it to /var/yp/Makefile. pw_util.c: - Nuke the pw_edit() and pw_prompt() functions -- we don't need them. - Change all warn()s, warnx()s and err()s to syslog()s. - Make sure we return error status to caller rather than bailing out in pw_lock() and pw_tmp(). - Don't block SIGTERM in pw_init() (by ignoring SIGTERM, we prevent yppasswdd from being shut down cleanly). - Don't let pw_error() exit. (This stuff was stolen from chpass and vipw which are interactive programs; it's okay to let pw_error() bail out for these programs, but not in a daemon like yppasswdd). - Fix signal handling in pw_mkdb (we need to temporarily de-install the SIGCHLD handler so that we can wait on the pwd_mkdb child ourselves). pw_copy.c: - Change all warn()s, warnx()s and err()s to syslog()s. - Add a bunch of returns() and make pw_copy() return and int ( 0 on success, -1 on failure) so that update.c can flag errors properly. - Return -1 after calling pw_error() to signal failures rather than relying on pw_error() to bail out. - Abort copying if we discover that we've been asked to change an entry for a user that exists in the NIS passwd maps but not in the master.passwd template file. This can happen if the passwd maps and the template file fall out of sync with each other (or if somebody tries to spoof us). The old behavior was to create add the entry to the password file, which yppasswdd should not do under any circumstances. Makefile: - update VERSION to 0.7 yppasswdd.8: - fix typo (forgot a carriage return somewhere) - remove bogus reference to pwunconv(8) which FreeBSD doesn't have. - bump version from 0.5 to 0.7 - Reflect changes in password file handling. yppwupdate: - Log map rebuilds to /var/yp/ypupdate.log. - Pass the name of the template password file to /var/yp/Makefile as $MASTER_PASSWD.
1995-07-19 17:44:41 +00:00
@$(MAKE) -f ../Makefile netid
hosts.byname: $(HOSTS)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(HOSTS) | \
$(AWK) '/^[0-9]/ { for (n=2; n<=NF && $$n !~ "#"; n++) \
print $$n"\t"$$0 }' $^ | $(DBLOAD) -i $(HOSTS) \
-o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
Updates, fixes and cleanups -- oh my. In ypserv: yp_svc.c: - small signal handler tweak (hopefully the last): just use sigemptyset() to clear sa_mask. Makefile.yp: - Let the user specify the location of master.passwd when updating maps (e.g. make MASTER_PASSWD=/some/path/to/master.passwd). Editing the file to change the location of master.passwd still works. This is mostly to let yppassswdd specify the name of the master.passwd file itself. In yppasswdd: yppasswdd.c: - Roll in some minor changes (mostly casts) from Olaf Kirch's latest yppasswd package release (version 0.7). - Use daemon() instead of doing all the deamonizing gruntwork ourselves. - Call pw_init() after daemonizing ourselves. pw_init() sets up some resource limits and blocks some signals for us. We used to do this before every password change, but there's really no point in calling it more than once during the life of the program. - Change install_reaper() so that we can use it to de-install the SIGCHLD handler if we need to (and we do in pw_mkdb() -- this is what I get for splicing code from two different programs together). - Use sigemptyset(&act.sa_mask) rather than act.sa_mask = 0: the latter is decidedly non-portable. (In IRIX, HP-UX and Solaris, sigset_t is an array of longs, not an int.) update.c: - Roll in change from new version (check that we're not modifying an NIS entry in validate_args()). - Get rid of call to pw_init() (moved to yppasswdd.c). - Check return values from pw_util routines and return error status to yppasswd clients if there's a problem. - Straighten out password file copying mechanism a little. Keep a grip on the original password file rather than summarily overwriting it so that we can restore everything if we fail to fork() a process to update the NIS maps. - Pass the name of the password template file (specified with -m or /etc/master.passwd by default) to the yppwupdate script, which in turn should now pass it to /var/yp/Makefile. pw_util.c: - Nuke the pw_edit() and pw_prompt() functions -- we don't need them. - Change all warn()s, warnx()s and err()s to syslog()s. - Make sure we return error status to caller rather than bailing out in pw_lock() and pw_tmp(). - Don't block SIGTERM in pw_init() (by ignoring SIGTERM, we prevent yppasswdd from being shut down cleanly). - Don't let pw_error() exit. (This stuff was stolen from chpass and vipw which are interactive programs; it's okay to let pw_error() bail out for these programs, but not in a daemon like yppasswdd). - Fix signal handling in pw_mkdb (we need to temporarily de-install the SIGCHLD handler so that we can wait on the pwd_mkdb child ourselves). pw_copy.c: - Change all warn()s, warnx()s and err()s to syslog()s. - Add a bunch of returns() and make pw_copy() return and int ( 0 on success, -1 on failure) so that update.c can flag errors properly. - Return -1 after calling pw_error() to signal failures rather than relying on pw_error() to bail out. - Abort copying if we discover that we've been asked to change an entry for a user that exists in the NIS passwd maps but not in the master.passwd template file. This can happen if the passwd maps and the template file fall out of sync with each other (or if somebody tries to spoof us). The old behavior was to create add the entry to the password file, which yppasswdd should not do under any circumstances. Makefile: - update VERSION to 0.7 yppasswdd.8: - fix typo (forgot a carriage return somewhere) - remove bogus reference to pwunconv(8) which FreeBSD doesn't have. - bump version from 0.5 to 0.7 - Reflect changes in password file handling. yppwupdate: - Log map rebuilds to /var/yp/ypupdate.log. - Pass the name of the template password file to /var/yp/Makefile as $MASTER_PASSWD.
1995-07-19 17:44:41 +00:00
@$(MAKE) -f ../Makefile netid
hosts.byaddr: $(HOSTS)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(HOSTS) | \
$(AWK) '$$1 !~ "#" { print $$1"\t"$$0 }' $^ \
| $(DBLOAD) -i $(HOSTS) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
Updates, fixes and cleanups -- oh my. In ypserv: yp_svc.c: - small signal handler tweak (hopefully the last): just use sigemptyset() to clear sa_mask. Makefile.yp: - Let the user specify the location of master.passwd when updating maps (e.g. make MASTER_PASSWD=/some/path/to/master.passwd). Editing the file to change the location of master.passwd still works. This is mostly to let yppassswdd specify the name of the master.passwd file itself. In yppasswdd: yppasswdd.c: - Roll in some minor changes (mostly casts) from Olaf Kirch's latest yppasswd package release (version 0.7). - Use daemon() instead of doing all the deamonizing gruntwork ourselves. - Call pw_init() after daemonizing ourselves. pw_init() sets up some resource limits and blocks some signals for us. We used to do this before every password change, but there's really no point in calling it more than once during the life of the program. - Change install_reaper() so that we can use it to de-install the SIGCHLD handler if we need to (and we do in pw_mkdb() -- this is what I get for splicing code from two different programs together). - Use sigemptyset(&act.sa_mask) rather than act.sa_mask = 0: the latter is decidedly non-portable. (In IRIX, HP-UX and Solaris, sigset_t is an array of longs, not an int.) update.c: - Roll in change from new version (check that we're not modifying an NIS entry in validate_args()). - Get rid of call to pw_init() (moved to yppasswdd.c). - Check return values from pw_util routines and return error status to yppasswd clients if there's a problem. - Straighten out password file copying mechanism a little. Keep a grip on the original password file rather than summarily overwriting it so that we can restore everything if we fail to fork() a process to update the NIS maps. - Pass the name of the password template file (specified with -m or /etc/master.passwd by default) to the yppwupdate script, which in turn should now pass it to /var/yp/Makefile. pw_util.c: - Nuke the pw_edit() and pw_prompt() functions -- we don't need them. - Change all warn()s, warnx()s and err()s to syslog()s. - Make sure we return error status to caller rather than bailing out in pw_lock() and pw_tmp(). - Don't block SIGTERM in pw_init() (by ignoring SIGTERM, we prevent yppasswdd from being shut down cleanly). - Don't let pw_error() exit. (This stuff was stolen from chpass and vipw which are interactive programs; it's okay to let pw_error() bail out for these programs, but not in a daemon like yppasswdd). - Fix signal handling in pw_mkdb (we need to temporarily de-install the SIGCHLD handler so that we can wait on the pwd_mkdb child ourselves). pw_copy.c: - Change all warn()s, warnx()s and err()s to syslog()s. - Add a bunch of returns() and make pw_copy() return and int ( 0 on success, -1 on failure) so that update.c can flag errors properly. - Return -1 after calling pw_error() to signal failures rather than relying on pw_error() to bail out. - Abort copying if we discover that we've been asked to change an entry for a user that exists in the NIS passwd maps but not in the master.passwd template file. This can happen if the passwd maps and the template file fall out of sync with each other (or if somebody tries to spoof us). The old behavior was to create add the entry to the password file, which yppasswdd should not do under any circumstances. Makefile: - update VERSION to 0.7 yppasswdd.8: - fix typo (forgot a carriage return somewhere) - remove bogus reference to pwunconv(8) which FreeBSD doesn't have. - bump version from 0.5 to 0.7 - Reflect changes in password file handling. yppwupdate: - Log map rebuilds to /var/yp/ypupdate.log. - Pass the name of the template password file to /var/yp/Makefile as $MASTER_PASSWD.
1995-07-19 17:44:41 +00:00
@$(MAKE) -f ../Makefile netid
networks.byname: $(NETWORKS)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(NETWORKS) | \
$(AWK) \
'$$1 !~ "#" { print $$1"\t"$$0; \
for (n=3; n<=NF && $$n !~ "#"; n++) \
print $$n"\t"$$0 \
}' $^ | $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
networks.byaddr: $(NETWORKS)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(NETWORKS) | \
$(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \
| $(DBLOAD) -i $(NETWORKS) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
protocols.byname: $(PROTOCOLS)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(PROTOCOLS) | \
$(AWK) \
'$$1 !~ "#" { print $$1"\t"$$0; \
for (n=3; n<=NF && $$n !~ "#"; n++) \
print $$n"\t"$$0 \
}' $^ | $(DBLOAD) -i $(PROTOCOLS) \
-o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
protocols.bynumber: $(PROTOCOLS)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(PROTOCOLS) | \
$(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \
| $(DBLOAD) -i $(PROTOCOLS) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
rpc.byname: $(RPC)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(RPC) | \
$(AWK) \
'$$1 !~ "#" { print $$1"\t"$$0; \
for (n=3; n<=NF && $$n !~ "#"; n++) \
print $$n"\t"$$0 \
}' $^ | $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
rpc.bynumber: $(RPC)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(RPC) | \
$(AWK) '$$1 !~ "#" { print $$2"\t"$$0 }' $^ \
| $(DBLOAD) -i $(RPC) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
services.byname: $(SERVICES)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(SERVICES) | \
$(AWK) \
'$$1 !~ "#" { print $$1"\t"$$0; \
for (n=3; n<=NF && $$n !~ "#"; n++) \
print $$n"\t"$$0 \
}' $^ | $(DBLOAD) -i $(SERVICES) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
$(PASSWD): $(MASTER)
@echo "Creating new $@ file from $(MASTER)..."
$(RM) $@
@if [ ! $(UNSECURE) ]; then \
$(RCAT) $(MASTER) | \
$(AWK) -F: '{if ($$1 != "+") \
print $$1":*:"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \
> $(PASSWD) ; \
else $(RCAT) $(MASTER) | \
$(AWK) -F: '{if ($$1 != "+") \
print $$1":"$$2":"$$3":"$$4":"$$8":"$$9":"$$10}' $^ \
> $(PASSWD) ; fi
passwd.byname: $(PASSWD)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(PASSWD) | \
$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
| $(DBLOAD) -i $(PASSWD) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
passwd.byuid: $(PASSWD)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(PASSWD) | \
$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
| $(DBLOAD) -i $(PASSWD) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
Updates, fixes and cleanups -- oh my. In ypserv: yp_svc.c: - small signal handler tweak (hopefully the last): just use sigemptyset() to clear sa_mask. Makefile.yp: - Let the user specify the location of master.passwd when updating maps (e.g. make MASTER_PASSWD=/some/path/to/master.passwd). Editing the file to change the location of master.passwd still works. This is mostly to let yppassswdd specify the name of the master.passwd file itself. In yppasswdd: yppasswdd.c: - Roll in some minor changes (mostly casts) from Olaf Kirch's latest yppasswd package release (version 0.7). - Use daemon() instead of doing all the deamonizing gruntwork ourselves. - Call pw_init() after daemonizing ourselves. pw_init() sets up some resource limits and blocks some signals for us. We used to do this before every password change, but there's really no point in calling it more than once during the life of the program. - Change install_reaper() so that we can use it to de-install the SIGCHLD handler if we need to (and we do in pw_mkdb() -- this is what I get for splicing code from two different programs together). - Use sigemptyset(&act.sa_mask) rather than act.sa_mask = 0: the latter is decidedly non-portable. (In IRIX, HP-UX and Solaris, sigset_t is an array of longs, not an int.) update.c: - Roll in change from new version (check that we're not modifying an NIS entry in validate_args()). - Get rid of call to pw_init() (moved to yppasswdd.c). - Check return values from pw_util routines and return error status to yppasswd clients if there's a problem. - Straighten out password file copying mechanism a little. Keep a grip on the original password file rather than summarily overwriting it so that we can restore everything if we fail to fork() a process to update the NIS maps. - Pass the name of the password template file (specified with -m or /etc/master.passwd by default) to the yppwupdate script, which in turn should now pass it to /var/yp/Makefile. pw_util.c: - Nuke the pw_edit() and pw_prompt() functions -- we don't need them. - Change all warn()s, warnx()s and err()s to syslog()s. - Make sure we return error status to caller rather than bailing out in pw_lock() and pw_tmp(). - Don't block SIGTERM in pw_init() (by ignoring SIGTERM, we prevent yppasswdd from being shut down cleanly). - Don't let pw_error() exit. (This stuff was stolen from chpass and vipw which are interactive programs; it's okay to let pw_error() bail out for these programs, but not in a daemon like yppasswdd). - Fix signal handling in pw_mkdb (we need to temporarily de-install the SIGCHLD handler so that we can wait on the pwd_mkdb child ourselves). pw_copy.c: - Change all warn()s, warnx()s and err()s to syslog()s. - Add a bunch of returns() and make pw_copy() return and int ( 0 on success, -1 on failure) so that update.c can flag errors properly. - Return -1 after calling pw_error() to signal failures rather than relying on pw_error() to bail out. - Abort copying if we discover that we've been asked to change an entry for a user that exists in the NIS passwd maps but not in the master.passwd template file. This can happen if the passwd maps and the template file fall out of sync with each other (or if somebody tries to spoof us). The old behavior was to create add the entry to the password file, which yppasswdd should not do under any circumstances. Makefile: - update VERSION to 0.7 yppasswdd.8: - fix typo (forgot a carriage return somewhere) - remove bogus reference to pwunconv(8) which FreeBSD doesn't have. - bump version from 0.5 to 0.7 - Reflect changes in password file handling. yppwupdate: - Log map rebuilds to /var/yp/ypupdate.log. - Pass the name of the template password file to /var/yp/Makefile as $MASTER_PASSWD.
1995-07-19 17:44:41 +00:00
@$(MAKE) -f ../Makefile netid
group.byname: $(GROUP)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(GROUP) | \
$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
| $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
group.bygid: $(GROUP)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(GROUP) | \
$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
| $(DBLOAD) -i $(GROUP) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
Updates, fixes and cleanups -- oh my. In ypserv: yp_svc.c: - small signal handler tweak (hopefully the last): just use sigemptyset() to clear sa_mask. Makefile.yp: - Let the user specify the location of master.passwd when updating maps (e.g. make MASTER_PASSWD=/some/path/to/master.passwd). Editing the file to change the location of master.passwd still works. This is mostly to let yppassswdd specify the name of the master.passwd file itself. In yppasswdd: yppasswdd.c: - Roll in some minor changes (mostly casts) from Olaf Kirch's latest yppasswd package release (version 0.7). - Use daemon() instead of doing all the deamonizing gruntwork ourselves. - Call pw_init() after daemonizing ourselves. pw_init() sets up some resource limits and blocks some signals for us. We used to do this before every password change, but there's really no point in calling it more than once during the life of the program. - Change install_reaper() so that we can use it to de-install the SIGCHLD handler if we need to (and we do in pw_mkdb() -- this is what I get for splicing code from two different programs together). - Use sigemptyset(&act.sa_mask) rather than act.sa_mask = 0: the latter is decidedly non-portable. (In IRIX, HP-UX and Solaris, sigset_t is an array of longs, not an int.) update.c: - Roll in change from new version (check that we're not modifying an NIS entry in validate_args()). - Get rid of call to pw_init() (moved to yppasswdd.c). - Check return values from pw_util routines and return error status to yppasswd clients if there's a problem. - Straighten out password file copying mechanism a little. Keep a grip on the original password file rather than summarily overwriting it so that we can restore everything if we fail to fork() a process to update the NIS maps. - Pass the name of the password template file (specified with -m or /etc/master.passwd by default) to the yppwupdate script, which in turn should now pass it to /var/yp/Makefile. pw_util.c: - Nuke the pw_edit() and pw_prompt() functions -- we don't need them. - Change all warn()s, warnx()s and err()s to syslog()s. - Make sure we return error status to caller rather than bailing out in pw_lock() and pw_tmp(). - Don't block SIGTERM in pw_init() (by ignoring SIGTERM, we prevent yppasswdd from being shut down cleanly). - Don't let pw_error() exit. (This stuff was stolen from chpass and vipw which are interactive programs; it's okay to let pw_error() bail out for these programs, but not in a daemon like yppasswdd). - Fix signal handling in pw_mkdb (we need to temporarily de-install the SIGCHLD handler so that we can wait on the pwd_mkdb child ourselves). pw_copy.c: - Change all warn()s, warnx()s and err()s to syslog()s. - Add a bunch of returns() and make pw_copy() return and int ( 0 on success, -1 on failure) so that update.c can flag errors properly. - Return -1 after calling pw_error() to signal failures rather than relying on pw_error() to bail out. - Abort copying if we discover that we've been asked to change an entry for a user that exists in the NIS passwd maps but not in the master.passwd template file. This can happen if the passwd maps and the template file fall out of sync with each other (or if somebody tries to spoof us). The old behavior was to create add the entry to the password file, which yppasswdd should not do under any circumstances. Makefile: - update VERSION to 0.7 yppasswdd.8: - fix typo (forgot a carriage return somewhere) - remove bogus reference to pwunconv(8) which FreeBSD doesn't have. - bump version from 0.5 to 0.7 - Reflect changes in password file handling. yppwupdate: - Log map rebuilds to /var/yp/ypupdate.log. - Pass the name of the template password file to /var/yp/Makefile as $MASTER_PASSWD.
1995-07-19 17:44:41 +00:00
@$(MAKE) -f ../Makefile netid
netid.byname: $(GROUP) $(PASSWD)
@echo "Updating $@..."
$(RM) $@
@$(MKNETID) $(PASSWD) $(GROUP) `basename \`pwd\`` \
| $(DBLOAD) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
master.passwd.byname: $(MASTER)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(MASTER) | \
$(AWK) -F: '{ if ($$1 != "+") print $$1"\t"$$0 }' $^ \
| $(DBLOAD) -i $(MASTER) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi
master.passwd.byuid: $(MASTER)
@echo "Updating $@..."
$(RM) $@
$(CAT) $(MASTER) | \
$(AWK) -F: '{ if ($$1 != "+") print $$3"\t"$$0 }' $^ \
| $(DBLOAD) -i $(MASTER) -o $(YPMAPDIR)/$@ - $@
@if [ ! $(NOPUSH) ]; then $(YPPUSH) -d $(DOMAIN) $@; fi
@if [ ! $(NOPUSH) ]; then echo "Pushed $@ map." ; fi