aboutsummaryrefslogtreecommitdiff
path: root/genpass.pl
diff options
context:
space:
mode:
authorMiquel Lionel <lionel@les-miquelots.net>2021-07-17 22:01:05 +0100
committerMiquel Lionel <lionelmiquel@sfr.fr>2021-07-18 20:01:02 +0100
commit1208e3e3ffb1cc263d879f996b22e18c8b024d33 (patch)
treec168dcc3eff82020e767b1d22f71880118a92fef /genpass.pl
parente6d90c87b655db6c33724e5fb3b4001963c63736 (diff)
downloadgpigeon-1208e3e3ffb1cc263d879f996b22e18c8b024d33.tar.gz
gpigeon-1208e3e3ffb1cc263d879f996b22e18c8b024d33.zip
fixes
- Makefile is better: the generated password via genpass.pl or genpass.pl with -i flag should now be a correct argon2id hash in both cases. - Added missing checks in the makefile - Fixed undeclared variables in gpigeon-template.cgi Running make should be better and require less manual fiddling now.
Diffstat (limited to 'genpass.pl')
-rwxr-xr-xgenpass.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/genpass.pl b/genpass.pl
index a57d98b..829ac48 100755
--- a/genpass.pl
+++ b/genpass.pl
@@ -29,12 +29,13 @@ my $opt = $ARGV[0];
sub FillConfigMk {
my $hash = shift;
$hash =~ s/\$/\\044/g;
+ $hash =~ s/\\/\\\\/g;
my $mkconfig = 'config.mk';
if (-e $mkconfig){
open my $in, '<', $mkconfig or die "$!";
open my $out, '>', "$mkconfig.tmp" or die "$!";
while (<$in>){
- s/ARGON2ID_HASH =.*/ARGON2ID_HASH = `printf "$hash"`/gi;
+ s/ARGON2ID_HASH =.*/ARGON2ID_HASH =$hash/gi;
print $out $_;
}
close $out;