Re: Security question: "Text file busy" overwriting executables but not shared libraries?

Jamie Lokier (lk@tantalophile.demon.co.uk)
Sat, 13 Oct 2001 21:05:21 +0200


Pablo Alcaraz wrote:
> Whatever will be the chosen solution, it would have to allow to
> overwrite all the executables and libraries files (if we have enough
> permissions).

Pablo, there's no need for this. Upgrades to libraries are done by
removing the old file's name from its parent directory and placing the
new file at that name, perhaps using an atomic rename. The old _file_
continues to exist even though its name has been deleted, until the last
program using the library finishes using it, even though the old file
does not have a name any more.

New programs that open the library will find the new file. Both files
exist until the old file finally disappears. At no point is any file's
contents overwritten.

This is why you can upgrade a running linux system including critical
system libraries, and nothing crashes. Usually ;-)

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/