X7ROOT File Manager
Current Path:
/usr/libexec/webmin/nis
usr
/
libexec
/
webmin
/
nis
/
📁
..
📄
CHANGELOG
(308 B)
📄
aix-lib.pl
(9.79 KB)
📄
backup_config.pl
(817 B)
📄
build.cgi
(162 B)
📄
coherent-linux-lib.pl
(10.4 KB)
📄
config-aix
(181 B)
📄
config-coherent-linux
(116 B)
📄
config-debian-linux
(120 B)
📄
config-generic-linux
(116 B)
📄
config-mandrake-linux
(116 B)
📄
config-msc-linux
(116 B)
📄
config-open-linux
(117 B)
📄
config-openmamba-linux
(116 B)
📄
config-redhat-linux
(116 B)
📄
config-slackware-linux
(116 B)
📄
config-solaris
(167 B)
📄
config-solaris-8-ALL
(199 B)
📄
config-suse-linux
(116 B)
📄
config-trustix-linux
(116 B)
📄
config-united-linux
(116 B)
📄
config.info
(282 B)
📄
config.info.ca
(320 B)
📄
config.info.cs
(321 B)
📄
config.info.de
(321 B)
📄
config.info.es
(277 B)
📄
config.info.fr
(350 B)
📄
config.info.hu
(0 B)
📄
config.info.nl
(290 B)
📄
config.info.no
(297 B)
📄
config.info.pl
(309 B)
📄
config.info.ru
(491 B)
📄
config.info.sv
(132 B)
📄
config.info.uk
(500 B)
📄
debian-linux-lib.pl
(10.19 KB)
📄
edit_aliases.cgi
(1.2 KB)
📄
edit_client.cgi
(1.41 KB)
📄
edit_ethers.cgi
(1.14 KB)
📄
edit_group.cgi
(1.81 KB)
📄
edit_group_shadow.cgi
(1.83 KB)
📄
edit_hosts.cgi
(1.31 KB)
📄
edit_netgroup.cgi
(2.01 KB)
📄
edit_netmasks.cgi
(1.16 KB)
📄
edit_networks.cgi
(1.35 KB)
📄
edit_passwd.cgi
(4.8 KB)
📄
edit_passwd_shadow.cgi
(4.8 KB)
📄
edit_passwd_shadow_full.cgi
(4.8 KB)
📄
edit_protocols.cgi
(1.35 KB)
📄
edit_rpc.cgi
(1.3 KB)
📄
edit_security.cgi
(1.92 KB)
📄
edit_server.cgi
(607 B)
📄
edit_services.cgi
(1.52 KB)
📄
edit_services2.cgi
(1.53 KB)
📄
edit_switch.cgi
(1.74 KB)
📄
edit_tables.cgi
(6.24 KB)
📄
feedback_files.pl
(157 B)
📁
images
📄
index.cgi
(776 B)
📁
lang
📄
linux-lib.pl
(5.27 KB)
📄
list_switches.cgi
(772 B)
📄
mandrake-linux-lib.pl
(10.38 KB)
📄
md5-lib.pl
(7.44 KB)
📄
module.info
(346 B)
📄
module.info.af
(0 B)
📄
module.info.af.auto
(167 B)
📄
module.info.ar
(0 B)
📄
module.info.ar.auto
(195 B)
📄
module.info.be
(0 B)
📄
module.info.be.auto
(287 B)
📄
module.info.bg
(0 B)
📄
module.info.bg.auto
(250 B)
📄
module.info.ca
(163 B)
📄
module.info.ca.auto
(12 B)
📄
module.info.cs
(28 B)
📄
module.info.cs.auto
(145 B)
📄
module.info.da
(0 B)
📄
module.info.da.auto
(154 B)
📄
module.info.de
(136 B)
📄
module.info.de.auto
(12 B)
📄
module.info.el
(0 B)
📄
module.info.el.auto
(235 B)
📄
module.info.es
(31 B)
📄
module.info.es.auto
(138 B)
📄
module.info.eu
(0 B)
📄
module.info.eu.auto
(164 B)
📄
module.info.fa
(0 B)
📄
module.info.fa.auto
(248 B)
📄
module.info.fi
(0 B)
📄
module.info.fi.auto
(158 B)
📄
module.info.fr
(30 B)
📄
module.info.fr.auto
(141 B)
📄
module.info.he
(0 B)
📄
module.info.he.auto
(170 B)
📄
module.info.hr
(0 B)
📄
module.info.hr.auto
(171 B)
📄
module.info.hu
(34 B)
📄
module.info.hu.auto
(147 B)
📄
module.info.it
(0 B)
📄
module.info.it.auto
(152 B)
📄
module.info.ja
(49 B)
📄
module.info.ja.auto
(226 B)
📄
module.info.ko
(39 B)
📄
module.info.ko.auto
(154 B)
📄
module.info.lt
(0 B)
📄
module.info.lt.auto
(169 B)
📄
module.info.lv
(0 B)
📄
module.info.lv.auto
(169 B)
📄
module.info.ms
(149 B)
📄
module.info.ms.auto
(12 B)
📄
module.info.mt
(0 B)
📄
module.info.mt.auto
(144 B)
📄
module.info.nl
(30 B)
📄
module.info.nl.auto
(130 B)
📄
module.info.no
(29 B)
📄
module.info.no.auto
(117 B)
📄
module.info.pl
(107 B)
📄
module.info.pl.auto
(12 B)
📄
module.info.pt
(0 B)
📄
module.info.pt.auto
(164 B)
📄
module.info.pt_BR
(0 B)
📄
module.info.pt_BR.auto
(173 B)
📄
module.info.ro
(0 B)
📄
module.info.ro.auto
(156 B)
📄
module.info.ru
(41 B)
📄
module.info.ru.auto
(246 B)
📄
module.info.sk
(0 B)
📄
module.info.sk.auto
(165 B)
📄
module.info.sl
(0 B)
📄
module.info.sl.auto
(165 B)
📄
module.info.sv
(31 B)
📄
module.info.sv.auto
(123 B)
📄
module.info.th
(0 B)
📄
module.info.th.auto
(347 B)
📄
module.info.tr
(0 B)
📄
module.info.tr.auto
(169 B)
📄
module.info.uk
(0 B)
📄
module.info.uk.auto
(247 B)
📄
module.info.ur
(0 B)
📄
module.info.ur.auto
(244 B)
📄
module.info.vi
(0 B)
📄
module.info.vi.auto
(217 B)
📄
module.info.zh
(34 B)
📄
module.info.zh.auto
(120 B)
📄
module.info.zh_TW
(37 B)
📄
module.info.zh_TW.auto
(126 B)
📄
msc-linux-lib.pl
(10.38 KB)
📄
nis-lib.pl
(6.02 KB)
📄
nisupdate.conf
(1.94 KB)
📄
old_edit_passwd_shadow.cgi
(4.62 KB)
📄
old_edit_switch.cgi
(1.76 KB)
📄
old_save_switch.cgi
(533 B)
📄
open-linux-lib.pl
(7.89 KB)
📄
openmamba-linux-lib.pl
(10.38 KB)
📄
redhat-linux-lib.pl
(10.38 KB)
📄
save_aliases.cgi
(749 B)
📄
save_client.cgi
(661 B)
📄
save_ethers.cgi
(793 B)
📄
save_file.cgi
(588 B)
📄
save_group.cgi
(945 B)
📄
save_group_shadow.cgi
(1.04 KB)
📄
save_hosts.cgi
(758 B)
📄
save_netgroup.cgi
(1.04 KB)
📄
save_netmasks.cgi
(753 B)
📄
save_networks.cgi
(791 B)
📄
save_passwd_shadow.cgi
(2.36 KB)
📄
save_protocols.cgi
(806 B)
📄
save_rpc.cgi
(746 B)
📄
save_security.cgi
(996 B)
📄
save_server.cgi
(184 B)
📄
save_services.cgi
(775 B)
📄
save_services2.cgi
(776 B)
📄
save_switch.cgi
(932 B)
📄
slackware-linux-lib.pl
(9.91 KB)
📄
solaris-lib.pl
(10.45 KB)
📄
suse-linux-8.2-lib.pl
(11.05 KB)
📄
suse-linux-9.0-lib.pl
(11.05 KB)
📄
suse-linux-lib.pl
(11.88 KB)
📄
switch-lib.pl
(3.08 KB)
📄
trustix-linux-lib.pl
(10.38 KB)
📄
united-linux-lib.pl
(11.05 KB)
Editing: nis-lib.pl
# nis-lib.pl # Common functions for NIS client and server management BEGIN { push(@INC, ".."); }; use WebminCore; &init_config(); if (-r "$module_root_directory/$gconfig{'os_type'}-$gconfig{'os_version'}-lib.pl") { do "$gconfig{'os_type'}-$gconfig{'os_version'}-lib.pl"; } else { do "$gconfig{'os_type'}-lib.pl"; } if ($gconfig{'os_type'} =~ /-linux$/) { do "linux-lib.pl"; } &foreign_require("init", "init-lib.pl"); # init_script(action) # Returns the full path to some init script sub init_script { local %iconfig = &foreign_config("init"); return "$iconfig{'init_dir'}/$_[0]"; } # get_nsswitch_conf() # Parses lines of nsswitch.conf into an array sub get_nsswitch_conf { local @rv; open(SWITCH, "<".$config{'nsswitch_conf'}); while(<SWITCH>) { s/\r|\n//g; s/#.*$//g; if (/^\s*(\S+):\s*(.*)/) { local $sw = { 'service' => $1, 'order' => $2 }; push(@rv, $sw); } } close(SWITCH); return @rv; } # save_nsswitch(service, order) # Updates the line for some service in nsswitch.conf sub save_nsswitch { local $lref = &read_file_lines($config{'nsswitch_conf'}); foreach $l (@$lref) { if ($l =~ /^\s*(\S+):/ && $1 eq $_[0]) { $l = "$_[0]:\t$_[1]"; last; } } } # table_edit_setup(table, line, splitter) # Returns &table, &lnums, line1, line2, ... sub table_edit_setup { local @tables = &list_nis_tables(); local $t = $tables[$_[0]]; return ( $t ) if (!defined($_[1])); local @lnums = ( $_[1] ); local $lref = &read_file_lines($t->{'files'}->[0]); local @lines = ( [ split($_[2], $lref->[$_[1]]) ] ); local $i; for($i=1; $t->{'files'}->[$i]; $i++) { local $lref2 = &read_file_lines($t->{'files'}->[$i]); local $lnum = 0; foreach $l (@$lref2) { local @line2 = split($_[2], $l); if ($line2[0] eq $lines[0]->[0]) { push(@lnums, $lnum); push(@lines, \@line2); last; } $lnum++; } } return ($t, \@lnums, @lines); } # table_add(&table, separator, &record, ...) # Adds a record to an NIS table sub table_add { local $i = 2; foreach $f (@{$_[0]->{'files'}}) { local $lref = &read_file_lines($f); push(@$lref, join($_[1], @{$_[$i++]})); } &flush_file_lines(); } # table_delete(&table, &lnums) # Delete a record from an NIS table sub table_delete { local $i = 0; foreach $f (@{$_[0]->{'files'}}) { local $lref = &read_file_lines($f); splice(@$lref, $_[1]->[$i], 1); $i++; } &flush_file_lines(); } # table_update(&table, &lnums, separator, &record, ...) # Modify a record in an NIS table sub table_update { local $i = 0; foreach $f (@{$_[0]->{'files'}}) { local $lref = &read_file_lines($f); splice(@$lref, $_[1]->[$i], 1, join($_[2], @{$_[$i+3]})); $i++; } &flush_file_lines(); } # date_input(day, month, year, prefix) sub date_input { print "<input name=$_[3]d size=3 value='$_[0]'>"; print "/<select name=$_[3]m>\n"; local $m; foreach $m (1..12) { printf "<option value=%d %s>%s</option>\n", $m, $_[1] eq $m ? 'selected' : '', $text{"smonth_$m"}; } print "</select>"; print "/<input name=$_[3]y size=5 value='$_[2]'>"; print &date_chooser_button("$_[3]d", "$_[3]m", "$_[3]y"); } # parse_ypserv_conf() # Returns &opts, &maps sub parse_ypserv_conf { local (%opts, @hosts); local $lnum = 0; open(CONF, "<".$ypserv_conf); while(<CONF>) { s/\r|\n//g; s/#.*$//; if (/^\s*([^:\s]+):\s*(yes|no)/) { # Found an option $opts{$1} = { 'name' => $1, 'value' => $2 eq 'yes' ? 1 : 0, 'line' => $lnum }; } elsif (/^\s*([^:\s]+)\s*:\s*([^:\s]+)\s*:\s*([^:\s]+)\s*:\s*(none|port|mangle|deny)(\/mangle(:(\d+))?)?/) { # Found a host and domain line (new format) push(@hosts, { 'host' => $1, 'domain' => $2, 'map' => $3, 'sec' => $4, 'mangle' => $5 ? 1 : 0, 'field' => $7, 'line' => $lnum } ); } elsif (/^\s*([^:\s]+)\s*:\s*([^:\s]+)\s*:\s*([^:\s]+)(\s*:\s*([^:\s]+))?(\s*:\s*([^:\s]+))?/) { # Found a host line (old format) push(@hosts, { 'host' => $1, 'map' => $2, 'sec' => $3, 'mangle' => $5 eq 'yes' ? 1 : 0, 'field' => $7 eq '' ? 2 : $7, 'line' => $lnum } ); } $lnum++; } close(CONF); return (\%opts, \@hosts); } # parse_yp_makefile() # Returns hashes of makefile variables and rules sub parse_yp_makefile { # First parse joined lines local $lnum = 0; local (@lines, $llast); open(MAKE, "<".$yp_makefile); while(<MAKE>) { s/\r|\n//g; local $slash = (s/\\$//); s/#.*$//; if ($llast) { $llast->{'value'} .= " $_"; $llast->{'eline'} = $lnum; } else { push(@lines, { 'value' => $_, 'line' => $lnum, 'eline' => $lnum }); } $llast = $slash ? $lines[$#lines] : undef; $lnum++; } close(MAKE); # Then look for variables and rules local ($i, %var, %rule); for($i=0; $i<@lines; $i++) { if ($lines[$i]->{'value'} =~ /^\s*(\S+)\s*=\s*(.*)/) { # Found a variable $var{$1} = { 'name' => $1, 'value' => $2, 'type' => 0, 'line' => $lines[$i]->{'line'}, 'eline' => $lines[$i]->{'eline'} }; } elsif ($lines[$i]->{'value'} =~ /^\s*(\S+)\s*\+=\s*(.*)/) { # Adding to a variable if ($var{$1}) { $var{$1}->{'value'} .= ' '.$2; } } elsif ($lines[$i]->{'value'} =~ /^\s*(\S+):\s*(.*)/) { # Found a makefile rule $rule{$1} = { 'name' => $1, 'value' => $2, 'type' => 1, 'line' => $lines[$i]->{'line'}, 'eline' => $lines[$i]->{'eline'} }; if ($lines[$i+1]->{'value'} =~ /^\s+/) { $rule{$1}->{'code'} = $lines[$i+1]->{'value'}; $rule{$1}->{'eline'} = $lines[$i+1]->{'eline'}; $i++; } } } return ( \%var, \%rule ); } # expand_vars(string, &vars) sub expand_vars { local $rv = $_[0]; while($rv =~ /^(.*)\$\(([A-Za-z0-9_]+)\)(.*)$/) { # if (substr($_[1]->{$2}->{'value'}, 0, 7) eq '$(shell') { # $rv = $1."\0(".$2.")".$3; # } # else { $rv = $1.$_[1]->{$2}->{'value'}.$3; # } } #$rv =~ s/\0/\$/g; return $rv; } # update_makefile(&old, value, [value]); sub update_makefile { local $lref = &read_file_lines($yp_makefile); local @n; if ($_[0]->{'type'} == 0) { @n = ( "$_[0]->{'name'} = $_[1]" ); } else { @n = ( "$_[0]->{'name'}: $_[1]", $_[2] ); } splice(@$lref, $_[0]->{'line'}, $_[0]->{'eline'} - $_[0]->{'line'} + 1, @n); } 1;
Upload File
Create Folder