mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
Tweak a couple of utilities so they compile cleanly for /rescue. Mostly
path fixes. Submitted by: Tim Kientzle <kientzle@acm.org>
This commit is contained in:
parent
884c25d15a
commit
6d1b4a4730
@ -10,7 +10,11 @@ TCSHDIR= ${.CURDIR}/../../contrib/tcsh
|
||||
.PATH: ${TCSHDIR}
|
||||
|
||||
PROG= csh
|
||||
.if defined(RESCUE)
|
||||
DFLAGS= -D_PATH_TCSHELL='"/rescue/${PROG}"'
|
||||
.else
|
||||
DFLAGS= -D_PATH_TCSHELL='"/bin/${PROG}"'
|
||||
.endif
|
||||
CFLAGS+= -I. -I${.CURDIR} -I${TCSHDIR} ${DFLAGS}
|
||||
WARNS= 2
|
||||
SRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c sh.char.c \
|
||||
|
@ -103,6 +103,10 @@ extern int h_errno;
|
||||
#define SOCKLEN_T int
|
||||
#endif
|
||||
|
||||
#ifdef RESCUE
|
||||
#define _PATH_DHCLIENT_SCRIPT "/rescue/dhclient-script"
|
||||
#endif
|
||||
|
||||
#if defined (USE_DEFAULT_NETWORK)
|
||||
# define USE_BPF
|
||||
#endif
|
||||
@ -113,6 +117,9 @@ extern int h_errno;
|
||||
#endif /* HAVE_DEV_RANDOM */
|
||||
|
||||
const char *cmds[] = {
|
||||
#ifndef RESCUE
|
||||
/* rescue environment can't rely on these ... */
|
||||
/* Actually, /sbin/dhclient shouldn't use these, either. */
|
||||
"/bin/ps -axlw 2>&1",
|
||||
"/usr/sbin/arp -an 2>&1",
|
||||
"/usr/bin/netstat -an 2>&1",
|
||||
@ -123,10 +130,12 @@ const char *cmds[] = {
|
||||
"/usr/sbin/iostat 2>&1",
|
||||
"/usr/bin/vmstat 2>&1",
|
||||
"/usr/bin/w 2>&1",
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *dirs[] = {
|
||||
#ifndef RESCUE
|
||||
"/tmp",
|
||||
"/usr/tmp",
|
||||
".",
|
||||
@ -136,13 +145,16 @@ const char *dirs[] = {
|
||||
"/var/mail",
|
||||
"/home",
|
||||
"/usr/home",
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *files[] = {
|
||||
#ifndef RESCUE
|
||||
"/var/log/messages",
|
||||
"/var/log/wtmp",
|
||||
"/var/log/lastlog",
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
#endif /* NEED_PRAND_CONF */
|
||||
|
@ -52,8 +52,9 @@ OBJS+= dhcpctl/dhcpctl.o dhcpctl/callback.o dhcpctl/remote.o
|
||||
# though, so we must run ``make all'' instead when we are asked to
|
||||
# generate an individual object file.
|
||||
|
||||
# Note: Must have some commands here to override the default build action
|
||||
${OBJS}: all
|
||||
|
||||
@true
|
||||
.endif
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
@ -8,7 +8,12 @@ DIST_DIR= ${.CURDIR}/../../../contrib/isc-dhcp
|
||||
PROG= dhclient
|
||||
SRCS= clparse.c dhclient.c
|
||||
|
||||
CFLAGS+= -DCLIENT_PATH='"PATH=/sbin:/bin:/usr/sbin:/usr/bin"' -Dwarn=dhcp_warn
|
||||
.if defined(RESCUE)
|
||||
CFLAGS+= -DCLIENT_PATH='"PATH=/rescue:/sbin:/bin:/usr/sbin:/usr/bin"'
|
||||
.else
|
||||
CFLAGS+= -DCLIENT_PATH='"PATH=/sbin:/bin:/usr/sbin:/usr/bin"'
|
||||
.endif
|
||||
CFLAGS+= -Dwarn=dhcp_warn
|
||||
|
||||
DPADD= ${LIBDHCP} ${LIBRES} ${LIBOMAPI} ${LIBDST}
|
||||
LDADD= ${LIBDHCP} ${LIBRES} ${LIBOMAPI} ${LIBDST}
|
||||
|
Loading…
Reference in New Issue
Block a user