From owner-freebsd-questions Mon Nov 1 1:18:50 1999 Delivered-To: freebsd-questions@freebsd.org Received: from mail.toplink.net (mail.toplink.net [195.2.171.8]) by hub.freebsd.org (Postfix) with ESMTP id 96D4714D75 for ; Mon, 1 Nov 1999 01:18:45 -0800 (PST) (envelope-from ck@toplink.net) Received: from babylon.toplink.net (babylon.toplink.net [195.2.171.90]) by mail.toplink.net (8.9.3/8.9.3) with ESMTP id KAA20221; Mon, 1 Nov 1999 10:18:43 +0100 (CET) Received: from localhost (ck@localhost) by babylon.toplink.net (8.9.3/8.9.3) with ESMTP id KAA38712; Mon, 1 Nov 1999 10:18:16 +0100 (CET) Date: Mon, 1 Nov 1999 10:18:16 +0100 (CET) From: Christian Kratzer To: TrouBle Cc: "freebsd-questions@freebsd.org" Subject: Re: REWARD...! Perl Programmer master.passwd problem In-Reply-To: <381CD49F.7243D959@hackfurby.com> Message-ID: X-NCC-RegID: de.toplink X-Spammer-Kill-Ratio: 75% X-Jihad: Will hunt down all cases of Spam and Net abuse. MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, On Sun, 31 Oct 1999, TrouBle wrote: > Okay real simple.... ive had enough, i have a cash reward of a decent > sum to the first perl programmer who can re-write a script, to work with > the BSd style master.passwd file and write it cortrectly, this is a web > based cgi written in perl, orginially for linux shadow passwds. i can > give you access to the box, the script and the first person who can > provide a working solution gets the dough... oh... yeah the dough, well > its a few hundred dollars offered by my employer. let me know who wants > a crack at it ! no big deal. We have awk or perl scripts creating master.passwd files on freebsd since we started with FreeBSD 2.0. We learned by reading the vipw source code. You need to do following 1. write master.passwd.tmp or other name somewhere in same file system as /etc lives in. Best is /etc/master.passwd.tmp 2. run pwd_mkdb -p /etc/master.passwd.tmp This installs the new master.passwd and creates/updates following files - passwd plaintext stripped version of master.passwd in classic unix format without crypted passwords - spwd.db Binary version of master.passwd - pwd.db Binary version of passwd All the information for the other files is in master.passwd Thats it. But beware. You can screw up things really bad. Be sure to have a root window open when you debug your script. Backups of master.passwd are made on a daily basis to /var/backup in case you forgot to backup your script. With above information you should be able to port your linux scripts just fine yourself and cash your bosses reward ;-) Greetings Christian -- TopLink Internet Services GmbH ck@171.2.195.in-addr.arpa Christian Kratzer http://www.toplink.net/ Phone: +49 7032 2701-0 Fax: +49 7032 2701-19 FreeBSD spoken here! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message