From owner-cvs-src-old@FreeBSD.ORG Wed Feb 18 22:28:00 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C25810658FA for ; Wed, 18 Feb 2009 22:28:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7776F8FC2C for ; Wed, 18 Feb 2009 22:28:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1IMS0Al032157 for ; Wed, 18 Feb 2009 22:28:00 GMT (envelope-from imp@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1IMS0Li032156 for cvs-src-old@freebsd.org; Wed, 18 Feb 2009 22:28:00 GMT (envelope-from imp@repoman.freebsd.org) Message-Id: <200902182228.n1IMS0Li032156@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to imp@repoman.freebsd.org using -f From: Warner Losh Date: Wed, 18 Feb 2009 22:27:46 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/usr.sbin/rpc.yppasswdd yppasswdd_server.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2009 22:28:02 -0000 imp 2009-02-18 22:27:46 UTC FreeBSD src repository Modified files: usr.sbin/rpc.yppasswdd yppasswdd_server.c Log: SVN rev 188766 on 2009-02-18 22:27:46Z by imp yppasswdd assumed that a struct x_master_passwd is type punable to a struct passwd. This is not the case when sizeof(unsigned long) != sizeof(time_t). Write a dinky function to do the assignment instead of relying on the punning. This does slow things down a little (1 extra function call, 11 pointer or int assignments), but is much safer and machines have been fast enough since the mid 1990s that nobody will notice the difference. time_t is a 64-bits int on arm and mips. Before this change, arm was silently broken. I guess there aren't that many ARM machines running master YP domain servers. :) The client side doesn't assume this type punning, so it doesn't need to be fixed. Revision Changes Path 1.30 +21 -3 src/usr.sbin/rpc.yppasswdd/yppasswdd_server.c