From 0ffcbb494dc5c06fdd9746825d59149180fda225 Mon Sep 17 00:00:00 2001 From: mycroft Date: Thu, 22 Feb 1996 11:14:41 +0000 Subject: [PATCH] Always swap most of the fields when updating a config file entry; otherwise we can get weird lossage when deleting a field (e.g. the group). --- usr.sbin/inetd/inetd.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 8078ea346375..5a34091e864a 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -1,4 +1,4 @@ -/* $NetBSD: inetd.c,v 1.10 1995/06/02 15:02:18 pk Exp $ */ +/* $NetBSD: inetd.c,v 1.11 1996/02/22 11:14:41 mycroft Exp $ */ /* * Copyright (c) 1983,1991 The Regents of the University of California. * All rights reserved. @@ -40,7 +40,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)inetd.c 5.30 (Berkeley) 6/3/91";*/ -static char rcsid[] = "$Id: inetd.c,v 1.10 1995/06/02 15:02:18 pk Exp $"; +static char rcsid[] = "$Id: inetd.c,v 1.11 1996/02/22 11:14:41 mycroft Exp $"; #endif /* not lint */ /* @@ -561,14 +561,10 @@ config() if (cp->se_bi == 0 && (sep->se_wait == 1 || cp->se_wait == 0)) sep->se_wait = cp->se_wait; - if (cp->se_max != sep->se_max) - SWAP(int, cp->se_max, sep->se_max); - if (cp->se_user) - SWAP(char *, sep->se_user, cp->se_user); - if (cp->se_group) - SWAP(char *, sep->se_group, cp->se_group); - if (cp->se_server) - SWAP(char *, sep->se_server, cp->se_server); + SWAP(int, cp->se_max, sep->se_max); + SWAP(char *, sep->se_user, cp->se_user); + SWAP(char *, sep->se_group, cp->se_group); + SWAP(char *, sep->se_server, cp->se_server); for (i = 0; i < MAXARGV; i++) SWAP(char *, sep->se_argv[i], cp->se_argv[i]); #undef SWAP