-# $OpenBSD: Makefile,v 1.29 2013/12/02 20:41:01 millert Exp $
+# $OpenBSD: Makefile,v 1.30 2015/10/10 00:10:07 deraadt Exp $
PROG= ksh
SRCS= alloc.c c_ksh.c c_sh.c c_test.c c_ulimit.c edit.c emacs.c eval.c \
misc.c path.c shf.c syn.c table.c trap.c tree.c tty.c var.c \
version.c vi.c
+# -DMKNOD - enable builtin mknod; conficts with pledge(2)
DEFS= -Wall
CFLAGS+=${DEFS} -I. -I${.CURDIR} -I${.CURDIR}/../../lib/libc/gen
MAN= ksh.1 sh.1
-/* $OpenBSD: c_sh.c,v 1.49 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: c_sh.c,v 1.50 2015/10/10 00:10:07 deraadt Exp $ */
/*
* built-in Bourne commands
return 0;
}
+#ifdef MKNOD
static int
c_mknod(char **wp)
{
bi_errorf("usage: mknod [-m mode] name p");
return 1;
}
+#endif /* MKNOD */
static int
c_suspend(char **wp)
{"ulimit", c_ulimit},
{"+umask", c_umask},
{"*=unset", c_unset},
+#ifdef MKNOD
{"mknod", c_mknod},
+#endif
{"suspend", c_suspend},
{NULL, NULL}
};
-/* $OpenBSD: main.c,v 1.60 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: main.c,v 1.61 2015/10/10 00:10:07 deraadt Exp $ */
/*
* startup, main loop, environments and error handling
kshname = argv[0];
+#ifndef MKNOD
+ if (pledge("stdio rpath wpath cpath getpw fattr proc exec tty", NULL) == -1)
+ perror("pledge");
+#endif
+
ainit(&aperm); /* initialize permanent Area */
/* set up base environment */
-# $OpenBSD: Makefile,v 1.1 2014/12/23 17:16:02 deraadt Exp $
+# $OpenBSD: Makefile,v 1.2 2015/10/10 00:10:07 deraadt Exp $
PROG= ksh
SRCS= alloc.c c_ksh.c c_sh.c c_test.c c_ulimit.c edit.c emacs.c eval.c \
misc.c path.c shf.c syn.c table.c trap.c tree.c tty.c var.c \
version.c vi.c
-DEFS= -Wall
+DEFS= -Wall -DMKNOD
CFLAGS+=${DEFS} -I. -I${.CURDIR}/../../../bin/ksh -I${.CURDIR}/../../../lib/libc/gen
MAN= ksh.1 sh.1