From 318d275f52251797be260e14e9ebb1cf54048088 Mon Sep 17 00:00:00 2001 From: bde Date: Thu, 12 Sep 1996 03:42:54 +0000 Subject: Use `install -C' instead of lots of shell commands to install ld.so as atomically as possible. (Immutable targets can't be renamed without opening a window when neither the source nor the target is immutable. Perhaps there should be a rename_immutable syscall to do this if unsetting the immutable flags would work.) --- libexec/rtld-aout/Makefile | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'libexec/rtld-aout/Makefile') diff --git a/libexec/rtld-aout/Makefile b/libexec/rtld-aout/Makefile index 7fc09fc..414e18c 100644 --- a/libexec/rtld-aout/Makefile +++ b/libexec/rtld-aout/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.18 1996/01/11 17:49:55 phk Exp $ +# $Id: Makefile,v 1.19 1996/05/07 23:15:58 wosch Exp $ PROG= ld.so SRCS= mdprologue.S rtld.c malloc.c shlib.c etc.c md.c @@ -11,6 +11,7 @@ ASFLAGS+=-k DPADD+= ${LIBC:S/c.a/c_pic.a/} ${LIBC:S/c.a/gcc_pic.a/} LDADD+= -lc_pic -lgcc_pic BINDIR= /usr/libexec +INSTALLFLAGS+= -fschg -C # -C to install as atomically as possible MLINKS= rtld.1 ld.so.1 .PATH: $(LDDIR) $(LDDIR)/$(MACHINE) @@ -18,16 +19,4 @@ MLINKS= rtld.1 ld.so.1 $(PROG): ${OBJS} ${DPADD} $(LD) -o $(PROG) $(LDFLAGS) $(OBJS) $(LDADD) -realinstall: - ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - ${INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROG}.new - test -f ${DESTDIR}${BINDIR}/${PROG}.old && \ - chflags noschg ${DESTDIR}${BINDIR}/${PROG}.old || \ - : - -chflags noschg ${DESTDIR}${BINDIR}/${PROG} - -ln -f ${DESTDIR}${BINDIR}/${PROG} ${DESTDIR}${BINDIR}/${PROG}.old - mv -f ${DESTDIR}${BINDIR}/${PROG}.new ${DESTDIR}${BINDIR}/${PROG} - chflags schg ${DESTDIR}${BINDIR}/${PROG} - -rm -f ${DESTDIR}${BINDIR}/${PROG}.old - .include -- cgit v1.1