Date: Mon, 2 Sep 2002 00:53:47 -0700 (PDT) From: Jay Chuang <jay@embeddedos.com.tw> To: freebsd-gnats-submit@FreeBSD.org Subject: i386/42316: chpass bug Message-ID: <200209020753.g827rlAT082771@www.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 42316
>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 01:00:03 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209020753.g827rlAT082771>
