From owner-freebsd-current Sun Sep 24 8: 8:16 2000 Delivered-To: freebsd-current@freebsd.org Received: from gw.nectar.com (gw.nectar.com [208.42.49.153]) by hub.freebsd.org (Postfix) with ESMTP id 3009A37B424 for ; Sun, 24 Sep 2000 08:08:13 -0700 (PDT) Received: by gw.nectar.com (Postfix, from userid 1001) id 8048F1925D; Sun, 24 Sep 2000 10:08:12 -0500 (CDT) Date: Sun, 24 Sep 2000 10:08:12 -0500 From: "Jacques A. Vidrine" To: Seigo Tanimura Cc: current@freebsd.org Subject: Re: pw_class in _pw_passwd is null if __hashpw() is not called in prior Message-ID: <20000924100812.A23848@spawn.nectar.com> References: <20000906151431.A26152@hamlet.nectar.com> <14798.4853.288090.72159A@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <14798.4853.288090.72159A@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp>; from tanimura@r.dl.itc.u-tokyo.ac.jp on Sun, Sep 24, 2000 at 11:43:01PM +0900 X-Url: http://www.nectar.com/ Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, Sep 24, 2000 at 11:43:01PM +0900, Seigo Tanimura wrote: > As we are supposed to fill in all of the members in struct passwd > (like Solaris), _pw_passwd should have its initial value other than > zero. > > static struct passwd _pw_passwd = > { > "", > "", > (uid_t)0, /* XXX Is zero appropriate? */ > (gid_t)0, > (time_t)0, > "", > "", > "", > "", > (time_t)0, > 0, > }; I agree -- it bit me while working on some additional nsswitch backends. Using a pointer to an empty string would be more safe. As to the XXX comment, those fields have been 0 forever, no point in changing them now. Unless objections come up, I'll commit this change or something similar with the next nsswitch commit. Thanks for the suggestion! -- Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message