[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] unix and userdb password sync
+--[ macky@staktrading.com ]--[ macky@staktrading.com ]
| Is there a way of syncing unix passwords with the userdb,
I would think there is. But it will be a bit work. I don't know minivend
is keeping the passwords. If they are crypted with the same algorithm as
unix is crypting the passswords, you only would have to write a small
programm (perhaps Perl), to get the data from your password into the
userdatabase.
Well i've taken a look at the userdb.asc. you would have to make
something like:
----[ update.pl ]----[ begin ]----
#!/usr/bin/perl -w
use strict;
my $dbfile = "/path/to/userdb.asc";
my %pwhash;
my $user;
my $pw;
my @temparray;
my @buffer;
open HANDLE, "/etc/passwd";
while (<HANDLE>) {
($user, $pwhash{$user}, @buffer) = split /:/;
}
close HANDLE;
open HANDLE, $dbfile;
@temparray = <HANDLE>;
close HANDLE;
open HANDLE, ">" . $dbfile;
foreach (@temparray) {
($user, $pw, @buffer) = split /\t/;
print HANDLE join "\t", $user, $pwhash, @buffer;
}
close HANDLE;
exit(0);
----[ update.pl ]----[ end ]----
Well i havn't tried if it works (c:
you still would have to create your useraccounts, this script only would
update the crypted passswords.
You will also have the problem, that you have Shaddowed Passwords. What
means the passwords are not given in /etc/passwd, but in /etc/shaddow or
another file. If you don't make the userdb.asc readonly for the
minivend-user you will have a security-hole.
With problems understanding the Script, mail me, ..
Rainer
--
Rainer Jung | Mother told me to be good
jura0011@fh-karlsruhe.de | but she's been wrong before.