[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

create password in postinst

Hi folks,

me once again. In my postinst I need to generate a MD5 crypted password
hash out of a userdefined password. Both of them have to replace the
defaults in a MySQL dump file, which I tend to do the following way,
unless there is a better solution:

 depend on mkpasswd
 ask the user for a password via debconf (store in $CLEARPASS)
 and then do HASH=`mkpasswd -S 35348090 -H md5 $CLEARPASS` and
 afterwards the usual sed -e "s/default/"$HASH"/;" ...

Is this OK in the postinst, especially the dependency on mkpasswd?
Are there better solutions around? All that I found with google & Co
were perl and several binary packages  :/


Daniel Knabl              http://www.tirolinux.net
PGP Fingerprint                   daniel@aio4u.com
A069 671B 39F2 E9B9 FB34  68BB 4BEC 1344 C8A4 3F0B

Attachment: signature.asc
Description: PGP signature

Reply to: