🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #68898

Re: Perl5.8.2 NDBM_File + ckpasswd script appears to corrupt passwd DB

#68898
From: none
Date: Fri, 02 Apr 2004 03:41
41 lines
2646 bytes
No - CKPASSWD fails. While a userid/password string does get inserted into
the "garbage filled" DB, CKPASSWD cannot validate the password, returning
"user <userid> unknown", while 'strings <passwd.DB>|tail -1' shows:
<crypted password><userid>.

Example "flat file" password generating script derived from earlier Perl
script called 'gen.passwd' (commands from CKPASSWD manual page):

#!/usr/bin/perl
open(pwfile,">>newpasswdfile") || die "Couldn't open 'newpasswdfile'";
print "Username: ";
my $user = <STDIN>;
chomp $user;
print "Password: ";
my $passwd = <STDIN>;
chomp $passwd;
my @alphabet = ('.', '/', 0..9, 'A'..'Z', 'a'..'z');
my $salt = join '', @alphabet[rand 64, rand 64];
my $cryptpasswd = crypt ($passwd, $salt);
print(pwfile "$user:$cryptpasswd\n");
close(pwfile);
exit;

CKPASSWD has no problem with the "flat file".


On Wed, 31 Mar 2004 09:49:42 -0800, Russ Allbery wrote:

> none <supraexpress@globaleyes.net> writes:
> 
>> Using "gen.passwd" script from CKPASSWD manual page:
> 
>> shows the following results from "strings:"
> 
> If you look up $user, do you still get the right password back?
> 
> I've seen this happen before, where lots of random strange junk gets
> inserted into the database according to strings, but the database works
> just fine.  I don't know what causes that; I always wrote it off as some
> weirdness in the NDBM libraries.
Technical Details
Message-ID: <pan.2004.04.02.03.41.52.243707@globaleyes.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.ash.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!nntp.giganews.com!newsrout1.ntli.net!news.ntli.net!sn-xit-02!sn-xit-04!sn-xit-01!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
References: <pan.2004.03.31.00.04.19.234631@siu.edu> <c4dams$gq1$2@puck.litech.org> <pan.2004.03.31.07.58.14.172520@globaleyes.net> <878yhgq53d.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
Message-ID: <pan.2004.04.02.03.41.52.243707@globaleyes.net>
Subject: Re: Perl5.8.2 NDBM_File + ckpasswd script appears to corrupt passwd DB
Date: Thu, 01 Apr 2004 21:41:54 -0600
From: none <supraexpress@globaleyes.net>
References: <pan.2004.03.31.00.04.19.234631@siu.edu> <c4dams$gq1$2@puck.litech.org> <pan.2004.03.31.07.58.14.172520@globaleyes.net> <878yhgq53d.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.ash.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!border1.nntp.ash.giganews.com!nntp.giganews.com!newsrout1.ntli.net!news.ntli.net!sn-xit-02!sn-xit-04!sn-xit-01!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
Newsgroups: news.software.nntp
Organization: Posted via Supernews, http://www.supernews.com
User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing
 moment of clarity.)
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Complaints-To: abuse@supernews.com
Lines: 41