From owner-freebsd-hackers Thu Apr 24 10:25:04 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id KAA18969 for hackers-outgoing; Thu, 24 Apr 1997 10:25:04 -0700 (PDT) Received: from labs.usn.blaze.net.au (labs.usn.blaze.net.au [203.17.53.30]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id KAA18958 for ; Thu, 24 Apr 1997 10:25:00 -0700 (PDT) Received: from labs.usn.blaze.net.au (local [127.0.0.1]) by labs.usn.blaze.net.au (8.8.5/8.8.5) with ESMTP id DAA08053; Fri, 25 Apr 1997 03:24:49 +1000 (EST) Message-Id: <199704241724.DAA08053@labs.usn.blaze.net.au> X-Mailer: exmh version 2.0gamma 1/27/96 To: keith waters cc: hackers@freebsd.org Subject: Re: MISSING master.passwd !!! Please Help!! In-reply-to: Your message of "Sat, 24 Apr 1997 18:05:03 +0200." <199704241605.SAA25750@ilink.nis.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 25 Apr 1997 03:24:48 +1000 From: David Nugent Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > I have a rather immediate urgent problem... > > My master.passwd file is missing! Ouch. > I have passwd, spwd.db and pwd.db > > Has anybody out there ever reverse-generated the passwords? If you disable NIS, then pw(8) will almost do it for you. The command "pw usershow -a" dumps the entire userfile, but leaves out the password. If you apply the following diff to src/usr.sbin/pw/pw_user.c, you'll get there all the way: Index: pw_user.c =================================================================== RCS file: /home/cvs/freebsd/src/usr.sbin/pw/pw_user.c,v retrieving revision 1.19 diff -u -r1.19 pw_user.c --- pw_user.c 1997/03/24 15:09:41 1.19 +++ pw_user.c 1997/04/24 17:19:26 @@ -955,7 +955,7 @@ if (!pretty) { char buf[_UC_MAXLINE]; - fmtpwent(buf, pwd); + fmtpwentry(buf, pwd, PWF_MASTER); fputs(buf, stdout); } else { int j; David Nugent - Unique Computing Pty Ltd - Melbourne, Australia Voice +61-3-9791-9547 Data/BBS +61-3-9792-3507 3:632/348@fidonet davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/