Hi Richard,

On Mar 28, 12:23pm, Richard Barnes -Listserv wrote:
> Subject: (RADIATOR) Extracting Users from a DBM file
> is there a quick and easy way to extract usernames (all of them) from the db
> file?
>
> I know of the builddbm -l <username> command, but as far as I can figure,
> you can't supply a wildcard, or if you can, I haven't figured out what the
> wildcard character is...

builddbm will not do what you want, but a little code like this (untested)
might help:

#!/usr/local/bin/perl
use AnyDBM_File;
my $dbfile = 'yourdbmfilename';
my $mode = 0666;
my $dbtype = 'AnyDBM_File';
my %users;
tie (%users, $dbtype, $dbfile, O_CREAT | O_RDWR, $mode)
    || die "Could not open user database file '$dbfile': $!";
my ($name, $value);
while (($name, $value) = each %users)
{
        print "$name\n";
}


>
> TIA
>
> Richard Barnes
>
>
> ===
> Archive at http://www.starport.net/~radiator/
> Announcements on [EMAIL PROTECTED]
> To unsubscribe, email '[EMAIL PROTECTED]' with
> 'unsubscribe radiator' in the body of the message.
>-- End of excerpt from Richard Barnes -Listserv



-- 
Mike McCauley                               [EMAIL PROTECTED]
Open System Consultants Pty. Ltd            Unix, Perl, Motif, C++, WWW
24 Bateman St Hampton, VIC 3188 Australia   http://www.open.com.au
Phone +61 3 9598-0985                       Fax   +61 3 9598-0955

Radiator: the most portable, flexible and configurable RADIUS server 
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, 
Platypus, Freeside, TACACS+, PAM, external, etc etc on Unix, Win95/8, 
2000, NT, MacOS X
===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.

Reply via email to