Diffstat (limited to 'noncore/settings/networksettings2/network') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/network_NNI.cpp | 47 | ||||
-rw-r--r-- | noncore/settings/networksettings2/network/networkrun.cpp | 4 |
2 files changed, 36 insertions, 15 deletions
diff --git a/noncore/settings/networksettings2/network/network_NNI.cpp b/noncore/settings/networksettings2/network/network_NNI.cpp index 054385a..3e368a2 100644 --- a/noncore/settings/networksettings2/network/network_NNI.cpp +++ b/noncore/settings/networksettings2/network/network_NNI.cpp | |||
@@ -110,21 +110,42 @@ bool ANetwork::generateDataForCommonFile( SystemFile & S, long DevNr ) { | |||
110 | // we can safely call from here since device item is deeper | 110 | // we can safely call from here since device item is deeper |
111 | if( Data.UseDHCP ) { | 111 | if( Data.UseDHCP ) { |
112 | S << "iface " << NIC << "-c" << connection()->number() << | 112 | S << "iface " |
113 | "-allowed inet dhcp" << endl; | 113 | << NIC |
114 | S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() << | 114 | << "-c" |
115 | ".up" << Data.IPAddress << endl; | 115 | << connection()->number() |
116 | << "-allowed inet dhcp" | ||
117 | << endl; | ||
118 | S << " up echo \"" | ||
119 | << NIC | ||
120 | << "\" > /tmp/profile-" | ||
121 | << connection()->number() | ||
122 | << ".up" | ||
123 | << endl; | ||
116 | if( Data.SendHostname ) { | 124 | if( Data.SendHostname ) { |
117 | S << " hostname "<< Data.Hostname << endl; | 125 | S << " hostname " |
126 | << Data.Hostname | ||
127 | << endl; | ||
118 | } | 128 | } |
119 | 129 | ||
120 | S << " down rm -f /tmp/profile-" << connection()->number() << | 130 | S << " down rm -f /tmp/profile-" |
121 | ".up" << Data.IPAddress << endl; | 131 | << connection()->number() |
132 | << ".up" | ||
133 | << endl; | ||
122 | } else { | 134 | } else { |
123 | S << "iface " << NIC << "-c" << connection()->number() << | 135 | S << "iface " |
124 | "-allowed inet static" << endl; | 136 | << NIC << "-c" |
125 | S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() << | 137 | << connection()->number() |
126 | ".up" << Data.IPAddress << endl; | 138 | << "-allowed inet static" |
127 | S << " down rm -f /tmp/profile-" << connection()->number() << | 139 | << endl; |
128 | ".up" << Data.IPAddress << endl; | 140 | S << " up echo \"" |
141 | << NIC | ||
142 | << "\" > /tmp/profile-" | ||
143 | << connection()->number() | ||
144 | << ".up" | ||
145 | << endl; | ||
146 | S << " down rm -f /tmp/profile-" | ||
147 | << connection()->number() | ||
148 | << ".up" | ||
149 | << endl; | ||
129 | S << " address " << Data.IPAddress << endl; | 150 | S << " address " << Data.IPAddress << endl; |
130 | S << " broadcast " << Data.Broadcast << endl; | 151 | S << " broadcast " << Data.Broadcast << endl; |
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp index ddb9a5f..c19235a 100644 --- a/noncore/settings/networksettings2/network/networkrun.cpp +++ b/noncore/settings/networksettings2/network/networkrun.cpp | |||
@@ -31,5 +31,5 @@ bool NetworkRun::setState( NodeCollection * NC, Action_t A ) { | |||
31 | II->Name.latin1(), II->Name.latin1(), | 31 | II->Name.latin1(), II->Name.latin1(), |
32 | connection()->number() ); | 32 | connection()->number() ); |
33 | NSResources->system().execute( S ); | 33 | NSResources->system().runAsRoot( S ); |
34 | } | 34 | } |
35 | return 1; | 35 | return 1; |
@@ -40,5 +40,5 @@ bool NetworkRun::setState( NodeCollection * NC, Action_t A ) { | |||
40 | II->Name.latin1(), II->Name.latin1(), | 40 | II->Name.latin1(), II->Name.latin1(), |
41 | connection()->number() ); | 41 | connection()->number() ); |
42 | NSResources->system().execute( S ); | 42 | NSResources->system().runAsRoot( S ); |
43 | } | 43 | } |
44 | return 1; | 44 | return 1; |