191 -install_sh_DATA = $(install_sh) -c -m 644 |
191 -install_sh_DATA = $(install_sh) -c -m 644 |
192 +install_sh_DATA = $(install_sh) -c -m 744 |
192 +install_sh_DATA = $(install_sh) -c -m 744 |
193 install_sh_PROGRAM = $(install_sh) -c |
193 install_sh_PROGRAM = $(install_sh) -c |
194 install_sh_SCRIPT = $(install_sh) -c |
194 install_sh_SCRIPT = $(install_sh) -c |
195 INSTALL_HEADER = $(INSTALL_DATA) |
195 INSTALL_HEADER = $(INSTALL_DATA) |
|
196 diff -r -u /tmp/ibutils-1.5.7/ibdiag/src/ibdebug.tcl ibutils-1.5.7/ibdiag/src/ibdebug.tcl |
|
197 --- /tmp/ibutils-1.5.7/ibdiag/src/ibdebug.tcl Tue Mar 8 03:08:02 2011 |
|
198 +++ ibutils-1.5.7/ibdiag/src/ibdebug.tcl Thu Jun 27 22:46:57 2013 |
|
199 @@ -352,13 +352,16 @@ |
|
200 if {[file exists $ibisOutDir/$ibisLogFile] && (![file writable $ibisOutDir/$ibisLogFile])} { |
|
201 set ibisLogFile $ibisLogFile.[pid] |
|
202 } |
|
203 + |
|
204 + ## Check if the file exists. If it does delete it. The log file is opened with the 'w' access |
|
205 + ## mode which truncates the file to zero length, so the contents are not preserved. Deleting |
|
206 + ## the file prevents any softlink based system file clobbering issues. |
|
207 if {[file exists $ibisOutDir/$ibisLogFile]} { |
|
208 - if {![file writable $ibisOutDir/$ibisLogFile]} { |
|
209 - if {![file writable $ibisOutDir/$ibisLogFile]} { |
|
210 - catch {set ibisLogFd [open $ibisOutDir/$ibisLogFile w]} errMsg |
|
211 - inform "-E-ibis:file.not.writable" -value $ibisOutDir/$ibisLogFile -errMsg $errMsg |
|
212 - } |
|
213 - } |
|
214 + ## Since we have already verified the directory is writable and open with 'w' option |
|
215 + ## truncates the file, it is safe to delete the file if it exists. |
|
216 + if {[catch {file delete $ibisOutDir/$ibisLogFile} errMsg]} { |
|
217 + inform "-E-ibis:could.not.delete.file" -value $ibisOutDir/$ibisLogFile |
|
218 + } |
|
219 } |
|
220 inform "-V-ibis.ibis.log.file" -value $ibisOutDir/$ibisLogFile |
|
221 |
|
222 @@ -5123,6 +5126,16 @@ |
|
223 return 1 |
|
224 } |
|
225 |
|
226 + ## If the file exists delete the file to prevent any symlink |
|
227 + ## system file clobbering. The file is about to be opened with |
|
228 + ## the access mode of 'w', which will truncate the file to zero |
|
229 + ## length anyway. So, it is safe to delete the file now. |
|
230 + if {[file exists $G(outfiles,.db)]} { |
|
231 + if {[catch {file delete $G(outfiles,.db)} errMsg]} { |
|
232 + return 1 |
|
233 + } |
|
234 + } |
|
235 + |
|
236 set FileID [InitializeOutputFile $G(var:tool.name).db] |
|
237 |
|
238 foreach {array_name data} {G data* Neighbor *} { |
|
239 diff -r -u /tmp/ibutils-1.5.7/ibdiag/src/ibdebug_if.tcl ibutils-1.5.7/ibdiag/src/ibdebug_if.tcl |
|
240 --- /tmp/ibutils-1.5.7/ibdiag/src/ibdebug_if.tcl Thu Oct 7 07:29:56 2010 |
|
241 +++ ibutils-1.5.7/ibdiag/src/ibdebug_if.tcl Wed Jun 19 07:43:17 2013 |
|
242 @@ -675,6 +675,16 @@ |
|
243 } |
|
244 |
|
245 ## Command line check - Test5.0: log file |
|
246 + |
|
247 + ## The directory has been verified to be writable, delete the file if it exists since |
|
248 + ## we anyway open it with 'w' which will truncate it to zero length. Deleting the file |
|
249 + ## will prevent symlink based system file clobbering. |
|
250 + if {[file exists $G(outfiles,.log)]} { |
|
251 + if {[catch {file delete $G(outfiles,.log)} errMsg]} { |
|
252 + ## Print the delete failure error message and exit |
|
253 + inform "-E-loading:cannot.delete.file" $G(outfiles,.log) -fn $G(outfiles,.log) -errMsg $errMsg |
|
254 + } |
|
255 + } |
|
256 if {[catch {set G(logFileID) [open $G(outfiles,.log) w]} errMsg]} { |
|
257 inform "-E-loading:cannot.open.file" $G(outfiles,.log) -fn $G(outfiles,.log) -errMsg $errMsg |
|
258 } |
|
259 @@ -1229,6 +1239,10 @@ |
|
260 append msgText "IBIS: The following file is write protected: $msgF(value)%n" |
|
261 append msgText "Error message: \"$msgF(errMsg)\"" |
|
262 } |
|
263 + "-E-ibis:could.not.delete.file" { |
|
264 + append msgText "IBIS: Could not delete the file : $msgF(value)%n" |
|
265 + append msgText "Error message: \"$msgF(errMsg)\"" |
|
266 + } |
|
267 "-V-ibis:ibis_get_local_ports_info" { |
|
268 append msgText "IBIS: ibis_get_local_ports_info:%n$msgF(value)" |
|
269 } |
|
270 @@ -1260,6 +1274,10 @@ |
|
271 append msgText "Failed to load ibdiag external DB from: $msgF(fn)%n" |
|
272 append msgText "Error message: \"$msgF(errMsg)\"" |
|
273 } |
|
274 + "-E-loading:cannot.delete.file" { |
|
275 + append msgText "Could not delete the file : $msgF(fn)%n" |
|
276 + append msgText "Error message: \"$msgF(errMsg)\"" |
|
277 + } |
|
278 "-W-loading:old.osm.version" { |
|
279 append msgText "OSM: The current OSM version is not up-to-date" |
|
280 } |
196 diff -r -u /tmp/ibutils-1.5.7/ibdiag/src/Makefile.in ibutils-1.5.7/ibdiag/src/Makefile.in |
281 diff -r -u /tmp/ibutils-1.5.7/ibdiag/src/Makefile.in ibutils-1.5.7/ibdiag/src/Makefile.in |
197 --- /tmp/ibutils-1.5.7/ibdiag/src/Makefile.in Tue Mar 8 03:09:32 2011 |
282 --- /tmp/ibutils-1.5.7/ibdiag/src/Makefile.in Tue Mar 8 03:09:32 2011 |
198 +++ ibutils-1.5.7/ibdiag/src/Makefile.in Thu Feb 24 16:51:16 2011 |
283 +++ ibutils-1.5.7/ibdiag/src/Makefile.in Thu Feb 24 16:51:16 2011 |
199 @@ -53,7 +53,7 @@ |
284 @@ -53,7 +53,7 @@ |
200 pkglibdir = $(libdir)/@PACKAGE@ |
285 pkglibdir = $(libdir)/@PACKAGE@ |