MOON
Server: Apache
System: Linux cl1170g 4.19.62-mod-std-ipv6-64-rescue #828825 SMP Tue Jul 30 13:54:49 UTC 2019 x86_64
User: wh0f20bb (1057)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //proc/thread-self/root/root/webmin-1.740/nis/save_aliases.cgi
#!/usr/bin/perl
# save_aliases.cgi
# Create, update or delete an alias

require './nis-lib.pl';
&ReadParse();

($t, $lnums, $alias) = &table_edit_setup($in{'table'}, $in{'line'}, '[\s:]+');
if ($in{'delete'}) {
	# Just delete the alias
	&table_delete($t, $lnums);
	}
else {
	# Validate inputs and save the alias
	&error_setup($text{'aliases_err'});
	$in{'from'} =~ /^[^:@ ]+$/ || &error($text{'aliases_efrom'});
	@to = split(/\s+/, $in{'to'});
	@to || &error($text{'aliases_eto'});
	@alias = ( $in{'from'}, join(",", @to) );
	if ($in{'line'} eq '') {
		&table_add($t, ":", \@alias);
		}
	else {
		&table_update($t, $lnums, ":", \@alias);
		}
	}
&apply_table_changes() if (!$config{'manual_build'});
&redirect("edit_tables.cgi?table=$in{'table'}");