]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
proxy.cgi: Fixes bug12755 - proxy auth problem with password longer than 8 chars
authorAdolf Belka <adolf.belka@ipfire.org>
Tue, 6 May 2025 14:10:10 +0000 (16:10 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 7 May 2025 09:01:30 +0000 (09:01 +0000)
- This makes the proxy local password management the same between chpasswd.cgi and
   proxy.cgi
- Tested out on my vm testbed and was able to create and modify users and their passwords
   in the proxy.cgi page or modify a password for a specified user on the chpasswd.cgi
   page. This all happened successfully and was confirmed by testing out the local
   authentication.

Fixes: bug12755
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/proxy.cgi

index c8e3576dfe2b2226b8e5e59a6159f336668dcb0d..bdce2fa66ab347450d5d92556ecc63af8613d115 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2021  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2025  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 # it under the terms of the GNU General Public License as published by        #
@@ -20,7 +20,6 @@
 ###############################################################################
 
 use strict;
-use Apache::Htpasswd;
 use Scalar::Util qw(looks_like_number);
 
 # enable only the following on debugging purpose
@@ -4050,15 +4049,7 @@ sub adduser
                close(FILE);
        } else {
                &deluser($str_user);
-
-               my %htpasswd_options = (
-                       passwdFile => "$userdb",
-                       UseMD5 => 1,
-               );
-
-               my $htpasswd = new Apache::Htpasswd(\%htpasswd_options);
-
-               $htpasswd->htpasswd($str_user, $str_pass);
+               &General::system("/usr/bin/htpasswd", "-bB", "-C 10", "$userdb", "$str_user", "$str_pass");
        }
 
        if ($str_group eq 'standard') { open(FILE, ">>$stdgrp");