Private
Server IP : 195.201.23.43  /  Your IP : 3.15.236.40
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/webmin/nis/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/share/webmin/nis/save_passwd_shadow.cgi
#!/usr/bin/perl
# save_passwd_shadow.cgi
# Create, update or delete a password/shadow files entry

require './nis-lib.pl';
require './md5-lib.pl';
use Time::Local;
&ReadParse();

($t, $lnums, $passwd, $shadow) =
	&table_edit_setup($in{'table'}, $in{'line'}, ':');
if ($in{'delete'}) {
	# Just delete the user
	&table_delete($t, $lnums);
	}
else {
	# Validate inputs and save the user
	&error_setup($text{'passwd_err'});
	$in{'name'} =~ /^[^: \t]+$/ || &error($text{'passwd_ename'});
	$in{'uid'} =~ /^\d+$/ || &error($text{'passwd_euid'});
	$in{'gid'} =~ /^\d+$/ || &error($text{'passwd_egid'});
	$in{'real'} =~ /^[^:]*$/ || &error($text{'passwd_ereal'});
	$in{'home'} =~ /^[^:]+$/ || &error($text{'passwd_ehome'});
	$in{'shell'} ne '' || $in{'other'} =~ /^[^:]+$/ ||
		&error($text{'passwd_eshell'});
	$in{'passmode'} != 2 || $in{'encpass'} =~ /^[^:]*$/ ||
		&error($text{'passwd_epass'});
	%uconfig = &foreign_config("useradmin");
	@passwd = ( $in{'name'}, 'x',
		    $in{'uid'}, $in{'gid'}, $in{'real'},
		    $in{'home'}, $in{'shell'} ? $in{'shell'} : $in{'other'} );
	$pass = $in{'passmode'} == 0 ? "" :
		$in{'passmode'} == 1 ? $uconfig{'lock_string'} :
		$in{'passmode'} == 2 ? $in{'encpass'} :
				       &encrypt_md5($in{'pass'});
	if ($in{'mode'} == 2) {
		# Parse extra shadow inputs
		if ($in{'expired'} ne "" && $in{'expirem'} ne "" &&
		    $in{'expirey'} ne "") {
			eval { $expire = timelocal(0, 0, 12, $in{'expired'},
						   $in{'expirem'}-1,
						   $in{'expirey'}-1900) };
			&error($text{'passwd_eexpire'}) if ($@);
			$expire = int($expire / (60*60*24));
			}
		$in{'min'} =~ /^[0-9]*$/ || &error($text{'passwd_emin'});
		$in{'max'} =~ /^[0-9]*$/ || &error($text{'passwd_emax'});
		$in{'warn'} =~ /^[0-9]*$/ || &error($text{'passwd_ewarn'});
		$in{'inactive'} =~ /^[0-9]*$/ || &error($text{'passwd_einactive'});
		@shadow = ( $in{'name'}, $pass,
			    undef, $in{'min'}, $in{'max'}, $in{'warn'},
			    $in{'inactive'}, $expire, $shadow->[8] );
		$shadow[2] = int(time() / (60*60*24))
			if ($shadow[1] ne $shadow->[1]);
		}
	elsif ($in{'mode'} == 1) {
		@shadow = ( $in{'name'}, $pass,
			    @$shadow[2..8] );
		}
	else {
		$passwd[1] = $pass;
		}

	if ($in{'line'} eq '') {
		&table_add($t, ":", \@passwd, \@shadow);
		}
	else {
		&table_update($t, $lnums, ":", \@passwd, \@shadow);
		}
	}
&apply_table_changes() if (!$config{'manual_build'});
&redirect("edit_tables.cgi?table=$in{'table'}");

Private