From f9b45dedc9d7d9b9b4f29d97acf46cf8ce5d5712 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 16 Feb 1997 23:45:29 +0000 Subject: [PATCH] clean --- etc/passwd.conf | 16 ++++++----- libexec/tftpd/tftpd.c | 66 ++++++++++++++++++++----------------------- 2 files changed, 40 insertions(+), 42 deletions(-) diff --git a/etc/passwd.conf b/etc/passwd.conf index c33ca388bdd..6081d46fe34 100644 --- a/etc/passwd.conf +++ b/etc/passwd.conf @@ -1,13 +1,15 @@ -# passwd configuration file +# $OpenBSD: passwd.conf,v 1.2 1997/02/16 23:45:29 deraadt Exp $ +# +# Passwd configuration file # # Possible options are at the moment: -# localcipher, ypcipher +# localcipher, ypcipher # they can take values of -# old - old unix style salt of 12bit -# newsalt - DES hash with salt of 64 bit -# blowfish,x - Blowfish cipher, x is number of rounds -# 128 bit salt, 4 rounds are min, 31 max -# +# old - old unix style salt of 12bit +# newsalt - DES hash with salt of 64 bit +# blowfish,x - Blowfish cipher, x is number of rounds +# 128 bit salt, 4 rounds are min, 31 max + default: localcipher=old ypcipher=old diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index d848a7e05f1..a46938f6eb4 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -39,7 +39,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)tftpd.c 5.13 (Berkeley) 2/26/91";*/ -static char rcsid[] = "$Id: tftpd.c,v 1.5 1996/12/22 03:41:22 tholo Exp $"; +static char rcsid[] = "$Id: tftpd.c,v 1.6 1997/02/16 23:49:21 deraadt Exp $"; #endif /* not lint */ /* @@ -105,6 +105,8 @@ main(argc, argv) register int n = 0; int on = 1; int fd = 0; + int pid; + int i, j; int c; openlog("tftpd", LOG_PID, LOG_DAEMON); @@ -175,42 +177,36 @@ main(argc, argv) * break before doing the above "recvfrom", inetd would * spawn endless instances, clogging the system. */ - { - int pid; - int i, j; - - for (i = 1; i < 20; i++) { - pid = fork(); - if (pid < 0) { - sleep(i); - /* - * flush out to most recently sent request. - * - * This may drop some request, but those - * will be resent by the clients when - * they timeout. The positive effect of - * this flush is to (try to) prevent more - * than one tftpd being started up to service - * a single request from a single client. - */ - j = sizeof from; - i = recvfrom(fd, buf, sizeof (buf), 0, - (struct sockaddr *)&from, &j); - if (i > 0) { - n = i; - fromlen = j; - } - } else { - break; - } - } + for (i = 1; i < 20; i++) { + pid = fork(); if (pid < 0) { - syslog(LOG_ERR, "fork: %m\n"); - exit(1); - } else if (pid != 0) { - exit(0); - } + sleep(i); + /* + * flush out to most recently sent request. + * + * This may drop some request, but those + * will be resent by the clients when + * they timeout. The positive effect of + * this flush is to (try to) prevent more + * than one tftpd being started up to service + * a single request from a single client. + */ + j = sizeof from; + i = recvfrom(fd, buf, sizeof (buf), 0, + (struct sockaddr *)&from, &j); + if (i > 0) { + n = i; + fromlen = j; + } + } else + break; } + if (pid < 0) { + syslog(LOG_ERR, "fork: %m\n"); + exit(1); + } else if (pid != 0) + exit(0); + from.sin_len = sizeof(struct sockaddr_in); from.sin_family = AF_INET; alarm(0); -- 2.20.1