From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,6b04f5359af5c957 X-Google-Attributes: gidfee84,public From: richardw@tiger.xs4all.nl (Richard Westerik) Subject: Re: Overwriting exe's crashes osf programs ? Why Date: 1996/02/25 Message-ID: <022596214534Rnf0.79b5@tiger.xs4all.nl>#1/1 X-Deja-AN: 141110719 distribution: world references: <4gie5u$ngn@lal.interserv.net> <4giut5$rvv@zk2nws.zko.dec.com> <022396184941Rnf0.79b5@tiger.xs4all.nl> <4gomj2$t3r@news.service.uci.edu> organization: The Tiger at home, The Netherlands newsgroups: comp.unix.osf.osf1 iglesias@draco.acs.uci.edu (Mike Iglesias) writes: >In article <022396184941Rnf0.79b5@tiger.xs4all.nl>, >Richard Westerik wrote: >>I disagree. It's not "just" cc or ld that can cause a situation like this. >>A customer of ours was once badly bitten by this 'feature' of Digital >>Unix. He tried to restore (part of?) /usr while running the restore from >>a 'dxterm' under X11. >One should use caution when restoring /usr (or files in / for that matter) >while the system is up. In fact, it's probably better to do it single >user. Of course, I know that, but the customer didn't (he never read the manual). What I meant was, if it is something the system cannot handle (like Digital UNIX obviously cannot) it should *prevent* users from "accidentally" doing it. Most Unix systems on the market today either (a) give ETXTBSY and do not overwrite the executable OR (b) survive, replacing the executable without apparent side-effects. >>This can happen not only when you try to overwrite an executable with a >>*different* content, but also when the content is going to be exactly the >>same! I've seen this problem on numerous occasions. I consider it to be a >>bug. >So you'd like the OS to compare what it's going to write out with >what's already there? Sounds slow and cpu intensive if you ask me. >If you don't do it in the OS, you'd have to implement it in all the >utilities that write and copy files. No, the OS should simply disallow writing over executables that are in use. It is *simple* to figure out (at open() time) if a file being opened for writing is in use as an executable. The OS could check and give an error message and avoid overwriting. In that case, it wouldn't have to check the contents, which I agree could prove impossible or time-consuming. I merely reacted to someone who stated that it would be "logical" (my wording) to generate "Memory fault - core dumped" by overwriting an executable with a different version. I agree, but wanted to stress it *also* happens when restoring a version with identical content. >SunOS has the same problem with writing over executables while they are >running. OK, that I didn't know (we don't deal a lot with Sun at the company I work for). Some other major vendors don't have this problem, notably AT&T, IBM, HP and SCO. Richard -- .------------------------- Richard M.J. Westerik --------------------------. |\@@@@\ | Private e-mail : richardw@tiger.xs4all.nl OR richardw@xs4all.nl | | \@@@@\ | Business e-mail: richardw@bssi.nl CompuServe: 100120,1136 | | \@@@@\| World wide web : http://www.xs4all.nl/~richardw (not finished) | `------------------- A day not loved is a day not lived -------------------'