Article View: es.comp.os.linux.programacion
Article #11802Perl + database + quitar "par"
From: marmolejo
Date: Sun, 07 Oct 2001 10:53
Date: Sun, 07 Oct 2001 10:53
29 lines
1891 bytes
1891 bytes
Hola, este script genera archivos database.dir y database.pag con parejas
usarios/password...�alguien puede decirme c�mo conseguir que se puedan
tambi�n quitar parejas de usuario/pass?
#!/usr/bin/perl
use NDBM_File;
use Fcntl;
tie (%db, 'NDBM_File', '/path/a/la/database', O_RDWR | O_CREAT, 0640)
or die "Cannot open /path/a/la/database: $!\n";
$| = 1;
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];
$db{$user} = crypt ($passwd, $salt);
untie %db;
Suyo afftsmo, mamrolejo ;)
--
Gabardinas Windows ME se cuelgan solas.
- Debian GNU/Linux Sid Linux User #162799 -
- PGP Pub Key en pgp.rediris.es ID:0x64438485 -
- marmolejo at able.es ICQ: 65833679 -
Technical Details
Message-ID:
<9ppc6g$ua$1@localhost.localhost>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!213.98.91.117!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f86c8,95686bb050d5fff6,start X-Google-Attributes: gidf86c8,public X-Google-ArrivalTime: 2001-10-07 04:19:22 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!213.98.91.117!not-for-mail From: "marmolejo" <marmolejo@escomposlinux.org> Newsgroups: es.comp.os.linux.programacion Subject: Perl + database + quitar "par" Date: Sun, 07 Oct 2001 12:53:04 +0200 Organization: Ecolnet Lines: 29 Message-ID: <9ppc6g$ua$1@localhost.localhost> Reply-To: marmolejo@escomposlinux.org NNTP-Posting-Host: 213.98.91.117 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: fu-berlin.de 1002453559 21250836 213.98.91.117 (16 [63420]) X-Orig-Path: julieta.escomposlinux.net!marmolejo.escomposlinux.net!not-for-mail User-Agent: Pan/0.10.0 (Unix) X-Comment-To: ALL X-No-Productlinks: Yes