mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-29 04:21:26 +01:00
Install ld.so in a way that is safe even on a running system.
This commit is contained in:
parent
c8975f103d
commit
d1b95a21ba
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile,v 1.14 1995/03/04 17:46:23 nate Exp $
|
||||
# $Id: Makefile,v 1.15 1995/08/26 13:17:39 joerg Exp $
|
||||
|
||||
PROG= ld.so
|
||||
SRCS= mdprologue.S rtld.c malloc.c shlib.c etc.c md.c
|
||||
@ -11,7 +11,6 @@ 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
|
||||
MLINKS= rtld.1 ld.so.1
|
||||
|
||||
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
|
||||
@ -19,4 +18,16 @@ 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 ${DESTDIR}${BINDIR}/${PROG}.new ${DESTDIR}${BINDIR}/${PROG}
|
||||
chflags schg ${DESTDIR}${BINDIR}/${PROG}
|
||||
rm ${DESTDIR}${BINDIR}/${PROG}.old
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $Id: Makefile,v 1.14 1995/03/04 17:46:23 nate Exp $
|
||||
# $Id: Makefile,v 1.15 1995/08/26 13:17:39 joerg Exp $
|
||||
|
||||
PROG= ld.so
|
||||
SRCS= mdprologue.S rtld.c malloc.c shlib.c etc.c md.c
|
||||
@ -11,7 +11,6 @@ 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
|
||||
MLINKS= rtld.1 ld.so.1
|
||||
|
||||
.PATH: $(LDDIR) $(LDDIR)/$(MACHINE)
|
||||
@ -19,4 +18,16 @@ 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 ${DESTDIR}${BINDIR}/${PROG}.new ${DESTDIR}${BINDIR}/${PROG}
|
||||
chflags schg ${DESTDIR}${BINDIR}/${PROG}
|
||||
rm ${DESTDIR}${BINDIR}/${PROG}.old
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
Loading…
Reference in New Issue
Block a user