diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-12-02 20:41:44 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-12-02 20:41:44 +0000 |
commit | 9519d51eb29b0a5881bc859e1c2b9b3b3a8abfa6 (patch) | |
tree | 61aeae2581a101186add4569667ddac27876bd0e /perl-install/network | |
parent | 5ea5e381f9840d127fe444d8eecf34be4c45d0e6 (diff) | |
download | drakx-9519d51eb29b0a5881bc859e1c2b9b3b3a8abfa6.tar drakx-9519d51eb29b0a5881bc859e1c2b9b3b3a8abfa6.tar.gz drakx-9519d51eb29b0a5881bc859e1c2b9b3b3a8abfa6.tar.bz2 drakx-9519d51eb29b0a5881bc859e1c2b9b3b3a8abfa6.tar.xz drakx-9519d51eb29b0a5881bc859e1c2b9b3b3a8abfa6.zip |
use output_with_perm()
Diffstat (limited to 'perl-install/network')
-rw-r--r-- | perl-install/network/isdn.pm | 5 | ||||
-rw-r--r-- | perl-install/network/netconnect.pm | 28 | ||||
-rw-r--r-- | perl-install/network/smb.pm | 3 | ||||
-rw-r--r-- | perl-install/network/tools.pm | 7 |
4 files changed, 16 insertions, 27 deletions
diff --git a/perl-install/network/isdn.pm b/perl-install/network/isdn.pm index b485c2e1c..be13b4021 100644 --- a/perl-install/network/isdn.pm +++ b/perl-install/network/isdn.pm @@ -100,8 +100,7 @@ sub isdn_write_config_backend { symlinkf("isdn" . $bundle . ".conf", "$prefix/etc/isdn/isdnctrl.conf"); symlinkf("ioptions" . $bundle, "$prefix/etc/ppp/ioptions"); } else { - my $f = "$prefix/etc/isdn/profile/link/myisp"; - output($f, + output_with_perm("$prefix/etc/isdn/profile/link/myisp", 0600, qq( I4L_USERNAME="$isdn->{login}" I4L_SYSNAME="" @@ -110,8 +109,6 @@ I4L_REMOTE_OUT="$isdn->{phone_out}" I4L_DIALMODE="$isdn->{dialing_mode}" ) . if_($isdn->{speed} =~ /128/, 'SLAVE="ippp1" ')); - chmod 0600, $f; - output "$prefix/etc/isdn/profile/card/mycard", qq( I4L_MODULE="$isdn->{driver}" diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index f0ebedfc9..8f9b83136 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -138,16 +138,14 @@ sub main { Click on Ok to keep your configuration, or cancel to reconfigure your Internet & Network connection. "), 1)) and do { $netcnx->{type} = 'lan'; - output "$prefix$connect_file", + output_with_perm("$prefix$connect_file", 0755, qq( ifup eth0 -); - output "$prefix$disconnect_file", +)); + output("$prefix$disconnect_file", 0755, qq( ifdown eth0 -); - chmod 0755, "$prefix$disconnect_file"; - chmod 0755, "$prefix$connect_file"; +)); $direct_net_install = 1; goto step_5; }; @@ -283,9 +281,9 @@ Test your connection via net_monitor or mcc. If your connection doesn't work, yo $network_configured or network::configureNetwork2($in, $prefix, $netc, $intf); + my $connect_cmd; if ($netcnx->{type} =~ /modem/ || $netcnx->{type} =~ /isdn_external/) { - output "$prefix$connect_prog", - qq( + $connect_cmd = qq( #!/bin/bash if [ -n "\$DISPLAY" ]; then if [ -e /usr/bin/kppp ]; then @@ -299,8 +297,7 @@ $connect_file fi ); } elsif ($netcnx->{type}) { - output "$prefix$connect_prog", - qq( + $connect_cmd = qq( #!/bin/bash if [ -n "\$DISPLAY" ]; then /usr/sbin/net_monitor --connect @@ -309,15 +306,13 @@ $connect_file fi ); } else { - output "$prefix$connect_prog", - qq( + $connect_cmd = qq( #!/bin/bash /usr/sbin/drakconnect ); } if ($direct_net_install) { - output "$prefix$connect_prog", - qq( + $connect_cmd = qq( #!/bin/bash if [ -n "\$DISPLAY" ]; then /usr/sbin/net_monitor --connect @@ -326,7 +321,7 @@ $connect_file fi ); } - chmod 0755, "$prefix$connect_prog"; + output_with_perm("$prefix$connect_prog", 0755, $connect_cmd) if $connect_cmd; $netcnx->{$_} = $netc->{$_} foreach qw(NET_DEVICE NET_INTERFACE); $netcnx->{NET_INTERFACE} and set_net_conf($netcnx, $netc); @@ -354,7 +349,7 @@ sub save_conf { $intf = { %$intf }; - output("$prefix/etc/sysconfig/network-scripts/drakconnect_conf", + output_with_perm("$prefix/etc/sysconfig/network-scripts/drakconnect_conf", 0600, "SystemName=" . do { $netc->{HOSTNAME} =~ /([^\.]*)\./; $1 } . " DomainName=" . do { $netc->{HOSTNAME} =~ /\.(.*)/; $1 } . " InternetAccessType=" . do { if ($netcnx->{type}) { $netcnx->{type} } else { $netc->{GATEWAY} ? "lan" : "" } } . " @@ -430,7 +425,6 @@ ADSLLogin=$adsl->{login} ADSLPassword=$adsl->{passwd} DOMAINNAME2=$netc->{DOMAINNAME2}" ); - chmod 0600, "$prefix/etc/sysconfig/network-scripts/drakconnect_conf"; my $a = $netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default"; cp_af("$prefix/etc/sysconfig/network-scripts/drakconnect_conf", "$prefix/etc/sysconfig/network-scripts/drakconnect_conf." . $a); chmod 0600, "$prefix/etc/sysconfig/network-scripts/drakconnect_conf"; diff --git a/perl-install/network/smb.pm b/perl-install/network/smb.pm index 06bd70609..e3dfc9ce6 100644 --- a/perl-install/network/smb.pm +++ b/perl-install/network/smb.pm @@ -131,8 +131,7 @@ sub remove_bad_credentials { sub save_credentials { my ($credentials) = @_; my $file = $credentials->{file}; - output_p("$::prefix$file", map { "$_ = $credentials->{$_}\n" } qw(username domain password)); - chmod(0640, "$::prefix$file"); + output_with_perm("$::prefix$file", 0640, map { "$_ = $credentials->{$_}\n" } qw(username domain password)); } diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index 55c8b8a89..48809e8ef 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -18,11 +18,10 @@ sub write_cnx_script { $netc->{internet_cnx}{$type}{type} = $type2; } else { foreach ($connect_file, $disconnect_file) { - output("$prefix$_", + output_with_perm("$prefix$_", 0755, '#!/bin/bash ' . if_(!$netc->{at_boot}, 'if [ "x$1" == "x--boot_time" ]; then exit; fi ') . $netc->{internet_cnx}{$netc->{internet_cnx_choice}}{$_}); - chmod 0755, "$prefix$_"; } } } @@ -223,7 +222,8 @@ sub disconnected {} sub write_initscript { - output("$prefix/etc/rc.d/init.d/internet", sprintf(<<'EOF', $connect_file, $connect_file, $disconnect_file, $disconnect_file)); + output_with_perm("$prefix/etc/rc.d/init.d/internet", 0755, + sprintf(<<'EOF', $connect_file, $connect_file, $disconnect_file, $disconnect_file)); #!/bin/bash # # internet Bring up/down internet connection @@ -267,7 +267,6 @@ sub write_initscript { esac exit 0 EOF - chmod 0755, "$prefix/etc/rc.d/init.d/internet"; $::isStandalone ? system("/sbin/chkconfig --add internet") : do { symlinkf("../init.d/internet", "$prefix/etc/rc.d/rc$_") foreach '0.d/K11internet', '1.d/K11internet', '2.d/K11internet', '3.d/S89internet', '5.d/S89internet', '6.d/K11internet'; |