Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jun 2002 09:59:10 -0700 (PDT)
From:      Paul Herman <pherman@frenchfries.net>
To:        "Matthew D. Fuller" <fullermd@over-yonder.net>
Cc:        "Geoffrey C. Speicher" <geoff@sea-incorporated.com>, <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: bug in pw, -STABLE [patch]
Message-ID:  <20020623094323.F38369-100000@mammoth.eat.frenchfries.net>
In-Reply-To: <20020623160439.GE81018@over-yonder.net>

next in thread | previous in thread | raw e-mail | index | archive | help

[ pulled over to -hackers as well ]

On Sun, 23 Jun 2002, Matthew D. Fuller wrote:

> On Sun, Jun 23, 2002 at 09:00:52AM -0700 I heard the voice of
> Paul Herman, and lo! it spake thus:
> > On Sun, 23 Jun 2002, Geoffrey C. Speicher wrote:
> >
> > How so?  I'm not suggesting unlink(2)ing /etc/master.passwd or
> > /etc/spwd.db at all.
>
> No, but pw(8) does; making it not do so would require reasonably
> extensive rewriting.

Indeed it does do this.  However, that seems to be the crux of the
problem.  The current pw(8) behavior was (probably) not only a
convenient way to update files in /etc, but an attempt to narrow
(not eliminate) the window for race conditions.  If this is
fundamentaly flawed, *this* should be fixed, and not have a larger
band aid put over it.

I can't imagine it would be too extensive of a rewrite.  The temp
file code could be kept, and in fileupd.c:fileupdate() instead of
rename("/etc/master.passwd.new", "/etc/master.passwd"), it just
copies the contents of the .new file into the original file (that
has the O_EXLOCK.)

-Paul.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020623094323.F38369-100000>