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).
This commit is contained in:
parent
c9dfd5cb44
commit
0ffcbb494d
|
@ -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,13 +561,9 @@ 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);
|
||||
for (i = 0; i < MAXARGV; i++)
|
||||
SWAP(char *, sep->se_argv[i], cp->se_argv[i]);
|
||||
|
|
Loading…
Reference in New Issue