mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Use md5 for NIS users
This commit is contained in:
1
nis/md5-lib.pl
Symbolic link
1
nis/md5-lib.pl
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../useradmin/md5-lib.pl
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
# Create, update or delete a password/shadow files entry
|
# Create, update or delete a password/shadow files entry
|
||||||
|
|
||||||
require './nis-lib.pl';
|
require './nis-lib.pl';
|
||||||
|
require './md5-lib.pl';
|
||||||
use Time::Local;
|
use Time::Local;
|
||||||
&ReadParse();
|
&ReadParse();
|
||||||
|
|
||||||
@@ -25,14 +26,13 @@ else {
|
|||||||
$in{'passmode'} != 2 || $in{'encpass'} =~ /^[^:]*$/ ||
|
$in{'passmode'} != 2 || $in{'encpass'} =~ /^[^:]*$/ ||
|
||||||
&error($text{'passwd_epass'});
|
&error($text{'passwd_epass'});
|
||||||
%uconfig = &foreign_config("useradmin");
|
%uconfig = &foreign_config("useradmin");
|
||||||
$salt = chr(int(rand(26))+65) . chr(int(rand(26))+65);
|
|
||||||
@passwd = ( $in{'name'}, 'x',
|
@passwd = ( $in{'name'}, 'x',
|
||||||
$in{'uid'}, $in{'gid'}, $in{'real'},
|
$in{'uid'}, $in{'gid'}, $in{'real'},
|
||||||
$in{'home'}, $in{'shell'} ? $in{'shell'} : $in{'other'} );
|
$in{'home'}, $in{'shell'} ? $in{'shell'} : $in{'other'} );
|
||||||
$pass = $in{'passmode'} == 0 ? "" :
|
$pass = $in{'passmode'} == 0 ? "" :
|
||||||
$in{'passmode'} == 1 ? $uconfig{'lock_string'} :
|
$in{'passmode'} == 1 ? $uconfig{'lock_string'} :
|
||||||
$in{'passmode'} == 2 ? $in{'encpass'} :
|
$in{'passmode'} == 2 ? $in{'encpass'} :
|
||||||
&unix_crypt($in{'pass'}, $salt);
|
&encrypt_md5($in{'pass'});
|
||||||
if ($in{'mode'} == 2) {
|
if ($in{'mode'} == 2) {
|
||||||
# Parse extra shadow inputs
|
# Parse extra shadow inputs
|
||||||
if ($in{'expired'} ne "" && $in{'expirem'} ne "" &&
|
if ($in{'expired'} ne "" && $in{'expirem'} ne "" &&
|
||||||
|
|||||||
Reference in New Issue
Block a user