From owner-freebsd-bugs Mon Sep 2 0:50:47 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E987937B400 for ; Mon, 2 Sep 2002 00:50:40 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B231E43E72 for ; Mon, 2 Sep 2002 00:50:11 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g827o1JU073750 for ; Mon, 2 Sep 2002 00:50:01 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g827o18o073749; Mon, 2 Sep 2002 00:50:01 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 90A8137B400 for ; Mon, 2 Sep 2002 00:49:32 -0700 (PDT) Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id B058F43EB1 for ; Mon, 2 Sep 2002 00:48:57 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g827l1OT082171 for ; Mon, 2 Sep 2002 00:47:01 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.4/8.12.4/Submit) id g827l1ga082170; Mon, 2 Sep 2002 00:47:01 -0700 (PDT) Message-Id: <200209020747.g827l1ga082170@www.freebsd.org> Date: Mon, 2 Sep 2002 00:47:01 -0700 (PDT) From: Jay Chuang To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: i386/42315: chpass bug Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 42315 >Category: i386 >Synopsis: chpass bug >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Sep 02 00:50:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Jay Chuang >Release: 4.6.2 >Organization: STEPTECH >Environment: FreeBSD jay.eflash.com.tw 4.6.2-RELEASE FreeBSD 4.6.2-RELEASE #7: Thu Aug 29 14:10:12 CST 2002 rd@jay.eflash.com.tw:/usr/src/sys/compile/KEVIN i386 >Description: chpass bug >How-To-Repeat: bug 1: source /usr/src/usr.sbin/vipw/pw_util.c int pw_tmp() { static char path[MAXPATHLEN]; int fd; char *p; if ((p = strrchr(masterpasswd, '/')) == NULL) strcpy(path, "pw.XXXXXX"); else if (snprintf(path, sizeof path, "%.*s/pw.XXXXXX", (int)(p - masterpasswd), masterpasswd) >= sizeof path) errx(1, "%s: path too long", masterpasswd); if ((fd = mkstemp(path)) == -1) err(1, "%s", path); tempname = path; return (fd); } bug 2 : source /usr/src/usr.bin/chpass/chpass.c 210 if (op == LOADENTRY) { 211 if (uid) 212 baduser(); 213 pw = &lpw; 214 if (!pw_scan(arg, pw)) 215 exit(1); 216 } >Fix: bug 1 Fix : change function strchr to strrch bug 1 Fix : add "old_pw = *pw;" after line 215 >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message