From owner-freebsd-current@FreeBSD.ORG Mon Jul 7 04:30:06 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D0AB106567B for ; Mon, 7 Jul 2008 04:30:06 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: from web57008.mail.re3.yahoo.com (web57008.mail.re3.yahoo.com [66.196.97.112]) by mx1.freebsd.org (Postfix) with SMTP id 1C5098FC16 for ; Mon, 7 Jul 2008 04:30:05 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: (qmail 6485 invoked by uid 60001); 7 Jul 2008 04:03:24 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=fnQvH4BRRK1WhTsTnRPO2WNuSXsOGSlLE0FszpSusn/74N7mm9fb89A24tnJWC78SmElE2/hEbPNzCUg+vUE/dSp0fuTXekdx6MixGMJH6omH0uK36GNYAxvu7Pv4YjYDDQTqafwhr3SNr+yrdGXh41o3M4NH7haYVcnnzHVVoI=; Received: from [220.255.7.234] by web57008.mail.re3.yahoo.com via HTTP; Sun, 06 Jul 2008 21:03:23 PDT X-Mailer: YahooMailWebService/0.7.199 Date: Sun, 6 Jul 2008 21:03:23 -0700 (PDT) From: Unga To: freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-2042182583-1215403403=:6371" Message-ID: <232537.6371.qm@web57008.mail.re3.yahoo.com> Subject: [PATCH] Fix /usr/src/usr.sbin/pw/pwupd.c - pw_update() return success on failure X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 04:30:06 -0000 --0-2042182583-1215403403=:6371 Content-Type: text/plain; charset=us-ascii Hi all In the present implementation even if the pwdb() fails, pw_update() still return rc=0, therefore, subsequent functions still continue to proceed without passwd and master.passwd been updated. The attached patch fixes this issue. If this patch is acceptable, appreciate if it could be applied to both current and RELENG_7. Kind regards Unga --0-2042182583-1215403403=:6371 Content-Type: application/octet-stream; name="pw_update-return-code-fix.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="pw_update-return-code-fix.patch" ZGlmZiAtTmF1ciBwdy5vcmlnL3B3dXBkLmMgcHcvcHd1cGQuYwotLS0gcHcu b3JpZy9wd3VwZC5jCTIwMDgtMDctMDcgMTA6Mjg6NTIuMDAwMDAwMDAwICsw ODAwCisrKyBwdy9wd3VwZC5jCTIwMDgtMDctMDcgMTE6Mjc6MzcuMDAwMDAw MDAwICswODAwCkBAIC0xMzksNyArMTM5LDcgQEAKIHN0YXRpYyBpbnQKIHB3 X3VwZGF0ZShzdHJ1Y3QgcGFzc3dkICogcHdkLCBjaGFyIGNvbnN0ICogdXNl ciwgaW50IG1vZGUpCiB7Ci0JaW50ICAgICAgICAgICAgIHJjID0gMDsKKwlp bnQgcmM7CiAKIAlFTkRQV0VOVCgpOwogCkBAIC0xNDgsNyArMTQ4LDggQEAK IAkgKiBOb3RlOiAtQyBpcyBvbmx5IGF2YWlsYWJsZSBpbiBGcmVlQlNEIDIu MiBhbmQgYWJvdmUKIAkgKi8KICNpZmRlZiBIQVZFX1BXREJfQwotCWlmIChw d2RiKCItQyIsIChjaGFyICopTlVMTCkgPT0gMCkgewkvKiBDaGVjayBvbmx5 ICovCisJcmMgPSBwd2RiKCItQyIsIChjaGFyICopTlVMTCk7IC8qIENoZWNr IG9ubHkgKi8KKwlpZiAocmMgPT0gMCkgewogI2Vsc2UKIAl7CQkJCS8qIE5v IC1DICovCiAjZW5kaWYK --0-2042182583-1215403403=:6371--