From owner-freebsd-questions Fri Jan 19 12:18:35 2001 Delivered-To: freebsd-questions@freebsd.org Received: from xena.gsicomp.on.ca (cr677933-a.ktchnr1.on.wave.home.com [24.43.230.149]) by hub.freebsd.org (Postfix) with ESMTP id 2E14137B6B5 for ; Fri, 19 Jan 2001 12:18:14 -0800 (PST) Received: from hermes (hermes.gsicomp.on.ca [192.168.0.18]) by xena.gsicomp.on.ca (8.9.3/8.9.3) with SMTP id PAA80689; Fri, 19 Jan 2001 15:17:38 -0500 (EST) (envelope-from matt@gsicomp.on.ca) Message-ID: <005501c08255$5ef9bcb0$1200a8c0@gsicomp.on.ca> From: "Matthew Emmerton" To: "Joe Oliveiro" , References: Subject: Re: Rebuilding a flatfile db forn a hash file Date: Fri, 19 Jan 2001 15:21:13 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > The owner of one of the boxes i admin is a complete idiot and zero'd out > his /etc/virtusertable file. The only thing he has on the server now is a > hashed file of the /etc/virtusertable file (virtusertable.db). > > Is there a way to recreate the virtusertable text file from the hashed > file? This Perl program should do what you want: #!/usr/bin/perl dbmopen %VIRTUSERTABLE, "/etc/mail/virtusertable", 0666 or die "Can't open virtusertable: $!\n"; while (($key, $val) = each %VIRTUSERTABLE) { print $key, "\t", $val, "\n"; } dmbclose %VIRTUSERTABLE; If anyone is wondering, this is an example take directly from "Programmg Perl, 2/ed", p154. -- Matt Emmerton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message